Commit 1e2e86d4 authored by tangwei's avatar tangwei

修改警情报送对象

parent a9bbceec
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.component.rule.Label;
import com.yeejoin.amos.component.rule.RuleFact;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
*
* <pre>
......@@ -165,6 +170,16 @@ public class AlertCalledRo implements Serializable{
@Label(value = "类型")
private Integer category;
//新加新字段
@Label(value = "创建人")
protected String recUserName;
@Label(value = "更新时间")
private Date updateTime;
@Label(value = "接警时间")
private Date callTime;
//
// /**
// * 其他
......
......@@ -383,7 +383,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
*/
public void ruleCallbackAction(String smsCode, List<Map<String,Object>> sendIds, Object object) throws Exception {
Thread.sleep(1000);
// Thread.sleep(1000);
log.info("规则回调参数"+object.toString());
......@@ -398,7 +398,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
List<Map<String, Object>> orgUsersqc = new LinkedList<>();
String sCode = "";
String alertWay = "";
AlertCalled alertCalled = null;
// AlertCalled alertCalled = null;
List<String> usIds = new ArrayList<>();
if (object instanceof AlertCalledRo) {
AlertCalledRo calledRo = (AlertCalledRo) object;
......@@ -430,9 +431,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
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();
// AlertCalledObjsDto alertCalledObjsDto = alertCalledService.selectAlertCalledByIdNoRedisNew(Long.valueOf(calledRo.getSequenceNbr()));
// log.info("alertCalledObjsDto"+alertCalledObjsDto);
// alertCalled = alertCalledObjsDto.getAlertCalled();
// AlertCalledRo tempCalledRo = new AlertCalledRo();
// RuleAlertCalledService.init(tempCalledRo,alertCalledObjsDto);
......@@ -554,7 +555,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmitted.setSchedulingTypeCode(alertSchedulingTypeEnum.get().getCode());
alertSubmitted.setSchedulingType(alertSchedulingTypeEnum.get().getName());
alertSubmitted.setSubmissionContent(JSONObject.toJSONString(objectToMap(calledRo)));
alertSubmitted.setSender(alertCalled.getRecUserName());
// alertSubmitted.setSender(alertCalled.getRecUserName());
alertSubmitted.setSender(calledRo.getRecUserName());
alertSubmitted.setUpdateTime(new Date());
alertSubmitted.setSubmissionTime(new Date());
......@@ -621,54 +624,71 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams.put("callTimeStr", calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress());
smsParams.put("fireLocation", calledRo.getFireLocation());
log.info("alertCalled888888"+alertCalled);
smsParams.put("endTimeStr", alertCalled.getUpdateTime()!=null ? DateUtils.convertDateToString(alertCalled.getUpdateTime(),DateUtils.DATE_TIME_PATTERN) : "");
// smsParams.put("endTimeStr", alertCalled.getUpdateTime()!=null ? DateUtils.convertDateToString(alertCalled.getUpdateTime(),DateUtils.DATE_TIME_PATTERN) : "");
smsParams.put("endTimeStr", calledRo.getUpdateTime()!=null ? DateUtils.convertDateToString(calledRo.getUpdateTime(),DateUtils.DATE_TIME_PATTERN) : "");
smsParams.put("burningMaterial", calledRo.getBurningMaterial());
smsParams.put("fireSituation", calledRo.getFireSituation());
smsParams.put("trappedNum", calledRo.getTrappedNum());
smsParams.put("casualtiesNum", calledRo.getCasualtiesNum());
smsParams.put("dangerousExplosives", calledRo.getDangerousExplosives());
smsParams.put("companyName", calledRo.getCompanyName());
smsParams.put("contactUser", alertCalled.getContactUser());
smsParams.put("contactPhone", alertCalled.getContactPhone());
// smsParams.put("contactUser", alertCalled.getContactUser());
// smsParams.put("contactPhone", alertCalled.getContactPhone());
smsParams.put("contactUser", calledRo.getContactUser());
smsParams.put("contactPhone", calledRo.getContactPhone());
smsParams.put("replaceContent", calledRo.getReplaceContent());
smsParams.put("alertType", calledRo.getAlertType());
smsParams.put("feedback", calledRo.getFeedback());
}
// 短信报送对象
alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息
// 组织短信内容
// 调用短信发送接口
Map<String,String> besidesMap = new HashMap<>();
besidesMap.put("alterId",String.valueOf(alertCalled.getSequenceNbr()));
if(alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
besidesMap.put("sendTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情初报.getCode(),besidesMap,smsParams,usIds, null);
} else {
if(alertWay.equals(AlertBusinessTypeEnum.警情续报.getCode())) {
besidesMap.put("sendTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情续报.getCode(),besidesMap,smsParams,usIds, null);
}
if(alertWay.equals(AlertBusinessTypeEnum.警情结案.getCode())) {
besidesMap.put("startTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
besidesMap.put("endTime", DateUtils.dateFormat(alertCalled.getRecDate(), DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情结案.getCode(),besidesMap,smsParams,usIds, null);
}
if(alertWay.equals(AlertBusinessTypeEnum.非警情确认.getCode())) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.非警情确认.getCode(),besidesMap,smsParams,usIds, null);
// 短信报送对象
alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息
// 组织短信内容
// 调用短信发送接口
Map<String,String> besidesMap = new HashMap<>();
//besidesMap.put("alterId",String.valueOf(alertCalled.getSequenceNbr()));
besidesMap.put("alterId",String.valueOf(calledRo.getSequenceNbr()));
if(alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
// besidesMap.put("sendTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
besidesMap.put("sendTime", DateUtils.dateFormat(calledRo.getCallTime(), DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情初报.getCode(),besidesMap,smsParams,usIds, null);
} else {
if(alertWay.equals(AlertBusinessTypeEnum.警情续报.getCode())) {
// besidesMap.put("sendTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
besidesMap.put("sendTime", DateUtils.dateFormat(calledRo.getCallTime(), DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情续报.getCode(),besidesMap,smsParams,usIds, null);
}
if(alertWay.equals(AlertBusinessTypeEnum.警情结案.getCode())) {
// besidesMap.put("startTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
// besidesMap.put("endTime", DateUtils.dateFormat(alertCalled.getRecDate(), DateUtils.DATE_TIME_PATTERN));
besidesMap.put("startTime", DateUtils.dateFormat(calledRo.getCallTime(), DateUtils.DATE_TIME_PATTERN));
besidesMap.put("endTime", DateUtils.dateFormat(calledRo.getUpdateTime(), DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情结案.getCode(),besidesMap,smsParams,usIds, null);
}
if(alertWay.equals(AlertBusinessTypeEnum.非警情确认.getCode())) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.非警情确认.getCode(),besidesMap,smsParams,usIds, null);
}
alertCalledAction.sendAlertCalleCmd(sCode, mobiles, smsParams);
}
alertCalledAction.sendAlertCalleCmd(sCode, mobiles, smsParams);
}
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
}
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException();
......
......@@ -8,10 +8,12 @@ import java.util.Set;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum;
import com.yeejoin.amos.component.rule.Label;
import com.yeejoin.amos.component.rule.config.ClazzUtils;
import com.yeejoin.amos.feign.rule.Rule;
import com.yeejoin.amos.feign.rule.client.RuleClient;
import com.yeejoin.amos.feign.rule.model.FactBaseModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -116,6 +118,13 @@ public class RuleAlertCalledService {
alertCalledRo.setTrappedNum(alertCalled.getTrappedNum() != null ? String.valueOf(alertCalled.getTrappedNum()) : "无");
alertCalledRo.setCompanyName(alertCalled.getCompanyName());
alertCalledRo.setRecUserName(alertCalled.getRecUserName());
alertCalledRo.setUpdateTime(alertCalled.getUpdateTime());
alertCalledRo.setCallTime(alertCalled.getCallTime());
List<AlertFormValue> alertFormValues = alertCalledVo.getAlertFormValue();
if (!ValidationUtil.isEmpty(alertFormValues))
......
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