|
|
@ -293,6 +293,10 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
|
|
|
|
throw new ServiceException("审核未通过,不能出库");
|
|
|
|
throw new ServiceException("审核未通过,不能出库");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (wmsRawReturn.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)) {
|
|
|
|
|
|
|
|
throw new ServiceException("已经退库完成,无需再退库");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String batchFlag = mesBaseBarcodeInfo.getBatchFlag();
|
|
|
|
String batchFlag = mesBaseBarcodeInfo.getBatchFlag();
|
|
|
|
|
|
|
|
|
|
|
|
if (!batchFlag.equals(MesConstants.IS_BATCH)) {
|
|
|
|
if (!batchFlag.equals(MesConstants.IS_BATCH)) {
|
|
|
@ -301,16 +305,16 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(!wmsRawReturn.getMaterialId().equals(mesBaseBarcodeInfo.getMaterialId())){
|
|
|
|
if (!wmsRawReturn.getMaterialId().equals(mesBaseBarcodeInfo.getMaterialId())) {
|
|
|
|
throw new ServiceException("物料编码错误");
|
|
|
|
throw new ServiceException("物料编码错误");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode);
|
|
|
|
WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode);
|
|
|
|
if(baseLocation == null){
|
|
|
|
if (baseLocation == null) {
|
|
|
|
throw new ServiceException("库位编码有误");
|
|
|
|
throw new ServiceException("库位编码有误");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(!baseLocation.getWarehouseId().equals(wmsRawReturn.getWarehouseId())){
|
|
|
|
if (!baseLocation.getWarehouseId().equals(wmsRawReturn.getWarehouseId())) {
|
|
|
|
throw new ServiceException("退库仓库有误");
|
|
|
|
throw new ServiceException("退库仓库有误");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -323,6 +327,15 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
|
|
|
|
throw new ServiceException("退库数量不能大于" + planAmount);
|
|
|
|
throw new ServiceException("退库数量不能大于" + planAmount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WmsRawReturnDetail queryRawReturnDetail = new WmsRawReturnDetail();
|
|
|
|
|
|
|
|
queryRawReturnDetail.setRawReturnId(rawReturnId);
|
|
|
|
|
|
|
|
queryRawReturnDetail.setMaterialBarcode(materialBarcode);
|
|
|
|
|
|
|
|
List<WmsRawReturnDetail> wmsRawReturnDetails = wmsRawReturnDetailMapper.selectWmsRawReturnDetailList(queryRawReturnDetail);
|
|
|
|
|
|
|
|
if (wmsRawReturnDetails != null && !wmsRawReturnDetails.isEmpty()) {
|
|
|
|
|
|
|
|
throw new ServiceException("已经退库,无需重复退库");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String executeStatus = "";
|
|
|
|
String executeStatus = "";
|
|
|
|
if (updatedReturnAmount.compareTo(planAmount) == 0) {
|
|
|
|
if (updatedReturnAmount.compareTo(planAmount) == 0) {
|
|
|
|
executeStatus = WmsConstants.WMS_EXECUTE_STATUS_FINISH;
|
|
|
|
executeStatus = WmsConstants.WMS_EXECUTE_STATUS_FINISH;
|
|
|
@ -344,7 +357,7 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
|
|
|
|
mesBaseBarcodeInfo, userName, currentDate);
|
|
|
|
mesBaseBarcodeInfo, userName, currentDate);
|
|
|
|
|
|
|
|
|
|
|
|
//更新原材料库存
|
|
|
|
//更新原材料库存
|
|
|
|
this.updateRawStock(wmsRawReturnConfirmVo, mesBaseBarcodeInfo, baseLocation,userName, currentDate);
|
|
|
|
this.updateRawStock(wmsRawReturnConfirmVo, mesBaseBarcodeInfo, baseLocation, userName, currentDate);
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|