WMS:PDA接口原材料退库完善
master
xins 8 months ago
parent 21db948cfc
commit cd7e92c428

@ -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;
} }

@ -162,6 +162,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productId != null">product_id = #{productId},</if> <if test="productId != null">product_id = #{productId},</if>
<if test="materialId != null">material_id = #{materialId},</if> <if test="materialId != null">material_id = #{materialId},</if>
<if test="planAmount != null">plan_amount = #{planAmount},</if> <if test="planAmount != null">plan_amount = #{planAmount},</if>
<if test="returnAmount != null">return_amount = #{returnAmount},</if>
<if test="operationType != null">operation_type = #{operationType},</if> <if test="operationType != null">operation_type = #{operationType},</if>
<if test="taskType != null and taskType != ''">task_type = #{taskType},</if> <if test="taskType != null and taskType != ''">task_type = #{taskType},</if>
<if test="applyReason != null">apply_reason = #{applyReason},</if> <if test="applyReason != null">apply_reason = #{applyReason},</if>

Loading…
Cancel
Save