Просмотр исходного кода

Merge branch 'Haozi'

# Conflicts:
#	app/Http/Controllers/TestController.php
zhouzhendong 4 лет назад
Родитель
Сommit
a11c8cca79

+ 3 - 2
app/Http/Controllers/HandInStorageController.php

@@ -120,8 +120,9 @@ class HandInStorageController extends Controller
         }
         if ($info['customerid']=='JIANSHANG'&&$handInStorageService->checkForwardingLoc($info)===1)$this->error('请维护拣货位');
         try {
-            $result = $handInStorageService->fluxHandIn($info);
-            if ($result){
+            $resultIn = $handInStorageService->fluxHandIn($info);
+            if ($resultIn===1)$this->error("超收");
+            if ($resultIn){
                 $asnQty=$handInStorageService->getAsnQty($info['asnno']);
                 $end=microtime(true);
                 if(($end-$start)>2)Log::warning('手持收货超时',$request->all());

+ 92 - 48
app/Http/Controllers/TestController.php

@@ -45,16 +45,15 @@ use App\Services\BatchService;
 use App\Services\CacheShelfService;
 use App\Services\ForeignHaiRoboticsService;
 use App\Services\OrderPackageReceivedSyncService;
-use App\Services\OrderPackageService;
 use App\Services\OrderService;
 use App\Services\OwnerFeeTotalService;
 use App\Services\OwnerLogisticFeeReportService;
 use App\Services\OwnerPriceOperationService;
 use App\Services\OwnerStoreFeeReportService;
 use App\Services\OwnerStoreOutFeeReportService;
-use App\Services\ReviewService;
 use App\Services\StationService;
 use App\Services\StorageService;
+use App\Services\StoreService;
 use App\Station;
 use App\StationTask;
 use App\StationTaskMaterialBox;
@@ -105,10 +104,73 @@ class TestController extends Controller
         return call_user_func([$this, $method], $request);
     }
 
-    public function test()
+    private function valFormat($val):?string
     {
+        if ($val!==null){
+            $ret = date("Y-m-d H:i:s",strtotime($val))===(string)$val;
+            if ($ret)$val = "to_date('".$val."','yyyy-mm-dd hh24:mi:ss')";
+            else $val = "'".$val."'";
+        }else $val = "null";
+        return $val;
+    }
 
+    public function test1($task,$amount){
+        DB::connection("oracle")->beginTransaction();
+        try {
+            $columns = '';
+            $values = '';
+            foreach ($task as $key => $val) {
+                if (Str::upper($key) == 'TASKID_SEQUENCE') {
+                    $taskMax = DB::connection("oracle")->selectOne(DB::raw("select MAX(TASKID_SEQUENCE) maxseq from TSK_TASKLISTS where taskid = ?"), [$task->taskid]);
+                    $val = $taskMax->maxseq + 1;
+                }
+                if (Str::upper($key) == 'FMQTY' || Str::upper($key) == 'FMQTY_EACH'
+                    || Str::upper($key) == 'PLANTOQTY' || Str::upper($key) == 'PLANTOQTY_EACH') {
+                    $val -= $amount;
+                    $task->$key = $amount;
+                }
+                $columns .= $key . ",";
+                $values .= $this->valFormat($val) . ",";
+            }
+            $columns = mb_substr($columns, 0, -1);
+            $values = mb_substr($values, 0, -1);
+            $sql = <<<sql
+    INSERT INTO TSK_TASKLISTS({$columns}) VALUES({$values})
+sql;
+            dd($sql);
+        } catch (\Exception $e) {
+            dd($e);
+        }
+    }
 
+    public function test()
+    {
+        $a = "2021-09-13 00:00:00";
+        dd(mb_substr($a,0,10));
+        $models = app("MaterialBoxModelService")->getModelSortedByOwner(null);
+        foreach ($models as $model){
+            $box = app("MaterialBoxService")->getAnEmptyBox($model,[],2);
+            dd($box);
+            if ($box)return $box;
+        }
+        dd();
+        TaskTransaction::query()->where("id",">=",280)->delete();
+        /*$a= new StorageService();
+        $a->clearTask(["HAIB1-01-01"]);
+        $task = StationTaskMaterialBox::query()->find(90233);
+        $station = Station::query()->find(11);
+        $foreignHaiRoboticsService = new ForeignHaiRoboticsService();
+        $foreignHaiRoboticsService->putBinToStore_fromCacheShelf($task, $station);
+        dd(1);*/
+        /*$batchService = new BatchService();
+        $batches = Batch::query()->where("id",171829)->get();
+        $batchService->assignTasks($batches);
+        dd();*/
+        /*TaskTransaction::query()->where("id",">=",277)->delete();
+        StationTaskMaterialBox::query()->whereIn("id",[89685,89686,89687])->delete();
+        app("CacheShelfService")->_stationCacheLightOff("HAIB1-01-01");//灭灯
+        app("CacheShelfService")->_stationCacheLightOff("HAIB1-02-01");//灭灯
+        dd(1);*/
         Station::query()->where("station_type_id", 5)->update(["status" => 1]);
         Cache::forget("CACHE_SHELF_AVAILABLE");
         $station = ["HAIB1-01-01", "HAIB1-02-01"];
@@ -303,26 +365,25 @@ sql;
             ]);
     }
 
-    public function syncOrderPackage()
-    {
-        ini_set('memory_limit', '500M');
+    public function syncOrderPackage(){
+        ini_set('memory_limit','500M');
         ini_set('max_execution_time', 0);
         $orderPackingSummary = OracleDocOrderPackingSummary::query()
-            ->where('editTime', '>=', '2021-09-11 12:00:00')
-            ->where('editTime', '<=', '2021-09-12 12:40:00')
+            ->where('editTime','>=','2021-09-11 12:00:00')
+            ->where('editTime','<=','2021-09-12 12:40:00')
             ->get();
 
         $orderPackingSummary_chunk = $orderPackingSummary->chunk(200);
         foreach ($orderPackingSummary_chunk as $orderPackingSummarys) {
             foreach ($orderPackingSummarys as $orderPackingSummary) {
-                $orderPackage = OrderPackage::query()->where('logistic_number', $orderPackingSummary->traceid)->first();
+                $orderPackage = OrderPackage::query()->where('logistic_number',$orderPackingSummary->traceid)->first();
                 $orderPackage->update([
-                    'uploaded_to_wms' => true,
-                    'weight' => $orderPackingSummary->grossweight,
-                    'length' => $orderPackingSummary->length,
-                    'width' => $orderPackingSummary->width,
-                    'height' => $orderPackingSummary->height,
-                    'weighed_at' => $orderPackingSummary->edittime
+                    'uploaded_to_wms'=> true,
+                    'weight'=>$orderPackingSummary->grossweight,
+                    'length'=>$orderPackingSummary->length,
+                    'width'=>$orderPackingSummary->width,
+                    'height'=>$orderPackingSummary->height,
+                    'weighed_at'=>$orderPackingSummary->edittime
                 ]);
                 dispatch(new WeightUpdateInstantBill($orderPackage));
             }
@@ -330,39 +391,22 @@ sql;
         return ['success' => true];
     }
 
-    public function collectUpload()
-    {
-        /** @var OrderPackageService $service */
-        $service = app('OrderPackageService');
-        return $service->collectUpload([
-            '75803656098638',
-            '75803656098612'
-        ]);
-    }
-
-    public function init_在途异常()
+    public function testChangeLabor()
     {
-//        $logistic_numbers = OrderPackage::query()
-//            ->select('logistic_number')
-//            ->where('exception_status', 5)
-//            ->where('created_at', '>=', now()->subDays(20)->toDateTimeString())
-//            ->pluck('logistic_number');
-//
-        /** @var OrderPackageReceivedSyncService $service */
-        $service = app('OrderPackageReceivedSyncService');
-//        $service->syncLogisticRoute(false, $logistic_numbers);
-
-
-        $logistic_numbers = OrderPackage::query()
-            ->select(['logistic_number', 'order_id', 'id'])
-            ->whereIn('order_id', function ($query) {
-                $query->from('orders')->selectRaw('id')->whereIn('logistic_id', function ($builder) {
-                    $builder->from('logistics')->selectRaw('id')->where('type', '=', '快递')->whereNotIn('belong_company', ['顺丰', '中通', '韵达', '圆通', '京东']);
-                });
-            })
-            ->where('exception_status', 5)
-            ->where('created_at', '>=', now()->subDays(20)->toDateTimeString())
-            ->pluck('logistic_number');
-        $service->syncLogisticRouteByAliJiSu($logistic_numbers);
+        $laborReports=LaborReport::query()
+            ->where('created_at','like','2021-09-13%')
+            ->where('user_workgroup_id',4)
+            ->where('online_duration','>',13)
+            ->get();
+        foreach ($laborReports as $laborReport){
+          LaborReport::query()->find($laborReport->id)
+              ->update([
+                  'online_duration'=>round(Carbon::parse($laborReport->check_out_at)->diffInSeconds(Carbon::parse($laborReport->check_in_at))/3600,2),
+                  'working_duration'=>(round(Carbon::parse($laborReport->check_out_at)->diffInSeconds(Carbon::parse($laborReport->check_in_at))/3600,2)-1),
+              ]);
+          LaborReportStatus::query()->where('labor_report_id',$laborReport->id)
+              ->where('status','已退场')
+              ->update(['created_at'=>$laborReport->check_out_at]);
+        }
     }
 }

+ 57 - 42
app/Services/HandInStorageService.php

@@ -538,13 +538,12 @@ sql;
         return $arr;
     }
 
-
     /**
      * @param array $info
-     * @return bool
+     * @return bool|int
      * fulx 手持收货
      */
-    public function fluxHandIn(array $info): bool
+    public function fluxHandIn(array $info)
     {
         $lotatt = array_filter($info, function ($key) {
             return strpos($key, 'lotatt') === 0;
@@ -563,29 +562,34 @@ sql;
         $db = DB::connection("oracle");
         $db->beginTransaction();
         try {
-//        return DB::connection("oracle")->transaction(function () use ($info, $invlotatt, $who, $time) {
-            //flux 批次号
+            $asnHeader = OracleDOCASNHeader::query()->where('asnno', $info['asnno'])->first();
+            $asnDetail = OracleDOCASNDetail::query()->where('asnno', $info['asnno'])
+                ->where('asnlineno', $info['asnlineno'])->where('sku', $info['sku'])->first();
+            // 1:flux 获取批次号
             $lotNum = $this->getOrCreateLotNum($info, $invlotatt, $who, $time);
             if (!$lotNum){$db->rollBack();return false;}
 
-            //flux 创建入库事务
-            $actTransactionLog = $this->setFluxActTransactionLog($info, $lotNum, $who, $time);
+            // 2:flux 判断当前入库是否超收
+            $res=$this->judgeOverCharge($info,$asnDetail);
+            if (!$res) return 1; //超收
+
+            // 3:flux 创建状态为创建的入库事务
+            $actTransactionLog = $this->setFluxActTransactionLog($info, $lotNum, $who, $time,$asnHeader,$asnDetail);
             if (count($actTransactionLog) == 0){$db->rollBack();return false;}
-            //flux 创建上架任务
-            $res=$this->setFluxTskTaskListPA($info, $invlotatt, $actTransactionLog, $who, $time);
-            if (!$res){$db->rollBack();return false;}
-            //flux 完善库存余量
+
+            // 4:flux 新增一条上架任务记录
+            $this->setFluxTskTaskListPA($info, $invlotatt, $actTransactionLog, $who, $time);
+
+            // 5:flux 完善库存余量 入库完成修改库存余量
             $this->updateFluxInv($info, $lotNum, $who, $time, $actTransactionLog);
-            //flux 更新asn_detail 和 asn_header 状态
+
+            // 6: flux 更新 asn_detail 和 asn_header 状态
             $result=$this->updateFluxAsn($info, $invlotatt, $time, $who);
-            if ($result){
-                $db->commit();
-                return true;
-            }else{
-                $db->rollBack();
-                return false;
-            }
-//        });
+            if (!$result){$db->rollBack();return false;}
+            // 7:入库完成 -> 事务状态改为完成
+            // $this->updateActTransactionLogStatus($actTransactionLog,$time);
+            $db->commit();
+            return true;
         } catch (\Exception $e) {
             $db->rollBack();
             return false;
@@ -593,6 +597,34 @@ sql;
 
     }
 
+    /**
+     * @param array $actTransactionLog
+     * @param $time
+     * 更改事务表状态
+     */
+//    public function updateActTransactionLogStatus(array $actTransactionLog,$time)
+//    {
+//        $db = DB::connection("oracle");
+//        $db->update(DB::raw("UPDATE ACT_TRANSACTION_LOG SET status = '99',edittime = TO_DATE(?,'yyyy-mm-dd hh24:mi:ss') WHERE transactionid = ?"),
+//            [$time, $actTransactionLog['trid']]);
+//
+//    }
+    /**
+     * @param array $info
+     * @param $asnDetail
+     * @return bool
+     * 判断是否超收
+     */
+    public function judgeOverCharge(array $info,$asnDetail): bool
+    {
+        //添加超收判断
+        $actTransactionLogQty = OracleActTransactionLog::query()->where('docno', $info['asnno'])
+            ->where('status','99')->where('transactiontype','IN')//事务状态,类型限定
+            ->where('doclineno', $info['asnlineno'])->where('fmsku', $info['sku'])->count('fmqty');
+        if ((int)($info['amount'] + $actTransactionLogQty) > (int)$asnDetail['expectedqty']) return false;
+        return true;
+    }
+
     /**
      * @param array $info
      * @param array $invlotatt
@@ -670,7 +702,6 @@ sql;
     public function updateFluxInv(array $info, $lotNum, $who, $time, array $actTransactionLog)
     {
         $db = DB::connection("oracle");
-//        $db->transaction(function () use ($db, $info, $lotNum, $actTransactionLog, $who, $time) {
         //更新 inv_lot 批次 库存表
         $invLot = $db->selectOne(DB::raw("SELECT * FROM INV_LOT WHERE lotnum = ? AND customerid = ? AND sku = ? FOR UPDATE"), [
             $lotNum, $info['customerid'], $info['sku']
@@ -722,7 +753,6 @@ sql;
                 $lotNum, $actTransactionLog['location'], $actTransactionLog['trackid'], $actTransactionLog['customerid'], $actTransactionLog['sku'], (int)$info['amount'], (int)$info['amount'], $time, $who, $time, $who,
             ]);
         }
-//        });
     }
 
     /**
@@ -731,19 +761,17 @@ sql;
      * @param $actTransactionLog
      * @param $who
      * @param $time
-     * @return bool
      * 生成上架任务
      */
-    public function setFluxTskTaskListPA(array $info, array $invlotatt, $actTransactionLog, $who, $time): bool
+    public function setFluxTskTaskListPA(array $info, array $invlotatt, $actTransactionLog, $who, $time)
     {
         $db = DB::connection("oracle");
-//        $db->transaction(function () use ($db, $info, $invlotatt, $actTransactionLog, $who, $time) {
         $sql = <<<sql
 INSERT INTO TSK_TASKLISTS VALUES(?,'1','PA',?,?,'ASN',?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,null,null,?,?,?,?,?,?,?,?,null,null,null,null,
     0,0,0,0,null,?,null,null,null,?,TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),null,null,?,TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),?,TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),'N',null,null,
     ?,?,?,'N',null,?,'*',null,null,null,'N',null,null)
 sql;
-        return $db->insert(DB::raw($sql), [
+        $db->insert(DB::raw($sql), [
             $actTransactionLog['tsid'], $actTransactionLog['customerid'], $actTransactionLog['sku'], $actTransactionLog['docno'], $actTransactionLog['doclineno'],
             $actTransactionLog['lotNum'], $actTransactionLog['packid'], 'EA', $info['amount'], $info['amount'], $actTransactionLog['location'], $actTransactionLog['location'],
             $actTransactionLog['trackid'], $actTransactionLog['lotNum'], $actTransactionLog['packid'], 'EA', $info['amount'], $info['amount'],
@@ -751,7 +779,6 @@ sql;
             $invlotatt['lotatt05'], $invlotatt['lotatt06'], $invlotatt['lotatt07'], $invlotatt['lotatt08'], $actTransactionLog['trid'], $who, $time, null, null, null, null,
             $actTransactionLog['userdefine1'], $actTransactionLog['userdefine2'], $actTransactionLog['userdefine3'], $actTransactionLog['warehouseid']
         ]);
-//        });
     }
 
     /**
@@ -759,24 +786,16 @@ sql;
      * @param $lotNum
      * @param $who
      * @param $time
+     * @param $asnHeader
+     * @param $asnDetail
      * @return array
      * 创建入库事务
      */
-    public function setFluxActTransactionLog(array $info, $lotNum, $who, $time): array
+    public function setFluxActTransactionLog(array $info, $lotNum, $who, $time,$asnHeader,$asnDetail): array
     {
         $db = DB::connection("oracle");
-//        return $db->transaction(function () use ($db, $info, $lotNum, $time, $who) {
         if ($info['trackNumber']) $trackNumber = $info['trackNumber'];
         else $trackNumber = substr(md5($time), 0, 30);
-        $asnHeader = OracleDOCASNHeader::query()->where('asnno', $info['asnno'])->first();
-        $asnDetail = OracleDOCASNDetail::query()->where('asnno', $info['asnno'])
-            ->where('asnlineno', $info['asnlineno'])->where('sku', $info['sku'])->first();
-        //添加超收判断
-        $actTransactionLogQty = OracleActTransactionLog::query()->where('docno', $info['asnno'])
-            ->where('status','99')->where('transactiontype','IN')//事务状态,类型限定
-            ->where('doclineno', $info['asnlineno'])->where('fmsku', $info['sku'])->count('fmqty');
-        if ((int)($info['amount'] + $actTransactionLogQty) > (int)$asnDetail['expectedqty']) return [];
-
         $sql = <<<sql
 INSERT INTO ACT_TRANSACTION_LOG VALUES(?,'IN',?,?,?,?,'ASN',?,?,?,?,?,?,?,?,TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),?,
 TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),?,0,0,0,0,TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),?,?,null,null,null,?,?,?,?,?,?,?,?,
@@ -799,7 +818,6 @@ sql;
             'userdefine3' => $asnHeader->userdefine3, 'trackid' => $trackNumber
         ];
         return $actTransactionLog;
-//        });
     }
 
     /**
@@ -820,7 +838,6 @@ sql;
 
         $db = DB::connection("oracle");
         list($num, $max) = $this->getLtNum();
-//        return $db->transaction(function () use ($db, $info, $invlotatt, $num, $who, $time) {
         $sql = <<<sql
 INSERT INTO INV_LOT_ATT VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),?,
 TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),?,TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),?)
@@ -831,8 +848,6 @@ sql;
         ]);
         $this->setLtNum();
         return $num;
-//        });
-
     }
 
     /**

+ 4 - 5
app/Services/OracleDocAsnHerderService.php

@@ -9,30 +9,29 @@ use App\Traits\ServiceAppAop;
 class OracleDocAsnHerderService
 {
     use ServiceAppAop;
-    protected $modelClass=OracleDocAsnHerder::class;
+//    protected $modelClass=OracleDocAsnHerder::class;
+
     public function getWmsAsnOnStartDateCreate($startDate)
     {
         if (!$startDate) return null;
-        $oracleDocAsnHerder= OracleDOCASNHeader::query()
+        return OracleDOCASNHeader::query()
             ->with(['asnType', 'asnStatus'])
             ->select('asnno','asnstatus','asntype','addtime','edittime','customerid','notes','warehouseid','asnreference3','asnreference2')
             ->where('addTime', '>=', $startDate)
             ->orderByDesc('addtime')
             ->get();
-        return $oracleDocAsnHerder;
     }
 
     public function getWmsAsnOnStartDateEdit($startDate)
     {
         if (!$startDate) return null;
-        $oracleDocAsnHerder= OracleDOCASNHeader::query()
+        return OracleDOCASNHeader::query()
             ->with(['asnType', 'asnStatus'])
             ->select('asnno','asnstatus','asntype','addtime','edittime','customerid','notes','warehouseid','asnreference3','asnreference2')
             ->where('EditTime', '>=', $startDate)
             ->whereColumn('EditTime', '<>', 'addTime')
             ->orderByDesc('EditTime')
             ->get();
-        return $oracleDocAsnHerder;
     }
 
 }

+ 24 - 2
app/Services/StoreService.php

@@ -85,16 +85,24 @@ class StoreService
         /** @var OracleDocAsnHerderService $oracleDocAsnHerderService */
         $oracleDocAsnHerderService = app(OracleDocAsnHerderService::class);
         $last_time = $this->getAsnLastSyncAt($updated_at, 'update');
+        app('LogService')
+            ->log(__METHOD__, __FUNCTION__, '获取上次更新时间:' . $last_time );
         $asnHerders = $oracleDocAsnHerderService->getWmsAsnOnStartDateEdit($last_time);
         if (count($asnHerders)<1) return;
         $last_time = $asnHerders->first()['edittime'];
         $last_records = $asnHerders->where('edittime', $last_time);
         $this->createStore($asnHerders,"update");
+
         $this->updateStore($asnHerders);
+
         $this->createStoreRejected($asnHerders);
+
         $this->deleteCacheKey($update_set, $update_keys);
+
         $this->setLastRecordsByRedis($update_key, $update_set, $update_keys, $last_records);
+
         $this->setAsnLastSyncAt($updated_at, $last_time);
+
     }
 
     public function createStore($asnHerders,$isUpdate=null)
@@ -129,6 +137,8 @@ class StoreService
         $rejectedBillService = app(RejectedBillService::class);
         $rejectedBillService->syncLoadedStatusByAsnHerder($asnHerders);
         if (!$isUpdate)$this->pushJob($asnHerders);
+        app('LogService')
+            ->log(__METHOD__, __FUNCTION__, '11 更新中创建createStore:' . $asnHerders );
         unset($asnHerders, $owners_code_map, $warehouses_code_map);
     }
 
@@ -223,7 +233,11 @@ class StoreService
                 ];
             }
         }
-        if (count($updateParams) > 1) $this->batchUpdate($updateParams);
+        if (count($updateParams) > 1) {
+            $res=$this->batchUpdate($updateParams);
+            app('LogService')
+                ->log(__METHOD__, __FUNCTION__, '11 批量更新:' . $res . ' | '.json_encode($updateParams));
+        }
         /** @var StoreItemService $storeItemService */
         $storeItemService = app(StoreItemService::class);
         $storeItemService->storeItemUpdateByWms($asnHerders);
@@ -231,6 +245,8 @@ class StoreService
         $rejectedBillService = app(RejectedBillService::class);
         $rejectedBillService->syncLoadedStatusByAsnHerder($asnHerders);
         $this->pushJob($asnHerders);
+        app('LogService')
+            ->log(__METHOD__, __FUNCTION__, '11 updateStore:'.$updateParams);
         unset($updateParams, $asnHerders);
     }
 
@@ -279,7 +295,7 @@ class StoreService
             'name' => $key,
             'value' => $last_time,
         ]);
-        LogService::log(__METHOD__, __FUNCTION__, '修改或更新' . $key . json_encode($asnLastSyncAt));
+        LogService::log(__METHOD__, __FUNCTION__, '11 setAsnLastSyncAt' . $key . json_encode($asnLastSyncAt));
         return $asnLastSyncAt;
     }
 
@@ -293,6 +309,8 @@ class StoreService
             }
             Cache::forget($keys);
         }
+        app('LogService')
+            ->log(__METHOD__, __FUNCTION__, '11 deleteCacheKey:' );
     }
 
     public function setLastRecordsByRedis($prefixKey, $set, $keys, $last_records)
@@ -304,6 +322,8 @@ class StoreService
         }
         Cache::put($keys, $cacheKeys);
         Cache::put($set, true);
+        app('LogService')
+            ->log(__METHOD__, __FUNCTION__, '11 setLastRecordsByRedis:'. $prefixKey.'||'. $set.'||'. $keys.'||'. $last_records);
     }
 
     public function createInstantBill(Store $store): bool
@@ -410,6 +430,8 @@ class StoreService
             ];
         }
         if (count($insert_param)>0) StoreRejected::query()->insert($insert_param);
+        app('LogService')
+            ->log(__METHOD__, __FUNCTION__, '11 createStoreRejected:'.$insert_param  );
     }
 
     /**

+ 19 - 12
resources/views/store/handInStorage/putaway.blade.php

@@ -358,14 +358,20 @@
                         ensure() {
                             this.errors={};//初始errors状态
                             this.verifyInfoAndCheckData();
-                            tempTip.setDuration(1000);
+                            if (JSON.stringify(this.errors) !== '{}')return;
+                            this.ensureSubmit();
+
+                        },
+                        ensureSubmit() {
+                            tempTip.setDuration(99999);
                             tempTip.waitingTip('提交中');
                             let url = '{{url('store/handInStorage/handFluxPa')}}';
                             if (JSON.stringify(this.errors)==='{}') window.axios.post(url,{info:this.info,checkData:this.checkData})
                                 .then(res=>{
                                     if (res.data.success){
-                                        window.tempTip.setDuration(3000);
-                                        window.tempTip.showSuccess(res.data.data);
+                                        tempTip.setDuration(3000);
+                                        tempTip.cancelWaitingTip();
+                                        tempTip.showSuccess(res.data.data);
                                         // this.info={};
                                         this.clearInfo();
                                         this.checkData=[];
@@ -375,15 +381,16 @@
                                         document.getElementById("trackNumber").select();
                                         return;
                                     }
-                                    window.tempTip.setDuration(3000);
-                                    window.tempTip.show(res.data.data);
-                                    window.tempTip.showErrorAudio();
+                                    tempTip.setDuration(3000);
+                                    tempTip.cancelWaitingTip();
+                                    tempTip.show(res.data.data);
+                                    tempTip.showErrorAudio();
                                 }).catch(err=>{
-                                window.tempTip.setDuration(3000);
-                                window.tempTip.show("网络错误:"+err);
-                                window.tempTip.showErrorAudio();
-                            })
-
+                                    tempTip.setDuration(3000);
+                                    tempTip.cancelWaitingTip();
+                                    tempTip.show("网络错误:"+err);
+                                    tempTip.showErrorAudio();
+                                })
                         },
                         cancel() {
                             setTimeout(function () {
@@ -405,7 +412,7 @@
                             if (!this.info.amount) error.amount = ["上架数量必填"];
                             if (Number(this.info.paTotal)!==0 && Number(this.info.amount)>Number(this.info.paTotal)) error.amount = ["上架数量不能超过上架总数必填"];
                             if (!this.info.location) error.location = ["目标库位必填"];
-                            if (JSON.stringify(error) !== '{}') {this.errors = error;return;}
+                            if (JSON.stringify(error) !== '{}') {this.errors = error;}
                         },
                     },
                 });

+ 17 - 10
resources/views/store/handInStorage/receiveDetailPage.blade.php

@@ -318,14 +318,19 @@
                     if (Number(this.info.receivedqty)===Number(this.info.expectedqty)){
                         window.tempTip.setDuration(2000); window.tempTip.show("收货已完成");
                     }
-                    tempTip.setDuration(1000);
+                   if(JSON.stringify(this.errors)!=='{}')return;
+                   this.ensureSubmit();
+                },
+                ensureSubmit(){
+                    tempTip.setDuration(99999);
                     tempTip.waitingTip('提交中');
                     let url = '{{url('store/handInStorage/fluxHandIn')}}';
                     if (JSON.stringify(this.errors)==='{}') window.axios.post(url,{info:this.info})
                         .then(res=>{
                             if (res.data.success){
-                                window.tempTip.setDuration(2000);
-                                window.tempTip.showSuccess('收货成功');
+                                tempTip.setDuration(2000);
+                                tempTip.cancelWaitingTip();
+                                tempTip.showSuccess('收货成功');
                                 // this.info={};
                                 this.clearInfo();
                                 this.asn_expectedqty=res.data.data.expectedqty;
@@ -338,14 +343,16 @@
                                     window.location.href="{{url('store/handInStorage/receive')}}";
                                 return;
                             }
-                            window.tempTip.setDuration(3000);
-                            window.tempTip.show(res.data.data);
-                            window.tempTip.showErrorAudio();
+                            tempTip.setDuration(3000);
+                            tempTip.cancelWaitingTip();
+                            tempTip.show(res.data.data);
+                            tempTip.showErrorAudio();
                         }).catch(err=>{
-                        window.tempTip.setDuration(2000);
-                        window.tempTip.show("网络错误:"+err);
-                        window.tempTip.showErrorAudio();
-                    })
+                            tempTip.setDuration(2000);
+                            tempTip.cancelWaitingTip();
+                            tempTip.show("网络错误:"+err);
+                            tempTip.showErrorAudio();
+                        })
                 },
                 cancel(){
                     setTimeout(function () {