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 215bb8dc..c832ab72 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 @@ -517,15 +517,15 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { map.put("QUANTITY", mesReportWork.getQuantityQualified()); map.put("ERFME", mesReportWork.getUnit()); 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); + if (mesReportWork.getBatch().length()>12&&mesReportWork.getBatch().length()<30){ + //String batch = mesReportWork.getBatch().substring(12); + String HSDAT = InterceptionSJRules(mesReportWork.getBatch()); + map.put("HSDAT", HSDAT); + }else { + String formattedsDate = mesReportWork.getProductDate().replace("-", ""); + map.put("HSDAT", formattedsDate); + } + mapList.add(map); } //过账 @@ -565,8 +565,14 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { // }else { // map.put("BATCH", mesReportWork.getBatch()); // } - String formattedsDate = mesReportWork.getProductDate().replace("-", ""); - map.put("HSDAT", formattedsDate); + if (mesReportWork.getBatch().length()>12&&mesReportWork.getBatch().length()<30){ + //String batch = mesReportWork.getBatch().substring(12); + String HSDAT = InterceptionSJRules(mesReportWork.getBatch()); + map.put("HSDAT", HSDAT); + }else { + String formattedsDate = mesReportWork.getProductDate().replace("-", ""); + map.put("HSDAT", formattedsDate); + } mapList.add(map); } //过账 @@ -1485,6 +1491,15 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { //去除空格,截取规则,例子:20270106LJ20240107CBCD0J——》240107CBCD public String InterceptionRules(String batchString){ + boolean containsSpace = batchString.contains(" "); + if (containsSpace) {//去除空格 + batchString = batchString.replace(" ", ""); + } + batchString =batchString.substring(12,22); + return batchString; + } + //去除空格,截取规则,例子:20270106LJ20240107CBCD0J——》240107CBCD + public String InterceptionSJRules(String batchString){ boolean containsSpace = batchString.contains(" "); if (containsSpace) {//去除空格 batchString = batchString.replace(" ", "");