|
|
@@ -80,35 +80,39 @@ class TestController extends Controller
|
|
|
{
|
|
|
return call_user_func([$this, $method], $request);
|
|
|
}
|
|
|
- public function updateInventory(){
|
|
|
- $inventoryAccounts=InventoryAccount::query()->get();
|
|
|
+
|
|
|
+ public function updateInventory()
|
|
|
+ {
|
|
|
+ $inventoryAccounts = InventoryAccount::query()->get();
|
|
|
$updateParams = [[
|
|
|
- 'id','processed','ignored','updated_at'
|
|
|
+ 'id', 'processed', 'ignored', 'updated_at'
|
|
|
]];
|
|
|
- $updated_at=Carbon::now()->toDateTimeString();
|
|
|
- foreach ($inventoryAccounts as $inventoryAccount){
|
|
|
- if ($inventoryAccount->getIgnoredAmount()>0){
|
|
|
+ $updated_at = Carbon::now()->toDateTimeString();
|
|
|
+ foreach ($inventoryAccounts as $inventoryAccount) {
|
|
|
+ if ($inventoryAccount->getIgnoredAmount() > 0) {
|
|
|
$updateParams[] = [
|
|
|
- 'id'=>$inventoryAccount->id,
|
|
|
- 'processed'=>$inventoryAccount->getProcessedAmount(),
|
|
|
+ 'id' => $inventoryAccount->id,
|
|
|
+ 'processed' => $inventoryAccount->getProcessedAmount(),
|
|
|
'ignored' => $inventoryAccount->getIgnoredAmount(),
|
|
|
- 'updated_at'=>$updated_at,
|
|
|
+ 'updated_at' => $updated_at,
|
|
|
];
|
|
|
}
|
|
|
}
|
|
|
- if(count($updateParams) > 1){
|
|
|
- app(BatchUpdateService::class)->batchUpdate('inventory_accounts',$updateParams);
|
|
|
+ if (count($updateParams) > 1) {
|
|
|
+ app(BatchUpdateService::class)->batchUpdate('inventory_accounts', $updateParams);
|
|
|
}
|
|
|
}
|
|
|
- public function mergeCarrier(){
|
|
|
+
|
|
|
+ public function mergeCarrier()
|
|
|
+ {
|
|
|
$carriers = Carrier::query()->get();
|
|
|
$logistics = [];
|
|
|
$map = [];
|
|
|
- foreach ($carriers as $carrier){
|
|
|
+ foreach ($carriers as $carrier) {
|
|
|
$map[$carrier->name] = $carrier->id;
|
|
|
- $lo = Logistic::query()->where("name",$carrier->name)->first();
|
|
|
- if ($lo){
|
|
|
- if ($lo->type == '快递'){
|
|
|
+ $lo = Logistic::query()->where("name", $carrier->name)->first();
|
|
|
+ if ($lo) {
|
|
|
+ if ($lo->type == '快递') {
|
|
|
// $lo->update(["type"=>"全部"]);$lo->save();
|
|
|
}
|
|
|
continue;
|
|
|
@@ -116,64 +120,68 @@ class TestController extends Controller
|
|
|
$logistics[] = [
|
|
|
"name" => $carrier->name,
|
|
|
'mobile' => $carrier->mobile,
|
|
|
- 'delivery_fee'=> $carrier->delivery_fee,
|
|
|
- 'remark'=> $carrier->remark,
|
|
|
+ 'delivery_fee' => $carrier->delivery_fee,
|
|
|
+ 'remark' => $carrier->remark,
|
|
|
"type" => "物流"
|
|
|
];
|
|
|
}
|
|
|
Logistic::query()->insert($logistics);
|
|
|
- $ls = Logistic::query()->where("type","物流")->get();
|
|
|
+ $ls = Logistic::query()->where("type", "物流")->get();
|
|
|
$result = [];
|
|
|
- foreach ($ls as $l)
|
|
|
- {
|
|
|
- if (isset($map[$l->name]))$result[$map[$l->name]] = $l->id;
|
|
|
+ foreach ($ls as $l) {
|
|
|
+ if (isset($map[$l->name])) $result[$map[$l->name]] = $l->id;
|
|
|
}
|
|
|
- LogService::log(__METHOD__,"同步承运商",json_encode($result));
|
|
|
- foreach ($result as $tag => $val){
|
|
|
- Waybill::query()->where("logistic_id",$tag)->update([
|
|
|
+ LogService::log(__METHOD__, "同步承运商", json_encode($result));
|
|
|
+ foreach ($result as $tag => $val) {
|
|
|
+ Waybill::query()->where("logistic_id", $tag)->update([
|
|
|
"logistic_id" => $val
|
|
|
]);
|
|
|
- WaybillPriceModel::query()->where("logistic_id",$tag)->update([
|
|
|
+ WaybillPriceModel::query()->where("logistic_id", $tag)->update([
|
|
|
"logistic_id" => $val
|
|
|
]);
|
|
|
- DB::table("logistic_user")->where("logistic_id",$tag)->update([
|
|
|
+ DB::table("logistic_user")->where("logistic_id", $tag)->update([
|
|
|
"logistic_id" => $val
|
|
|
]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function test4(){
|
|
|
- $arr=[['id'=>3],['id'=>33],];
|
|
|
- dd(data_get($arr,'*.id'));
|
|
|
+ public function test4()
|
|
|
+ {
|
|
|
+ $arr = [['id' => 3], ['id' => 33],];
|
|
|
+ dd(data_get($arr, '*.id'));
|
|
|
}
|
|
|
+
|
|
|
public function t($a)
|
|
|
{
|
|
|
$r = new \ReflectionClass('App\Http\Controllers\UnitsController');
|
|
|
- dd($r->getMethods(),$r->getConstants());
|
|
|
+ dd($r->getMethods(), $r->getConstants());
|
|
|
}
|
|
|
|
|
|
- public function updateLaborRemark(){
|
|
|
- $laborReports=LaborReport::query()->with(['remarks'=>function($query){
|
|
|
+ public function updateLaborRemark()
|
|
|
+ {
|
|
|
+ $laborReports = LaborReport::query()->with(['remarks' => function ($query) {
|
|
|
return $query->whereNotNull('mark');
|
|
|
}])->get();
|
|
|
$updateParams = [[
|
|
|
- 'id','remark','updated_at'
|
|
|
+ 'id', 'remark', 'updated_at'
|
|
|
]];
|
|
|
- $updated_at=Carbon::now()->toDateTimeString();
|
|
|
- foreach ($laborReports as $laborReport){
|
|
|
- if ($laborReport->remarks){
|
|
|
+ $updated_at = Carbon::now()->toDateTimeString();
|
|
|
+ foreach ($laborReports as $laborReport) {
|
|
|
+ if ($laborReport->remarks) {
|
|
|
$updateParams[] = [
|
|
|
- 'id'=>$laborReport->id,
|
|
|
- 'remark'=>$laborReport->remarks->mark,
|
|
|
- 'updated_at'=>$updated_at,
|
|
|
+ 'id' => $laborReport->id,
|
|
|
+ 'remark' => $laborReport->remarks->mark,
|
|
|
+ 'updated_at' => $updated_at,
|
|
|
];
|
|
|
}
|
|
|
}
|
|
|
- if(count($updateParams) > 1){
|
|
|
- app(BatchUpdateService::class)->batchUpdate('labor_reports',$updateParams);
|
|
|
+ if (count($updateParams) > 1) {
|
|
|
+ app(BatchUpdateService::class)->batchUpdate('labor_reports', $updateParams);
|
|
|
}
|
|
|
}
|
|
|
- public function test2(){
|
|
|
+
|
|
|
+ public function test2()
|
|
|
+ {
|
|
|
}
|
|
|
|
|
|
function packageFromLog(Request $request)
|
|
|
@@ -205,11 +213,12 @@ class TestController extends Controller
|
|
|
|
|
|
function wmsSql()
|
|
|
{
|
|
|
- $owner=Owner::first();
|
|
|
+ $owner = Owner::first();
|
|
|
// $owner['phone_number'] ?? $owner['phone_number'] = '31115';
|
|
|
// $owner->update();
|
|
|
dd($owner);
|
|
|
}
|
|
|
+
|
|
|
function issues()
|
|
|
{
|
|
|
/** @var OrderPackageService $orderPackageService */
|
|
|
@@ -236,8 +245,9 @@ class TestController extends Controller
|
|
|
|
|
|
function tlog(Request $request)
|
|
|
{
|
|
|
- app('LogService')->log(__METHOD__,'cczdelme'.__FUNCTION__,json_encode($request->all()),null);
|
|
|
+ app('LogService')->log(__METHOD__, 'cczdelme' . __FUNCTION__, json_encode($request->all()), null);
|
|
|
}
|
|
|
+
|
|
|
function setCache(Request $request)
|
|
|
{
|
|
|
$today = now();
|
|
|
@@ -577,56 +587,57 @@ class TestController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function test5(){
|
|
|
- ini_set('max_execution_time',2500);
|
|
|
- ini_set('memory_limit','1526M');
|
|
|
+ public function test5()
|
|
|
+ {
|
|
|
+ ini_set('max_execution_time', 2500);
|
|
|
+ ini_set('memory_limit', '1526M');
|
|
|
//清理冗余条码
|
|
|
// $this->cleanBarcode();
|
|
|
|
|
|
- while(true){
|
|
|
+ while (true) {
|
|
|
$toDay = Carbon::now();
|
|
|
$skus = DB::select(DB::raw('select sku from commodities group by sku,owner_id having count(*)>1 limit 500 '));
|
|
|
- $skus = array_column($skus,'sku');
|
|
|
+ $skus = array_column($skus, 'sku');
|
|
|
|
|
|
- $commodities = Commodity::query()->with('barcodes')->whereNotNull('owner_id')->whereIn('sku',$skus)->get();
|
|
|
+ $commodities = Commodity::query()->with('barcodes')->whereNotNull('owner_id')->whereIn('sku', $skus)->get();
|
|
|
|
|
|
|
|
|
- if (count($commodities) < 1)return "SUCCESS";
|
|
|
+ if (count($commodities) < 1) return "SUCCESS";
|
|
|
$commodityMap = [];
|
|
|
$commodityDel = [];
|
|
|
$commodityTag = [];
|
|
|
$commodityBar = [];
|
|
|
$createBarcodes = [];
|
|
|
$logs = [];
|
|
|
- foreach ($commodities as $commodity){
|
|
|
- if ($commodityMap[$commodity->sku.'_'.$commodity->owner_id] ?? false){
|
|
|
- $codes = $commodity->barcodes ? array_column($commodity->barcodes->toArray(),'code') : [];
|
|
|
+ foreach ($commodities as $commodity) {
|
|
|
+ if ($commodityMap[$commodity->sku . '_' . $commodity->owner_id] ?? false) {
|
|
|
+ $codes = $commodity->barcodes ? array_column($commodity->barcodes->toArray(), 'code') : [];
|
|
|
$logs[] = [
|
|
|
'id' => $commodity->id,
|
|
|
'sku' => $commodity->sku,
|
|
|
- 'owner_id'=>$commodity->owner_id,
|
|
|
- 'code'=>$codes,
|
|
|
+ 'owner_id' => $commodity->owner_id,
|
|
|
+ 'code' => $codes,
|
|
|
];
|
|
|
$commodityDel[] = $commodity->id;
|
|
|
- $commodityTag[$commodity->id] = $commodityMap[$commodity->sku.'_'.$commodity->owner_id];
|
|
|
+ $commodityTag[$commodity->id] = $commodityMap[$commodity->sku . '_' . $commodity->owner_id];
|
|
|
|
|
|
- $arr = array_diff($codes,$commodityBar[$commodity->sku.'_'.$commodity->owner_id]);
|
|
|
- foreach ($arr as $code){
|
|
|
- if (!$code)continue;
|
|
|
+ $arr = array_diff($codes, $commodityBar[$commodity->sku . '_' . $commodity->owner_id]);
|
|
|
+ foreach ($arr as $code) {
|
|
|
+ if (!$code) continue;
|
|
|
$createBarcodes[] = [
|
|
|
'code' => $code,
|
|
|
- 'commodity_id' => $commodityMap[$commodity->sku.'_'.$commodity->owner_id],
|
|
|
+ 'commodity_id' => $commodityMap[$commodity->sku . '_' . $commodity->owner_id],
|
|
|
'created_at' => $toDay,
|
|
|
];
|
|
|
}
|
|
|
- }else{
|
|
|
- $commodityMap[$commodity->sku.'_'.$commodity->owner_id] = $commodity->id;
|
|
|
- $commodityBar[$commodity->sku.'_'.$commodity->owner_id] = $commodity->barcodes ? array_column($commodity->barcodes->toArray(),'code') : [];
|
|
|
+ } else {
|
|
|
+ $commodityMap[$commodity->sku . '_' . $commodity->owner_id] = $commodity->id;
|
|
|
+ $commodityBar[$commodity->sku . '_' . $commodity->owner_id] = $commodity->barcodes ? array_column($commodity->barcodes->toArray(), 'code') : [];
|
|
|
}
|
|
|
}
|
|
|
- dd($commodityMap,$commodityDel,$commodityTag);
|
|
|
- app('LogService')->log(__METHOD__,'清理商品',json_encode($logs,JSON_UNESCAPED_UNICODE));
|
|
|
- app('LogService')->log(__METHOD__,'重新分配商品',json_encode($commodityTag,JSON_UNESCAPED_UNICODE));
|
|
|
+ dd($commodityMap, $commodityDel, $commodityTag);
|
|
|
+ app('LogService')->log(__METHOD__, '清理商品', json_encode($logs, JSON_UNESCAPED_UNICODE));
|
|
|
+ app('LogService')->log(__METHOD__, '重新分配商品', json_encode($commodityTag, JSON_UNESCAPED_UNICODE));
|
|
|
|
|
|
app('InventoryAccountMissionService')->batchUpdateItself('commodity_id', $commodityTag);//批量更新库存盘点任务
|
|
|
app('InventoryCompareService')->batchUpdateItself('commodity_id', $commodityTag);//批量更新库存对比
|
|
|
@@ -635,13 +646,14 @@ class TestController extends Controller
|
|
|
app('StoreCheckingReceiveItemService')->batchUpdateItself('commodity_id', $commodityTag);//批量更新入库盘收一体
|
|
|
app('OrderPackageCommoditiesService')->batchUpdateItself('commodity_id', $commodityTag);//批量更新订单商品
|
|
|
|
|
|
- app('LogService')->log(__METHOD__,'删除商品与对应条码',json_encode($commodityDel,JSON_UNESCAPED_UNICODE));
|
|
|
- CommodityBarcode::query()->whereIn('commodity_id',$commodityDel)->delete();
|
|
|
+ app('LogService')->log(__METHOD__, '删除商品与对应条码', json_encode($commodityDel, JSON_UNESCAPED_UNICODE));
|
|
|
+ CommodityBarcode::query()->whereIn('commodity_id', $commodityDel)->delete();
|
|
|
Commodity::destroy($commodityDel);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private function cleanBarcode(){
|
|
|
+ private function cleanBarcode()
|
|
|
+ {
|
|
|
|
|
|
$logCommodityBarcodes = CommodityBarcode::query()->where('code', "")->get();
|
|
|
if (count($logCommodityBarcodes) > 0) app('LogService')->log(__METHOD__, "纠正商品-删除空条码", json_encode($logCommodityBarcodes, JSON_UNESCAPED_UNICODE));
|
|
|
@@ -662,30 +674,31 @@ where (c.code,c.commodity_id) in (select code,commodity_id from commodity_barcod
|
|
|
CommodityBarcode::destroy($barcodeDelete);
|
|
|
}
|
|
|
|
|
|
- private function multiCodes(){
|
|
|
+ private function multiCodes()
|
|
|
+ {
|
|
|
|
|
|
- $barcode='BG10B1014C002100';
|
|
|
- $commodity=Commodity::whereHas('barcodes', function (Builder $query)use($barcode){
|
|
|
- $query->where('code',$barcode);
|
|
|
- })->where('owner_id',4)->first();
|
|
|
+ $barcode = 'BG10B1014C002100';
|
|
|
+ $commodity = Commodity::whereHas('barcodes', function (Builder $query) use ($barcode) {
|
|
|
+ $query->where('code', $barcode);
|
|
|
+ })->where('owner_id', 4)->first();
|
|
|
$codes = $commodity->barcodes->map(function ($barcode) {
|
|
|
- return $barcode->code??'';
|
|
|
+ return $barcode->code ?? '';
|
|
|
});
|
|
|
- foreach($codes as $code){
|
|
|
- $commodity=Commodity::whereHas('barcodes', function (Builder $query)use($barcode){
|
|
|
- $query->where('code',$barcode);
|
|
|
- })->where('owner_id',4)->get();
|
|
|
+ foreach ($codes as $code) {
|
|
|
+ $commodity = Commodity::whereHas('barcodes', function (Builder $query) use ($barcode) {
|
|
|
+ $query->where('code', $barcode);
|
|
|
+ })->where('owner_id', 4)->get();
|
|
|
dump($commodity);
|
|
|
}
|
|
|
die();
|
|
|
- $commodityBuilder=Commodity::query();
|
|
|
- $commodityBuilder->where('owner_id',4)->first();
|
|
|
- $commodityBuilder->whereHas('barcodes', function (Builder $query)use($barcode,$codes){
|
|
|
- foreach($codes as $code){
|
|
|
- $query->orWhere('code',$code);
|
|
|
- }
|
|
|
- });
|
|
|
- dd($commodity, $codes,$commodityBuilder->get());
|
|
|
+ $commodityBuilder = Commodity::query();
|
|
|
+ $commodityBuilder->where('owner_id', 4)->first();
|
|
|
+ $commodityBuilder->whereHas('barcodes', function (Builder $query) use ($barcode, $codes) {
|
|
|
+ foreach ($codes as $code) {
|
|
|
+ $query->orWhere('code', $code);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dd($commodity, $codes, $commodityBuilder->get());
|
|
|
}
|
|
|
|
|
|
public function correctCommodity()
|
|
|
@@ -752,7 +765,7 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
}
|
|
|
$updateCommodities[$del->commodity_id] = $target->commodity_id;
|
|
|
}
|
|
|
- if (count($updateCommodities) > 0){
|
|
|
+ if (count($updateCommodities) > 0) {
|
|
|
app('InventoryAccountMissionService')->batchUpdateItself('commodity_id', $updateCommodities);//批量更新库存盘点任务
|
|
|
app('InventoryCompareService')->batchUpdateItself('commodity_id', $updateCommodities);//批量更新库存对比
|
|
|
app('InventoryDailyLogService')->batchUpdateItself('commodity_id', $updateCommodities);//批量更新库存每日记录
|
|
|
@@ -832,22 +845,20 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
public function test11()
|
|
|
{
|
|
|
$rejectedBills = RejectedBill::query()
|
|
|
- ->where('created_at','>=','2020-11-10 18:00:22')
|
|
|
- ->where('created_at','<=','2020-11-11 00:00:00')
|
|
|
+ ->where('created_at', '>=', '2020-11-10 18:00:22')
|
|
|
+ ->where('created_at', '<=', '2020-11-11 00:00:00')
|
|
|
->get();
|
|
|
- $update = [['id','logistic_number']];
|
|
|
- $rejectedBills->each(function ($rejectedBill)use(&$update){
|
|
|
- if($rejectedBill->logistic_number == '原单退回'){
|
|
|
- $details = OracleActAllocationDetails::query()->with('oracleDocOrderHeader')->whereHas('oracleDocOrderHeader',function($query)use($rejectedBill){
|
|
|
- $query->where('SOReference1',$rejectedBill->order_number);
|
|
|
+ $update = [['id', 'logistic_number']];
|
|
|
+ $rejectedBills->each(function ($rejectedBill) use (&$update) {
|
|
|
+ if ($rejectedBill->logistic_number == '原单退回') {
|
|
|
+ $details = OracleActAllocationDetails::query()->with('oracleDocOrderHeader')->whereHas('oracleDocOrderHeader', function ($query) use ($rejectedBill) {
|
|
|
+ $query->where('SOReference1', $rejectedBill->order_number);
|
|
|
})->get()->groupBy('picktotraceid');
|
|
|
- if($details->count() == 1){
|
|
|
- $update[] = ['id'=> $rejectedBill->id ,'logistic_number'=>$rejectedBill->logistic_number_return];
|
|
|
+ if ($details->count() == 1) {
|
|
|
+ $update[] = ['id' => $rejectedBill->id, 'logistic_number' => $rejectedBill->logistic_number_return];
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -858,23 +869,26 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
{
|
|
|
/** @var CacheService $cacheService */
|
|
|
$cacheService = app('CacheService');
|
|
|
- $authorities=$cacheService->getOrExecute('userxx',function (){
|
|
|
+ $authorities = $cacheService->getOrExecute('userxx', function () {
|
|
|
return Authority::with('roles')->get();
|
|
|
});
|
|
|
dd($authorities);
|
|
|
}
|
|
|
+
|
|
|
public function output2()
|
|
|
{
|
|
|
dump(Cache::get('aa'));
|
|
|
Cache::put('aa', '2223', 5);
|
|
|
}
|
|
|
+
|
|
|
public function usage()
|
|
|
{
|
|
|
dd(Request::all());
|
|
|
}
|
|
|
+
|
|
|
public function relating()
|
|
|
{
|
|
|
- dd(OrderIssue::query()->where('id',182)->paginate()->total());
|
|
|
+ dd(OrderIssue::query()->where('id', 182)->paginate()->total());
|
|
|
}
|
|
|
|
|
|
public function updateOrdersWarehouse()
|
|
|
@@ -890,10 +904,11 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
$warehouse = Warehouse::query()->get();
|
|
|
$warehouse_map = $dataHandlerService->dataHeader(['code'], $warehouse);
|
|
|
for ($i = 0; $i < $count; $i += $page) {
|
|
|
- $min = $i;$max = $i + $page;
|
|
|
+ $min = $i;
|
|
|
+ $max = $i + $page;
|
|
|
$orders = Order::query()->where('id', '>=', $min)->where('id', '<=', $max)->get();
|
|
|
$orderNos = array_diff(array_unique(data_get($orders, '*.code')), ['', ' ', '*', null]);
|
|
|
- if (count($orderNos)==0) continue;
|
|
|
+ if (count($orderNos) == 0) continue;
|
|
|
/** @var Collection $orderHeaders */
|
|
|
$orderHeaders = OracleDOCOrderHeader::query()->whereIn('orderno', $orderNos)->get();
|
|
|
if ($orderHeaders->count() == 0) continue;
|
|
|
@@ -919,54 +934,57 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
public function syncSendOrder()
|
|
|
{
|
|
|
$order_issues = OrderIssue::query()->whereNotNull('second_client_no')->get();
|
|
|
- $client_nos = data_get($order_issues,'*.second_client_no');
|
|
|
- $orderHeaders = OracleDOCOrderHeader::query()->selectRaw(implode(',',OracleDOCOrderHeaderService::$columns))
|
|
|
- ->whereIn('SOReference1',$client_nos)
|
|
|
- ->with(['oracleBASCustomer'=>function($query){
|
|
|
+ $client_nos = data_get($order_issues, '*.second_client_no');
|
|
|
+ $orderHeaders = OracleDOCOrderHeader::query()->selectRaw(implode(',', OracleDOCOrderHeaderService::$columns))
|
|
|
+ ->whereIn('SOReference1', $client_nos)
|
|
|
+ ->with(['oracleBASCustomer' => function ($query) {
|
|
|
$query->selectRaw('BAS_CUSTOMER.CustomerID,BAS_CUSTOMER.Customer_Type,BAS_CUSTOMER.Descr_C,BAS_CUSTOMER.Active_Flag');
|
|
|
- },'oracleDOCOrderDetails'=>function($query){
|
|
|
+ }, 'oracleDOCOrderDetails' => function ($query) {
|
|
|
$query->selectRaw('doc_order_details.orderNo,doc_order_details.customerid,doc_order_details.sku,doc_order_details.QtyOrdered');
|
|
|
- }, 'actAllocationDetails'=>function($query){
|
|
|
+ }, 'actAllocationDetails' => function ($query) {
|
|
|
$query->selectRaw('ACT_Allocation_Details.AllocationDetailsID,ACT_Allocation_Details.OrderNo,ACT_Allocation_Details.Qty_Each,ACT_Allocation_Details.PickToTraceID,ACT_Allocation_Details.CustomerID');
|
|
|
- },'oracleBASCode'=>function($query){
|
|
|
+ }, 'oracleBASCode' => function ($query) {
|
|
|
$query->selectRaw('BAS_Codes.CodeID,BAS_Codes.CodeName_C,BAS_Codes.Code');
|
|
|
}])
|
|
|
->get();
|
|
|
$service = app('OrderIssueService');
|
|
|
$service->updateByWmsOrders($orderHeaders);
|
|
|
}
|
|
|
+
|
|
|
public function testCollectMethod()
|
|
|
{
|
|
|
- $startDate=Carbon::parse('2020-11-11 23:59:59')->subSeconds(65)->format('Y-m-d H:i:s');
|
|
|
- $asnHerders=app(OracleDocAsnHerderService::class)->getWmsAsnOnStartDateCreate($startDate);
|
|
|
- if ($asnHerders->isEmpty())return null;
|
|
|
+ $startDate = Carbon::parse('2020-11-11 23:59:59')->subSeconds(65)->format('Y-m-d H:i:s');
|
|
|
+ $asnHerders = app(OracleDocAsnHerderService::class)->getWmsAsnOnStartDateCreate($startDate);
|
|
|
+ if ($asnHerders->isEmpty()) return null;
|
|
|
/**
|
|
|
* @var OwnerService $ownerService
|
|
|
* @var WarehouseService $wareHouseService
|
|
|
*/
|
|
|
$ownerService = app(OwnerService::class);
|
|
|
- $owners=$ownerService->getByWmsOrders($asnHerders);
|
|
|
- $wareHouseService=app(WarehouseService::class);
|
|
|
- $warehouses=$wareHouseService->getByWms($asnHerders);
|
|
|
+ $owners = $ownerService->getByWmsOrders($asnHerders);
|
|
|
+ $wareHouseService = app(WarehouseService::class);
|
|
|
+ $warehouses = $wareHouseService->getByWms($asnHerders);
|
|
|
foreach ($owners as $owner) {
|
|
|
$owners_code_map[$owner->code] = $owner;
|
|
|
}
|
|
|
foreach ($warehouses as $warehouse) {
|
|
|
$warehouses_code_map[$warehouse->code] = $warehouse;
|
|
|
}
|
|
|
- var_dump('createStoreParam_start',Carbon::now());
|
|
|
- $params=app(StoreService::class)->getParamsByAsnHeader($asnHerders,$owners_code_map,$warehouses_code_map);
|
|
|
- var_dump('createStoreParam_end',Carbon::now());
|
|
|
+ var_dump('createStoreParam_start', Carbon::now());
|
|
|
+ $params = app(StoreService::class)->getParamsByAsnHeader($asnHerders, $owners_code_map, $warehouses_code_map);
|
|
|
+ var_dump('createStoreParam_end', Carbon::now());
|
|
|
|
|
|
- var_dump('insertStore_start',Carbon::now());
|
|
|
- if(count($params)> 0){
|
|
|
+ var_dump('insertStore_start', Carbon::now());
|
|
|
+ if (count($params) > 0) {
|
|
|
//app(StoreService::class)->insertStore($params);
|
|
|
DB::table('stores')->insert($params);
|
|
|
}
|
|
|
- var_dump('insertStore_end',Carbon::now());
|
|
|
+ var_dump('insertStore_end', Carbon::now());
|
|
|
}
|
|
|
- public function testMethodSecond(){
|
|
|
- $param=[
|
|
|
+
|
|
|
+ public function testMethodSecond()
|
|
|
+ {
|
|
|
+ $param = [
|
|
|
"asn_code" => "ASN2011120516",
|
|
|
"warehouse_id" => 2,
|
|
|
"owner_id" => 35,
|
|
|
@@ -975,14 +993,15 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
"remark" => null,
|
|
|
"created_at" => "2020-11-12 14:12:42",
|
|
|
"updated_at" => "2020-11-12 14:12:42",
|
|
|
- ];
|
|
|
- var_dump('start',Carbon::now());
|
|
|
+ ];
|
|
|
+ var_dump('start', Carbon::now());
|
|
|
//Store::query()->insert($param);
|
|
|
app(StoreService::class)->insertStore($param);
|
|
|
- var_dump('end',Carbon::now());
|
|
|
+ var_dump('end', Carbon::now());
|
|
|
}
|
|
|
- public function testSyncAsn(){
|
|
|
|
|
|
+ public function testSyncAsn()
|
|
|
+ {
|
|
|
app(StoreService::class)->storeCreateByWms();
|
|
|
app(StoreService::class)->storeUpdateByWms();
|
|
|
}
|
|
|
@@ -992,19 +1011,19 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
/**
|
|
|
* @var OrderService $orderService
|
|
|
*/
|
|
|
- $carbon =Carbon::now()->subMinutes(30);
|
|
|
- var_dump('$orderHeader',new Carbon());
|
|
|
- $orderHeader_start = OracleDOCOrderHeader::query()->selectRaw(implode(',',OracleDOCOrderHeaderService::$columns))
|
|
|
- ->with(['oracleBASCustomer'=>function($query){
|
|
|
+ $carbon = Carbon::now()->subMinutes(30);
|
|
|
+ var_dump('$orderHeader', new Carbon());
|
|
|
+ $orderHeader_start = OracleDOCOrderHeader::query()->selectRaw(implode(',', OracleDOCOrderHeaderService::$columns))
|
|
|
+ ->with(['oracleBASCustomer' => function ($query) {
|
|
|
$query->selectRaw('BAS_CUSTOMER.CustomerID,BAS_CUSTOMER.Customer_Type,BAS_CUSTOMER.Descr_C,BAS_CUSTOMER.Active_Flag');
|
|
|
- },'oracleDOCOrderDetails'=>function($query){
|
|
|
+ }, 'oracleDOCOrderDetails' => function ($query) {
|
|
|
$query->selectRaw('doc_order_details.orderNo,doc_order_details.customerid,doc_order_details.sku,doc_order_details.QtyOrdered');
|
|
|
- }, 'actAllocationDetails'=>function($query){
|
|
|
+ }, 'actAllocationDetails' => function ($query) {
|
|
|
$query->selectRaw('ACT_Allocation_Details.AllocationDetailsID,ACT_Allocation_Details.OrderNo,ACT_Allocation_Details.Qty_Each,ACT_Allocation_Details.PickToTraceID,ACT_Allocation_Details.CustomerID,ACT_Allocation_Details.Sku');
|
|
|
- },'oracleBASCode'=>function($query){
|
|
|
+ }, 'oracleBASCode' => function ($query) {
|
|
|
$query->selectRaw('BAS_Codes.CodeID,BAS_Codes.CodeName_C,BAS_Codes.Code');
|
|
|
}])
|
|
|
- ->where('DOC_Order_Header.addTime','>=',$carbon)
|
|
|
+ ->where('DOC_Order_Header.addTime', '>=', $carbon)
|
|
|
// ->where('DOC_Order_Header.editTime','>=',$carbon)
|
|
|
->get();
|
|
|
var_dump((string)Carbon::now());
|
|
|
@@ -1016,77 +1035,85 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
// orderService getCreateOrderModelsByWMSOrderHeaders
|
|
|
}
|
|
|
|
|
|
- public function testOrderPackages(){
|
|
|
+ public function testOrderPackages()
|
|
|
+ {
|
|
|
$batch_number = 'W201114000104';
|
|
|
$weight = 0.3;
|
|
|
- OrderPackage::createPackagesFromBatchCode($batch_number,$weight);
|
|
|
+ OrderPackage::createPackagesFromBatchCode($batch_number, $weight);
|
|
|
}
|
|
|
|
|
|
- public function view(){
|
|
|
+ public function view()
|
|
|
+ {
|
|
|
return view('test');
|
|
|
}
|
|
|
- public function tdel(){
|
|
|
+
|
|
|
+ public function tdel()
|
|
|
+ {
|
|
|
echo '223232323';
|
|
|
return 'asdfsadfsdf';
|
|
|
}
|
|
|
- public function cleanOrderRepeat(){
|
|
|
|
|
|
- ini_set('max_execution_time',6500);
|
|
|
- ini_set('memory_limit','1526M');
|
|
|
- for($i=0;true;$i++){
|
|
|
- $orders_repeating=Order::query()
|
|
|
+ public function cleanOrderRepeat()
|
|
|
+ {
|
|
|
+
|
|
|
+ ini_set('max_execution_time', 6500);
|
|
|
+ ini_set('memory_limit', '1526M');
|
|
|
+ for ($i = 0; true; $i++) {
|
|
|
+ $orders_repeating = Order::query()
|
|
|
->selectRaw('count(*) as count, code, id')
|
|
|
->whereNotNull('code')
|
|
|
->groupBy('code')
|
|
|
->having('count', '>', 1)
|
|
|
->limit(100)
|
|
|
->get();
|
|
|
- if($orders_repeating->count()==0)break;
|
|
|
- $orders_repeating->each(function ($order){
|
|
|
- $code_repeating=$order['code'];
|
|
|
- $orders_toCombine=Order::query()
|
|
|
- ->where('code',$code_repeating)
|
|
|
+ if ($orders_repeating->count() == 0) break;
|
|
|
+ $orders_repeating->each(function ($order) {
|
|
|
+ $code_repeating = $order['code'];
|
|
|
+ $orders_toCombine = Order::query()
|
|
|
+ ->where('code', $code_repeating)
|
|
|
->orderByDesc('updated_at')
|
|
|
->get();
|
|
|
- $orderId_unique=(function()use($orders_toCombine){
|
|
|
- $order_toLive=$orders_toCombine->first();
|
|
|
- foreach($orders_toCombine as $key=>$order_toEliminate){
|
|
|
- if($key==0)continue;
|
|
|
- if(!$order_toLive['batch_id'])$order_toLive['batch_id']=$order_toEliminate['batch_id'];
|
|
|
- if(!$order_toLive['owner_id'])$order_toLive['owner_id']=$order_toEliminate['owner_id'];
|
|
|
- if(!$order_toLive['status'])$order_toLive['status']=$order_toEliminate['status'];
|
|
|
- if(!$order_toLive['created_at'])$order_toLive['created_at']=$order_toEliminate['created_at'];
|
|
|
- if(!$order_toLive['code'])$order_toLive['code']=$order_toEliminate['code'];
|
|
|
- if(!$order_toLive['shop_id'])$order_toLive['shop_id']=$order_toEliminate['shop_id'];
|
|
|
- if(!$order_toLive['owner_id'])$order_toLive['owner_id']=$order_toEliminate['owner_id'];
|
|
|
- if(!$order_toLive['client_code'])$order_toLive['client_code']=$order_toEliminate['client_code'];
|
|
|
- if(!$order_toLive['logistic_id'])$order_toLive['logistic_id']=$order_toEliminate['logistic_id'];
|
|
|
- if(!$order_toLive['consignee_name'])$order_toLive['consignee_name']=$order_toEliminate['consignee_name'];
|
|
|
- if(!$order_toLive['consignee_phone'])$order_toLive['consignee_phone']=$order_toEliminate['consignee_phone'];
|
|
|
- if(!$order_toLive['province'])$order_toLive['province']=$order_toEliminate['province'];
|
|
|
- if(!$order_toLive['city'])$order_toLive['city']=$order_toEliminate['city'];
|
|
|
- if(!$order_toLive['district'])$order_toLive['district']=$order_toEliminate['district'];
|
|
|
- if(!$order_toLive['address'])$order_toLive['address']=$order_toEliminate['address'];
|
|
|
- if(!$order_toLive['wms_status'])$order_toLive['wms_status']=$order_toEliminate['wms_status'];
|
|
|
- if(!$order_toLive['status'])$order_toLive['status']=$order_toEliminate['status'];
|
|
|
- if(!$order_toLive['warehouse_id'])$order_toLive['warehouse_id']=$order_toEliminate['warehouse_id'];
|
|
|
- if(!$order_toLive['wms_edittime'])$order_toLive['wms_edittime']=$order_toEliminate['wms_edittime'];
|
|
|
+ $orderId_unique = (function () use ($orders_toCombine) {
|
|
|
+ $order_toLive = $orders_toCombine->first();
|
|
|
+ foreach ($orders_toCombine as $key => $order_toEliminate) {
|
|
|
+ if ($key == 0) continue;
|
|
|
+ if (!$order_toLive['batch_id']) $order_toLive['batch_id'] = $order_toEliminate['batch_id'];
|
|
|
+ if (!$order_toLive['owner_id']) $order_toLive['owner_id'] = $order_toEliminate['owner_id'];
|
|
|
+ if (!$order_toLive['status']) $order_toLive['status'] = $order_toEliminate['status'];
|
|
|
+ if (!$order_toLive['created_at']) $order_toLive['created_at'] = $order_toEliminate['created_at'];
|
|
|
+ if (!$order_toLive['code']) $order_toLive['code'] = $order_toEliminate['code'];
|
|
|
+ if (!$order_toLive['shop_id']) $order_toLive['shop_id'] = $order_toEliminate['shop_id'];
|
|
|
+ if (!$order_toLive['owner_id']) $order_toLive['owner_id'] = $order_toEliminate['owner_id'];
|
|
|
+ if (!$order_toLive['client_code']) $order_toLive['client_code'] = $order_toEliminate['client_code'];
|
|
|
+ if (!$order_toLive['logistic_id']) $order_toLive['logistic_id'] = $order_toEliminate['logistic_id'];
|
|
|
+ if (!$order_toLive['consignee_name']) $order_toLive['consignee_name'] = $order_toEliminate['consignee_name'];
|
|
|
+ if (!$order_toLive['consignee_phone']) $order_toLive['consignee_phone'] = $order_toEliminate['consignee_phone'];
|
|
|
+ if (!$order_toLive['province']) $order_toLive['province'] = $order_toEliminate['province'];
|
|
|
+ if (!$order_toLive['city']) $order_toLive['city'] = $order_toEliminate['city'];
|
|
|
+ if (!$order_toLive['district']) $order_toLive['district'] = $order_toEliminate['district'];
|
|
|
+ if (!$order_toLive['address']) $order_toLive['address'] = $order_toEliminate['address'];
|
|
|
+ if (!$order_toLive['wms_status']) $order_toLive['wms_status'] = $order_toEliminate['wms_status'];
|
|
|
+ if (!$order_toLive['status']) $order_toLive['status'] = $order_toEliminate['status'];
|
|
|
+ if (!$order_toLive['warehouse_id']) $order_toLive['warehouse_id'] = $order_toEliminate['warehouse_id'];
|
|
|
+ if (!$order_toLive['wms_edittime']) $order_toLive['wms_edittime'] = $order_toEliminate['wms_edittime'];
|
|
|
}
|
|
|
$order_toLive->save();
|
|
|
return $order_toLive['id'];
|
|
|
})();
|
|
|
- $orderIds_toRemove=(function()use($orders_toCombine){
|
|
|
+ $orderIds_toRemove = (function () use ($orders_toCombine) {
|
|
|
$orders_toCombine->shift();
|
|
|
- return $orders_toCombine->map(function($order){return $order['id'];});
|
|
|
+ return $orders_toCombine->map(function ($order) {
|
|
|
+ return $order['id'];
|
|
|
+ });
|
|
|
})();
|
|
|
- OrderPackage::query()->whereIn('order_id',$orderIds_toRemove)->update(['order_id'=>$orderId_unique]);
|
|
|
- OrderIssue::query()->whereIn('order_id',$orderIds_toRemove)->update(['order_id'=>$orderId_unique]);
|
|
|
- OrderCommodity::query()->whereIn('order_id',$orderIds_toRemove)->update(['order_id'=>$orderId_unique]);
|
|
|
- OrderBin::query()->whereIn('order_id',$orderIds_toRemove)->update(['order_id'=>$orderId_unique]);
|
|
|
+ OrderPackage::query()->whereIn('order_id', $orderIds_toRemove)->update(['order_id' => $orderId_unique]);
|
|
|
+ OrderIssue::query()->whereIn('order_id', $orderIds_toRemove)->update(['order_id' => $orderId_unique]);
|
|
|
+ OrderCommodity::query()->whereIn('order_id', $orderIds_toRemove)->update(['order_id' => $orderId_unique]);
|
|
|
+ OrderBin::query()->whereIn('order_id', $orderIds_toRemove)->update(['order_id' => $orderId_unique]);
|
|
|
Order::destroy($orderIds_toRemove);
|
|
|
- app('LogService')->log(__METHOD__,__FUNCTION__,'orders_toCombine:'.json_encode($orderIds_toRemove).'|toBe OrderId: '.json_encode($orderId_unique));
|
|
|
+ app('LogService')->log(__METHOD__, __FUNCTION__, 'orders_toCombine:' . json_encode($orderIds_toRemove) . '|toBe OrderId: ' . json_encode($orderId_unique));
|
|
|
});
|
|
|
- app('LogService')->log(__METHOD__,__FUNCTION__,'orders_repeating:'.$orders_repeating->toJson());
|
|
|
+ app('LogService')->log(__METHOD__, __FUNCTION__, 'orders_repeating:' . $orders_repeating->toJson());
|
|
|
}
|
|
|
echo $i;
|
|
|
}
|
|
|
@@ -1094,7 +1121,7 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
public function orderTrackingImportTest(Request $request)
|
|
|
{
|
|
|
$file = $request->file('file');
|
|
|
- ini_set('max_execution_time',4000);
|
|
|
+ ini_set('max_execution_time', 4000);
|
|
|
ini_set('memory_limit', '1024M');
|
|
|
$extension = $request->file()['file']->getClientOriginalExtension();
|
|
|
$extension[0] = strtoupper($extension[0]);
|
|
|
@@ -1105,12 +1132,12 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
{
|
|
|
$client_no = null;
|
|
|
$items = null;
|
|
|
- $order=(new OrderTrackingImport())->getOrder($client_no,$items);
|
|
|
- if($order['id']) echo 'yes1';
|
|
|
+ $order = (new OrderTrackingImport())->getOrder($client_no, $items);
|
|
|
+ if ($order['id']) echo 'yes1';
|
|
|
|
|
|
|
|
|
$order = Order::query()->create([
|
|
|
- 'code'=>'null'.Str::uuid(),'client_code' => 'asdfdfdg','web_order_number' => 'sadfdsf'
|
|
|
+ 'code' => 'null' . Str::uuid(), 'client_code' => 'asdfdfdg', 'web_order_number' => 'sadfdsf'
|
|
|
]);
|
|
|
dd($order);
|
|
|
// $order=(new OrderTrackingImport())->getOrder('92024765871-SDO130000986796QX',$items);
|
|
|
@@ -1159,49 +1186,51 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
// }
|
|
|
|
|
|
public function testSyncOrder()
|
|
|
- {
|
|
|
- $carbon =Carbon::now()->subHours(1);
|
|
|
+ {
|
|
|
+ $carbon = Carbon::now()->subHours(1);
|
|
|
$date = '2020-05-18 18:13:50';
|
|
|
- $orderHeader = OracleDOCOrderHeader::query()->selectRaw(implode(',',OracleDOCOrderHeaderService::$columns))
|
|
|
- ->with(['oracleBASCustomer'=>function($query){
|
|
|
+ $orderHeader = OracleDOCOrderHeader::query()->selectRaw(implode(',', OracleDOCOrderHeaderService::$columns))
|
|
|
+ ->with(['oracleBASCustomer' => function ($query) {
|
|
|
$query->selectRaw('BAS_CUSTOMER.CustomerID,BAS_CUSTOMER.Customer_Type,BAS_CUSTOMER.Descr_C,BAS_CUSTOMER.Active_Flag');
|
|
|
- },'oracleDOCOrderDetails'=>function($query){
|
|
|
+ }, 'oracleDOCOrderDetails' => function ($query) {
|
|
|
$query->selectRaw('doc_order_details.orderNo,doc_order_details.customerid,doc_order_details.sku,doc_order_details.QtyOrdered');
|
|
|
- }, 'actAllocationDetails'=>function($query){
|
|
|
+ }, 'actAllocationDetails' => function ($query) {
|
|
|
$query->selectRaw('ACT_Allocation_Details.AllocationDetailsID,ACT_Allocation_Details.OrderNo,ACT_Allocation_Details.Qty_Each,ACT_Allocation_Details.PickToTraceID,ACT_Allocation_Details.CustomerID,ACT_Allocation_Details.Sku');
|
|
|
- },'oracleBASCode'=>function($query){
|
|
|
+ }, 'oracleBASCode' => function ($query) {
|
|
|
$query->selectRaw('BAS_Codes.CodeID,BAS_Codes.CodeName_C,BAS_Codes.Code');
|
|
|
}])
|
|
|
// ->where('DOC_Order_Header.addTime','>=',$startDate)
|
|
|
// ->where('orderno','SO201112029795')
|
|
|
- ->where('DOC_Order_Header.addTime','>=',$carbon)
|
|
|
+ ->where('DOC_Order_Header.addTime', '>=', $carbon)
|
|
|
->get();
|
|
|
/** @var OrderService $service */
|
|
|
$service = app('OrderService');
|
|
|
$service->syncOrder($orderHeader);
|
|
|
}
|
|
|
|
|
|
- public function OrderSync(){
|
|
|
+ public function OrderSync()
|
|
|
+ {
|
|
|
dump(Carbon::now());
|
|
|
$tack = new SyncWMSOrderTask();
|
|
|
$tack->handle();
|
|
|
dump(Carbon::now());
|
|
|
}
|
|
|
|
|
|
- public function testSyncCommodity(){
|
|
|
+ public function testSyncCommodity()
|
|
|
+ {
|
|
|
/**
|
|
|
* @var CommodityService $commodityService
|
|
|
*/
|
|
|
- $commodityService=app(CommodityService::class);
|
|
|
- dump('start',(string)Carbon::now());
|
|
|
+ $commodityService = app(CommodityService::class);
|
|
|
+ dump('start'.(string)Carbon::now());
|
|
|
$commodityService->syncCommodityCreated();
|
|
|
$commodityService->syncCommodityUpdated();
|
|
|
- dump('end',(string)Carbon::now());
|
|
|
+ dump('end'.(string)Carbon::now());
|
|
|
}
|
|
|
|
|
|
public function reNewBatches3()
|
|
|
{
|
|
|
- $batches=Batch::query()->where('id','>',324)->get('code');
|
|
|
+ $batches = Batch::query()->where('id', '>', 324)->get('code');
|
|
|
// $batchCodes = $batches->map(function($batch){
|
|
|
// return $batch['code'];
|
|
|
// })->toArray();
|
|
|
@@ -1220,43 +1249,42 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
'W201201000074',
|
|
|
'W201201000075',
|
|
|
'W201201000076',];
|
|
|
- $requests=[];
|
|
|
+ $requests = [];
|
|
|
// $logs=Log::query()->select('description')->where('CREATED_AT','>','2020-11-11')
|
|
|
// ->where('type',"issued_newBatch")
|
|
|
// ->get();
|
|
|
// dd($logs);
|
|
|
- foreach($batchCodes as $code){
|
|
|
+ foreach ($batchCodes as $code) {
|
|
|
// $request=Cache::get('temp'.$code)['description'];
|
|
|
- $request=Log::query()->select('description')->where('CREATED_AT','>','2020-12-01')
|
|
|
- ->where('type',"issued_newBatch")
|
|
|
- ->where('description','like',"%{$code}%")
|
|
|
+ $request = Log::query()->select('description')->where('CREATED_AT', '>', '2020-12-01')
|
|
|
+ ->where('type', "issued_newBatch")
|
|
|
+ ->where('description', 'like', "%{$code}%")
|
|
|
->first();
|
|
|
- if($request){
|
|
|
- $response=Zttp::post('https://wcs.baoshi56.com/api/thirdPart/flux/sorting/newBatch',
|
|
|
+ if ($request) {
|
|
|
+ $response = Zttp::post('https://wcs.baoshi56.com/api/thirdPart/flux/sorting/newBatch',
|
|
|
json_decode($request['description'])
|
|
|
);
|
|
|
- app('LogService')->log(__METHOD__,__FUNCTION__,$response->body());
|
|
|
- $requests[]=$response->body();
|
|
|
+ app('LogService')->log(__METHOD__, __FUNCTION__, $response->body());
|
|
|
+ $requests[] = $response->body();
|
|
|
}
|
|
|
// Cache::put('temp'.$code,$request);
|
|
|
// $requests[]=$request;
|
|
|
}
|
|
|
dd($requests);
|
|
|
}
|
|
|
- public function testGetCommodity(){
|
|
|
+
|
|
|
+ public function testGetCommodity()
|
|
|
+ {
|
|
|
/**
|
|
|
* @var CommodityService $commodityService
|
|
|
*/
|
|
|
-// $commodityService=app(CommodityService::class);
|
|
|
-// dump('start'.(string)Carbon::now());
|
|
|
-// $commodities=$commodityService->get_(['3','2']);
|
|
|
-// dump($commodities);
|
|
|
-// dump('end'.(string)Carbon::now());
|
|
|
-
|
|
|
- $commodities=Commodity::query()->with(['barcodes','owner'])->where('owner_id',1)->paginate(10);
|
|
|
- //dd($commodities);
|
|
|
- dump($commodities->items());
|
|
|
- dump($commodities->currentPage());
|
|
|
+ $ownerIds=['1','2'];
|
|
|
+ $barcodes = ['5211801041604', '5211801041004', '5211801041603'];
|
|
|
+ $skus = ['5211801041604', '5211801041004', '5211801041603'];
|
|
|
+ $commodityService = app(CommodityService::class);
|
|
|
+ $commodities=$commodityService->get_($ownerIds);
|
|
|
+ dd($commodities[99]);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public function syncOrderTracking()
|
|
|
@@ -1267,9 +1295,9 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
$orderService = app(OrderService::class);
|
|
|
/*$owners = app(OrderTrackingOwnerService::class)->getTrackingOrderOwner();*/
|
|
|
/*$startDate = \Illuminate\Support\Carbon::parse('2020-10-28 00:00:00')->toDateTimeString();*/
|
|
|
- $orderNos = ['SO201205001735','SO201204003891','SO201204003706','SO201204002877','SO201203003771'];
|
|
|
+ $orderNos = ['SO201205001735', 'SO201204003891', 'SO201204003706', 'SO201204002877', 'SO201203003771'];
|
|
|
$orderHeaders = OracleDOCOrderHeader::query()->with(['oracleDOCOrderDetails', 'actAllocationDetails', 'oracleBASCode'])
|
|
|
- ->whereIn('orderno',$orderNos)
|
|
|
+ ->whereIn('orderno', $orderNos)
|
|
|
->get();
|
|
|
$orderService->updateByWmsOrders($orderHeaders);
|
|
|
$orderTrackingService->createByWmsOrderHeader($orderHeaders);
|