Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
67208fb7
Commit
67208fb7
authored
Dec 31, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调教魔板匹配的时间格式显示和等级排序
parent
6f4d3575
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
2 deletions
+43
-2
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+43
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
View file @
67208fb7
...
...
@@ -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"));
// }
// }
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment