Commit ff9b4ff2 authored by tianyiming's avatar tianyiming

Merge branch 'develop_dl_plan6' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6

parents 5762fa7c 76422f37
......@@ -2,10 +2,10 @@ package com.yeejoin.equipmanage.common.enums;
public enum PressurePumpMessageEnum {
MESSAGE_LEVEL_YB("YB", "【%s】分钟内,启停间隔较小", "","名称:稳压泵启停异常提醒;时间:%s;内容:【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"),
MESSAGE_LEVEL_YZ("YZ", "【%s】分钟内,启停间隔较小", "", "名称:稳压泵启停异常提醒;时间:%s;内容:【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"),
MESSAGE_LEVEL_QT_WJ("QT_WJ", "【%s】分钟内,设备启停频繁", "类型:漏水提醒 ;设备位置:【稳压泵设备位置】; 设备名称:【稳压泵设备名称】 ; 时间:系统推送时间", "名称:漏水提醒; 时间:%s;内容:【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,可能存在漏水,请及时查看处理"),
MESSAGE_LEVEL_QT_WJ_YXSC("WJ_YXSC", "运行时长超过【%s】分钟,存在漏水可能", "类型:漏水提醒 ;设备位置:【稳压泵设备位置】; 设备名称:【稳压泵设备名称】 ; 时间:系统推送时间", "名称:漏水提醒; 时间:%s;内容:【%s】- 【%s】 - 运行时长超过【%s】分钟,存在漏水可能,请及时查看处理");
MESSAGE_LEVEL_YB("YB", "【%s】分钟内,启停间隔较小", "","【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"),
MESSAGE_LEVEL_YZ("YZ", "【%s】分钟内,启停间隔较小", "", "【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"),
MESSAGE_LEVEL_QT_WJ("QT_WJ", "【%s】分钟内,设备启停频繁", "类型:漏水提醒 ;设备位置:【稳压泵设备位置】; 设备名称:【稳压泵设备名称】 ; 时间:系统推送时间", "【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,可能存在漏水,请及时查看处理"),
MESSAGE_LEVEL_QT_WJ_YXSC("WJ_YXSC", "运行时长超过【%s】分钟,存在漏水可能", "类型:漏水提醒 ;设备位置:【稳压泵设备位置】; 设备名称:【稳压泵设备名称】 ; 时间:系统推送时间", "【%s】- 【%s】 - 运行时长超过【%s】分钟,存在漏水可能,请及时查看处理");
private String code;
private String allMessage;
private String marqueeMessage;
......
package com.yeejoin.amos.boot.module.common.biz.enums;
public enum DataDictionaryTypeEnum {
PERSON_TYPE("人员类型", "DLRYLX");
private String name;
private String code;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
DataDictionaryTypeEnum(String name, String code) {
this.name = name;
this.code = code;
}
}
package com.yeejoin.amos.boot.module.common.biz.enums;
public enum DynamicGroupCode {
public enum DynamicGroupCodeEnum {
JCS_PERSON("机场人员", "246");
......@@ -23,7 +23,7 @@ public enum DynamicGroupCode {
this.code = code;
}
DynamicGroupCode(String name, String code) {
DynamicGroupCodeEnum(String name, String code) {
this.name = name;
this.code = code;
}
......
......@@ -19,7 +19,10 @@ import java.util.stream.Stream;
import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCode;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService;
import com.yeejoin.amos.boot.module.common.biz.enums.DataDictionaryTypeEnum;
import com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCodeEnum;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
......@@ -82,6 +85,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
@Autowired
IDataDictionaryService dataDictionaryService;
/**
* 每天单个班次执勤人数全部小于等于3人
*/
......@@ -122,7 +129,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
});
}
// 获取人员详细信息
List<Map<String, Object>> personInfoList = dynamicFormInstanceService.personInfoList(DynamicGroupCode.JCS_PERSON.getCode(), userIdSet);
List<Map<String, Object>> personInfoList = dynamicFormInstanceService.personInfoList(DynamicGroupCodeEnum.JCS_PERSON.getCode(), userIdSet);
if (!CollectionUtils.isEmpty(personInfoList)) {
Map<String, List<Map<String, Object>>> listMap = personInfoList.stream().collect(Collectors.groupingBy((Map m) -> String.valueOf(m.get("userId"))));
records.forEach(x -> {
......@@ -559,9 +566,17 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "peopleType")
.eq(DynamicFormInstance::getInstanceId, userId)
.eq(DynamicFormInstance::getGroupCode, DynamicGroupCode.JCS_PERSON.getCode()));
.eq(DynamicFormInstance::getGroupCode, DynamicGroupCodeEnum.JCS_PERSON.getCode()));
if (!CollectionUtils.isEmpty(instances)) {
d.put("personType", instances.get(0).getFieldValue());
String fieldValue = instances.get(0).getFieldValue();
List<DataDictionary> dictionaryList = dataDictionaryService.getByType(DataDictionaryTypeEnum.PERSON_TYPE.getCode());
if (StringUtils.isNotBlank(fieldValue) && !CollectionUtils.isEmpty(dictionaryList)) {
Map<String, List<DataDictionary>> map = dictionaryList.stream().collect(Collectors.groupingBy(DataDictionary::getCode));
List<DataDictionary> list = map.get(fieldValue);
if (!CollectionUtils.isEmpty(list)) {
d.put("personType", list.get(0).getName());
}
}
}
}
return d;
......
......@@ -51,7 +51,7 @@ public class PumpSendMessage implements Job {
}
String recordMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getRecordMessage();
if (StringUtil.isNotEmpty(recordMessage)) {
body = String.format(recordMessage,new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(new Date()), equipmentSpecific.getName(), equipmentSpecific.getPosition(), pressurePumpEnum.getRightValue());
body = String.format(recordMessage, equipmentSpecific.getName(), equipmentSpecific.getPosition(), pressurePumpEnum.getRightValue());
}
String marqueeMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getMarqueeMessage();
if (StringUtil.isNotEmpty(marqueeMessage)) {
......@@ -67,7 +67,9 @@ public class PumpSendMessage implements Job {
}
model.setBody(body);
model.setTitle("漏水提醒");
model.setExtras(map);
model.setRelationId(String.valueOf(equipmentSpecific.getId()));
model.setMsgType("pressurePump");
model.setIsSendApp(false);
model.setTerminal("WEB");
......
......@@ -1474,7 +1474,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
String recordMessage = pumpMessageEnum.getRecordMessage();
if (StringUtil.isNotEmpty(recordMessage)) {
String value = StringUtil.isNotEmpty(pressurePumpEnum.getLeftValue()) ? pressurePumpEnum.getLeftValue() : pressurePumpEnum.getRightValue();
body = String.format(recordMessage,time, data.getEquipmentSpecificName(), data.getLocation(), value);
body = String.format(recordMessage, data.getEquipmentSpecificName(), data.getLocation(), value);
}
String marqueeMessage = pumpMessageEnum.getMarqueeMessage();
if (StringUtil.isNotEmpty(marqueeMessage)) {
......@@ -1493,10 +1493,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
case MESSAGE_LEVEL_YB:
case MESSAGE_LEVEL_YZ:
map.put("type", "稳压泵启停异常提醒");
model.setTitle("稳压泵启停异常提醒");
break;
case MESSAGE_LEVEL_QT_WJ:
case MESSAGE_LEVEL_QT_WJ_YXSC:
map.put("type", "漏水提醒");
model.setTitle("漏水提醒");
break;
default:
break;
......@@ -1512,6 +1514,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
model.setCategory(1);
List<String> receive = new ArrayList<>();
receive.add("system");
model.setRelationId(String.valueOf(data.getEquipmentId()));
model.setRecivers(receive);
Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
......
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