From ee1708c0dfa4dcce211ff8386afbbb24e4e992eb Mon Sep 17 00:00:00 2001 From: 18110972313 <780768673@qq.com> Date: Fri, 30 May 2025 09:36:38 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=96=B0=E6=96=99=E5=8F=B7=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E6=89=93=E5=8D=B0=EF=BC=8C=E6=A0=87=E7=AD=BE=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=96=B0=E6=97=A7=E6=96=99=E5=8F=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../idm/service/Impl/BSLabelServiceImpl.java | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/zi-wms-pda/src/main/java/com/cim/idm/service/Impl/BSLabelServiceImpl.java b/zi-wms-pda/src/main/java/com/cim/idm/service/Impl/BSLabelServiceImpl.java index f6de449..f887a22 100644 --- a/zi-wms-pda/src/main/java/com/cim/idm/service/Impl/BSLabelServiceImpl.java +++ b/zi-wms-pda/src/main/java/com/cim/idm/service/Impl/BSLabelServiceImpl.java @@ -1935,7 +1935,8 @@ public class BSLabelServiceImpl extends CommonServiceDAO im //订单号 labelPrintPET.setProductRequestName(queryForListProduct.get(0).get("SOURCEORDER") == null ? "" : queryForListProduct.get(0).get("SOURCEORDER").toString()); //品名 - labelPrintPET.setProductName(queryForListProduct.get(0).get("MATERIALNAME") == null ? "" : queryForListProduct.get(0).get("MATERIALNAME").toString()); + String materialName = queryForListProduct.get(0).get("MATERIALNAME") == null ? "" : queryForListProduct.get(0).get("MATERIALNAME").toString(); + labelPrintPET.setProductName(materialName); //等级 labelPrintPET.setLotGrade(queryForListProduct.get(0).get("DEFINEITEM17") == null ? "" : queryForListProduct.get(0).get("DEFINEITEM17").toString()); //厚度 @@ -1949,8 +1950,9 @@ public class BSLabelServiceImpl extends CommonServiceDAO im //接头 labelPrintPET.setJoint(queryForListProduct.get(0).get("DEFINEITEM18") == null ? "" : queryForListProduct.get(0).get("DEFINEITEM18").toString()); //料号 + String materialSpecNameNc = queryForListProduct.get(0).get("MATERIALSPECNAMENC") == null ? "" : queryForListProduct.get(0).get("MATERIALSPECNAMENC").toString(); String materialCode = queryForListProduct.get(0).get("MATERIALCODE") == null ? "" : queryForListProduct.get(0).get("MATERIALCODE").toString(); - labelPrintPET.setProductSpecName(materialCode); + labelPrintPET.setProductSpecName(materialSpecNameNc); //阶段 String stageCode = queryForListProduct.get(0).get("STAGECODE") == null ? "" : queryForListProduct.get(0).get("STAGECODE").toString(); labelPrintPET.setStageCode(stageCode); @@ -1973,8 +1975,7 @@ public class BSLabelServiceImpl extends CommonServiceDAO im //NC料号编码+'-'+货位编码 String erpLocation = queryForListProduct.get(0).get("ERPLOCATION") == null ? "" : queryForListProduct.get(0).get("ERPLOCATION").toString(); String locationname = queryForListProduct.get(0).get("LOCATIONNAME") == null ? "" : queryForListProduct.get(0).get("LOCATIONNAME").toString(); - String materialSpecNameNc = queryForListProduct.get(0).get("MATERIALSPECNAMENC") == null ? "" : queryForListProduct.get(0).get("MATERIALSPECNAMENC").toString(); - labelPrintPET.setLocationcode(materialSpecNameNc + "-" + locationname); + labelPrintPET.setLocationcode(materialCode + "-" + locationname); labelPrintPET.setWide(""); labelPrintPET.setLength(""); labelPrintPET.setLineSpeed(""); @@ -2005,7 +2006,7 @@ public class BSLabelServiceImpl extends CommonServiceDAO im " m.CHARGE lotNo,NVL(m.suppliername,'') supplierNo,\n" + " m.REMARK remark,TO_CHAR(m.RECEIVETIME,'YYYYMMDD') jumboRollBatch,\n" + " TO_CHAR(MAKEDATE,'YYYYMMDD') makedate, TO_CHAR(EXPIRINGDATE,'YYYYMMDD') expdate ,m.RECEIVEUSER opreater," + - " m.ERPLOCATION,m.LOCATIONNAME," + + " m.ERPLOCATION," + " CASE " + " WHEN m.LOCATIONNAME IS NULL OR TRIM(m.LOCATIONNAME) = '' THEN m.ERPLOCATION " + " ELSE m.LOCATIONNAME" + @@ -2056,11 +2057,15 @@ public class BSLabelServiceImpl extends CommonServiceDAO im qeuryLabelMap.put("MATERIALPACKINGNAME", MATERIALPACKINGNAME); queryForListProduct = IDMFrameServiceProxy.getSqlTemplate().queryForList(qeuryLabelDatasql, qeuryLabelMap); obj.setBarcode(queryForListProduct.get(0).get("barcode") != null ? queryForListProduct.get(0).get("barcode").toString() : ""); - obj.setMakedate(queryForListProduct.get(0).get("makedate") != null ? queryForListProduct.get(0).get("makedate").toString() : ""); - obj.setExpdate(queryForListProduct.get(0).get("expdate") != null ? queryForListProduct.get(0).get("expdate").toString() : ""); + String makedate = queryForListProduct.get(0).get("makedate") != null ? queryForListProduct.get(0).get("makedate").toString() : ""; + obj.setMakedate(formatDateStr(makedate)); + String expdate = queryForListProduct.get(0).get("expdate") != null ? queryForListProduct.get(0).get("expdate").toString() : ""; + obj.setExpdate(formatDateStr(expdate)); obj.setDescription(queryForListProduct.get(0).get("description") != null ? queryForListProduct.get(0).get("description").toString() : ""); // private String partNo; - obj.setPartNo(queryForListProduct.get(0).get("partNo") != null ? queryForListProduct.get(0).get("partNo").toString() : ""); + String erpState = queryForListProduct.get(0).get("ERPSTATE") == null ? "" : queryForListProduct.get(0).get("ERPSTATE").toString(); + String partNo = queryForListProduct.get(0).get("partNo") != null ? queryForListProduct.get(0).get("partNo").toString() : ""; + obj.setPartNo(erpState); // private String state; obj.setState(queryForListProduct.get(0).get("state") != null ? queryForListProduct.get(0).get("state").toString() : ""); // private String sdkSpec; @@ -2077,6 +2082,7 @@ public class BSLabelServiceImpl extends CommonServiceDAO im // private String qty; obj.setQty(queryForListProduct.get(0).get("qty") != null ? queryForListProduct.get(0).get("qty").toString() : ""); // private String orderNo; + obj.setOrderNo(queryForListProduct.get(0).get("orderNo") != null ? queryForListProduct.get(0).get("orderNo").toString() : ""); obj.setSourceOrder(queryForListProduct.get(0).get("sourceOrder") != null ? queryForListProduct.get(0).get("sourceOrder").toString() : ""); obj.setPiece(queryForListProduct.get(0).get("piece") != null ? queryForListProduct.get(0).get("piece").toString() : ""); @@ -2095,13 +2101,13 @@ public class BSLabelServiceImpl extends CommonServiceDAO im obj.setRemark(queryForListProduct.get(0).get("remark") != null ? queryForListProduct.get(0).get("remark").toString() : ""); obj.setRemarks(queryForListProduct.get(0).get("remarks") != null ? queryForListProduct.get(0).get("remarks").toString() : ""); // obj.setJumboRollBatch(queryForList.get(0).get("jumboRollBatch") != null ? queryForList.get(0).get("jumboRollBatch").toString() : ""); - obj.setMakedate(queryForListProduct.get(0).get("makedate") != null ? queryForListProduct.get(0).get("makedate").toString() : ""); + obj.setMakedate(formatDateStr(makedate)); obj.setSupplierno(queryForListProduct.get(0).get("supplierNo") != null ? queryForListProduct.get(0).get("supplierNo").toString() : ""); obj.setDescription(queryForListProduct.get(0).get("description") != null ? queryForListProduct.get(0).get("description").toString() : ""); String erpLocation = queryForListProduct.get(0).get("ERPLOCATION") == null ? "" : queryForListProduct.get(0).get("ERPLOCATION").toString(); String locationName = queryForListProduct.get(0).get("LOCATIONNAME") == null ? "" : queryForListProduct.get(0).get("LOCATIONNAME").toString(); - String erpState = queryForListProduct.get(0).get("ERPSTATE") == null ? "" : queryForListProduct.get(0).get("ERPSTATE").toString(); - obj.setLocationcode(erpState + "-" + locationName); + + obj.setLocationcode(partNo + "-" + locationName); log.info("***************************PrintLabel Assign params is : " + params.toString()); //labelUrl = labelPrintRabbitMQ(obj, requestUrl, pr, params); labelUrl = labelPrint(obj, requestUrl, pr, params); @@ -2174,11 +2180,15 @@ public class BSLabelServiceImpl extends CommonServiceDAO im qeuryLabelMap.put("MATERIALPACKINGNAME", MATERIALPACKINGNAME); queryForListProduct = IDMFrameServiceProxy.getSqlTemplate().queryForList(qeuryLabelDatasql, qeuryLabelMap); obj.setBarcode(queryForListProduct.get(0).get("barcode") != null ? queryForListProduct.get(0).get("barcode").toString() : ""); - obj.setMakedate(queryForListProduct.get(0).get("makedate") != null ? queryForListProduct.get(0).get("makedate").toString() : ""); - obj.setExpdate(queryForListProduct.get(0).get("expdate") != null ? queryForListProduct.get(0).get("expdate").toString() : ""); + String makedate = queryForListProduct.get(0).get("makedate") != null ? queryForListProduct.get(0).get("makedate").toString() : ""; + obj.setMakedate(formatDateStr(makedate)); + String expdate = queryForListProduct.get(0).get("expdate") != null ? queryForListProduct.get(0).get("expdate").toString() : ""; + obj.setExpdate(formatDateStr(expdate)); obj.setDescription(queryForListProduct.get(0).get("description") != null ? queryForListProduct.get(0).get("description").toString() : ""); // private String partNo; - obj.setPartNo(queryForListProduct.get(0).get("partNo") != null ? queryForListProduct.get(0).get("partNo").toString() : ""); + String partNo = queryForListProduct.get(0).get("partNo") != null ? queryForListProduct.get(0).get("partNo").toString() : ""; + String erpState = queryForListProduct.get(0).get("ERPSTATE") == null ? "" : queryForListProduct.get(0).get("ERPSTATE").toString(); + obj.setPartNo(erpState); // private String state; obj.setState(queryForListProduct.get(0).get("state") != null ? queryForListProduct.get(0).get("state").toString() : ""); // private String sdkSpec; @@ -2213,13 +2223,13 @@ public class BSLabelServiceImpl extends CommonServiceDAO im obj.setRemark(queryForListProduct.get(0).get("remark") != null ? queryForListProduct.get(0).get("remark").toString() : ""); obj.setRemarks(queryForListProduct.get(0).get("remarks") != null ? queryForListProduct.get(0).get("remarks").toString() : ""); // obj.setJumboRollBatch(queryForList.get(0).get("jumboRollBatch") != null ? queryForList.get(0).get("jumboRollBatch").toString() : ""); - obj.setMakedate(queryForListProduct.get(0).get("makedate") != null ? queryForListProduct.get(0).get("makedate").toString() : ""); + obj.setMakedate(formatDateStr(makedate)); obj.setSupplierno(queryForListProduct.get(0).get("supplierNo") != null ? queryForListProduct.get(0).get("supplierNo").toString() : ""); obj.setDescription(queryForListProduct.get(0).get("description") != null ? queryForListProduct.get(0).get("description").toString() : ""); String erpLocation = queryForListProduct.get(0).get("ERPLOCATION") == null ? "" : queryForListProduct.get(0).get("ERPLOCATION").toString(); String locationName = queryForListProduct.get(0).get("LOCATIONNAME") == null ? "" : queryForListProduct.get(0).get("LOCATIONNAME").toString(); - String erpState = queryForListProduct.get(0).get("ERPSTATE") == null ? "" : queryForListProduct.get(0).get("ERPSTATE").toString(); - obj.setLocationcode(erpState + " " + locationName); + + obj.setLocationcode(partNo + "-" + locationName); log.info("***************************PrintLabel Assign params is : " + params.toString()); //labelUrl = labelPrintRabbitMQ(obj, requestUrl, pr, params); labelUrl = labelPrint(obj, requestUrl, pr, params);