Compare commits
6 Commits
ac476e936e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d14d142472 | ||
|
|
571cee49a0 | ||
|
|
f1878910e3 | ||
|
|
f5aa87d7e9 | ||
| fa189331b8 | |||
|
|
0616844403 |
@@ -35,6 +35,7 @@ import javax.annotation.Resource;
|
||||
import javax.validation.groups.Default;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -91,6 +92,8 @@ public class ScreenController extends BaseController {
|
||||
return successful(kilnInfoList);
|
||||
}
|
||||
|
||||
@PostMapping(value = "getEleList")
|
||||
@ApiOperation(value = "获取加工炉最近十条加工任务电能消耗信息")
|
||||
public R countEleByKiln(@Validated @RequestBody IdParam idParam) {
|
||||
return eleService.list(idParam.getId());
|
||||
}
|
||||
@@ -124,6 +127,8 @@ public class ScreenController extends BaseController {
|
||||
Integer setupTime = 1;
|
||||
//剩余时间
|
||||
Integer remainingTime = 0;
|
||||
|
||||
|
||||
if (kilnInfo.getType() != 4) {
|
||||
if (kilnInfo.getType() == 3) {
|
||||
remainingTime = readPlc(nameSpace, "ProgramTimeRemaining").intValue();
|
||||
@@ -446,6 +451,7 @@ public class ScreenController extends BaseController {
|
||||
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();
|
||||
@@ -455,8 +461,17 @@ public class ScreenController extends BaseController {
|
||||
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());
|
||||
rot2Consume.add(rot2Vo);
|
||||
}
|
||||
rot1ConsumeList.add(rot1Consume);
|
||||
rot2ConsumeList.add(rot2Consume);
|
||||
}
|
||||
}
|
||||
//温度趋势(实际温度、设定温度)油槽温度外区温度
|
||||
@@ -558,9 +573,27 @@ public class ScreenController extends BaseController {
|
||||
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("外一区温度");
|
||||
outerZone1TempConsume.add(outer1TempVo);
|
||||
|
||||
EnergyVo outer2TempVo = EnergyVo.builder().build();
|
||||
outer2TempVo.setTime(parTemValue.getCreateTime());
|
||||
outer2TempVo.setCode(currTask.getStoveCode());
|
||||
outer2TempVo.setUnit("℃");
|
||||
outer2TempVo.setValue(parTemValue.getOuterZone2Temp());
|
||||
outer2TempVo.setName("外二区温度");
|
||||
outerZone2TempConsume.add(outer2TempVo);
|
||||
|
||||
}
|
||||
tempConsumeList.add(actualTempConsume);
|
||||
tempConsumeList.add(setupTempConsume);
|
||||
outerZone1TempConsumeList.add(outerZone1TempConsume);
|
||||
outerZone2TempConsumeList.add(outerZone2TempConsume);
|
||||
}
|
||||
}
|
||||
map.put("checkResult", checkResultList);
|
||||
@@ -578,8 +611,11 @@ public class ScreenController extends BaseController {
|
||||
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("outerZone1Temp",outerZone1TempConsumeList);
|
||||
map.put("outerZone2Temp",outerZone2TempConsumeList);
|
||||
return successful(JSONObject.parseObject(JSON.toJSONString(map)));
|
||||
}
|
||||
|
||||
|
||||
@@ -702,7 +702,7 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
||||
if (currTask.getStatus() != 0) {
|
||||
return R.failed("该任务状态不为未执行,无法执行!");
|
||||
}
|
||||
if (currTask.getCacheSatatus()==2||currTask.getIsCache()==1){
|
||||
if (currTask.getCacheSatatus()==2&&currTask.getIsCache()==1){
|
||||
return R.failed("该任务已在缓存队列,状态不为未执行,无法执行!");
|
||||
}
|
||||
//是否为自动任务
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package com.mt.wms.empty.service.impl;
|
||||
|
||||
import com.mt.wms.core.base.BaseService;
|
||||
import com.mt.wms.core.dal.entity.CurrTask;
|
||||
import com.mt.wms.core.dal.service.CurrTaskServiceBiz;
|
||||
import com.mt.wms.core.vo.R;
|
||||
import com.mt.wms.empty.mapper.EleMapper;
|
||||
import com.mt.wms.empty.service.EleService;
|
||||
import com.mt.wms.empty.vo.CountEleVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: LGH
|
||||
@@ -17,9 +21,26 @@ public class EleServiceImpl extends BaseService implements EleService {
|
||||
|
||||
@Resource
|
||||
EleMapper eleMapper;
|
||||
@Resource
|
||||
CurrTaskServiceBiz currTaskServiceBiz;
|
||||
|
||||
@Override
|
||||
public R list(Long kilnId) {
|
||||
return successful(eleMapper.list(kilnId));
|
||||
List<CountEleVo> list = eleMapper.list(kilnId);
|
||||
for (CountEleVo countEleVo:list
|
||||
) {
|
||||
CurrTask currTask = currTaskServiceBiz.getById(countEleVo.getTaskId());
|
||||
if (currTask.getStoveCode()==null){
|
||||
if (currTask.getSheetNo()!=null){
|
||||
currTask.setStoveCode(currTask.getSheetNo());
|
||||
}else {
|
||||
currTask.setStoveCode(currTask.getTaskCode());
|
||||
}
|
||||
|
||||
}
|
||||
countEleVo.setStoveCode(currTask.getStoveCode());
|
||||
countEleVo.setCreateTime(currTask.getCreateTime());
|
||||
}
|
||||
return successful(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ public class ScheduledTask extends BaseService {
|
||||
Double oilStirringSpeed2 = readPlc(nameSpaceNote, "OilStirringSpeed2");
|
||||
ParRotSpeedValue parRotSpeedValue = new ParRotSpeedValue();
|
||||
parRotSpeedValue.setOilStiSpeedAValue(oilStirringSpeed1.floatValue());
|
||||
parRotSpeedValue.setOilStiSpeedAValue(oilStirringSpeed2.floatValue());
|
||||
parRotSpeedValue.setOilStiSpeedBValue(oilStirringSpeed2.floatValue());
|
||||
parRotSpeedValue.setKilnId(kilnId);
|
||||
parRotSpeedValue.setTaskId(currTaskId);
|
||||
parRotSpeedValue.setCreateTime(LocalDateTime.now());
|
||||
@@ -555,7 +555,7 @@ public class ScheduledTask extends BaseService {
|
||||
//A向电压
|
||||
Double phaseAVoltage = readPlc(nameSpaceNote, "AVoltage");
|
||||
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");
|
||||
|
||||
@@ -28,11 +28,17 @@ public class CountEleVo {
|
||||
* 消耗值
|
||||
*/
|
||||
@ApiModelProperty(value = "消耗值", example = "0.0")
|
||||
private Float value;
|
||||
private Float totalBat;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty(value = "任务id", example = "0.0")
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 炉号
|
||||
*/
|
||||
@ApiModelProperty(value = "炉号", example = "0.0")
|
||||
private String stoveCode;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -79,6 +80,11 @@ public class NowCurrTaskDetVo extends BaseVo implements PageVo.ConvertVo {
|
||||
*/
|
||||
@ApiModelProperty(value = "工艺进度", example = "0")
|
||||
private Integer completeness;
|
||||
/**
|
||||
* 开始加工时间
|
||||
*/
|
||||
@ApiModelProperty(value = "开始加工时间", example = "0")
|
||||
private LocalDateTime beginTime;
|
||||
|
||||
/**
|
||||
* 标识卡list
|
||||
|
||||
@@ -11,28 +11,24 @@
|
||||
<resultMap id="BaseResultMap" type="com.mt.wms.empty.vo.CountEleVo">
|
||||
<id column="task_id" property="taskId"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="total_bat" property="value"/>
|
||||
<result column="total_bat" property="totalBat"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 根据角色查询菜单,角色已分配的菜单标记为选中状态 -->
|
||||
<select id="list"
|
||||
resultType="com.mt.wms.empty.vo.CountEleVo">
|
||||
SELECT menu.id AS id,
|
||||
menu.parent_id AS parentId,
|
||||
menu.code AS code,
|
||||
menu.name AS name,
|
||||
menu.category AS category,
|
||||
menu.type AS type,
|
||||
menu.order_num AS orderNum,
|
||||
roleMenu.id AS checked
|
||||
FROM t_sys_menu AS menu
|
||||
LEFT JOIN t_sys_role_menu AS roleMenu ON menu.id = roleMenu.menu_id
|
||||
AND roleMenu.role_id = #{roleId}
|
||||
AND roleMenu.valid = 1
|
||||
WHERE menu.valid = 1
|
||||
AND menu.enabled = 1
|
||||
AND menu.category = #{category}
|
||||
ORDER BY menu.order_num
|
||||
select
|
||||
max(total_bat) as total_bat ,
|
||||
task_id
|
||||
from
|
||||
t_par_ele_value tpev2
|
||||
where
|
||||
kiln_id = #{kilnId}
|
||||
group by
|
||||
task_id
|
||||
order by
|
||||
total_bat desc
|
||||
limit 11
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user