Explorar o código

Merge remote-tracking branch 'origin/master'

yuang %!s(int64=4) %!d(string=hai) anos
pai
achega
7c7890947c

+ 3 - 0
app/Console/Commands/SyncBatchTask.php

@@ -3,6 +3,7 @@
 namespace App\Console\Commands;
 
 use App\Jobs\BatchTaskJob;
+use App\Jobs\BroadcastBatchToZhengCangJob;
 use App\Order;
 use App\OrderBin;
 use App\Services\BatchService;
@@ -246,6 +247,7 @@ sql;
             app("BatchService")->checkBatchOrderInfo($updatingBatches);
             LogService::log(__METHOD__,"波次注册一入口",json_encode($updatingBatches));
             BatchTaskJob::dispatch($updatingBatches);    //在这里为波次注册队列任务!
+            BroadcastBatchToZhengCangJob::dispatch($updatingBatches);    //在这里为波次注册祯仓推送任务!
         }
         if ($map){
             $waveCodes = array_keys($map);
@@ -273,6 +275,7 @@ sql;
                 app("BatchService")->checkBatchOrderInfo($batches);
                 LogService::log(__METHOD__,"波次注册二入口",json_encode($batches));
                 BatchTaskJob::dispatch($batches);    //在这里为波次注册队列任务!
+                BroadcastBatchToZhengCangJob::dispatch($batches);    //在这里为波次注册祯仓推送任务!
             }
         }
         ValueStore::query()->where("name","wave_detail_last_sync_date")->update(["value"=>$details[count($details)-1]->edittime]);

+ 5 - 5
app/DeliveryAppointment.php

@@ -33,15 +33,15 @@ class DeliveryAppointment extends Model
     ];
     //时段 映射date_period字段 必须有序 否则展示数据错乱
     const PERIOD=[
-        0 => "09-11",
-        1 => "12-14",
-        2 => "14-18",
+        0 => "09-12",
+        1 => "13-15",
+        2 => "15-17",
     ];
     //时长 映射PERIOD常量
     const HOUR=[
         0 => 3,
-        1 => 3,
-        2 => 5,
+        1 => 2,
+        2 => 2,
     ];
     //状态
     const STATUS=[

+ 1 - 0
app/DeliveryAppointmentCar.php

@@ -19,6 +19,7 @@ class DeliveryAppointmentCar extends Model
         "appointment_number",
         "delivery_time",
         "status",
+        "unloaded_at",
     ];
     const STATUS = [
         0 => "未送达",

+ 1 - 1
app/Events/DeliveryAppointmentEvent.php

@@ -46,7 +46,7 @@ class DeliveryAppointmentEvent implements ShouldBroadcastNow
         $delivery->period = isset($delivery->deliveryAppointment->date_period) ? ($delivery->deliveryAppointment->date_period==0 ? '上午' : '下午') : '';
         $delivery->delivery_time = $delivery->delivery_time ? substr($delivery->delivery_time,11,5) : '';
 
-        $delivery->morrow = $delivery->deliveryAppointment->appointment_date == date('Y-m-d',strtotime("+1 day"));
+        $delivery->morrow = $delivery->deliveryAppointment->appointment_date != date('Y-m-d'/*,strtotime("+1 day")*/);
         $this->delivery = $delivery->withoutRelations();
     }
 

+ 17 - 7
app/Http/ApiControllers/InventoryController.php

@@ -11,6 +11,7 @@ use App\Services\AndroidInventoryService;
 use App\Services\InventoryAccountService;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Log;
+use phpDocumentor\Reflection\Types\Object_;
 
 class InventoryController
 {
@@ -102,7 +103,11 @@ class InventoryController
         $taskId = $request->input("taskId");
         $location = $request->input("location");
         $res=app('AndroidInventoryService')->getLocInvPro($taskId,$location);
-        $this->response($res);
+        if ($res===0){
+            $this->response(null,410,"库位不存在!");
+        }else{
+            $this->response($res);
+        }
     }
 
     /**
@@ -159,6 +164,7 @@ class InventoryController
      * @apiSuccess {string} message 响应描述
      * @apiSuccess {int} status_code HTTP响应码
      * @apiSuccess {array} data 数据列表
+     * @apiSuccess {bool} isDiff 是否差异
      *
      * @apiSuccessExample {json} Success-Response:
      *     HTTP/1.1 200 OK
@@ -166,10 +172,11 @@ class InventoryController
      *       "message": "请求成功",
      *       "status_code": "200"
      *       "data":[
+     *          “isDiff”=>“是否差异",
      *          "notStocktakingList"=>[
      *                  {
-     *                        "id"=>"盘点任务明细号",
      *                        "location"=>"库位",
+     *                        "count"=>"待盘数量",
      *                  }
      *              ]
      *        ]
@@ -177,7 +184,6 @@ class InventoryController
      */
     public function stockInventory(Request $request)
     {
-        Log::error('执行开始',[now()->toDateTimeString()]);
         $task_item_id = $request->input("task_item_id");
         $verified_amount = $request->input("verified_amount");
         /**
@@ -190,16 +196,20 @@ class InventoryController
         if (!$inventoryAccountMission)$this->response(null,410,'未查询到盘点明细');
         $task_id=$inventoryAccountMission->inventory_account_id;
         if (!$request->has('produced_at')&&!$request->has('valid_at')&&!$request->has('batch_number')){
-            $stockService->盘点($task_id,$verified_amount,$inventoryAccountMission);
+            $stockDetail=$stockService->盘点($task_id,$verified_amount,$inventoryAccountMission);
         }else{
-            $stockService->盘点生产日期_失效日期_批号有改动任务($task_item_id, $verified_amount, $task_id,
+            $stockDetail=$stockService->盘点生产日期_失效日期_批号有改动任务($task_item_id, $verified_amount, $task_id,
                 $request->input('produced_at')??'', $request->input('valid_at')??'',
                 $request->input('batch_number')??'');
             $stockService->updateInventory($task_id);
         }
+        if ($stockDetail->difference_amount==0){
+            $isDiff=false;
+        }else{
+            $isDiff=true;
+        }
         $notStocktakingList=$service->getUnInventoryTaskList($task_id);
-        Log::error('执行结束',[now()->toDateTimeString()]);
-        $this->response($notStocktakingList);
+        $this->response(['isDiff'=>$isDiff,'notStocktakingList'=>$notStocktakingList]);
     }
 
     /**

+ 11 - 7
app/Http/Controllers/DeliveryAppointmentController.php

@@ -190,8 +190,8 @@ class DeliveryAppointmentController extends Controller
             DeliveryAppointmentCar::query()->insert($insert);
         });
         dispatch(new DeliveryAppointmentCheck($appointment->id))->delay(Carbon::parse($appointment->appointment_date." ".(explode("-",DeliveryAppointment::PERIOD[$appointment->date_period])[1]).":00:01"));
-        //当日或次日预约单广播
-        if (strtotime(date('Y-m-d',strtotime("+2 day")))>strtotime($appointment->appointment_date." 00:00:00")){
+        // x当日或次日预约单广播  √大于当前时间的都广播
+        if (strtotime($appointment->appointment_date." 00:00:00")>strtotime(date('Y-m-d'))){
             $appointment->load("cars");
             event(new DeliveryAppointmentEvent($appointment->cars[0]));
         }
@@ -246,7 +246,7 @@ class DeliveryAppointmentController extends Controller
         //当日或次日预约单广播
         $old = $appointment->appointment_date == date('Y-m-d') ? 0 : ($appointment->appointment_date == date('Y-m-d',strtotime('+1 day') ? 1 : 2));
         $new = $selectDate["date"] == date('Y-m-d') ? 0 : ($selectDate["date"] == date('Y-m-d',strtotime('+1 day') ? 1 : 2));
-        if ($old==2 && $new==2)$this->success(); //超过广播区间不推送
+        //if ($old==2 && $new==2)$this->success(); //超过广播区间不推送
         if (($old-$new)!=0 || $appointment->date_period!=$selectDate["time"]){
             $appointment->cars[0]->change = true;
             $appointment->cars[0]->old = $old;
@@ -385,8 +385,12 @@ class DeliveryAppointmentController extends Controller
             $query->withCount("cars")->with("owner");
         }])->whereHas("deliveryAppointment",function ($query)use($period,$warehouse,$date){
             /** @var Builder $query */
-            $query->where("appointment_date",$date)
-                ->where("warehouse_id",$warehouse)->whereIn("status",[0,2]);
+            if ($date){
+                $query->where("appointment_date",$date);
+            }else{
+                $query->where("appointment_date",">",date("Y-m-d"));
+            }
+            $query->where("warehouse_id",$warehouse)->whereIn("status",[0,2]);
         })->where(function ($query)use($period){
             /** @var Builder $query */
             $query->where("status",1)->orWhereHas("deliveryAppointment",function (Builder $query)use($period){
@@ -457,7 +461,7 @@ class DeliveryAppointmentController extends Controller
                     break;
             }
         }
-        $result = ["list"=>$list,"success"=>$success,"work"=>$work,"notReached"=>$notReached,"nextDay"=>$this->carList(0,date("Y-m-d",strtotime("+1 day")),$warehouse)];
+        $result = ["list"=>$list,"success"=>$success,"work"=>$work,"notReached"=>$notReached,"nextDay"=>$this->carList(0,/*date("Y-m-d",strtotime("+1 day"))*/null,$warehouse)];
         $nextTime = DeliveryAppointment::PERIOD[$index+1] ?? null;
         if ($nextTime){
             $nextTime = explode("-",$nextTime)[0];
@@ -567,7 +571,7 @@ html;
         if (!$car || !$car->deliveryAppointment)$this->error("单据不存在");
         if (!$car->delivery_time)$this->error("尚未签到");
         if (mb_substr($car->delivery_time,0,10)!=date('Y-m-d'))$this->error("禁止越天逾期操作");
-        $car->update(["status"=>2]);
+        $car->update(["status"=>2,"unloaded_at"=>date("Y-m-d H:i:s")]);
         $status = app("DeliveryAppointmentService")->checkFull($car->delivery_appointment_id);
         event(new DeliveryAppointmentEvent($car));
         $this->success($status);

+ 4 - 4
app/Http/Controllers/InventoryAccountController.php

@@ -329,21 +329,21 @@ class InventoryAccountController extends Controller
         if (is_null($count)) return ['success' => false, 'data' => '盘点数不能为空!'];
         if ($produced_at || $valid_at || $batch_number) {
             /** @var InventoryAccountService $inventoryAccountMission */
-            $inventoryAccountService = app('InventoryAccountService');
+            $inventoryAccountService = app('inventoryAccountService');
             $inventoryAccountMission = $inventoryAccountService->盘点生产日期_失效日期_批号有改动任务($id, $count, $inventoryId, $produced_at, $valid_at, $batch_number);
             if (!$inventoryAccountMission) return ['success' => false, 'data' => '盘点生产日期_失效日期_批号有改动任务失败!'];
             /** @var InventoryAccountService $inventoryService */
-            $inventoryService = app('InventoryAccountService');
+            $inventoryService = app('inventoryAccountService');
             $inventoryAccount = $inventoryService->updateInventory($inventoryId);
             $stockInventoryPersons = $inventoryAccountMission[0]->stockInventoryPersons;
             return ['success' => true, 'inventoryMission' => $inventoryAccountMission, 'inventory' => $inventoryAccount, 'stockInventoryPersons' => $stockInventoryPersons];
         } else {
             /** @var InventoryAccountService $inventoryAccountMission */
-            $inventoryAccountService = app('InventoryAccountService');
+            $inventoryAccountService = app('inventoryAccountService');
             $inventoryAccountMission = $inventoryAccountService->盘点选中任务($id, $count, $inventoryId);
             if (!$inventoryAccountMission) return ['success' => false, 'data' => '盘点选中任务失败!'];
             /** @var InventoryAccountService $inventoryService */
-            $inventoryService = app('InventoryAccountService');
+            $inventoryService = app('inventoryAccountService');
             $inventoryAccount = $inventoryService->updateInventory($inventoryId);
             $stockInventoryPersons = $inventoryAccountMission->stockInventoryPersons;
             return ['success' => true, 'inventoryMission' => $inventoryAccountMission, 'inventory' => $inventoryAccount, 'stockInventoryPersons' => $stockInventoryPersons];

+ 33 - 67
app/Http/Controllers/TestController.php

@@ -179,22 +179,41 @@ class TestController extends Controller
     public function test1(\Closure $c,string $a){
         dd($c($a));
     }
-    public function test(Request $request)
+    private function paramDefault(&$waybill):array
     {
-        foreach (Batch::query()->where("created_at",">=","2021-12-18 00:00:00")->get() as $bat){
-            $this->assignBatch($bat->code);
+        $update = [];
+        if (!$waybill->order_type){
+            $update["order_type"] = $waybill->order_type = Waybill::ORDER_TYPE_DEFAULT;
         }
-        dd("OK");
-        $user = User::query()->where("name","yanyuanmin")->first();
-        dd($user->id);
-        dd($codes = app('OwnerService')->getQuery($user->id)->select("code")->pluck("code"));
-
-
-        $ownerIds=app('UserService')->getPermittingOwnerIds($user);
-        $owners =  Owner::query()->select("id","name","code")->whereIn('id', $ownerIds)->whereNull('deleted_at')->get();
-        $codes = array_column($owners->toArray(), 'code');
-        dd($codes);
-        dd(Order::class);
+        if (!$waybill->transport_type){
+            $update["transport_type"] = $waybill->transport_type = "JZKH";
+        }
+        if (!$waybill->cargo_name){
+            $update["cargo_name"] = $waybill->cargo_name = "补货";
+        }
+        if (!$waybill->total_number){
+            $update["total_number"] = $waybill->total_number = 1;
+        }
+        if (!$waybill->total_weight){
+            $update["total_weight"] = $waybill->total_weight = 1;
+        }
+        if (!$waybill->package_service){
+            $update["package_service"] = $waybill->package_service = '托膜';
+        }
+        if (!$waybill->deliveryType){
+            $update["deliveryType_id"] = $waybill->deliveryType_id = 3;
+        }
+        if (!$waybill->pay_type){
+            $update["pay_type"] = $waybill->pay_type = Waybill::PAY_TYPE_DEFAULT;
+        }
+        if (!$waybill->back_sign_bill){
+            $update["back_sign_bill"] = $waybill->back_sign_bill = Waybill::BACK_SIGN_BILL_DEFAULT;
+        }
+        return $update;
+    }
+    public function test(Request $request)
+    {
+        dd(1);
         $c = "test";
         $a = function ($b)use($c){
             return $b.$c;
@@ -239,31 +258,6 @@ class TestController extends Controller
         $service->syncWorkOrder($rejected_bill);
     }
 
-    public function changeWorkOrder(){
-        $type = OrderIssueType::query()->where('name' ,'拦截')->first();
-
-        WorkOrder::query()->where('order_issue_type_id',$type->id)
-            ->where('status',[4,5])
-            ->where('process_progress','拦截成功')
-            ->update(['process_progress' => '成功已退回,不赔偿']);
-
-        WorkOrder::query()->where('order_issue_type_id',$type->id)
-            ->whereIn('status',[4,5])
-            ->where('process_progress','拦截失败')
-            ->update(['process_progress' => '无法拦截']);
-
-
-        WorkOrderDetail::query()->where('order_issue_type_id',$type->id)
-            ->where('status',[4,5])
-            ->where('process_progress','拦截成功')
-            ->update(['process_progress' => '成功已退回,不赔偿']);
-
-        WorkOrderDetail::query()->where('order_issue_type_id',$type->id)
-            ->whereIn('status',[4,5])
-            ->where('process_progress','拦截失败')
-            ->update(['process_progress' => '无法拦截']);
-    }
-
 
     public function assignBatch($code)
     {
@@ -309,34 +303,6 @@ class TestController extends Controller
         app("BatchService")->assignTasks($batches);
     }
 
-    public function inventory()
-    {
-        $location='H05-35-04';
-        $inventoryAccountId=792;
-        $barcode='6973244250033';
-        $inventoryAccountMission=InventoryAccountMission::with(['commodity.barcodes','stockInventoryPersons'])
-            ->whereHas('commodity',function($query)use($barcode){
-            $query->whereHas('barcodes',function($sql)use($barcode){
-                $sql->where('code','=',$barcode);
-            });
-        })->where('location',$location)->where('inventory_account_id',$inventoryAccountId)->toSql();
-        dd($inventoryAccountMission);
-
-    }
-
-    public function testZC()
-    {
-//        $batches=Batch::query()->where('id',1)->get();
-//        BroadcastBatchToZhengCangJob::dispatch($batches);    //在这里为波次注册队列任务!
-        $taskId=792;
-        $location='H05-35-04';
-        $barcode='6931481255587';
-        /** @var AndroidInventoryService $service */
-        $service=app('AndroidInventoryService');
-        $inventoryAccountMission=$service->getInventoryDetail($taskId,$location,$barcode);
-        dd($inventoryAccountMission->stockInventoryPersons);
-    }
-
 
 
 }

+ 6 - 0
app/InventoryAccountMission.php

@@ -24,6 +24,12 @@ class InventoryAccountMission extends Model
         return $this->hasMany('App\Sign','signable_id','id')
             ->where('signable_type','inventory_account_missions')->where('field','盘点人');
     }
+    public function getProducedAtAttribute($value){
+        return substr($value,0,10);
+    }
+    public function getValidAtAttribute($value){
+        return substr($value,0,10);
+    }
     public function createSignStockInventoryPersons(){
         return Sign::query()->firstOrCreate([
             'signable_type'=>'inventory_account_missions',

+ 16 - 6
app/Jobs/BroadcastBatchToZhengCangJob.php

@@ -3,7 +3,10 @@
 namespace App\Jobs;
 
 use App\Batch;
+use App\Exceptions\ErrorException;
+use App\Log;
 use App\Services\ForeignZhenCangService;
+use App\Services\LogService;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
 use Illuminate\Foundation\Bus\Dispatchable;
@@ -35,12 +38,19 @@ class BroadcastBatchToZhengCangJob implements ShouldQueue
     {
         /** @var ForeignZhenCangService  $foreignZhenCangService */
         $foreignZhenCangService=app('ForeignZhenCangService');
-        //TODO 限定指定货主波次
-        foreach ($this->batches as &$batch){
-            $batch->loadMissing([
-                'orders.orderCommodities.commodity.barcodes'
-            ]);
-            $foreignZhenCangService->broadcastBatch($batch);
+        if(!$this->batches){throw new ErrorException('波次任务中波次不存在!');}
+        $batchCollect=collect($this->batches);
+        //暂时直接指定 375 妍柯货主
+        $batches=Batch::query()->where('owner_id',375)->whereIn('id',data_get($batchCollect,'*.id'))->get();
+        try {
+            foreach ($batches as &$batch) {
+                $batch->loadMissing([
+                    'orders.orderCommodities.commodity.barcodes'
+                ]);
+                $foreignZhenCangService->broadcastBatch($batch);
+            }
+        } catch (\Exception $e) {
+            LogService::log(__METHOD__,'BroadcastBatchToZhengCangJob','波次任务推送祯仓失败'.json_encode($e->getMessage()));
         }
     }
 }

+ 9 - 7
app/Observers/WaybillObserver.php

@@ -24,17 +24,19 @@ class WaybillObserver
                 return;
             }
             $update = $this->paramDefault($waybill);
+            $waybill->update($update);
             $bill = app('DbOpenService')->getDbOrderNo($waybill);
             if (!$bill || $bill["result"]=="false"){
-                Log::error("德邦单号获取失败",["no"=>$waybill->waybill_number,"info"=>$bill]);
+                Log::error("德邦单号获取失败",["no"=>$waybill->toArray(),"info"=>$bill]);
                 return;
             }
-            $update["carrier_bill"] = $bill['mailNo'];
-            $update["waybill_number"] = $bill['mailNo'];
-            $update["station_no"] = $bill['stationNo'];
-            $update["arrived_org_simple_name"] = $bill['arrivedOrgSimpleName'];
-            $update["much_higher_delivery"] = $bill['muchHigherDelivery'];
-            $waybill->update($update);
+            $waybill->update([
+                "carrier_bill"=>$bill['mailNo'],
+                "waybill_number"=>$bill['mailNo'],
+                "station_no"=>$bill['stationNo'],
+                "arrived_org_simple_name"=>$bill['arrivedOrgSimpleName'],
+                "much_higher_delivery"=>$bill['muchHigherDelivery'],
+            ]);
             if (!app("WaybillService")->notifyFlux($waybill)){
                 Log::error("德邦单号回传FLUX失败",["no"=>$waybill->waybill_number,"info"=>$bill]);
                 return;

+ 48 - 27
app/Services/AndroidInventoryService.php

@@ -17,54 +17,75 @@ class AndroidInventoryService
     //未盘任务列表
     public function getUnInventoryTaskList($taskId)
     {
-        return  InventoryAccountMission::query()
+        $stock_status = InventoryAccount::query()->where('id', $taskId)->value('status');
+        $query = InventoryAccountMission::query()
             ->select('location')->selectRaw("count(*) count")
             ->where('inventory_account_id', $taskId)
-            ->where('checked', '否')->groupBy("location")
-            ->get();
+            ->groupBy("location");
+        if ($stock_status=='待盘点'||$stock_status=='盘点中'){ //初盘
+            return $query->where('checked', '否')->get();
+        }elseif ($stock_status=='复盘中'){  //复盘
+            return $query->where('checked', '是')->whereNotNull('difference_amount')->get();
+        }else{
+            return collect();
+        }
+
     }
+
     //根据员工姓名获取当日盘点行数
     public function getStaffSameDayInvCount(): int
     {
-         return Sign::query()
+        return Sign::query()
             ->where('signable_type', 'inventory_account_missions')
             ->where('field', '盘点人')
             ->where('created_at', 'like', Carbon::now()->toDateString() . '%')
             ->where('mark', Auth::user()['name'])->count();
     }
-    public function getLocInvPro($taskId,$location): array
+
+    public function getLocInvPro($taskId, $location)
     {
-        $ins=InventoryAccountMission::query()
-            ->where('inventory_account_id',$taskId)
-            ->where('location',$location)->get();
+        $ins = InventoryAccountMission::query()
+            ->where('inventory_account_id', $taskId)
+            ->where('location', $location)->get();
         //库位盘点任务总条数
-        $total=$ins->count();
+        $total = $ins->count();
         //已盘数
-        $invCount=$ins->where('checked','<>','否')->count();
-        return ['total'=>$total,'invCount'=>$invCount];
+        $invCount = $ins->where('checked', '<>', '否')->count();
+        if ($total == 0 && $invCount == 0) {
+            return 0;//库位不存在
+        } else {
+            return ['total' => $total, 'invCount' => $invCount];
+        }
+
     }
+
     //根据盘点任务号,库位,条码 查询指定盘点任务
-    public function getInventoryDetail($taskId,$location,$barcode)
+    public function getInventoryDetail($taskId, $location, $barcode)
     {
-        return Cache::remember($taskId.'_'.$location.'_'.$barcode, 300, function ()use($taskId,$location,$barcode) {
-            return InventoryAccountMission::with(['commodity.barcodes','stockInventoryPersons'])
-                ->whereHas('commodity',function($query)use($barcode){
-                    $query->whereHas('barcodes',function($sql)use($barcode){
-                        $sql->where('code','=',$barcode);
-                    });
-                })->where('location',$location)
-                ->where('inventory_account_id',$taskId)
-                ->where('checked','否')
-                ->first();
-        });
+        $stock_status = InventoryAccount::query()->where('id', $taskId)->value('status');
+        $query = InventoryAccountMission::with(['commodity.barcodes', 'stockInventoryPersons'])
+            ->whereHas('commodity', function ($query) use ($barcode) {
+                $query->whereHas('barcodes', function ($sql) use ($barcode) {
+                    $sql->where('code', '=', $barcode);
+                });
+            })->where('location', $location)
+            ->where('inventory_account_id', $taskId);
+        if ($stock_status == '待盘点' || $stock_status == '盘点中') { //初盘
+            return $query->where('checked', '否')->first();
+        } elseif ($stock_status == '复盘中') { //复盘
+            return $query->where('checked', '是')->whereNotNull('difference_amount')->first();
+        } else {
+            return null;
+        }
     }
+
     public function skipInventory($inventoryDetailId)
     {
-        $inventoryAccountMission=InventoryAccountMission::query()->find($inventoryDetailId);
-        if (!$inventoryAccountMission)return null;
-        $inventoryAccountMission->checked='跳过';
+        $inventoryAccountMission = InventoryAccountMission::query()->find($inventoryDetailId);
+        if (!$inventoryAccountMission) return null;
+        $inventoryAccountMission->checked = '跳过';
         $inventoryAccountMission->update();
-        if ($inventoryAccountMission->checked=='跳过'){
+        if ($inventoryAccountMission->checked == '跳过') {
             /** @var InventoryAccountService $inventoryService */
             $inventoryService = app('inventoryAccountService');
             $inventoryService->updateInventory($inventoryAccountMission->inventory_account_id);

+ 0 - 1
app/Services/DbOpenService.php

@@ -5,7 +5,6 @@ namespace App\Services;
 use App\Components\ErrorPush;
 use App\Traits\ServiceAppAop;
 use Illuminate\Database\Eloquent\Model;
-use Illuminate\Support\Facades\Log;
 
 
 class DbOpenService

+ 0 - 1
app/Services/ForeignZhenCangService.php

@@ -38,7 +38,6 @@ class ForeignZhenCangService
             }
         }
         $body['slots']=array_values($result);
-        dd($body);
         $response = Http::post('http://zc-it.cn/api/createBatch',$body);
     }
 }

+ 32 - 0
database/migrations/2021_12_21_161432_change_delivery_appointment_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class ChangeDeliveryAppointmentTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('delivery_appointment_cars', function (Blueprint $table) {
+            $table->timestamp("unloaded_at")->nullable()->comment("卸货完成时间");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('delivery_appointment_cars', function (Blueprint $table) {
+            $table->dropColumn("unloaded_at");
+        });
+    }
+}

+ 1 - 1
resources/views/store/deliveryAppointment/exhibition.blade.php

@@ -147,7 +147,7 @@
             </div>
             <div class="col-4">
                 <div class="w-100 text-center">
-                    <h2 class="font-weight-bold">次日预约</h2>
+                    <h2 class="font-weight-bold">后续预约</h2>
                 </div>
                 <table class="table w-100 h4">
                     <tr>

+ 8 - 2
resources/views/store/deliveryAppointment/list.blade.php

@@ -66,10 +66,15 @@
                 <td><span v-html="warpText(info.asn_number)"></span></td>
                 <td class="text-primary">@{{ info.appointment_date }}&nbsp;&nbsp;@{{ info.period }}</td>
                 <td>@{{ info.created_at }}</td>
+                <td>
+                    <div>
+                        @{{ info.cars[0].delivery_time }}
+                    </div>
+                </td>
                 <td>
                     <div>
                         @can("入库管理-入库预约-预约管理-卸货完成")<button class="btn btn-sm btn-outline-success" @click="unloading(i,0)" v-if="info.cars[0].status==1">卸货完成</button>@endcan
-                        <div v-if="info.cars[0].status==2">@{{ info.cars[0].delivery_time }}</div>
+                        <div v-if="info.cars[0].status==2">@{{ info.cars[0].unloaded_at }}</div>
                     </div>
                 </td>
                 <td>
@@ -248,7 +253,8 @@
                         {name:'asn_number',value: 'ASN单号', class:"td-warm"},
                         {name:'appointment_date',value: '预约时间', class:"td-warm"},
                         {name:'created_at',value: '创建时间', class:"td-warm"},
-                        {name:'delivery_time',value: '操作/送达时间', neglect: true, class:"td-warm"},
+                        {name:'delivery_time',value: '签到时间', neglect: true, class:"td-warm"},
+                        {name:'unloaded_at',value: '卸货时间', neglect: true, class:"td-warm"},
                         {name:'owner_id',value: '货主', class:"td-warm"},
                         {name:'tonne',value: '重量/吨', class:"td-warm"},
                         {name:'cubic_meter',value: '体积/立方', class:"td-warm"},