From 952962413804a0ee8dc8d20f47abd671b370461b 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:17:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=8C=E6=9C=9F=E5=8F=91?= =?UTF-8?q?=E6=B3=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FoamBoxController.java | 2 + .../controller/FoamBoxController2.java | 239 ------------------ .../main/resources/static/js/foamBox/index.js | 16 +- .../resources/static/js/foamBox/index2.js | 137 ---------- .../resources/templates/foamBox/index.html | 12 + .../resources/templates/foamBox/index2.html | 89 ------- 6 files changed, 28 insertions(+), 467 deletions(-) delete mode 100644 productionboard/src/main/java/com/productionboard/controller/FoamBoxController2.java delete mode 100644 productionboard/src/main/resources/static/js/foamBox/index2.js delete mode 100644 productionboard/src/main/resources/templates/foamBox/index2.html diff --git a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java index 2b691ff..5750831 100644 --- a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java +++ b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java @@ -48,9 +48,11 @@ public class FoamBoxController { { switch (id) { case 0: + case 2: mmap.put("positionId",0); break; case 1: + case 3: mmap.put("positionId",1); break; default: diff --git a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController2.java b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController2.java deleted file mode 100644 index f8ee7a2..0000000 --- a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController2.java +++ /dev/null @@ -1,239 +0,0 @@ -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 a943c58..04bfb3c 100644 --- a/productionboard/src/main/resources/static/js/foamBox/index.js +++ b/productionboard/src/main/resources/static/js/foamBox/index.js @@ -9,9 +9,9 @@ $(() => { //设备运行状态 $.getJSON(`/foamBox/getRunStatusJson?ids=${ids}`, function (result) { - if (ids === 0 || ids === 1){ + if (htmlId === '0' || htmlId === '1') { deviceStatus(result); - }else{ + } else { deviceStatus2(result) } }); @@ -140,3 +140,15 @@ const deviceStatus = (statusArray) => { $(".foamingLineRunStatus table tr").append(info); } + +const deviceStatus2 = (statusArray) => { + let info = ` + + + + +`; + + $(".foamingLineRunStatus table tr").append(info); + +} diff --git a/productionboard/src/main/resources/static/js/foamBox/index2.js b/productionboard/src/main/resources/static/js/foamBox/index2.js deleted file mode 100644 index 9e1734a..0000000 --- a/productionboard/src/main/resources/static/js/foamBox/index2.js +++ /dev/null @@ -1,137 +0,0 @@ -$(() => { - - 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([1,1,1,1,1,1]); - - - //库存统计 - $.getJSON(`/foamBox/getMaterialStoreJson`, function (result) { - threeDimensionalCylindrical(result, document.getElementById("inventoryStatistics")); - }); - - //按型号统计产量 - $.getJSON(`/foamBox/getMaterialProdutionJson?ids=${ids}`, function (result) { - horizontalBarChart(result, document.getElementById("statisticalOutputByModel")); - }); - - //小时产量 - $.getJSON(`/foamBox/getHourProdutionJson?ids=${ids}`, function (result) { - brokenLineAreaDiagram(result, document.getElementById("hourlyOutputStatistics")); - }); - - //发泡参数 - $.getJSON(`/foamBox/getParamTemperature?ids=${ids}`, function (result) { - multipleBrokenLineAreaDiagram(result, document.getElementById("foamingParameters")); - }); - - // 模具温度1 - - - $.getJSON(`/foamBox/getMouldTemperature?ids=${ids}`, function (result) { - temperature(result, document.getElementById("temperatureOne")); - }); - $.getJSON(`/foamBox/getMouldTemperature2?ids=${ids}`, function (result) { - temperature(result, document.getElementById("temperatureTwo")); - }); - setTimeout(fun, 10000) - } - fun() - - -}) - -const temperature = (res, ids) => { - let mycharts = echarts.init(ids); - console.log(res); - - - let option = { - grid: { - top: '15%', - left: '6%', - right: '6%', - bottom: '3%', - containLabel: true - }, - tooltip: { - // trigger: "axis", - }, - xAxis: [ - { - interval: 0, - type: 'category', - data: res.xValueList, - axisPointer: { - type: 'shadow' - }, - axisLabel: { - show: true, - rotate: 30, - interval: 0 - } - } - ], - yAxis: [ - { - splitLine: { - show: false, - }, - type: 'value', - name: '温度', - min: 0, - // max: 50, - interval: 10, - axisLabel: { - formatter: '{value} °C ' - } - }, - ], - series: [ - { - name: '内膜温度', - type: 'bar', - tooltip: { - valueFormatter: function (value) { - return value + ' ml'; - } - }, - data: res.interiorList - }, - { - name: '外膜温度', - type: 'bar', - tooltip: { - valueFormatter: function (value) { - return value + ' ml'; - } - }, - data: res.lateralList - }, - ] - }; - - mycharts.setOption(option); - $(window).resize(mycharts.resize); -} - -const deviceStatus = (statusArray) => { - let info = ` - - - - -`; - - $(".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 5c3791c..ba31c7e 100644 --- a/productionboard/src/main/resources/templates/foamBox/index.html +++ b/productionboard/src/main/resources/templates/foamBox/index.html @@ -64,6 +64,18 @@ }); const ids = [[${positionId}]]; + const htmlId = location.href.split('?')[1].split('=')[1] + if (htmlId === '2' || htmlId === '3') { + $('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/src/main/resources/templates/foamBox/index2.html b/productionboard/src/main/resources/templates/foamBox/index2.html deleted file mode 100644 index a62d5cd..0000000 --- a/productionboard/src/main/resources/templates/foamBox/index2.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - 发泡和发泡线数据展示平台 - - - - - - - - - - - - - - -
- - -
- - -
- - -
- - -
- - - -
-
- - -
-
-
-
-
-
-
-
-
-
-
-
- - - - - \ No newline at end of file