change - 铝内胆运行参数接口整合,将运行参数、能耗产量、loss、标准节拍参数整合在一个接口

master
wenjy 3 years ago
parent c7a81e1426
commit 8691723387

@ -58,10 +58,10 @@ public class AluminumLinerkController {
* @date 2022-06-08 15:53 * @date 2022-06-08 15:53
* @return java.lang.String * @return java.lang.String
*/ */
@GetMapping("/getEnergyProductStatistics") @GetMapping("/getRunParameters")
@ResponseBody @ResponseBody
public String getEnergyProductStatistics(){ public String getRunParameters(){
return aluminumDeviceInfoService.getEnergyProductJson(); return aluminumDeviceInfoService.getRunParameters();
} }
/** /**

@ -14,6 +14,7 @@ import java.util.Date;
* @author WenJY * @author WenJY
* @date 20220606 16:06 * @date 20220606 16:06
*/ */
@Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("SCADA_LCB_DEVICEINFO_1") @TableName("SCADA_LCB_DEVICEINFO_1")
@ -39,6 +40,14 @@ public class AluminumDeviceDataInformation implements Serializable {
@TableField("RUNTIME") @TableField("RUNTIME")
private String runTime; private String runTime;
/** 停机时长 */
@TableField("STOPTIME")
private String stopTime;
/** 设备oee */
@TableField("OEE")
private String deviceOee;
/** 设备功率 */ /** 设备功率 */
@TableField("DEVICEPOWER") @TableField("DEVICEPOWER")
private String devicePower; private String devicePower;
@ -50,68 +59,4 @@ public class AluminumDeviceDataInformation implements Serializable {
/** 采集时间 */ /** 采集时间 */
@TableField("COLLECTTIME") @TableField("COLLECTTIME")
private Date 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;
}
} }

@ -20,12 +20,12 @@ public interface IAluminumDeviceInfoService {
public List<AluminumDeviceDataInformation> getDataInformationList(); public List<AluminumDeviceDataInformation> getDataInformationList();
/** /**
* * ,loss
* @author WenJY * @author WenJY
* @date 2022-06-08 15:53 * @date 2022-06-08 15:53
* @return java.lang.String * @return java.lang.String
*/ */
public String getEnergyProductJson(); public String getRunParameters();
/** /**
* Loss * Loss

@ -45,14 +45,14 @@ public class AluminumDeviceInfoServiceImpl implements IAluminumDeviceInfoService
} }
/** /**
* * ,loss
* @author WenJY * @author WenJY
* @date 2022-06-08 15:53 * @date 2022-06-08 15:53
* @return java.lang.String * @return java.lang.String
*/ */
@Override @Override
public String getEnergyProductJson() { public String getRunParameters() {
String[] result = new String[4]; String[] result = new String[10];
try{ try{
List<AluminumThisMonthEnergy> aluminumThisMonthEnergies = aluminumThisMonthEnergyMapper.selectList(null); List<AluminumThisMonthEnergy> aluminumThisMonthEnergies = aluminumThisMonthEnergyMapper.selectList(null);
List<AluminumYesterdayEnergy> aluminumYesterdayEnergies = aluminumYesterdayEnergyMapper.selectList(null); List<AluminumYesterdayEnergy> aluminumYesterdayEnergies = aluminumYesterdayEnergyMapper.selectList(null);
@ -62,12 +62,20 @@ public class AluminumDeviceInfoServiceImpl implements IAluminumDeviceInfoService
result[2] = aluminumThisMonthEnergies.size() > 0 ? aluminumThisMonthEnergies.get(0).getProduction():"0"; result[2] = aluminumThisMonthEnergies.size() > 0 ? aluminumThisMonthEnergies.get(0).getProduction():"0";
result[3] = aluminumThisMonthEnergies.size() > 0 ? aluminumThisMonthEnergies.get(0).getEnergy():"0"; result[3] = aluminumThisMonthEnergies.size() > 0 ? aluminumThisMonthEnergies.get(0).getEnergy():"0";
List<AluminumDeviceDataInformation> 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){ }catch (Exception e){
System.out.println("getEnergyProduct方法异常"); System.out.println("getEnergyProduct方法异常:"+e.getMessage());
result[0] = "-"; result[0] = "-";
result[1] = "-";
result[2] = "-";
result[3] = "-";
} }
return JSONArray.toJSONString(result); return JSONArray.toJSONString(result);

Loading…
Cancel
Save