From 83f03158139cd208348c08bdbd9bd4c599d33c84 Mon Sep 17 00:00:00 2001 From: wenjy Date: Thu, 16 Jun 2022 23:10:42 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E6=A0=B7=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AluminumLinerkController.java | 2 +- .../controller/FoamBoxController.java | 10 +++- .../controller/TankShellDeviceController.java | 6 -- .../AluminumDevice/AluminumOeeStatistics.java | 4 +- .../TankShellDevicePrameterValue.java | 4 +- .../TankShellDevicePrameterValueMapper.java | 2 +- .../service/IFoamBoxDeviceInfoService.java | 2 +- .../impl/FoamBoxDeviceInfoServiceImpl.java | 59 ++++--------------- .../impl/TankShellDeviceInfoServiceImpl.java | 2 +- .../static/js/aluminumLiner/index.js | 2 +- .../main/resources/static/js/foamBox/index.js | 16 ++--- .../resources/static/js/tankShell/device.js | 8 +-- 12 files changed, 41 insertions(+), 76 deletions(-) diff --git a/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java b/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java index d415a76..58d5807 100644 --- a/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java +++ b/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java @@ -84,7 +84,7 @@ public class AluminumLinerkController { List oeeStatisticsList = aluminumDeviceInfoService.getOeeStatisticsList(); if(oeeStatisticsList.size()>0){ oeeStatisticsList.forEach(x->{ - x.setYValue(hourFormat.format(x.getCreateTime())); + x.setXValue(hourFormat.format(x.getCreateTime())); }); } return JSONArray.toJSONString(oeeStatisticsList); diff --git a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java index 1d6daac..536d357 100644 --- a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java +++ b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java @@ -115,7 +115,15 @@ public class FoamBoxController { @GetMapping("/getMouldTemperature") @ResponseBody public String getMouldTemperature(String ids){ - String s = ifamBoxDeviceInfoService.getMouldTemperature(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; } diff --git a/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java b/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java index d6547ad..202dd3e 100644 --- a/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java +++ b/productionboard/src/main/java/com/productionboard/controller/TankShellDeviceController.java @@ -59,12 +59,6 @@ public class TankShellDeviceController { jsonObjectList.add(jsonObject); }); } - for (int i = 0;i<5;i++){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("name",i); - jsonObject.put("value",i); - jsonObjectList.add(jsonObject); - } String s = JSONArray.toJSONString(jsonObjectList); return s; } diff --git a/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumOeeStatistics.java b/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumOeeStatistics.java index 29913d1..ce69521 100644 --- a/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumOeeStatistics.java +++ b/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumOeeStatistics.java @@ -20,10 +20,10 @@ import java.util.Date; @TableName("SCADA_LCB_DEVICEINFO_4") public class AluminumOeeStatistics implements Serializable { - @TableField("OEE") + @TableField(exist = false) public String xValue; - @TableField(exist = false) + @TableField("OEE") public String yValue; @TableField("CREATETIME") diff --git a/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDevicePrameterValue.java b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDevicePrameterValue.java index a34c97c..adcb44f 100644 --- a/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDevicePrameterValue.java +++ b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDevicePrameterValue.java @@ -31,12 +31,12 @@ public class TankShellDevicePrameterValue implements Serializable { @TableField("prameterValue") private String prameterValue; - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "HH:mm:ss") @TableField("createtime") private Date createTime; public String getCreateTime() { - return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTime); + return new SimpleDateFormat("HH:mm:ss").format(createTime); } public void setCreateTime(Date createTime) { diff --git a/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java b/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java index 53ae3ea..4536d29 100644 --- a/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java +++ b/productionboard/src/main/java/com/productionboard/mapper/TankShellDevicePrameterValueMapper.java @@ -14,7 +14,7 @@ import java.util.List; @Mapper public interface TankShellDevicePrameterValueMapper extends BaseMapper { - @Select("select t2.DEVICEID,t2.PRAMETERNAME, t2.VALUE as PRAMETERVALUE, t2.CREATETIME\n" + @Select("select t2.DEVICEID,t2.PRAMETERNAME, to_char(t2.VALUE,'fm9999990.00') as PRAMETERVALUE, t2.CREATETIME\n" + "from (select * from BASIC_SCADA_DEVICEPARAMETER@SCADA_DBLINK where Device_id = 'XKCX001' and PARAMETER_ID = '2') t1\n" + " left join SCADA_PRAMERTER_VALUE t2 on t1.PARAMETER_NAME = t2.PRAMETERNAME\n" + "where CREATETIME = (select max(CREATETIME) from SCADA_PRAMERTER_VALUE where DEVICEID = T2.DEVICEID)") diff --git a/productionboard/src/main/java/com/productionboard/service/IFoamBoxDeviceInfoService.java b/productionboard/src/main/java/com/productionboard/service/IFoamBoxDeviceInfoService.java index 317fe9c..9513d31 100644 --- a/productionboard/src/main/java/com/productionboard/service/IFoamBoxDeviceInfoService.java +++ b/productionboard/src/main/java/com/productionboard/service/IFoamBoxDeviceInfoService.java @@ -33,5 +33,5 @@ public interface IFoamBoxDeviceInfoService { * @param ids * @return java.lang.String */ - String getMouldTemperature(String ids); + String getMouldTemperature(String ids,int number); } diff --git a/productionboard/src/main/java/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl.java b/productionboard/src/main/java/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl.java index 70668ef..36ba09f 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl.java @@ -168,7 +168,7 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService { * @return java.lang.String */ @Override - public String getMouldTemperature(String ids) { + public String getMouldTemperature(String ids,int number) { List xValueList = new ArrayList<>(); List interiorList = new ArrayList<>(); @@ -180,8 +180,11 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService { case "0": List deviceId = new ArrayList(){ { - this.add("FPX003"); - this.add("FPX004"); + if(number == 0){ + this.add("FPX003"); + }else{ + this.add("FPX004"); + } } }; wrapper.in("DEVICEID", deviceId); @@ -189,8 +192,11 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService { case "1": List deviceId2 = new ArrayList(){ { - this.add("FPX001"); - this.add("FPX002"); + if(number == 0){ + this.add("FPX001"); + }else{ + this.add("FPX002"); + } } }; wrapper.in("DEVICEID", deviceId2); @@ -226,49 +232,6 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService { interiorList.add(interior.get(i).getPameterValue()); lateralList.add(interior.get(i).getPameterValue()); } - }else{ - xValueList.add("A区1#模具"); - xValueList.add("A区2#模具"); - xValueList.add("A区3#模具"); - xValueList.add("A区4#模具"); - xValueList.add("A区5#模具"); - xValueList.add("A区6#模具"); - - xValueList.add("B区1#模具"); - xValueList.add("B区2#模具"); - xValueList.add("B区3#模具"); - xValueList.add("B区4#模具"); - xValueList.add("B区5#模具"); - xValueList.add("B区6#模具"); - - interiorList.add("12"); - interiorList.add("12"); - interiorList.add("12"); - interiorList.add("12"); - interiorList.add("12"); - interiorList.add("12"); - - interiorList.add("11"); - interiorList.add("11"); - interiorList.add("11"); - interiorList.add("11"); - interiorList.add("11"); - interiorList.add("11"); - - lateralList.add("17"); - lateralList.add("17"); - lateralList.add("17"); - lateralList.add("17"); - lateralList.add("17"); - lateralList.add("17"); - - lateralList.add("9"); - lateralList.add("9"); - lateralList.add("9"); - lateralList.add("9"); - lateralList.add("9"); - lateralList.add("9"); - } JSONObject jsonObject = new JSONObject(); diff --git a/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java b/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java index e3f3c74..9a4d3d0 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java @@ -153,7 +153,7 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi String[] xValueArray = new String[tankShellEnergyConsumptions.size()]; for (int i = 0;i< tankShellEnergyConsumptions.size();i++){ - productionArray[i] = tankShellEnergyConsumptions.get(i).getEnergy(); + productionArray[i] = tankShellEnergyConsumptions.get(i).getProduction(); energyArray[i] = tankShellEnergyConsumptions.get(i).getEnergy(); xValueArray[i] = dateFormat.format(tankShellEnergyConsumptions.get(i).getCreateTime()); } diff --git a/productionboard/src/main/resources/static/js/aluminumLiner/index.js b/productionboard/src/main/resources/static/js/aluminumLiner/index.js index b83f33a..d288941 100644 --- a/productionboard/src/main/resources/static/js/aluminumLiner/index.js +++ b/productionboard/src/main/resources/static/js/aluminumLiner/index.js @@ -4,7 +4,7 @@ $(() => { $.getJSON('/aluminumLiner/getDataInformation', function (result) { const statusArray = [1, 0, 0, 0, 0]; if (result.length > 0) { - statusArray[0] = result[0].deviceStatus == "正常" ? 1 : 0; + statusArray[0] = result[0].deviceStatus; statusArray[1] = result[0].devicePower; statusArray[2] = result[0].deviceEnergy; } diff --git a/productionboard/src/main/resources/static/js/foamBox/index.js b/productionboard/src/main/resources/static/js/foamBox/index.js index 67f1063..dfc44ac 100644 --- a/productionboard/src/main/resources/static/js/foamBox/index.js +++ b/productionboard/src/main/resources/static/js/foamBox/index.js @@ -43,7 +43,7 @@ $(() => { top: '10%', left: '6%', right: '6%', - bottom: '0', + bottom: '10%', containLabel: true }, tooltip: { @@ -110,7 +110,7 @@ $(() => { $.getJSON(`/foamBox/getMouldTemperature?ids=${ids}`, function (result) { temperature(result, document.getElementById("temperatureOne")); }); - $.getJSON(`/foamBox/getMouldTemperature?ids=${ids}`, function (result) { + $.getJSON(`/foamBox/getMouldTemperature2?ids=${ids}`, function (result) { temperature(result, document.getElementById("temperatureTwo")); }); @@ -120,12 +120,12 @@ $(() => { const deviceStatus = (statusArray) => { let info = ` - - - - - - + + + + + +
`; diff --git a/productionboard/src/main/resources/static/js/tankShell/device.js b/productionboard/src/main/resources/static/js/tankShell/device.js index f526865..13bba99 100644 --- a/productionboard/src/main/resources/static/js/tankShell/device.js +++ b/productionboard/src/main/resources/static/js/tankShell/device.js @@ -24,7 +24,7 @@ $(() => { }); const tableRes = {} - //生产计划 + //设备信息 const getTable = () => { $.ajax({ url: '/tankShellDevice/getDeviceParameterValue', @@ -35,8 +35,8 @@ $(() => { console.log(res.length +'+'+ tableRes.data?.length); $('#productionPlan').remove() $('.scrollTable').html('
') - tableRes.data = res.map(val => [val.deviceId, val.prameterName, val.prameterValue, val.createTime,]) - tableRes.header = ['设备名称', '参数名称', '当前值', '时间',] + tableRes.data = res.map(val => [val.prameterName, val.prameterValue, val.createTime,]) + tableRes.header = ['参数名称', '当前值', '时间',] dynamicTable({ el: '#productionPlan', rowNum: 5, @@ -49,7 +49,7 @@ $(() => { headerBGC: 'rgba(8,36,75,0.2)', oddRowBGC: 'rgba(8,36,75,0.2)', evenRowBGC: 'rgba(6,25,57,0.2)', - colWidth: ['100%', '100%', '40%', '160%',] + colWidth: ['250%', '50%', '50%',] }); }, error: function (e) {