|
|
@@ -17,6 +17,7 @@ use App\OracleInvLotLocId;
|
|
|
use App\Traits\ServiceAppAop;
|
|
|
use App\ValueStore;
|
|
|
use Carbon\Carbon;
|
|
|
+use Decimal\Decimal;
|
|
|
use Doctrine\DBAL\Schema\AbstractAsset;
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
|
@@ -124,19 +125,26 @@ class HandInStorageService
|
|
|
if (!$location) return 1;//库位不存在
|
|
|
|
|
|
if ($location['mix_flag'] == 'N' && $location['mix_lotflag'] == 'N') { // 库位:产品和批次都不可混放
|
|
|
- $inv = OracleInvLotLocId::query()->where('locationid', $info['location'])->first();
|
|
|
+ $inv = OracleInvLotLocId::query()->with('oracleInvLotAtt:lotnum,lotatt01,lotatt02,lotatt03,lotatt04,lotatt05,lotatt08')
|
|
|
+ ->where('locationid', $info['location'])->first();
|
|
|
|
|
|
if (!$inv) return true; //当前库位无库存余量 可直接入库
|
|
|
|
|
|
if ($inv['customerid'] == $param['customerid'] && $inv['sku'] == $param['sku']
|
|
|
- && $inv['lotnum'] == $param['plantolotnum'])
|
|
|
+ && $inv['oracleInvLotAtt']['lotatt01'] == $param['lotatt01']
|
|
|
+ && $inv['oracleInvLotAtt']['lotatt02'] == $param['lotatt02']
|
|
|
+ && $inv['oracleInvLotAtt']['lotatt04'] == $param['lotatt04']
|
|
|
+ && $inv['oracleInvLotAtt']['lotatt05'] == $param['lotatt05']
|
|
|
+ && $inv['oracleInvLotAtt']['lotatt08'] == $param['lotatt08']
|
|
|
+ )
|
|
|
return true;
|
|
|
else return 2; //库位:产品和批次不可混放
|
|
|
}
|
|
|
|
|
|
|
|
|
if ($location['mix_flag'] == 'Y' && $location['mix_lotflag'] == 'N') {//库位:产品可混放,批次不可
|
|
|
- $invs = OracleInvLotLocId::query()->where('locationid', $info['location'])->get();
|
|
|
+ $invs = OracleInvLotLocId::query()->with('oracleInvLotAtt:lotnum,lotatt01,lotatt02,lotatt03,lotatt04,lotatt05,lotatt08')
|
|
|
+ ->where('locationid', $info['location'])->get();
|
|
|
|
|
|
if ($invs->count() == 0) return true; //当前库位无库存余量 可直接入库
|
|
|
|
|
|
@@ -146,13 +154,18 @@ class HandInStorageService
|
|
|
$skuInvs[] = $inv;
|
|
|
continue;
|
|
|
}
|
|
|
- if ($inv['lotnum'] == $param['plantolotnum']) return true; // 批次相同
|
|
|
+ if ($inv['oracleInvLotAtt']['lotatt01'] == $param['lotatt01']
|
|
|
+ && $inv['oracleInvLotAtt']['lotatt02'] == $param['lotatt02']
|
|
|
+ && $inv['oracleInvLotAtt']['lotatt04'] == $param['lotatt04']
|
|
|
+ && $inv['oracleInvLotAtt']['lotatt05'] == $param['lotatt05']
|
|
|
+ && $inv['oracleInvLotAtt']['lotatt08'] == $param['lotatt08']) return true; // 批次相同
|
|
|
return 3; //库位:产品相同,不能混放批次
|
|
|
}
|
|
|
if (count($skuInvs) == count($invs)) return true;
|
|
|
}
|
|
|
if ($location['mix_flag'] == 'N' && $location['mix_lotflag'] == 'Y') { //库位:产品不可混放,批次可混放
|
|
|
- $inv = OracleInvLotLocId::query()->where('locationid', $info['location'])->first();
|
|
|
+ $inv = OracleInvLotLocId::query()->with('oracleInvLotAtt:lotnum,lotatt01,lotatt02,lotatt03,lotatt04,lotatt05,lotatt08')
|
|
|
+ ->where('locationid', $info['location'])->first();
|
|
|
if (!$inv) return true; //当前库位无库存余量 可直接入库
|
|
|
|
|
|
if ($inv['customerid'] == $param['customerid'] && $inv['sku'] == $param['sku']) return true;
|