查询能源消耗

This commit is contained in:
李广豪 2022-03-05 18:21:13 +08:00
parent bb957ab4ea
commit edd0f8c77b
3 changed files with 174 additions and 135 deletions

View File

@ -269,8 +269,8 @@ public class CurrTaskController extends BaseController {
}
@PostMapping(value = "runTask")
@ApiOperation(value = "执行任务")
public R<String> runTask(@Validated @RequestBody Long taskId) {
public R<String> runTask(@Validated @RequestBody IdParam param) {
//点击执行按钮会判断当前任务是否为自动任务如果是自动任务会去自动任务查一下该自动任务的上一步是否已完成仅非一步时
return currTaskService.runTask(taskId);
return currTaskService.runTask(param.getId());
}
}

View File

@ -223,39 +223,48 @@ public class EnergyController extends BaseController {
//传入任务号窑炉号查询消耗数据返回json字符串
JSONObject jsonObject=new JSONObject();
ConsumeDataVo consumeDataVo=ConsumeDataVo.builder().build();
Map map=new HashMap();
//电能消耗
List<ParEleValue> parEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>()
.eq(ParEleValue.KILN_ID, electricQueryParam.getKilnId())
.eq(ParEleValue.KILN_ID, kilnId)
.eq(ParEleValue.TASK_ID, electricQueryParam.getTaskId()));
if (parEleValueList.size()>0){
List eleList=new ArrayList();
//电能消耗
List<ConsumeDataVo> eleConsume=new ArrayList<>();
List eleConsume=new ArrayList<>();
//A向电压
List<ConsumeDataVo> aVolConsume=new ArrayList<>();
List aVolConsume=new ArrayList<>();
//B向电压
List<ConsumeDataVo> bVolConsume=new ArrayList<>();
List bVolConsume=new ArrayList<>();
//C向电压
List<ConsumeDataVo> cVolConsume=new ArrayList<>();
List cVolConsume=new ArrayList<>();
for (ParEleValue parEleValue:parEleValueList
) {
consumeDataVo.setCreateTime(parEleValue.getCreateTime());
consumeDataVo.setValue(parEleValue.getTotalBat());
consumeDataVo.setName("耗电量");
consumeDataVo.setUnit("KW");
eleConsume.add(consumeDataVo);
consumeDataVo.setValue(parEleValue.getAVoltagevValue());
consumeDataVo.setName("A向电压");
consumeDataVo.setUnit("V");
aVolConsume.add(consumeDataVo);
consumeDataVo.setValue(parEleValue.getBVoltagevValue());
consumeDataVo.setName("B向电压");
consumeDataVo.setUnit("V");
bVolConsume.add(consumeDataVo);
consumeDataVo.setValue(parEleValue.getCVoltagevValue());
consumeDataVo.setName("C向电压");
consumeDataVo.setUnit("V");
cVolConsume.add(consumeDataVo);
map.put("time",parEleValue.getCreateTime());
map.put("value",parEleValue.getTotalBat());
map.put("name","耗电量");
map.put("unit","KW");
eleConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parEleValue.getCreateTime());
map.put("value",parEleValue.getAVoltagevValue());
map.put("name","A向电压");
map.put("unit","V");
aVolConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parEleValue.getCreateTime());
map.put("value",parEleValue.getBVoltagevValue());
map.put("name","B向电压");
map.put("unit","V");
bVolConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parEleValue.getCreateTime());
map.put("value",parEleValue.getCVoltagevValue());
map.put("name","C向电压");
map.put("unit","V");
cVolConsume.add(JSONObject.toJSON(map));
map.clear();
}
eleList.add(eleConsume);
eleList.add(aVolConsume);
@ -265,38 +274,45 @@ public class EnergyController extends BaseController {
}
//氮气甲醇丙烷氨气消耗量
List<ParGasValue> parGasValueList = parGasValueServiceBiz.list(new QueryWrapper<ParGasValue>()
.eq(ParEleValue.KILN_ID, electricQueryParam.getKilnId())
.eq(ParEleValue.KILN_ID, kilnId)
.eq(ParEleValue.TASK_ID, electricQueryParam.getTaskId()));
if (parGasValueList.size()>0){
if (kilnType==1){
List gasList=new ArrayList();
//氮气
List<ConsumeDataVo> nitConsume=new ArrayList<>();
List nitConsume=new ArrayList<>();
//甲醇
List<ConsumeDataVo> metConsume=new ArrayList<>();
List metConsume=new ArrayList<>();
//丙烷
List<ConsumeDataVo> propaneConsume=new ArrayList<>();
List propaneConsume=new ArrayList<>();
//氨气
List<ConsumeDataVo> ammoniaConsume=new ArrayList<>();
List ammoniaConsume=new ArrayList<>();
for (ParGasValue parGasValue:parGasValueList
) {
consumeDataVo.setCreateTime(parGasValue.getCreateTime());
consumeDataVo.setValue(parGasValue.getNitFlowValue());
consumeDataVo.setName("氮气");
consumeDataVo.setUnit("");
nitConsume.add(consumeDataVo);
consumeDataVo.setValue(parGasValue.getMethanolFlow());
consumeDataVo.setName("甲醇");
consumeDataVo.setUnit("");
metConsume.add(consumeDataVo);
consumeDataVo.setValue(parGasValue.getPropaneFlow());
consumeDataVo.setName("丙烷");
consumeDataVo.setUnit("");
propaneConsume.add(consumeDataVo);
consumeDataVo.setValue(parGasValue.getAmmoniaFlowValue());
consumeDataVo.setName("氨气");
consumeDataVo.setUnit("");
ammoniaConsume.add(consumeDataVo);
map.put("time",parGasValue.getCreateTime());
map.put("value",parGasValue.getNitFlowValue());
map.put("name","氮气");
map.put("unit","");
nitConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parGasValue.getCreateTime());
map.put("value",parGasValue.getMethanolFlow());
map.put("name","甲醇");
map.put("unit","");
metConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parGasValue.getCreateTime());
map.put("value",parGasValue.getPropaneFlow());
map.put("name","丙烷");
map.put("unit","");
propaneConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parGasValue.getCreateTime());
map.put("value",parGasValue.getAmmoniaFlowValue());
map.put("name","氨气");
map.put("unit","");
ammoniaConsume.add(JSONObject.toJSON(map));
map.clear();
}
gasList.add(nitConsume);
gasList.add(metConsume);
@ -307,26 +323,31 @@ public class EnergyController extends BaseController {
if (kilnType==3){
List gasList=new ArrayList();
//氮气
List<ConsumeDataVo> nitConsume=new ArrayList<>();
List nitConsume=new ArrayList<>();
//二氧化碳
List<ConsumeDataVo> carbonConsume=new ArrayList<>();
List carbonConsume=new ArrayList<>();
//氨气
List<ConsumeDataVo> ammoniaConsume=new ArrayList<>();
List ammoniaConsume=new ArrayList<>();
for (ParGasValue parGasValue:parGasValueList
) {
consumeDataVo.setCreateTime(parGasValue.getCreateTime());
consumeDataVo.setValue(parGasValue.getNitFlowValue());
consumeDataVo.setName("氮气");
consumeDataVo.setUnit("");
nitConsume.add(consumeDataVo);
consumeDataVo.setValue(parGasValue.getCarDioxideFlowValue());
consumeDataVo.setName("二氧化碳");
consumeDataVo.setUnit("");
carbonConsume.add(consumeDataVo);
consumeDataVo.setValue(parGasValue.getAmmoniaFlowValue());
consumeDataVo.setName("氨气");
consumeDataVo.setUnit("");
ammoniaConsume.add(consumeDataVo);
map.put("time",parGasValue.getCreateTime());
map.put("value",parGasValue.getNitFlowValue());
map.put("name","氮气");
map.put("unit","");
nitConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parGasValue.getCreateTime());
map.put("value",parGasValue.getCarDioxideFlowValue());
map.put("name","二氧化碳");
map.put("unit","");
carbonConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parGasValue.getCreateTime());
map.put("value",parGasValue.getAmmoniaFlowValue());
map.put("name","氨气");
map.put("unit","");
ammoniaConsume.add(JSONObject.toJSON(map));
map.clear();
}
gasList.add(nitConsume);
gasList.add(carbonConsume);
@ -336,24 +357,27 @@ public class EnergyController extends BaseController {
}
//油搅拌转速趋势
List<ParRotSpeedValue> parRotSpeedValueList = parRotSpeedValueServiceBiz.list(new QueryWrapper<ParRotSpeedValue>()
.eq(ParEleValue.KILN_ID, electricQueryParam.getKilnId())
.eq(ParEleValue.KILN_ID, kilnId)
.eq(ParEleValue.TASK_ID, electricQueryParam.getTaskId()));
if (parRotSpeedValueList.size()>0){
if (kilnType==1){
List rotList=new ArrayList();
List<ConsumeDataVo> rot1Consume=new ArrayList<>();
List<ConsumeDataVo> rot2Consume=new ArrayList<>();
List rot1Consume=new ArrayList<>();
List rot2Consume=new ArrayList<>();
for (ParRotSpeedValue parRotSpeedValue:parRotSpeedValueList
) {
consumeDataVo.setCreateTime(parRotSpeedValue.getCreateTime());
consumeDataVo.setValue(parRotSpeedValue.getOilStiSpeedAValue());
consumeDataVo.setName("1号油搅拌转速");
consumeDataVo.setUnit("转/min");
rot1Consume.add(consumeDataVo);
consumeDataVo.setValue(parRotSpeedValue.getOilStiSpeedBValue());
consumeDataVo.setName("2号油搅拌转速");
consumeDataVo.setUnit("转/min");
rot2Consume.add(consumeDataVo);
map.put("time",parRotSpeedValue.getCreateTime());
map.put("value",parRotSpeedValue.getOilStiSpeedAValue());
map.put("name","1号油搅拌转速");
map.put("unit","转/min");
rot1Consume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parRotSpeedValue.getCreateTime());
map.put("value",parRotSpeedValue.getOilStiSpeedBValue());
map.put("name","2号油搅拌转速");
map.put("unit","转/min");
rot2Consume.add(JSONObject.toJSON(map));
map.clear();
}
rotList.add(rot1Consume);
rotList.add(rot2Consume);
@ -362,37 +386,41 @@ public class EnergyController extends BaseController {
}
//温度趋势实际温度设定温度
List<ParTemValue> parTemValueList = parTemValueServiceBiz.list(new QueryWrapper<ParTemValue>()
.eq(ParEleValue.KILN_ID, electricQueryParam.getKilnId())
.eq(ParEleValue.KILN_ID, kilnId)
.eq(ParEleValue.TASK_ID, electricQueryParam.getTaskId()));
if (parTemValueList.size()>0){
if (kilnType==1){
List tempList=new ArrayList();
List<ConsumeDataVo> actualTempConsume=new ArrayList<>();
List<ConsumeDataVo> setupTempConsume=new ArrayList<>();
List<ConsumeDataVo> actualOilTempConsume=new ArrayList<>();
List<ConsumeDataVo> setupOilTempConsume=new ArrayList<>();
List actualTempConsume=new ArrayList<>();
List setupTempConsume=new ArrayList<>();
List actualOilTempConsume=new ArrayList<>();
List setupOilTempConsume=new ArrayList<>();
for (ParTemValue parTemValue:parTemValueList
) {
consumeDataVo.setCreateTime(parTemValue.getCreateTime());
consumeDataVo.setName("实际温度");
consumeDataVo.setValue(parTemValue.getActTemValue());
consumeDataVo.setUnit("");
actualTempConsume.add(consumeDataVo);
consumeDataVo.setCreateTime(parTemValue.getCreateTime());
consumeDataVo.setName("设定温度");
consumeDataVo.setValue(parTemValue.getSetTemValue());
consumeDataVo.setUnit("");
setupTempConsume.add(consumeDataVo);
consumeDataVo.setCreateTime(parTemValue.getCreateTime());
consumeDataVo.setName("油槽实际温度");
consumeDataVo.setValue(parTemValue.getOilTankActTemValue());
consumeDataVo.setUnit("");
actualOilTempConsume.add(consumeDataVo);
consumeDataVo.setCreateTime(parTemValue.getCreateTime());
consumeDataVo.setName("油槽设定温度");
consumeDataVo.setValue(parTemValue.getOilTankSetTemValue());
consumeDataVo.setUnit("");
setupOilTempConsume.add(consumeDataVo);
map.put("time",parTemValue.getCreateTime());
map.put("value",parTemValue.getActTemValue());
map.put("name","实际温度");
map.put("unit","");
actualTempConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parTemValue.getCreateTime());
map.put("value",parTemValue.getSetTemValue());
map.put("name","设定温度");
map.put("unit","");
setupTempConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parTemValue.getCreateTime());
map.put("value",parTemValue.getOilTankActTemValue());
map.put("name","油槽实际温度");
map.put("unit","");
actualOilTempConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parTemValue.getCreateTime());
map.put("value",parTemValue.getOilTankSetTemValue());
map.put("name","油槽设定温度");
map.put("unit","");
setupOilTempConsume.add(JSONObject.toJSON(map));
map.clear();
}
tempList.add(actualTempConsume);
tempList.add(setupTempConsume);
@ -402,20 +430,22 @@ public class EnergyController extends BaseController {
}
if (kilnType==2){
List tempList=new ArrayList();
List<ConsumeDataVo> actualTempConsume=new ArrayList<>();
List<ConsumeDataVo> setupTempConsume=new ArrayList<>();
List actualTempConsume=new ArrayList<>();
List setupTempConsume=new ArrayList<>();
for (ParTemValue parTemValue:parTemValueList
) {
consumeDataVo.setCreateTime(parTemValue.getCreateTime());
consumeDataVo.setName("实际温度");
consumeDataVo.setValue(parTemValue.getActTemValue());
consumeDataVo.setUnit("");
actualTempConsume.add(consumeDataVo);
consumeDataVo.setCreateTime(parTemValue.getCreateTime());
consumeDataVo.setName("设定温度");
consumeDataVo.setValue(parTemValue.getSetTemValue());
consumeDataVo.setUnit("");
setupTempConsume.add(consumeDataVo);
map.put("time",parTemValue.getCreateTime());
map.put("value",parTemValue.getActTemValue());
map.put("name","实际温度");
map.put("unit","");
actualTempConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parTemValue.getCreateTime());
map.put("value",parTemValue.getSetTemValue());
map.put("name","设定温度");
map.put("unit","");
setupTempConsume.add(JSONObject.toJSON(map));
map.clear();
}
tempList.add(actualTempConsume);
tempList.add(setupTempConsume);
@ -424,32 +454,36 @@ public class EnergyController extends BaseController {
if (kilnType==3){
List tempList=new ArrayList();
List<ConsumeDataVo> actualTempConsume=new ArrayList<>();
List<ConsumeDataVo> setupTempConsume=new ArrayList<>();
List<ConsumeDataVo> outerZone1TempConsume=new ArrayList<>();
List<ConsumeDataVo> outerZone2TempConsume=new ArrayList<>();
List actualTempConsume=new ArrayList<>();
List setupTempConsume=new ArrayList<>();
List outerZone1TempConsume=new ArrayList<>();
List outerZone2TempConsume=new ArrayList<>();
for (ParTemValue parTemValue:parTemValueList
) {
consumeDataVo.setCreateTime(parTemValue.getCreateTime());
consumeDataVo.setName("实际温度");
consumeDataVo.setValue(parTemValue.getActTemValue());
consumeDataVo.setUnit("");
actualTempConsume.add(consumeDataVo);
consumeDataVo.setCreateTime(parTemValue.getCreateTime());
consumeDataVo.setName("设定温度");
consumeDataVo.setValue(parTemValue.getSetTemValue());
consumeDataVo.setUnit("");
setupTempConsume.add(consumeDataVo);
consumeDataVo.setCreateTime(parTemValue.getCreateTime());
consumeDataVo.setName("外一区温度");
consumeDataVo.setValue(parTemValue.getOuterZone1Temp());
consumeDataVo.setUnit("");
outerZone1TempConsume.add(consumeDataVo);
consumeDataVo.setCreateTime(parTemValue.getCreateTime());
consumeDataVo.setName("外二区温度");
consumeDataVo.setValue(parTemValue.getOuterZone2Temp());
consumeDataVo.setUnit("");
outerZone2TempConsume.add(consumeDataVo);
map.put("time",parTemValue.getCreateTime());
map.put("value",parTemValue.getActTemValue());
map.put("name","实际温度");
map.put("unit","");
actualTempConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parTemValue.getCreateTime());
map.put("value",parTemValue.getSetTemValue());
map.put("name","设定温度");
map.put("unit","");
setupTempConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parTemValue.getCreateTime());
map.put("value",parTemValue.getOuterZone1Temp());
map.put("name","外一区温度");
map.put("unit","");
outerZone1TempConsume.add(JSONObject.toJSON(map));
map.clear();
map.put("time",parTemValue.getCreateTime());
map.put("value",parTemValue.getOuterZone2Temp());
map.put("name","外二区温度");
map.put("unit","");
outerZone2TempConsume.add(JSONObject.toJSON(map));
map.clear();
}
tempList.add(actualTempConsume);
tempList.add(setupTempConsume);

View File

@ -51,6 +51,11 @@ public class CurrTaskQueryVo extends BaseVo implements PageVo.ConvertVo {
*/
@ApiModelProperty("任务类型")
private Integer taskType;
/**
* 是否自动执行 0手动1自动如果是自动任务这里要监控进出和到缓存区的调度任务
*/
@ApiModelProperty("是否自动执行手动1自动")
private Integer is_auto;
/**
* 开始加工时间
*/