From 5cbb324c4dba727ddf2c84f82842c2cdd719deb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Mon, 14 Nov 2022 11:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=93=9D=E5=86=85=E8=83=86?= =?UTF-8?q?=E6=88=90=E5=9E=8B=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FoamBoxController.java | 6 - .../controller/FoamBoxController2.java | 239 ++++++++++++++++++ .../main/resources/static/js/foamBox/index.js | 12 - .../resources/static/js/foamBox/index2.js} | 9 +- .../resources/templates/foamBox/index.html | 12 - .../resources/templates/foamBox/index2.html} | 17 +- 6 files changed, 256 insertions(+), 39 deletions(-) create mode 100644 productionboard/src/main/java/com/productionboard/controller/FoamBoxController2.java rename productionboard/{target/classes/static/js/foamBox/index.js => src/main/resources/static/js/foamBox/index2.js} (91%) rename productionboard/{target/classes/templates/foamBox/index.html => src/main/resources/templates/foamBox/index2.html} (83%) diff --git a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java index e09e393..2b691ff 100644 --- a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java +++ b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java @@ -53,12 +53,6 @@ public class FoamBoxController { case 1: mmap.put("positionId",1); break; - case 2: - mmap.put("positionId",2); - break; - case 3: - mmap.put("positionId",3); - break; default: break; } diff --git a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController2.java b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController2.java new file mode 100644 index 0000000..f8ee7a2 --- /dev/null +++ b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController2.java @@ -0,0 +1,239 @@ +package com.productionboard.controller; + +import com.alibaba.fastjson.JSONArray; +import com.productionboard.entity.MesProduction.MesHourProdutionStatistics; +import com.productionboard.entity.MesProduction.MesMaterialProductionStatistics; +import com.productionboard.entity.MesProduction.MesMaterialStoreStatistics; +import com.productionboard.entity.MesProduction.MesTeamStatistics; +import com.productionboard.service.IFoamBoxDeviceInfoService; +import com.productionboard.service.IMesProductionDataService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.ArrayList; +import java.util.List; + +/** + * 箱体发泡 + * @author WenJY + * @date 2022年04月20日 11:03 + */ +@Controller +@RequestMapping("/foamBox2") +public class FoamBoxController2 { + + @Autowired + private IMesProductionDataService iMesProductionDataService; + + @Autowired + private IFoamBoxDeviceInfoService ifamBoxDeviceInfoService; + + private String prefix = "foamBox/index2"; + + /** + * id:0-南线;1-北线 + * @author WenJY + * @date 2022-06-10 13:57 + * @param id + * @param mmap + * @return java.lang.String + */ + @GetMapping() + public String index(@RequestParam("id") int id,ModelMap mmap) + { + switch (id) { + case 0: + mmap.put("positionId",0); + break; + case 1: + mmap.put("positionId",1); + break; + default: + break; + } + return prefix; + } + + /** + * 班组统计 + * @author WenJY + * @date 2022-06-09 16:38 + * @return java.lang.String + */ + @GetMapping("/getTeamStatisticsJson") + @ResponseBody + public String getTeamStatisticsJson(String ids){ + String type=(ids.equals("0"))?"1029":"1012"; +// List mesTeamStatisticsList = iMesProductionDataService.getMesTeamStatisticsList(type); + List mesTeamStatisticsList = iMesProductionDataService.getMesTeamStatisticsList("1010"); + if(mesTeamStatisticsList.size()>0){ + return JSONArray.toJSONString(mesTeamStatisticsList.get(0)); + } + return JSONArray.toJSONString(new MesTeamStatistics()); + } + + /** + * 获取发泡线、发泡机状态 + * @author WenJY + * @date 2022-06-10 14:57 + * @param ids + * @return java.lang.String + */ + @GetMapping("/getRunStatusJson") + @ResponseBody + public String getRunStatusJson(String ids){ + System.out.println("发泡机状态"+ids); + String runStatus = ifamBoxDeviceInfoService.getRunStatus(ids); + + return runStatus; + } + + /** + * 获取发泡机ISO、POL温度 + * @author WenJY + * @date 2022-06-10 14:58 + * @param ids + * @return java.lang.String + */ + @GetMapping("/getParamTemperature") + @ResponseBody + public String getParamTemperature(String ids){ + String s = ifamBoxDeviceInfoService.getParamTemperature(ids); + + return s; + } + + /** + * 获取模具温度 + * @author WenJY + * @date 2022-06-10 17:08 + * @param ids + * @return java.lang.String + */ + @GetMapping("/getMouldTemperature") + @ResponseBody + public String getMouldTemperature(String ids){ + String s = ifamBoxDeviceInfoService.getMouldTemperature(ids,0); + + return s; + } + + @GetMapping("/getMouldTemperature2") + @ResponseBody + public String getMouldTemperature2(String ids){ + String s = ifamBoxDeviceInfoService.getMouldTemperature(ids,1); + + return s; + } + + /** + * 通过工位号获取MES小时产量 + * @author WenJY + * @date 2022-06-09 16:54 + * @return java.lang.String + * Proce_Code =1029 发泡前出库南线 + * Proce_Code =1012 发泡前出库北线 + */ + @GetMapping("/getHourProdutionJson") + @ResponseBody + public String getHourProdutionStatisticsJson(String ids){ + System.out.println("通过工位号获取MES小时产量:"+ids); + String type=(ids.equals("0"))?"1029":"1012"; + List mesHourProdutionStatisticsList = + iMesProductionDataService.getMesHourProdutionStatisticsListType("1010",type); + if(mesHourProdutionStatisticsList.size()>0){ + return JSONArray.toJSONString(mesHourProdutionStatisticsList); + } + return JSONArray.toJSONString(new ArrayList()); + } + + /** + * 通过工位号获取MES物料产量 + * @author WenJY + * @date 2022-06-09 17:06 + * @return java.lang.String + */ + @GetMapping("/getMaterialProdutionJson") + @ResponseBody + public String getMaterialProdutionStatisticsJson(String ids){ + String type=(ids.equals("0"))?"1029":"1012"; + List mesMaterialProductionStatisticsList = + iMesProductionDataService.getMesMaterialProductionStatisticsListType("1010",type); + + return JSONArray.toJSONString(mesMaterialProductionStatisticsList); + } + + /** + * 获取MES物料库存 + * @author WenJY + * @date 2022-06-09 17:18 + * @return java.lang.String + */ + @GetMapping("/getMaterialStoreJson") + @ResponseBody + public String getMesMaterialStoreStatisticsJson(){ + + List mesMaterialStoreStatisticsList = + iMesProductionDataService.getMesMaterialStoreStatisticsList("1010"); + return JSONArray.toJSONString(mesMaterialStoreStatisticsList); + } + +// /** +// * 根据型号统计产量 +// * +// * @author WenJY +// * @date 2022/4/20 10:15 +// * @return java.lang.String +// */ +// @GetMapping("/getStatisticalOutputByModel") +// @ResponseBody +// public String getStatisticalOutputByModel() { +// String info = +// "{\n" +// + "\t\"datas\":[\n" +// + " {\"ranking\": 1,\"station\":\"SC227\",\"value\": 199999},\n" +// + " {\"ranking\": 2,\"station\":\"SC228\",\"value\": 104970},\n" +// + " {\"ranking\": 3,\"station\":\"SC229\",\"value\": 29034},\n" +// + " {\"ranking\": 4,\"station\":\"SC223\",\"value\": 23489},\n" +// + " {\"ranking\": 5,\"station\":\"SC224\",\"value\": 18203}\n" +// + " ],\n" +// + "\t\"plan\":[290000, 290000, 290000, 290000, 290000, 290000]\n" +// + "}"; +// return info; +// } + +// /** +// * 库存 统计 +// * +// * @author WenJY +// * @date 2022/4/20 10:16 +// * @return java.lang.String +// */ +// @GetMapping("/getInventoryStatistics") +// @ResponseBody +// public String getInventoryStatistics() { +// String info = +// "{\n" +// + "\t\"datas\":[\n" +// + " {\n" +// + " \"name\": \"SC528\",\n" +// + " \"value\": 175.17\n" +// + " },\n" +// + " {\n" +// + " \"name\": \"SC529\",\n" +// + " \"value\": 148.35\n" +// + " },\n" +// + " {\n" +// + " \"name\": \"SC327\",\n" +// + " \"value\": 95.36\n" +// + " }\n" +// + " ]\n" +// + "}"; +// return info; +// } +} diff --git a/productionboard/src/main/resources/static/js/foamBox/index.js b/productionboard/src/main/resources/static/js/foamBox/index.js index 750cf41..a943c58 100644 --- a/productionboard/src/main/resources/static/js/foamBox/index.js +++ b/productionboard/src/main/resources/static/js/foamBox/index.js @@ -140,15 +140,3 @@ const deviceStatus = (statusArray) => { $(".foamingLineRunStatus table tr").append(info); } - -const deviceStatus2 = (statusArray) => { - let info = ` - - - - -`; - - $(".foamingLineRunStatus table tr").append(info); - -} diff --git a/productionboard/target/classes/static/js/foamBox/index.js b/productionboard/src/main/resources/static/js/foamBox/index2.js similarity index 91% rename from productionboard/target/classes/static/js/foamBox/index.js rename to productionboard/src/main/resources/static/js/foamBox/index2.js index 43c5fcb..9e1734a 100644 --- a/productionboard/target/classes/static/js/foamBox/index.js +++ b/productionboard/src/main/resources/static/js/foamBox/index2.js @@ -3,12 +3,13 @@ $(() => { let fun = () => { //班组计划统计 $.getJSON(`/foamBox/getTeamStatisticsJson?ids=${ids}`, function (result) { + console.log(result) onDutyPlan(result.planAmount, result.actualAmount, result.planAmount - result.actualAmount) }); //设备运行状态 $.getJSON(`/foamBox/getRunStatusJson?ids=${ids}`, function (result) { - deviceStatus(result); + deviceStatus(result); }); // deviceStatus([1,1,1,1,1,1]); @@ -122,12 +123,11 @@ const temperature = (res, ids) => { mycharts.setOption(option); $(window).resize(mycharts.resize); } + const deviceStatus = (statusArray) => { let info = ` - - - + `; @@ -135,4 +135,3 @@ const deviceStatus = (statusArray) => { $(".foamingLineRunStatus table tr").append(info); } - diff --git a/productionboard/src/main/resources/templates/foamBox/index.html b/productionboard/src/main/resources/templates/foamBox/index.html index 36e5775..5c3791c 100644 --- a/productionboard/src/main/resources/templates/foamBox/index.html +++ b/productionboard/src/main/resources/templates/foamBox/index.html @@ -64,18 +64,6 @@ }); const ids = [[${positionId}]]; - if (ids === 2 || ids === 3) { - console.log($('body')) - $('body').css( - { - backgroundColor: 'aquamarine', - background: 'url(../../img/foamBox/foamBoxbackground2.jpg)', - backgroundPosition: 'center center', - backgroundRepeat: 'no-repeat', - backgroundAttachment: 'fixed', - backgroundSize: '100% 100%', - }) - } // let info = ` // diff --git a/productionboard/target/classes/templates/foamBox/index.html b/productionboard/src/main/resources/templates/foamBox/index2.html similarity index 83% rename from productionboard/target/classes/templates/foamBox/index.html rename to productionboard/src/main/resources/templates/foamBox/index2.html index af0ee80..a62d5cd 100644 --- a/productionboard/target/classes/templates/foamBox/index.html +++ b/productionboard/src/main/resources/templates/foamBox/index2.html @@ -1,12 +1,12 @@ - + 发泡和发泡线数据展示平台 - - - + + + @@ -64,6 +64,15 @@ }); const ids = [[${positionId}]]; + $('body').css( + { + backgroundColor: 'aquamarine', + background: 'url(../../img/foamBox/foamBoxbackground2.jpg)', + backgroundPosition: 'center center', + backgroundRepeat: 'no-repeat', + backgroundAttachment: 'fixed', + backgroundSize: '100% 100%', + }) // let info = ` //