diff --git a/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java b/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java index 5c675c4..0aebfc8 100644 --- a/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java +++ b/productionboard/src/main/java/com/productionboard/controller/AluminumLinerkController.java @@ -58,10 +58,10 @@ public class AluminumLinerkController { * @date 2022-06-08 15:53 * @return java.lang.String */ - @GetMapping("/getEnergyProductStatistics") + @GetMapping("/getRunParameters") @ResponseBody - public String getEnergyProductStatistics(){ - return aluminumDeviceInfoService.getEnergyProductJson(); + public String getRunParameters(){ + return aluminumDeviceInfoService.getRunParameters(); } /** 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 bdf580b..4b9df84 100644 --- a/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumDeviceDataInformation.java +++ b/productionboard/src/main/java/com/productionboard/entity/AluminumDevice/AluminumDeviceDataInformation.java @@ -14,6 +14,7 @@ import java.util.Date; * @author WenJY * @date 2022年06月06日 16:06 */ +@Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("SCADA_LCB_DEVICEINFO_1") @@ -39,6 +40,14 @@ public class AluminumDeviceDataInformation implements Serializable { @TableField("RUNTIME") private String runTime; + /** 停机时长 */ + @TableField("STOPTIME") + private String stopTime; + + /** 设备oee */ + @TableField("OEE") + private String deviceOee; + /** 设备功率 */ @TableField("DEVICEPOWER") private String devicePower; @@ -50,68 +59,4 @@ public class AluminumDeviceDataInformation implements Serializable { /** 采集时间 */ @TableField("COLLECTTIME") private Date collectTime; - - public String getDeviceId() { - return deviceId; - } - - public void setDeviceId(String deviceId) { - this.deviceId = deviceId; - } - - public String getDeviceStatus() { - return deviceStatus; - } - - public void setDeviceStatus(String deviceStatus) { - this.deviceStatus = deviceStatus; - } - - public String getDeviceTakt() { - return deviceTakt; - } - - public void setDeviceTakt(String deviceTakt) { - this.deviceTakt = deviceTakt; - } - - public String getOpenTime() { - return openTime; - } - - public void setOpenTime(String openTime) { - this.openTime = openTime; - } - - public String getRunTime() { - return runTime; - } - - public void setRunTime(String runTime) { - this.runTime = runTime; - } - - public String getDevicePower() { - return devicePower; - } - - public void setDevicePower(String devicePower) { - this.devicePower = devicePower; - } - - public String getDeviceEnergy() { - return deviceEnergy; - } - - public void setDeviceEnergy(String deviceEnergy) { - this.deviceEnergy = deviceEnergy; - } - - public Date getCollectTime() { - return collectTime; - } - - public void setCollectTime(Date collectTime) { - this.collectTime = collectTime; - } } diff --git a/productionboard/src/main/java/com/productionboard/service/IAluminumDeviceInfoService.java b/productionboard/src/main/java/com/productionboard/service/IAluminumDeviceInfoService.java index 37fd8f3..37dbc14 100644 --- a/productionboard/src/main/java/com/productionboard/service/IAluminumDeviceInfoService.java +++ b/productionboard/src/main/java/com/productionboard/service/IAluminumDeviceInfoService.java @@ -20,12 +20,12 @@ public interface IAluminumDeviceInfoService { public List getDataInformationList(); /** - * 获取能耗产量数据 + * 获取运行参数,整合产量能耗、运行参数、loss、标准节拍参数 * @author WenJY * @date 2022-06-08 15:53 * @return java.lang.String */ - public String getEnergyProductJson(); + public String getRunParameters(); /** * 获取Loss统计数据 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 28210c7..31e287b 100644 --- a/productionboard/src/main/java/com/productionboard/service/impl/AluminumDeviceInfoServiceImpl.java +++ b/productionboard/src/main/java/com/productionboard/service/impl/AluminumDeviceInfoServiceImpl.java @@ -45,14 +45,14 @@ public class AluminumDeviceInfoServiceImpl implements IAluminumDeviceInfoService } /** - * 获取能耗产量数据 + * 获取运行参数,整合产量能耗、运行参数、loss、标准节拍参数 * @author WenJY * @date 2022-06-08 15:53 * @return java.lang.String */ @Override - public String getEnergyProductJson() { - String[] result = new String[4]; + public String getRunParameters() { + String[] result = new String[10]; try{ List aluminumThisMonthEnergies = aluminumThisMonthEnergyMapper.selectList(null); List aluminumYesterdayEnergies = aluminumYesterdayEnergyMapper.selectList(null); @@ -62,12 +62,20 @@ public class AluminumDeviceInfoServiceImpl implements IAluminumDeviceInfoService result[2] = aluminumThisMonthEnergies.size() > 0 ? aluminumThisMonthEnergies.get(0).getProduction():"0"; result[3] = aluminumThisMonthEnergies.size() > 0 ? aluminumThisMonthEnergies.get(0).getEnergy():"0"; + List aluminumDeviceDataInformations = dataInformationMapper.selectList(null); + if(aluminumDeviceDataInformations.size() > 0){ + AluminumDeviceDataInformation aluminumDeviceDataInformation = aluminumDeviceDataInformations.get(0); + result[4] = aluminumDeviceDataInformation.getRunTime(); + result[5] = aluminumDeviceDataInformation.getStopTime(); + result[6] = aluminumDeviceDataInformation.getDeviceOee(); + result[7] = "0"; + result[8] = aluminumDeviceDataInformation.getRunTime(); + result[9] = aluminumDeviceDataInformation.getDeviceTakt(); + } + }catch (Exception e){ - System.out.println("getEnergyProduct方法异常"); + System.out.println("getEnergyProduct方法异常:"+e.getMessage()); result[0] = "-"; - result[1] = "-"; - result[2] = "-"; - result[3] = "-"; } return JSONArray.toJSONString(result);