Compare commits

...

5 Commits

Author SHA1 Message Date
LGH
59921c28ca update:
上报apms炉号
2022-11-18 10:15:35 +08:00
LGH
5eed777f0a update:
上报apms炉号
2022-11-18 10:12:54 +08:00
LGH
592d27b858 update:
上报apms炉号
2022-11-18 10:09:47 +08:00
LGH
59f008f19e Merge branch 'master' of http://git.picaiba.com/mt-ck/mt-qj-wms-hd 2022-11-18 09:06:34 +08:00
LGH
3ecf06ae6a update:
能源消耗结构修改
2022-11-18 09:05:14 +08:00
6 changed files with 1211 additions and 593 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

@ -491,6 +491,7 @@ public class AsynRunTaskService extends BaseService {
webSocketServer.sendtoAll("任务 " + currTask.getTaskCode() + " 车辆从工业炉到缓存区过程中失败。"); webSocketServer.sendtoAll("任务 " + currTask.getTaskCode() + " 车辆从工业炉到缓存区过程中失败。");
} }
} }
//出库起点为加工炉终点为提升台 //出库起点为加工炉终点为提升台
@Async("asyncServiceExecutor") @Async("asyncServiceExecutor")
public void asynRunOutStockForKilnToYYT(Long currTaskId, String yeyaTaiCode, Long vehicleId) throws IOException { public void asynRunOutStockForKilnToYYT(Long currTaskId, String yeyaTaiCode, Long vehicleId) throws IOException {
@ -589,6 +590,7 @@ public class AsynRunTaskService extends BaseService {
webSocketServer.sendtoAll("出库任务车辆从加工炉到提升平台过程中失败。"); webSocketServer.sendtoAll("出库任务车辆从加工炉到提升平台过程中失败。");
} }
} }
//出库起点为缓存区库位终点为提升台 //出库起点为缓存区库位终点为提升台
@Async("asyncServiceExecutor") @Async("asyncServiceExecutor")
public void asynRunOutStock(Long locationId, String yeyaTaiCode, Long vehicleId) throws IOException { public void asynRunOutStock(Long locationId, String yeyaTaiCode, Long vehicleId) throws IOException {
@ -1225,6 +1227,7 @@ public class AsynRunTaskService extends BaseService {
logger.info(currTask.getId() + "任务为多步骤任务且第一步为清洗,不生成洗炉炉号."); logger.info(currTask.getId() + "任务为多步骤任务且第一步为清洗,不生成洗炉炉号.");
} }
} }
/** /**
* 上报apms创建生产单并开始处理 * 上报apms创建生产单并开始处理
* *
@ -1250,7 +1253,10 @@ public class AsynRunTaskService extends BaseService {
createItem.setWeight(e.getWeight().doubleValue()); createItem.setWeight(e.getWeight().doubleValue());
createItems.add(createItem); createItems.add(createItem);
}); });
apmsCreateSheet.setStoveCode(code); //apmsCreateSheet.setStoveCode(code);
if (currTask.getStoveCode() != null) {
apmsCreateSheet.setStoveCode(currTask.getStoveCode());
}
apmsCreateSheet.setItems(createItems); apmsCreateSheet.setItems(createItems);
logger.info(currTask.getId() + "开始创建apms生产单号"); logger.info(currTask.getId() + "开始创建apms生产单号");
R<ApmsCreateProcessSheetVo> processSheet = apmsController.createProcessSheet(apmsCreateSheet); R<ApmsCreateProcessSheetVo> processSheet = apmsController.createProcessSheet(apmsCreateSheet);
@ -1281,6 +1287,7 @@ public class AsynRunTaskService extends BaseService {
/** /**
* 上报apms开始加工 * 上报apms开始加工
*
* @param currTask * @param currTask
* @return * @return
*/ */
@ -1291,7 +1298,10 @@ public class AsynRunTaskService extends BaseService {
apmsStartProcess.setStartTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); apmsStartProcess.setStartTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
apmsStartProcess.setTechName(currTask.getCraftCodeId().toString()); apmsStartProcess.setTechName(currTask.getCraftCodeId().toString());
apmsStartProcess.setSheetNo(currTask.getSheetNo()); apmsStartProcess.setSheetNo(currTask.getSheetNo());
apmsStartProcess.setStoveCode(code); if (currTask.getStoveCode() != null) {
apmsStartProcess.setStoveCode(currTask.getStoveCode());
}
R<ApmsStartProcess> apmsStartProcessR = apmsController.startProcess(apmsStartProcess); R<ApmsStartProcess> apmsStartProcessR = apmsController.startProcess(apmsStartProcess);
if (apmsStartProcessR.getCode() != 0) { if (apmsStartProcessR.getCode() != 0) {
logger.info("任务号" + currTask.getTaskCode() + "生产单号:" + currTask.getSheetNo() + "生产单开始生产上报apms失败"); logger.info("任务号" + currTask.getTaskCode() + "生产单号:" + currTask.getSheetNo() + "生产单开始生产上报apms失败");
@ -1303,6 +1313,7 @@ public class AsynRunTaskService extends BaseService {
/** /**
* 上报apms-end * 上报apms-end
*
* @param currTask * @param currTask
* @return * @return
*/ */
@ -1322,6 +1333,7 @@ public class AsynRunTaskService extends BaseService {
/** /**
* 上报apms-finish * 上报apms-finish
*
* @param currTask * @param currTask
* @return * @return
*/ */
@ -1350,8 +1362,10 @@ public class AsynRunTaskService extends BaseService {
} }
return true; return true;
} }
/** /**
* 车辆是否在线 * 车辆是否在线
*
* @param vehicleId 车辆id * @param vehicleId 车辆id
* @return true/false * @return true/false
* @throws IOException plc访问失败 * @throws IOException plc访问失败
@ -1381,6 +1395,7 @@ public class AsynRunTaskService extends BaseService {
/** /**
* 传入车辆ID,检查另一辆车是否在线如果在线检查是否位置冲突冲突则避让若另一辆车不在线则不检查是否冲突 * 传入车辆ID,检查另一辆车是否在线如果在线检查是否位置冲突冲突则避让若另一辆车不在线则不检查是否冲突
*
* @param vehicleId * @param vehicleId
* @param currTask * @param currTask
* @throws IOException * @throws IOException
@ -1437,6 +1452,7 @@ public class AsynRunTaskService extends BaseService {
/** /**
* 判断任务是否为单步骤任务多步骤任务第一步 * 判断任务是否为单步骤任务多步骤任务第一步
*
* @param currTask 任务 * @param currTask 任务
* @return 单步骤任务true多步骤任务第一步true,其他false * @return 单步骤任务true多步骤任务第一步true,其他false
*/ */

View File

@ -88,6 +88,7 @@ public class ScheduledTask extends BaseService {
public void test() throws IOException { public void test() throws IOException {
} }
//@Scheduled(fixedDelay = 1000*60) //@Scheduled(fixedDelay = 1000*60)
public void testWebsocket() throws IOException { public void testWebsocket() throws IOException {
//查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间剩余时间查询标识卡详情 //查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间剩余时间查询标识卡详情
@ -196,6 +197,7 @@ public class ScheduledTask extends BaseService {
} }
webSocketServer.sendtoUser(JSON.toJSONString(nowCurrTaskDetVoList), "2"); webSocketServer.sendtoUser(JSON.toJSONString(nowCurrTaskDetVoList), "2");
} }
/** /**
* 查询加工完成的工业炉 * 查询加工完成的工业炉
*/ */
@ -437,10 +439,19 @@ public class ScheduledTask extends BaseService {
Double phaseAVoltage = readPlc(nameSpaceNote, "PhaseAVoltage"); Double phaseAVoltage = readPlc(nameSpaceNote, "PhaseAVoltage");
Double phaseBVoltage = readPlc(nameSpaceNote, "PhaseBVoltage"); Double phaseBVoltage = readPlc(nameSpaceNote, "PhaseBVoltage");
Double phaseCVoltage = readPlc(nameSpaceNote, "PhaseCVoltage"); Double phaseCVoltage = readPlc(nameSpaceNote, "PhaseCVoltage");
//ABC向电流
Double phaseACurrent = readPlc(nameSpaceNote, "PhaseACurrent");
Double phaseBCurrent = readPlc(nameSpaceNote, "PhaseBCurrent");
Double phaseDCurrent = readPlc(nameSpaceNote, "PhaseDCurrent");
ParEleValue parEleValue = new ParEleValue(); ParEleValue parEleValue = new ParEleValue();
parEleValue.setAVoltagevValue(phaseAVoltage.floatValue()); parEleValue.setAVoltagevValue(phaseAVoltage.floatValue());
parEleValue.setAVoltagevValue(phaseBVoltage.floatValue()); parEleValue.setBVoltagevValue(phaseBVoltage.floatValue());
parEleValue.setAVoltagevValue(phaseCVoltage.floatValue()); parEleValue.setCVoltagevValue(phaseCVoltage.floatValue());
parEleValue.setACurrentValue(phaseACurrent.floatValue());
parEleValue.setBCurrentValue(phaseBCurrent.floatValue());
parEleValue.setCCurrentValue(phaseDCurrent.floatValue());
parEleValue.setTotalBat(electricalValue.floatValue()); parEleValue.setTotalBat(electricalValue.floatValue());
parEleValue.setKilnId(kilnId); parEleValue.setKilnId(kilnId);
parEleValue.setTaskId(currTaskId); parEleValue.setTaskId(currTaskId);
@ -466,10 +477,17 @@ public class ScheduledTask extends BaseService {
Double phaseAVoltage = readPlc(nameSpaceNote, "AVoltage"); Double phaseAVoltage = readPlc(nameSpaceNote, "AVoltage");
Double phaseBVoltage = readPlc(nameSpaceNote, "BVoltage"); Double phaseBVoltage = readPlc(nameSpaceNote, "BVoltage");
Double phaseCVoltage = readPlc(nameSpaceNote, "CVoltage"); Double phaseCVoltage = readPlc(nameSpaceNote, "CVoltage");
//ABC三相电流
Double aCurrent = readPlc(nameSpaceNote, "ACurrent");
Double bCurrent = readPlc(nameSpaceNote, "BCurrent");
Double cCurrent = readPlc(nameSpaceNote, "CCurrent");
ParEleValue parEleValue2 = new ParEleValue(); ParEleValue parEleValue2 = new ParEleValue();
parEleValue2.setAVoltagevValue(phaseAVoltage.floatValue()); parEleValue2.setAVoltagevValue(phaseAVoltage.floatValue());
parEleValue2.setAVoltagevValue(phaseBVoltage.floatValue()); parEleValue2.setBVoltagevValue(phaseBVoltage.floatValue());
parEleValue2.setAVoltagevValue(phaseCVoltage.floatValue()); parEleValue2.setCVoltagevValue(phaseCVoltage.floatValue());
parEleValue2.setACurrentValue(aCurrent.floatValue());
parEleValue2.setBCurrentValue(bCurrent.floatValue());
parEleValue2.setCCurrentValue(cCurrent.floatValue());
parEleValue2.setTotalBat(electricalValue.floatValue()); parEleValue2.setTotalBat(electricalValue.floatValue());
parEleValue2.setKilnId(kilnId); parEleValue2.setKilnId(kilnId);
parEleValue2.setTaskId(currTaskId); parEleValue2.setTaskId(currTaskId);
@ -504,10 +522,17 @@ public class ScheduledTask extends BaseService {
Double phaseAVoltage = readPlc(nameSpaceNote, "PhaseAVoltage"); Double phaseAVoltage = readPlc(nameSpaceNote, "PhaseAVoltage");
Double phaseBVoltage = readPlc(nameSpaceNote, "PhaseBVoltage"); Double phaseBVoltage = readPlc(nameSpaceNote, "PhaseBVoltage");
Double phaseCVoltage = readPlc(nameSpaceNote, "PhaseCVoltage"); Double phaseCVoltage = readPlc(nameSpaceNote, "PhaseCVoltage");
//ABC三向电流
Double phaseACurrent = readPlc(nameSpaceNote, "PhaseACurrent");
Double phaseBCurrent = readPlc(nameSpaceNote, "PhaseBCurrent");
Double phaseCCurrent = readPlc(nameSpaceNote, "PhaseCCurrent");
ParEleValue parEleValue3 = new ParEleValue(); ParEleValue parEleValue3 = new ParEleValue();
parEleValue3.setAVoltagevValue(phaseAVoltage.floatValue()); parEleValue3.setAVoltagevValue(phaseAVoltage.floatValue());
parEleValue3.setAVoltagevValue(phaseBVoltage.floatValue()); parEleValue3.setBVoltagevValue(phaseBVoltage.floatValue());
parEleValue3.setAVoltagevValue(phaseCVoltage.floatValue()); parEleValue3.setCVoltagevValue(phaseCVoltage.floatValue());
parEleValue3.setACurrentValue(phaseACurrent.floatValue());
parEleValue3.setBCurrentValue(phaseBCurrent.floatValue());
parEleValue3.setCCurrentValue(phaseCVoltage.floatValue());
parEleValue3.setTotalBat(electricalValue.floatValue()); parEleValue3.setTotalBat(electricalValue.floatValue());
parEleValue3.setKilnId(kilnId); parEleValue3.setKilnId(kilnId);
parEleValue3.setTaskId(currTaskId); parEleValue3.setTaskId(currTaskId);
@ -522,10 +547,17 @@ public class ScheduledTask extends BaseService {
Double phaseAVoltage = readPlc(nameSpaceNote, "AVoltage"); Double phaseAVoltage = readPlc(nameSpaceNote, "AVoltage");
Double phaseBVoltage = readPlc(nameSpaceNote, "BVoltage"); Double phaseBVoltage = readPlc(nameSpaceNote, "BVoltage");
Double phaseCVoltage = readPlc(nameSpaceNote, "CVoltage"); Double phaseCVoltage = readPlc(nameSpaceNote, "CVoltage");
//ABC三向电流
Double aCurrent = readPlc(nameSpaceNote, "ACurrent");
Double bCurrent = readPlc(nameSpaceNote, "BCurrent");
Double cCurrent = readPlc(nameSpaceNote, "CCurrent");
ParEleValue parEleValue4 = new ParEleValue(); ParEleValue parEleValue4 = new ParEleValue();
parEleValue4.setAVoltagevValue(phaseAVoltage.floatValue()); parEleValue4.setAVoltagevValue(phaseAVoltage.floatValue());
parEleValue4.setAVoltagevValue(phaseBVoltage.floatValue()); parEleValue4.setBVoltagevValue(phaseBVoltage.floatValue());
parEleValue4.setAVoltagevValue(phaseCVoltage.floatValue()); parEleValue4.setCVoltagevValue(phaseCVoltage.floatValue());
parEleValue4.setACurrentValue(aCurrent.floatValue());
parEleValue4.setBCurrentValue(bCurrent.floatValue());
parEleValue4.setCCurrentValue(cCurrent.floatValue());
parEleValue4.setTotalBat(electricalValue.floatValue()); parEleValue4.setTotalBat(electricalValue.floatValue());
parEleValue4.setKilnId(kilnId); parEleValue4.setKilnId(kilnId);
parEleValue4.setTaskId(currTaskId); parEleValue4.setTaskId(currTaskId);
@ -631,7 +663,8 @@ public class ScheduledTask extends BaseService {
List<PlcNameSpace> alarmNameList = plcNameSpaceServiceBiz.list(new QueryWrapper<PlcNameSpace>() List<PlcNameSpace> alarmNameList = plcNameSpaceServiceBiz.list(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_TYPE, 1) .eq(PlcNameSpace.EQ_TYPE, 1)
.eq(PlcNameSpace.TYPE, 1) .eq(PlcNameSpace.TYPE, 1)
.eq(PlcNameSpace.EQ_ID,kilnInfo.getId()));; .eq(PlcNameSpace.EQ_ID, kilnInfo.getId()));
;
for (PlcNameSpace plcNameSpace : alarmNameList for (PlcNameSpace plcNameSpace : alarmNameList
) { ) {
String name = plcNameSpace.getName(); String name = plcNameSpace.getName();
@ -663,8 +696,7 @@ public class ScheduledTask extends BaseService {
alarmInfo.setCreateTime(LocalDateTime.now()); alarmInfo.setCreateTime(LocalDateTime.now());
alarmInfoServiceBiz.save(alarmInfo); alarmInfoServiceBiz.save(alarmInfo);
} }
} } else {
else {
AlarmInfo alarmInfo = new AlarmInfo(); AlarmInfo alarmInfo = new AlarmInfo();
alarmInfo.setEquipmentId(kilnInfo.getId()); alarmInfo.setEquipmentId(kilnInfo.getId());
alarmInfo.setEquipmentName(kilnInfo.getKilnName()); alarmInfo.setEquipmentName(kilnInfo.getKilnName());
@ -701,8 +733,10 @@ public class ScheduledTask extends BaseService {
} }
} }
} }
/** /**
* 获取变量值 * 获取变量值
*
* @param nameSpace nameSpace前缀 * @param nameSpace nameSpace前缀
* @param variableName 变量名称 * @param variableName 变量名称
* @return result字符串 * @return result字符串
@ -723,8 +757,10 @@ public class ScheduledTask extends BaseService {
return result; return result;
} }
/** /**
* 获取变量值 * 获取变量值
*
* @param nameSpace nameSpace前缀 * @param nameSpace nameSpace前缀
* @param variableName 变量名称 * @param variableName 变量名称
* @return 变量值 * @return 变量值
@ -754,6 +790,7 @@ public class ScheduledTask extends BaseService {
String result = readPlcToString(nameSpaceNote, "AllowIn"); String result = readPlcToString(nameSpaceNote, "AllowIn");
return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString()); return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
} }
private Boolean kilnReadyIn(Long kilnId) { private Boolean kilnReadyIn(Long kilnId) {
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>() PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_TYPE, 0) .eq(PlcNameSpace.EQ_TYPE, 0)
@ -763,6 +800,7 @@ public class ScheduledTask extends BaseService {
String result = readPlcToString(nameSpaceNote, "ReadyIn"); String result = readPlcToString(nameSpaceNote, "ReadyIn");
return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString()); return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
} }
private Boolean kilnWorking(Long kilnId) { private Boolean kilnWorking(Long kilnId) {
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>() PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_TYPE, 0) .eq(PlcNameSpace.EQ_TYPE, 0)
@ -775,6 +813,7 @@ public class ScheduledTask extends BaseService {
/** /**
* 车辆是否在线 * 车辆是否在线
*
* @param vehicleId 车辆id * @param vehicleId 车辆id
* @return true/false * @return true/false
* @throws IOException plc访问失败 * @throws IOException plc访问失败
@ -804,6 +843,7 @@ public class ScheduledTask extends BaseService {
/** /**
* 车辆是否空闲 * 车辆是否空闲
*
* @param vehicleId 车辆id * @param vehicleId 车辆id
* @return true/false * @return true/false
* @throws IOException plc访问失败 * @throws IOException plc访问失败

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;
}