Commit f7f4305bbeac74e620b230dbf3f8d4705a5a03ae
1 parent
fe5e748b40
Exists in
master
and in
6 other branches
产后随访
Showing 7 changed files with 178 additions and 48 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/UsersQuery.java
- platform-biz-service/src/main/resources/mainOrm/master/MasterUsers.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ConfigServiceController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatdeliverFollowController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ConfigServiceFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatdeliverFollowRequest.java
platform-biz-service/src/main/java/com/lyms/platform/permission/model/UsersQuery.java
View file @
f7f4305
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 | |
10 | 10 | public class UsersQuery extends BaseQuery { |
11 | 11 | private Integer id; |
12 | + private List<Integer> ids; | |
12 | 13 | private Integer logincenterId; |
13 | 14 | private Integer type; // |
14 | 15 | private Integer orgId; |
... | ... | @@ -37,6 +38,15 @@ |
37 | 38 | private Integer roleId; |
38 | 39 | private String foreignId; |
39 | 40 | private Integer otherAccount; //第三方帐号, 1医院帐号 |
41 | + | |
42 | + public List<Integer> getIds() { | |
43 | + return ids; | |
44 | + } | |
45 | + | |
46 | + public void setIds(List<Integer> ids) { | |
47 | + this.ids = ids; | |
48 | + } | |
49 | + | |
40 | 50 | public Integer getOtherAccount() { |
41 | 51 | return otherAccount; |
42 | 52 | } |
platform-biz-service/src/main/resources/mainOrm/master/MasterUsers.xml
View file @
f7f4305
... | ... | @@ -145,6 +145,13 @@ |
145 | 145 | <if test="id != null and id >= 0"> |
146 | 146 | and id = #{id,jdbcType=INTEGER} |
147 | 147 | </if> |
148 | + <if test="ids != null and ids.size() !=0 "> | |
149 | + AND id IN | |
150 | + <foreach collection="ids" item="title" | |
151 | + index="index" open="(" close=")" separator=","> | |
152 | + #{title} | |
153 | + </foreach> | |
154 | + </if> | |
148 | 155 | <if test="logincenterId != null and logincenterId >= 0"> |
149 | 156 | and logincenter_id = #{logincenterId,jdbcType=INTEGER} |
150 | 157 | </if> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ConfigServiceController.java
View file @
f7f4305
... | ... | @@ -16,6 +16,7 @@ |
16 | 16 | import com.lyms.platform.permission.service.OrganizationService; |
17 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
18 | 18 | import org.springframework.stereotype.Controller; |
19 | +import org.springframework.web.bind.annotation.PathVariable; | |
19 | 20 | import org.springframework.web.bind.annotation.RequestMapping; |
20 | 21 | import org.springframework.web.bind.annotation.RequestMethod; |
21 | 22 | import org.springframework.web.bind.annotation.ResponseBody; |
22 | 23 | |
... | ... | @@ -52,7 +53,31 @@ |
52 | 53 | return configServiceFacade.patientServiceInit(loginState.getId()); |
53 | 54 | } |
54 | 55 | |
56 | + /** | |
57 | + * 新增或修改服务价格配置 | |
58 | + * | |
59 | + * @param ps 服务开通记录 | |
60 | + * @param request | |
61 | + * @return | |
62 | + */ | |
63 | + @ResponseBody | |
64 | + @TokenRequired | |
65 | + @RequestMapping(value = "/addOrUpdateHospSer", method = RequestMethod.POST) | |
66 | + public BaseResponse addOrUpdateHospitalService(HospitalServiceContent ps,HttpServletRequest request) { | |
67 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
68 | + try { | |
69 | + return configServiceFacade.addOrUpdateHospitalService(ps,loginState.getId()); | |
70 | + } catch (Exception e) { | |
71 | + e.printStackTrace(); | |
72 | + BaseResponse baseResponse = new BaseResponse(); | |
73 | + baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); | |
74 | + baseResponse.setErrormsg(e.getMessage()); | |
75 | + return baseResponse; | |
76 | + } | |
77 | + } | |
55 | 78 | |
79 | + | |
80 | + | |
56 | 81 | /** |
57 | 82 | * 新增或修改服务开通记录 |
58 | 83 | * |
... | ... | @@ -120,7 +145,7 @@ |
120 | 145 | @ResponseBody |
121 | 146 | @TokenRequired |
122 | 147 | @RequestMapping(value = "/list/{hospitalId}", method = RequestMethod.GET) |
123 | - public BaseResponse getConfigService(String hospitalId | |
148 | + public BaseResponse getConfigService(@PathVariable String hospitalId | |
124 | 149 | ) { |
125 | 150 | return configServiceFacade.findDoctServiceList(hospitalId); |
126 | 151 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatdeliverFollowController.java
View file @
f7f4305
... | ... | @@ -89,6 +89,12 @@ |
89 | 89 | return matdeliverFollowFacade.getOneMatdeliverFollowMake(id); |
90 | 90 | } |
91 | 91 | |
92 | + /** | |
93 | + * 获取产后随访列表 | |
94 | + * @param MatdeliverFollowRequest | |
95 | + * @param request | |
96 | + * @return | |
97 | + */ | |
92 | 98 | @ResponseBody |
93 | 99 | @TokenRequired |
94 | 100 | @RequestMapping(value = "/list", method = RequestMethod.GET) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ConfigServiceFacade.java
View file @
f7f4305
... | ... | @@ -84,29 +84,20 @@ |
84 | 84 | |
85 | 85 | hscQuery.setHospitalId(hsId); |
86 | 86 | //状态 1--有效 |
87 | - hscQuery.setStatus(1); | |
87 | + // hscQuery.setStatus(1); | |
88 | + hscQuery.setSort("ser_type asc"); | |
88 | 89 | |
89 | 90 | List<HospitalServiceContent> hospitalServiceContents = hospitalServiceContentService.queryHospitalServiceContent(hscQuery); |
90 | 91 | List<HospitalServiceContentResult> hscResult = new ArrayList<>(); |
91 | 92 | |
92 | - Map<String, HospitalServiceContentResult> hscMap = new HashMap<>(); | |
93 | 93 | for (HospitalServiceContent hsc : hospitalServiceContents) { |
94 | 94 | HospitalServiceContentResult convertResult = convertToResult(hsc); |
95 | + HospitalDoctServiceQuery hospitalDoctServiceQuery = new HospitalDoctServiceQuery(); | |
96 | + hospitalDoctServiceQuery.setHospServiceId(hsc.getId()); | |
97 | + List<HospitalDoctService> hospitalDoctServiceList = hospitalDoctService.queryHospitalDoctService(hospitalDoctServiceQuery); | |
98 | + convertResult.setHospitalDoctServices(doctServiceConvertToResult(hospitalDoctServiceList)); | |
95 | 99 | hscResult.add(convertResult); |
96 | - hscMap.put(hsc.getId(), convertResult); | |
97 | 100 | } |
98 | - HospitalDoctServiceQuery hospitalDoctServiceQuery = new HospitalDoctServiceQuery(); | |
99 | - //状态 1--有效 | |
100 | - hospitalDoctServiceQuery.setStatus(1); | |
101 | - hospitalDoctServiceQuery.setHospId(hsId); | |
102 | - List<HospitalDoctService> hospitalDoctServiceList = hospitalDoctService.queryHospitalDoctService(hospitalDoctServiceQuery); | |
103 | - //给医院服务加入医生的服务价格信息 | |
104 | - for (HospitalDoctService hds : hospitalDoctServiceList) { | |
105 | - HospitalServiceContentResult hsc = hscMap.get(hds.getHospServiceId()); | |
106 | - if (hsc != null) { | |
107 | - hsc.getHospitalDoctServices().add(doctServiceConvertToResult(hds)); | |
108 | - } | |
109 | - } | |
110 | 101 | |
111 | 102 | BaseResponse baseResponse = new BaseResponse(); |
112 | 103 | baseResponse.setObject(hscResult); |
113 | 104 | |
... | ... | @@ -115,7 +106,39 @@ |
115 | 106 | return baseResponse; |
116 | 107 | } |
117 | 108 | |
109 | + /** | |
110 | + * 新增医院服务配置 | |
111 | + * | |
112 | + * @param ps | |
113 | + * @param userId 用户id | |
114 | + * @return | |
115 | + */ | |
116 | + public BaseResponse addOrUpdateHospitalService(HospitalServiceContent ps,Integer userId) throws Exception { | |
117 | + BaseResponse baseResponse = new BaseResponse(); | |
118 | 118 | |
119 | + //根据用户id获取医院ID | |
120 | + HospitalServiceContentQuery patientQuery = new HospitalServiceContentQuery(); | |
121 | + patientQuery.setHospitalId(ps.getHospitalId()); | |
122 | + patientQuery.setSerType(ps.getSerType()); | |
123 | + | |
124 | + List<HospitalServiceContent> patientServices = hospitalServiceContentService.queryHospitalServiceContent(patientQuery); | |
125 | + if (CollectionUtils.isNotEmpty(patientServices)) {//修改 | |
126 | + HospitalServiceContent hospitalServiceContent = patientServices.get(0); | |
127 | + hospitalServiceContent.setSyncStatus(0); | |
128 | + hospitalServiceContent.setSerPrice(ps.getSerPrice()); | |
129 | + hospitalServiceContentService.updateHospitalServiceContent(hospitalServiceContent); | |
130 | + } else { | |
131 | + ps.setId(UUID.randomUUID().toString().replace("-", "")); | |
132 | + ps.setSyncStatus(0); | |
133 | + //服务类型 | |
134 | + ps.setCreateDate(new Date()); | |
135 | + ps.setCreateUser(String.valueOf(userId)); | |
136 | + hospitalServiceContentService.addHospitalServiceContent(ps); | |
137 | + } | |
138 | + return baseResponse; | |
139 | + } | |
140 | + | |
141 | + | |
119 | 142 | /** |
120 | 143 | * 新增医院服务配置 |
121 | 144 | * |
122 | 145 | |
123 | 146 | |
... | ... | @@ -123,20 +146,20 @@ |
123 | 146 | * @param id |
124 | 147 | * @return |
125 | 148 | */ |
126 | - public BaseResponse addHospitalService(HospitalServiceContent ps,boolean isAutoDoct, Integer id) throws Exception { | |
149 | + public BaseResponse addHospitalService(HospitalServiceContent ps, boolean isAutoDoct, Integer id) throws Exception { | |
127 | 150 | //根据用户id获取医院ID |
128 | 151 | HospitalServiceContentQuery patientQuery = new HospitalServiceContentQuery(); |
129 | 152 | patientQuery.setHospitalId(ps.getHospitalId()); |
130 | 153 | patientQuery.setSerType(ps.getSerType()); |
131 | 154 | |
132 | 155 | |
133 | - List<HospitalServiceContent> patientServices = hospitalServiceContentService.queryGroupHospitalServiceContent(patientQuery); | |
156 | + List<HospitalServiceContent> patientServices = hospitalServiceContentService.queryHospitalServiceContent(patientQuery); | |
134 | 157 | if (CollectionUtils.isNotEmpty(patientServices)) {//修改 |
135 | 158 | HospitalServiceContent hospitalServiceContent = patientServices.get(0); |
136 | 159 | hospitalServiceContent.setSyncStatus(0); |
137 | 160 | hospitalServiceContent.setSerPrice(ps.getSerPrice()); |
138 | 161 | hospitalServiceContentService.updateHospitalServiceContent(hospitalServiceContent); |
139 | - }else{ | |
162 | + } else { | |
140 | 163 | ps.setId(UUID.randomUUID().toString().replace("-", "")); |
141 | 164 | ps.setSyncStatus(0); |
142 | 165 | //默认开通状态 |
... | ... | @@ -147,7 +170,7 @@ |
147 | 170 | hospitalServiceContentService.addHospitalServiceContent(ps); |
148 | 171 | |
149 | 172 | //自动创建专家咨询服务医生配置 |
150 | - if(ps.getSerType() == PatientSerEnums.SerTypeEnums.zjzx.getId() && isAutoDoct){ | |
173 | + if (ps.getSerType() == PatientSerEnums.SerTypeEnums.zjzx.getId() && isAutoDoct) { | |
151 | 174 | //查询医院 |
152 | 175 | String hospitalId = ps.getHospitalId(); |
153 | 176 | UsersQuery usersQuery = new UsersQuery(); |
... | ... | @@ -155,7 +178,7 @@ |
155 | 178 | usersQuery.setYn(1); |
156 | 179 | usersQuery.setEnable(1); |
157 | 180 | List<Users> users = usersService.queryUsers(usersQuery); |
158 | - for(Users us:users){ | |
181 | + for (Users us : users) { | |
159 | 182 | HospitalDoctService doctService = new HospitalDoctService(); |
160 | 183 | doctService.setId(UUID.randomUUID().toString().replace("-", "")); |
161 | 184 | doctService.setSyncStatus(0); |
162 | 185 | |
163 | 186 | |
164 | 187 | |
165 | 188 | |
166 | 189 | |
167 | 190 | |
168 | 191 | |
... | ... | @@ -178,43 +201,52 @@ |
178 | 201 | /** |
179 | 202 | * 医院医生服务数据转换 |
180 | 203 | * |
181 | - * @param hs | |
204 | + * @param hsList | |
182 | 205 | * @return |
183 | 206 | */ |
184 | - public HospitalDoctSerResult doctServiceConvertToResult(HospitalDoctService hs) { | |
185 | - if (hs == null) { | |
207 | + public List<HospitalDoctSerResult> doctServiceConvertToResult(List<HospitalDoctService> hsList) { | |
208 | + if (CollectionUtils.isEmpty(hsList)) { | |
186 | 209 | return null; |
187 | 210 | } |
188 | - HospitalDoctSerResult result = new HospitalDoctSerResult(); | |
189 | - result.setId(hs.getId()); | |
190 | - if (StringUtils.isNotEmpty(hs.getHospId())) {//查询医院名称 | |
191 | - result.setHospId(hs.getHospId()); | |
192 | - //判断ID是否存在 | |
193 | - Organization organization = organizationService.getOrganization(Integer.parseInt(hs.getHospId())); | |
194 | - if (organization != null) { | |
195 | - //设置医院名称 | |
196 | - result.setHospName(organization.getName()); | |
211 | + | |
212 | + //需要查询的医生id | |
213 | + List<Integer> doctIds = new ArrayList<>(); | |
214 | + List<HospitalDoctSerResult> results = new ArrayList<>(); | |
215 | + for (HospitalDoctService hs : hsList) { | |
216 | + if (StringUtils.isNum(hs.getDoctId())) { | |
217 | + doctIds.add(Integer.parseInt(hs.getDoctId())); | |
197 | 218 | } |
198 | 219 | } |
220 | + //存放医生列表,医生ID和医生姓名 | |
221 | + Map<Integer,String> docterMap = new HashMap<>(); | |
199 | 222 | |
200 | - result.setDoctId(hs.getDoctId()); | |
201 | - result.setDoctPrice(hs.getDoctPrice()); | |
202 | - | |
203 | - if (StringUtils.isNotEmpty(hs.getDoctId())) { | |
204 | - try { | |
205 | - Users users = usersService.getUsers(Integer.parseInt(hs.getDoctId())); | |
206 | - if (users != null) { | |
207 | - result.setDoctName(users.getName()); | |
223 | + if (CollectionUtils.isNotEmpty(doctIds)) { | |
224 | + UsersQuery usersQuery = new UsersQuery(); | |
225 | + usersQuery.setIds(doctIds); | |
226 | + List<Users> users = usersService.queryUsers(usersQuery); | |
227 | + if(CollectionUtils.isNotEmpty(users)){ | |
228 | + for(Users us:users){ | |
229 | + docterMap.put(us.getId(),us.getName()); | |
208 | 230 | } |
209 | - } catch (Exception e) { | |
210 | - result.setDoctName("产检医生"); | |
211 | 231 | } |
212 | 232 | } |
213 | 233 | |
214 | - if (hs.getStatus() != null) { | |
215 | - result.setStatus(HospitalSerStatusEnums.getNameById(hs.getStatus())); | |
234 | + for (HospitalDoctService hs : hsList) { | |
235 | + HospitalDoctSerResult result = new HospitalDoctSerResult(); | |
236 | + result.setHospServiceId(hs.getHospServiceId()); | |
237 | + result.setId(hs.getId()); | |
238 | + result.setDoctId(hs.getDoctId()); | |
239 | + result.setDoctPrice(hs.getDoctPrice()); | |
240 | + if (StringUtils.isNum(hs.getDoctId())) { | |
241 | + result.setDoctName(docterMap.get(Integer.parseInt(hs.getDoctId()))); | |
242 | + } | |
243 | + | |
244 | + if (hs.getStatus() != null) { | |
245 | + result.setStatus(HospitalSerStatusEnums.getNameById(hs.getStatus())); | |
246 | + } | |
247 | + results.add(result); | |
216 | 248 | } |
217 | - return result; | |
249 | + return results; | |
218 | 250 | } |
219 | 251 | |
220 | 252 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
f7f4305
... | ... | @@ -1185,12 +1185,23 @@ |
1185 | 1185 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
1186 | 1186 | |
1187 | 1187 | //查询号不为空,则查询孕妇id |
1188 | - if (StringUtils.isNotEmpty(matdeliverFollowRequest.getQueryNo())) { | |
1188 | + if (StringUtils.isNotEmpty(matdeliverFollowRequest.getQueryNo())//查询号不为空 | |
1189 | + ||StringUtils.isNotEmpty(matdeliverFollowRequest.getProvinceId())//居住地省 | |
1190 | + ||StringUtils.isNotEmpty(matdeliverFollowRequest.getCityId())//居住地市 | |
1191 | + ||StringUtils.isNotEmpty(matdeliverFollowRequest.getAreaId())//居住区 | |
1192 | + ||StringUtils.isNotEmpty(matdeliverFollowRequest.getStreetId())//居住街道 | |
1193 | + ) { | |
1189 | 1194 | PatientsQuery patientsQuery = new PatientsQuery(); |
1190 | 1195 | patientsQuery.setQueryNo(matdeliverFollowRequest.getQueryNo()); |
1191 | 1196 | patientsQuery.setYn(YnEnums.YES.getId()); |
1192 | 1197 | patientsQuery.setIsAutoFm(YnEnums.NO.getId()); |
1193 | 1198 | patientsQuery.setType(3); |
1199 | + //居住地 注意需要反起查询,不要搞错l,原因:前端小弟把数据存反了 | |
1200 | + patientsQuery.setAreaRegisterId(matdeliverFollowRequest.getAreaId()); | |
1201 | + patientsQuery.setCityRegisterId(matdeliverFollowRequest.getCityId()); | |
1202 | + patientsQuery.setProvinceRegisterId(matdeliverFollowRequest.getProvinceId()); | |
1203 | + patientsQuery.setStreetRegisterId(matdeliverFollowRequest.getStreetId()); | |
1204 | + | |
1194 | 1205 | if (StringUtils.isNotEmpty(matdeliverFollowRequest.getBirthDate())) { |
1195 | 1206 | patientsQuery.setFmDateStart(DateUtil.getSNDate(matdeliverFollowRequest.getBirthDate())[0]); |
1196 | 1207 | patientsQuery.setFmDateEnd(DateUtil.getSNDate(matdeliverFollowRequest.getBirthDate())[1]); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatdeliverFollowRequest.java
View file @
f7f4305
... | ... | @@ -22,6 +22,13 @@ |
22 | 22 | * @discription 分娩日期 |
23 | 23 | */ |
24 | 24 | private String birthDate; |
25 | + | |
26 | + //居住地 | |
27 | + private String provinceId; | |
28 | + private String cityId; | |
29 | + private String areaId; | |
30 | + private String streetId; | |
31 | + | |
25 | 32 | /** |
26 | 33 | * @discription 分娩医院省 |
27 | 34 | */ |
... | ... | @@ -63,6 +70,38 @@ |
63 | 70 | * 产妇随访确认(1-待确认、2-已确认) |
64 | 71 | */ |
65 | 72 | private Integer visitAffirm; |
73 | + | |
74 | + public String getProvinceId() { | |
75 | + return provinceId; | |
76 | + } | |
77 | + | |
78 | + public void setProvinceId(String provinceId) { | |
79 | + this.provinceId = provinceId; | |
80 | + } | |
81 | + | |
82 | + public String getCityId() { | |
83 | + return cityId; | |
84 | + } | |
85 | + | |
86 | + public void setCityId(String cityId) { | |
87 | + this.cityId = cityId; | |
88 | + } | |
89 | + | |
90 | + public String getAreaId() { | |
91 | + return areaId; | |
92 | + } | |
93 | + | |
94 | + public void setAreaId(String areaId) { | |
95 | + this.areaId = areaId; | |
96 | + } | |
97 | + | |
98 | + public String getStreetId() { | |
99 | + return streetId; | |
100 | + } | |
101 | + | |
102 | + public void setStreetId(String streetId) { | |
103 | + this.streetId = streetId; | |
104 | + } | |
66 | 105 | |
67 | 106 | public Integer getVisitStatus() { |
68 | 107 | return visitStatus; |