Commit ee4e279d authored by tangwei's avatar tangwei

修改bug

parent db6a4b97
......@@ -23,9 +23,10 @@ public class MessageAction {
MessageModel messageModel = JSON.parseObject(JSON.toJSONString(msgObj), MessageModel.class);
messageModel.setTitle(title);
messageModel.setBody(RuleUtils.instedParams(content, msgObj));
log.info(String.format("接收规则返回数据: %s", JSON.toJSONString(msgObj)));
log.info(String.format("接收规则返回数据: %s", msgObj));
if (!ValidationUtil.isEmpty(messageModel)) {
try {
log.info("调用平台消息接口参数: {}", messageModel);
Systemctl.messageClient.create(messageModel);
} catch (Exception e) {
e.printStackTrace();
......
......@@ -466,7 +466,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
@Transactional(isolation=Isolation.READ_UNCOMMITTED)
public AlertCalledObjsDto selectAlertCalledByIdNoRedisNew(Long id) {
// 警情基本信息
logger.info("alertCalled6666666666"+id);
AlertCalled alertCalled = this.getById(id);
logger.info("alertCalled777777"+alertCalled);
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id);
// 警情动态表单数据
......@@ -476,6 +478,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
AlertCalledObjsDto alertCalledFormVo = new AlertCalledObjsDto();
alertCalledFormVo.setAlertCalled(alertCalled);
alertCalledFormVo.setAlertFormValue(list);
logger.info("alertCalled75555555"+alertCalledFormVo);
return alertCalledFormVo;
}
......@@ -569,10 +573,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
iAlertFormValueService.saveBatch(alertFormValuelist);
alertCalledObjsDto.setAlertCalled(alertCalled);
alertCalledObjsDto.setAlertFormValue(alertFormValuelist);
// 警情报送
// 调用规则 警情初报
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto, AlertBusinessTypeEnum.警情初报.getCode(),
null, null, null);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, false);
......@@ -621,7 +622,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
eSOrgUsrService.saveAlertCalledToESNew(orgUsr);
}
// 警情报送
// 调用规则 警情初报
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto, AlertBusinessTypeEnum.警情初报.getCode(),
null, null, null);
}
// toSendCompletePoliceSituationMatch(alertCalled.getSequenceNbr());
return alertCalledObjsDto;
......
......@@ -278,7 +278,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
template = templateService.getByType(alertSubmittedExtDto.getBusinessTypeCode());
}
AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService.selectAlertCalledByIdNoRedisNew(queryParam.getAlertCalledId());
AlertCalledObjsDto alertCalledVo = alertCalledService.selectAlertCalledByIdNoRedisNew(queryParam.getAlertCalledId());
AlertCalled alertCalled = alertCalledVo.getAlertCalled();
/**
* 构建警情报送规则对象
......@@ -347,7 +347,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
//// alertCalled.setEndTimeStr()
//// }
AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService.selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr());
AlertCalledObjsDto alertCalledVo = alertCalledService.selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr());
alertCalledVo.setAlertCalled(alertCalled);
// 调用规则
......@@ -393,8 +393,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
* 规则回调
*/
public void ruleCallbackAction(String smsCode, List<Map<String,Object>> sendIds, Object object) throws Exception {
Thread.sleep(1000);
log.info("规则回调参数"+object.toString());
// 获取报送对象列表
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
try { List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
Set<String> mobiles = new HashSet<>();
HashMap<String, String> smsParams = new HashMap<>();
......@@ -410,7 +415,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String alertSubmittedId = calledRo.getAlertSubmittedId();
alertCalledId = calledRo.getSequenceNbr();
AlertCalledObjsDto alertCalledObjsDto = (AlertCalledObjsDto)alertCalledService.selectAlertCalledByIdNoRedisNew(Long.valueOf(calledRo.getSequenceNbr()));
log.info("calledRo.getSequenceNbr()"+calledRo.getSequenceNbr());
log.info("alertCalledObjsDtoid"+Long.valueOf(calledRo.getSequenceNbr()));
AlertCalledObjsDto alertCalledObjsDto = alertCalledService.selectAlertCalledByIdNoRedisNew(Long.valueOf(calledRo.getSequenceNbr()));
log.info("alertCalledObjsDto"+alertCalledObjsDto);
alertCalled = alertCalledObjsDto.getAlertCalled();
// AlertCalledRo tempCalledRo = new AlertCalledRo();
......@@ -591,7 +600,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams.put("callTimeStr", calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress());
smsParams.put("fireLocation", calledRo.getFireLocation());
smsParams.put("endTimeStr", !ValidationUtil.isEmpty(alertCalled.getUpdateTime()) ? DateUtils.convertDateToString(alertCalled.getUpdateTime(),DateUtils.DATE_TIME_PATTERN) : "");
log.info("alertCalled888888"+alertCalled);
smsParams.put("endTimeStr", alertCalled.getUpdateTime()!=null ? DateUtils.convertDateToString(alertCalled.getUpdateTime(),DateUtils.DATE_TIME_PATTERN) : "");
smsParams.put("burningMaterial", calledRo.getBurningMaterial());
smsParams.put("fireSituation", calledRo.getFireSituation());
smsParams.put("trappedNum", calledRo.getTrappedNum());
......@@ -637,10 +647,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException();
}
}
/**
......@@ -1350,7 +1361,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
map.put("companyName", companyName);
map.put("editContent", "可自编辑续报内容");
AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService.selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr());
AlertCalledObjsDto alertCalledVo = alertCalledService.selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr());
/**
* 构建警情报送规则对象
......@@ -1822,9 +1833,11 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
if(sendUserIds!=null&&sendUserIds.size()>0){
for (Map<String, Object> sendUserId : sendUserIds) {
if(sendUserId!=null&&sendUserId.get("amosId")!=null){
map.put(sendUserId.get("amosId").toString(),sendUserId);
}
}
}
Set<Map<String, Object>> set = new HashSet<>(map.values());
return set;
......@@ -2120,6 +2133,8 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
*/
public void pushPowerTransferToAppAndWeb(String type,Map<String, String> besidesMap, HashMap<String, String> smsParams, List<String> userList, Integer messageType){
log.info("web ---消息/addAlterMessageCheck开始组装数据");
PushMessageWebAndAppRo pushMessageWebAndAppRo = new PushMessageWebAndAppRo();
pushMessageWebAndAppRo.setRelationId(besidesMap.get("alterId"));
pushMessageWebAndAppRo.setRecivers(userList);
......@@ -2186,9 +2201,11 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
}
pushMessageWebAndAppRo.setExtras(map);;
try {
log.info("消息/addAlterMessageCheck规则触发前");
ruleTrigger.publish(pushMessageWebAndAppRo, "消息/addAlterMessageCheck", new String[0]);
log.info("消息/addAlterMessageCheck规则触发后");
} catch (Exception e) {
e.printStackTrace();
}
}
......
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