Commit eb4515012503f70759e836bde72256e7f3471f3e
1 parent
8868460921
Exists in
master
and in
6 other branches
增值服务价格配置
Showing 6 changed files with 185 additions and 19 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/HospitalServiceContent.java
- 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/SyncDataController.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/result/HospitalDoctSerResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HospitalServiceContentResult.java
platform-biz-service/src/main/java/com/lyms/platform/permission/model/HospitalServiceContent.java
View file @
eb45150
... | ... | @@ -47,6 +47,22 @@ |
47 | 47 | */ |
48 | 48 | private List<String> doctIds = new ArrayList<>(); |
49 | 49 | |
50 | + | |
51 | + /** | |
52 | + * 服务医生集合 | |
53 | + */ | |
54 | + private List<HospitalDoctService> hospitalDoctServices = new ArrayList<>(); | |
55 | + | |
56 | + | |
57 | + | |
58 | + public List<HospitalDoctService> getHospitalDoctServices() { | |
59 | + return hospitalDoctServices; | |
60 | + } | |
61 | + | |
62 | + public void setHospitalDoctServices(List<HospitalDoctService> hospitalDoctServices) { | |
63 | + this.hospitalDoctServices = hospitalDoctServices; | |
64 | + } | |
65 | + | |
50 | 66 | public String getSerTypes() { |
51 | 67 | return serTypes; |
52 | 68 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ConfigServiceController.java
View file @
eb45150
... | ... | @@ -81,11 +81,24 @@ |
81 | 81 | @TokenRequired |
82 | 82 | @RequestMapping(value = "/list", method = RequestMethod.GET) |
83 | 83 | public BaseListResponse getPatientService( |
84 | - PageInfo pageInfo, | |
85 | - HttpServletRequest request | |
84 | + PageInfo pageInfo, | |
85 | + HttpServletRequest request | |
86 | 86 | ) { |
87 | 87 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
88 | 88 | return configServiceFacade.getHospitalService(pageInfo, loginState.getId()); |
89 | + } | |
90 | + | |
91 | + /** | |
92 | + * 根据条件查询医院服务配置 | |
93 | + * | |
94 | + * @return | |
95 | + */ | |
96 | + @ResponseBody | |
97 | + @TokenRequired | |
98 | + @RequestMapping(value = "/list/{hospitalId}", method = RequestMethod.GET) | |
99 | + public BaseResponse getConfigService(String hospitalId | |
100 | + ) { | |
101 | + return configServiceFacade.findDoctServiceList(hospitalId); | |
89 | 102 | } |
90 | 103 | |
91 | 104 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SyncDataController.java
View file @
eb45150
... | ... | @@ -85,11 +85,12 @@ |
85 | 85 | @RequestParam(value = "synForm", required = false) String synForm, |
86 | 86 | @RequestParam(value = "method", required = true) String method |
87 | 87 | ) { |
88 | + //返回值 | |
89 | + BaseResponse baseResponse = null; | |
88 | 90 | try { |
89 | 91 | System.out.println("数据同步开始:action:" + action + ",method:" + method+",synForm:"+synForm); |
90 | 92 | WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext(); |
91 | - //返回值 | |
92 | - BaseResponse baseResponse = null; | |
93 | + | |
93 | 94 | if(StringUtils.isNotEmpty(synForm)){//如果有参数 |
94 | 95 | Method mh = ReflectionUtils.findMethod(webApplicationContext.getBean(action).getClass(), method, new Class[]{String.class}); |
95 | 96 | baseResponse = (BaseResponse) ReflectionUtils.invokeMethod(mh, webApplicationContext.getBean(action), synForm); |
... | ... | @@ -105,7 +106,6 @@ |
105 | 106 | } |
106 | 107 | return baseResponse; |
107 | 108 | } catch (Exception e) { |
108 | - BaseResponse baseResponse = new BaseResponse(); | |
109 | 109 | baseResponse.setObject(e.getMessage()); |
110 | 110 | baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); |
111 | 111 | baseResponse.setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ConfigServiceFacade.java
View file @
eb45150
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | import com.lyms.platform.common.utils.Config; |
13 | 13 | import com.lyms.platform.common.utils.DateUtil; |
14 | 14 | import com.lyms.platform.common.utils.StringUtils; |
15 | +import com.lyms.platform.operate.web.result.HospitalDoctSerResult; | |
15 | 16 | import com.lyms.platform.operate.web.result.HospitalServiceContentResult; |
16 | 17 | import com.lyms.platform.permission.model.*; |
17 | 18 | import com.lyms.platform.permission.service.*; |
18 | 19 | |
19 | 20 | |
20 | 21 | |
21 | 22 | |
... | ... | @@ -75,16 +76,41 @@ |
75 | 76 | /** |
76 | 77 | * 根据配置id查询医生服务记录 |
77 | 78 | * |
78 | - * @param id | |
79 | + * @param hsId 医生id | |
79 | 80 | * @return |
80 | 81 | */ |
81 | - public BaseResponse findDoctServiceList(String hsId, Integer id) { | |
82 | - //根据用户id获取医院ID | |
83 | - String hospitalId = autoMatchFacade.getHospitalId(id); | |
82 | + public BaseResponse findDoctServiceList(String hsId) { | |
84 | 83 | |
84 | + HospitalServiceContentQuery hscQuery = new HospitalServiceContentQuery(); | |
85 | 85 | |
86 | + hscQuery.setHospitalId(hsId); | |
87 | + //状态 1--有效 | |
88 | + hscQuery.setStatus(1); | |
89 | + | |
90 | + List<HospitalServiceContent> hospitalServiceContents = hospitalServiceContentService.queryHospitalServiceContent(hscQuery); | |
91 | + List<HospitalServiceContentResult> hscResult = new ArrayList<>(); | |
92 | + | |
93 | + Map<String,HospitalServiceContentResult> hscMap = new HashMap<>(); | |
94 | + for(HospitalServiceContent hsc:hospitalServiceContents){ | |
95 | + HospitalServiceContentResult convertResult = convertToResult(hsc); | |
96 | + hscResult.add(convertResult); | |
97 | + hscMap.put(hsc.getId(),convertResult); | |
98 | + } | |
99 | + HospitalDoctServiceQuery hospitalDoctServiceQuery = new HospitalDoctServiceQuery(); | |
100 | + //状态 1--有效 | |
101 | + hospitalDoctServiceQuery.setStatus(1); | |
102 | + hospitalDoctServiceQuery.setHospId(hsId); | |
103 | + List<HospitalDoctService> hospitalDoctServiceList = hospitalDoctService.queryHospitalDoctService(hospitalDoctServiceQuery); | |
104 | + //给医院服务加入医生的服务价格信息 | |
105 | + for(HospitalDoctService hds:hospitalDoctServiceList){ | |
106 | + HospitalServiceContentResult hsc = hscMap.get(hds.getHospServiceId()); | |
107 | + if(hsc!=null){ | |
108 | + hsc.getHospitalDoctServices().add(doctServiceConvertToResult(hds)); | |
109 | + } | |
110 | + } | |
111 | + | |
86 | 112 | BaseResponse baseResponse = new BaseResponse(); |
87 | - // baseResponse.setObject(patientSerResults); | |
113 | + baseResponse.setObject(hscResult); | |
88 | 114 | baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
89 | 115 | baseResponse.setErrormsg("成功"); |
90 | 116 | return baseResponse; |
91 | 117 | |
92 | 118 | |
93 | 119 | |
... | ... | @@ -145,10 +171,50 @@ |
145 | 171 | return baseResponse; |
146 | 172 | } |
147 | 173 | |
174 | + /** | |
175 | + * 医院医生服务数据转换 | |
176 | + * | |
177 | + * @param hs | |
178 | + * @return | |
179 | + */ | |
180 | + public HospitalDoctSerResult doctServiceConvertToResult(HospitalDoctService hs) { | |
181 | + if (hs == null) { | |
182 | + return null; | |
183 | + } | |
184 | + HospitalDoctSerResult result = new HospitalDoctSerResult(); | |
185 | + result.setId(hs.getId()); | |
186 | + if (StringUtils.isNotEmpty(hs.getHospId())) {//查询医院名称 | |
187 | + result.setHospId(hs.getHospId()); | |
188 | + //判断ID是否存在 | |
189 | + Organization organization = organizationService.getOrganization(Integer.parseInt(hs.getHospId())); | |
190 | + if (organization != null) { | |
191 | + //设置医院名称 | |
192 | + result.setHospName(organization.getName()); | |
193 | + } | |
194 | + } | |
148 | 195 | |
196 | + result.setDoctId(hs.getDoctId()); | |
197 | + result.setDoctPrice(hs.getDoctPrice()); | |
149 | 198 | |
199 | + if (StringUtils.isNotEmpty(hs.getDoctId())) { | |
200 | + try { | |
201 | + Users users = usersService.getUsers(Integer.parseInt(hs.getDoctId())); | |
202 | + if (users != null) { | |
203 | + result.setDoctName(users.getName()); | |
204 | + } | |
205 | + } catch (Exception e) { | |
206 | + result.setDoctName("产检医生"); | |
207 | + } | |
208 | + } | |
209 | + | |
210 | + if(hs.getStatus()!=null){ | |
211 | + result.setStatus(HospitalSerStatusEnums.getNameById(hs.getStatus())); | |
212 | + } | |
213 | + return result; | |
214 | + } | |
215 | + | |
150 | 216 | /** |
151 | - * 数据转换 | |
217 | + * 医院服务数据转换 | |
152 | 218 | * |
153 | 219 | * @param hs |
154 | 220 | * @return |
... | ... | @@ -160,6 +226,7 @@ |
160 | 226 | HospitalServiceContentResult result = new HospitalServiceContentResult(); |
161 | 227 | result.setId(hs.getId()); |
162 | 228 | if (StringUtils.isNotEmpty(hs.getHospitalId())) {//查询医院名称 |
229 | + result.setHospitalId(hs.getHospitalId()); | |
163 | 230 | //判断ID是否存在 |
164 | 231 | Organization organization = organizationService.getOrganization(Integer.parseInt(hs.getHospitalId())); |
165 | 232 | if (organization != null) { |
166 | 233 | |
... | ... | @@ -201,9 +268,14 @@ |
201 | 268 | String serType = PatientSerEnums.SerTypeEnums.getTitle(Integer.parseInt(st)); |
202 | 269 | stb.append(serType+"/"); |
203 | 270 | } |
204 | - result.setSerType(stb.toString().substring(0,stb.length()-1)); | |
271 | + result.setSerTypeName(stb.toString().substring(0,stb.length()-1)); | |
205 | 272 | } |
206 | 273 | |
274 | + if(hs.getSerType()!=null){ | |
275 | + result.setSerTypeName(PatientSerEnums.SerTypeEnums.getTitle(hs.getSerType())); | |
276 | + } | |
277 | + result.setSerPrice(hs.getSerPrice()); | |
278 | + result.setSerType(hs.getSerType()); | |
207 | 279 | result.setCreateDate(DateUtil.getyyyy_MM_dd(hs.getCreateDate())); |
208 | 280 | if(hs.getStatus()!=null){ |
209 | 281 | result.setStatus(HospitalSerStatusEnums.getNameById(hs.getStatus())); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HospitalDoctSerResult.java
View file @
eb45150
... | ... | @@ -21,10 +21,18 @@ |
21 | 21 | */ |
22 | 22 | private String doctId; |
23 | 23 | /** |
24 | + * 医生名称 | |
25 | + */ | |
26 | + private String doctName; | |
27 | + /** | |
24 | 28 | * 医院id |
25 | 29 | */ |
26 | 30 | private String hospId; |
27 | 31 | /** |
32 | + * 医院名称 | |
33 | + */ | |
34 | + private String hospName; | |
35 | + /** | |
28 | 36 | * 医生价格 |
29 | 37 | */ |
30 | 38 | private BigDecimal doctPrice; |
... | ... | @@ -34,6 +42,14 @@ |
34 | 42 | */ |
35 | 43 | private String status; |
36 | 44 | |
45 | + public String getDoctName() { | |
46 | + return doctName; | |
47 | + } | |
48 | + | |
49 | + public void setDoctName(String doctName) { | |
50 | + this.doctName = doctName; | |
51 | + } | |
52 | + | |
37 | 53 | public String getId() { |
38 | 54 | return id; |
39 | 55 | } |
... | ... | @@ -64,6 +80,14 @@ |
64 | 80 | |
65 | 81 | public void setHospId(String hospId) { |
66 | 82 | this.hospId = hospId; |
83 | + } | |
84 | + | |
85 | + public String getHospName() { | |
86 | + return hospName; | |
87 | + } | |
88 | + | |
89 | + public void setHospName(String hospName) { | |
90 | + this.hospName = hospName; | |
67 | 91 | } |
68 | 92 | |
69 | 93 | public BigDecimal getDoctPrice() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HospitalServiceContentResult.java
View file @
eb45150
1 | 1 | package com.lyms.platform.operate.web.result; |
2 | 2 | |
3 | 3 | import java.math.BigDecimal; |
4 | +import java.util.ArrayList; | |
5 | +import java.util.List; | |
4 | 6 | |
5 | 7 | /** |
6 | 8 | * @auther yangfei |
7 | 9 | |
8 | 10 | |
9 | 11 | |
... | ... | @@ -16,14 +18,24 @@ |
16 | 18 | private String cityName; |
17 | 19 | private String areaName; |
18 | 20 | /** |
19 | - * 医院id | |
21 | + * 医院 | |
20 | 22 | */ |
21 | 23 | private String hospitalName; |
22 | 24 | /** |
25 | + * 医院id | |
26 | + */ | |
27 | + private String hospitalId; | |
28 | + | |
29 | + /** | |
23 | 30 | * 服务类型 |
24 | 31 | */ |
25 | - private String serType; | |
32 | + private Integer serType; | |
33 | + | |
26 | 34 | /** |
35 | + * 服务类型 | |
36 | + */ | |
37 | + private String serTypeName; | |
38 | + /** | |
27 | 39 | * 服务价格 |
28 | 40 | */ |
29 | 41 | private BigDecimal serPrice; |
... | ... | @@ -40,6 +52,39 @@ |
40 | 52 | */ |
41 | 53 | private String status; |
42 | 54 | |
55 | + /** | |
56 | + * 服务医生集合 | |
57 | + */ | |
58 | + private List<HospitalDoctSerResult> hospitalDoctServices = new ArrayList<>(); | |
59 | + | |
60 | + public List<HospitalDoctSerResult> getHospitalDoctServices() { | |
61 | + return hospitalDoctServices; | |
62 | + } | |
63 | + | |
64 | + public void setHospitalDoctServices(List<HospitalDoctSerResult> hospitalDoctServices) { | |
65 | + this.hospitalDoctServices = hospitalDoctServices; | |
66 | + } | |
67 | + | |
68 | + public void setSerType(Integer serType) { | |
69 | + this.serType = serType; | |
70 | + } | |
71 | + | |
72 | + public String getSerTypeName() { | |
73 | + return serTypeName; | |
74 | + } | |
75 | + | |
76 | + public void setSerTypeName(String serTypeName) { | |
77 | + this.serTypeName = serTypeName; | |
78 | + } | |
79 | + | |
80 | + public String getHospitalId() { | |
81 | + return hospitalId; | |
82 | + } | |
83 | + | |
84 | + public void setHospitalId(String hospitalId) { | |
85 | + this.hospitalId = hospitalId; | |
86 | + } | |
87 | + | |
43 | 88 | public String getProvinceName() { |
44 | 89 | return provinceName; |
45 | 90 | } |
46 | 91 | |
... | ... | @@ -80,12 +125,8 @@ |
80 | 125 | this.hospitalName = hospitalName; |
81 | 126 | } |
82 | 127 | |
83 | - public String getSerType() { | |
128 | + public Integer getSerType() { | |
84 | 129 | return serType; |
85 | - } | |
86 | - | |
87 | - public void setSerType(String serType) { | |
88 | - this.serType = serType; | |
89 | 130 | } |
90 | 131 | |
91 | 132 | public BigDecimal getSerPrice() { |