From 5106e12bdd13ef6cdfbc81d519b2f8f34f2062ba Mon Sep 17 00:00:00 2001 From: yinq <1345442242@qq.com> Date: Mon, 7 Nov 2022 13:28:08 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=B4=9F=E8=8D=B7=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- anomaly/src/main/resources/mapper/ReportMapper.xml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/anomaly/src/main/resources/mapper/ReportMapper.xml b/anomaly/src/main/resources/mapper/ReportMapper.xml index 76c72d4e..c20be248 100644 --- a/anomaly/src/main/resources/mapper/ReportMapper.xml +++ b/anomaly/src/main/resources/mapper/ReportMapper.xml @@ -2767,12 +2767,9 @@ SELECT zab.CREATED_DATE_TIME, SELECT Vie.* FROM customer_Dimension_FinishedTime_Report Vie From 05509f9a3c88022a46d37c1534b3dbae01e95c08 Mon Sep 17 00:00:00 2001 From: yinq <1345442242@qq.com> Date: Mon, 7 Nov 2022 13:55:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9C=BA=E5=8F=B0=E5=B7=B2=E5=AE=8C?= =?UTF-8?q?=E5=B7=A5=E5=B7=A5=E6=97=B6=E6=8A=A5=E8=A1=A8=E4=BF=9D=E7=95=99?= =?UTF-8?q?2=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ReportServiceImpl.java | 58 +++++++------- .../main/resources/mapper/ReportMapper.xml | 80 +++++++++---------- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java index aa2dbf97..1d1a31de 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java @@ -1334,21 +1334,21 @@ public class ReportServiceImpl implements ReportService { tardinessWork += Float.valueOf(String.valueOf(map.get("tardinessWork"))); totalWorkingHours += Float.valueOf(String.valueOf(map.get("totalWorkingHours"))); } - countMap.put("tardinessWork",String.format("%.3f",tardinessWork)); - countMap.put("monthCapacity",String.format("%.3f",monthCapacity)); - countMap.put("workHours1",String.format("%.3f",workHours1)); - countMap.put("workHours2",String.format("%.3f",workHours2)); - countMap.put("workHours3",String.format("%.3f",workHours3)); - countMap.put("workHours4",String.format("%.3f",workHours4)); - countMap.put("workHours5",String.format("%.3f",workHours5)); - countMap.put("workHours6",String.format("%.3f",workHours6)); - countMap.put("workHours7",String.format("%.3f",workHours7)); - countMap.put("workHours8",String.format("%.3f",workHours8)); - countMap.put("workHours9",String.format("%.3f",workHours9)); - countMap.put("workHours10",String.format("%.3f",workHours10)); - countMap.put("workHours11",String.format("%.3f",workHours11)); - countMap.put("workHours12",String.format("%.3f",workHours12)); - countMap.put("totalWorkingHours",String.format("%.3f",totalWorkingHours)); + countMap.put("tardinessWork",String.format("%.2f",tardinessWork)); + countMap.put("monthCapacity",String.format("%.2f",monthCapacity)); + countMap.put("workHours1",String.format("%.2f",workHours1)); + countMap.put("workHours2",String.format("%.2f",workHours2)); + countMap.put("workHours3",String.format("%.2f",workHours3)); + countMap.put("workHours4",String.format("%.2f",workHours4)); + countMap.put("workHours5",String.format("%.2f",workHours5)); + countMap.put("workHours6",String.format("%.2f",workHours6)); + countMap.put("workHours7",String.format("%.2f",workHours7)); + countMap.put("workHours8",String.format("%.2f",workHours8)); + countMap.put("workHours9",String.format("%.2f",workHours9)); + countMap.put("workHours10",String.format("%.2f",workHours10)); + countMap.put("workHours11",String.format("%.2f",workHours11)); + countMap.put("workHours12",String.format("%.2f",workHours12)); + countMap.put("totalWorkingHours",String.format("%.2f",totalWorkingHours)); result.add(countMap); return result; } @@ -1402,20 +1402,20 @@ public class ReportServiceImpl implements ReportService { tardinessWork += Float.valueOf(String.valueOf(map.get("tardinessWork"))); totalWorkingHours += Float.valueOf(String.valueOf(map.get("totalWorkingHours"))); } - countMap.put("tardinessWork",String.format("%.3f",tardinessWork)); - countMap.put("workHours1",String.format("%.3f",workHours1)); - countMap.put("workHours2",String.format("%.3f",workHours2)); - countMap.put("workHours3",String.format("%.3f",workHours3)); - countMap.put("workHours4",String.format("%.3f",workHours4)); - countMap.put("workHours5",String.format("%.3f",workHours5)); - countMap.put("workHours6",String.format("%.3f",workHours6)); - countMap.put("workHours7",String.format("%.3f",workHours7)); - countMap.put("workHours8",String.format("%.3f",workHours8)); - countMap.put("workHours9",String.format("%.3f",workHours9)); - countMap.put("workHours10",String.format("%.3f",workHours10)); - countMap.put("workHours11",String.format("%.3f",workHours11)); - countMap.put("workHours12",String.format("%.3f",workHours12)); - countMap.put("totalWorkingHours",String.format("%.3f",totalWorkingHours)); + countMap.put("tardinessWork",String.format("%.2f",tardinessWork)); + countMap.put("workHours1",String.format("%.2f",workHours1)); + countMap.put("workHours2",String.format("%.2f",workHours2)); + countMap.put("workHours3",String.format("%.2f",workHours3)); + countMap.put("workHours4",String.format("%.2f",workHours4)); + countMap.put("workHours5",String.format("%.2f",workHours5)); + countMap.put("workHours6",String.format("%.2f",workHours6)); + countMap.put("workHours7",String.format("%.2f",workHours7)); + countMap.put("workHours8",String.format("%.2f",workHours8)); + countMap.put("workHours9",String.format("%.2f",workHours9)); + countMap.put("workHours10",String.format("%.2f",workHours10)); + countMap.put("workHours11",String.format("%.2f",workHours11)); + countMap.put("workHours12",String.format("%.2f",workHours12)); + countMap.put("totalWorkingHours",String.format("%.2f",totalWorkingHours)); result.add(countMap); return result; } diff --git a/anomaly/src/main/resources/mapper/ReportMapper.xml b/anomaly/src/main/resources/mapper/ReportMapper.xml index c20be248..c1e38048 100644 --- a/anomaly/src/main/resources/mapper/ReportMapper.xml +++ b/anomaly/src/main/resources/mapper/ReportMapper.xml @@ -2571,20 +2571,20 @@ SELECT zab.CREATED_DATE_TIME, --客户维度已完工工时报表 SELECT KHW."workCenterDescription",--车间 KHW."shortHandWorkOrder",--客户 - SUM(KHW."tardinessWork") "tardinessWork", --未完工工时 - SUM(KHW."workHours1") "workHours1", - SUM(KHW."workHours2") "workHours2", - SUM(KHW."workHours3") "workHours3", - SUM(KHW."workHours4") "workHours4", - SUM(KHW."workHours5") "workHours5", - SUM(KHW."workHours6") "workHours6", - SUM(KHW."workHours7") "workHours7", - SUM(KHW."workHours8") "workHours8", - SUM(KHW."workHours9") "workHours9", - SUM(KHW."workHours10") "workHours10", - SUM(KHW."workHours11") "workHours11", - SUM(KHW."workHours12") "workHours12", - SUM(KHW."totalWorkingHours") "totalWorkingHours" + ROUND(SUM(KHW."tardinessWork") ,2) "tardinessWork", --未完工工时 + ROUND(SUM(KHW."workHours1") ,2) "workHours1", + ROUND(SUM(KHW."workHours2") ,2) "workHours2", + ROUND(SUM(KHW."workHours3") ,2) "workHours3", + ROUND(SUM(KHW."workHours4") ,2) "workHours4", + ROUND(SUM(KHW."workHours5") ,2) "workHours5", + ROUND(SUM(KHW."workHours6") ,2) "workHours6", + ROUND(SUM(KHW."workHours7") ,2) "workHours7", + ROUND(SUM(KHW."workHours8") ,2) "workHours8", + ROUND(SUM(KHW."workHours9") ,2) "workHours9", + ROUND(SUM(KHW."workHours10") ,2) "workHours10", + ROUND(SUM(KHW."workHours11") ,2) "workHours11", + ROUND(SUM(KHW."workHours12") ,2) "workHours12", + ROUND(SUM(KHW."totalWorkingHours"),2) "totalWorkingHours" FROM ( SELECT CASE WHEN INSTR(WIP."workOrder", '硫化') > 0 THEN '硫化' @@ -2621,84 +2621,84 @@ SELECT zab.CREATED_DATE_TIME, FROM DUAL) SELECT WCT.DESCRIPTION "workCenterDescription", cf2.VALUE "workOrder", - SUM(CASE + ROUND(ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS != 'CANCEL' AND ZSD.DISPATCH_STATUS != 'PAUSE' AND ZSD.DISPATCH_STATUS != 'COMPLETE' THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "tardinessWork", - SUM(CASE + ELSE 0 END),2) "tardinessWork", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month0) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month1) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours1", - SUM(CASE + ELSE 0 END),2) "workHours1", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month1) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month2) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours2", - SUM(CASE + ELSE 0 END),2) "workHours2", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month2) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month3) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours3", - SUM(CASE + ELSE 0 END),2) "workHours3", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month3) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month4) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours4", - SUM(CASE + ELSE 0 END),2) "workHours4", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month4) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month5) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours5", - SUM(CASE + ELSE 0 END),2) "workHours5", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month5) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month6) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours6", - SUM(CASE + ELSE 0 END),2) "workHours6", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month6) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month7) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours7", - SUM(CASE + ELSE 0 END),2) "workHours7", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month7) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month8) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours8", - SUM(CASE + ELSE 0 END),2) "workHours8", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month8) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month9) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours9", - SUM(CASE + ELSE 0 END),2) "workHours9", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month9) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month10) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours10", - SUM(CASE + ELSE 0 END),2) "workHours10", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month10) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month11) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours11", - SUM(CASE + ELSE 0 END),2) "workHours11", + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS = 'COMPLETE' AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= TO_DATE(MONTH.month11) AND (ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) < TO_DATE(MONTH.month12) THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS - ELSE 0 END) "workHours12" + ELSE 0 END),2) "workHours12" FROM Z_SFC_DISPATCH ZSD LEFT JOIN SHOP_ORDER so ON so.SHOP_ORDER = zsd.SHOP_ORDER AND so.SITE = zsd.SITE LEFT JOIN CUSTOM_FIELDS cf2 ON cf2.HANDLE = so.HANDLE AND cf2."ATTRIBUTE" = 'WORK_ORDER' From c291217871534cc28bc1a5f8fac66d67ec768c00 Mon Sep 17 00:00:00 2001 From: yinq <1345442242@qq.com> Date: Tue, 8 Nov 2022 10:08:26 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=B4=9F=E8=8D=B7=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TemporaryFixController.java | 21 +++++++++++++++++++ .../main/resources/mapper/ReportMapper.xml | 6 +++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/TemporaryFixController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/TemporaryFixController.java index a88fe084..bbba314d 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/TemporaryFixController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/TemporaryFixController.java @@ -1,8 +1,11 @@ package com.foreverwin.mesnac.anomaly.controller; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONUtil; import com.foreverwin.mesnac.anomaly.utils.DateReportUtils; import com.foreverwin.mesnac.common.util.DataUtils; import com.foreverwin.mesnac.common.util.DateUtil; +import com.foreverwin.mesnac.common.util.HttpUtils; import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.modular.core.util.R; import com.foreverwin.modular.core.util.FrontPage; @@ -153,6 +156,24 @@ public class TemporaryFixController { return R.ok(result); } + /** + * 测试 + * @param paramMap + * @return + */ + @PostMapping("/getURL") + @ResponseBody + public R getURL(Map paramMap) { + paramMap.put("materialCode","A10000"); + String respBody = null; + try { + String jsonStr = JSONUtil.toJsonStr(paramMap); + respBody = HttpUtil.post("http://121.36.58.109:6088/hand/instore/info?materialCode=A10000", jsonStr); + } catch (Exception e) { + return R.failed(e.toString()); + } + return R.ok(respBody); + } /* @PostMapping("/import") diff --git a/anomaly/src/main/resources/mapper/ReportMapper.xml b/anomaly/src/main/resources/mapper/ReportMapper.xml index c1e38048..91fd1eb2 100644 --- a/anomaly/src/main/resources/mapper/ReportMapper.xml +++ b/anomaly/src/main/resources/mapper/ReportMapper.xml @@ -2621,7 +2621,7 @@ SELECT zab.CREATED_DATE_TIME, FROM DUAL) SELECT WCT.DESCRIPTION "workCenterDescription", cf2.VALUE "workOrder", - ROUND(ROUND(SUM(CASE + ROUND(SUM(CASE WHEN ZSD.DISPATCH_STATUS != 'CANCEL' AND ZSD.DISPATCH_STATUS != 'PAUSE' AND ZSD.DISPATCH_STATUS != 'COMPLETE' THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS @@ -2712,7 +2712,7 @@ SELECT zab.CREATED_DATE_TIME, GROUP BY WCT.DESCRIPTION, cf2.VALUE) WIP ) KHW GROUP BY KHW."workCenterDescription", KHW."shortHandWorkOrder" - ORDER BY KHW."workCenterDescription" DESC, KHW."shortHandWorkOrder" + ORDER BY "totalWorkingHours" DESC