Commit 88318956 authored by tangwei's avatar tangwei

修改bnug

parent bccdd858
package com.yeejoin.equipmanage.common.enums; package com.yeejoin.equipmanage.common.enums;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
public enum PressurePumpEnum { public enum PressurePumpEnum {
ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", new Date().getSeconds() + " " + new Date().getMinutes() + "/5 * * * ?", "5",
ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5",
PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"), PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5", ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5",
......
...@@ -49,6 +49,7 @@ import java.math.BigInteger; ...@@ -49,6 +49,7 @@ import java.math.BigInteger;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -1595,8 +1596,23 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1595,8 +1596,23 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private void startTimeCompute(String indexKey, TopicEntityVo topicEntity, PressurePumpEnum pressurePumpEnum) { private void startTimeCompute(String indexKey, TopicEntityVo topicEntity, PressurePumpEnum pressurePumpEnum) {
String jobName = topicEntity.getIotCode()+"_"+indexKey; String jobName = topicEntity.getIotCode()+"_"+indexKey;
String cron ="";
String triggerName = PUMP_TRIGGER_NAME+"-"+topicEntity.getIotCode(); String triggerName = PUMP_TRIGGER_NAME+"-"+topicEntity.getIotCode();
String cron = pressurePumpEnum.getLeftValue();
if("FHS_PressurePump_Start_ALONE_START_YXSC".equals(pressurePumpEnum.getCode())){
Calendar time= Calendar.getInstance();
time.add(Calendar.MINUTE,5);
cron = time.get(Calendar.SECOND) + " " + time.get(Calendar.MINUTE) + "/5 * * * ?";
}else{
cron = pressurePumpEnum.getLeftValue();
}
EquipmentSpecific equipmentSpecific = null; EquipmentSpecific equipmentSpecific = null;
try { try {
LambdaQueryWrapper<EquipmentSpecific> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EquipmentSpecific> wrapper = new LambdaQueryWrapper<>();
......
...@@ -552,10 +552,19 @@ public class InputItemController extends AbstractBaseController { ...@@ -552,10 +552,19 @@ public class InputItemController extends AbstractBaseController {
@RequestMapping(value = "/addItemNew", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/addItemNew", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse addNewItemNew(@ApiParam(value = "检查项信息") @RequestBody InputItemParam param) { public CommonResponse addNewItemNew(@ApiParam(value = "检查项信息") @RequestBody InputItemParam param) {
if (param.getEquipmentType() == null && param.getCustomType() == null&&param.getFacilitiesType() == null&&param.getKeyPartsType() == null){
throw new BadRequest("适用类型至少需选择一项");
if(param.getId()>0){
if (param.getEquipmentType()==null && param.getCustomType()==null &&param.getFacilitiesType() == null&&param.getKeyPartsType() == null){
throw new BadRequest("适用类型至少需选择一项");
}
}else{
if ("1".equals(param.getEquipmentType()) && "1".equals(param.getCustomType()) &&param.getFacilitiesType() == null&&param.getKeyPartsType() == null){
throw new BadRequest("适用类型至少需选择一项");
}
} }
if (CollectionUtils.isNotEmpty(inputItemDao.findByItemNo(param.getItemNo(), param.getId() != 0 ? String.valueOf(param.getId()) : null))) { if (CollectionUtils.isNotEmpty(inputItemDao.findByItemNo(param.getItemNo(), param.getId() != 0 ? String.valueOf(param.getId()) : null))) {
throw new BadRequest("该编号已存在,请重新输入"); throw new BadRequest("该编号已存在,请重新输入");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment