能源消耗结构修改
This commit is contained in:
李广豪 2022-11-18 09:05:14 +08:00
parent 85299bb26a
commit 3ecf06ae6a
4 changed files with 891 additions and 329 deletions

View File

@ -157,6 +157,7 @@ public class IDGenerator {
int second = (int)(tomorrowDate.getTimeInMillis() - curDate.getTimeInMillis()) / 1000; int second = (int)(tomorrowDate.getTimeInMillis() - curDate.getTimeInMillis()) / 1000;
idGenerator.redisTemplate.opsForValue().set(KEY_PREFIX_SEQUENCE + sequenceName, sequence, second, TimeUnit.SECONDS); idGenerator.redisTemplate.opsForValue().set(KEY_PREFIX_SEQUENCE + sequenceName, sequence, second, TimeUnit.SECONDS);
idGenerator.redisTemplate.opsForValue().getOperations(); idGenerator.redisTemplate.opsForValue().getOperations();
if (sequenceLength > 0) { if (sequenceLength > 0) {
if (sequenceLength > MAX_SEQUENCE_LENGTH) { if (sequenceLength > MAX_SEQUENCE_LENGTH) {
sequenceLength = MAX_SEQUENCE_LENGTH; sequenceLength = MAX_SEQUENCE_LENGTH;

View File

@ -1,5 +1,6 @@
package com.mt.wms.empty.controller; package com.mt.wms.empty.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
@ -7,9 +8,12 @@ import com.mt.wms.core.base.BaseController;
import com.mt.wms.core.constants.CommonConstant; import com.mt.wms.core.constants.CommonConstant;
import com.mt.wms.core.dal.entity.*; import com.mt.wms.core.dal.entity.*;
import com.mt.wms.core.dal.service.*; import com.mt.wms.core.dal.service.*;
import com.mt.wms.core.utils.BeanUtils;
import com.mt.wms.core.vo.R; import com.mt.wms.core.vo.R;
import com.mt.wms.empty.params.ElectricQueryParam; import com.mt.wms.empty.params.ElectricQueryParam;
import com.mt.wms.empty.vo.ApmsCheckResultVo;
import com.mt.wms.empty.vo.ConsumeDataVo; import com.mt.wms.empty.vo.ConsumeDataVo;
import com.mt.wms.empty.vo.EnergyVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -406,11 +410,13 @@ public class EnergyController extends BaseController {
} }
return R.ok(json.toJSONString()); return R.ok(json.toJSONString());
} }
private Float floatSubtract(Float a, Float b) { private Float floatSubtract(Float a, Float b) {
BigDecimal a1 = new BigDecimal(Float.toString(a)); BigDecimal a1 = new BigDecimal(Float.toString(a));
BigDecimal b1 = new BigDecimal(Float.toString(b)); BigDecimal b1 = new BigDecimal(Float.toString(b));
return a1.floatValue(); return a1.subtract(b1).floatValue();
} }
@PostMapping(value = "checkResultList") @PostMapping(value = "checkResultList")
@ApiOperation(value = "根据生产单号获取apms检验结果") @ApiOperation(value = "根据生产单号获取apms检验结果")
public List<ApmsCheckResult> getApmsCheckResult(@RequestBody ElectricQueryParam electricQueryParam) { public List<ApmsCheckResult> getApmsCheckResult(@RequestBody ElectricQueryParam electricQueryParam) {
@ -418,135 +424,466 @@ public class EnergyController extends BaseController {
} }
@PostMapping(value = "eletric") @PostMapping(value = "eletric")
@ApiOperation(value = "根据任务id获取消耗情况",hidden = true) @ApiOperation(value = "根据任务id获取消耗情况", hidden = false)
public R<String> list(@Validated({Default.class}) @RequestBody ElectricQueryParam electricQueryParam) { public R<JSONObject> list(@Validated({Default.class}) @RequestBody ElectricQueryParam electricQueryParam) {
Long kiln = electricQueryParam.getKilnId(); List<Long> taskIds = electricQueryParam.getTaskIds();
//工业炉id为0代表全部存储的时候计算全部 Map<String, Object> map = new HashMap<>();
JSONObject jsonObject=new JSONObject(); //电度值
//指定时间节点 List<List<EnergyVo>> eleConsumeList = new ArrayList<>();
LocalDate timeDate = electricQueryParam.getTime().toLocalDate(); //A向电压
LocalDateTime timeStart = LocalDateTime.of(timeDate, LocalTime.MIN); List<List<EnergyVo>> aVolConsumeList = new ArrayList<>();
LocalDateTime timeEnd = LocalDateTime.of(timeDate, LocalTime.MAX); //B向电压
//当前时间节点 List<List<EnergyVo>> bVolConsumeList = new ArrayList<>();
LocalDateTime todayStart = LocalDateTime.of(LocalDate.now(), LocalTime.MIN); //C向电压
LocalDateTime todayEnd = LocalDateTime.of(LocalDate.now(), LocalTime.MAX); List<List<EnergyVo>> cVolConsumeList = new ArrayList<>();
//A向电流
//总电能消耗 List<List<EnergyVo>> aCurrentList = new ArrayList<>();
List<ParEleValue> todayEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>() //B向电流
.eq("kiln_id", kiln) List<List<EnergyVo>> bCurrentList = new ArrayList<>();
.between("create_time", todayStart, todayEnd) //C向电流
.orderByDesc("create_time")); List<List<EnergyVo>> cCurrentList = new ArrayList<>();
Float countEleValue = todayEleValueList.get(0).getTotalBat(); //氮气
jsonObject.put("countEle",countEleValue); List<List<EnergyVo>> nitConsumeList = new ArrayList<>();
//甲醇
//昨日电能消耗 List<List<EnergyVo>> metConsumeList = new ArrayList<>();
LocalDateTime yesterdayStart = LocalDateTime.of(LocalDate.now().plus(1, ChronoUnit.DAYS), LocalTime.MIN); //丙烷
LocalDateTime yesterdayEnd = LocalDateTime.of(LocalDate.now().plus(1, ChronoUnit.DAYS), LocalTime.MAX); List<List<EnergyVo>> propaneConsumeList = new ArrayList<>();
List<ParEleValue> yesterdayEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>() //氨气
.eq("kiln_id", kiln) List<List<EnergyVo>> ammoniaConsumeList = new ArrayList<>();
.between("create_time", yesterdayStart, yesterdayEnd) //二氧化碳
.eq("date_type",0) List<List<EnergyVo>> carbonConsumeList = new ArrayList<>();
.orderByAsc("create_time")); //1号油搅拌转速
Float yesterdayTotalBat= yesterdayEleValueList.get(yesterdayEleValueList.size()-1).getTotalBat()-yesterdayEleValueList.get(0).getTotalBat(); List<List<EnergyVo>> rot1ConsumeList = new ArrayList<>();
jsonObject.put("yesterdayCountEle",yesterdayTotalBat); //2号油搅拌转速
List<List<EnergyVo>> rot2ConsumeList = new ArrayList<>();
//指定日期当天的电能消耗 //温度
if (electricQueryParam.getDateType()==0){ List<List<EnergyVo>> tempConsumeList = new ArrayList<>();
List<ParEleValue> dateEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>() //油槽温度
.eq("kiln_id", kiln) List<List<EnergyVo>> oilTempConsumeList = new ArrayList<>();
.between("create_time", timeStart, timeEnd) //外一区温度
.orderByAsc("create_time")); List<List<EnergyVo>> outerZone1TempConsumeList = new ArrayList<>();
//总耗电量 //外二区温度
Float dateCountEle=0F; List<List<EnergyVo>> outerZone2TempConsumeList = new ArrayList<>();
if (dateEleValueList.size()!=0){ ///氮势
dateCountEle= dateEleValueList.get(dateEleValueList.size()-1).getTotalBat()-dateEleValueList.get(0).getTotalBat(); List<List<EnergyVo>> carbonList = new ArrayList<>();
} List<List<ApmsCheckResultVo>> checkResultList = new ArrayList<>();
jsonObject.put("dateCountEle",dateCountEle); for (Long taskId : taskIds
//分时消耗量
Map<String,Float> timeJsonObject=new LinkedHashMap();
for (int i = 0; i < dateEleValueList.size() - 1; ++i) {
// TODO: 2021/12/16
float eleValue = dateEleValueList.get(i).getTotalBat() - dateEleValueList.get(i - 1).getTotalBat();
int j=i+1;
if (j%2==0){
String time=(j-1)/2+":30";
timeJsonObject.put(time,eleValue);
}else {
String time=(j-1)/2+":00";
timeJsonObject.put(time,eleValue);
}
}
jsonObject.put("timeEle",timeJsonObject);
}
//指定日期当周的每天电能消耗
if(electricQueryParam.getDateType()==1){
LocalDate monday = timeDate.with(DayOfWeek.MONDAY);
LocalDate sunday = timeDate.with(DayOfWeek.SUNDAY);
List<ParEleValue> timeWeekEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>()
.eq("kiln_id", kiln)
.between("create_time", monday, sunday.plusDays(1))
.eq("date_type", 1)
.orderByAsc("create_time"));
//总耗电量
Float dateCountEle=0F;
if (timeWeekEleValueList.size()!=0){
dateCountEle= timeWeekEleValueList.get(timeWeekEleValueList.size()-1).getTotalBat()-timeWeekEleValueList.get(0).getTotalBat();
}
jsonObject.put("dateCountEle",dateCountEle);
Map<String,Float> timeJsonObject=new LinkedHashMap();
for (ParEleValue parEleValue:timeWeekEleValueList
) { ) {
LocalDate localDate = parEleValue.getCreateTime().toLocalDate(); TaskHis currTask = taskHisServiceBiz.getOne(new QueryWrapper<TaskHis>().eq(TaskHis.TASK_ID, taskId));
timeJsonObject.put(localDate.toString(),parEleValue.getTotalBat()); //防止早期没有炉号的报错
if (currTask.getStoveCode() == null) {
currTask.setStoveCode(currTask.getSheetNo());
} }
jsonObject.put("timeEle",timeJsonObject); //获取检验结果
} List<ApmsCheckResult> apmsCheckResults = apmsCheckResultServiceBiz.list(new QueryWrapper<ApmsCheckResult>()
//指定日期当月的每天电能消耗 .eq(ApmsCheckResult.SHEET_NO, currTask.getSheetNo()));
if(electricQueryParam.getDateType()==2){ List<ApmsCheckResultVo> apmsCheckResultVos = BeanUtils.copyList(apmsCheckResults, ApmsCheckResultVo.class);
LocalDate firstday = LocalDate.of(timeDate.getYear(), timeDate.getMonthValue(), 1); for (ApmsCheckResultVo apmsCheckResultVo : apmsCheckResultVos
LocalDate lastDay = timeDate.with(TemporalAdjusters.lastDayOfMonth());
List<ParEleValue> timeMonthEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>()
.eq("kiln_id", kiln)
.between("create_time", firstday, lastDay.plusDays(1))
.eq("date_type", 1)
.orderByAsc("create_time"));
//总耗电量
Float dateCountEle=0F;
if (timeMonthEleValueList.size()!=0){
dateCountEle= timeMonthEleValueList.get(timeMonthEleValueList.size()-1).getTotalBat()-timeMonthEleValueList.get(0).getTotalBat();
}
jsonObject.put("dateCountEle",dateCountEle);
Map<String,Float> timeJsonObject=new LinkedHashMap();
for (ParEleValue parEleValue:timeMonthEleValueList
) { ) {
LocalDate localDate = parEleValue.getCreateTime().toLocalDate(); apmsCheckResultVo.setStoveCode(currTask.getStoveCode());
timeJsonObject.put(localDate.toString(),parEleValue.getTotalBat());
} }
jsonObject.put("timeEle",timeJsonObject); Long kilnId = currTask.getKilnId();
} KilnInfo kilnInfo = kilnInfoServiceBiz.getById(kilnId);
//指定日期当年的每月电能消耗 Integer kilnType = kilnInfo.getType();
if(electricQueryParam.getDateType()==2){ //电能消耗
LocalDate firstDay = timeDate.with(TemporalAdjusters.firstDayOfYear()); List<ParEleValue> parEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>()
LocalDate lastDay = timeDate.with(TemporalAdjusters.lastDayOfYear()); .eq(ParEleValue.KILN_ID, kilnId)
List<ParEleValue> timeYearEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>() .eq(ParEleValue.TASK_ID, taskId));
.eq("kiln_id", kiln) if (parEleValueList.size() > 0) {
.between("create_time", firstDay, lastDay.plusDays(1)) List<Object> eleList = new ArrayList<>();
.eq("date_type", 2) //电能消耗
.orderByAsc("create_time")); List<EnergyVo> eleConsume = new ArrayList<>();
//总耗电量 //A向电压
Float dateCountEle=0F; List<EnergyVo> aVolConsume = new ArrayList<>();
if (timeYearEleValueList.size()!=0){ //B向电压
dateCountEle= timeYearEleValueList.get(timeYearEleValueList.size()-1).getTotalBat()-timeYearEleValueList.get(0).getTotalBat(); List<EnergyVo> bVolConsume = new ArrayList<>();
} //C向电压
jsonObject.put("dateCountEle",dateCountEle); List<EnergyVo> cVolConsume = new ArrayList<>();
Map<String,Float> timeJsonObject=new LinkedHashMap(); //A向电流
for (ParEleValue parEleValue:timeYearEleValueList List<EnergyVo> aCurrentConsume = new ArrayList<>();
//B向电流
List<EnergyVo> bCurrentConsume = new ArrayList<>();
//C向电流
List<EnergyVo> cCurrentConsume = new ArrayList<>();
Float talBat = 0F;
int i = 0;
for (ParEleValue parEleValue : parEleValueList
) { ) {
LocalDate localDate = parEleValue.getCreateTime().toLocalDate(); //首位置为0
timeJsonObject.put(localDate.toString(),parEleValue.getTotalBat()); if (i == 0) {
talBat = parEleValue.getTotalBat();
} }
jsonObject.put("timeEle",timeJsonObject); i++;
EnergyVo eleVo = EnergyVo.builder().build();
eleVo.setCode(currTask.getStoveCode());
eleVo.setName("耗电量");
eleVo.setUnit("KW");
eleVo.setTime(parEleValue.getCreateTime());
eleVo.setValue(floatSubtract(parEleValue.getTotalBat(), talBat));
eleConsume.add(eleVo);
EnergyVo aVolVo = EnergyVo.builder().build();
aVolVo.setCode(currTask.getStoveCode());
aVolVo.setName("A向电压");
aVolVo.setUnit("V");
aVolVo.setTime(parEleValue.getCreateTime());
aVolVo.setValue(parEleValue.getAVoltagevValue());
aVolConsume.add(aVolVo);
EnergyVo bVolVo = EnergyVo.builder().build();
bVolVo.setCode(currTask.getStoveCode());
bVolVo.setName("B向电压");
bVolVo.setUnit("V");
bVolVo.setTime(parEleValue.getCreateTime());
bVolVo.setValue(parEleValue.getBVoltagevValue());
bVolConsume.add(bVolVo);
EnergyVo cVolVo = EnergyVo.builder().build();
cVolVo.setCode(currTask.getStoveCode());
cVolVo.setName("C向电压");
cVolVo.setUnit("V");
cVolVo.setTime(parEleValue.getCreateTime());
cVolVo.setValue(parEleValue.getCVoltagevValue());
cVolConsume.add(cVolVo);
EnergyVo aCurrVo = EnergyVo.builder().build();
aCurrVo.setCode(currTask.getStoveCode());
aCurrVo.setName("A向电流");
aCurrVo.setUnit("A");
aCurrVo.setTime(parEleValue.getCreateTime());
aCurrVo.setValue(parEleValue.getACurrentValue());
aCurrentConsume.add(aCurrVo);
EnergyVo bCurrVo = EnergyVo.builder().build();
bCurrVo.setCode(currTask.getStoveCode());
bCurrVo.setName("B向电流");
bCurrVo.setUnit("A");
bCurrVo.setTime(parEleValue.getCreateTime());
bCurrVo.setValue(parEleValue.getBCurrentValue());
bCurrentConsume.add(bCurrVo);
EnergyVo cCurrVo = EnergyVo.builder().build();
cCurrVo.setCode(currTask.getStoveCode());
cCurrVo.setName("C向电流");
cCurrVo.setUnit("A");
cCurrVo.setTime(parEleValue.getCreateTime());
cCurrVo.setValue(parEleValue.getCCurrentValue());
cCurrentConsume.add(cCurrVo);
} }
return successful(jsonObject.toJSONString()); eleConsumeList.add(eleConsume);
aVolConsumeList.add(aVolConsume);
bVolConsumeList.add(bVolConsume);
cVolConsumeList.add(cVolConsume);
aCurrentList.add(aCurrentConsume);
bCurrentList.add(bCurrentConsume);
cCurrentList.add(cCurrentConsume);
}
//氮气甲醇丙烷氨气二氧化碳消耗量碳势
List<ParGasValue> parGasValueList = parGasValueServiceBiz.list(new QueryWrapper<ParGasValue>()
.eq(ParEleValue.KILN_ID, kilnId)
.eq(ParEleValue.TASK_ID, taskId));
if (parGasValueList.size() > 0) {
if (kilnType == 1) {
///氮势
List<EnergyVo> carbon = new ArrayList<>();
///氮势-设定
List<EnergyVo> carbonSet = new ArrayList<>();
//氮气
List<EnergyVo> nitConsume = new ArrayList<>();
//甲醇
List<EnergyVo> metConsume = new ArrayList<>();
//丙烷
List<EnergyVo> propaneConsume = new ArrayList<>();
//氨气
List<EnergyVo> ammoniaConsume = new ArrayList<>();
for (ParGasValue parGasValue : parGasValueList
) {
EnergyVo carbonSetVo = EnergyVo.builder().build();
carbonSetVo.setTime(parGasValue.getCreateTime());
carbonSetVo.setCode(currTask.getStoveCode().concat("-设定"));
carbonSetVo.setUnit("%");
carbonSetVo.setName("碳/氮势");
carbonSetVo.setValue(parGasValue.getSetNitPotValue());
carbonSet.add(carbonSetVo);
EnergyVo carbonActVo = EnergyVo.builder().build();
carbonActVo.setValue(parGasValue.getActualNitPotValue());
carbonActVo.setUnit("%");
carbonActVo.setName("碳/氮势");
carbonActVo.setCode(currTask.getStoveCode());
carbon.add(carbonActVo);
EnergyVo nitVo = EnergyVo.builder().build();
nitVo.setTime(parGasValue.getCreateTime());
nitVo.setUnit("m³/h");
nitVo.setValue(parGasValue.getNitFlowValue());
nitVo.setName("氮气");
nitVo.setCode(currTask.getStoveCode());
nitConsume.add(nitVo);
EnergyVo metVo = EnergyVo.builder().build();
metVo.setCode(currTask.getStoveCode());
metVo.setValue(parGasValue.getMethanolFlow());
metVo.setName("甲醇");
metVo.setUnit("m³/h");
metVo.setTime(parGasValue.getCreateTime());
metConsume.add(metVo);
EnergyVo propaneVo = EnergyVo.builder().build();
propaneVo.setTime(parGasValue.getCreateTime());
propaneVo.setCode(currTask.getStoveCode());
propaneVo.setUnit("m³/h");
propaneVo.setValue(parGasValue.getPropaneFlow());
propaneVo.setName("丙烷");
propaneConsume.add(propaneVo);
EnergyVo ammoniaVo = EnergyVo.builder().build();
ammoniaVo.setName("氨气");
ammoniaVo.setCode(currTask.getStoveCode());
ammoniaVo.setValue(parGasValue.getAmmoniaFlowValue());
ammoniaVo.setUnit("m³/h");
ammoniaVo.setTime(parGasValue.getCreateTime());
ammoniaConsume.add(ammoniaVo);
}
carbonList.add(carbon);
carbonList.add(carbonSet);
nitConsumeList.add(nitConsume);
metConsumeList.add(metConsume);
propaneConsumeList.add(propaneConsume);
ammoniaConsumeList.add(ammoniaConsume);
}
if (kilnType == 3) {
///氮势
List<EnergyVo> carbon = new ArrayList<>();
///氮势-设定
List<EnergyVo> carbonSet = new ArrayList<>();
//氮气
List<EnergyVo> nitConsume = new ArrayList<>();
//二氧化碳
List<EnergyVo> carbonConsume = new ArrayList<>();
//氨气
List<EnergyVo> ammoniaConsume = new ArrayList<>();
for (ParGasValue parGasValue : parGasValueList
) {
EnergyVo carbonSetVo = EnergyVo.builder().build();
carbonSetVo.setTime(parGasValue.getCreateTime());
carbonSetVo.setCode(currTask.getStoveCode().concat("-设定"));
carbonSetVo.setUnit("%");
carbonSetVo.setName("碳/氮势");
carbonSetVo.setValue(parGasValue.getSetNitPotValue());
carbonSet.add(carbonSetVo);
EnergyVo carbonActVo = EnergyVo.builder().build();
carbonActVo.setValue(parGasValue.getActualNitPotValue());
carbonActVo.setUnit("%");
carbonActVo.setName("碳/氮势");
carbonActVo.setCode(currTask.getStoveCode());
carbon.add(carbonActVo);
EnergyVo nitVo = EnergyVo.builder().build();
nitVo.setTime(parGasValue.getCreateTime());
nitVo.setUnit("m³/h");
nitVo.setValue(parGasValue.getNitFlowValue());
nitVo.setName("氮气");
nitVo.setCode(currTask.getStoveCode());
nitConsume.add(nitVo);
EnergyVo carbonVo = EnergyVo.builder().build();
carbonVo.setTime(parGasValue.getCreateTime());
carbonVo.setCode(currTask.getStoveCode());
carbonVo.setUnit("m³/h");
carbonVo.setValue(parGasValue.getCarDioxideFlowValue());
carbonVo.setName("二氧化碳");
carbonConsume.add(carbonVo);
EnergyVo ammoniaVo = EnergyVo.builder().build();
ammoniaVo.setName("氨气");
ammoniaVo.setCode(currTask.getStoveCode());
ammoniaVo.setValue(parGasValue.getAmmoniaFlowValue());
ammoniaVo.setUnit("m³/h");
ammoniaVo.setTime(parGasValue.getCreateTime());
ammoniaConsume.add(ammoniaVo);
}
carbonList.add(carbon);
carbonList.add(carbonSet);
carbonConsumeList.add(carbonConsume);
nitConsumeList.add(nitConsume);
ammoniaConsumeList.add(ammoniaConsume);
}
}
//油搅拌转速趋势
List<ParRotSpeedValue> parRotSpeedValueList = parRotSpeedValueServiceBiz.list(new QueryWrapper<ParRotSpeedValue>()
.eq(ParEleValue.KILN_ID, kilnId)
.eq(ParEleValue.TASK_ID, taskId));
if (parRotSpeedValueList.size() > 0) {
if (kilnType == 1) {
List<EnergyVo> rot1Consume = new ArrayList<>();
List<EnergyVo> rot2Consume = new ArrayList<>();
for (ParRotSpeedValue parRotSpeedValue : parRotSpeedValueList
) {
EnergyVo rot1Vo = EnergyVo.builder().build();
rot1Vo.setCode(currTask.getStoveCode());
rot1Vo.setUnit("转/min");
rot1Vo.setName("1号油搅拌转速");
rot1Vo.setValue(parRotSpeedValue.getOilStiSpeedAValue());
rot1Vo.setTime(parRotSpeedValue.getCreateTime());
rot1Consume.add(rot1Vo);
EnergyVo rot2Vo = EnergyVo.builder().build();
rot2Vo.setCode(currTask.getStoveCode());
rot2Vo.setUnit("转/min");
rot2Vo.setName("2号油搅拌转速");
rot2Vo.setValue(parRotSpeedValue.getOilStiSpeedBValue());
rot2Vo.setTime(parRotSpeedValue.getCreateTime());
rot1Consume.add(rot2Vo);
}
rot1ConsumeList.add(rot1Consume);
rot2ConsumeList.add(rot2Consume);
}
}
//温度趋势实际温度设定温度油槽温度外区温度
List<ParTemValue> parTemValueList = parTemValueServiceBiz.list(new QueryWrapper<ParTemValue>()
.eq(ParEleValue.KILN_ID, kilnId)
.eq(ParEleValue.TASK_ID, taskId));
if (parTemValueList.size() > 0) {
if (kilnType == 1) {
List<EnergyVo> actualTempConsume = new ArrayList<>();
List<EnergyVo> setupTempConsume = new ArrayList<>();
List<EnergyVo> actualOilTempConsume = new ArrayList<>();
List<EnergyVo> setupOilTempConsume = new ArrayList<>();
for (ParTemValue parTemValue : parTemValueList
) {
EnergyVo actTempVo = EnergyVo.builder().build();
actTempVo.setTime(parTemValue.getCreateTime());
actTempVo.setCode(currTask.getStoveCode());
actTempVo.setUnit("");
actTempVo.setValue(parTemValue.getActTemValue());
actTempVo.setName("实际温度");
actualTempConsume.add(actTempVo);
EnergyVo setTempVo = EnergyVo.builder().build();
setTempVo.setTime(parTemValue.getCreateTime());
setTempVo.setCode(currTask.getStoveCode().concat("-设定"));
setTempVo.setUnit("");
setTempVo.setValue(parTemValue.getSetTemValue());
setTempVo.setName("设定温度");
setupTempConsume.add(setTempVo);
EnergyVo oilSetTempVo = EnergyVo.builder().build();
oilSetTempVo.setTime(parTemValue.getCreateTime());
oilSetTempVo.setCode(currTask.getStoveCode().concat("-设定"));
oilSetTempVo.setUnit("");
oilSetTempVo.setValue(parTemValue.getOilTankSetTemValue());
oilSetTempVo.setName("油槽设定温度");
setupOilTempConsume.add(oilSetTempVo);
EnergyVo oilActTempVo = EnergyVo.builder().build();
oilActTempVo.setTime(parTemValue.getCreateTime());
oilActTempVo.setCode(currTask.getStoveCode());
oilActTempVo.setUnit("");
oilActTempVo.setValue(parTemValue.getOilTankActTemValue());
oilActTempVo.setName("油槽实际温度");
actualOilTempConsume.add(oilActTempVo);
}
tempConsumeList.add(actualTempConsume);
tempConsumeList.add(setupTempConsume);
oilTempConsumeList.add(actualOilTempConsume);
oilTempConsumeList.add(setupOilTempConsume);
}
if (kilnType == 2) {
List<EnergyVo> actualTempConsume = new ArrayList<>();
List<EnergyVo> setupTempConsume = new ArrayList<>();
for (ParTemValue parTemValue : parTemValueList
) {
EnergyVo actTempVo = EnergyVo.builder().build();
actTempVo.setTime(parTemValue.getCreateTime());
actTempVo.setCode(currTask.getStoveCode());
actTempVo.setUnit("");
actTempVo.setValue(parTemValue.getActTemValue());
actTempVo.setName("实际温度");
actualTempConsume.add(actTempVo);
EnergyVo setTempVo = EnergyVo.builder().build();
setTempVo.setTime(parTemValue.getCreateTime());
setTempVo.setCode(currTask.getStoveCode().concat("-设定"));
setTempVo.setUnit("");
setTempVo.setValue(parTemValue.getSetTemValue());
setTempVo.setName("设定温度");
setupTempConsume.add(setTempVo);
}
tempConsumeList.add(actualTempConsume);
tempConsumeList.add(setupTempConsume);
;
}
if (kilnType == 3) {
List<EnergyVo> actualTempConsume = new ArrayList<>();
List<EnergyVo> setupTempConsume = new ArrayList<>();
List<EnergyVo> outerZone1TempConsume = new ArrayList<>();
List<EnergyVo> outerZone2TempConsume = new ArrayList<>();
for (ParTemValue parTemValue : parTemValueList
) {
EnergyVo actTempVo = EnergyVo.builder().build();
actTempVo.setTime(parTemValue.getCreateTime());
actTempVo.setCode(currTask.getStoveCode());
actTempVo.setUnit("");
actTempVo.setValue(parTemValue.getActTemValue());
actTempVo.setName("实际温度");
actualTempConsume.add(actTempVo);
EnergyVo setTempVo = EnergyVo.builder().build();
setTempVo.setTime(parTemValue.getCreateTime());
setTempVo.setCode(currTask.getStoveCode().concat("-设定"));
setTempVo.setUnit("");
setTempVo.setValue(parTemValue.getSetTemValue());
setTempVo.setName("设定温度");
setupTempConsume.add(setTempVo);
EnergyVo outer1TempVo = EnergyVo.builder().build();
outer1TempVo.setTime(parTemValue.getCreateTime());
outer1TempVo.setCode(currTask.getStoveCode());
outer1TempVo.setUnit("");
outer1TempVo.setValue(parTemValue.getOuterZone1Temp());
outer1TempVo.setName("外一区温度");
setupTempConsume.add(outer1TempVo);
EnergyVo outer2TempVo = EnergyVo.builder().build();
outer2TempVo.setTime(parTemValue.getCreateTime());
outer2TempVo.setCode(currTask.getStoveCode());
outer2TempVo.setUnit("");
outer2TempVo.setValue(parTemValue.getOuterZone2Temp());
outer2TempVo.setName("外二区温度");
setupTempConsume.add(outer2TempVo);
}
tempConsumeList.add(actualTempConsume);
tempConsumeList.add(setupTempConsume);
outerZone1TempConsumeList.add(outerZone1TempConsume);
outerZone2TempConsumeList.add(outerZone2TempConsume);
}
}
checkResultList.add(apmsCheckResultVos);
}
map.put("checkResult", checkResultList);
map.put("ele", eleConsumeList);
map.put("aVol", aVolConsumeList);
map.put("bVol", bVolConsumeList);
map.put("cVol", cVolConsumeList);
map.put("aCurr", aCurrentList);
map.put("bCurr", bCurrentList);
map.put("cCurr", cCurrentList);
map.put("carbon", carbonList);
map.put("nit", nitConsumeList);
map.put("met", metConsumeList);
map.put("propane", propaneConsumeList);
map.put("ammon", ammoniaConsumeList);
map.put("car", carbonConsumeList);
map.put("rot1", rot1ConsumeList);
map.put("rot2", rot2ConsumeList);
map.put("temp", tempConsumeList);
map.put("oilTemp", oilTempConsumeList);
map.put("outer1Temp", outerZone1TempConsumeList);
map.put("outer2Temp", outerZone2TempConsumeList);
return successful(JSONObject.parseObject(JSON.toJSONString(map)));
} }
} }

View File

@ -0,0 +1,174 @@
package com.mt.wms.empty.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
* @Author: LGH
* @Date: 2022/11/17
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Builder
@ApiModel(value = "APMS检验结果视图对象", description = "用于查询APMS检验结果视图对象")
public class ApmsCheckResultVo {
/**
* 添加时间入库时间
*/
@ApiModelProperty(value = "创建时间", example = "1")
private LocalDateTime createTime;
/**
* 生产单号
*/
@ApiModelProperty(value = "生产单号", example = "1")
private String sheetNo;
/**
* 炉号
*/
@ApiModelProperty(value = "炉号", example = "1")
private String stoveCode;
/**
* 标识卡号
*/
@ApiModelProperty(value = "标识卡号", example = "1")
private String idenCardNum;
/**
* 硬度检验结果待检验合格不合格返工作废
*/
@ApiModelProperty(value = "硬度检验结果(待检验、合格、不合格、返工、作废)", example = "1")
private String hardness;
/**
* 金相检验结果合格不合格
*/
@ApiModelProperty(value = "金相检验结果(合格、不合格)", example = "1")
private String metallography;
/**
* 心部硬度检验值
*/
@ApiModelProperty(value = "心部硬度检验值", example = "1")
private String heartHardness;
/**
* 备注特殊注释等
*/
@ApiModelProperty(value = "备注", example = "1")
private String remake;
/**
* 硬度检验结果1
*/
@ApiModelProperty(value = "硬度检验结果1", example = "1")
private String hardnessValueOne;
/**
* 硬度检验结果2
*/
@ApiModelProperty(value = "硬度检验结果2", example = "1")
private String hardnessValueTwo;
/**
* 硬度检验结果3
*/
@ApiModelProperty(value = "硬度检验结果3", example = "1")
private String hardnessValueThree;
/**
* 金相检验渗碳淬火 渗碳层深度
*/
@ApiModelProperty(value = "金相检验渗碳淬火 渗碳层深度", example = "1")
private Float metallographyStchStccsd;
/**
* 金相检验渗碳淬火 表面为马氏体残余奥氏体
*/
@ApiModelProperty(value = "金相检验渗碳淬火 表面为马氏体、残余奥氏体(级)", example = "1")
private String metallographyStchMstost;
/**
* 金相检验渗碳淬火 细小颗粒状碳化物
*/
@ApiModelProperty(value = "金相检验渗碳淬火 细小颗粒状碳化物", example = "1")
private String metallographyStchXxklzthw;
/**
* 金相检验渗碳淬火 心部为低碳马氏体加游离铁素体
*/
@ApiModelProperty(value = "金相检验渗碳淬火 心部为低碳马氏体加游离铁素体(级)", example = "1")
private String metallographyStchDtmstyltst;
/**
* 金相检验整体淬火 基体为回火马氏体
*/
@ApiModelProperty(value = "金相检验整体淬火 基体为回火马氏体(级)", example = "1")
private String metallographyZtchHhmst;
/**
* 金相检验整体淬火 基体为回火托式体
*/
@ApiModelProperty(value = "金相检验整体淬火 基体为回火托式体(级)", example = "1")
private String metallographyZtchHhtst;
/**
* 金相检验整体淬火 基体为回火素式体
*/
@ApiModelProperty(value = "金相检验整体淬火 基体为回火素式体(级)", example = "1")
private String metallographyZtchHhsst;
/**
* 金相检验氮化 表面亮白色的为氮化合物层深
*/
@ApiModelProperty(value = "金相检验氮化 表面亮白色的为氮化合物层深", example = "1")
private Float metallographyDhDhhwcs;
/**
* 金相检验氮化 向内为扩散层深
*/
@ApiModelProperty(value = "金相检验氮化 向内为扩散层深", example = "1")
private Float metallographyDhKscs;
/**
* 金相检验氮化 心部
*/
@ApiModelProperty(value = "金相检验氮化 心部", example = "1")
private String metallographyDhXb;
/**
* 金相检验表面淬火 表面为板条马氏体
*/
@ApiModelProperty(value = "金相检验表面淬火 表面为板条马氏体(级)", example = "1")
private String metallographyBmchBtmst;
/**
* 金相检验表面淬火 心部
*/
@ApiModelProperty(value = "金相检验表面淬火 心部", example = "1")
private String metallographyBmchXb;
/**
* 金相检验 备注
*/
@ApiModelProperty(value = "金相检验 备注", example = "1")
private String metallographyBz;
/**
* 金相检验心部硬度 心部硬度检验结果
*/
@ApiModelProperty(value = "金相检验心部硬度 心部硬度检验结果", example = "1")
private Float metallographyXbydXbydjyjg;
}

View File

@ -0,0 +1,50 @@
package com.mt.wms.empty.vo;
import com.mt.wms.core.base.BaseVo;
import com.mt.wms.core.vo.PageVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
* @Author: LGH
* @Date: 2022/11/16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Builder
@ApiModel(value = "能源消耗视图对象", description = "用于查询能源消耗视图对象")
public class EnergyVo extends BaseVo implements PageVo.ConvertVo{
/**
* 名称
*/
@ApiModelProperty(value = "名称",example = "0")
private String name;
/**
*
*/
@ApiModelProperty(value = "名称",example = "0")
private Object value;
/**
* 单位
*/
@ApiModelProperty(value = "单位",example = "0")
private String unit;
/**
* 时间
*/
@ApiModelProperty(value = "时间",example = "0")
private LocalDateTime time;
/**
* code
*/
@ApiModelProperty(value = "编码",example = "0")
private String code;
}