diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java index 63088e4..78236ff 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java @@ -551,7 +551,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer throw new ServiceException("配对条码有误,未找到原材料条码信息"); } - if (StringUtils.isNotEmpty(bindBarcodeInfo.getSafeFlag()) && + if (StringUtils.isNotEmpty(bindBarcodeInfo.getSingleFlag()) && bindBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_INTERNAL)) {//对内生产 if (StringUtils.isEmpty(bindBarcodeInfo.getProductBarcode())) { throw new ServiceException("未按成品条码生成原材料条码"); diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml index 4afd90d..0fd1cb9 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml @@ -52,6 +52,7 @@ + @@ -298,7 +299,7 @@ create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, - sop_id = #{sopId}, + sop_id = #{sopId}, where plan_id = #{planId} @@ -507,4 +508,38 @@ + + + + + diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java index 1d7033c..6c517ed 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java @@ -69,6 +69,12 @@ public class WmsRawInstock extends BaseEntity @Excel(name = "执行状态(0待执行,1执行中,2执行完成)") private String executeStatus; + /**请求返回标识(1是),wcs在将execute_status改为1时此return_flag改为null*/ + private String returnFlag; + + private String planDetailCode; + + /** 同步ERP状态(0:失败,1成功) */ @Excel(name = "同步ERP状态(0:失败,1成功)") private String erpStatus; @@ -264,6 +270,23 @@ public class WmsRawInstock extends BaseEntity { return executeStatus; } + + public String getReturnFlag() { + return returnFlag; + } + + public void setReturnFlag(String returnFlag) { + this.returnFlag = returnFlag; + } + + public String getPlanDetailCode() { + return planDetailCode; + } + + public void setPlanDetailCode(String planDetailCode) { + this.planDetailCode = planDetailCode; + } + public void setErpStatus(String erpStatus) { this.erpStatus = erpStatus; diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsRawBackVo.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsRawBackVo.java index 149cf48..eb59ab5 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsRawBackVo.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsRawBackVo.java @@ -20,4 +20,8 @@ public class WmsRawBackVo { @NotNull(message="返库ID不能为空") private Long warehouseId; + + //生产计划编号 + @NotBlank(message="生产计划明细编号必须输入") + private String planDetailCode; } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java index fa3d96c..ced7b65 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java @@ -17,9 +17,11 @@ import com.hw.mes.api.RemoteMesService; import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.wms.config.WmsConfig; import com.hw.wms.domain.WmsBaseLocation; +import com.hw.wms.domain.WmsRawOutstock; import com.hw.wms.domain.WmsRawStock; import com.hw.wms.domain.vo.*; import com.hw.wms.mapper.WmsBaseLocationMapper; +import com.hw.wms.mapper.WmsRawOutstockMapper; import com.hw.wms.mapper.WmsRawStockMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpEntity; @@ -53,6 +55,9 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { @Autowired private WmsRawStockMapper wmsRawStockMapper; + @Autowired + private WmsRawOutstockMapper wmsRawOutstockMapper; + @Autowired private WmsConfig wmsConfig; @@ -281,7 +286,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { throw new ServiceException("物料条码有误"); } - //判断此柜体是否已跟拆分门板绑定,如果未绑定不允许返库 + //判断此柜体是否已跟配对码绑定,如果未绑定不允许返库 R bindBarcodeInfoR = remoteMesService.getBarcodeByBindBarcode(materialBarcode, SecurityConstants.INNER); if (bindBarcodeInfoR == null) { throw new ServiceException("没找到绑定信息,不能返库"); @@ -291,17 +296,41 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { throw new ServiceException("没找到绑定信息,不能返库"); } + WmsRawInstock queryReturnRawInstock = new WmsRawInstock(); + queryReturnRawInstock.setReturnFlag("1"); + List returnRawInstocks = wmsRawInstockMapper.selectWmsRawInstockList(queryReturnRawInstock); + if (returnRawInstocks != null && !returnRawInstocks.isEmpty()) { + throw new ServiceException("有正在返库的记录,不能再次申请"); + } + + WmsRawInstock queryPlanRawInstock = new WmsRawInstock(); + queryPlanRawInstock.setPlanDetailCode(wmsRawBackVo.getPlanDetailCode()); + List planRawInstocks = wmsRawInstockMapper.selectWmsRawInstockList(queryPlanRawInstock); + if (planRawInstocks != null && !planRawInstocks.isEmpty()) { + throw new ServiceException("此生产明细已经申请过返库,无需重复申请"); + } + + //4楼上5楼的不需要申请领柜体,所以也不需要返库 + WmsRawOutstock queryRawOutsotck = new WmsRawOutstock(); + queryRawOutsotck.setPlanDetailCode(wmsRawBackVo.getPlanDetailCode()); + queryRawOutsotck.setSplitFlag(WmsConstants.WMS_RAW_OUTSTOCK_SPLIT_FLAG_YES); + List wmsRawOutstocks = wmsRawOutstockMapper.selectWmsRawOutstockList(queryRawOutsotck); + if (wmsRawOutstocks == null || wmsRawOutstocks.isEmpty()) { + throw new ServiceException("没有领取柜体,无需返库"); + } + + + if (!baseBarcodeInfo.getPlanDetailCode().equals(wmsRawBackVo.getPlanDetailCode())) { + throw new ServiceException(String.format("此物料条码明细编号为%s:,与此明细编号不符", baseBarcodeInfo.getPlanDetailCode())); + } + //判断是否有返库记录,不能重复提交 WmsRawInstock queryRawInstock = new WmsRawInstock(); - queryRawInstock.setMaterialBarcode(materialBarcode);//materialBarcode是索引,先不需要加别的条件,获取出来再过滤 + queryRawInstock.setMaterialBarcode(materialBarcode); + queryRawInstock.setInstockType(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_RETURN); List wmsRawInstocks = wmsRawInstockMapper.selectWmsRawInstockList(queryRawInstock); if (wmsRawInstocks != null && !wmsRawInstocks.isEmpty()) { - List returnRawInstocks = wmsRawInstocks.stream().filter - (wmsRawInstock -> wmsRawInstock.getInstockType().equals(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_RETURN)) - .collect(Collectors.toList()); - if (returnRawInstocks != null && !returnRawInstocks.isEmpty()) { - throw new ServiceException("已经有此物料返库记录,无需重复返库"); - } + throw new ServiceException("已经有此物料返库记录,无需重复返库"); } WmsRawInstock wmsRawInstock = new WmsRawInstock(); @@ -316,6 +345,8 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { wmsRawInstock.setPalletInfoCode(baseBarcodeInfo.getPalletInfoCode()); wmsRawInstock.setInstockAmount(BigDecimal.ONE); wmsRawInstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE); + wmsRawInstock.setReturnFlag("1");//返回标识,只能有一个returnflag为1的。 + wmsRawInstock.setPlanDetailCode(wmsRawBackVo.getPlanDetailCode()); wmsRawInstock.setApplyBy(SecurityUtils.getUsername()); wmsRawInstock.setApplyDate(new Date()); diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml index 5c35a54..c851c25 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml @@ -18,6 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -52,6 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and operation_type = #{operationType} and instock_type = #{instockType} and execute_status = #{executeStatus} + and return_flag = #{returnFlag} + and plan_detail_code = #{planDetailCode} and apply_by = #{applyBy} and apply_date = #{applyDate} and update_date = #{updateDate} @@ -80,6 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" pallet_info_code, instock_amount, execute_status, + return_flag, + plan_detail_code, erp_status, erp_amount, apply_by, @@ -104,6 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{palletInfoCode}, #{instockAmount}, #{executeStatus}, + #{returnFlag}, + #{planDetailCode}, #{erpStatus}, #{erpAmount}, #{applyBy}, diff --git a/hw-ui/src/utils/ruoyi.js b/hw-ui/src/utils/ruoyi.js index f1e1418..2e18e8b 100644 --- a/hw-ui/src/utils/ruoyi.js +++ b/hw-ui/src/utils/ruoyi.js @@ -266,3 +266,18 @@ export function fileDownload(file) { } }) } + + +// 表单重置 +export function getNowDateTime() { + let now = new Date(); + let year = now.getFullYear(); + let month = ('0' + (now.getMonth() + 1)).slice(-2); // 月份是从0开始的,所以加1 + let day = ('0' + now.getDate()).slice(-2); + let hours = ('0' + now.getHours()).slice(-2); + let minutes = ('0' + now.getMinutes()).slice(-2); + let seconds = ('0' + now.getSeconds()).slice(-2); + + return year+"-"+month+"-"+day +" "+ hours+":"+minutes+":"+seconds; +} + diff --git a/hw-ui/src/views/board/barcode/workshopBarcode.vue b/hw-ui/src/views/board/barcode/workshopBarcode.vue index 603048f..a7a2987 100644 --- a/hw-ui/src/views/board/barcode/workshopBarcode.vue +++ b/hw-ui/src/views/board/barcode/workshopBarcode.vue @@ -168,7 +168,7 @@ @@ -246,6 +246,8 @@ export default { return { // 遮罩层 loading: true, + // 保存遮罩层 + submitLoading:false, // 选中数组 ids: [], barcodeInfos: [], @@ -428,6 +430,7 @@ export default { // this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.PRODUCT + "," + this.BARCODE_TYPE.BIND_BARCODE; } else if (barcodeType === this.BARCODE_TYPE_PARAM.SPLIT_BIND_BARCODE) {//拆分原材料配对码 this.queryParams.barcodeType = this.BARCODE_TYPE.RAW ; + this.queryParams.bindOrFlag = "1"; // this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.RAW + "," + this.BARCODE_TYPE.BIND_BARCODE; // this.queryParams.bindOrFlag = "1"; } @@ -633,10 +636,13 @@ export default { submitForm() { this.$refs["form"].validate(valid => { if (valid) { + this.submitLoading = true; addProductBarcode(this.form).then(response => { this.$modal.msgSuccess("新增成功"); this.addProductBarcodeOpen = false; this.getList(); + }).finally(e =>{ + this.submitLoading = false; }); } }); diff --git a/hw-ui/src/views/board/common/applyRawOutstock.vue b/hw-ui/src/views/board/common/applyRawOutstock.vue index 1e04944..47fed21 100644 --- a/hw-ui/src/views/board/common/applyRawOutstock.vue +++ b/hw-ui/src/views/board/common/applyRawOutstock.vue @@ -1,5 +1,5 @@