能源消耗结构修改
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;
idGenerator.redisTemplate.opsForValue().set(KEY_PREFIX_SEQUENCE + sequenceName, sequence, second, TimeUnit.SECONDS);
idGenerator.redisTemplate.opsForValue().getOperations();
if (sequenceLength > 0) {
if (sequenceLength > MAX_SEQUENCE_LENGTH) {
sequenceLength = MAX_SEQUENCE_LENGTH;

View File

@ -1,5 +1,6 @@
package com.mt.wms.empty.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.dal.entity.*;
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.empty.params.ElectricQueryParam;
import com.mt.wms.empty.vo.ApmsCheckResultVo;
import com.mt.wms.empty.vo.ConsumeDataVo;
import com.mt.wms.empty.vo.EnergyVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@ -406,11 +410,13 @@ public class EnergyController extends BaseController {
}
return R.ok(json.toJSONString());
}
private Float floatSubtract(Float a, Float b) {
BigDecimal a1 = new BigDecimal(Float.toString(a));
BigDecimal b1 = new BigDecimal(Float.toString(b));
return a1.floatValue();
return a1.subtract(b1).floatValue();
}
@PostMapping(value = "checkResultList")
@ApiOperation(value = "根据生产单号获取apms检验结果")
public List<ApmsCheckResult> getApmsCheckResult(@RequestBody ElectricQueryParam electricQueryParam) {
@ -418,135 +424,466 @@ public class EnergyController extends BaseController {
}
@PostMapping(value = "eletric")
@ApiOperation(value = "根据任务id获取消耗情况",hidden = true)
public R<String> list(@Validated({Default.class}) @RequestBody ElectricQueryParam electricQueryParam) {
Long kiln = electricQueryParam.getKilnId();
//工业炉id为0代表全部存储的时候计算全部
JSONObject jsonObject=new JSONObject();
//指定时间节点
LocalDate timeDate = electricQueryParam.getTime().toLocalDate();
LocalDateTime timeStart = LocalDateTime.of(timeDate, LocalTime.MIN);
LocalDateTime timeEnd = LocalDateTime.of(timeDate, LocalTime.MAX);
//当前时间节点
LocalDateTime todayStart = LocalDateTime.of(LocalDate.now(), LocalTime.MIN);
LocalDateTime todayEnd = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
//总电能消耗
List<ParEleValue> todayEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>()
.eq("kiln_id", kiln)
.between("create_time", todayStart, todayEnd)
.orderByDesc("create_time"));
Float countEleValue = todayEleValueList.get(0).getTotalBat();
jsonObject.put("countEle",countEleValue);
//昨日电能消耗
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<ParEleValue> yesterdayEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>()
.eq("kiln_id", kiln)
.between("create_time", yesterdayStart, yesterdayEnd)
.eq("date_type",0)
.orderByAsc("create_time"));
Float yesterdayTotalBat= yesterdayEleValueList.get(yesterdayEleValueList.size()-1).getTotalBat()-yesterdayEleValueList.get(0).getTotalBat();
jsonObject.put("yesterdayCountEle",yesterdayTotalBat);
//指定日期当天的电能消耗
if (electricQueryParam.getDateType()==0){
List<ParEleValue> dateEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>()
.eq("kiln_id", kiln)
.between("create_time", timeStart, timeEnd)
.orderByAsc("create_time"));
//总耗电量
Float dateCountEle=0F;
if (dateEleValueList.size()!=0){
dateCountEle= dateEleValueList.get(dateEleValueList.size()-1).getTotalBat()-dateEleValueList.get(0).getTotalBat();
}
jsonObject.put("dateCountEle",dateCountEle);
//分时消耗量
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
@ApiOperation(value = "根据任务id获取消耗情况", hidden = false)
public R<JSONObject> list(@Validated({Default.class}) @RequestBody ElectricQueryParam electricQueryParam) {
List<Long> taskIds = electricQueryParam.getTaskIds();
Map<String, Object> map = new HashMap<>();
//电度值
List<List<EnergyVo>> eleConsumeList = new ArrayList<>();
//A向电压
List<List<EnergyVo>> aVolConsumeList = new ArrayList<>();
//B向电压
List<List<EnergyVo>> bVolConsumeList = new ArrayList<>();
//C向电压
List<List<EnergyVo>> cVolConsumeList = new ArrayList<>();
//A向电流
List<List<EnergyVo>> aCurrentList = new ArrayList<>();
//B向电流
List<List<EnergyVo>> bCurrentList = new ArrayList<>();
//C向电流
List<List<EnergyVo>> cCurrentList = new ArrayList<>();
//氮气
List<List<EnergyVo>> nitConsumeList = new ArrayList<>();
//甲醇
List<List<EnergyVo>> metConsumeList = new ArrayList<>();
//丙烷
List<List<EnergyVo>> propaneConsumeList = new ArrayList<>();
//氨气
List<List<EnergyVo>> ammoniaConsumeList = new ArrayList<>();
//二氧化碳
List<List<EnergyVo>> carbonConsumeList = new ArrayList<>();
//1号油搅拌转速
List<List<EnergyVo>> rot1ConsumeList = new ArrayList<>();
//2号油搅拌转速
List<List<EnergyVo>> rot2ConsumeList = new ArrayList<>();
//温度
List<List<EnergyVo>> tempConsumeList = new ArrayList<>();
//油槽温度
List<List<EnergyVo>> oilTempConsumeList = new ArrayList<>();
//外一区温度
List<List<EnergyVo>> outerZone1TempConsumeList = new ArrayList<>();
//外二区温度
List<List<EnergyVo>> outerZone2TempConsumeList = new ArrayList<>();
///氮势
List<List<EnergyVo>> carbonList = new ArrayList<>();
List<List<ApmsCheckResultVo>> checkResultList = new ArrayList<>();
for (Long taskId : taskIds
) {
LocalDate localDate = parEleValue.getCreateTime().toLocalDate();
timeJsonObject.put(localDate.toString(),parEleValue.getTotalBat());
TaskHis currTask = taskHisServiceBiz.getOne(new QueryWrapper<TaskHis>().eq(TaskHis.TASK_ID, taskId));
//防止早期没有炉号的报错
if (currTask.getStoveCode() == null) {
currTask.setStoveCode(currTask.getSheetNo());
}
jsonObject.put("timeEle",timeJsonObject);
}
//指定日期当月的每天电能消耗
if(electricQueryParam.getDateType()==2){
LocalDate firstday = LocalDate.of(timeDate.getYear(), timeDate.getMonthValue(), 1);
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
//获取检验结果
List<ApmsCheckResult> apmsCheckResults = apmsCheckResultServiceBiz.list(new QueryWrapper<ApmsCheckResult>()
.eq(ApmsCheckResult.SHEET_NO, currTask.getSheetNo()));
List<ApmsCheckResultVo> apmsCheckResultVos = BeanUtils.copyList(apmsCheckResults, ApmsCheckResultVo.class);
for (ApmsCheckResultVo apmsCheckResultVo : apmsCheckResultVos
) {
LocalDate localDate = parEleValue.getCreateTime().toLocalDate();
timeJsonObject.put(localDate.toString(),parEleValue.getTotalBat());
apmsCheckResultVo.setStoveCode(currTask.getStoveCode());
}
jsonObject.put("timeEle",timeJsonObject);
}
//指定日期当年的每月电能消耗
if(electricQueryParam.getDateType()==2){
LocalDate firstDay = timeDate.with(TemporalAdjusters.firstDayOfYear());
LocalDate lastDay = timeDate.with(TemporalAdjusters.lastDayOfYear());
List<ParEleValue> timeYearEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>()
.eq("kiln_id", kiln)
.between("create_time", firstDay, lastDay.plusDays(1))
.eq("date_type", 2)
.orderByAsc("create_time"));
//总耗电量
Float dateCountEle=0F;
if (timeYearEleValueList.size()!=0){
dateCountEle= timeYearEleValueList.get(timeYearEleValueList.size()-1).getTotalBat()-timeYearEleValueList.get(0).getTotalBat();
}
jsonObject.put("dateCountEle",dateCountEle);
Map<String,Float> timeJsonObject=new LinkedHashMap();
for (ParEleValue parEleValue:timeYearEleValueList
Long kilnId = currTask.getKilnId();
KilnInfo kilnInfo = kilnInfoServiceBiz.getById(kilnId);
Integer kilnType = kilnInfo.getType();
//电能消耗
List<ParEleValue> parEleValueList = parEleValueServiceBiz.list(new QueryWrapper<ParEleValue>()
.eq(ParEleValue.KILN_ID, kilnId)
.eq(ParEleValue.TASK_ID, taskId));
if (parEleValueList.size() > 0) {
List<Object> eleList = new ArrayList<>();
//电能消耗
List<EnergyVo> eleConsume = new ArrayList<>();
//A向电压
List<EnergyVo> aVolConsume = new ArrayList<>();
//B向电压
List<EnergyVo> bVolConsume = new ArrayList<>();
//C向电压
List<EnergyVo> cVolConsume = new ArrayList<>();
//A向电流
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();
timeJsonObject.put(localDate.toString(),parEleValue.getTotalBat());
//首位置为0
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;
}