From 76aaf154ad7eb31ce59ad2305403ab9a67e1797e Mon Sep 17 00:00:00 2001 From: 18188916393 <2562295436@qq.com> Date: Fri, 29 Jul 2022 11:08:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E5=A4=A7=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ProductServiceImpl.java | 91 ++++++--- .../ext/bigScreen/wql/BIGSCREENPRODUCT.wql | 184 +++++++++++------- .../org/nl/wms/ext/bigScreen/wql/ds_agv.xls | Bin 146432 -> 146432 bytes .../src/test/java/org/nl/Test3.java | 172 ++++++++++++---- 4 files changed, 311 insertions(+), 136 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/service/impl/ProductServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/service/impl/ProductServiceImpl.java index 19e8fd0c..ebb82d35 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/service/impl/ProductServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/service/impl/ProductServiceImpl.java @@ -2,6 +2,7 @@ package org.nl.wms.ext.bigScreen.service.impl; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; @@ -17,14 +18,10 @@ import java.util.Map; @RequiredArgsConstructor @Slf4j public class ProductServiceImpl implements ProductService { - private String now = "2022-07-26 23:59:59"; - private String today = "2022-07-26"; - //一个月的开始时间 - DateTime beginMonthDateTime = DateUtil.offsetDay(DateUtil.parse(now), 30); - //一天的开始时间 - DateTime beginTimeOfDay = DateUtil.beginOfDay(DateUtil.parse(now)); - //一天的结束时间 - DateTime endTimeOfDay = DateUtil.endOfDay(DateUtil.parseDate(now)); + private String now = DateUtil.now(); + private String today = DateUtil.today(); + //一个月的开始日期 + private String beginOfMonth = DateUtil.formatTime(DateUtil.beginOfMonth(DateUtil.parseDate(today))); @Override public Map planReached(Map param) { @@ -32,12 +29,33 @@ public class ProductServiceImpl implements ProductService { //01-弯头工段、02-综合工段、03-成品工段 Map map = new HashMap(); map.put("flag", "1"); - map.put("begin_time", beginTimeOfDay); - map.put("end_time", endTimeOfDay); - JSONArray dayResult = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().getResultJSONArray(0); + map.put("produce_date", today); + map.put("worksection_type_scode","01"); + JSONObject jo1 = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0); + map.put("worksection_type_scode","02"); + JSONObject jo2 = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0); + map.put("worksection_type_scode","03"); + JSONObject jo3 = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0); + JSONObject dayResult = new JSONObject(); + dayResult.put("jo1",jo1); + dayResult.put("jo2",jo2); + dayResult.put("jo3",jo3); + //计算一个月的计划达成 - map.put("begin_time", beginMonthDateTime); - JSONArray monthResult = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().getResultJSONArray(0); + JSONObject monthResult = new JSONObject(); + map.put("flag", "14"); + map.put("end_produce_date", today); + map.put("begin_produce_date", beginOfMonth); + map.put("worksection_type_scode","01"); + JSONObject joo1 = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0); + map.put("worksection_type_scode","02"); + JSONObject joo2 = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0); + map.put("worksection_type_scode","03"); + JSONObject joo3 = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0); + + monthResult.put("joo1",joo1); + monthResult.put("joo2",joo2); + monthResult.put("joo3",joo3); JSONObject returnjo = new JSONObject(); returnjo.put("code", "1"); returnjo.put("desc", "操作成功!"); @@ -51,8 +69,7 @@ public class ProductServiceImpl implements ProductService { //今日排产生产进度跟踪 Map map = new HashMap(); map.put("flag", "2"); - map.put("begin_time", beginTimeOfDay); - map.put("end_time", endTimeOfDay); + map.put("produce_date", today); JSONArray result = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().getResultJSONArray(0); JSONObject returnjo = new JSONObject(); returnjo.put("code", "1"); @@ -67,8 +84,7 @@ public class ProductServiceImpl implements ProductService { Map map = new HashMap(); // map.put("flag", "3"); map.put("flag", "7"); - map.put("begin_time", beginTimeOfDay); - map.put("end_time", endTimeOfDay); + map.put("produce_date", today); //统计产量方式一: 1 计算工单物料 2 计算每个物料清洗前一个工序 3拿着工序+物料 关联工单表 统计总数 //1激光下料——推弯——清洗 //2旋压-清洗 @@ -83,7 +99,7 @@ public class ProductServiceImpl implements ProductService { map.put("flag", "4"); int sum_qty = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0).getIntValue("count"); //统计延时工单 - map.put("now_time", now); + map.put("product_date",today); map.put("flag", "5"); int delayed_qty = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0).getIntValue("count"); @@ -105,20 +121,28 @@ public class ProductServiceImpl implements ProductService { //获取一周的日期 JSONArray dataArr = new JSONArray(); JSONArray results = new JSONArray(); - for (int i = 1; i < 9; i++) { + for (int i = 0; i < 7; i++) { DateTime dateTime = DateUtil.offsetDay(DateUtil.parse(now), -i); dataArr.add(dateTime.toString().substring(0, 10)); } for (int i = 0; i < dataArr.size(); i++) { JSONObject jo = new JSONObject(); - JSONObject datejo = dataArr.getJSONObject(i); - String date = datejo.get(i).toString(); - jo.put("date", date); + String date = dataArr.get(( dataArr.size()-i-1)).toString(); + + //01-弯头工段、02-综合工段、03-成品工段 Map map = new HashMap(); - map.put("flag", "8"); + map.put("flag", "15"); map.put("produce_date", date); - JSONArray arr = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().getResultJSONArray(0); - jo.put("data", arr); + map.put("worksection_type_scode", "01"); + int elbow_qty = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0).getIntValue("real_qty"); + jo.put("elbow_qty", elbow_qty); + map.put("worksection_type_scode", "02"); + int comprehensive_qty = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0).getIntValue("real_qty"); + jo.put("comprehensive_qty", comprehensive_qty); + map.put("worksection_type_scode", "03"); + int end_product_qty = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0).getIntValue("real_qty"); + jo.put("end_product_qty", end_product_qty); + jo.put("date",date.substring(5,date.length())); results.add(jo); } JSONObject returnjo = new JSONObject(); @@ -147,20 +171,24 @@ public class ProductServiceImpl implements ProductService { //30天产量走势 JSONArray dataArr = new JSONArray(); JSONArray results = new JSONArray(); - for (int i = 1; i < 31; i++) { + for (int i = 0; i < 30; i++) { DateTime dateTime = DateUtil.offsetDay(DateUtil.parse(now), -i); dataArr.add(dateTime.toString().substring(0, 10)); } for (int i = 0; i < dataArr.size(); i++) { JSONObject jo = new JSONObject(); - JSONObject datejo = dataArr.getJSONObject(i); - String date = datejo.get(i).toString(); - jo.put("date", date); + String date = dataArr.get(dataArr.size()-i-1).toString(); + Map map = new HashMap(); map.put("flag", "9"); map.put("produce_date", date); - int real_qty = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0).getIntValue("real_qty"); + int real_qty = 0; + JSONObject jsonObject = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().uniqueResult(0); + if (ObjectUtil.isNotEmpty(jsonObject)) { + real_qty = jsonObject.getIntValue("real_qty"); + } jo.put("real_qty", real_qty); + jo.put("date", date.substring(5,date.length())); results.add(jo); } JSONObject returnjo = new JSONObject(); @@ -189,6 +217,8 @@ public class ProductServiceImpl implements ProductService { Map map = new HashMap(); map.put("flag", "12"); map.put("produce_date", today); + map.put("end_produce_date", today); + map.put("begin_produce_date", beginOfMonth); JSONArray results = WQL.getWO("BIGSCREENPRODUCT").addParamMap(map).process().getResultJSONArray(0); //计算所有的产能 map.put("flag", "13"); @@ -204,6 +234,7 @@ public class ProductServiceImpl implements ProductService { if (count_num_flag < sum_count) { JSONObject joo = new JSONObject(); joo.put("material_name", "其他"); + joo.put("material_spec", "其他"); joo.put("real_qty", sum_count - count_num_flag); results.add(joo); } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/wql/BIGSCREENPRODUCT.wql b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/wql/BIGSCREENPRODUCT.wql index 8f9ef9da..a33bfed9 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/wql/BIGSCREENPRODUCT.wql +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/wql/BIGSCREENPRODUCT.wql @@ -19,6 +19,9 @@ 输入.end_time TYPEAS s_string 输入.now_time TYPEAS s_string 输入.produce_date TYPEAS s_string + 输入.end_produce_date TYPEAS s_string + 输入.begin_produce_date TYPEAS s_string + 输入.worksection_type_scode TYPEAS s_string @@ -47,7 +50,7 @@ IF 输入.flag = "1" QUERY SELECT - workprocedure.worksection_type_scode, + sum( shiftorder.real_qty ) AS real_qty, sum( shiftorder.plan_qty ) AS plan_qty , convert(sum( shiftorder.real_qty )/sum( shiftorder.plan_qty ),DECIMAL(10,2))*100 as finish_rate @@ -56,18 +59,15 @@ LEFT JOIN pdm_bi_workprocedure workprocedure ON shiftorder.workprocedure_id = workprocedure.workprocedure_id LEFT JOIN sys_dict_detail sys ON sys.VALUE= workprocedure.worksection_type_scode AND sys.dict_id = '87' where - 1=1 + + shiftorder.is_delete='0' OPTION 输入.worksection_type_scode <> "" workprocedure.worksection_type_scode = 输入.worksection_type_scode ENDOPTION - OPTION 输入.begin_time <> "" - shiftorder.planproduceend_date >= 输入.begin_time - ENDOPTION - OPTION 输入.end_time <> "" - shiftorder.planproduceend_date <= 输入.end_time - ENDOPTION - GROUP BY - worksection_type_scode + OPTION 输入.produce_date <> "" + shiftorder.produce_date = 输入.produce_date + ENDOPTION + ENDSELECT ENDQUERY ENDIF @@ -79,16 +79,13 @@ shiftorder.plan_qty, shiftorder.real_qty, (shiftorder.plan_qty - shiftorder.real_qty) AS gap_qty, - CONVERT ( ( shiftorder.real_qty / shiftorder.plan_qty ), DECIMAL ( 10, 2 ) ) * 100 AS finish_rate + CONVERT ( ( shiftorder.real_qty / shiftorder.plan_qty ), DECIMAL ( 10, 3 ) ) * 100 AS finish_rate FROM mps_bd_produceshiftorder shiftorder where - 1=1 - OPTION 输入.begin_time <> "" - shiftorder.planproduceend_date >= 输入.begin_time - ENDOPTION - OPTION 输入.end_time <> "" - shiftorder.planproduceend_date <= 输入.end_time + shiftorder.is_delete='0' + OPTION 输入.produce_date <> "" + shiftorder.produce_date = 输入.produce_date ENDOPTION ENDSELECT ENDQUERY @@ -101,7 +98,7 @@ IF 输入.flag = "3" SELECT sum( shiftorder.real_qty ) AS real_qty, sum( shiftorder.plan_qty ) AS plan_qty, - CONVERT ( sum( shiftorder.real_qty ) / sum( shiftorder.plan_qty ), DECIMAL ( 10, 2 ) ) * 100 AS finish_rate + CONVERT ( sum( shiftorder.real_qty ) / sum( shiftorder.plan_qty ), DECIMAL ( 10, 3 ) ) * 100 AS finish_rate FROM mps_bd_produceshiftorder shiftorder RIGHT JOIN ( @@ -118,12 +115,9 @@ IF 输入.flag = "3" AND a.workprocedure_id = shiftorder.workprocedure_id where 1=1 - OPTION 输入.begin_time <> "" - shiftorder.planproduceend_date >= 输入.begin_time - ENDOPTION - OPTION 输入.end_time <> "" - shiftorder.planproduceend_date <= 输入.end_time - ENDOPTION + OPTION 输入.produce_date <> "" + shiftorder.produce_date = 输入.produce_date + ENDOPTION ENDSELECT ENDQUERY ENDIF @@ -135,13 +129,10 @@ ENDIF FROM mps_bd_produceshiftorder shiftorder where - 1=1 - OPTION 输入.begin_time <> "" - shiftorder.planproduceend_date >= 输入.begin_time - ENDOPTION - OPTION 输入.end_time <> "" - shiftorder.planproduceend_date <= 输入.end_time - ENDOPTION + shiftorder.is_delete='0' + OPTION 输入.produce_date <> "" + shiftorder.produce_date = 输入.produce_date + ENDOPTION ENDSELECT ENDQUERY ENDIF @@ -154,12 +145,9 @@ ENDIF mps_bd_produceshiftorder shiftorder where shiftorder.realproduceend_date > shiftorder.planproduceend_date - OPTION 输入.begin_time <> "" - shiftorder.planproduceend_date >= 输入.begin_time - ENDOPTION - OPTION 输入.end_time <> "" - shiftorder.planproduceend_date <= 输入.end_time - ENDOPTION + OPTION 输入.produce_date <> "" + shiftorder.produce_date = 输入.produce_date + ENDOPTION ENDSELECT ENDQUERY ENDIF @@ -170,18 +158,16 @@ ENDIF SELECT sum( real_qty ) AS real_qty, sum( plan_qty ) AS plan_qty, - CONVERT ( sum( shiftorder.real_qty ) / sum( shiftorder.plan_qty ), DECIMAL ( 10, 2 ) ) * 100 AS finish_rate + CONVERT ( sum( shiftorder.real_qty ) / sum( shiftorder.plan_qty ), DECIMAL ( 10, 3 ) ) * 100 AS finish_rate FROM mps_bd_produceshiftorder shiftorder LEFT JOIN pdm_bi_workprocedure workprocedure ON workprocedure.workprocedure_id = shiftorder.workprocedure_id WHERE - workprocedure.workprocedure_code IN ( '07', '06', '02' ) - OPTION 输入.begin_time <> "" - shiftorder.planproduceend_date >= 输入.begin_time - ENDOPTION - OPTION 输入.end_time <> "" - shiftorder.planproduceend_date <= 输入.end_time - ENDOPTION + shiftorder.is_delete='0' + and workprocedure.workprocedure_code IN ( '07', '06', '02' ) + OPTION 输入.produce_date <> "" + shiftorder.produce_date = 输入.produce_date + ENDOPTION ENDSELECT ENDQUERY ENDIF @@ -193,17 +179,18 @@ IF 输入.flag = "8" workprocedure.worksection_type_scode, sum( real_qty ) AS real_qty, sum( plan_qty ) AS plan_qty, - CONVERT ( sum( shiftorder.real_qty ) / sum( shiftorder.plan_qty ), DECIMAL ( 10, 2 ) ) * 100 AS finish_rate + shiftorder.produce_date as date, + CONVERT ( sum( shiftorder.real_qty ) / sum( shiftorder.plan_qty ), DECIMAL ( 10, 3 ) ) * 100 AS finish_rate FROM mps_bd_produceshiftorder shiftorder LEFT JOIN pdm_bi_workprocedure workprocedure ON shiftorder.workprocedure_id = workprocedure.workprocedure_id LEFT JOIN sys_dict_detail sys ON sys.VALUE= workprocedure.worksection_type_scode AND sys.dict_id = '87' WHERE - workprocedure.workprocedure_code IN ( '07', '06', '02' ) + shiftorder.is_delete='0' OPTION 输入.produce_date <> "" - shiftorder.produce_date >= 输入.produce_date + shiftorder.produce_date = 输入.produce_date ENDOPTION - GROUP BY worksection_type_scode + GROUP BY worksection_type_scode,shiftorder.produce_date ENDSELECT ENDQUERY ENDIF @@ -217,9 +204,10 @@ IF 输入.flag = "9" LEFT JOIN pdm_bi_workprocedure workprocedure ON shiftorder.workprocedure_id = workprocedure.workprocedure_id LEFT JOIN sys_dict_detail sys ON sys.VALUE= workprocedure.worksection_type_scode AND sys.dict_id = '87' WHERE - workprocedure.workprocedure_code IN ( '07', '06', '02' ) + shiftorder.is_delete='0' + and workprocedure.workprocedure_code IN ( '07', '06', '02' ) OPTION 输入.produce_date <> "" - shiftorder.produce_date >= 输入.produce_date + shiftorder.produce_date = 输入.produce_date ENDOPTION GROUP BY worksection_type_scode ENDSELECT @@ -232,6 +220,7 @@ IF 输入.flag = "10" shiftorder.material_id, material.material_code, material.material_name, + material.material_spec, sum( real_qty ) AS real_qty FROM mps_bd_produceshiftorder shiftorder @@ -239,14 +228,16 @@ IF 输入.flag = "10" LEFT JOIN sys_dict_detail sys ON sys.VALUE= workprocedure.worksection_type_scode AND sys.dict_id = '87' left join md_me_materialbase material on material.material_id =shiftorder.material_id WHERE - workprocedure.workprocedure_code IN ( '07', '06', '02' ) + shiftorder.is_delete='0' + and workprocedure.workprocedure_code IN ( '07', '06', '02' ) OPTION 输入.produce_date <> "" - shiftorder.produce_date >= 输入.produce_date + shiftorder.produce_date = 输入.produce_date ENDOPTION GROUP BY shiftorder.material_id, material.material_code, - material.material_name + material.material_name, + material.material_spec ORDER BY real_qty LIMIT 0,10 ENDSELECT @@ -265,17 +256,18 @@ IF 输入.flag = "11" shiftorder. real_qty, shiftorder.plan_qty, shiftorder.plan_qty -shiftorder. real_qty as gap_qty, - curdate() as date + shiftorder.produce_date as date FROM mps_bd_produceshiftorder shiftorder LEFT JOIN pdm_bi_workprocedure workprocedure ON shiftorder.workprocedure_id = workprocedure.workprocedure_id LEFT JOIN sys_dict_detail sys ON sys.VALUE= workprocedure.worksection_type_scode AND sys.dict_id = '87' left join md_me_materialbase material on material.material_id =shiftorder.material_id WHERE - workprocedure.workprocedure_code IN ( '07', '06', '02' ) + shiftorder.is_delete='0' + and workprocedure.workprocedure_code IN ( '07', '06', '02' ) and shiftorder. real_qty < shiftorder.plan_qty OPTION 输入.produce_date <> "" - shiftorder.produce_date >= 输入.produce_date + shiftorder.produce_date = 输入.produce_date ENDOPTION ENDSELECT ENDQUERY @@ -288,6 +280,7 @@ IF 输入.flag = "12" shiftorder.material_id, material.material_code, material.material_name, + material.material_spec, sum( real_qty ) AS real_qty FROM mps_bd_produceshiftorder shiftorder @@ -295,13 +288,18 @@ IF 输入.flag = "12" LEFT JOIN sys_dict_detail sys ON sys.VALUE= workprocedure.worksection_type_scode AND sys.dict_id = '87' left join md_me_materialbase material on material.material_id =shiftorder.material_id WHERE - workprocedure.workprocedure_code IN ( '07', '06', '02' ) - OPTION 输入.produce_date <> "" - shiftorder.produce_date >= 输入.produce_date - ENDOPTION + shiftorder.is_delete='0' + and workprocedure.workprocedure_code IN ( '07', '06', '02' ) + OPTION 输入.end_produce_date <> "" + shiftorder.produce_date <= 输入.end_produce_date + ENDOPTION + OPTION 输入.begin_produce_date <> "" + shiftorder.produce_date >= 输入.begin_produce_date + ENDOPTION GROUP BY shiftorder.material_id, material.material_code, + material.material_spec, material.material_name ORDER BY real_qty LIMIT 0,9 @@ -319,11 +317,67 @@ IF 输入.flag = "13" LEFT JOIN sys_dict_detail sys ON sys.VALUE= workprocedure.worksection_type_scode AND sys.dict_id = '87' left join md_me_materialbase material on material.material_id =shiftorder.material_id WHERE - workprocedure.workprocedure_code IN ( '07', '06', '02' ) - OPTION 输入.produce_date <> "" - shiftorder.produce_date >= 输入.produce_date + shiftorder.is_delete='0' + and workprocedure.workprocedure_code IN ( '07', '06', '02' ) + OPTION 输入.end_produce_date <> "" + shiftorder.produce_date <= 输入.end_produce_date + ENDOPTION + OPTION 输入.begin_produce_date <> "" + shiftorder.produce_date >= 输入.begin_produce_date ENDOPTION ENDSELECT ENDQUERY -ENDIF \ No newline at end of file +ENDIF + +IF 输入.flag = "14" + QUERY + SELECT + + sum( shiftorder.real_qty ) AS real_qty, + sum( shiftorder.plan_qty ) AS plan_qty , + convert(sum( shiftorder.real_qty )/sum( shiftorder.plan_qty ),DECIMAL(10,2))*100 as finish_rate + FROM + mps_bd_produceshiftorder shiftorder + LEFT JOIN pdm_bi_workprocedure workprocedure ON shiftorder.workprocedure_id = workprocedure.workprocedure_id + LEFT JOIN sys_dict_detail sys ON sys.VALUE= workprocedure.worksection_type_scode AND sys.dict_id = '87' + where + shiftorder.is_delete='0' + OPTION 输入.worksection_type_scode <> "" + workprocedure.worksection_type_scode = 输入.worksection_type_scode + ENDOPTION + OPTION 输入.end_produce_date <> "" + shiftorder.produce_date <= 输入.end_produce_date + ENDOPTION + OPTION 输入.begin_produce_date <> "" + shiftorder.produce_date >= 输入.begin_produce_date + ENDOPTION + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "15" + QUERY + SELECT + sum( real_qty ) AS real_qty, + sum( plan_qty ) AS plan_qty, + CONVERT ( sum( shiftorder.real_qty ) / sum( shiftorder.plan_qty ), DECIMAL ( 10, 3 ) ) * 100 AS finish_rate + FROM + mps_bd_produceshiftorder shiftorder + LEFT JOIN pdm_bi_workprocedure workprocedure ON shiftorder.workprocedure_id = workprocedure.workprocedure_id + LEFT JOIN sys_dict_detail sys ON sys.VALUE= workprocedure.worksection_type_scode AND sys.dict_id = '87' + WHERE + shiftorder.is_delete='0' + OPTION 输入.produce_date <> "" + shiftorder.produce_date = 输入.produce_date + ENDOPTION + OPTION 输入.worksection_type_scode <> "" + workprocedure.worksection_type_scode = 输入.worksection_type_scode + ENDOPTION + OPTION 输入.produce_date <> "" + shiftorder.produce_date = 输入.produce_date + ENDOPTION + ENDSELECT + ENDQUERY + ENDIF \ No newline at end of file diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/wql/ds_agv.xls b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/wql/ds_agv.xls index 155a4176e131815d14b6d47f41eb5b1d61607887..80ca82b3b4c6ddb4197c91bacc4cfb1cabe3494e 100644 GIT binary patch delta 29 lcmZqp!O`%8V?z!L+l8G^6Fe6+7qPS#u`q5gVqxkt2LQ&x3(Eii delta 29 lcmZqp!O`%8V?z!LTf-!lPm>om7qPS#u`q5gVqxkt2LQZ_3r+w4 diff --git a/mes/hd/nladmin-system/src/test/java/org/nl/Test3.java b/mes/hd/nladmin-system/src/test/java/org/nl/Test3.java index d375bbd5..961adb5d 100644 --- a/mes/hd/nladmin-system/src/test/java/org/nl/Test3.java +++ b/mes/hd/nladmin-system/src/test/java/org/nl/Test3.java @@ -3,17 +3,22 @@ package org.nl; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.junit.Test; import org.nl.exception.BadRequestException; +import org.nl.modules.system.util.CodeUtil; import org.nl.wql.WQL; import org.nl.wql.core.bean.WQLObject; +import java.math.BigDecimal; import java.util.Calendar; import java.util.Date; +import java.util.LinkedList; +import java.util.Queue; public class Test3 extends BaseTest { @Test @@ -965,13 +970,14 @@ public class Test3 extends BaseTest { String a = point_code.substring(0, 2); String b = point_code.substring(2, 4); String c = point_code.substring(4, 6); - String new_point_code ="L"+ a + "-" + c + "-" + b; - String new_point_code_name = a+"排"+c +"列"+b+"层"; + String new_point_code = "L" + a + "-" + c + "-" + b; + String new_point_code_name = a + "排" + c + "列" + b + "层"; jo.put("point_code", new_point_code); - jo.put("point_name",new_point_code_name); + jo.put("point_name", new_point_code_name); pointTable.update(jo); } } + //初始化成品出库位 @Test public void StructCKWCode() { @@ -980,7 +986,7 @@ public class Test3 extends BaseTest { for (int i = 0; i < resultArr.size(); i++) { JSONObject jo = resultArr.getJSONObject(i); String point_code = jo.getString("point_code"); - String new_point_code ="CPCKW"+point_code; + String new_point_code = "CPCKW" + point_code; jo.put("point_code", new_point_code); pointTable.update(jo); } @@ -1003,31 +1009,31 @@ public class Test3 extends BaseTest { String sect_name = ""; if (area_type.equals("KQ001")) { sect_id = "1528631043496742912"; - sect_name="成品库区"; + sect_name = "成品库区"; } if (area_type.equals("KQ002")) { sect_id = "1528631044482404352"; - sect_name="半成品库区"; + sect_name = "半成品库区"; } if (area_type.equals("KQ003")) { sect_id = "1528631044243329024"; - sect_name="半成品上料空框暂存区"; + sect_name = "半成品上料空框暂存区"; } if (area_type.equals("KQ004")) { sect_id = "1528631042318143488"; - sect_name="半成品上下料暂存区"; + sect_name = "半成品上下料暂存区"; } if (area_type.equals("KQ005")) { sect_id = "1528631044369158144"; - sect_name="半成品空框应急区"; + sect_name = "半成品空框应急区"; } if (area_type.equals("KQ006")) { sect_id = "1528631043685486592"; - sect_name="成品出库暂存区"; + sect_name = "成品出库暂存区"; } if (area_type.equals("KQ007")) { sect_id = "1528631044054585344"; - sect_name="半成品料箱区"; + sect_name = "半成品料箱区"; } @@ -1043,22 +1049,23 @@ public class Test3 extends BaseTest { joo.put("width", "1"); joo.put("height", "2"); joo.put("zdepth", "1"); - joo.put("is_tempstruct","1"); - joo.put("create_id","1"); - joo.put("create_name","管理员"); - joo.put("create_time","2022-05-23 15:19:14"); - joo.put("is_delete","0"); - joo.put("back_ground_color","01"); - joo.put("front_ground_color","01"); - joo.put("font_direction_scode","01"); - joo.put("is_used","1"); - joo.put("is_emptyvehicle","0"); - joo.put("storagevehicle_qty","0"); - joo.put("lock_type","00"); - joo.put("material_height_type","1"); + joo.put("is_tempstruct", "1"); + joo.put("create_id", "1"); + joo.put("create_name", "管理员"); + joo.put("create_time", "2022-05-23 15:19:14"); + joo.put("is_delete", "0"); + joo.put("back_ground_color", "01"); + joo.put("front_ground_color", "01"); + joo.put("font_direction_scode", "01"); + joo.put("is_used", "1"); + joo.put("is_emptyvehicle", "0"); + joo.put("storagevehicle_qty", "0"); + joo.put("lock_type", "00"); + joo.put("material_height_type", "1"); structtable.insert(joo); } } + //同步产品工艺路线 @Test public void PDM_BI_ProductProcessRoute() { @@ -1069,8 +1076,8 @@ public class Test3 extends BaseTest { for (int i = 0; i < ja.size(); i++) { JSONObject jo = ja.getJSONObject(i); String processroute_uuid = jo.getString("processroute_uuid"); - JSONArray dtlja = WQL.getWO("QLK01").setDbname("dataSource2").addParam("processroute_uuid",processroute_uuid).addParam("flag", "16").process().getResultJSONArray(0); - for (int j = 0; j