Commit 5541909be696d94bfb89eb00cff270a9c7916ab8
1 parent
814b924640
Exists in
master
and in
6 other branches
1
Showing 4 changed files with 21 additions and 10 deletions
- platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/ReportModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/ReportModel.java
View file @
5541909
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
5541909
| ... | ... | @@ -1620,8 +1620,8 @@ |
| 1620 | 1620 | List<String> rlevel=Collections.emptyList(); |
| 1621 | 1621 | if(StringUtils.isNotEmpty(loa.getRiskLevelId())&&!"[]".equals(loa.getRiskLevelId())){ |
| 1622 | 1622 | rlevel= JsonUtil.jkstr2Obj(loa.getRiskLevelId(), List.class); |
| 1623 | - HashSet set =new HashSet(rlevel); | |
| 1624 | - rlevel=new ArrayList<String>(set); | |
| 1623 | + | |
| 1624 | + com.lyms.platform.operate.web.utils.CollectionUtils.removeDuplicate(rlevel,true); | |
| 1625 | 1625 | } |
| 1626 | 1626 | referralApplyOrderModel.setrLevel(rlevel); |
| 1627 | 1627 | applyOrderService.updateByParentId(applyOrderQuery, referralApplyOrderModel); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
5541909
| ... | ... | @@ -1763,9 +1763,9 @@ |
| 1763 | 1763 | HighScoreResult highScoreResult = findLastRisk(patients.getPid(), true); |
| 1764 | 1764 | patients1.setRiskScore(highScoreResult.getScore()); |
| 1765 | 1765 | patients1.setRiskFactorId(highScoreResult.getHighId()); |
| 1766 | - | |
| 1767 | - HashSet set = new HashSet(highScoreResult.getLevelId()); | |
| 1768 | - patients1.setRiskLevelId(JsonUtil.array2JsonString(new ArrayList<String>(set))); | |
| 1766 | + List list =highScoreResult.getLevelId(); | |
| 1767 | + com.lyms.platform.operate.web.utils.CollectionUtils.removeDuplicate(list,true); | |
| 1768 | + patients1.setRiskLevelId(JsonUtil.array2JsonString(list)); | |
| 1769 | 1769 | //设置其他的高危因素 |
| 1770 | 1770 | patients1.setoRiskFactor(StringUtils.isNotEmpty(highScoreResult.getOtherRisk()) ? highScoreResult.getOtherRisk() : ""); |
| 1771 | 1771 | patientsService.findAndModify(patientsQuery1, patients1); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java
View file @
5541909
| ... | ... | @@ -121,11 +121,22 @@ |
| 121 | 121 | * list去重数据 |
| 122 | 122 | * @param list |
| 123 | 123 | */ |
| 124 | - public static void removeDuplicate(List list) { | |
| 124 | + public static void removeDuplicate(List list,boolean order) { | |
| 125 | 125 | Assert.notNull(list, "list must be not null!"); |
| 126 | - Set<Object> temp = new HashSet<>(list); | |
| 127 | - list.clear(); | |
| 128 | - list.addAll(temp); | |
| 126 | + if(order){ | |
| 127 | + List ls=new ArrayList(); | |
| 128 | + for(int i=0;i<list.size();i++){ | |
| 129 | + if(!ls.contains(list.get(i))){ | |
| 130 | + ls.add(list.get(i)); | |
| 131 | + } | |
| 132 | + } | |
| 133 | + list.clear(); | |
| 134 | + list.addAll(ls); | |
| 135 | + }else { | |
| 136 | + Set<Object> temp = new HashSet<>(list); | |
| 137 | + list.clear(); | |
| 138 | + list.addAll(temp); | |
| 139 | + } | |
| 129 | 140 | } |
| 130 | 141 | |
| 131 | 142 | public static <T> List<T> transValToList(Map<String, T> map) { |