From 93c1c11f04696ac665d0ca05a0ce74e7c5e21b07 Mon Sep 17 00:00:00 2001 From: liuxy Date: Wed, 10 Jul 2024 08:51:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?rev:=E5=87=BA=E5=BA=93=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8E=9F=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OutBillQueryServiceImpl.java | 37 +++++++++++++++++++ .../views/wms/stat/outbillquery/index2.vue | 3 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/stat/service/impl/OutBillQueryServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/stat/service/impl/OutBillQueryServiceImpl.java index 7156e9608..a4ebc5711 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/stat/service/impl/OutBillQueryServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/stat/service/impl/OutBillQueryServiceImpl.java @@ -2,6 +2,7 @@ package org.nl.wms.stat.service.impl; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONArray; @@ -23,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.*; +import java.util.stream.Collectors; /** * @author Liuxy @@ -114,7 +116,28 @@ public class OutBillQueryServiceImpl implements OutBillQueryService { JSONObject json = WQL.getWO("ST_IVT_OUTBILLQUERY").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC,dis.box_no"); // 查询此子卷转单之前的销售订单号 + List content = json.getJSONArray("content").toJavaList(JSONObject.class); + String pcsn_in = content.stream() + .map(row -> row.getString("pcsn")) + .collect(Collectors.joining("','")); + + List subList = WQLObject.getWQLObject("pdm_bi_subpackagerelationrecord") + .query("container_name IN ('" + pcsn_in + "') AND io_type = '0' ORDER BY insert_time") + .getResultJSONArray(0).toJavaList(JSONObject.class); + + // 查询所有子卷最早的入库时间 + for (JSONObject item : content) { + + JSONObject jsonSub = subList.stream() + .filter(row -> row.getString("container_name").equals(item.getString("pcsn"))) + .min(Comparator.comparing(row -> row.getString("insert_time"))) + .orElse(null); + + item.put("old_sale_order_name", ObjectUtil.isEmpty(jsonSub) ? item.getString("sale_order_name") : jsonSub.getString("sale_order_name")); + } + + json.put("content", content); return json; } @@ -281,6 +304,11 @@ public class OutBillQueryServiceImpl implements OutBillQueryService { JSONObject json = resultJSONArray.getJSONObject(i); Map mp = new LinkedHashMap<>(); + // 查询第一次入库的源销售订单 + JSONObject jsonSub = WQLObject.getWQLObject("pdm_bi_subpackagerelationrecord") + .query("container_name = '" + json.getString("pcsn") + "' AND io_type = '0' ORDER BY insert_time") + .uniqueResult(0); + mp.put("仓库", json.getString("stor_name")); if (ObjectUtil.isNotEmpty(bill_type) && "1004".equals(bill_type)) { mp.put("移入仓库", json.getString("in_stor_name")); @@ -312,6 +340,15 @@ public class OutBillQueryServiceImpl implements OutBillQueryService { mp.put("销售订单", json.getString("sale_order_name")); mp.put("行号", ""); } + // 原销售订单 + try { + mp.put("原销售订单", jsonSub.getString("sale_order_name").substring(0, jsonSub.getString("sale_order_name").indexOf("-"))); + mp.put("原行号", jsonSub.getString("sale_order_name").substring(jsonSub.getString("sale_order_name").indexOf("-") + 1, jsonSub.getString("sale_order_name").length())); + } catch (Exception e) { + mp.put("原销售订单", jsonSub.getString("sale_order_name")); + mp.put("原行号", ""); + } + mp.put("业务员", json.getString("sales_owner")); mp.put("出库日期", json.getString("input_time")); mp.put("产品规格", String.format("%.0f", json.getDoubleValue("width"))); diff --git a/lms/nladmin-ui/src/views/wms/stat/outbillquery/index2.vue b/lms/nladmin-ui/src/views/wms/stat/outbillquery/index2.vue index 29304732f..e4b89c3ef 100644 --- a/lms/nladmin-ui/src/views/wms/stat/outbillquery/index2.vue +++ b/lms/nladmin-ui/src/views/wms/stat/outbillquery/index2.vue @@ -115,7 +115,7 @@ - + @@ -127,6 +127,7 @@ + From 4b75167f197e1a197e99ac8fb05efa5bd08d652d Mon Sep 17 00:00:00 2001 From: yanps Date: Wed, 10 Jul 2024 17:52:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0LMS=E4=B8=8B?= =?UTF-8?q?=E5=8F=91=E4=BF=A1=E5=8F=B7=E5=88=B0=E8=A5=BF=E9=97=A8=E5=AD=90?= =?UTF-8?q?=E7=A7=B0=E9=87=8D=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 1022cafa8..a0a63744c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -209,6 +209,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { LampThreecolorDeviceDriver lampThreecolorDeviceDriver; SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; PluggingUnpluggingMachineDeviceDriver pluggingUnpluggingMachineDeviceDriver; + SiemensWeightConveyorDeviceDriver siemensWeightConveyorDeviceDriver; if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); hongXiangStationDeviceDriver.writing(code, value); @@ -225,7 +226,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { pluggingUnpluggingMachineDeviceDriver = (PluggingUnpluggingMachineDeviceDriver) device.getDeviceDriver(); pluggingUnpluggingMachineDeviceDriver.writing(code, value); } - + if (device.getDeviceDriver() instanceof SiemensWeightConveyorDeviceDriver) { + siemensWeightConveyorDeviceDriver = (SiemensWeightConveyorDeviceDriver) device.getDeviceDriver(); + siemensWeightConveyorDeviceDriver.writing(code, value); + } } response.setStatus(200);