diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java index 921c8ee1..622a2c88 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java @@ -193,10 +193,19 @@ public class wmsReportWork extends BaseEntity { private String createTimeEnd; private String feedbackTimeStart; private String feedbackTimeEnd; - private String batch; + private String batch;//生产批次 + private String batchSK;//RK批次 private String endReport; private String whCode; + public String getBatchSK() { + return batchSK; + } + + public void setBatchSK(String batchSK) { + this.batchSK = batchSK; + } + public String getWhCode() { return whCode; } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsProductPut.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsProductPut.java index 5b72dc1b..31f815e5 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsProductPut.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsProductPut.java @@ -47,6 +47,15 @@ public class WmsProductPut extends BaseEntity { */ @Excel(name = "仓库编码") private String whCode; + private String batchSK;//生产批次 + + public String getBatchSK() { + return batchSK; + } + + public void setBatchSK(String batchSK) { + this.batchSK = batchSK; + } /** * 库区编码 @@ -490,4 +499,6 @@ public class WmsProductPut extends BaseEntity { ", attr10='" + attr10 + '\'' + '}'; } + + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java index 86e9de66..e00d5215 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java @@ -329,6 +329,15 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { @DS("#header.poolName") public List getReportList(wmsReportWork mesReportWork) { List rlist = wmsProductPutMapper.getReportList(mesReportWork); + for (wmsReportWork wmsReportWork: + rlist ) { + if (wmsReportWork.getBatch().length()>=23){ + String batchsk = InterceptionRules(wmsReportWork.getBatch()); + wmsReportWork.setBatchSK(batchsk); + }else { + wmsReportWork.setBatchSK(wmsReportWork.getBatch()); + } + } return rlist; } @@ -365,6 +374,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { wmsProductPutk.setBatchNumber(mesReportWork.getBatch());// // wmsProductPutk.setSapStatus("2");//过账失败的 List wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk); + if (wmsProductPutList.size() > 0) { String id = wmsProductPutList.get(0).getId(); mesReportWork.setId(id); @@ -393,6 +403,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { wmsReportWorkListagain.add(mesReportWork);// // } } + //已经插入且插入失败的 for (wmsReportWork mesReportWork : wmsReportWorkList) { WmsProductPut wmsProductPutk = new WmsProductPut(); @@ -408,6 +419,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit()); wmsProductPutk.setBatchNumber(mesReportWork.getBatch());// wmsProductPutk.setSapStatus("2"); + List wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk); if (wmsProductPutList.size() > 0) {//已经插入且失败的 wmsReportWorkListTWO.add(mesReportWork);// @@ -415,7 +427,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { } - //先屏蔽起来 + //第一次 for (wmsReportWork mesReportWork : wmsReportWorkListRk) { WmsProductPut wmsProductPutk = new WmsProductPut(); @@ -433,12 +445,12 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { wmsProductPutk.setStatus("1"); wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit()); wmsProductPutk.setBatchNumber(mesReportWork.getBatch());// + wmsProductPutk.setAttr4(mesReportWork.getBatchSK()); //List wmsProductPutList= wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk); - +// wmsProductPutk.setBatchSK(mesReportWork.getBatchSK());//入库批次 wmsProductPutk.setAttr3(formattedDate);// wmsProductPutk.setCreateBy(SecurityUtils.getUsername()); wmsProductPutk.setCreateTime(new Date()); - wmsProductPutk.setProductDate(mesReportWork.getProductDate()); wmsProductPutk.setId(mesReportWork.getId()); wmsProductPutk.setSapStatus("0"); @@ -492,13 +504,14 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { map.put("LGORT", mesReportWork.getWhCode()); map.put("QUANTITY", mesReportWork.getQuantityQualified()); map.put("ERFME", mesReportWork.getUnit()); - if (mesReportWork.getBatch().length()>12){ - //String batch = mesReportWork.getBatch().substring(12); - String batch = InterceptionRules(mesReportWork.getBatch()); - map.put("BATCH", batch); - }else { - map.put("BATCH", mesReportWork.getBatch()); - } + map.put("BATCH", mesReportWork.getBatchSK()); +// if (mesReportWork.getBatch().length()>12){ +// //String batch = mesReportWork.getBatch().substring(12); +// String batch = InterceptionRules(mesReportWork.getBatch()); +// +// }else { +// map.put("BATCH", mesReportWork.getBatch()); +// } String formattedsDate = mesReportWork.getProductDate().replace("-", ""); map.put("HSDAT", formattedsDate); mapList.add(map); @@ -532,12 +545,13 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { map.put("LGORT", mesReportWork.getWhCode()); map.put("QUANTITY", mesReportWork.getQuantityQualified()); map.put("ERFME", mesReportWork.getUnit()); - if (mesReportWork.getBatch().length()>12){ - String batch = InterceptionRules(mesReportWork.getBatch()); - map.put("BATCH", batch); - }else { - map.put("BATCH", mesReportWork.getBatch()); - } + map.put("BATCH", mesReportWork.getBatchSK()); +// if (mesReportWork.getBatch().length()>12){ +// String batch = InterceptionRules(mesReportWork.getBatch()); +// map.put("BATCH", batch); +// }else { +// map.put("BATCH", mesReportWork.getBatch()); +// } String formattedsDate = mesReportWork.getProductDate().replace("-", ""); map.put("HSDAT", formattedsDate); mapList.add(map);