|
|
|
@ -148,7 +148,6 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
|
|
|
|
|
if (baseLocation == null) {
|
|
|
|
|
throw new ServiceException("库位编码有误");
|
|
|
|
|
}
|
|
|
|
|
//todo 可入物料(wms_warehouse_material)判断是否可以入此库位
|
|
|
|
|
|
|
|
|
|
BigDecimal instockAmount = wmsRawInstockVo.getInstockAmount();
|
|
|
|
|
if (baseBarcodeInfo.getBatchFlag().equals(MesConstants.IS_BATCH)) {
|
|
|
|
@ -204,7 +203,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
|
|
|
|
|
*/
|
|
|
|
|
public void updateRawStock(WmsRawInstock wmsRawInstock, WmsRawInstockVo wmsRawInstockVo, WmsBaseLocation baseLocation
|
|
|
|
|
, MesBaseBarcodeInfo baseBarcodeInfo, String userName, Date currentDate) {
|
|
|
|
|
String instockBatch = baseBarcodeInfo.getBatchCode();
|
|
|
|
|
String barcode = baseBarcodeInfo.getBarcodeInfo();
|
|
|
|
|
String locationCode = wmsRawInstock.getLocationCode();
|
|
|
|
|
|
|
|
|
|
//判断此库位的数量限制,是否还能入库
|
|
|
|
@ -217,10 +216,14 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
|
|
|
|
|
throw new ServiceException("已超出库位数量限制,请重新选择库位");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String batchFlag = baseBarcodeInfo.getBatchFlag();
|
|
|
|
|
//如果是同一库位入同一批次,则更新数量
|
|
|
|
|
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, instockBatch);
|
|
|
|
|
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(barcode);
|
|
|
|
|
if (wmsRawStock != null) {
|
|
|
|
|
// wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus());
|
|
|
|
|
if(!batchFlag.equals(MesConstants.IS_BATCH)){
|
|
|
|
|
throw new ServiceException("此物料条码已经入库");
|
|
|
|
|
}
|
|
|
|
|
wmsRawStock.setTotalAmount(wmsRawStock.getTotalAmount().add(wmsRawInstockVo.getInstockAmount()));
|
|
|
|
|
wmsRawStock.setUpdateBy(userName);
|
|
|
|
|
wmsRawStock.setUpdateDate(currentDate);
|
|
|
|
@ -231,11 +234,15 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
|
|
|
|
|
wmsRawStock.setLocationCode(locationCode);
|
|
|
|
|
wmsRawStock.setStockType(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW);
|
|
|
|
|
wmsRawStock.setMaterialId(baseBarcodeInfo.getMaterialId());
|
|
|
|
|
wmsRawStock.setInstockBatch(instockBatch);
|
|
|
|
|
wmsRawStock.setInstockBatch(barcode);
|
|
|
|
|
wmsRawStock.setWarehouseFloor(baseLocation.getWarehouseFloor());
|
|
|
|
|
// wmsRawStock.setLastOutstockTime(baseBarcodeInfo.getLastOutstockDate());
|
|
|
|
|
// wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus());
|
|
|
|
|
wmsRawStock.setTotalAmount(wmsRawInstockVo.getInstockAmount());
|
|
|
|
|
wmsRawStock.setSaleOrderId(baseBarcodeInfo.getSaleOrderId());
|
|
|
|
|
wmsRawStock.setSafeFlag(baseBarcodeInfo.getSafeFlag());
|
|
|
|
|
wmsRawStock.setInstockDate(baseBarcodeInfo.getAcceptedDate());
|
|
|
|
|
wmsRawStock.setLastOutstockTime(baseBarcodeInfo.getLastOutstockDate());
|
|
|
|
|
wmsRawStock.setCreateBy(userName);
|
|
|
|
|
wmsRawStock.setCreateDate(currentDate);
|
|
|
|
|
wmsRawStockMapper.insertWmsRawStock(wmsRawStock);
|
|
|
|
|