Commit 1c44822a authored by 李腾威's avatar 李腾威

迭代6 1090 融合调度消息发送

parent 041f79d2
...@@ -117,4 +117,7 @@ public class FirefightersDto extends BaseDto { ...@@ -117,4 +117,7 @@ public class FirefightersDto extends BaseDto {
private String areasExpertise; private String areasExpertise;
@ApiModelProperty(value = "消防专家领域字典code") @ApiModelProperty(value = "消防专家领域字典code")
private String areasExpertiseCode; private String areasExpertiseCode;
@ApiModelProperty(value = "amos账户id")
private String amosUserId;
} }
...@@ -37,5 +37,5 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> { ...@@ -37,5 +37,5 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId, List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId,
String state, String areasExpertise, String jobTitle); String state, String areasExpertise, String jobTitle);
List<FirefightersDto> queryById(@Param("gw")String[] gw); List<FirefightersDto> queryById(@Param("gw")String[] gw, @Param("name")String name);
} }
...@@ -342,8 +342,8 @@ AND cft.type_code = ( ...@@ -342,8 +342,8 @@ AND cft.type_code = (
</select> </select>
<select id='queryByCompanyId' resultType="map"> <select id='queryByCompanyId' resultType="map">
select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone from ( select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone, amosUserId from (
select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr,orgUsr.amos_org_id amosUserId
from cb_org_usr orgUsr left join cb_dynamic_form_instance i on orgUsr.sequence_nbr = from cb_org_usr orgUsr left join cb_dynamic_form_instance i on orgUsr.sequence_nbr =
i.instance_id where i.field_code = 'telephone') as d i.instance_id where i.field_code = 'telephone') as d
where d.sequence_nbr in ( where d.sequence_nbr in (
...@@ -367,8 +367,8 @@ AND cft.type_code = ( ...@@ -367,8 +367,8 @@ AND cft.type_code = (
<select id='queryByCompanyNew' resultType="map"> <select id='queryByCompanyNew' resultType="map">
select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone from ( select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone,amosUserId from (
select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr,orgUsr.amos_org_id amosUserId
from cb_org_usr orgUsr left join cb_dynamic_form_instance i on orgUsr.sequence_nbr = from cb_org_usr orgUsr left join cb_dynamic_form_instance i on orgUsr.sequence_nbr =
i.instance_id where i.field_code = 'telephone') as d i.instance_id where i.field_code = 'telephone') as d
where d.sequence_nbr in ( where d.sequence_nbr in (
......
...@@ -176,12 +176,13 @@ ...@@ -176,12 +176,13 @@
SELECT SELECT
firefighters.sequence_nbr sequenceNbr , firefighters.sequence_nbr sequenceNbr ,
firefighters.name, firefighters.name,
mobile_phone as mobilePhone mobile_phone as mobilePhone,
amos_user_id amosUserId
FROM FROM
cb_firefighters firefighters cb_firefighters firefighters
WHERE WHERE
fire_team_id in ( select sequence_nbr from cb_fire_team cft where company in ( fire_team_id in ( select sequence_nbr from cb_fire_team cft where company in (
select sequence_nbr from cb_org_usr cou where biz_org_name = '消防救援保障部') ) select sequence_nbr from cb_org_usr cou where biz_org_name = #{name}) )
<if test="gw != null"> <if test="gw != null">
And job_title_code In And job_title_code In
<foreach item="item" collection="gw" index="index" open="(" separator="," close=")"> <foreach item="item" collection="gw" index="index" open="(" separator="," close=")">
......
...@@ -689,7 +689,7 @@ LEFT JOIN ( ...@@ -689,7 +689,7 @@ LEFT JOIN (
<select id="queryCompanyId" resultType="map"> <select id="queryCompanyId" resultType="map">
select * from ( select * from (
select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId, select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId,
a.fireManagementPostCode, b.telephone from cb_org_usr cou a.fireManagementPostCode, b.telephone,cou.amos_org_id amosUserId from cb_org_usr cou
left join (select i.instance_id id1 ,if(i.field_code = 'fireManagementPostCode', left join (select i.instance_id id1 ,if(i.field_code = 'fireManagementPostCode',
i.field_value, null) as 'fireManagementPostCode' from cb_dynamic_form_instance i where i.field_code = 'fireManagementPostCode' i.field_value, null) as 'fireManagementPostCode' from cb_dynamic_form_instance i where i.field_code = 'fireManagementPostCode'
and i.field_value_label is not null) a on cou .sequence_nbr = a.id1 and i.field_value_label is not null) a on cou .sequence_nbr = a.id1
...@@ -707,7 +707,7 @@ LEFT JOIN ( ...@@ -707,7 +707,7 @@ LEFT JOIN (
<select id="queryCompanyIdNew" resultType="map"> <select id="queryCompanyIdNew" resultType="map">
select * from ( select * from (
select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId, select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId,
a.administrativePositionCode, b.telephone from cb_org_usr cou a.administrativePositionCode, b.telephone, cou.amos_org_id amosUserId from cb_org_usr cou
left join (select i.instance_id id1 ,if(i.field_code = 'administrativePositionCode', left join (select i.instance_id id1 ,if(i.field_code = 'administrativePositionCode',
i.field_value_label, null) as 'administrativePositionCode' from cb_dynamic_form_instance i where i.field_code = 'administrativePositionCode' i.field_value_label, null) as 'administrativePositionCode' from cb_dynamic_form_instance i where i.field_code = 'administrativePositionCode'
and i.field_value_label is not null) a on cou .sequence_nbr = a.id1 and i.field_value_label is not null) a on cou .sequence_nbr = a.id1
......
...@@ -131,10 +131,10 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -131,10 +131,10 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
return firefightersMapper.getFirefightersName(); return firefightersMapper.getFirefightersName();
} }
public List<FirefightersDto> queryById(String[] gw){ public List<FirefightersDto> queryById(String[] gw,String name){
return firefightersMapper.queryById(gw); return firefightersMapper.queryById(gw,name);
} }
/** /**
* 获取指定岗位名称下的队伍人员电话号码信息 * 获取指定岗位名称下的队伍人员电话号码信息
......
...@@ -84,7 +84,7 @@ public class AlertSubmittedController extends BaseController { ...@@ -84,7 +84,7 @@ public class AlertSubmittedController extends BaseController {
@RequestMapping(value = "/save", method = RequestMethod.POST) @RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增警情报送记录", notes = "新增警情报送记录") @ApiOperation(httpMethod = "POST", value = "新增警情报送记录", notes = "新增警情报送记录")
public ResponseModel<Object> saveAlertSubmitted(@RequestBody AlertSubmittedDto alertSubmittedDto) throws Exception { public ResponseModel<Object> saveAlertSubmitted(@RequestBody AlertSubmittedDto alertSubmittedDto) throws Exception {
return ResponseHelper.buildResponse(alertSubmittedService.save(alertSubmittedDto, getUserInfo().getUserName())); return ResponseHelper.buildResponse(alertSubmittedService.save(alertSubmittedDto, getUserInfo().getRealName()));
} }
/** /**
......
...@@ -264,11 +264,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -264,11 +264,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
List<Map<String, Object>> orgUsers = new LinkedList<>(); List<Map<String, Object>> orgUsers = new LinkedList<>();
String sCode = ""; String sCode = "";
String alertWay = ""; String alertWay = "";
AlertCalled alertCalled = null;
List<String> usIds = new ArrayList<>();
if (object instanceof AlertCalledRo) { if (object instanceof AlertCalledRo) {
AlertCalledRo calledRo = (AlertCalledRo) object; AlertCalledRo calledRo = (AlertCalledRo) object;
String alertSubmittedId = calledRo.getAlertSubmittedId(); String alertSubmittedId = calledRo.getAlertSubmittedId();
alertCalledId = calledRo.getSequenceNbr(); alertCalledId = calledRo.getSequenceNbr();
AlertCalledObjsDto alertCalledObjsDto = (AlertCalledObjsDto)alertCalledService.selectAlertCalledByIdNoRedisNew(Long.valueOf(calledRo.getSequenceNbr()));
alertCalled = alertCalledObjsDto.getAlertCalled();
String alertTypeCode = calledRo.getAlertTypeCode(); String alertTypeCode = calledRo.getAlertTypeCode();
alertWay = calledRo.getAlertWay(); alertWay = calledRo.getAlertWay();
String unitInvolved = calledRo.getUnitInvolved(); String unitInvolved = calledRo.getUnitInvolved();
...@@ -294,7 +299,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -294,7 +299,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} }
if(e.containsKey("fireBrigade")) { if(e.containsKey("fireBrigade")) {
// 根据人员岗位:班组长、队长、通讯员; 消防队伍--消防人员 中,对应岗位的人员 // 根据人员岗位:班组长、队长、通讯员; 消防队伍--消防人员 中,对应岗位的人员
List<FirefightersDto> fireBrigade = firefightersService.queryById(e.get("fireBrigade").toString().split(",")); List<FirefightersDto> fireBrigade = firefightersService.queryById(e.get("fireBrigade").toString().split(","), e.get("name").toString());
fireBrigade.stream().forEach(f->{ fireBrigade.stream().forEach(f->{
HashMap<String,Object> map = new HashMap<>(); HashMap<String,Object> map = new HashMap<>();
map.put("telephone",f.getMobilePhone()); map.put("telephone",f.getMobilePhone());
...@@ -403,6 +408,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -403,6 +408,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
List<AlertSubmitted> alertSubmitteds = alertSubmittedMapper.selectList(queryWrapper); List<AlertSubmitted> alertSubmitteds = alertSubmittedMapper.selectList(queryWrapper);
alertSubmittedNew = alertSubmitteds.get(0); alertSubmittedNew = alertSubmitteds.get(0);
if(!ValidationUtil.isEmpty(calledRo.getUsIds())) {
usIds.addAll(Arrays.asList(calledRo.getUsIds().split(",")));
}
} }
// 组装人员信息 // 组装人员信息
...@@ -414,6 +422,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -414,6 +422,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
} }
usIds.add(orgUser.get("amosUserId").toString());
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setUserId(Long.valueOf(String.valueOf(orgUser.get("sequenceNbr")))); alertSubmittedObject.setUserId(Long.valueOf(String.valueOf(orgUser.get("sequenceNbr"))));
...@@ -448,9 +458,29 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -448,9 +458,29 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 组织短信内容 // 组织短信内容
// 调用短信发送接口 // 调用短信发送接口
Map<String,String> besidesMap = new HashMap<>();
besidesMap.put("alterId",String.valueOf(alertCalled.getSequenceNbr()));
if(alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) { if(alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams); alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
besidesMap.put("sendTime",DateUtils.dateFormat(alertCalled.getCallTime(),DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情初报.getCode(),besidesMap,smsParams,usIds);
} else { } else {
if(alertWay.equals(AlertBusinessTypeEnum.警情续报.getCode())) {
besidesMap.put("sendTime",DateUtils.dateFormat(alertCalled.getCallTime(),DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情续报.getCode(),besidesMap,smsParams,usIds);
}
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);
}
if(alertWay.equals(AlertBusinessTypeEnum.非警情确认.getCode())) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.非警情确认.getCode(),besidesMap,smsParams,usIds);
}
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);
...@@ -1251,9 +1281,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1251,9 +1281,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
/** /**
* app消息web 消息推送 * app消息web 消息推送
* @param smsCode * @param
* @param sendIds
* @param object
* @throws MqttPersistenceException * @throws MqttPersistenceException
* @throws MqttException * @throws MqttException
*/ */
...@@ -1277,19 +1305,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1277,19 +1305,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
pushMessageWebAndAppRo.setStartTime(besidesMap.get("startTime")); pushMessageWebAndAppRo.setStartTime(besidesMap.get("startTime"));
pushMessageWebAndAppRo.setEndTime(besidesMap.get("endTime")); pushMessageWebAndAppRo.setEndTime(besidesMap.get("endTime"));
pushMessageWebAndAppRo.setAddress(smsParams.get("address")); pushMessageWebAndAppRo.setAddress(smsParams.get("address"));
pushMessageWebAndAppRo.setRuleType("endAlert");
} }
if(AlertBusinessTypeEnum.非警情确认.getCode().equals(type)) { if(AlertBusinessTypeEnum.非警情确认.getCode().equals(type)) {
pushMessageWebAndAppRo.setName("消息"); pushMessageWebAndAppRo.setName("消息");
pushMessageWebAndAppRo.setSendTime(smsParams.get("callTimeStr")); pushMessageWebAndAppRo.setSendTime(smsParams.get("callTimeStr"));
pushMessageWebAndAppRo.setAddress(smsParams.get("address")); pushMessageWebAndAppRo.setAddress(smsParams.get("address"));
pushMessageWebAndAppRo.setRuleType("notAlert");
} }
if(AlertBusinessTypeEnum.警情续报.getCode().equals(type)) { if(AlertBusinessTypeEnum.警情续报.getCode().equals(type)) {
pushMessageWebAndAppRo.setName("消息"); pushMessageWebAndAppRo.setName("消息");
pushMessageWebAndAppRo.setCompanyName(smsParams.get("companyName")); pushMessageWebAndAppRo.setCompanyName(smsParams.get("alertType"));
pushMessageWebAndAppRo.setAddress(smsParams.get("address")); pushMessageWebAndAppRo.setAddress(smsParams.get("address"));
pushMessageWebAndAppRo.setSendTime(besidesMap.get("sendTime")); pushMessageWebAndAppRo.setSendTime(besidesMap.get("sendTime"));
pushMessageWebAndAppRo.setTransferLocation(besidesMap.get("transferLocation")); pushMessageWebAndAppRo.setTransferLocation(smsParams.get("replaceContent"));
pushMessageWebAndAppRo.setTrappedNum(smsParams.get("trappedNum"));//被困人数
pushMessageWebAndAppRo.setCasualtiesNum(smsParams.get("casualtiesNum"));//伤亡人数
pushMessageWebAndAppRo.setRuleType("followReportAlert");
} }
if(AlertBusinessTypeEnum.力量调派.getCode().equals(type)) { if(AlertBusinessTypeEnum.力量调派.getCode().equals(type)) {
map.put("url", "powerInformationPage"); map.put("url", "powerInformationPage");
...@@ -1310,7 +1342,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1310,7 +1342,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
pushMessageWebAndAppRo.setSendTime(besidesMap.get("sendTime")); pushMessageWebAndAppRo.setSendTime(besidesMap.get("sendTime"));
pushMessageWebAndAppRo.setCompanyName(smsParams.get("companyName"));//发送单位 pushMessageWebAndAppRo.setCompanyName(smsParams.get("companyName"));//发送单位
pushMessageWebAndAppRo.setAddress(smsParams.get("address")); pushMessageWebAndAppRo.setAddress(smsParams.get("address"));
pushMessageWebAndAppRo.setFireSituation(besidesMap.get("fireSituation"));//火势情况 pushMessageWebAndAppRo.setFireSituation(smsParams.get("fireSituation"));//火势情况
pushMessageWebAndAppRo.setTrappedNum(smsParams.get("trappedNum"));//被困人数 pushMessageWebAndAppRo.setTrappedNum(smsParams.get("trappedNum"));//被困人数
pushMessageWebAndAppRo.setCasualtiesNum(smsParams.get("casualtiesNum"));//伤亡人数 pushMessageWebAndAppRo.setCasualtiesNum(smsParams.get("casualtiesNum"));//伤亡人数
} }
......
...@@ -192,9 +192,9 @@ public class RuleAlertCalledService { ...@@ -192,9 +192,9 @@ public class RuleAlertCalledService {
// 警情初报模板替换规则 // 警情初报模板替换规则
String replaceContent = ""; String replaceContent = "";
if(alertCalled.getAlertTypeCode().equals(AlertStageEnums.YBHZ.getCode())) { if(alertCalled.getAlertTypeCode().equals(AlertStageEnums.YBHZ.getCode())) {
replaceContent = "失火位置:".concat(ValidationUtil.isEmpty(alertCalled.getAddress()) ? "无": alertCalled.getAddress()).concat( replaceContent = "失火位置:".concat(ValidationUtil.isEmpty(alertCalledRo.getFireLocation()) ? "无": alertCalledRo.getFireLocation()).concat(
";燃烧物质:").concat(ValidationUtil.isEmpty(alertCalledRo.getFireLocation() )? "无": alertCalledRo.getFireLocation()).concat( ";燃烧物质:").concat(ValidationUtil.isEmpty(alertCalledRo.getBurningMaterial() )? "无": alertCalledRo.getBurningMaterial()).concat(
";火势情况:").concat(ValidationUtil.isEmpty(alertCalledRo.getFireLocation() ) ? "无" : alertCalledRo.getFireSituation()); ";火势情况:").concat(ValidationUtil.isEmpty(alertCalledRo.getFireSituation() ) ? "无" : alertCalledRo.getFireSituation());
} }
if(alertCalled.getAlertTypeCode().equals(AlertStageEnums.HKJY.getCode())) { if(alertCalled.getAlertTypeCode().equals(AlertStageEnums.HKJY.getCode())) {
......
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