Commit 175f422b authored by tangwei's avatar tangwei

Merge branch 'develop_dl_plan6_temp' of…

Merge branch 'develop_dl_plan6_temp' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6_temp # Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
parents d012287e 0efbaf08
...@@ -24,6 +24,7 @@ import org.springframework.util.CollectionUtils; ...@@ -24,6 +24,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...@@ -35,6 +36,8 @@ import java.text.SimpleDateFormat; ...@@ -35,6 +36,8 @@ import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static org.typroject.tyboot.core.foundation.utils.DateTimeUtil.ISO8601_DATE_HOUR_MIN_SEC;
@RestController @RestController
@Api(tags = "监盘总览组态需求 -- API") @Api(tags = "监盘总览组态需求 -- API")
@RequestMapping(value = "/supervisionConfigure", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/supervisionConfigure", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
...@@ -456,7 +459,7 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -456,7 +459,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
public ResponseModel selectPipePressureDetail(@RequestParam(value = "equipmentSpecificId") String equipmentSpecificId, public ResponseModel selectPipePressureDetail(@RequestParam(value = "equipmentSpecificId") String equipmentSpecificId,
@RequestParam(value = "startTime", required = false) String startTime, @RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime @RequestParam(value = "endTime", required = false) String endTime
) { ) throws ParseException {
if (!StringUtil.isNotEmpty(equipmentSpecificId)) { if (!StringUtil.isNotEmpty(equipmentSpecificId)) {
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
...@@ -493,14 +496,16 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -493,14 +496,16 @@ public class SupervisionConfigureController extends AbstractBaseController {
String json1 = JSON.toJSONString(mounthEntity.getResult()); String json1 = JSON.toJSONString(mounthEntity.getResult());
List<Map<String, String>> list = (List<Map<String, String>>) JSONArray.parse(json1); List<Map<String, String>> list = (List<Map<String, String>>) JSONArray.parse(json1);
Collections.reverse(list); Collections.reverse(list);
if (!CollectionUtils.isEmpty(list) && list.size() > 30) { // if (!CollectionUtils.isEmpty(list) && list.size() > 30) {
for (int i = 0; i <= 29; i++) { // for (int i = 0; i <= 29; i++) {
result.add(list.get(i)); // result.add(list.get(i));
} // }
} else { // } else {
// result.addAll(list);
// }
if (!CollectionUtils.isEmpty(list)) {
result.addAll(list); result.addAll(list);
} }
} }
List<Map<String, String>> res = new ArrayList<>(); List<Map<String, String>> res = new ArrayList<>();
for (Map<String, String> m : result) { for (Map<String, String> m : result) {
...@@ -531,19 +536,32 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -531,19 +536,32 @@ public class SupervisionConfigureController extends AbstractBaseController {
return CommonResponseUtil.success(resMap); return CommonResponseUtil.success(resMap);
} }
private String change(String time) { private String change(String time) throws ParseException {
//进行转化时区 //进行转化时区
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US);
Date myDate = null; Date date1 = null;
// if(time.contains("Z")) {
// try {
// myDate = dateFormat.parse(time.replace("Z", "+0000"));
// } catch (ParseException e) {
// e.printStackTrace();
// }
// }
try { try {
myDate = dateFormat.parse(time.replace("Z", "+0000")); String strDate = time.substring(0, 19);
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
date1 = sdf.parse(strDate);
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
return DateTimeUtil.format(date1, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
// return times;
//转换为年月日时分秒 //转换为年月日时分秒
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = df.format(myDate); // return df.format(time);
return format; // return format;
} }
} }
...@@ -506,7 +506,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -506,7 +506,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
// 处理监控和多个电力设备关系(1个摄像头对多个电力装备) // 处理监控和多个电力设备关系(1个摄像头对多个电力装备)
videoImportantEquipments.addAll(this.buildVideoImportantEquipment(fireMap, video.getId(), x.getImportantEquipmentCodes(), rowNum)); videoImportantEquipments.addAll(this.buildVideoImportantEquipment(fireMap, video.getId(), x.getImportantEquipmentCodes(), rowNum));
}catch (Exception e) { }catch (Exception e) {
throw new RuntimeException("系统异常!"); throw new RuntimeException(e.getMessage());
} }
} }
if (!videoSources.isEmpty()) { if (!videoSources.isEmpty()) {
......
...@@ -33,7 +33,6 @@ import java.util.stream.IntStream; ...@@ -33,7 +33,6 @@ import java.util.stream.IntStream;
import com.yeejoin.amos.boot.module.command.api.dto.FrontlineLiaisonDto; import com.yeejoin.amos.boot.module.command.api.dto.FrontlineLiaisonDto;
import com.yeejoin.amos.boot.module.command.biz.service.impl.FrontlineLiaisonServiceImpl; import com.yeejoin.amos.boot.module.command.biz.service.impl.FrontlineLiaisonServiceImpl;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.jcs.api.entity.*; import com.yeejoin.amos.boot.module.jcs.api.entity.*;
import com.yeejoin.amos.boot.module.jcs.api.enums.*; import com.yeejoin.amos.boot.module.jcs.api.enums.*;
import com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper;
...@@ -137,6 +136,8 @@ import com.yeejoin.amos.feign.systemctl.Systemctl; ...@@ -137,6 +136,8 @@ import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.ws.rs.HEAD;
/** /**
* 警情报送记录 服务实现类 * 警情报送记录 服务实现类
...@@ -239,6 +240,33 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -239,6 +240,33 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
private String topicJa; private String topicJa;
private final String msgType = "jcs119"; private final String msgType = "jcs119";
//定义常量 规避SonarLint检验
private String recDate = "recDate";
private String companyName = "companyName";
private String usIds = "usIds";
private String amosUserId = "amosUserId";
private String airportPost = "airportPost";
private String callTimeStr = "callTimeStr";
private String address = "address";
private String trappedNum = "trappedNum";
private String casualtiesNum = "casualtiesNum";
private String contactUser = "contactUser";
private String contactPhone = "contactPhone";
private String alertType = "alertType";
private String alterId = "alterId";
private String sendTime = "sendTime";
private String editContent = "editContent";
private String arrivalTime = "arrivalTime";
private String waterNum = "waterNum";
private String foamNum = "foamNum";
private String airportUnit = "airportUnit";
private String userId = "userId";
private String userName = "userName";
private String resourceNum = "resourcesNum";
private String mobilePhone = "mobilePhone";
private String amosId = "amosId";
@Override @Override
public SchedulingReportingDto listSchedulingByParam(AlertSubmittedDto queryParam) { public SchedulingReportingDto listSchedulingByParam(AlertSubmittedDto queryParam) {
...@@ -303,19 +331,18 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -303,19 +331,18 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
definitions.put("$callTime", DateUtils.convertDateToString(alertCalled.getCallTime(),DateUtils.DATE_TIME_PATTERN)); definitions.put("$callTime", DateUtils.convertDateToString(alertCalled.getCallTime(),DateUtils.DATE_TIME_PATTERN));
definitions.put("$replaceContent",replaceContent); definitions.put("$replaceContent",replaceContent);
definitions.put("$address",ValidationUtil.isEmpty(alertCalled.getAddress()) ? "" : alertCalled.getAddress()); definitions.put("$address",ValidationUtil.isEmpty(alertCalled.getAddress()) ? "" : alertCalled.getAddress());
// definitions.put("$recDate",DateUtils.dateTimeToDateString(alertCalled.getUpdateTime()));
definitions.put("$contactUser",ValidationUtil.isEmpty(alertCalled.getContactUser()) ? "" : alertCalled.getContactUser()); definitions.put("$contactUser",ValidationUtil.isEmpty(alertCalled.getContactUser()) ? "" : alertCalled.getContactUser());
definitions.put("$trappedNum",ValidationUtil.isEmpty(alertCalledRo.getTrappedNum()) ? "" : String.valueOf(alertCalled.getTrappedNum())); definitions.put("$trappedNum",ValidationUtil.isEmpty(alertCalledRo.getTrappedNum()) ? "" : String.valueOf(alertCalled.getTrappedNum()));
definitions.put("$casualtiesNum",ValidationUtil.isEmpty(alertCalled.getCasualtiesNum()) ? "" : String.valueOf(alertCalled.getCasualtiesNum())); definitions.put("$casualtiesNum",ValidationUtil.isEmpty(alertCalled.getCasualtiesNum()) ? "" : String.valueOf(alertCalled.getCasualtiesNum()));
definitions.put("$contactPhone",ValidationUtil.isEmpty(alertCalled.getContactPhone()) ? "" : alertCalled.getContactPhone()); definitions.put("$contactPhone",ValidationUtil.isEmpty(alertCalled.getContactPhone()) ? "" : alertCalled.getContactPhone());
String companyName = JSON.parseObject(alertSubmittedExtDto.getSubmissionContent()).getString("$companyName") ; String company = JSON.parseObject(alertSubmittedExtDto.getSubmissionContent()).getString("$companyName") ;
JSONObject jsonObject = null; JSONObject jsonObject = null;
if(!ValidationUtil.isEmpty(alertCalled.getUpdateTime())) { if(!ValidationUtil.isEmpty(alertCalled.getUpdateTime())) {
jsonObject = JSON.parseObject(alertSubmittedExtDto.getSubmissionContent()); jsonObject = JSON.parseObject(alertSubmittedExtDto.getSubmissionContent());
jsonObject.put("recDate",DateUtils.convertDateToString(alertCalled.getUpdateTime(), DateUtils.DATE_TIME_PATTERN)); jsonObject.put(recDate,DateUtils.convertDateToString(alertCalled.getUpdateTime(), DateUtils.DATE_TIME_PATTERN));
} }
if(jsonObject != null) { if(jsonObject != null) {
...@@ -323,7 +350,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -323,7 +350,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} }
definitions.put("$companyName", null == companyName ? "" : companyName); definitions.put("$companyName", null == company ? "" : company);
String content = getTaskInformation( template.getRichContent(),definitions); String content = getTaskInformation( template.getRichContent(),definitions);
...@@ -343,23 +370,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -343,23 +370,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean save(AlertSubmittedDto alertSubmittedDto, String userName) { public Boolean save(AlertSubmittedDto alertSubmittedDto, String userName) {
try { try {
String company = ValidationUtil.isEmpty(alertSubmittedDto.getSubmitContent().get("companyName")) ? "" : alertSubmittedDto.getSubmitContent().get("companyName").toString() ; String company = ValidationUtil.isEmpty(alertSubmittedDto.getSubmitContent().get(companyName)) ? "" : alertSubmittedDto.getSubmitContent().get(companyName).toString() ;
Map<String,String> map = saveAlertSubmitted(alertSubmittedDto, userName); Map<String,String> map = saveAlertSubmitted(alertSubmittedDto, userName);
// 组装规则入参 // 组装规则入参
AlertCalled alertCalled = alertCalledService.getById(alertSubmittedDto.getAlertCalledId()); AlertCalled alertCalled = alertCalledService.getById(alertSubmittedDto.getAlertCalledId());
alertCalled.setCompanyName(company); alertCalled.setCompanyName(company);
// if(AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
//// alertCalled.setEndTimeStr()
//// }
AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService.selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr()); AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService.selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr());
alertCalledVo.setAlertCalled(alertCalled); alertCalledVo.setAlertCalled(alertCalled);
// 调用规则 // 调用规则
ruleAlertCalledService.fireAlertCalledRule(alertCalledVo, map.get("alertWay"),map.get("mobiles"), map.get("usIds"), map.get("feedBack")); ruleAlertCalledService.fireAlertCalledRule(alertCalledVo, map.get("alertWay"),map.get("mobiles"), map.get(usIds), map.get("feedBack"));
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化 //通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(powertopic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true); emqKeeper.getMqttClient().publish(powertopic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
...@@ -379,7 +404,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -379,7 +404,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} catch (Exception e) { } catch (Exception e) {
log.info("规则调用失败"); log.info("规则调用失败");
} }
} }
ESAlertCalled esAlertCalled = esAlertCalledService.queryById(alertSubmittedDto.getAlertCalledId()); ESAlertCalled esAlertCalled = esAlertCalledService.queryById(alertSubmittedDto.getAlertCalledId());
if (alertCalled.getAlertStatus()) if (alertCalled.getAlertStatus())
...@@ -397,6 +421,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -397,6 +421,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
return true; return true;
} }
/** /**
* 规则回调 * 规则回调
*/ */
...@@ -421,10 +447,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -421,10 +447,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
AlertCalledObjsDto alertCalledObjsDto = (AlertCalledObjsDto)alertCalledService.selectAlertCalledByIdNoRedisNew(Long.valueOf(calledRo.getSequenceNbr())); AlertCalledObjsDto alertCalledObjsDto = (AlertCalledObjsDto)alertCalledService.selectAlertCalledByIdNoRedisNew(Long.valueOf(calledRo.getSequenceNbr()));
alertCalled = alertCalledObjsDto.getAlertCalled(); alertCalled = alertCalledObjsDto.getAlertCalled();
// AlertCalledRo tempCalledRo = new AlertCalledRo();
// RuleAlertCalledService.init(tempCalledRo,alertCalledObjsDto);
// BeanUtils.copyProperties(tempCalledRo,calledRo,"feedback","usIds","ids","alertWay","replaceContent","unitInvolved","alertSubmittedId");
String alertTypeCode = calledRo.getAlertTypeCode(); String alertTypeCode = calledRo.getAlertTypeCode();
alertWay = calledRo.getAlertWay(); alertWay = calledRo.getAlertWay();
String unitInvolved = calledRo.getUnitInvolved(); String unitInvolved = calledRo.getUnitInvolved();
...@@ -459,8 +481,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -459,8 +481,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
map.put(telephone,f.getMobilePhone()); map.put(telephone,f.getMobilePhone());
map.put(sequenceNbr,f.getSequenceNbr()); map.put(sequenceNbr,f.getSequenceNbr());
map.put("bizOrgName",f.getName()); map.put("bizOrgName",f.getName());
map.put("amosUserId",f.getAmosUserId()); map.put(amosUserId,f.getAmosUserId());
map.put("companyName", e.get("name").toString()); map.put(companyName, e.get("name").toString());
orgUsers.add(map); orgUsers.add(map);
}); });
...@@ -473,45 +495,39 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -473,45 +495,39 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} }
// 安运部 // 安运部
if(e.get("type").toString().equals("AY")) { if(e.get("type").toString().equals("AY") && e.containsKey("name")) {
if(e.containsKey("name")) { String [] arr = e.get(airportPost).toString().split(",");
String [] arr = e.get("airportPost").toString().split(",");
List<String> list = Arrays.asList(arr); List<String> list = Arrays.asList(arr);
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId(e.get("name").toString(),list); List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId(e.get("name").toString(),list);
orgUsers.addAll(mapList); orgUsers.addAll(mapList);
}
} }
// 事发单位 // 事发单位
if(e.get("type").toString().equals("SF")) { if(e.get("type").toString().equals("SF") && e.containsKey(airportPost)) {
if(e.containsKey("airportPost")) { String [] arr = e.get(airportPost).toString().split(",");
String [] arr = e.get("airportPost").toString().split(",");
List<String> list = Arrays.asList(arr); List<String> list = Arrays.asList(arr);
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId(unitInvolved,list); List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId(unitInvolved,list);
orgUsers.addAll(mapList); orgUsers.addAll(mapList);
} }
} }
}
// 突发事件救援 // 漏油现场安全保障 // 专机保障 // 其他 // 突发事件救援 // 漏油现场安全保障 // 专机保障 // 其他
if(alertTypeCode.equals(AlertStageEnums.TFSJ.getCode()) || alertTypeCode.equals(AlertStageEnums.LYXC.getCode()) if((alertTypeCode.equals(AlertStageEnums.TFSJ.getCode()) || alertTypeCode.equals(AlertStageEnums.LYXC.getCode())
|| alertTypeCode.equals(AlertStageEnums.ZJBZ.getCode()) || alertTypeCode.equals(AlertStageEnums.QTJQ.getCode())) { || alertTypeCode.equals(AlertStageEnums.ZJBZ.getCode()) || alertTypeCode.equals(AlertStageEnums.QTJQ.getCode())) && e.containsKey(onDuty)) {
if(e.containsKey(onDuty)) {
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew(e.get("name").toString()); List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew(e.get("name").toString());
orgUsers.addAll(mapList); orgUsers.addAll(mapList);
}
} }
// 120急救 // 120急救
if(alertTypeCode.equals(AlertStageEnums.JJJQ.getCode())) { if(alertTypeCode.equals(AlertStageEnums.JJJQ.getCode()) && e.containsKey("name")) {
if (e.containsKey("name")) {
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew(e.get("name").toString()); List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew(e.get("name").toString());
orgUsers.addAll(mapList); orgUsers.addAll(mapList);
List<Map<String, Object>> mapList1 = iOrgUsrService.queryCompanyIdNew(e.get("name").toString()); List<Map<String, Object>> mapList1 = iOrgUsrService.queryCompanyIdNew(e.get("name").toString());
orgUsers.addAll(mapList1); orgUsers.addAll(mapList1);
}
} }
}); });
...@@ -553,9 +569,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -553,9 +569,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
AlertSubmitted alertSubmittedNew = null; AlertSubmitted alertSubmittedNew = null;
// Optional<AlertBusinessTypeEnum> alertBusinessTypeEnum = // Optional<AlertBusinessTypeEnum> alertBusinessTypeEnum =
// EnumsUtils.getEnumObject(AlertBusinessTypeEnum.class, // EnumsUtils.getEnumObject(AlertBusinessTypeEnum.class,
// e -> e.getCode().equals(calledRo.getAlertTypeCode()));
// smsCode = alertBusinessTypeEnum.get().getSms_code();
if(!alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) { if(!alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) {
LambdaQueryWrapper<AlertSubmitted> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AlertSubmitted> queryWrapper = new LambdaQueryWrapper<>();
...@@ -578,15 +591,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -578,15 +591,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
} }
if (!ValidationUtil.isEmpty(orgUser.get("amosUserId"))) { if (!ValidationUtil.isEmpty(orgUser.get(amosUserId))) {
usIds.add(orgUser.get("amosUserId").toString()); 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))));
alertSubmittedObject.setTheUser((String) orgUser.get("bizOrgName")); alertSubmittedObject.setTheUser((String) orgUser.get("bizOrgName"));
alertSubmittedObject.setCompanyName((String) orgUser.get("companyName")); alertSubmittedObject.setCompanyName((String) orgUser.get(companyName));
if (!ValidationUtil.isEmpty(orgUser.get(telephone))) { if (!ValidationUtil.isEmpty(orgUser.get(telephone))) {
mobiles.add(orgUser.get(telephone).toString()); mobiles.add(orgUser.get(telephone).toString());
...@@ -596,20 +609,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -596,20 +609,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} }
// 组装报送内容 // 组装报送内容
smsParams.put("callTimeStr", calledRo.getCallTimeStr()); smsParams.put(callTimeStr, calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress()); smsParams.put(address, calledRo.getAddress());
smsParams.put("fireLocation", calledRo.getFireLocation()); smsParams.put("fireLocation", calledRo.getFireLocation());
smsParams.put("endTimeStr", !ValidationUtil.isEmpty(alertCalled.getUpdateTime()) ? DateUtils.convertDateToString(alertCalled.getUpdateTime(),DateUtils.DATE_TIME_PATTERN) : ""); smsParams.put("endTimeStr", !ValidationUtil.isEmpty(alertCalled.getUpdateTime()) ? DateUtils.convertDateToString(alertCalled.getUpdateTime(),DateUtils.DATE_TIME_PATTERN) : "");
smsParams.put("burningMaterial", calledRo.getBurningMaterial()); smsParams.put("burningMaterial", calledRo.getBurningMaterial());
smsParams.put("fireSituation", calledRo.getFireSituation()); smsParams.put("fireSituation", calledRo.getFireSituation());
smsParams.put("trappedNum", calledRo.getTrappedNum()); smsParams.put(trappedNum, calledRo.getTrappedNum());
smsParams.put("casualtiesNum", calledRo.getCasualtiesNum()); smsParams.put(casualtiesNum, calledRo.getCasualtiesNum());
smsParams.put("dangerousExplosives", calledRo.getDangerousExplosives()); smsParams.put("dangerousExplosives", calledRo.getDangerousExplosives());
smsParams.put("companyName", calledRo.getCompanyName()); smsParams.put(companyName, calledRo.getCompanyName());
smsParams.put("contactUser", alertCalled.getContactUser()); smsParams.put(contactUser, alertCalled.getContactUser());
smsParams.put("contactPhone", alertCalled.getContactPhone()); smsParams.put(contactPhone, alertCalled.getContactPhone());
smsParams.put("replaceContent", calledRo.getReplaceContent()); smsParams.put("replaceContent", calledRo.getReplaceContent());
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put(alertType, calledRo.getAlertType());
smsParams.put("feedback", calledRo.getFeedback()); smsParams.put("feedback", calledRo.getFeedback());
} }
// 短信报送对象 // 短信报送对象
...@@ -619,15 +632,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -619,15 +632,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 调用短信发送接口 // 调用短信发送接口
Map<String,String> besidesMap = new HashMap<>(); Map<String,String> besidesMap = new HashMap<>();
besidesMap.put("alterId",String.valueOf(alertCalled.getSequenceNbr())); 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)); besidesMap.put(sendTime, DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情初报.getCode(),besidesMap,smsParams,usIds, null); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情初报.getCode(),besidesMap,smsParams,usIds, null);
} else { } else {
if(alertWay.equals(AlertBusinessTypeEnum.警情续报.getCode())) { if(alertWay.equals(AlertBusinessTypeEnum.警情续报.getCode())) {
besidesMap.put("sendTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN)); besidesMap.put(sendTime, DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情续报.getCode(),besidesMap,smsParams,usIds, null); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情续报.getCode(),besidesMap,smsParams,usIds, null);
} }
...@@ -657,7 +670,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -657,7 +670,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
* @param alertSubmittedDto 警情信息 * @param alertSubmittedDto 警情信息
* @param userName 用户名 * @param userName 用户名
*/ */
@Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
@Autowired
public Map<String,String> saveAlertSubmitted(AlertSubmittedDto alertSubmittedDto, String userName) { public Map<String,String> saveAlertSubmitted(AlertSubmittedDto alertSubmittedDto, String userName) {
try { Long alertSubmittedId = alertSubmittedDto.getSequenceNbr(); try { Long alertSubmittedId = alertSubmittedDto.getSequenceNbr();
String alertWay = ""; String alertWay = "";
...@@ -676,23 +690,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -676,23 +690,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Optional<AlertBusinessTypeEnum> businessTypeEnum = EnumsUtils.getEnumObject(AlertBusinessTypeEnum.class, Optional<AlertBusinessTypeEnum> businessTypeEnum = EnumsUtils.getEnumObject(AlertBusinessTypeEnum.class,
e -> e.getCode().equals(bussTypeCode)); e -> e.getCode().equals(bussTypeCode));
alertSubmitted.setBusinessType(businessTypeEnum.get().getName()); alertSubmitted.setBusinessType(businessTypeEnum.isPresent()? businessTypeEnum.get().getName():null);
alertSubmitted.setCallLogId(alertSubmittedDto.getCallLogId()); alertSubmitted.setCallLogId(alertSubmittedDto.getCallLogId());
alertSubmitted.setRecDate(alertSubmittedDto.getRecDate()); alertSubmitted.setRecDate(alertSubmittedDto.getRecDate());
alertSubmitted.setSubmissionMethodCode(alertSubmittedDto.getSubmissionMethodCode()); alertSubmitted.setSubmissionMethodCode(alertSubmittedDto.getSubmissionMethodCode());
Optional<SubmissionMethodEnum> submissionMethodEnum = EnumsUtils.getEnumObject(SubmissionMethodEnum.class, Optional<SubmissionMethodEnum> submissionMethodEnum = EnumsUtils.getEnumObject(SubmissionMethodEnum.class,
e -> e.getCode().equals(alertSubmittedDto.getSubmissionMethodCode())); e -> e.getCode().equals(alertSubmittedDto.getSubmissionMethodCode()));
alertSubmitted.setSubmissionMethod(submissionMethodEnum.get().getName()); alertSubmitted.setSubmissionMethod(submissionMethodEnum.map(SubmissionMethodEnum::getName).orElse(null));
Optional<AlertSchedulingTypeEnum> alertSchedulingTypeEnum = Optional<AlertSchedulingTypeEnum> alertSchedulingTypeEnum =
EnumsUtils.getEnumObject(AlertSchedulingTypeEnum.class, EnumsUtils.getEnumObject(AlertSchedulingTypeEnum.class,
e -> e.getCode().equals(alertSubmittedDto.getSchedulingTypeCode())); e -> e.getCode().equals(alertSubmittedDto.getSchedulingTypeCode()));
alertSubmitted.setSchedulingTypeCode(alertSubmittedDto.getSchedulingTypeCode()); alertSubmitted.setSchedulingTypeCode(alertSubmittedDto.getSchedulingTypeCode());
alertSubmitted.setSchedulingType(alertSchedulingTypeEnum.get().getName()); alertSubmitted.setSchedulingType(alertSchedulingTypeEnum.map(AlertSchedulingTypeEnum::getName).orElse(null));
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日 // 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
alertSubmitted.setBusinessTypeCode(alertSubmittedDto.getBusinessTypeCode()); alertSubmitted.setBusinessTypeCode(alertSubmittedDto.getBusinessTypeCode());
alertSubmittedDto.getSubmitContent().get("recDate").toString(); alertSubmittedDto.getSubmitContent().get(recDate).toString();
endDate = DateUtils.dateParse(alertSubmittedDto.getSubmitContent().get("recDate").toString(),DateUtils.HOUR_PATTERN); //endDate = DateUtils.dateParse(alertSubmittedDto.getSubmitContent().get(recDate).toString(),DateUtils.HOUR_PATTERN);
alertSubmitted.setSubmissionContent(alertSubmittedDto.getSubmitContent().toJSONString()); alertSubmitted.setSubmissionContent(alertSubmittedDto.getSubmitContent().toJSONString());
...@@ -746,18 +760,18 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -746,18 +760,18 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 查询AmousUserId // 查询AmousUserId
LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(true, OrgUsr::getSequenceNbr, userIds); queryWrapper.in(true, OrgUsr::getSequenceNbr, userIds);
List<String> usIds = new ArrayList<>(); List<String> ids = new ArrayList<>();
List<OrgUsr> list = orgUsrService.getBaseMapper().selectList(queryWrapper); List<OrgUsr> list = orgUsrService.getBaseMapper().selectList(queryWrapper);
if(null != list && list.size() > 0) { if(null != list && list.size() > 0) {
list.stream().forEach(e->{ list.stream().forEach(e->{
if(!ValidationUtil.isEmpty(e.getAmosOrgId())) { if(!ValidationUtil.isEmpty(e.getAmosOrgId())) {
usIds.add(e.getAmosOrgId()); ids.add(e.getAmosOrgId());
} }
}); });
map.put("usIds", StringUtils.join(usIds.toArray(new String[userIds.size()]),",")); map.put(usIds, StringUtils.join(ids.toArray(new String[userIds.size()]),","));
} else { } else {
map.put("usIds", ""); map.put(usIds, "");
} }
for(AlertSubmittedObject object :alertSubmittedObjectList ) { for(AlertSubmittedObject object :alertSubmittedObjectList ) {
...@@ -781,9 +795,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -781,9 +795,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
AlertCalledFormDto alertCalledFormDto = (AlertCalledFormDto)alertCalledService.selectAlertCalledById(alertSubmittedDto.getAlertCalledId()); AlertCalledFormDto alertCalledFormDto = (AlertCalledFormDto)alertCalledService.selectAlertCalledById(alertSubmittedDto.getAlertCalledId());
AlertCalled alertCalled = alertCalledFormDto.getAlertCalled(); AlertCalled alertCalled = alertCalledFormDto.getAlertCalled();
generateMob(alertCalled); generateMob(alertCalled);
} catch (FileNotFoundException e) { } catch (Exception e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
...@@ -856,7 +868,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -856,7 +868,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
JSONObject submitContent = alertSubmittedDto.getSubmitContent(); JSONObject submitContent = alertSubmittedDto.getSubmitContent();
String feedBack = submitContent.get("editContent") != null ? submitContent.get("editContent").toString(): ""; String feedBack = submitContent.get(editContent) != null ? submitContent.get(editContent).toString(): "";
// 4.2调用短信发送接口 废弃 // 4.2调用短信发送接口 废弃
...@@ -905,7 +917,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -905,7 +917,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} }
handleFunc(dto,first.get(i)); handleFunc(dto,first.get(i));
LocalDateTime dateTime = (LocalDateTime)first.get(i).get("recDate"); LocalDateTime dateTime = (LocalDateTime)first.get(i).get(recDate);
Date date = Date.from(dateTime.toInstant(ZoneOffset.of("+8"))); Date date = Date.from(dateTime.toInstant(ZoneOffset.of("+8")));
report.setToTime((DateUtils.dateFormat(date,DateUtils.HOUR_PATTERN))); report.setToTime((DateUtils.dateFormat(date,DateUtils.HOUR_PATTERN)));
...@@ -914,16 +926,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -914,16 +926,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if (!ObjectUtils.isEmpty(dto.getPersonNum())){ if (!ObjectUtils.isEmpty(dto.getPersonNum())){
totalPeople = totalPeople.add(new BigDecimal(dto.getPersonNum())); totalPeople = totalPeople.add(new BigDecimal(dto.getPersonNum()));
} }
if (!ObjectUtils.isEmpty(first.get(i).get("arrivalTime"))){ if (!ObjectUtils.isEmpty(first.get(i).get(arrivalTime))){
dto.setArriveTime(first.get(i).get("arrivalTime").toString()); dto.setArriveTime(first.get(i).get(arrivalTime).toString());
if (!ObjectUtils.isEmpty(report.getArriveTime())){ if (!ObjectUtils.isEmpty(report.getArriveTime())){
Date parseOld = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(report.getArriveTime()); Date parseOld = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(report.getArriveTime());
Date parseNew = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(first.get(i).get("arrivalTime").toString()); Date parseNew = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(first.get(i).get(arrivalTime).toString());
if (parseNew.getTime() < parseOld.getTime()){ if (parseNew.getTime() < parseOld.getTime()){
report.setArriveTime(first.get(i).get("arrivalTime").toString()); report.setArriveTime(first.get(i).get(arrivalTime).toString());
} }
}else { }else {
report.setArriveTime(first.get(i).get("arrivalTime").toString()); report.setArriveTime(first.get(i).get(arrivalTime).toString());
} }
} }
...@@ -932,15 +944,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -932,15 +944,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if (!ObjectUtils.isEmpty(first.get(i).get("id"))){ if (!ObjectUtils.isEmpty(first.get(i).get("id"))){
longs.add(Long.valueOf(first.get(i).get("id").toString())); longs.add(Long.valueOf(first.get(i).get("id").toString()));
ResponseModel<Map<String, Object>> carPropertyByCarIds = equipFeignClient.getCarPropertyByCarIds(longs); ResponseModel<Map<String, Object>> carPropertyByCarIds = equipFeignClient.getCarPropertyByCarIds(longs);
if (!ObjectUtils.isEmpty(carPropertyByCarIds.getResult().get("waterNum"))){ if (!ObjectUtils.isEmpty(carPropertyByCarIds.getResult().get(waterNum))){
dto.setWater(String.valueOf(carPropertyByCarIds.getResult().get("waterNum"))); dto.setWater(String.valueOf(carPropertyByCarIds.getResult().get(waterNum)));
totalWater = totalWater.add(new BigDecimal(String.valueOf(carPropertyByCarIds.getResult().get("waterNum")))); totalWater = totalWater.add(new BigDecimal(String.valueOf(carPropertyByCarIds.getResult().get(waterNum))));
}else { }else {
dto.setWater("0"); dto.setWater("0");
} }
if (!ObjectUtils.isEmpty(carPropertyByCarIds.getResult().get("foamNum"))){ if (!ObjectUtils.isEmpty(carPropertyByCarIds.getResult().get(foamNum))){
dto.setFoam(String.valueOf(carPropertyByCarIds.getResult().get("foamNum"))); dto.setFoam(String.valueOf(carPropertyByCarIds.getResult().get(foamNum)));
totalFoam = totalFoam.add(new BigDecimal(String.valueOf(carPropertyByCarIds.getResult().get("foamNum")))); totalFoam = totalFoam.add(new BigDecimal(String.valueOf(carPropertyByCarIds.getResult().get(foamNum))));
}else { }else {
dto.setFoam("0"); dto.setFoam("0");
} }
...@@ -956,16 +968,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -956,16 +968,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if (!ObjectUtils.isEmpty(dto.getPersonNum())){ if (!ObjectUtils.isEmpty(dto.getPersonNum())){
totalPeople = totalPeople.add(new BigDecimal(dto.getPersonNum())); totalPeople = totalPeople.add(new BigDecimal(dto.getPersonNum()));
} }
if (!ObjectUtils.isEmpty(other.get(i).get("arrivalTime"))){ if (!ObjectUtils.isEmpty(other.get(i).get(arrivalTime))){
dto.setArriveTime(other.get(i).get("arrivalTime").toString()); dto.setArriveTime(other.get(i).get(arrivalTime).toString());
if (!ObjectUtils.isEmpty(report.getArriveTime())){ if (!ObjectUtils.isEmpty(report.getArriveTime())){
Date parseOld = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(report.getArriveTime()); Date parseOld = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(report.getArriveTime());
Date parseNew = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(other.get(i).get("arrivalTime").toString()); Date parseNew = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(other.get(i).get(arrivalTime).toString());
if (parseNew.getTime() < parseOld.getTime()){ if (parseNew.getTime() < parseOld.getTime()){
report.setArriveTime(other.get(i).get("arrivalTime").toString()); report.setArriveTime(other.get(i).get(arrivalTime).toString());
} }
}else { }else {
report.setArriveTime(other.get(i).get("arrivalTime").toString()); report.setArriveTime(other.get(i).get(arrivalTime).toString());
} }
} }
...@@ -974,15 +986,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -974,15 +986,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if (!ObjectUtils.isEmpty(other.get(i).get("id"))){ if (!ObjectUtils.isEmpty(other.get(i).get("id"))){
longs.add(Long.valueOf(other.get(i).get("id").toString())); longs.add(Long.valueOf(other.get(i).get("id").toString()));
ResponseModel<Map<String, Object>> carPropertyByCarIds = equipFeignClient.getCarPropertyByCarIds(longs); ResponseModel<Map<String, Object>> carPropertyByCarIds = equipFeignClient.getCarPropertyByCarIds(longs);
if (!ObjectUtils.isEmpty(carPropertyByCarIds.getResult().get("waterNum"))){ if (!ObjectUtils.isEmpty(carPropertyByCarIds.getResult().get(waterNum))){
dto.setWater(String.valueOf(carPropertyByCarIds.getResult().get("waterNum"))); dto.setWater(String.valueOf(carPropertyByCarIds.getResult().get(waterNum)));
totalWater = totalWater.add(new BigDecimal(String.valueOf(carPropertyByCarIds.getResult().get("waterNum")))); totalWater = totalWater.add(new BigDecimal(String.valueOf(carPropertyByCarIds.getResult().get(waterNum))));
}else { }else {
dto.setWater("0"); dto.setWater("0");
} }
if (!ObjectUtils.isEmpty(carPropertyByCarIds.getResult().get("foamNum"))){ if (!ObjectUtils.isEmpty(carPropertyByCarIds.getResult().get(foamNum))){
dto.setFoam(String.valueOf(carPropertyByCarIds.getResult().get("foamNum"))); dto.setFoam(String.valueOf(carPropertyByCarIds.getResult().get(foamNum)));
totalFoam = totalFoam.add(new BigDecimal(String.valueOf(carPropertyByCarIds.getResult().get("foamNum")))); totalFoam = totalFoam.add(new BigDecimal(String.valueOf(carPropertyByCarIds.getResult().get(foamNum))));
}else { }else {
dto.setFoam("0"); dto.setFoam("0");
} }
...@@ -1009,7 +1021,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1009,7 +1021,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
report.setTotalWater(String.valueOf(totalWater)); report.setTotalWater(String.valueOf(totalWater));
report.setTotalFoam(String.valueOf(totalFoam)); report.setTotalFoam(String.valueOf(totalFoam));
report.setTotalPeople(String.valueOf(totalPeople)); report.setTotalPeople(String.valueOf(totalPeople));
...@@ -1081,11 +1092,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1081,11 +1092,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
document.saveToFile(pa1, FileFormat.Doc); document.saveToFile(pa1, FileFormat.Doc);
} else { } else {
document.loadFromFile(fileName); document.loadFromFile(fileName);
newFileName = "/opt/file/" + System.currentTimeMillis()+".doc"; newFileName = "/opt/file/" + System.currentTimeMillis()+".doc";
document.saveToFile(newFileName, FileFormat.Doc); document.saveToFile(newFileName, FileFormat.Doc);
pa1 = newFileName; pa1 = newFileName;
} }
log.warn(pa1);
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFile(WordConverterUtils.fileToMultipartFile(new File(pa1))); FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFile(WordConverterUtils.fileToMultipartFile(new File(pa1)));
if (date != null) { if (date != null) {
...@@ -1096,6 +1109,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1096,6 +1109,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} }
} }
log.warn(urlString);
// 更新警情信息 // 更新警情信息
alertCalled.setRecordUrl(urlString); alertCalled.setRecordUrl(urlString);
alertCalledService.updateById(alertCalled); alertCalledService.updateById(alertCalled);
...@@ -1128,7 +1143,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1128,7 +1143,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
dto.setCarName(map.get("carName").toString()); dto.setCarName(map.get("carName").toString());
} }
dto.setStation(map.get("companyName").toString()); dto.setStation(map.get(companyName).toString());
// 随车人员 // 随车人员
if (map.containsKey("id")) { if (map.containsKey("id")) {
List<PowerData> powerDataOne = powerTransferMapper.getPowerDataOne(Long.valueOf(map.get("id").toString())); List<PowerData> powerDataOne = powerTransferMapper.getPowerDataOne(Long.valueOf(map.get("id").toString()));
...@@ -1313,8 +1328,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1313,8 +1328,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
public void getAlertSubmittedContent(Long alertCalledId, ArrayList<TemplateDto> templateDtos, String companyName) throws IllegalAccessException, ParseException { public void getAlertSubmittedContent(Long alertCalledId, ArrayList<TemplateDto> templateDtos, String companyName) throws IllegalAccessException, ParseException {
AlertCalled alertCalled = alertCalledService.getById(alertCalledId); AlertCalled alertCalled = alertCalledService.getById(alertCalledId);
Map<String, Object> map = objectToMap(alertCalled); Map<String, Object> map = objectToMap(alertCalled);
map.put("companyName", companyName); map.put(companyName, companyName);
map.put("editContent", "可自编辑续报内容"); map.put(editContent, "可自编辑续报内容");
AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService.selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr()); AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService.selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr());
...@@ -1340,9 +1355,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1340,9 +1355,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
definitions.put("$contactUser",ValidationUtil.isEmpty(alertCalled.getContactUser()) ? "" : alertCalled.getContactUser() ); definitions.put("$contactUser",ValidationUtil.isEmpty(alertCalled.getContactUser()) ? "" : alertCalled.getContactUser() );
definitions.put("$contactPhone",ValidationUtil.isEmpty(alertCalled.getContactPhone()) ? "" : alertCalled.getContactPhone() ); definitions.put("$contactPhone",ValidationUtil.isEmpty(alertCalled.getContactPhone()) ? "" : alertCalled.getContactPhone() );
if(alertCalled.getAlertStatus()) { if(alertCalled.getAlertStatus()) {
map.put("recDate",DateUtils.convertDateToString(alertCalled.getUpdateTime(), DateUtils.DATE_TIME_PATTERN)); map.put(recDate,DateUtils.convertDateToString(alertCalled.getUpdateTime(), DateUtils.DATE_TIME_PATTERN));
} else { } else {
map.put("recDate",DateUtils.convertDateToString(new Date(), DateUtils.DATE_TIME_PATTERN)); map.put(recDate,DateUtils.convertDateToString(new Date(), DateUtils.DATE_TIME_PATTERN));
} }
String content = getTaskInformation( template.getContent(),definitions); String content = getTaskInformation( template.getContent(),definitions);
...@@ -1404,12 +1419,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1404,12 +1419,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
case "警情初报": case "警情初报":
content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," + js.getString("address") + "发生" + js.getString("alertType"); content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," + js.getString(address) + "发生" + js.getString(alertType);
break; break;
case "警情续报": case "警情续报":
content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," + "现场被困人数:" + js.getString("trappedNum") + "人伤亡人数:" + js.getString("casualtiesNum") + "人。"; content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," + "现场被困人数:" + js.getString(trappedNum) + "人伤亡人数:" + js.getString(casualtiesNum) + "人。";
break; break;
case "非警情确认": case "非警情确认":
...@@ -1560,9 +1575,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1560,9 +1575,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
sendIds.stream().forEach(e -> { sendIds.stream().forEach(e -> {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(e)); JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(e));
// 消救部 // 消救部
if (jsonObject.containsKey("airportUnit")) { if (jsonObject.containsKey(airportUnit)) {
String departmentName= jsonObject.getString("name"); String departmentName= jsonObject.getString("name");
if (jsonObject.containsKey("airportUnit")) { { if (jsonObject.containsKey(airportUnit)) { {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,null); List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,null);
userIdList.addAll(mapList); userIdList.addAll(mapList);
} }
...@@ -1579,6 +1594,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1579,6 +1594,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
PowerTransferCompanyDto powerDto = JSON.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class); PowerTransferCompanyDto powerDto = JSON.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
Long companyId = powerDto.getCompanyId(); Long companyId = powerDto.getCompanyId();
String companyName = powerDto.getCompanyName(); String companyName = powerDto.getCompanyName();
String company = powerDto.getCompanyName();
StringBuilder resourcesNum = new StringBuilder(); StringBuilder resourcesNum = new StringBuilder();
Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>(); Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>();
FireTeam fireTeam= fireTeamServiceImpl.getById(companyId); FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);
...@@ -1624,10 +1640,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1624,10 +1640,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setCompanyId(companyId); alertSubmittedObject.setCompanyId(companyId);
alertSubmittedObject.setCompanyName(companyName); alertSubmittedObject.setCompanyName(company);
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setUserId(Long.parseLong(orgUser.get("userId").toString())); alertSubmittedObject.setUserId(Long.parseLong(orgUser.get(userId).toString()));
alertSubmittedObject.setTheUser(orgUser.get("userName").toString()); alertSubmittedObject.setTheUser(orgUser.get(userName).toString());
// 将发送人放入 list // 将发送人放入 list
pList.add(orgUser); pList.add(orgUser);
...@@ -1638,15 +1654,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1638,15 +1654,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} }
alertSubmittedObjectList.add(alertSubmittedObject); alertSubmittedObjectList.add(alertSubmittedObject);
} }
smsParams.put("callTimeStr", calledRo.getCallTimeStr()); smsParams.put(callTimeStr, calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress()); smsParams.put(address, calledRo.getAddress());
smsParams.put("content", calledRo.getContent()); smsParams.put("content", calledRo.getContent());
smsParams.put("trappedNum", calledRo.getTrappedNum()); smsParams.put(trappedNum, calledRo.getTrappedNum());
smsParams.put("casualtiesNum", calledRo.getCasualtiesNum()); smsParams.put(casualtiesNum, calledRo.getCasualtiesNum());
smsParams.put("companyName", calledRo.getCompanyName()); smsParams.put(companyName, calledRo.getCompanyName());
smsParams.put("contactUser", calledRo.getContactUser()); smsParams.put(contactUser, calledRo.getContactUser());
smsParams.put("contactPhone", calledRo.getContactPhone()); smsParams.put(contactPhone, calledRo.getContactPhone());
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put(alertType, calledRo.getAlertType());
List<PowerTransferCompanyResourcesDto> list = powerDto List<PowerTransferCompanyResourcesDto> list = powerDto
.getPowerTransferCompanyResourcesDtoList(); .getPowerTransferCompanyResourcesDtoList();
// 查询已绑定车辆人员id // 查询已绑定车辆人员id
...@@ -1662,7 +1678,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1662,7 +1678,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
resourcesNum.append("、"); resourcesNum.append("、");
if (designatedDriver) { if (designatedDriver) {
// 发送单个车辆的信息数据到客户 // 发送单个车辆的信息数据到客户
smsParams.put("resourcesNum", smsParams.put(resourceNum,
resourcesNum.toString()); resourcesNum.toString());
List<AlertSubmittedObject> alertSubmittedObjectListSub = Lists.newArrayList(); List<AlertSubmittedObject> alertSubmittedObjectListSub = Lists.newArrayList();
Map<String, Object> map = dynamicFormInstanceMapper Map<String, Object> map = dynamicFormInstanceMapper
...@@ -1671,49 +1687,49 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1671,49 +1687,49 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObjectSub.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObjectSub.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
alertSubmittedObjectSub.setType(false); alertSubmittedObjectSub.setType(false);
alertSubmittedObjectSub.setCompanyId(companyId); alertSubmittedObjectSub.setCompanyId(companyId);
alertSubmittedObjectSub.setCompanyName(companyName); alertSubmittedObjectSub.setCompanyName(company);
alertSubmittedObjectSub.setType(false); alertSubmittedObjectSub.setType(false);
if(map==null || !map.containsKey("userId")) { if(map==null || !map.containsKey(userId)) {
continue; continue;
} }
alertSubmittedObjectSub.setUserId(Long.parseLong(map.get("userId").toString())); alertSubmittedObjectSub.setUserId(Long.parseLong(map.get(userId).toString()));
alertSubmittedObjectSub.setTheUser(map.get("userName").toString()); alertSubmittedObjectSub.setTheUser(map.get(userName).toString());
// //
pList.add(map); pList.add(map);
Set<String> mobile =null; Set<String> mobile =null;
List<String> userList=null; List<String> userList=null;
if (!ValidationUtil.isEmpty(map.get("mobilePhone"))) { if (!ValidationUtil.isEmpty(map.get(mobilePhone))) {
mobile = new HashSet<String>() { mobile = new HashSet<String>() {
{ {
add(map.get("mobilePhone").toString()); add(map.get(mobilePhone).toString());
} }
}; };
userList=new ArrayList<String>(); userList=new ArrayList<String>();
// 车辆绑定人发送的是待办任务 // 车辆绑定人发送的是待办任务
if(!ValidationUtil.isEmpty(map.get("amosId"))) { if(!ValidationUtil.isEmpty(map.get(amosId))) {
if (!CollectionUtils.isEmpty(userIds)){ if (!CollectionUtils.isEmpty(userIds)){
if (userIds.contains(Long.valueOf(map.get("amosId").toString()))){ if (userIds.contains(Long.valueOf(map.get(amosId).toString()))){
Map<String, String> besidesMap = new HashMap<String, String>(); Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("responseLevelString", responseLevelString); besidesMap.put("responseLevelString", responseLevelString);
besidesMap.put("alterId", alertCalledId); besidesMap.put(alterId, alertCalledId);
ArrayList<String> strings = new ArrayList<>(); ArrayList<String> strings = new ArrayList<>();
strings.add(map.get("amosId").toString()); strings.add(map.get(amosId).toString());
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,strings, RuleConstant.TASK); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,strings, RuleConstant.TASK);
}else { }else {
userList.add(map.get("amosId").toString()); userList.add(map.get(amosId).toString());
} }
}else { }else {
userList.add(map.get("amosId").toString()); userList.add(map.get(amosId).toString());
} }
} }
alertSubmittedObjectSub.setUserPhone(map.get("mobilePhone").toString()); alertSubmittedObjectSub.setUserPhone(map.get(mobilePhone).toString());
} }
alertSubmittedObjectListSub.add(alertSubmittedObjectSub); alertSubmittedObjectListSub.add(alertSubmittedObjectSub);
// 调用短信发送接口 // 调用短信发送接口
alertCalledAction.sendAlertCalleCmd(smsCode, mobile, smsParams); alertCalledAction.sendAlertCalleCmd(smsCode, mobile, smsParams);
Map<String, String> besidesMap = new HashMap<String, String>(); Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("responseLevelString", responseLevelString); besidesMap.put("responseLevelString", responseLevelString);
besidesMap.put("alterId", alertCalledId); besidesMap.put(alterId, alertCalledId);
if(!ValidationUtil.isEmpty(userList)) { if(!ValidationUtil.isEmpty(userList)) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList, null); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList, null);
} }
...@@ -1727,18 +1743,18 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1727,18 +1743,18 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
List<String> userList= new ArrayList<String>(); List<String> userList= new ArrayList<String>();
ArrayList<String> taskUserIds = new ArrayList<>(); ArrayList<String> taskUserIds = new ArrayList<>();
sendUser.stream().forEach(i -> { sendUser.stream().forEach(i -> {
if (i.containsKey("mobilePhone")) { if (i.containsKey(mobilePhone)) {
mobiles.add(i.get("mobilePhone").toString()); mobiles.add(i.get(mobilePhone).toString());
} }
if (i.containsKey("amosId")&& !ValidationUtil.isEmpty(i.get("amosId"))) { if (i.containsKey(amosId)&& !ValidationUtil.isEmpty(i.get(amosId))) {
if (!CollectionUtils.isEmpty(userIds)){ if (!CollectionUtils.isEmpty(userIds)){
if (userIds.contains(Long.valueOf(i.get("amosId").toString()))){ if (userIds.contains(Long.valueOf(i.get(amosId).toString()))){
taskUserIds.add(i.get("amosId").toString()); taskUserIds.add(i.get(amosId).toString());
}else { }else {
userList.add(i.get("amosId").toString()); userList.add(i.get(amosId).toString());
} }
}else { }else {
userList.add(i.get("amosId").toString()); userList.add(i.get(amosId).toString());
} }
} }
...@@ -1747,19 +1763,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1747,19 +1763,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if (!CollectionUtils.isEmpty(taskUserIds)){ if (!CollectionUtils.isEmpty(taskUserIds)){
Map<String, String> besidesMap = new HashMap<String, String>(); Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("responseLevelString", responseLevelString);//响应级别 besidesMap.put("responseLevelString", responseLevelString);//响应级别
besidesMap.put("alterId", alertCalledId); besidesMap.put(alterId, alertCalledId);
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,taskUserIds, RuleConstant.TASK); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,taskUserIds, RuleConstant.TASK);
} }
smsParams.put("resourcesNum", resourcesNumStr); smsParams.put(resourceNum, resourcesNumStr);
// 短信报送对象 // 短信报送对象
// 发送任务消息 // 发送任务消息
// 组织短信内容 // 组织短信内容
// 调用短信发送接口 // 调用短信发送接口
try {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams); alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
} catch (Exception e) {
e.printStackTrace();
}
Map<String, String> besidesMap = new HashMap<String, String>(); Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("responseLevelString", responseLevelString);//响应级别 besidesMap.put("responseLevelString", responseLevelString);//响应级别
besidesMap.put("alterId", alertCalledId); besidesMap.put(alterId, alertCalledId);
if(userList.size()>0) { if(userList.size()>0) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList, null); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList, null);
} }
...@@ -1777,7 +1797,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -1777,7 +1797,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
if(sendUserIds!=null&&sendUserIds.size()>0){ if(sendUserIds!=null&&sendUserIds.size()>0){
for (Map<String, Object> sendUserId : sendUserIds) { for (Map<String, Object> sendUserId : sendUserIds) {
map.put(sendUserId.get("amosId").toString(),sendUserId); map.put(sendUserId.get(amosId).toString(),sendUserId);
} }
} }
Set<Map<String, Object>> set = new HashSet<>(map.values()); Set<Map<String, Object>> set = new HashSet<>(map.values());
...@@ -1811,7 +1831,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -1811,7 +1831,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(e)); JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(e));
if(jsonObject.containsKey("type") &&( (jsonObject.getString("type").equals(AlertStageEnums.ZH.getCode())) || jsonObject.getString("type").equals(AlertStageEnums.XJ.getCode()))) { if(jsonObject.containsKey("type") &&( (jsonObject.getString("type").equals(AlertStageEnums.ZH.getCode())) || jsonObject.getString("type").equals(AlertStageEnums.XJ.getCode()))) {
String departmentName= jsonObject.getString("name"); String departmentName= jsonObject.getString("name");
if (jsonObject.containsKey("airportUnit")) { { if (jsonObject.containsKey(airportUnit)) { {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,null); List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,null);
userIds.addAll(mapList); userIds.addAll(mapList);
} }
...@@ -1826,7 +1846,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -1826,7 +1846,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>(); Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>();
PowerTransferCompanyDto powerDto = JSON.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class); PowerTransferCompanyDto powerDto = JSON.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
Long companyId = powerDto.getCompanyId(); Long companyId = powerDto.getCompanyId();
String companyName = powerDto.getCompanyName(); String company = powerDto.getCompanyName();
FireTeam fireTeam= fireTeamServiceImpl.getById(companyId); FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);
for(Object sendObject:sendIds) { for(Object sendObject:sendIds) {
...@@ -1837,7 +1857,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -1837,7 +1857,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
DateUtils.getDateNowShortStr(), fireTeam.getCompanyName()); DateUtils.getDateNowShortStr(), fireTeam.getCompanyName());
sendUserIds.addAll(dutyList); sendUserIds.addAll(dutyList);
} }
if (jsonObject1.containsKey("airportUnit")) { { if (jsonObject1.containsKey(airportUnit)) { {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff( fireTeam.getCompanyName(),null); List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff( fireTeam.getCompanyName(),null);
sendUserIds.addAll(mapList); sendUserIds.addAll(mapList);
} }
...@@ -1856,10 +1876,10 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -1856,10 +1876,10 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setCompanyId(companyId); alertSubmittedObject.setCompanyId(companyId);
alertSubmittedObject.setCompanyName(companyName); alertSubmittedObject.setCompanyName(company);
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setUserId(Long.parseLong(orgUser.get("userId").toString())); alertSubmittedObject.setUserId(Long.parseLong(orgUser.get(userId).toString()));
alertSubmittedObject.setTheUser(orgUser.get("userName").toString()); alertSubmittedObject.setTheUser(orgUser.get(userName).toString());
pList.add(orgUser); pList.add(orgUser);
if (!ValidationUtil.isEmpty(orgUser.get(telephone))) { if (!ValidationUtil.isEmpty(orgUser.get(telephone))) {
...@@ -1868,31 +1888,31 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -1868,31 +1888,31 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
} }
alertSubmittedObjectList.add(alertSubmittedObject); alertSubmittedObjectList.add(alertSubmittedObject);
} }
smsParams.put("callTimeStr", calledRo.getCallTimeStr()); smsParams.put(callTimeStr, calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress()); smsParams.put(address, calledRo.getAddress());
smsParams.put("content", calledRo.getContent()); smsParams.put("content", calledRo.getContent());
smsParams.put("trappedNum", calledRo.getTrappedNum()); smsParams.put(trappedNum, calledRo.getTrappedNum());
smsParams.put("casualtiesNum", calledRo.getCasualtiesNum()); smsParams.put(casualtiesNum, calledRo.getCasualtiesNum());
smsParams.put("companyName", calledRo.getCompanyName()); smsParams.put(companyName, calledRo.getCompanyName());
smsParams.put("contactUser", calledRo.getContactUser()); smsParams.put(contactUser, calledRo.getContactUser());
smsParams.put("contactPhone", calledRo.getContactPhone()); smsParams.put(contactPhone, calledRo.getContactPhone());
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put(alertType, calledRo.getAlertType());
List<String> userList= new ArrayList<String>(); List<String> userList= new ArrayList<String>();
ArrayList<String> taskUserIds = new ArrayList<>(); ArrayList<String> taskUserIds = new ArrayList<>();
sendUser.stream().forEach(i -> { sendUser.stream().forEach(i -> {
if (i.containsKey("mobilePhone")) { if (i.containsKey(mobilePhone)) {
mobiles.add(i.get("mobilePhone").toString()); mobiles.add(i.get(mobilePhone).toString());
} }
if (i.containsKey("amosId")&& !ValidationUtil.isEmpty(i.get("amosId"))) { if (i.containsKey(amosId)&& !ValidationUtil.isEmpty(i.get(amosId))) {
if (!CollectionUtils.isEmpty(userCarIds)){ if (!CollectionUtils.isEmpty(userCarIds)){
if (userCarIds.contains(Long.valueOf(i.get("amosId").toString()))){ if (userCarIds.contains(Long.valueOf(i.get(amosId).toString()))){
taskUserIds.add(i.get("amosId").toString()); taskUserIds.add(i.get(amosId).toString());
}else { }else {
userList.add(i.get("amosId").toString()); userList.add(i.get(amosId).toString());
} }
}else { }else {
userList.add(i.get("amosId").toString()); userList.add(i.get(amosId).toString());
} }
} }
...@@ -1900,10 +1920,10 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -1900,10 +1920,10 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
// 绑定车辆人员发送的是待办消息 // 绑定车辆人员发送的是待办消息
if (!CollectionUtils.isEmpty(taskUserIds)){ if (!CollectionUtils.isEmpty(taskUserIds)){
Map<String, String> besidesMap = new HashMap<String, String>(); Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("alterId", alertCalledId); besidesMap.put(alterId, alertCalledId);
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,taskUserIds,RuleConstant.TASK); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,taskUserIds,RuleConstant.TASK);
} }
smsParams.put("resourcesNum", companyName); smsParams.put(resourceNum, company);
// 短信报送对象 // 短信报送对象
// 发送任务消息 // 发送任务消息
// 组织短信内容 // 组织短信内容
...@@ -1914,7 +1934,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -1914,7 +1934,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
e.printStackTrace(); e.printStackTrace();
} }
Map<String, String> besidesMap = new HashMap<String, String>(); Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("alterId", alertCalledId); besidesMap.put(alterId, alertCalledId);
if(userList.size()>0) { if(userList.size()>0) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList,null); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList,null);
} }
...@@ -1949,7 +1969,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -1949,7 +1969,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(e)); JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(e));
if(jsonObject.containsKey("type") &&( (jsonObject.getString("type").equals(AlertStageEnums.ZH.getCode())) || jsonObject.getString("type").equals(AlertStageEnums.XJ.getCode()))) { if(jsonObject.containsKey("type") &&( (jsonObject.getString("type").equals(AlertStageEnums.ZH.getCode())) || jsonObject.getString("type").equals(AlertStageEnums.XJ.getCode()))) {
String departmentName= jsonObject.getString("name"); String departmentName= jsonObject.getString("name");
if (jsonObject.containsKey("airportUnit")) { { if (jsonObject.containsKey(airportUnit)) { {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,null); List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,null);
userIds.addAll(mapList); userIds.addAll(mapList);
} }
...@@ -1966,7 +1986,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -1966,7 +1986,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>(); Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>();
PowerTransferCompanyDto powerDto = JSON.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class); PowerTransferCompanyDto powerDto = JSON.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
Long companyId = powerDto.getCompanyId(); Long companyId = powerDto.getCompanyId();
String companyName = powerDto.getCompanyName(); String companyNa = powerDto.getCompanyName();
FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);//这个公司ID实际上是120急救站的id值 FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);//这个公司ID实际上是120急救站的id值
for(Object e:sendIds) { for(Object e:sendIds) {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(e)); JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(e));
...@@ -1993,42 +2013,42 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -1993,42 +2013,42 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject(); AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject();
alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
alertSubmittedObject.setCompanyId(companyId); alertSubmittedObject.setCompanyId(companyId);
alertSubmittedObject.setCompanyName(companyName); alertSubmittedObject.setCompanyName(companyNa);
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setUserId(Long.parseLong(orgUser.get("userId").toString())); alertSubmittedObject.setUserId(Long.parseLong(orgUser.get(userId).toString()));
alertSubmittedObject.setTheUser(orgUser.get("userName").toString()); alertSubmittedObject.setTheUser(orgUser.get(userName).toString());
pList.add(orgUser); pList.add(orgUser);
if (!ValidationUtil.isEmpty(orgUser.get("mobilePhone"))) { if (!ValidationUtil.isEmpty(orgUser.get(mobilePhone))) {
mobiles.add((String) orgUser.get("mobilePhone")); mobiles.add((String) orgUser.get(mobilePhone));
alertSubmittedObject.setUserPhone(orgUser.get("mobilePhone").toString()); alertSubmittedObject.setUserPhone(orgUser.get(mobilePhone).toString());
} }
alertSubmittedObjectList.add(alertSubmittedObject); alertSubmittedObjectList.add(alertSubmittedObject);
} }
smsParams.put("callTimeStr", calledRo.getCallTimeStr()); smsParams.put(callTimeStr, calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress()); smsParams.put(address, calledRo.getAddress());
smsParams.put("content", calledRo.getContent()); smsParams.put("content", calledRo.getContent());
smsParams.put("trappedNum", calledRo.getTrappedNum()); smsParams.put(trappedNum, calledRo.getTrappedNum());
smsParams.put("casualtiesNum", calledRo.getCasualtiesNum()); smsParams.put(casualtiesNum, calledRo.getCasualtiesNum());
smsParams.put("companyName", calledRo.getCompanyName()); smsParams.put(companyName, calledRo.getCompanyName());
smsParams.put("contactUser", calledRo.getContactUser()); smsParams.put(contactUser, calledRo.getContactUser());
smsParams.put("contactPhone", calledRo.getContactPhone()); smsParams.put(contactPhone, calledRo.getContactPhone());
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put(alertType, calledRo.getAlertType());
List<String> userList= new ArrayList<String>(); List<String> userList= new ArrayList<String>();
List<String> taskUserIds= new ArrayList<String>(); List<String> taskUserIds= new ArrayList<String>();
sendUser.stream().forEach(i -> { sendUser.stream().forEach(i -> {
if (i.containsKey("mobilePhone")) { if (i.containsKey(mobilePhone)) {
mobiles.add(i.get("mobilePhone").toString()); mobiles.add(i.get(mobilePhone).toString());
} }
if (i.containsKey("amosId")&& !ValidationUtil.isEmpty(i.get("amosId"))) { if (i.containsKey(amosId)&& !ValidationUtil.isEmpty(i.get(amosId))) {
if (!CollectionUtils.isEmpty(userCarIds)){ if (!CollectionUtils.isEmpty(userCarIds)){
if (userCarIds.contains(Long.valueOf(i.get("amosId").toString()))){ if (userCarIds.contains(Long.valueOf(i.get(amosId).toString()))){
taskUserIds.add(i.get("amosId").toString()); taskUserIds.add(i.get(amosId).toString());
}else { }else {
userList.add(i.get("amosId").toString()); userList.add(i.get(amosId).toString());
} }
}else { }else {
userList.add(i.get("amosId").toString()); userList.add(i.get(amosId).toString());
} }
} }
...@@ -2036,22 +2056,22 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -2036,22 +2056,22 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
// 绑定车辆人员发送的是待办消息 // 绑定车辆人员发送的是待办消息
if (CollectionUtils.isEmpty(taskUserIds)){ if (CollectionUtils.isEmpty(taskUserIds)){
Map<String, String> besidesMap = new HashMap<String, String>(); Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("alterId", alertCalledId); besidesMap.put(alterId, alertCalledId);
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,taskUserIds, RuleConstant.TASK); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,taskUserIds, RuleConstant.TASK);
} }
smsParams.put("resourcesNum", companyName); smsParams.put(resourceNum, companyName);
// 短信报送对象 // 短信报送对象
// 发送任务消息 // 发送任务消息
// 组织短信内容 // 组织短信内容
// 调用短信发送接口 // 调用短信发送接口
try { try {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams); alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
}catch (Exception e) {// TODO: handle exception }catch (Exception e) {//
e.printStackTrace();
} }
Map<String, String> besidesMap = new HashMap<String, String>(); Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("alterId", alertCalledId); besidesMap.put(alterId, alertCalledId);
if(userList.size()>0) { if(!userList.isEmpty()) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList, null); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList, null);
} }
...@@ -2069,7 +2089,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -2069,7 +2089,7 @@ 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){ public void pushPowerTransferToAppAndWeb(String type,Map<String, String> besidesMap, HashMap<String, String> smsParams, List<String> userList, Integer messageType){
PushMessageWebAndAppRo pushMessageWebAndAppRo = new PushMessageWebAndAppRo(); PushMessageWebAndAppRo pushMessageWebAndAppRo = new PushMessageWebAndAppRo();
pushMessageWebAndAppRo.setRelationId(besidesMap.get("alterId")); pushMessageWebAndAppRo.setRelationId(besidesMap.get(alterId));
pushMessageWebAndAppRo.setRecivers(userList); pushMessageWebAndAppRo.setRecivers(userList);
// 默认发送消息通知,力量调派车辆绑定人发送待办任务。 // 默认发送消息通知,力量调派车辆绑定人发送待办任务。
if (null != messageType){ if (null != messageType){
...@@ -2083,36 +2103,36 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -2083,36 +2103,36 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
pushMessageWebAndAppRo.setMsgType(this.msgType); pushMessageWebAndAppRo.setMsgType(this.msgType);
pushMessageWebAndAppRo.setTerminal(RuleConstant.APP_WEB); pushMessageWebAndAppRo.setTerminal(RuleConstant.APP_WEB);
Map<String,String> map= new HashMap<String,String>(); Map<String,String> map= new HashMap<String,String>();
map.put(sequenceNbr, besidesMap.get("alterId")); map.put(sequenceNbr, besidesMap.get(alterId));
if(AlertBusinessTypeEnum.警情结案.getCode().equals(type)) { if(AlertBusinessTypeEnum.警情结案.getCode().equals(type)) {
pushMessageWebAndAppRo.setName("消息"); pushMessageWebAndAppRo.setName("消息");
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"); 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"); pushMessageWebAndAppRo.setRuleType("notAlert");
} }
if(AlertBusinessTypeEnum.警情续报.getCode().equals(type)) { if(AlertBusinessTypeEnum.警情续报.getCode().equals(type)) {
pushMessageWebAndAppRo.setName("消息"); pushMessageWebAndAppRo.setName("消息");
pushMessageWebAndAppRo.setCompanyName(smsParams.get("alertType")); 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(smsParams.get("replaceContent")); pushMessageWebAndAppRo.setTransferLocation(smsParams.get("replaceContent"));
pushMessageWebAndAppRo.setTrappedNum(smsParams.get("trappedNum"));//被困人数 pushMessageWebAndAppRo.setTrappedNum(smsParams.get(trappedNum));//被困人数
pushMessageWebAndAppRo.setCasualtiesNum(smsParams.get("casualtiesNum"));//伤亡人数 pushMessageWebAndAppRo.setCasualtiesNum(smsParams.get(casualtiesNum));//伤亡人数
pushMessageWebAndAppRo.setRuleType("followReportAlert"); pushMessageWebAndAppRo.setRuleType("followReportAlert");
} }
if(AlertBusinessTypeEnum.力量调派.getCode().equals(type)) { if(AlertBusinessTypeEnum.力量调派.getCode().equals(type)) {
pushMessageWebAndAppRo.setName(AlertBusinessTypeEnum.力量调派.getName()); pushMessageWebAndAppRo.setName(AlertBusinessTypeEnum.力量调派.getName());
pushMessageWebAndAppRo.setCompanyName(smsParams.get("resourcesNum")); pushMessageWebAndAppRo.setCompanyName(smsParams.get(resourceNum));
pushMessageWebAndAppRo.setAddress(smsParams.get("address")); pushMessageWebAndAppRo.setAddress(smsParams.get(address));
pushMessageWebAndAppRo.setSendTime(smsParams.get("callTimeStr")); pushMessageWebAndAppRo.setSendTime(smsParams.get(callTimeStr));
if(StringUtils.isNotBlank(besidesMap.get("transferLocation"))) { if(StringUtils.isNotBlank(besidesMap.get("transferLocation"))) {
pushMessageWebAndAppRo.setTransferLocation(besidesMap.get("responseLevelString"));//响应级别 pushMessageWebAndAppRo.setTransferLocation(besidesMap.get("responseLevelString"));//响应级别
pushMessageWebAndAppRo.setRuleType("fullTime"); pushMessageWebAndAppRo.setRuleType("fullTime");
...@@ -2123,14 +2143,14 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){ ...@@ -2123,14 +2143,14 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
if(AlertBusinessTypeEnum.警情初报.getCode().equals(type)) { if(AlertBusinessTypeEnum.警情初报.getCode().equals(type)) {
pushMessageWebAndAppRo.setRuleType("reportAlert"); pushMessageWebAndAppRo.setRuleType("reportAlert");
pushMessageWebAndAppRo.setName(AlertBusinessTypeEnum.警情初报.getName()); pushMessageWebAndAppRo.setName(AlertBusinessTypeEnum.警情初报.getName());
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(smsParams.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));//伤亡人数
} }
pushMessageWebAndAppRo.setExtras(map);; pushMessageWebAndAppRo.setExtras(map);
try { try {
ruleTrigger.publish(pushMessageWebAndAppRo, "消息/addAlterMessageCheck", new String[0]); ruleTrigger.publish(pushMessageWebAndAppRo, "消息/addAlterMessageCheck", new String[0]);
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
wel.warehouse_structure_id ,wel.equipment_code wel.warehouse_structure_id ,wel.equipment_code
</select> </select>
<select id="selectFireMonitor" resultType="java.util.Map"> <select id="selectFireMonitor" resultType="java.util.Map">
SELECT temp.name, temp.alarm ,temp.id, SELECT temp.name, temp.alarm ,temp.id, temp.code,
IFNULL((SELECT wesi.value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = temp.id AND wesi.equipment_index_key = 'CAFS_CAFSFireGun_FireGunPressure' IFNULL((SELECT wesi.value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = temp.id AND wesi.equipment_index_key = 'CAFS_CAFSFireGun_FireGunPressure'
ORDER BY wesi.update_date desc LIMIT 1),0) AS value, ORDER BY wesi.update_date desc LIMIT 1),0) AS value,
IFNULL((SELECT CASE WHEN wesi.value_label IS NULL OR trim( wesi.value_label ) = '' THEN (CASE IFNULL((SELECT CASE WHEN wesi.value_label IS NULL OR trim( wesi.value_label ) = '' THEN (CASE
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
ORDER BY wesi.update_date desc LIMIT 1),'--') AS status, ORDER BY wesi.update_date desc LIMIT 1),'--') AS status,
'0' AS flow '0' AS flow
FROM( FROM(
SELECT wes.id,wes.name, SELECT wes.id,wes.name,wes.code,
CASE CASE
WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1 WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1
AND wes.realtime_iot_index_value = 'true' THEN AND wes.realtime_iot_index_value = 'true' THEN
...@@ -145,6 +145,7 @@ ...@@ -145,6 +145,7 @@
SELECT SELECT
temp.id, temp.id,
temp.name, temp.name,
temp.code,
temp.nowLevel, temp.nowLevel,
temp.volume, temp.volume,
temp.unit, temp.unit,
...@@ -179,6 +180,7 @@ ...@@ -179,6 +180,7 @@
SELECT SELECT
wes.id, wes.id,
wes.name, wes.name,
wes.code,
IFNULL( ( SELECT value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS nowLevel, IFNULL( ( SELECT value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS nowLevel,
IFNULL( ( SELECT unit FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS unit, IFNULL( ( SELECT unit FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS unit,
IFNULL(( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxLevel' ) , 0 )AS maxLevel, IFNULL(( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxLevel' ) , 0 )AS maxLevel,
...@@ -198,7 +200,7 @@ ...@@ -198,7 +200,7 @@
'1' as type, '1' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id (SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level, WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code , wes.code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'暂无信号' '暂无信号'
...@@ -222,7 +224,7 @@ ...@@ -222,7 +224,7 @@
'2' as type, '2' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id (SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level, WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code , wes.code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'暂无信号' '暂无信号'
...@@ -247,7 +249,7 @@ ...@@ -247,7 +249,7 @@
'3' as type, '3' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id (SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level, WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code , wes.code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'暂无信号' '暂无信号'
...@@ -272,7 +274,7 @@ ...@@ -272,7 +274,7 @@
'4' as type, '4' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id (SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level, WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code , wes.code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'暂无信号' '暂无信号'
...@@ -1170,6 +1172,7 @@ ...@@ -1170,6 +1172,7 @@
'未消除' '未消除'
) cleanStatus, ) cleanStatus,
wlesal.equipment_index_id AS fireEquipmentIndexId, wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_code AS code,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey, wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName, wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
CASE wlesal.equipment_specific_index_value CASE wlesal.equipment_specific_index_value
......
...@@ -2825,6 +2825,7 @@ ...@@ -2825,6 +2825,7 @@
concat_ws( '-', ws.full_name, ed.area ) area, concat_ws( '-', ws.full_name, ed.area ) area,
es.iot_code, es.iot_code,
es.id, es.id,
es.code,
IFNULL( sum( `status` ), 0 ) AS isAlarm IFNULL( sum( `status` ), 0 ) AS isAlarm
FROM FROM
wl_equipment_specific es wl_equipment_specific es
...@@ -4681,13 +4682,15 @@ ...@@ -4681,13 +4682,15 @@
IFNULL( rp.volume, 0 ) AS volume, IFNULL( rp.volume, 0 ) AS volume,
ec.image, ec.image,
r.resource_type, r.resource_type,
r.sequence_nbr r.sequence_nbr,
wes.code
FROM FROM
cb_water_resource r cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_specific_index ei ON ei.equipment_specific_id = rp.level_device_id LEFT JOIN wl_equipment_specific_index ei ON ei.equipment_specific_id = rp.level_device_id
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id
LEFT JOIN wl_equipment_specific wes ON wes.id = rp.level_device_id
WHERE WHERE
r.resource_type = 'industryPool' r.resource_type = 'industryPool'
AND r.is_delete = 1 AND r.is_delete = 1
...@@ -4707,7 +4710,8 @@ ...@@ -4707,7 +4710,8 @@
a.volume, a.volume,
a.image, a.image,
a.resource_type, a.resource_type,
a.sequence_nbr a.sequence_nbr,
a.code
FROM FROM
( (
SELECT SELECT
...@@ -4733,12 +4737,14 @@ ...@@ -4733,12 +4737,14 @@
ec.image, ec.image,
r.resource_type, r.resource_type,
r.sequence_nbr, r.sequence_nbr,
rp.level_device_id rp.level_device_id,
wes.code
FROM FROM
cb_water_resource r cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id
LEFT JOIN wl_equipment_specific wes ON wes.id = rp.level_device_id
WHERE WHERE
r.resource_type = 'pool' r.resource_type = 'pool'
AND r.is_delete = 1 AND r.is_delete = 1
......
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