Commit c223a9f0 authored by chenzhao's avatar chenzhao

修改bug

parent c9b6dbbe
......@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceI
import com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.entity.*;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
......@@ -115,7 +116,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
private static int comparingByGroupVal(Map<String, Object> map, Map<String, Object> map2, String key) {
int result = 0;
if (map.get(key) instanceof Date) {
if (map.get(key) instanceof DateTime) {
long r1 = ((Date) map.get(key)).getTime();
long r2 = ((Date) map2.get(key)).getTime();
result = Long.compare(r1, r2);
......@@ -159,29 +160,29 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
//
// List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus, alertTypeCode, alertSourceCode, startTime, endTime, data, lift);
// }
public IPage<AlertCalled> queryForCalledList(Page pageBean,Integer alertStatus,
String alertTypeCode ,
String alertSourceCode,
String startTime,
String endTime,
String sort) {
public IPage<AlertCalled> queryForCalledList(Page pageBean, Integer alertStatus,
String alertTypeCode,
String alertSourceCode,
String startTime,
String endTime,
String sort) {
String[] split = sort!=null? sort.split(","):null;
String data = split!=null? RedisKey.humpToLine(split[0]):null;
String[] split = sort != null ? sort.split(",") : null;
String data = split != null ? RedisKey.humpToLine(split[0]) : null;
/*2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 start*/
if (data != null ) {
if (data.equals("alertType") || data.equals("alertSource") || data.equals("alarmType")) {
data = data + "Code";
}
if (data.equals("alertStatusStr")){
data = "alert_status";
}
if (data != null) {
if (data.equals("alertType") || data.equals("alertSource") || data.equals("alarmType")) {
data = data + "Code";
}
if (data.equals("alertStatusStr")) {
data = "alert_status";
}
/*2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 end*/
String lift =split!=null?split[1]:null;
}
/*2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 end*/
String lift = split != null ? split[1] : null;
List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus, alertTypeCode, alertSourceCode, startTime, endTime,data,lift);
List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus, alertTypeCode, alertSourceCode, startTime, endTime, data, lift);
IPage<AlertCalled> iPage = new Page<>();
iPage.setRecords(list);
iPage.setTotal(alertCalledMapper.selectAllCount(alertStatus, alertTypeCode, alertSourceCode, startTime, endTime));
......@@ -248,9 +249,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
// 动态表单
List<AlertFormValue> alertFormValuelist = alertCalledObjsDto.getAlertFormValue();
//判断是否航空器救援 如果为航空器救援则保存冗余字段 response_level_code bug2542 bykongfm
if(AlertStageEnums.HKJY.getCode().equals(alertCalled.getAlertTypeCode())) {
if (AlertStageEnums.HKJY.getCode().equals(alertCalled.getAlertTypeCode())) {
alertFormValuelist.stream().forEach(alertFormValue -> {
if(alertFormValue.getFieldCode().equals("responseLevel")){
if (alertFormValue.getFieldCode().equals("responseLevel")) {
alertCalled.setResponseLevelCode(alertFormValue.getFieldValueCode());
alertCalled.setResponseLevel(alertFormValue.getFieldValue());
}
......@@ -291,11 +292,29 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
iAlertFormValueService.saveBatch(alertFormValuelist);
alertCalledObjsDto.setAlertCalled(alertCalled);
alertCalledObjsDto.setAlertFormValue(alertFormValuelist);
//警情报送
AlertSubmitted alertSubmitted = new AlertSubmitted();
alertSubmitted.setAlertCalledId(alertCalled.getSequenceNbr());
alertSubmitted.setBusinessType(alertCalled.getAlarmType());
alertSubmitted.setBusinessTypeCode(alertCalled.getAlarmTypeCode());
alertSubmitted.setSubmissionTime(new Date());
// 获取接警情况模板
List<Template> templateList =
templateMapper.selectList(new LambdaQueryWrapper<Template>().eq(Template::getFormat, false).like(Template::getTypeCode,
DutyInfoEnum.接警情况.getKey() + "-"));
Map<String, Template> templateMap = templateList.stream().collect(Collectors.toMap(Template::getTypeCode,
Function.identity()));
//增加非空判断 cz 2021-10-08
if ( alertCalled.getAlertTypeCode() != null) {
String tempContent =
templateMap.get(DutyInfoEnum.接警情况.getKey() + "-" + alertCalled.getAlertTypeCode()).getContent();
alertSubmitted.setSubmissionContent(replaceTemplate(tempContent, Bean.BeantoMap(alertCalled)));
};
alertSubmittedService.save(alertSubmitted);
//调用规则
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto);
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
}
......@@ -379,15 +398,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
});
allList.forEach(i -> {
AlertCalled alertCalled = calledMap.get(Long.parseLong(i.get("instanceId").toString()));
i.putAll(Bean.BeantoMap(alertCalled));
//增加非空判断 cz 2021-10-08
if (calledMap.get(Long.parseLong(i.get("instanceId").toString())) != null) {
AlertCalled alertCalled = calledMap.get(Long.parseLong(i.get("instanceId").toString()));
i.putAll(Bean.BeantoMap(alertCalled));
}
});
}
// 按接警时间正序排序
allList.sort((e, o) -> comparingByGroupVal(e, o, "callTime"));
allList.sort((e, o) -> comparingByGroupVal(e, o, "recDate"));
return allList;
}
public Map<String, Object> getAlertInfoList(String beginDate, String endDate) {
Map<String, Object> result = Maps.newHashMap();
List<Map<String, Object>> list = listByDateRange(beginDate, endDate);
......@@ -398,10 +421,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
Map<String, Template> templateMap = templateList.stream().collect(Collectors.toMap(Template::getTypeCode,
Function.identity()));
List<String> contentList = Lists.newArrayList();
//增加非空判断 cz 2021-10-08
list.forEach(i -> {
String tempContent =
templateMap.get(DutyInfoEnum.接警情况.getKey() + "-" + i.get("alertTypeCode")).getContent();
contentList.add(replaceTemplate(tempContent, i));
if (i.get("alertTypeCode") != null) {
String tempContent =
templateMap.get(DutyInfoEnum.接警情况.getKey() + "-" + i.get("alertTypeCode")).getContent();
contentList.add(replaceTemplate(tempContent, i));
}
});
Map<String, Integer> statusCountMap = alertCalledMapper.queryAlertStatusCount(beginDate, endDate);
Integer unFinishedCount =
......@@ -687,12 +713,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
//未结案警情统计
@Override
public Integer AlertCalledcount(int type) {
return alertCalledMapper.AlertCalledcount(0);
return alertCalledMapper.AlertCalledcount(0);
}
@Override
public List<AlertCalled> AlertCalledStatusPage(Integer current, Integer size) {
return alertCalledMapper.AlertCalledStatusPage( current, size);
return alertCalledMapper.AlertCalledStatusPage(current, size);
}
......@@ -787,16 +813,17 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
return resultList;
}
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始*/
public List<String> getContactName( ){
public List<String> getContactName() {
List<String> firefightersName = firefightersService.getFirefightersName();
List<String> contactNames = alertCalledMapper.getContactName();
firefightersName.addAll(contactNames);
return firefightersName;
return firefightersName;
}
public List<String> getCalledAddress( ){
public List<String> getCalledAddress() {
List<String> keyAddress = keySiteService.getAddress();
List<String> alertAddress = alertCalledMapper.getAddress();
keyAddress.addAll(alertAddress);
......
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