Commit fc1b3bc8 authored by chenzhao's avatar chenzhao

修改代码

parent 16ef8398
......@@ -44,7 +44,6 @@ public class AlertCalledFeedbackServiceImpl extends BaseService<AlertCalledFeedb
@Override
public boolean handleFeedback(AlertCalledFeedbackDto model) {
Long alertCalledId = model.getAlertCalledId();
// 更新警情调派任务状态
// 保存警情反馈
......
......@@ -231,13 +231,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
split[0] = "alertStatus";
}
}
if (split[1] != null) {
if (split[1].equals("ascend")) {
if (split[1] != null && split[1].equals("ascend") ){
split[1] = "ASC";
}
if (split[1].equals("descend")) {
split[1] = "DESC";
}
}else (split[1] != null && split[1].equals("descend") ) {
split[1] = "DESC";
}
}
}
......@@ -590,7 +588,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
map.put("sequenceNbr",ll.getSequenceNbr()+"");
map.put("callTime",ll.getCallTime()!=null?sdf.format(ll.getCallTime()):"");
map.put("updateTime",ll.getUpdateTime()!=null?sdf.format(ll.getUpdateTime()):"");
json=list!=null&&list.size()>0?JSONObject.toJSONString(map, SerializerFeature.PrettyFormat,
json=list!=null&&list.size()>0?JSON.toJSONString(map, SerializerFeature.PrettyFormat,
SerializerFeature.WriteMapNullValue):"";
}
......@@ -603,7 +601,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
// 航空报警器报警通知
if (AlertStageEnums.HKJY.getCode().equals(alertCalled.getAlertTypeCode())) {
List<String> flightNumber = powerTransferMapper.selectFlightNumber(AlertStageEnums.HKJY.getCode());
String flightNumIds = JSONObject.toJSONString(flightNumber);
String flightNumIds = JSON.toJSONString(flightNumber);
emqKeeper.getMqttClient().publish(noticeAviation, flightNumIds.getBytes(), RuleConfig.DEFAULT_QOS, false);
}
......@@ -1113,6 +1111,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
case LYXC:
case ZJBZ:
resultList = queryDisposalObjectAircraft(alertCalled);
break;
default:
break;
}
......@@ -1193,22 +1192,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/* 2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始 */
public List<Map<String, String>> getContactName() {
// List<Map<String,String>> firefightersName =
// firefightersService.getFirefightersName();
// firefightersName.forEach(r->{
// String phone = r.get("phone");
// phone = QRCodeUtil.generateQRCode()+"@"+phone;
// r.put("phone",phone);
// }
// );
// List<Map<String,String>> contactNames = alertCalledMapper.getContactName();
// contactNames.forEach(r->{
// String phone = r.get("phone");
// phone = QRCodeUtil.generateQRCode()+"@"+phone;
// r.put("phone",phone);
// }
// );
// firefightersName.addAll(contactNames);
List<Map<String, String>> list = orgUsrServiceImpl.getPersonSimpleDetail();
list.stream().forEach(i -> {
String phone = "";
......@@ -1369,13 +1352,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
int priority = 1;
boolean flag2 = false;
boolean flag3 = false;
JSONObject listForcondition1Nameobj = JSONObject.parseObject(JSONObject.toJSONString(i));
JSONObject listForcondition1Nameobj = JSON.parseObject(JSON.toJSONString(i));
ResponseModel<Object> responseForInstanceId = knowledgebaseFeignClient
.queryByInstance(Long.parseLong(listForcondition1Nameobj.getString("sequenceNbr")));
List responseForInstanceIdList = (List) responseForInstanceId.getResult();
Object responseForInstanceIdDetail = responseForInstanceIdList.get(0);
JSONObject responseForInstanceIdJsonDetail = JSONObject
.parseObject(JSONObject.toJSONString(responseForInstanceIdDetail));
.parseObject(JSON.toJSONString(responseForInstanceIdDetail));
if (!(condition1.split(",")[1]).equals(responseForInstanceIdJsonDetail.getString("tagValue"))) {
continue;
}
......@@ -1401,16 +1384,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
ResponseModel<Object> targetSeqResult = knowledgebaseFeignClient
.queryListByTargetSeq(Long.parseLong(listForcondition1Nameobj.getString("targetSeq")));
Object targetSeqResultObj = targetSeqResult.getResult();
JSONArray targetSeqResultArray = JSONArray.parseArray(JSONArray.toJSONString(targetSeqResultObj));
JSONArray targetSeqResultArray = JSON.parseArray(JSON.toJSONString(targetSeqResultObj));
for (Object m : targetSeqResultArray) {
JSONObject detailJson = JSONObject.parseObject(JSONObject.toJSONString(m));
JSONObject detailJson = JSON.parseObject(JSON.toJSONString(m));
if (condition2Name != null && condition2Name.equals(detailJson.getString("tagName"))) {
ResponseModel<Object> condition2ResponseForInstanceId = knowledgebaseFeignClient
.queryByInstance(Long.parseLong(detailJson.getString("sequenceNbr")));
List condition2ResponseForInstanceIdList = (List) condition2ResponseForInstanceId.getResult();
Object condition2ResponseForInstanceIdDetail = condition2ResponseForInstanceIdList.get(0);
JSONObject condition2ResponseForInstanceIdJsonDetail = JSONObject
.parseObject(JSONObject.toJSONString(condition2ResponseForInstanceIdDetail));
JSONObject condition2ResponseForInstanceIdJsonDetail = JSON
.parseObject(JSON.toJSONString(condition2ResponseForInstanceIdDetail));
if (condition2value != null && condition2value
.equals(condition2ResponseForInstanceIdJsonDetail.getString("tagValue"))) {
flag2 = true;
......@@ -1423,7 +1406,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
List condition3ResponseForInstanceIdList = (List) condition3ResponseForInstanceId.getResult();
Object condition3ResponseForInstanceIdDetail = condition3ResponseForInstanceIdList.get(0);
JSONObject condition3ResponseForInstanceIdJsonDetail = JSONObject
.parseObject(JSONObject.toJSONString(condition3ResponseForInstanceIdDetail));
.parseObject(JSON.toJSONString(condition3ResponseForInstanceIdDetail));
if (condition3value != null && condition3value
.equals(condition3ResponseForInstanceIdJsonDetail.getString("tagValue"))) {
flag3 = true;
......@@ -1451,7 +1434,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
ResponseModel<Object> SimpleDetailResponse = knowledgebaseFeignClient
.getSimpleDetail(listForcondition1Nameobj.getString("targetSeq"));
if (ObjectUtils.isNotEmpty(SimpleDetailResponse.getResult()) && priority != 0) {
JSONArray detailJsonArray = JSONArray.parseArray(JSONArray.toJSONString(SimpleDetailResponse.getResult()));
JSONArray detailJsonArray = JSON.parseArray(JSON.toJSONString(SimpleDetailResponse.getResult()));
JSONObject detailJsonObject= detailJsonArray.getJSONObject(0);
map.put("recDate",DateUtils.dateToString(detailJsonObject.getString("REC_DATE")));
map.put("sequenceNbr", detailJsonObject.getString("SEQUENCE_NBR"));
......@@ -1467,39 +1450,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
public void sort(List<Map<String, Object>> list) {
Collections.sort(list, new Comparator<Map<String, Object>>() {
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
Integer i =(Integer) o1.get("priority") == (Integer) o2
.get("priority") ? 0 : -1;
return (Integer) o1.get("priority") < (Integer) o2
.get("priority") ? ((Integer) o1.get("priority") == (Integer) o2
.get("priority") ? 0 : -1) : 1;
.get("priority") ? i : 1;
}
});
}
//
// public static void main(String[] args) {
// List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
// Map<String, Object> map = new HashMap<String, Object>();
// map.put("docTitle", "21313213");
// map.put("priority", 21);
// resultList.add(map);
// Map<String, Object> map1 = new HashMap<String, Object>();
// map1.put("docTitle", "21313213");
// map1.put("priority", 12);
// resultList.add(map1);
// Map<String, Object> map2 = new HashMap<String, Object>();
// map2.put("docTitle", "21313213");
// map2.put("priority", 1);
// resultList.add(map2);
// Map<String, Object> map3 = new HashMap<String, Object>();
// map3.put("docTitle", "21313213");
// map3.put("priority", 31);
// resultList.add(map3);
// Map<String, Object> map4 = new HashMap<String, Object>();
// map4.put("docTitle", "21313213");
// map4.put("priority", 18);
// resultList.add(map4);
// sort(resultList);
// for (Map<String, Object> map6 : resultList) {
// System.out.println(map6.get("priority"));
// }
// }
}
......@@ -8,6 +8,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.nio.file.Files;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
......@@ -57,6 +58,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ReflectionUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -195,6 +197,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Autowired
EquipFeignClient equipFeignClient;
private String onDuty = "onDuty";
private String fireBrigade = "fireBrigade";
private String telephone = "telephone";
private String sequenceNbr = "sequenceNbr";
@Autowired
FireTeamServiceImpl fireTeamServiceImpl;
......@@ -302,11 +309,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
definitions.put("$casualtiesNum",ValidationUtil.isEmpty(alertCalled.getCasualtiesNum()) ? "" : String.valueOf(alertCalled.getCasualtiesNum()));
definitions.put("$contactPhone",ValidationUtil.isEmpty(alertCalled.getContactPhone()) ? "" : alertCalled.getContactPhone());
String companyName = JSONObject.parseObject(alertSubmittedExtDto.getSubmissionContent()).getString("$companyName") ;
String companyName = JSON.parseObject(alertSubmittedExtDto.getSubmissionContent()).getString("$companyName") ;
JSONObject jsonObject = null;
if(!ValidationUtil.isEmpty(alertCalled.getUpdateTime())) {
jsonObject = JSONObject.parseObject(alertSubmittedExtDto.getSubmissionContent());
jsonObject = JSON.parseObject(alertSubmittedExtDto.getSubmissionContent());
jsonObject.put("recDate",DateUtils.convertDateToString(alertCalled.getUpdateTime(), DateUtils.DATE_TIME_PATTERN));
}
......@@ -319,7 +326,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String content = getTaskInformation( template.getRichContent(),definitions);
alertSubmittedExtDto.setSubmissionContentValue(JSONObject.parseObject(alertSubmittedExtDto.getSubmissionContent()));
alertSubmittedExtDto.setSubmissionContentValue(JSON.parseObject(alertSubmittedExtDto.getSubmissionContent()));
alertSubmittedExtDto.setSubmissionContent(content);
} catch (JSONException e) {
......@@ -358,7 +365,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 航空报警器警情结案推送
if(AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode()) && AlertStageEnums.HKJY.getCode().equals(alertCalled.getAlertTypeCode())) {
List<String> list = powerTransferMapper.selectFlightNumber(AlertStageEnums.HKJY.getCode());
emqKeeper.getMqttClient().publish(noticeAviation, JSONObject.toJSONString(list).getBytes(), RuleConfig.DEFAULT_QOS, false);
emqKeeper.getMqttClient().publish(noticeAviation, JSON.toJSONString(list).getBytes(), RuleConfig.DEFAULT_QOS, false);
}
// 警情结案时,修改该警情关联待办任务状态
if(AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
......@@ -435,21 +442,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 一般火灾 // 航空器救援
if(alertTypeCode.equals(AlertStageEnums.YBHZ.getCode()) || alertTypeCode.equals(AlertStageEnums.HKJY.getCode())) {
if(e.containsKey("onDuty")) {
if(e.containsKey(onDuty)) {
// 当日值班人员:获值班表中包括消救部、综合办公室、消防支队、应急指挥科的值班人员。
String [] arr = e.get("onDuty").toString().split(",");
String [] arr = e.get(onDuty).toString().split(",");
List<String> list = Arrays.asList(arr);
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyId(list);
orgUsers.addAll(mapList);
}
if(e.containsKey("fireBrigade")) {
if(e.containsKey(fireBrigade)) {
// 根据人员岗位:班组长、队长、通讯员; 消防队伍--消防人员 中,对应岗位的人员
List<FirefightersDto> fireBrigade = firefightersService.queryById(e.get("fireBrigade").toString().split(","), e.get("name").toString());
List<FirefightersDto> fireBrigade = firefightersService.queryById(e.get(fireBrigade).toString().split(","), e.get("name").toString());
fireBrigade.stream().forEach(f->{
HashMap<String,Object> map = new HashMap<>();
map.put("telephone",f.getMobilePhone());
map.put("sequenceNbr",f.getSequenceNbr());
map.put(telephone,f.getMobilePhone());
map.put(sequenceNbr,f.getSequenceNbr());
map.put("bizOrgName",f.getName());
map.put("amosUserId",f.getAmosUserId());
map.put("companyName", e.get("name").toString());
......@@ -489,7 +496,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 突发事件救援 // 漏油现场安全保障 // 专机保障 // 其他
if(alertTypeCode.equals(AlertStageEnums.TFSJ.getCode()) || alertTypeCode.equals(AlertStageEnums.LYXC.getCode())
|| alertTypeCode.equals(AlertStageEnums.ZJBZ.getCode()) || alertTypeCode.equals(AlertStageEnums.QTJQ.getCode())) {
if(e.containsKey("onDuty")) {
if(e.containsKey(onDuty)) {
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew(e.get("name").toString());
orgUsers.addAll(mapList);
}
......@@ -523,7 +530,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Optional<AlertSchedulingTypeEnum> alertSchedulingTypeEnum = Optional.of(AlertSchedulingTypeEnum.融合调度);
alertSubmitted.setSchedulingTypeCode(alertSchedulingTypeEnum.get().getCode());
alertSubmitted.setSchedulingType(alertSchedulingTypeEnum.get().getName());
alertSubmitted.setSubmissionContent(JSONObject.toJSONString(objectToMap(calledRo)));
alertSubmitted.setSubmissionContent(JSON.toJSONString(objectToMap(calledRo)));
alertSubmitted.setUpdateTime(new Date());
alertSubmitted.setSubmissionTime(new Date());
......@@ -576,13 +583,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
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.setCompanyName((String) orgUser.get("companyName"));
if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) {
mobiles.add(orgUser.get("telephone").toString());
alertSubmittedObject.setUserPhone((String) orgUser.get("telephone"));
if (!ValidationUtil.isEmpty(orgUser.get(telephone))) {
mobiles.add(orgUser.get(telephone).toString());
alertSubmittedObject.setUserPhone((String) orgUser.get(telephone));
}
alertSubmittedObjectList.add(alertSubmittedObject);
}
......@@ -833,13 +840,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String strDateFormat = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
map1.put("callTime",ll.getCallTime()!=null?sdf.format(ll.getCallTime()):"");
map.put("sequenceNbr",ll.getSequenceNbr()+"");
map.put(sequenceNbr,ll.getSequenceNbr()+"");
map1.put("updateTime",ll.getUpdateTime()!=null?sdf.format(ll.getUpdateTime()):"");
json=list!=null&&list.size()>0?JSONObject.toJSONString(map1, SerializerFeature.PrettyFormat,
json=list!=null&&list.size()>0?JSON.toJSONString(map1, SerializerFeature.PrettyFormat,
SerializerFeature.WriteMapNullValue):"";
}
// String json=list4!=null&&list4.size()>0?JSONObject.toJSONString(list4.get(0), SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue):"";
// String json=list4!=null&&list4.size()>0?JSON.toJSONString(list4.get(0), SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue):"";
emqKeeper.getMqttClient().publish(topicJa, json.getBytes(), RuleConfig.DEFAULT_QOS, false);
}
......@@ -1137,12 +1144,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
File file2 = new File(fileName);
if(file2.exists()) {
file2.delete();
Files.delete(file2.toPath());
}
File file1 = new File(newFileName);
if(file1.exists()) {
file1.delete();
Files.delete(file1.toPath());
}
} catch (IOException e) {
e.printStackTrace();
......@@ -1297,12 +1304,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
style.setBold(true);
reverseList.get(i).getCellDatas().get(0).getRenderData().setStyle(style);
// reverseList.get(i).getCellDatas().forEach(cellRenderData -> {
// Style style = new Style();
// style.setFontFamily("仿宋");
// style.setFontSize(12);
// cellRenderData.getRenderData().setStyle(style);
// });
XWPFTableRow insertNewTableRow = table.insertNewTableRow(dangerListDataStartRow);
IntStream.range(5,14).forEach(j -> insertNewTableRow.createCell());
MiniTableRenderPolicy.Helper.renderRow(table, dangerListDataStartRow, reverseList.get(i));
......@@ -1337,7 +1338,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Set<String> mobiles, HashMap<String, String> smsParams) {
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息
// 组织短信内容
// 调用短信发送接口
......@@ -1373,7 +1373,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
definitions.put("$address",ValidationUtil.isEmpty(alertCalled.getAddress()) ? "" : alertCalled.getAddress() );
definitions.put("$contactUser",ValidationUtil.isEmpty(alertCalled.getContactUser()) ? "" : alertCalled.getContactUser() );
definitions.put("$contactPhone",ValidationUtil.isEmpty(alertCalled.getContactPhone()) ? "" : alertCalled.getContactPhone() );
// definitions.put("$recDate", DateUtils.convertDateToString(new Date(), DateUtils.DATE_TIME_PATTERN));
if(alertCalled.getAlertStatus()) {
map.put("recDate",DateUtils.convertDateToString(alertCalled.getUpdateTime(), DateUtils.DATE_TIME_PATTERN));
} else {
......@@ -1432,7 +1431,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
List<AlertSubmittedZHDto> listAlertSubmittedZHDto = alertSubmittedMapper.listAlertSubmittedZHDto(id);
listAlertSubmittedZHDto.stream().forEach(AlertSubmittedZHDto -> {
JSONObject js = JSONObject.parseObject(AlertSubmittedZHDto.getSubmissionContent());
JSONObject js = JSON.parseObject(AlertSubmittedZHDto.getSubmissionContent());
String content = "";
switch (AlertSubmittedZHDto.getBusinessType()) {
......@@ -1515,7 +1514,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
instructionsZHDto.setSubmissionTime(item.getRecDate());
listInstructionsZHDto.add(instructionsZHDto);
});
// ;
//排序时间倒序
/* Bug 2613 修改排序 按照发送时间排序 2021-09-01 陈召 开始*/
Collections.sort(listInstructionsZHDto, new Comparator<InstructionsZHDto>() {
......@@ -1547,7 +1545,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
String fieldName = field.getName();
if ("dynamicFormAlert".equalsIgnoreCase(fieldName)) {
List<FormValue> dynamicFormAlert = (List<FormValue>) field.get(obj);
......@@ -1577,14 +1575,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
boolean designatedDriver = false;
for (Object id : sendIds) {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(id));
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(id));
if (jsonObject.containsKey("type") && jsonObject.getString("type").equals(AlertStageEnums.BD.getCode())) {
designatedDriver = true;
}
}
List<Map<String, Object>> orgUsers = new LinkedList<>();
String sCode = "";
if (object instanceof AlertCallePowerTransferRo) {
AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object;
String alertSubmittedId = calledRo.getAlertSubmittedId();
......@@ -1597,7 +1592,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
//先获取消救部领导、消救部值班人员信息
sendIds.stream().forEach(e -> {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(e));
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(e));
// 消救部
if (jsonObject.containsKey("airportUnit")) {
String departmentName= jsonObject.getString("name");
......@@ -1606,7 +1601,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
userIdList.addAll(mapList);
}
if(jsonObject.containsKey("onDuty")) {
if(jsonObject.containsKey(onDuty)) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),departmentName);
userIdList.addAll(mapList);
}
......@@ -1615,40 +1610,38 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
});
List<Object> companyDetail = JSONArray.parseArray(JSON.toJSON(calledRo.getCompany()).toString(),Object.class);
for (Object powerTransferCompanyDto : companyDetail) {
PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
PowerTransferCompanyDto powerDto = JSON.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
Long companyId = powerDto.getCompanyId();
String companyName = powerDto.getCompanyName();
StringBuffer resourcesNum = new StringBuffer();
Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>();
//FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);
String alertTypeCode = calledRo.getAlertTypeCode();
FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);
sendIds.stream().forEach(e -> {
JSONObject jsonObject1 = JSONObject.parseObject(JSONObject.toJSONString(e));
JSONObject jsonObject1 = JSON.parseObject(JSON.toJSONString(e));
if (jsonObject1.containsKey("type") && (jsonObject1.getString("type").equals(AlertStageEnums.DD.getCode()))) {
String [] groupCode = jsonObject1.getString("fireBrigade").split(",");
String [] groupCode = jsonObject1.getString(fireBrigade).split(",");
List<String> positionType= Arrays.asList(groupCode);
if (jsonObject1.containsKey("fireBrigade")) { {
if (jsonObject1.containsKey(fireBrigade)) { {
LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<OrgUsr>();
queryWrapper.eq(OrgUsr::getBizOrgCode, fireTeam.getBizOrgCode());
OrgUsr one = orgUsrService.getOne(queryWrapper);
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(one.getBizOrgName(),positionType);
sendUserIds.addAll(mapList);
}
if(jsonObject1.containsKey("onDuty")) {
if(jsonObject1.containsKey(onDuty)) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),fireTeam.getCompanyName());
sendUserIds.addAll(mapList);
}
}
}else if (jsonObject1.containsKey("type") && (jsonObject1.getString("type").equals(AlertStageEnums.ZD.getCode()))) {
String [] groupCode = jsonObject1.get("fireBrigade").toString().split(",");
String [] groupCode = jsonObject1.get(fireBrigade).toString().split(",");
List<String> positionType= Arrays.asList(groupCode);
String departmentName= jsonObject1.getString("name");
if (jsonObject1.containsKey("fireBrigade")) { {
if (jsonObject1.containsKey(fireBrigade)) { {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,positionType);
sendUserIds.addAll(mapList);
}
if(jsonObject1.containsKey("onDuty")) {
if(jsonObject1.containsKey(onDuty)) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),departmentName);
sendUserIds.addAll(mapList);
}
......@@ -1673,9 +1666,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 将发送人放入 list
pList.add(orgUser);
if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) {
mobiles.add((String) orgUser.get("telephone"));
alertSubmittedObject.setUserPhone((String) orgUser.get("telephone"));
if (!ValidationUtil.isEmpty(orgUser.get(telephone))) {
mobiles.add((String) orgUser.get(telephone));
alertSubmittedObject.setUserPhone((String) orgUser.get(telephone));
}
alertSubmittedObjectList.add(alertSubmittedObject);
}
......@@ -1750,7 +1743,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObjectSub.setUserPhone(map.get("mobilePhone").toString());
}
alertSubmittedObjectListSub.add(alertSubmittedObjectSub);
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectListSub);
// 调用短信发送接口
alertCalledAction.sendAlertCalleCmd(smsCode, mobile, smsParams);
Map<String, String> besidesMap = new HashMap<String, String>();
......@@ -1794,7 +1786,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
smsParams.put("resourcesNum", resourcesNumStr);
// 短信报送对象
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息
// 组织短信内容
// 调用短信发送接口
......@@ -1853,14 +1844,14 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
Set<Map<String, Object>> userIds = new HashSet<Map<String, Object>>();
List<Object> companyDetail =JSONArray.parseArray(JSON.toJSON(calledRo.getCompany()).toString(),Object.class);
for(Object e:sendIds) {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.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()))) {
String departmentName= jsonObject.getString("name");
if (jsonObject.containsKey("airportUnit")) { {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,null);
userIds.addAll(mapList);
}
if(jsonObject.containsKey("onDuty")) {
if(jsonObject.containsKey(onDuty)) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),departmentName);
userIds.addAll(mapList);
}
......@@ -1869,15 +1860,15 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
}
for (Object powerTransferCompanyDto : companyDetail) {
Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>();
PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
PowerTransferCompanyDto powerDto = JSON.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
Long companyId = powerDto.getCompanyId();
String companyName = powerDto.getCompanyName();
FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);
for(Object sendObject:sendIds) {
JSONObject jsonObject1 = JSONObject.parseObject(JSONObject.toJSONString(sendObject));
JSONObject jsonObject1 = JSON.parseObject(JSON.toJSONString(sendObject));
if (jsonObject1.containsKey("type") && (jsonObject1.getString("type").equals(AlertStageEnums.监控大队.getCode()))) {
if(jsonObject1.containsKey("onDuty")) {
if(jsonObject1.containsKey(onDuty)) {
List<Map<String, Object>> dutyList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(
DateUtils.getDateNowShortStr(), fireTeam.getCompanyName());
sendUserIds.addAll(dutyList);
......@@ -1907,9 +1898,9 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
alertSubmittedObject.setTheUser(orgUser.get("userName").toString());
pList.add(orgUser);
if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) {
mobiles.add((String) orgUser.get("telephone"));
alertSubmittedObject.setUserPhone((String) orgUser.get("telephone"));
if (!ValidationUtil.isEmpty(orgUser.get(telephone))) {
mobiles.add((String) orgUser.get(telephone));
alertSubmittedObject.setUserPhone((String) orgUser.get(telephone));
}
alertSubmittedObjectList.add(alertSubmittedObject);
}
......@@ -1950,14 +1941,13 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
}
smsParams.put("resourcesNum", companyName);
// 短信报送对象
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息
// 组织短信内容
// 调用短信发送接口
try {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
}catch(Exception e){
e.printStackTrace();
}
Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("alterId", alertCalledId);
......@@ -1989,11 +1979,10 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object;
String alertSubmittedId = calledRo.getAlertSubmittedId();
alertCalledId = calledRo.getSequenceNbr();
//List<FireTeam> fireTeamList= new ArrayList<FireTeam>();
List<Object> companyDetail =JSONArray.parseArray(JSON.toJSON(calledRo.getCompany()).toString(),Object.class);
List<Object> companyDetail =JSON.parseArray(JSON.toJSON(calledRo.getCompany()).toString(),Object.class);
//获取急救科、消救部人员信息
for(Object e:sendIds) {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.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()))) {
String departmentName= jsonObject.getString("name");
if (jsonObject.containsKey("airportUnit")) { {
......@@ -2001,7 +1990,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
userIds.addAll(mapList);
}
if(jsonObject.containsKey("onDuty")) {
if(jsonObject.containsKey(onDuty)) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),departmentName);
userIds.addAll(mapList);
}
......@@ -2011,25 +2000,21 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
//获取对应急救站的当日值班员信息
for (Object powerTransferCompanyDto : companyDetail) {
Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>();
PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
PowerTransferCompanyDto powerDto = JSON.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
Long companyId = powerDto.getCompanyId();
String companyName = powerDto.getCompanyName();
FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);//这个公司ID实际上是120急救站的id值
//fireTeamList.add(fireTeam);
for(Object e:sendIds) {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(e));
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(e));
//获取120急救站的规则
if (jsonObject.containsKey("type") && (jsonObject.getString("type").equals(AlertStageEnums.JJZ.getCode()))) {
if(!jsonObject.containsKey("onDuty")) {
if(!jsonObject.containsKey(onDuty)) {
continue;
}
//fireTeamList.stream().forEach(i->{
//获取120急救排版值班的人员信息
List<Map<String, Object>> dutyList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndAirId(
DateUtils.getDateNowShortStr(), fireTeam.getCompanyName());
sendUserIds.addAll(dutyList);
//});
}
}
sendUserIds.addAll(userIds);
......@@ -2092,7 +2077,6 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
}
smsParams.put("resourcesNum", companyName);
// 短信报送对象
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息
// 组织短信内容
// 调用短信发送接口
......@@ -2135,8 +2119,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
pushMessageWebAndAppRo.setMsgType(this.msgType);
pushMessageWebAndAppRo.setTerminal(RuleConstant.APP_WEB);
Map<String,String> map= new HashMap<String,String>();
//map.put("url", "disasterPage");
map.put("sequenceNbr", besidesMap.get("alterId"));
map.put(sequenceNbr, besidesMap.get("alterId"));
if(AlertBusinessTypeEnum.警情结案.getCode().equals(type)) {
pushMessageWebAndAppRo.setName("消息");
......@@ -2162,7 +2145,6 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
pushMessageWebAndAppRo.setRuleType("followReportAlert");
}
if(AlertBusinessTypeEnum.力量调派.getCode().equals(type)) {
//map.put("url", "powerInformationPage");
pushMessageWebAndAppRo.setName(AlertBusinessTypeEnum.力量调派.getName());
pushMessageWebAndAppRo.setCompanyName(smsParams.get("resourcesNum"));
pushMessageWebAndAppRo.setAddress(smsParams.get("address"));
......@@ -2189,6 +2171,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
ruleTrigger.publish(pushMessageWebAndAppRo, "消息/addAlterMessageCheck", new String[0]);
} catch (Exception e) {
e.printStackTrace();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment