Commit 0c72306dbae73aa27d871e4cdb13c175daa82dc2
1 parent
1ed13b8093
Exists in
master
and in
6 other branches
一贯制医生信息
Showing 1 changed file with 33 additions and 15 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TeamServiceImpl.java
View file @
0c72306
1 | 1 | package com.lyms.platform.operate.web.service.impl; |
2 | 2 | |
3 | +import com.alibaba.fastjson.JSONObject; | |
3 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
4 | 5 | import com.lyms.platform.common.result.BaseObjectResponse; |
5 | 6 | import com.lyms.platform.common.result.BaseResponse; |
... | ... | @@ -24,6 +25,7 @@ |
24 | 25 | import java.util.ArrayList; |
25 | 26 | import java.util.Date; |
26 | 27 | import java.util.List; |
28 | +import java.util.Map; | |
27 | 29 | |
28 | 30 | @Service |
29 | 31 | public class TeamServiceImpl implements TeamService { |
... | ... | @@ -62,8 +64,37 @@ |
62 | 64 | criteria.and("hospitalId").is(hospitalId); |
63 | 65 | } |
64 | 66 | PageResult pageResult = findMongoPage(TeamModel.class, new Query(criteria).with(new Sort(Sort.Direction.DESC, "created")), page, limit); |
65 | - List<TeamModel> babyEyeChecks = (List<TeamModel>) pageResult.getGrid(); | |
66 | -// pageResult.setGrid(setDatas(babyEyeChecks)); | |
67 | + List<TeamModel> tLst = (List<TeamModel>) pageResult.getGrid(); | |
68 | + | |
69 | + List rLst=new ArrayList(); | |
70 | + | |
71 | + for (TeamModel t:tLst){ | |
72 | + Map row=(Map) (JSONObject.toJSON(t)); | |
73 | + | |
74 | + UsersQuery usersQuery = new UsersQuery(); | |
75 | + List<Integer> ids=new ArrayList<>(); | |
76 | + | |
77 | + for (String id : t.getDoctorIdArr()) { | |
78 | + ids.add(Integer.valueOf(id)); | |
79 | + } | |
80 | + | |
81 | + usersQuery.setIds(ids); | |
82 | + List<Users> uLst=usersService.queryUsers(usersQuery); | |
83 | + | |
84 | + StringBuffer sb=new StringBuffer(); | |
85 | + | |
86 | + for (int i = 0; i < uLst.size(); i++) { | |
87 | + if (i<uLst.size()-1){ | |
88 | + sb.append(uLst.get(i).getName()+","); | |
89 | + }else{ | |
90 | + sb.append(uLst.get(i).getName()); | |
91 | + } | |
92 | + } | |
93 | + row.put("uLst",sb); | |
94 | + | |
95 | + rLst.add(row); | |
96 | + } | |
97 | + pageResult.setGrid(rLst); | |
67 | 98 | return RespBuilder.buildSuccess(pageResult); |
68 | 99 | } |
69 | 100 | |
... | ... | @@ -163,19 +194,6 @@ |
163 | 194 | .setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(tLst.size()>0?tLst.get(0):null); |
164 | 195 | } |
165 | 196 | |
166 | - public static void main(String[] args) { | |
167 | - List<Integer> l1=new ArrayList<>(); | |
168 | - l1.add(1); | |
169 | - l1.add(2); | |
170 | - l1.add(3); | |
171 | - l1.add(4); | |
172 | - List<Integer> l2=new ArrayList<>(); | |
173 | - l2.add(3); | |
174 | - l2.add(4); | |
175 | - l2.add(5); | |
176 | - l1.removeAll(l2); | |
177 | - System.out.println(l1); | |
178 | - } | |
179 | 197 | |
180 | 198 | } |