diff --git a/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java b/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java index fa5661c..a0d2157 100644 --- a/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java +++ b/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java @@ -55,13 +55,26 @@ public class AluminumLinerkController { @ResponseBody public String getDataInformation(){ List dataInformationList = aluminumDeviceInfoService.getDataInformationList(); - if(dataInformationList.size() > 0 && dataInformationList.get(0) == null){ + if(dataInformationList.get(0) == null){ dataInformationList.remove(0); AluminumDeviceDataInformation aluminumDeviceDataInformation = new AluminumDeviceDataInformation(); aluminumDeviceDataInformation.setDeviceStatus("0"); aluminumDeviceDataInformation.setDevicePower("0"); aluminumDeviceDataInformation.setDeviceEnergy("0"); + aluminumDeviceDataInformation.setCount(0); dataInformationList.add(aluminumDeviceDataInformation); + }else{ + for(AluminumDeviceDataInformation item : dataInformationList){ + if(item.getDeviceStatus() == null){ + item.setDeviceStatus("0"); + } + if(item.getDevicePower() == null){ + item.setDevicePower("0"); + } + if(item.getDeviceEnergy() == null){ + item.setDeviceEnergy("0"); + } + } } String s = JSONArray.toJSONString(dataInformationList); return s; diff --git a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java index 5750831..83910ee 100644 --- a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java +++ b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java @@ -185,57 +185,4 @@ public class FoamBoxController { 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/java/com/productionboard/entity/AluminumDevice/AluminumDeviceDataInformation.java b/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumDeviceDataInformation.java index 7808f35..6a23de1 100644 --- a/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumDeviceDataInformation.java +++ b/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumDeviceDataInformation.java @@ -66,4 +66,10 @@ public class AluminumDeviceDataInformation implements Serializable { /** 采集时间 */ @TableField("COLLECTTIME") private Date collectTime; + + @TableField("count") + private int count; + + @TableField("lossTime") + private String lossTime; } diff --git a/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDeviceDataInformation.java b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDeviceDataInformation.java index 9e79c75..af55211 100644 --- a/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDeviceDataInformation.java +++ b/productionboard/src/main/java/com/productionboard/entity/TankShellDevice/TankShellDeviceDataInformation.java @@ -59,4 +59,10 @@ public class TankShellDeviceDataInformation implements Serializable { @TableField("COLLECTTIME") private Date collectTime; + @TableField("COUNT") + private int alarmCount; + + @TableField("lossTime") + private String lossTime; + } diff --git a/productionboard/src/main/java/com/productionboard/mapper/TankShellDeviceDataInformationMapper.java b/productionboard/src/main/java/com/productionboard/mapper/TankShellDeviceDataInformationMapper.java index 8d8738f..4d28d6e 100644 --- a/productionboard/src/main/java/com/productionboard/mapper/TankShellDeviceDataInformationMapper.java +++ b/productionboard/src/main/java/com/productionboard/mapper/TankShellDeviceDataInformationMapper.java @@ -20,7 +20,7 @@ public interface TankShellDeviceDataInformationMapper extends BaseMapper getTankShellDeviceDataInformations(@Param("in_id") Integer in_id); /** diff --git a/productionboard/src/main/java/com/productionboard/service/impl/AluminumDeviceInfoServiceImpl.java b/productionboard/src/main/java/com/productionboard/service/impl/AluminumDeviceInfoServiceImpl.java index 0be9e43..89f875c 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/AluminumDeviceInfoServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/AluminumDeviceInfoServiceImpl.java @@ -74,8 +74,8 @@ public class AluminumDeviceInfoServiceImpl implements IAluminumDeviceInfoService result[4] = aluminumDeviceDataInformation.getRunTime(); result[5] = aluminumDeviceDataInformation.getStopTime(); result[6] = aluminumDeviceDataInformation.getDeviceOee(); - result[7] = "0"; - result[8] = aluminumDeviceDataInformation.getRunTime(); + result[7] = aluminumDeviceDataInformation.getCount()+""; + result[8] = aluminumDeviceDataInformation.getLossTime(); result[9] = aluminumDeviceDataInformation.getDeviceTakt(); }else{ result[4] = "0"; 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 9df923f..b425bdb 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl.java @@ -20,6 +20,7 @@ import org.springframework.stereotype.Service; import java.lang.reflect.Array; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -42,6 +43,8 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService { private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss"); + private SimpleDateFormat minimumDateFormat = new SimpleDateFormat("HH"); + @Value("${in_id}") private int in_id; @@ -124,7 +127,6 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService { break; } -// List foamBoxParamTemperatures = foamBoxParamTemperatureMapper.selectList(wrapper); String DEVICEID = "HF202009858"; if ("1".equals(ids)){ DEVICEID = "HF202009857"; @@ -158,11 +160,11 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService { String[] polArray1 = new String[15]; String[] polArray2 = new String[15]; for (int i = 0;i<15;i++){ - xAxisArray[i] = 0+i+""; - isoArray1[i] = 1+i+""; - isoArray2[i] = 2+i+""; - polArray1[i] = 1+i+""; - polArray2[i] = 2+i+""; + xAxisArray[i] = minimumDateFormat.format(new Date())+":"+i; + isoArray1[i] = "23"; + isoArray2[i] = "21"; + polArray1[i] = "22"; + polArray2[i] = "23"; } result.put("xAxisArray",xAxisArray); result.put("isoArray1",isoArray1); diff --git a/productionboard/src/main/java/com/productionboard/service/impl/MesProductionDataServiceImpl.java b/productionboard/src/main/java/com/productionboard/service/impl/MesProductionDataServiceImpl.java index 22648bb..cff6b30 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/MesProductionDataServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/MesProductionDataServiceImpl.java @@ -221,7 +221,12 @@ public class MesProductionDataServiceImpl implements IMesProductionDataService { planInfo.setCha((oq -aq)+""); //map.put("17",String.format("%.1f%%", ((double)actualQtuitem / (double)planQtyItem * 100))); - planInfo.setRound(String.format("%.1f%%", ((double)aq / (double)oq * 100))); + if(oq == 0){ + planInfo.setRound("0.00%"); + }else { + planInfo.setRound(String.format("%.1f%%", ((double)aq / (double)oq * 100))); + } + } return aluminumLinerMesPlan; } 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 f8d1f83..2034f5e 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.productionboard.entity.AluminumDevice.AluminumDeviceDataInformation; import com.productionboard.entity.TankShellDevice.*; import com.productionboard.mapper.*; import com.productionboard.service.ITankShellDeviceInfoService; @@ -57,15 +58,43 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi // List tankShellDeviceDataInformations = tankShellDeviceDataInformationMapper.selectList(null); List tankShellDeviceDataInformations = tankShellDeviceDataInformationMapper.getTankShellDeviceDataInformations(in_id); - if(tankShellDeviceDataInformations.size() > 0 && tankShellDeviceDataInformations.get(0) == null){ - tankShellDeviceDataInformations.remove(0); + if(tankShellDeviceDataInformations == null || tankShellDeviceDataInformations.size() ==0){ TankShellDeviceDataInformation tankShellDeviceDataInformation = new TankShellDeviceDataInformation(); tankShellDeviceDataInformation.setDeviceStatus("0"); tankShellDeviceDataInformation.setDevicePower("0"); tankShellDeviceDataInformation.setDeviceEnergy("0"); + tankShellDeviceDataInformation.setAlarmCount(0); tankShellDeviceDataInformations.add(tankShellDeviceDataInformation); + }else{ + if(tankShellDeviceDataInformations.get(0) == null){ + TankShellDeviceDataInformation tankShellDeviceDataInformation = new TankShellDeviceDataInformation(); + tankShellDeviceDataInformation.setDeviceStatus("0"); + tankShellDeviceDataInformation.setDevicePower("0"); + tankShellDeviceDataInformation.setDeviceEnergy("0"); + tankShellDeviceDataInformation.setAlarmCount(0); + tankShellDeviceDataInformations.add(tankShellDeviceDataInformation); + }else{ + for(TankShellDeviceDataInformation item : tankShellDeviceDataInformations){ + if(item.getDeviceStatus().equals("正常")){ + item.setDeviceStatus("1"); + }else { + item.setDeviceStatus("0"); + } + if(item.getDeviceStatus() == null){ + item.setDeviceStatus("0"); + } + if(item.getDevicePower() == null){ + item.setDevicePower("0"); + } + if(item.getDeviceEnergy() == null){ + item.setDeviceEnergy("0"); + } + } + } } + + return JSONArray.toJSONString(tankShellDeviceDataInformations); } @@ -99,9 +128,10 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi result[4] = tankShellDeviceDataInformation.getRunTime(); result[5] = tankShellDeviceDataInformation.getStopTime(); result[6] = tankShellDeviceDataInformation.getDeviceOee(); - result[7] = "0"; - result[8] = tankShellDeviceDataInformation.getStopTime(); + result[7] = tankShellDeviceDataInformation.getAlarmCount()+""; + result[8] = tankShellDeviceDataInformation.getLossTime(); result[9] = tankShellDeviceDataInformation.getDeviceTakt(); + }else { result[4] = "0"; result[5] = "0"; @@ -111,13 +141,29 @@ public class TankShellDeviceInfoServiceImpl implements ITankShellDeviceInfoServi result[9] = "0"; } + }else { + result[4] = "0"; + result[5] = "0"; + result[6] = "0"; + result[7] = "0"; + result[8] = "0"; + result[9] = "0"; } + for (int i = 0; i < result.length; i++) { + // + if(result[i] == null){ + result[i] = "0"; + } + } + + }catch (Exception e){ System.out.println("箱壳设备看板getRunParameters方法异常:"+e.getMessage()); result[0] = "-"; } + return JSONArray.toJSONString(result); } diff --git a/productionboard/src/main/resources/static/js/aluminumLiner/index.js b/productionboard/src/main/resources/static/js/aluminumLiner/index.js index ff02b37..2ee8c56 100644 --- a/productionboard/src/main/resources/static/js/aluminumLiner/index.js +++ b/productionboard/src/main/resources/static/js/aluminumLiner/index.js @@ -5,9 +5,10 @@ $(() => { $.getJSON('/aluminumLiner/getDataInformation', function (result) { const statusArray = [1, 0, 0, 0, 0]; if (result.length > 0) { - statusArray[0] = result[0].deviceStatus; - statusArray[1] = result[0].devicePower; - statusArray[2] = result[0].deviceEnergy; + statusArray[0] = result[0].deviceStatus == "正常" ? "1" : "0"; + statusArray[1] = test(result[0].devicePower,100); + statusArray[2] = test(result[0].deviceEnergy,1000); + //statusArray[3] = result[0].count; } dataInformationFunction(statusArray); }); @@ -77,4 +78,9 @@ $(() => { } fun2() tableAnimation('#productionPlan') -}) \ No newline at end of file +}) + +const test = (number,flag) =>{ + var info = Math.floor(number / flag); + return info.toFixed(2); +} \ No newline at end of file diff --git a/productionboard/src/main/resources/static/js/tankShell/device.js b/productionboard/src/main/resources/static/js/tankShell/device.js index f177a17..cc159da 100644 --- a/productionboard/src/main/resources/static/js/tankShell/device.js +++ b/productionboard/src/main/resources/static/js/tankShell/device.js @@ -32,9 +32,6 @@ $(() => { $("#meterParam").text(result[9]); }); - $.getJSON('/tankShellDevice/getRunParameters', function (result) { - runParamStatisticsFunction(result) - }); return setTimeout(fun,10000) } fun() @@ -86,16 +83,22 @@ const dataInformationFunction = (statusArray) => { let info = ` - + - +
${res.deviceStatus == 1 ? `正常` : `异常`} ${res.devicePower}kW ${test(res.devicePower,1000)} kW
${res.deviceEnergy}kW·h ${test(res.deviceEnergy,100)}kW·h 0
`; $("#dataInformation").html(info); + +} + +const test = (number,flag) =>{ + var info = Math.floor(number / flag); + return info.toFixed(2); } /*能耗产量统计*/ @@ -113,6 +116,7 @@ const energyProductionStatisticsFunction = (statusArray) => { } const runParamStatisticsFunction = (statusArray) => { + console.log(statusArray) let info = `
${statusArray[4]}
${statusArray[5]}
diff --git a/productionboard/target/classes/com/productionboard/controller/AluminumLinerkController.class b/productionboard/target/classes/com/productionboard/controller/AluminumLinerkController.class index b45c2b6..d521e15 100644 Binary files a/productionboard/target/classes/com/productionboard/controller/AluminumLinerkController.class and b/productionboard/target/classes/com/productionboard/controller/AluminumLinerkController.class differ diff --git a/productionboard/target/classes/com/productionboard/controller/FoamBoxController.class b/productionboard/target/classes/com/productionboard/controller/FoamBoxController.class index d02c0a2..575180e 100644 Binary files a/productionboard/target/classes/com/productionboard/controller/FoamBoxController.class and b/productionboard/target/classes/com/productionboard/controller/FoamBoxController.class differ diff --git a/productionboard/target/classes/com/productionboard/controller/PreassembleController.class b/productionboard/target/classes/com/productionboard/controller/PreassembleController.class index f8a09d9..890e7bc 100644 Binary files a/productionboard/target/classes/com/productionboard/controller/PreassembleController.class and b/productionboard/target/classes/com/productionboard/controller/PreassembleController.class differ diff --git a/productionboard/target/classes/com/productionboard/entity/AluminumDevice/AluminumDeviceDataInformation.class b/productionboard/target/classes/com/productionboard/entity/AluminumDevice/AluminumDeviceDataInformation.class index a9a06ba..7eab790 100644 Binary files a/productionboard/target/classes/com/productionboard/entity/AluminumDevice/AluminumDeviceDataInformation.class and b/productionboard/target/classes/com/productionboard/entity/AluminumDevice/AluminumDeviceDataInformation.class differ diff --git a/productionboard/target/classes/com/productionboard/entity/TankShellDevice/TankShellDeviceDataInformation.class b/productionboard/target/classes/com/productionboard/entity/TankShellDevice/TankShellDeviceDataInformation.class index eac9780..e2c1358 100644 Binary files a/productionboard/target/classes/com/productionboard/entity/TankShellDevice/TankShellDeviceDataInformation.class and b/productionboard/target/classes/com/productionboard/entity/TankShellDevice/TankShellDeviceDataInformation.class differ diff --git a/productionboard/target/classes/com/productionboard/mapper/TankShellDeviceDataInformationMapper.class b/productionboard/target/classes/com/productionboard/mapper/TankShellDeviceDataInformationMapper.class index 66bb26a..2ac69e2 100644 Binary files a/productionboard/target/classes/com/productionboard/mapper/TankShellDeviceDataInformationMapper.class and b/productionboard/target/classes/com/productionboard/mapper/TankShellDeviceDataInformationMapper.class differ diff --git a/productionboard/target/classes/com/productionboard/service/impl/AluminumDeviceInfoServiceImpl.class b/productionboard/target/classes/com/productionboard/service/impl/AluminumDeviceInfoServiceImpl.class index 60fd12d..33ada1a 100644 Binary files a/productionboard/target/classes/com/productionboard/service/impl/AluminumDeviceInfoServiceImpl.class and b/productionboard/target/classes/com/productionboard/service/impl/AluminumDeviceInfoServiceImpl.class differ diff --git a/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl$1.class b/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl$1.class index 5ecce21..aaeb451 100644 Binary files a/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl$1.class and b/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl$1.class differ diff --git a/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl$2.class b/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl$2.class index 30b5495..cac3c11 100644 Binary files a/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl$2.class and b/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl$2.class differ diff --git a/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl.class b/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl.class index 4dc9519..bffb61b 100644 Binary files a/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl.class and b/productionboard/target/classes/com/productionboard/service/impl/FoamBoxDeviceInfoServiceImpl.class differ diff --git a/productionboard/target/classes/com/productionboard/service/impl/MesProductionDataServiceImpl.class b/productionboard/target/classes/com/productionboard/service/impl/MesProductionDataServiceImpl.class index 52c4ede..adb7ff8 100644 Binary files a/productionboard/target/classes/com/productionboard/service/impl/MesProductionDataServiceImpl.class and b/productionboard/target/classes/com/productionboard/service/impl/MesProductionDataServiceImpl.class differ diff --git a/productionboard/target/classes/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.class b/productionboard/target/classes/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.class index f20fea2..5e3c188 100644 Binary files a/productionboard/target/classes/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.class and b/productionboard/target/classes/com/productionboard/service/impl/TankShellDeviceInfoServiceImpl.class differ diff --git a/productionboard/target/classes/static/js/adsorptionTank/index.js b/productionboard/target/classes/static/js/adsorptionTank/index.js index 7a2584d..ee9ec01 100644 --- a/productionboard/target/classes/static/js/adsorptionTank/index.js +++ b/productionboard/target/classes/static/js/adsorptionTank/index.js @@ -1,25 +1,28 @@ $(() => { - // onDutyPlan(1234,1202,33); - $.getJSON('/adsorptionTank/getTeamStatisticsJson', function (result) { - // alert(result.actualAmount+"\t"+ result.differenceAmount) - storageStatistics(result.className, result.planAmount, result.actualAmount, result.differenceAmount,) - }); + let fun = () => { + $.getJSON('/adsorptionTank/getTeamStatisticsJson', function (result) { + // alert(result.actualAmount+"\t"+ result.differenceAmount) + storageStatistics(result.className, result.planAmount, result.actualAmount, result.differenceAmount,) + }); - //按型号统计产量 - $.getJSON('/adsorptionTank/getMaterialProdutionJson', function (result) { - horizontalBarChart(result, document.getElementById("statisticalOutputByModel")); - }); + //按型号统计产量 + $.getJSON('/adsorptionTank/getMaterialProdutionJson', function (result) { + horizontalBarChart(result, document.getElementById("statisticalOutputByModel")); + }); - //小时产量 - $.getJSON('/adsorptionTank/getHourProdutionJson', function (result) { - brokenLineAreaDiagram(result, document.getElementById("hourlyOutputStatistics")); - }); + //小时产量 + $.getJSON('/adsorptionTank/getHourProdutionJson', function (result) { + brokenLineAreaDiagram(result, document.getElementById("hourlyOutputStatistics")); + }); - //库存统计 - $.getJSON('/adsorptionTank/getMaterialStoreJson', function (result) { - threeDimensionalCylindrical(result, document.getElementById("inventoryStatistics")); - }); + //库存统计 + $.getJSON('/adsorptionTank/getMaterialStoreJson', function (result) { + threeDimensionalCylindrical(result, document.getElementById("inventoryStatistics")); + }); + setTimeout(fun, 10000) + } + fun() }) diff --git a/productionboard/target/classes/static/js/aluminumLiner/index.js b/productionboard/target/classes/static/js/aluminumLiner/index.js index ff02b37..2ee8c56 100644 --- a/productionboard/target/classes/static/js/aluminumLiner/index.js +++ b/productionboard/target/classes/static/js/aluminumLiner/index.js @@ -5,9 +5,10 @@ $(() => { $.getJSON('/aluminumLiner/getDataInformation', function (result) { const statusArray = [1, 0, 0, 0, 0]; if (result.length > 0) { - statusArray[0] = result[0].deviceStatus; - statusArray[1] = result[0].devicePower; - statusArray[2] = result[0].deviceEnergy; + statusArray[0] = result[0].deviceStatus == "正常" ? "1" : "0"; + statusArray[1] = test(result[0].devicePower,100); + statusArray[2] = test(result[0].deviceEnergy,1000); + //statusArray[3] = result[0].count; } dataInformationFunction(statusArray); }); @@ -77,4 +78,9 @@ $(() => { } fun2() tableAnimation('#productionPlan') -}) \ No newline at end of file +}) + +const test = (number,flag) =>{ + var info = Math.floor(number / flag); + return info.toFixed(2); +} \ No newline at end of file diff --git a/productionboard/target/classes/static/js/common/echarts.common.js b/productionboard/target/classes/static/js/common/echarts.common.js index 08e24c3..b214ccc 100644 --- a/productionboard/target/classes/static/js/common/echarts.common.js +++ b/productionboard/target/classes/static/js/common/echarts.common.js @@ -1226,7 +1226,7 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => { color: "#fff", fontSize: fontSize, }, - data: ["箱壳库", "内胆库"], + data: ["内胆库", "箱壳库"], }, xAxis: [ { diff --git a/productionboard/target/classes/static/js/common/ondutyplan.js b/productionboard/target/classes/static/js/common/ondutyplan.js index 3ddb2cc..2dc8164 100644 --- a/productionboard/target/classes/static/js/common/ondutyplan.js +++ b/productionboard/target/classes/static/js/common/ondutyplan.js @@ -42,9 +42,9 @@ let onDutyPlan = (scheduledProductionNumber, actualOutPutNumber, differenceValue differenceValue.push(`#differenceValue :nth-child(${i})`); } - updateSplitBlocks(scheduledProductionNumber, scheduledProduction); - updateSplitBlocks(actualOutPutNumber, actualOutPut); - updateSplitBlocks(differenceValueNumber, differenceValue); + updateSplitBlocks(scheduledProductionNumber || 0, scheduledProduction); + updateSplitBlocks(actualOutPutNumber || 0, actualOutPut); + updateSplitBlocks(differenceValueNumber || 0, differenceValue); } let storageStatistics = (leftInStoreNumber, leftOutStoreNumber, rightInStoreNumber, rightOutStoreNumber) => { diff --git a/productionboard/target/classes/static/js/storage/index.js b/productionboard/target/classes/static/js/storage/index.js index 1ea15cb..41e9952 100644 --- a/productionboard/target/classes/static/js/storage/index.js +++ b/productionboard/target/classes/static/js/storage/index.js @@ -33,48 +33,63 @@ $(() => { let fun = () => { //当前库存统计 - $.getJSON(`/storage/getStoreStatistics?ids=${ids}`, function (result) { - multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory"), 2); - }); + // $.getJSON(`/storage/getStoreStatistics?ids=${ids}`, function (result) { + // multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory"), 2); + // }); //库位参数 $.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) { - //单日出入库统计 - storageStatistics(result[0] == null ? 0 : result[0], result[1] == null ? 0 : result[1], result[2] == null ? 0 : result[2], result[3] == null ? 0 : result[3]); - //当前库存统计 - $.getJSON('/tankShell/getMaterialStoreJson', function (result) { - multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory")); - }); + //单日出入库统计 + storageStatistics(result[0] == null ? 0 : result[0], result[1] == null ? 0 : result[1], result[2] == null ? 0 : result[2], result[3] == null ? 0 : result[3]); - //库位参数 - $.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) { + }) + //当前库存统计 + $.getJSON('/tankShell/getMaterialStoreJson', function (result) { + multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory")); + }); - console.log(result); + //库位参数 + $.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) { - //单日出入库统计 - storageStatistics(result.inStoreLeftCount, result.outStoreLeftCount, result.inStoreRightCount, result.outStoreRightCount); + console.log(result); - //库存统计 - $("#emptyLocation-left").text(result.freeStoreLeftCount); - $("#haveUsedLocation-left").text(result.useStoreLeftCount); - $("#emptyLocation-right").text(result.freeStoreRightCount); - $("#haveUsedLocation-right").text(result.useStoreRightCount); + //单日出入库统计 + storageStatistics(result.inStoreLeftCount, result.outStoreLeftCount, result.inStoreRightCount, result.outStoreRightCount); - //库位占比 - $("#emptyLocationNumber").text(result.freeStoreCount); - $("#emptyLocationRatio").text(GetPercent(result.freeStoreCount, 312)); - $("#haveUsedLocationNumber").text(result.useStoreCount); - $("#haveUsedLocationRatio").text(GetPercent(result.useStoreCount, 312)); - }); + //库存统计 + // $("#emptyLocation-left").text(result[4] == null ? 0 : result[4]); + // $("#haveUsedLocation-left").text(result[6] == null ? 0 : result[5]); + // $("#emptyLocation-right").text(result[5] == null ? 0 : result[6]); + // $("#haveUsedLocation-right").text(result[7] == null ? 0 : result[7]); + //库存统计 + $("#emptyLocation-left").text(result.freeStoreLeftCount); + $("#haveUsedLocation-left").text(result.useStoreLeftCount); + $("#emptyLocation-right").text(result.freeStoreRightCount); + $("#haveUsedLocation-right").text(result.useStoreRightCount); - //百分比 - function GetPercent(num, total) { - num = parseFloat(num); - total = parseFloat(total); - if (isNaN(num) || isNaN(total)) { - return "-"; - } - return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00) + "%"; - } + //库位占比 + // $("#emptyLocationNumber").text(result[8] == null ? 0 : result[8]); + // $("#emptyLocationRatio").text(result[9] == null ? 0 : result[9]); + // $("#haveUsedLocationNumber").text(result[10] == null ? 0 : result[10]); + // $("#haveUsedLocationRatio").text(result[11] == null ? 0 : result[11]); + //库位占比 + $("#emptyLocationNumber").text(result.freeStoreCount); + $("#emptyLocationRatio").text(GetPercent(result.freeStoreCount, 312)); + $("#haveUsedLocationNumber").text(result.useStoreCount); + $("#haveUsedLocationRatio").text(GetPercent(result.useStoreCount, 312)); +//百分比 + function GetPercent(num, total) { + num = parseFloat(num); + total = parseFloat(total); + if (isNaN(num) || isNaN(total)) { + return "-"; + } + return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00) + "%"; } - ) \ No newline at end of file + }); + setTimeout(fun, 10000) + } + fun() + + +}) \ No newline at end of file diff --git a/productionboard/target/classes/static/js/tankShell/device.js b/productionboard/target/classes/static/js/tankShell/device.js index 979066f..cc159da 100644 --- a/productionboard/target/classes/static/js/tankShell/device.js +++ b/productionboard/target/classes/static/js/tankShell/device.js @@ -1,27 +1,40 @@ $(() => { + let fun = () => { + //设备OEE统计 + $.getJSON('/tankShellDevice/getOeeStatistics', function (result) { + OEEStatistics(result, document.getElementById("OEEStatistics")); + }); - //设备OEE统计 - $.getJSON('/tankShellDevice/getOeeStatistics', function (result) { - OEEStatistics(result, document.getElementById("OEEStatistics")); - }); - setInterval(() => { - // OEEStatistics(result, document.getElementById("OEEStatistics")); - }, 1000); + //设备故障排名 + $.getJSON('/tankShellDevice/getStatisticalOutputByModel', function (result) { + equipmentFailure(result, document.getElementById("equipmentFailure")); + }); - //设备故障排名 - $.getJSON('/tankShellDevice/getStatisticalOutputByModel', function (result) { - equipmentFailure(result, document.getElementById("equipmentFailure")); - }); + //loss + $.getJSON('/tankShellDevice/getLossStatistics', function (result) { + loss(result, document.getElementById("loss")); + }); - //loss - $.getJSON('/tankShellDevice/getLossStatistics', function (result) { - loss(result, document.getElementById("loss")); - }); + //设备产量能耗对比 + $.getJSON('/tankShellDevice/getEnergyConsumption', function (result) { + energyConsumption(result, document.getElementById("energyConsumption")); + }); - //设备产量能耗对比 - $.getJSON('/tankShellDevice/getEnergyConsumption', function (result) { - energyConsumption(result, document.getElementById("energyConsumption")); - }); + /*数据信息*/ + $.getJSON('/tankShellDevice/getDataInformation', function (result) { + dataInformationFunction(result) + }); + $.getJSON('/tankShellDevice/getRunParameters', function (result) { + console.log(result); + energyProductionStatisticsFunction(result) + runParamStatisticsFunction(result) + $("#lossParam").text(result[8]); + + $("#meterParam").text(result[9]); + }); + return setTimeout(fun,10000) + } + fun() const tableRes = {} //设备信息 @@ -61,21 +74,6 @@ $(() => { getTable() }, 10000); tableAnimation('#productionPlan') - /*数据信息*/ - $.getJSON('/tankShellDevice/getDataInformation', function (result) { - dataInformationFunction(result) - }); - $.getJSON('/tankShellDevice/getRunParameters', function (result) { - console.log(result); - energyProductionStatisticsFunction(result) - runParamStatisticsFunction(result) - $("#lossParam").text(result[8]); - - $("#meterParam").text(result[9]); - }); - $.getJSON('/tankShellDevice/getRunParameters', function (result) { - runParamStatisticsFunction(result) - }); }) /*数据信息*/ @@ -85,16 +83,22 @@ const dataInformationFunction = (statusArray) => { let info = ` - + - - + +
${res.deviceStatus == 1 ? `正常` : `异常`} ${res.devicePower}kW ${test(res.devicePower,1000)} kW
${res.deviceEnergy}kW·h2 ${test(res.deviceEnergy,100)}kW·h0
`; - $("#dataInformation").append(info); + $("#dataInformation").html(info); + +} + +const test = (number,flag) =>{ + var info = Math.floor(number / flag); + return info.toFixed(2); } /*能耗产量统计*/ @@ -108,10 +112,11 @@ const energyProductionStatisticsFunction = (statusArray) => { `; - $("#energyProductionStatistics").append(info); + $("#energyProductionStatistics").html(info); } const runParamStatisticsFunction = (statusArray) => { + console.log(statusArray) let info = `
${statusArray[4]}
${statusArray[5]}
diff --git a/productionboard/target/classes/static/js/tankShell/index.js b/productionboard/target/classes/static/js/tankShell/index.js index e795fce..ea1d8e3 100644 --- a/productionboard/target/classes/static/js/tankShell/index.js +++ b/productionboard/target/classes/static/js/tankShell/index.js @@ -18,7 +18,7 @@ $(() => { //库存统计 $.getJSON('/tankShell/getMaterialStoreJson', function (result) { - multipleThreeDimensionalCylindrical(result, document.getElementById("inventoryStatistics")); + multipleThreeDimensionalCylindrical(result, document.getElementById("inventoryStatistics"),); }); setTimeout(fun, 10000) }