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"));
// }
// }
}
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