|
|
@@ -9,6 +9,7 @@ use App\InventoryAccount;
|
|
|
use App\InventoryAccountMission;
|
|
|
use App\OraccleBasCustomer;
|
|
|
use App\OracleActTransactionLog;
|
|
|
+use App\OracleInvLotAtt;
|
|
|
use App\OracleInvLotLocId;
|
|
|
use App\Owner;
|
|
|
use App\Services\common\QueryService;
|
|
|
@@ -164,6 +165,12 @@ class InventoryAccountService
|
|
|
Controller::logS(__METHOD__,"根据wms产品编码和货主查询或创建商品信息__".__FUNCTION__,json_encode($wmsInventory));
|
|
|
$commodity->newBarcode($wmsInventory->产品条码);
|
|
|
Controller::logS(__METHOD__,"根据wms产品条码和商品id查询或创建商品条码信息__".__FUNCTION__,json_encode($wmsInventory));
|
|
|
+ if($wmsInventory->质量状态=='ZP') $quality='正品';
|
|
|
+ if ($wmsInventory->质量状态=='CC') $quality='残次';
|
|
|
+ if ($wmsInventory->质量状态=='XS') $quality='箱损';
|
|
|
+ if ($wmsInventory->质量状态=='JS') $quality='机损';
|
|
|
+ if ($wmsInventory->质量状态=='DJ') $quality='冻结';
|
|
|
+ if ($wmsInventory->质量状态=='FKT') $quality='封口贴';
|
|
|
$inventoryAccountMission=[
|
|
|
'commodity_id'=>$commodity->id,
|
|
|
'inventory_account_id'=>$inventoryAccountId,
|
|
|
@@ -173,7 +180,7 @@ class InventoryAccountService
|
|
|
'stored_at'=>$wmsInventory->入库日期,
|
|
|
'batch_number'=>$wmsInventory->批号,
|
|
|
'erp_type_position'=>$wmsInventory->属性仓,
|
|
|
- 'quality'=>$wmsInventory->质量状态,
|
|
|
+ 'quality'=>$quality,
|
|
|
'stored_amount'=>$wmsInventory->在库数量,
|
|
|
'occupied_amount'=>$wmsInventory->占用数量,
|
|
|
'valid_amount'=>$wmsInventory->在库数量-$wmsInventory->占用数量,
|
|
|
@@ -236,4 +243,19 @@ class InventoryAccountService
|
|
|
if (!$inventoryAccountMission) return null;
|
|
|
return $inventoryAccountMission;
|
|
|
}
|
|
|
+ public function 修改质量状态($id,$location,$sku,$quality,$ownerCode){
|
|
|
+ $lotnum=OracleInvLotLocId::query()->where('locationid',$location)->where('customerid',$ownerCode)->where('sku',$sku)->value('lotnum');
|
|
|
+ if (!$lotnum) return null;
|
|
|
+ $oracleInvLotAtt=OracleInvLotAtt::query()->where('lotnum',$lotnum)->where('sku',$sku)->where('customerid',$ownerCode)->first();
|
|
|
+ if(!isset($oracleInvLotAtt))return null;
|
|
|
+ if ($quality=='正品')$status='ZP';
|
|
|
+ if ($quality=='残次')$status='CC';
|
|
|
+ $oracleInvLotAtt=OracleInvLotAtt::query()->where('lotnum',$lotnum)->where('sku',$sku)->where('customerid',$ownerCode)->update([
|
|
|
+ 'lotatt08'=>$status,
|
|
|
+ ]);
|
|
|
+ $inventoryAccountMission=InventoryAccountMission::query()->find($id);
|
|
|
+ $inventoryAccountMission->quality=$quality;
|
|
|
+ $inventoryAccountMission=$inventoryAccountMission->update();
|
|
|
+ if ($oracleInvLotAtt>0&&$inventoryAccountMission)return $inventoryAccountMission;
|
|
|
+ }
|
|
|
}
|