|
|
@@ -3,10 +3,12 @@
|
|
|
namespace App\Services;
|
|
|
|
|
|
use App\Batch;
|
|
|
+use App\Log;
|
|
|
use App\OracleActAllocationDetails;
|
|
|
use App\Order;
|
|
|
use App\OrderCommodity;
|
|
|
use App\OrderPackage;
|
|
|
+use App\Owner;
|
|
|
use App\Services\common\BatchUpdateService;
|
|
|
use App\Services\common\DataHandlerService;
|
|
|
use Carbon\Carbon;
|
|
|
@@ -23,7 +25,8 @@ class OrderCommodityService
|
|
|
if(!$innerParams)return false;
|
|
|
if(count($innerParams)==0)return false;
|
|
|
try {
|
|
|
- return OrderCommodity::query()->insert($innerParams);
|
|
|
+ $bool = OrderCommodity::query()->insert($innerParams);
|
|
|
+ return $bool;
|
|
|
} catch (\Exception $e) {
|
|
|
return false;
|
|
|
}
|
|
|
@@ -202,6 +205,9 @@ class OrderCommodityService
|
|
|
$order = $orderCommodity->order;
|
|
|
$owner = $dataHandlerService->getKeyValue(['id'=>$order->owner_id ?? ''],$owner_id_maps);
|
|
|
$sku = $orderCommodity->commodity->sku ?? '';
|
|
|
+ if($owner == null){
|
|
|
+ $owner = App(OwnerService::class)->first(['id'=>$order->owner_id]);
|
|
|
+ }
|
|
|
$key = "order_{$order->code}_owner_code_{$owner['code']}_sku_{ $sku}_location_{$orderCommodity->location}_amount_{$orderCommodity->amount}";
|
|
|
if(empty($map[$key]))$map[$key]=[];
|
|
|
$map[$key][] =[
|