Commit eeca824721cdd15093d3178897b65cf450750e72
1 parent
07a58c853b
Exists in
master
and in
6 other branches
住院管理系统
Showing 9 changed files with 181 additions and 44 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/PatientMarkHospitalMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/PatientService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/ReportMakeHosptail.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/PatientMarkHospitalService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/PatientMarkHospitalServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/master/PatientMarkHospital.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientMarkHospServiceFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/PatientMarkHospitalMapper.java
View file @
eeca824
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.permission.model.PatientMarkHospital; |
4 | 4 | import com.lyms.platform.permission.model.PatientMarkHospitalQuery; |
5 | +import com.lyms.platform.permission.model.ReportMakeHosptail; | |
5 | 6 | |
6 | 7 | import java.util.List; |
7 | 8 | |
... | ... | @@ -17,6 +18,8 @@ |
17 | 18 | public int queryPatientMarkHospitalCount(PatientMarkHospitalQuery query); |
18 | 19 | |
19 | 20 | public List<PatientMarkHospital> queryPatientMarkHospital(PatientMarkHospitalQuery query); |
21 | + | |
22 | + public List<ReportMakeHosptail> reportPatMarkHospByMakeDoctor(PatientMarkHospitalQuery query); | |
20 | 23 | |
21 | 24 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/PatientService.java
View file @
eeca824
... | ... | @@ -18,6 +18,10 @@ |
18 | 18 | */ |
19 | 19 | private Integer serType; |
20 | 20 | /** |
21 | + * 服务类型(1-高危精准指导、2-体重、3-血糖、4-血压、5-专家咨询) | |
22 | + */ | |
23 | + private String serTypes; | |
24 | + /** | |
21 | 25 | * 指定医生 |
22 | 26 | */ |
23 | 27 | private String serDoct; |
... | ... | @@ -77,6 +81,14 @@ |
77 | 81 | * 退款人 |
78 | 82 | */ |
79 | 83 | private String backUser; |
84 | + | |
85 | + public String getSerTypes() { | |
86 | + return serTypes; | |
87 | + } | |
88 | + | |
89 | + public void setSerTypes(String serTypes) { | |
90 | + this.serTypes = serTypes; | |
91 | + } | |
80 | 92 | |
81 | 93 | public Date getBackDate() { |
82 | 94 | return backDate; |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/ReportMakeHosptail.java
View file @
eeca824
1 | +package com.lyms.platform.permission.model; | |
2 | + | |
3 | +/** | |
4 | + * @auther yangfei | |
5 | + * @createTime 2017年09月25日 17时08分 | |
6 | + * @discription 住院预约统计 | |
7 | + */ | |
8 | +public class ReportMakeHosptail { | |
9 | + //住院预约数 | |
10 | + private int num; | |
11 | + //医生Id | |
12 | + private String doctorId; | |
13 | + //医生名称 | |
14 | + private String doctorName; | |
15 | + //预约占比 | |
16 | + private int occupCompar; | |
17 | + | |
18 | + public String getDoctorName() { | |
19 | + return doctorName; | |
20 | + } | |
21 | + | |
22 | + public void setDoctorName(String doctorName) { | |
23 | + this.doctorName = doctorName; | |
24 | + } | |
25 | + | |
26 | + public int getOccupCompar() { | |
27 | + return occupCompar; | |
28 | + } | |
29 | + | |
30 | + public void setOccupCompar(int occupCompar) { | |
31 | + this.occupCompar = occupCompar; | |
32 | + } | |
33 | + | |
34 | + public int getNum() { | |
35 | + return num; | |
36 | + } | |
37 | + | |
38 | + public void setNum(int num) { | |
39 | + this.num = num; | |
40 | + } | |
41 | + | |
42 | + public String getDoctorId() { | |
43 | + return doctorId; | |
44 | + } | |
45 | + | |
46 | + public void setDoctorId(String doctorId) { | |
47 | + this.doctorId = doctorId; | |
48 | + } | |
49 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/PatientMarkHospitalService.java
View file @
eeca824
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.permission.model.PatientMarkHospital; |
4 | 4 | import com.lyms.platform.permission.model.PatientMarkHospitalQuery; |
5 | +import com.lyms.platform.permission.model.ReportMakeHosptail; | |
5 | 6 | |
6 | 7 | import java.util.List; |
7 | 8 | |
... | ... | @@ -17,6 +18,8 @@ |
17 | 18 | public int queryPatientMarkHospitalCount(PatientMarkHospitalQuery query); |
18 | 19 | |
19 | 20 | public List<PatientMarkHospital> queryPatientMarkHospital(PatientMarkHospitalQuery query); |
21 | + | |
22 | + public List<ReportMakeHosptail> reportPatMarkHospByMakeDoctor(PatientMarkHospitalQuery query); | |
20 | 23 | |
21 | 24 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/PatientMarkHospitalServiceImpl.java
View file @
eeca824
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | import com.lyms.platform.permission.dao.master.PatientMarkHospitalMapper; |
4 | 4 | import com.lyms.platform.permission.model.PatientMarkHospital; |
5 | 5 | import com.lyms.platform.permission.model.PatientMarkHospitalQuery; |
6 | +import com.lyms.platform.permission.model.ReportMakeHosptail; | |
6 | 7 | import com.lyms.platform.permission.service.PatientMarkHospitalService; |
7 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
8 | 9 | import org.springframework.stereotype.Service; |
... | ... | @@ -46,6 +47,11 @@ |
46 | 47 | query.mysqlBuild(patientMarkHospitalMapper.queryPatientMarkHospitalCount(query)); |
47 | 48 | } |
48 | 49 | return patientMarkHospitalMapper.queryPatientMarkHospital(query); |
50 | + } | |
51 | + | |
52 | + @Override | |
53 | + public List<ReportMakeHosptail> reportPatMarkHospByMakeDoctor(PatientMarkHospitalQuery query) { | |
54 | + return patientMarkHospitalMapper.reportPatMarkHospByMakeDoctor(query); | |
49 | 55 | } |
50 | 56 | |
51 | 57 | } |
platform-biz-service/src/main/resources/mainOrm/master/PatientMarkHospital.xml
View file @
eeca824
... | ... | @@ -261,6 +261,13 @@ |
261 | 261 | </where> |
262 | 262 | </sql> |
263 | 263 | |
264 | + <select id="reportPatMarkHospByMakeDoctor" resultType="com.lyms.platform.permission.model.ReportMakeHosptail" | |
265 | + parameterType="com.lyms.platform.permission.model.PatientMarkHospitalQuery"> | |
266 | + select count(*) num,make_doctor as doctorId from patient_mark_hospital | |
267 | + <include refid="PatientMarkHospitalCondition"/> | |
268 | + GROUP BY make_doctor; | |
269 | + </select> | |
270 | + | |
264 | 271 | |
265 | 272 | <select id="queryPatientMarkHospital" resultMap="PatientMarkHospitalResultMap" |
266 | 273 | parameterType="com.lyms.platform.permission.model.PatientMarkHospitalQuery"> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
View file @
eeca824
... | ... | @@ -169,8 +169,8 @@ |
169 | 169 | return baseResponse; |
170 | 170 | } |
171 | 171 | //serType服务类型(1-高危精准指导、2-体重、3-血糖、4-血压、5-专家咨询) |
172 | - if(ps.getSerType()==null){ | |
173 | - baseResponse.setErrormsg("请传入serType"); | |
172 | + if(ps.getSerTypes()==null){ | |
173 | + baseResponse.setErrormsg("请传入serTypes"); | |
174 | 174 | baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
175 | 175 | return baseResponse; |
176 | 176 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientMarkHospServiceFacade.java
View file @
eeca824
... | ... | @@ -10,10 +10,7 @@ |
10 | 10 | import com.lyms.platform.common.utils.DateUtil; |
11 | 11 | import com.lyms.platform.operate.web.request.PatientMarkRequest; |
12 | 12 | import com.lyms.platform.operate.web.result.PatienMarkHospResult; |
13 | -import com.lyms.platform.permission.model.PatientMarkHospital; | |
14 | -import com.lyms.platform.permission.model.PatientMarkHospitalLog; | |
15 | -import com.lyms.platform.permission.model.PatientMarkHospitalQuery; | |
16 | -import com.lyms.platform.permission.model.Users; | |
13 | +import com.lyms.platform.permission.model.*; | |
17 | 14 | import com.lyms.platform.permission.service.PatientMarkHospitalLogService; |
18 | 15 | import com.lyms.platform.permission.service.PatientMarkHospitalService; |
19 | 16 | import com.lyms.platform.permission.service.UsersService; |
... | ... | @@ -48,6 +45,62 @@ |
48 | 45 | private LlfyHisService llfyHisService; |
49 | 46 | |
50 | 47 | /** |
48 | + * 住院预约统计 | |
49 | + * @param patientMarkRequest | |
50 | + * @param id | |
51 | + * @return | |
52 | + */ | |
53 | + public BaseListResponse reportHospit(PatientMarkRequest patientMarkRequest, Integer id){ | |
54 | + PatientMarkHospitalQuery query = new PatientMarkHospitalQuery(); | |
55 | + //根据用户id获取医院ID | |
56 | + String hospitalId = autoMatchFacade.getHospitalId(id); | |
57 | + PatientMarkHospitalQuery patientMarkHospQuery = new PatientMarkHospitalQuery(); | |
58 | + patientMarkHospQuery.setHospitalId(hospitalId); | |
59 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
60 | + List<Patients> patientses = null; | |
61 | + //根据查询号、当前孕周进行查询 | |
62 | + if (null != patientMarkRequest.getcDueWeekStart() || null != patientMarkRequest.getcDueWeekEnd()) { | |
63 | + if (null != patientMarkRequest.getcDueWeekStart()) { | |
64 | + patientsQuery.setLastMensesEnd(DateUtil.addDay(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(new Date())), -(patientMarkRequest.getcDueWeekStart() * 7))); | |
65 | + } | |
66 | + if (null != patientMarkRequest.getcDueWeekEnd()) { | |
67 | + patientsQuery.setLastMensesStart(DateUtil.addDay(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(new Date())), -(patientMarkRequest.getcDueWeekEnd() * 7) - 6)); | |
68 | + } | |
69 | + patientsQuery.setHospitalId(hospitalId); | |
70 | + patientses = patientsService.queryPatient1(patientsQuery, "modpatientsQueryified"); | |
71 | + } | |
72 | + | |
73 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
74 | + List<String> parentIds = new LinkedList<>(); | |
75 | + for (Patients pa : patientses) { | |
76 | + parentIds.add(pa.getId()); | |
77 | + } | |
78 | + patientMarkHospQuery.setPatientIds((String[]) parentIds.toArray(new String[parentIds.size()])); | |
79 | + } else if (null != patientMarkRequest.getcDueWeekStart() || null != patientMarkRequest.getcDueWeekEnd()) { | |
80 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
81 | + } | |
82 | + | |
83 | + //统计数据 | |
84 | + List<ReportMakeHosptail> reportMakeHosptails = patientMarkHospitalService.reportPatMarkHospByMakeDoctor(query); | |
85 | + //总数据 | |
86 | + int count = patientMarkHospitalService.queryPatientMarkHospitalCount(query); | |
87 | + for(ReportMakeHosptail rm:reportMakeHosptails){ | |
88 | + Users users = usersService.getUsers(Integer.parseInt(rm.getDoctorId())); | |
89 | + if (users != null) { | |
90 | + rm.setDoctorName(users.getName()); | |
91 | + } else { | |
92 | + rm.setDoctorName("产检医生"); | |
93 | + } | |
94 | + rm.setOccupCompar(rm.getNum()/count); | |
95 | + } | |
96 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(reportMakeHosptails); | |
97 | + } | |
98 | + | |
99 | + | |
100 | + | |
101 | + | |
102 | + | |
103 | + /** | |
51 | 104 | * 初始化接口 |
52 | 105 | * |
53 | 106 | * @return |
... | ... | @@ -184,8 +237,6 @@ |
184 | 237 | * @param ps |
185 | 238 | * @return |
186 | 239 | */ |
187 | - ; | |
188 | - | |
189 | 240 | public PatienMarkHospResult convertToResult(PatientMarkHospital ps) { |
190 | 241 | if (ps == null) { |
191 | 242 | return null; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
View file @
eeca824
... | ... | @@ -117,45 +117,51 @@ |
117 | 117 | public BaseResponse addPatientService(PatientService ps, Integer id) { |
118 | 118 | //根据用户id获取医院ID |
119 | 119 | String hospitalId = autoMatchFacade.getHospitalId(id); |
120 | + String [] serTypes = ps.getSerTypes().split(","); | |
121 | + for (String psType : serTypes) { | |
120 | 122 | |
121 | - //先根据孕妇id和开通服务类型、开通医生进行查询,如果已经开通过则开通失败 | |
122 | - PatientServiceQuery patientQuery = new PatientServiceQuery(); | |
123 | - patientQuery.setHospitalId(hospitalId); | |
124 | - patientQuery.setParentid(ps.getParentid()); | |
125 | - patientQuery.setSerType(ps.getSerType()); | |
126 | - patientQuery.setSerDoct(ps.getSerDoct()); | |
123 | + //先根据孕妇id和开通服务类型、开通医生进行查询,如果已经开通过则开通失败 | |
124 | + PatientServiceQuery patientQuery = new PatientServiceQuery(); | |
125 | + patientQuery.setHospitalId(hospitalId); | |
126 | + patientQuery.setParentid(ps.getParentid()); | |
127 | + patientQuery.setSerType(Integer.parseInt(psType)); | |
128 | + patientQuery.setSerDoct(ps.getSerDoct()); | |
127 | 129 | |
128 | - List<PatientService> patientServices = patientServiceService.queryPatientService(patientQuery); | |
129 | - if (CollectionUtils.isNotEmpty(patientServices)) { | |
130 | - BaseResponse baseResponse = new BaseResponse(); | |
131 | - baseResponse.setErrorcode(ErrorCodeConstants.DATA_EXIST); | |
132 | - String serType = PatientSerEnums.SerTypeEnums.getTitle(ps.getSerType()); | |
133 | - String serDoct = "产检医生"; | |
134 | - Users users = usersService.getUsers(Integer.parseInt(ps.getSerDoct())); | |
135 | - if (users != null) { | |
136 | - serDoct = users.getName(); | |
130 | + List<PatientService> patientServices = patientServiceService.queryPatientService(patientQuery); | |
131 | + if (CollectionUtils.isNotEmpty(patientServices)) { | |
132 | + continue; | |
133 | + // BaseResponse baseResponse = new BaseResponse(); | |
134 | + // baseResponse.setErrorcode(ErrorCodeConstants.DATA_EXIST); | |
135 | + // String serType = PatientSerEnums.SerTypeEnums.getTitle(ps.getSerType()); | |
136 | + // String serDoct = "产检医生"; | |
137 | + // Users users = usersService.getUsers(Integer.parseInt(ps.getSerDoct())); | |
138 | + // if (users != null) { | |
139 | + // serDoct = users.getName(); | |
140 | + // } | |
141 | + // baseResponse.setErrormsg("该孕妇已开通" + serDoct + "医生的" + serType + "服务,请勿重复开通"); | |
142 | + // return baseResponse; | |
137 | 143 | } |
138 | - baseResponse.setErrormsg("该孕妇已开通" + serDoct + "医生的" + serType + "服务,请勿重复开通"); | |
139 | - return baseResponse; | |
140 | - } | |
141 | 144 | |
142 | - Patients patients = patientsService.findOnePatientById(ps.getParentid()); | |
143 | - if(patients!=null){ | |
144 | - ps.setPid(patients.getPid()); | |
145 | + Patients patients = patientsService.findOnePatientById(ps.getParentid()); | |
146 | + if (patients != null) { | |
147 | + ps.setPid(patients.getPid()); | |
148 | + } | |
149 | + ps.setId(UUID.randomUUID().toString().replace("-", "")); | |
150 | + ps.setHospitalId(hospitalId); | |
151 | + ps.setCreateDate(new Date()); | |
152 | + ps.setCreateUser(String.valueOf(id)); | |
153 | + //默认开通状态 | |
154 | + ps.setSerStatus(PatientSerEnums.SerStatusEnums.kt.getId()); | |
155 | + //服务类型 | |
156 | + ps.setSerType(Integer.parseInt(psType)); | |
157 | + //默认已经领取 | |
158 | + ps.setStatus(2); | |
159 | + //领取时间 | |
160 | + ps.setReceiveDate(new Date()); | |
161 | + //领取操作医生id | |
162 | + ps.setReceiveUser(String.valueOf(id)); | |
163 | + patientServiceService.addPatientService(ps); | |
145 | 164 | } |
146 | - ps.setId(UUID.randomUUID().toString().replace("-", "")); | |
147 | - ps.setHospitalId(hospitalId); | |
148 | - // ps.setCreateDate(new Date()); | |
149 | - // ps.setCreateUser(String.valueOf(id)); | |
150 | - //默认开通状态 | |
151 | - ps.setSerStatus(PatientSerEnums.SerStatusEnums.kt.getId()); | |
152 | - //默认已经领取 | |
153 | - ps.setStatus(2); | |
154 | - //领取时间 | |
155 | - ps.setReceiveDate(new Date()); | |
156 | - //领取操作医生id | |
157 | - ps.setReceiveUser(String.valueOf(id)); | |
158 | - patientServiceService.addPatientService(ps); | |
159 | 165 | |
160 | 166 | BaseResponse baseResponse = new BaseResponse(); |
161 | 167 | baseResponse.setObject(ps.getId()); |