From 1ecef4bfb9338f59db31f8c1ba37a15afab47234 Mon Sep 17 00:00:00 2001 From: yinq Date: Fri, 22 Mar 2024 16:35:41 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E5=9C=A8=E5=88=B6=E5=93=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SAPPutStorageServiceImpl.java | 3 +- .../mapper/base/BaseProductLineMapper.xml | 4 +- .../mapper/report/GeneralReportMapper.xml | 53 +++++++++++-------- 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java b/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java index 7e72ef1..2d763c5 100644 --- a/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java +++ b/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java @@ -167,7 +167,8 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService { ArrayList baseOrderInfoList = new ArrayList<>(); List> itemList = resultVo.getO_TAB().get("item"); for (HashMap map : itemList) { - if (StringUtils.isEmpty(map.get("WERKS")) || !map.get("WERKS").equals(SAPConstants.FACTORY_CODE)) { + if (StringUtils.isEmpty(map.get("WERKS")) || !map.get("WERKS").equals(SAPConstants.FACTORY_CODE) + || !map.get("MATNR").startsWith("90")) { continue; } BaseOrderInfo boInfo = new BaseOrderInfo(); diff --git a/aucma-base/src/main/resources/mapper/base/BaseProductLineMapper.xml b/aucma-base/src/main/resources/mapper/base/BaseProductLineMapper.xml index 48e17d8..689c428 100644 --- a/aucma-base/src/main/resources/mapper/base/BaseProductLineMapper.xml +++ b/aucma-base/src/main/resources/mapper/base/BaseProductLineMapper.xml @@ -76,7 +76,9 @@ and bpl.parent_id = #{parentId} and bpl.station_type = #{stationType} - order by bpl.PRODUCT_LINE_CODE + order by + bpl.execution_sort, + bpl.PRODUCT_LINE_CODE - + SELECT B2.PRODUCT_LINE_CODE, B2.PRODUCT_LINE_NAME, - VMC.ORDER_CODE, - VMC.MATERIAL_CODE, - BM.MATERIAL_NAME, + SD.ORDER_CODE, + SD.MATERIAL_CODE, + SD.MATERIAL_NAME, BO.MATERIAL_CODE PRODUCT_CODE, BO.MATERIAL_NAME PRODUCT_NAME, - COUNT(*) COMP_AMOUNT - FROM VIEW_MATERIAL_COMPLETION VMC + COUNT(*) COMP_AMOUNT + FROM ( + SELECT PB.ORDER_CODE, VMC.MATERIAL_BARCODE, BM.MATERIAL_CODE, BM.MATERIAL_NAME + FROM C##AUCMA_SCADA.MATERIAL_COMPLETION VMC LEFT JOIN BASE_PRODUCTLINE BP ON BP.PRODUCT_LINE_CODE = VMC.STATION_NAME - LEFT JOIN BASE_PRODUCTLINE B2 ON B2.PRODUCT_LINE_CODE = BP.PARENT_ID - LEFT JOIN BASE_ORDERINFO BO ON BO.ORDER_CODE = VMC.ORDER_CODE AND BO.ORDER_AMOUNT > BO.COMPLETE_AMOUNT - LEFT JOIN BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = VMC.MATERIAL_CODE + LEFT JOIN C##AUCMA_SCADA.PRINT_BARCODE PB ON VMC.MATERIAL_BARCODE = PB.MATERIAL_BARCODE AND PRINT_BARTYPE = 1 + LEFT JOIN C##AUCMA_SCADA.PRODUCT_OFFLINE PO ON PO.BOX_CODE = PB.MATERIAL_BARCODE + LEFT JOIN BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = PB.MATERIAL_CODE + WHERE PB.MATERIAL_BARCODE IS NOT NULL + AND PO.BOX_CODE IS NULL + AND VMC.COMPLETE_DATE > (SYSDATE - 3) + + AND BP.EXECUTION_SORT >= #{beginStationCode} + + + AND #{endStationCode} > BP.EXECUTION_SORT + + GROUP BY PB.ORDER_CODE, VMC.MATERIAL_BARCODE, BM.MATERIAL_CODE, BM.MATERIAL_NAME + ) SD + LEFT JOIN BASE_ORDERINFO BO ON BO.ORDER_CODE = SD.ORDER_CODE + LEFT JOIN BASE_PRODUCTLINE B2 ON B2.WORK_CENTER_CODE = BO.WORK_CENTER_CODE + LEFT JOIN BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = BO.MATERIAL_CODE - VMC.IS_DOWN_LINE = 0 - AND VMC.PRODUCT_LINE_CODE = #{productLineCode} - - - AND BP.EXECUTION_SORT >= #{beginStationCode} - - - AND #{endStationCode} >= BP.EXECUTION_SORT + AND B2.PRODUCT_LINE_CODE = #{productLineCode} - and VMC.ORDER_CODE = #{ORDER_CODE} + and SD.ORDER_CODE = #{ORDER_CODE} - and BO.MATERIAL_CODE like concat(#{PRODUCT_CODE}, '%') + and BO.MATERIAL_CODE = #{PRODUCT_CODE} and BO.MATERIAL_NAME like concat(concat('%', #{PRODUCT_NAME}), '%') - GROUP BY B2.PRODUCT_LINE_CODE, B2.PRODUCT_LINE_NAME, VMC.ORDER_CODE, VMC.MATERIAL_CODE, BM.MATERIAL_NAME, + GROUP BY B2.PRODUCT_LINE_CODE, B2.PRODUCT_LINE_NAME, SD.ORDER_CODE, SD.MATERIAL_CODE, SD.MATERIAL_NAME, BO.MATERIAL_CODE, BO.MATERIAL_NAME - ORDER BY B2.PRODUCT_LINE_CODE, VMC.ORDER_CODE + ORDER BY COMP_AMOUNT DESC