|
|
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|
|
|
|
|
use App\Components\AsyncResponse;
|
|
|
use App\OracleDOCASNHeader;
|
|
|
+use App\Owner;
|
|
|
use App\Services\HandInStorageService;
|
|
|
use Carbon\Carbon;
|
|
|
use Doctrine\DBAL\Exception;
|
|
|
@@ -108,6 +109,9 @@ class HandInStorageController extends Controller
|
|
|
if ($info['lotatt02']&&Carbon::now()->gt($info['lotatt02']))$this->error('失效日期超过入库效期');
|
|
|
if (!$info['customerid']||$isSku===false||!$info['asnno']||$isReceivedqty===false||$isExpectedqty===false) $this->error('参数错误');
|
|
|
if ($info['amount'] + $info['receivedqty'] > $info['expectedqty']) $this->error('收货数大于预期数');
|
|
|
+ //九干仓禁止使用当前app收货
|
|
|
+ $res=$this->screenWarehouseAndContrast($info['customerid']);
|
|
|
+ if ($res)$this->error('禁止使用当前app收货,请换用新版app收货!');
|
|
|
/** @var HandInStorageService $handInStorageService */
|
|
|
$handInStorageService=app('HandInStorageService');
|
|
|
if ($info['customerid']=='ONKYO'||$info['customerid']=='ANMEILAI'||$info['customerid']=='FEIHE'){
|
|
|
@@ -144,6 +148,21 @@ class HandInStorageController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function screenWarehouseAndContrast($ownerCode): bool
|
|
|
+ {
|
|
|
+ $owners=Owner::query()
|
|
|
+ ->select('code')
|
|
|
+ ->where('warehouse_id',3)//3 代表九干仓仓库id
|
|
|
+ ->whereNull('deleted_at')
|
|
|
+ ->get();
|
|
|
+ foreach ($owners as $owner){
|
|
|
+ if ($owner->code==$ownerCode){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param Request $request
|
|
|
* 根据商品条码和跟踪号 获取要上架的任务列表
|
|
|
@@ -196,6 +215,11 @@ class HandInStorageController extends Controller
|
|
|
if (!$info['location']||!$info['amount']||!$info['barCode'] || gettype($info['amount'])==='string') $this->error('参数错误');
|
|
|
if (count($request->input('checkData'))==0) $this->error('请勾选要上架任务');
|
|
|
$checkData=$request->input('checkData')[0];
|
|
|
+
|
|
|
+ //九干仓禁止使用当前app上架
|
|
|
+ $res=$this->screenWarehouseAndContrast($checkData['customerid']);
|
|
|
+ if ($res)$this->error('禁止使用当前app上架,请换用新版app上架!');
|
|
|
+
|
|
|
/** @var HandInStorageService $handInStorageService */
|
|
|
$handInStorageService=app('HandInStorageService');
|
|
|
//判断当前库位是否能放该商品
|