Commit 67208fb7 authored by chenhao's avatar chenhao

调教魔板匹配的时间格式显示和等级排序

parent 6f4d3575
......@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -1157,7 +1159,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
// }
private Object getIdsList1(String type ,String condition1, String condition2, String condition3)throws Exception {
List<Object> resultList = new ArrayList<Object>();
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
ResponseModel<Object> responseForcondition1Name = knowledgebaseFeignClient
.queryListByTagName(condition1.split(",")[0]);
......@@ -1254,7 +1256,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
if (ObjectUtils.isNotEmpty(SimpleDetailResponse.getResult()) && priority != 0) {
JSONArray detailJsonArray = JSONArray.parseArray(JSONArray.toJSONString(SimpleDetailResponse.getResult()));
JSONObject detailJsonObject= detailJsonArray.getJSONObject(0);
map.put("recDate",detailJsonObject.getString("REC_DATE"));
map.put("recDate",DateUtils.dateToString(detailJsonObject.getString("REC_DATE")));
map.put("sequenceNbr", detailJsonObject.getString("SEQUENCE_NBR"));
map.put("docTitle", detailJsonObject.getString("DOC_TITLE"));
map.put("priority", priority);
......@@ -1262,6 +1264,45 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
}
}
sort(resultList);
return resultList;
}
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) {
return (Integer) o1.get("priority") < (Integer) o2
.get("priority") ? ((Integer) o1.get("priority") == (Integer) o2
.get("priority") ? 0 : -1) : 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