Commit 63b9091ffcb34c664e3a8c02f9bc7fc9f37f8e60
1 parent
b6a7cc45a2
Exists in
master
and in
8 other branches
建档管理
Showing 5 changed files with 420 additions and 9 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PatientManagerRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PatientManagerQueryModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PatientManagerResult.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
63b9091
... | ... | @@ -7,15 +7,17 @@ |
7 | 7 | import com.lyms.platform.common.result.BaseListResponse; |
8 | 8 | import com.lyms.platform.common.result.BaseObjectResponse; |
9 | 9 | import com.lyms.platform.common.result.BaseResponse; |
10 | +import com.lyms.platform.common.utils.BeanUtils; | |
11 | +import com.lyms.platform.common.utils.ExcelUtil; | |
12 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
10 | 13 | import com.lyms.platform.common.utils.SystemConfig; |
11 | 14 | import com.lyms.platform.operate.web.facade.AntenatalExaminationFacade; |
12 | 15 | import com.lyms.platform.operate.web.facade.BasicConfigFacade; |
13 | 16 | import com.lyms.platform.operate.web.facade.PatientFacade; |
14 | -import com.lyms.platform.operate.web.facade.PuerperaManagerFacade; | |
15 | 17 | import com.lyms.platform.operate.web.request.*; |
16 | 18 | import com.lyms.platform.operate.web.result.BasicConfigResult; |
17 | -import com.lyms.platform.operate.web.utils.HiskCountTask; | |
18 | -import com.lyms.platform.pojo.BasicConfig; | |
19 | +import com.lyms.platform.operate.web.result.PatientManagerQueryModel; | |
20 | +import com.lyms.platform.operate.web.result.PatientManagerResult; | |
19 | 21 | import org.apache.commons.collections.CollectionUtils; |
20 | 22 | import org.springframework.beans.factory.annotation.Autowired; |
21 | 23 | import org.springframework.stereotype.Controller; |
... | ... | @@ -24,12 +26,7 @@ |
24 | 26 | import javax.servlet.http.HttpServletRequest; |
25 | 27 | import javax.servlet.http.HttpServletResponse; |
26 | 28 | import javax.validation.Valid; |
27 | -import java.util.ArrayList; | |
28 | -import java.util.HashMap; | |
29 | -import java.util.List; | |
30 | -import java.util.Map; | |
31 | -import java.util.concurrent.Callable; | |
32 | -import java.util.concurrent.Future; | |
29 | +import java.util.*; | |
33 | 30 | |
34 | 31 | /** |
35 | 32 | * 孕产妇管理接口 |
... | ... | @@ -264,5 +261,63 @@ |
264 | 261 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
265 | 262 | return patientFacade.queryHighRisk(patientsQueryRequest,null,1,loginState.getId(),"true",Boolean.TRUE); |
266 | 263 | } |
264 | + | |
265 | + /** | |
266 | + * @auther HuJiaqi | |
267 | + * @createTime 2016年12月20日 15时03分 | |
268 | + * @discription 建档管理 | |
269 | + */ | |
270 | + @TokenRequired | |
271 | + @ResponseBody | |
272 | + @RequestMapping(value = "patientManager", method = RequestMethod.POST) | |
273 | + public BaseListResponse patientManager(@RequestBody PatientManagerRequest patientManagerRequest, HttpServletRequest httpServletRequest) { | |
274 | + BaseListResponse baseListResponse; | |
275 | + try { | |
276 | + patientManagerRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); | |
277 | + PatientManagerResult patientManagerResult = patientFacade.patientManager(patientManagerRequest); | |
278 | + if (patientManagerResult.getErrorcode() != ErrorCodeConstants.SUCCESS) { | |
279 | + baseListResponse = new BaseListResponse().setErrorcode(patientManagerResult.getErrorcode()).setErrormsg(patientManagerResult.getErrormsg()); | |
280 | + return baseListResponse; | |
281 | + } | |
282 | + baseListResponse = new BaseListResponse().setErrorcode(patientManagerResult.getErrorcode()).setErrormsg(patientManagerResult.getErrormsg()).setData(patientManagerResult.getData()).setPageInfo(patientManagerResult.getPageInfo()); | |
283 | + } catch (Exception e) { | |
284 | + baseListResponse = new BaseListResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION); | |
285 | + ExceptionUtils.catchException(e, "patientManager异常"); | |
286 | + } | |
287 | + return baseListResponse; | |
288 | + } | |
289 | + | |
290 | + @TokenRequired | |
291 | + @RequestMapping(value = "patientManagerExcel", method = RequestMethod.POST) | |
292 | + public void patientManagerExcel(HttpServletRequest httpServletRequest, @RequestBody PatientManagerRequest patientManagerRequest, HttpServletResponse httpServletResponse) { | |
293 | + try { | |
294 | + patientManagerRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); | |
295 | + // 这里返回的结果必然是这个泛型,之所以query返回的结果集没有用泛型是为了更好的传递数据 | |
296 | + @SuppressWarnings("unchecked") | |
297 | + List<PatientManagerQueryModel> patientManagerQueryModelList = patientFacade.patientManager(patientManagerRequest).getData(); | |
298 | + List<Map<String, Object>> list = new ArrayList<>(); | |
299 | + for (PatientManagerQueryModel patientManagerQueryModel : patientManagerQueryModelList) { | |
300 | + Map<String, Object> map = BeanUtils.objectToObjectMap(patientManagerQueryModel); | |
301 | + list.add(map); | |
302 | + } | |
303 | + Map<String, String> header = new LinkedHashMap<>(); | |
304 | + header.put("username", "姓名"); | |
305 | + header.put("age", "年龄"); | |
306 | + header.put("phone", "联系电话"); | |
307 | + header.put("cardNo", "证件号码"); | |
308 | + header.put("addressRegister", "户口所在地"); | |
309 | + header.put("husbandName", "丈夫姓名"); | |
310 | + header.put("husbandAddressRegister", "丈夫户口所在地"); | |
311 | + header.put("bookbuildingDate", "建档时间"); | |
312 | + header.put("bookbuildingDoctor", "建档医生"); | |
313 | + header.put("serviceType", "服务类型"); | |
314 | + httpServletResponse.setContentType("application/force-download"); | |
315 | + httpServletResponse.setHeader("Content-Disposition", "attachment;filename=" + new String(("建档管理.xls").getBytes("UTF-8"), "ISO-8859-1")); | |
316 | + ExcelUtil.toExcel(httpServletResponse.getOutputStream(), list, header); | |
317 | + } catch (Exception e) { | |
318 | + ExceptionUtils.catchException(e, "childbirthManagerExcel异常"); | |
319 | + } | |
320 | + } | |
321 | + | |
267 | 322 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
63b9091
... | ... | @@ -748,5 +748,65 @@ |
748 | 748 | |
749 | 749 | return str; |
750 | 750 | } |
751 | + | |
752 | + public PatientManagerResult patientManager(PatientManagerRequest patientManagerRequest) { | |
753 | + PatientManagerResult patientManagerResult = new PatientManagerResult(); | |
754 | + | |
755 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
756 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
757 | + patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(patientManagerRequest.getOperatorId())); | |
758 | + patientsQuery.setProvinceRegisterId(StringUtils.isEmpty(patientManagerRequest.getProvinceRegisterId()) ? null : patientManagerRequest.getProvinceRegisterId()); | |
759 | + patientsQuery.setCityRegisterId(StringUtils.isEmpty(patientManagerRequest.getCityRegisterId()) ? null : patientManagerRequest.getCityRegisterId()); | |
760 | + patientsQuery.setAreaRegisterId(StringUtils.isEmpty(patientManagerRequest.getAreaRegisterId()) ? null : patientManagerRequest.getAreaRegisterId()); | |
761 | + patientsQuery.setNeed("need"); | |
762 | + if (StringUtils.isNotEmpty(patientManagerRequest.getBookBuildingDate())) { | |
763 | + try { | |
764 | + patientsQuery.setBookbuildingDateStart(DateUtil.getSNDate(patientManagerRequest.getBookBuildingDate())[0]); | |
765 | + patientsQuery.setBookbuildingDateEnd(DateUtil.getSNDate(patientManagerRequest.getBookBuildingDate())[1]); | |
766 | + } catch (Exception e) { | |
767 | + // 什么都不做,这里是数据传入错误了 | |
768 | + } | |
769 | + } | |
770 | + patientsQuery.setName(StringUtils.isEmpty(patientManagerRequest.getUserName()) ? null : patientManagerRequest.getUserName()); | |
771 | + patientsQuery.setCardNo(StringUtils.isEmpty(patientManagerRequest.getCardNo()) ? null : patientManagerRequest.getCardNo()); | |
772 | + patientsQuery.setPhone(StringUtils.isEmpty(patientManagerRequest.getPhone()) ? null : patientManagerRequest.getPhone()); | |
773 | + | |
774 | + List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
775 | + List<PatientManagerQueryModel> patientManagerQueryModelList = new ArrayList<>(); | |
776 | + if (CollectionUtils.isNotEmpty(patientsList)) { | |
777 | + for (Patients patients : patientsList) { | |
778 | + PatientManagerQueryModel patientManagerQueryModel = new PatientManagerQueryModel(); | |
779 | + BeanUtils.copy(patients, patientManagerQueryModel); | |
780 | + patientManagerQueryModel.setAge(DateUtil.getAge(patients.getBirth())); | |
781 | + switch (patients.getBuildType()) { | |
782 | + case 0: | |
783 | + patientManagerQueryModel.setServiceType("未分娩建档"); | |
784 | + break; | |
785 | + case 1: | |
786 | + patientManagerQueryModel.setServiceType("儿童建档时建档"); | |
787 | + break; | |
788 | + case 2: | |
789 | + patientManagerQueryModel.setServiceType("自动分娩类型"); | |
790 | + break; | |
791 | + case 3: | |
792 | + patientManagerQueryModel.setServiceType("转诊自动建档"); | |
793 | + break; | |
794 | + default: | |
795 | + patientManagerQueryModel.setServiceType(""); | |
796 | + } | |
797 | + patientManagerQueryModel.setBookbuildingDoctor(StringUtils.isEmpty(patients.getBookbuildingDoctor()) ? "" : usersService.getUsers(Integer.valueOf(patients.getBookbuildingDoctor())).getName()); | |
798 | + patientManagerQueryModel.setBookbuildingDate(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); | |
799 | + patientManagerQueryModel.setAddressRegister(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
800 | + patientManagerQueryModel.setHusbandAddressRegister(CommonsHelper.getResidence(patients.getHprovinceRegisterId(), patients.getHcityRegisterId(), patients.getHareaRegisterId(), patients.getHstreetRegisterId(), patients.getHaddressRegister(), basicConfigService)); | |
801 | + patientManagerQueryModelList.add(patientManagerQueryModel); | |
802 | + } | |
803 | + } | |
804 | + | |
805 | + patientManagerResult.setPageInfo(patientsQuery.getPageInfo()); | |
806 | + patientManagerResult.setData(patientManagerQueryModelList); | |
807 | + patientManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
808 | + patientManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
809 | + return patientManagerResult; | |
810 | + } | |
751 | 811 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PatientManagerRequest.java
View file @
63b9091
1 | +package com.lyms.platform.operate.web.request; | |
2 | + | |
3 | +/** | |
4 | + * @auther HuJiaqi | |
5 | + * @createTime 2016年12月20日 14时33分 | |
6 | + * @discription | |
7 | + */ | |
8 | +public class PatientManagerRequest extends BasePageQueryRequest { | |
9 | + | |
10 | + private Integer operatorId; | |
11 | + | |
12 | + /** | |
13 | + * @auther HuJiaqi | |
14 | + * @createTime 2016年12月20日 14时59分 | |
15 | + * @discription 户口所在地省id | |
16 | + */ | |
17 | + private String provinceRegisterId; | |
18 | + | |
19 | + /** | |
20 | + * @auther HuJiaqi | |
21 | + * @createTime 2016年12月20日 14时59分 | |
22 | + * @discription 户口所在地市id | |
23 | + */ | |
24 | + private String cityRegisterId; | |
25 | + | |
26 | + /** | |
27 | + * @auther HuJiaqi | |
28 | + * @createTime 2016年12月20日 14时59分 | |
29 | + * @discription 户口所在地区县id | |
30 | + */ | |
31 | + private String areaRegisterId; | |
32 | + | |
33 | + /** | |
34 | + * @auther HuJiaqi | |
35 | + * @createTime 2016年12月20日 14时59分 | |
36 | + * @discription 建档日期 | |
37 | + */ | |
38 | + private String bookBuildingDate; | |
39 | + | |
40 | + /** | |
41 | + * @auther HuJiaqi | |
42 | + * @createTime 2016年12月20日 14时59分 | |
43 | + * @discription 姓名 | |
44 | + */ | |
45 | + private String userName; | |
46 | + | |
47 | + /** | |
48 | + * @auther HuJiaqi | |
49 | + * @createTime 2016年12月20日 15时00分 | |
50 | + * @discription 证件号 | |
51 | + */ | |
52 | + private String cardNo; | |
53 | + | |
54 | + /** | |
55 | + * @auther HuJiaqi | |
56 | + * @createTime 2016年12月20日 15时00分 | |
57 | + * @discription 联系方式 | |
58 | + */ | |
59 | + private String phone; | |
60 | + | |
61 | + // 条码号暂时不管 | |
62 | + | |
63 | + public String getProvinceRegisterId() { | |
64 | + return provinceRegisterId; | |
65 | + } | |
66 | + | |
67 | + public void setProvinceRegisterId(String provinceRegisterId) { | |
68 | + this.provinceRegisterId = provinceRegisterId; | |
69 | + } | |
70 | + | |
71 | + public String getCityRegisterId() { | |
72 | + return cityRegisterId; | |
73 | + } | |
74 | + | |
75 | + public void setCityRegisterId(String cityRegisterId) { | |
76 | + this.cityRegisterId = cityRegisterId; | |
77 | + } | |
78 | + | |
79 | + public String getAreaRegisterId() { | |
80 | + return areaRegisterId; | |
81 | + } | |
82 | + | |
83 | + public void setAreaRegisterId(String areaRegisterId) { | |
84 | + this.areaRegisterId = areaRegisterId; | |
85 | + } | |
86 | + | |
87 | + public String getBookBuildingDate() { | |
88 | + return bookBuildingDate; | |
89 | + } | |
90 | + | |
91 | + public void setBookBuildingDate(String bookBuildingDate) { | |
92 | + this.bookBuildingDate = bookBuildingDate; | |
93 | + } | |
94 | + | |
95 | + public String getUserName() { | |
96 | + return userName; | |
97 | + } | |
98 | + | |
99 | + public void setUserName(String userName) { | |
100 | + this.userName = userName; | |
101 | + } | |
102 | + | |
103 | + public String getCardNo() { | |
104 | + return cardNo; | |
105 | + } | |
106 | + | |
107 | + public void setCardNo(String cardNo) { | |
108 | + this.cardNo = cardNo; | |
109 | + } | |
110 | + | |
111 | + public String getPhone() { | |
112 | + return phone; | |
113 | + } | |
114 | + | |
115 | + public void setPhone(String phone) { | |
116 | + this.phone = phone; | |
117 | + } | |
118 | + | |
119 | + public Integer getOperatorId() { | |
120 | + return operatorId; | |
121 | + } | |
122 | + | |
123 | + public void setOperatorId(Integer operatorId) { | |
124 | + this.operatorId = operatorId; | |
125 | + } | |
126 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PatientManagerQueryModel.java
View file @
63b9091
1 | +package com.lyms.platform.operate.web.result; | |
2 | + | |
3 | +/** | |
4 | + * @auther HuJiaqi | |
5 | + * @createTime 2016年12月20日 14时35分 | |
6 | + * @discription | |
7 | + */ | |
8 | +public class PatientManagerQueryModel { | |
9 | + | |
10 | + /** | |
11 | + * @auther HuJiaqi | |
12 | + * @createTime 2016年12月20日 14时42分 | |
13 | + * @discription 姓名 | |
14 | + */ | |
15 | + private String username; | |
16 | + | |
17 | + /** | |
18 | + * @auther HuJiaqi | |
19 | + * @createTime 2016年12月20日 14时42分 | |
20 | + * @discription 年龄 | |
21 | + */ | |
22 | + private Integer age; | |
23 | + | |
24 | + /** | |
25 | + * @auther HuJiaqi | |
26 | + * @createTime 2016年12月20日 14时42分 | |
27 | + * @discription 联系电话 | |
28 | + */ | |
29 | + private String phone; | |
30 | + | |
31 | + /** | |
32 | + * @auther HuJiaqi | |
33 | + * @createTime 2016年12月20日 14时42分 | |
34 | + * @discription 证件号码 | |
35 | + */ | |
36 | + private String cardNo; | |
37 | + | |
38 | + /** | |
39 | + * @auther HuJiaqi | |
40 | + * @createTime 2016年12月20日 14时42分 | |
41 | + * @discription 户口所在地 | |
42 | + */ | |
43 | + private String addressRegister; | |
44 | + | |
45 | + /** | |
46 | + * @auther HuJiaqi | |
47 | + * @createTime 2016年12月20日 14时42分 | |
48 | + * @discription 丈夫姓名 | |
49 | + */ | |
50 | + private String husbandName; | |
51 | + | |
52 | + /** | |
53 | + * @auther HuJiaqi | |
54 | + * @createTime 2016年12月20日 14时42分 | |
55 | + * @discription 丈夫户口所在地 | |
56 | + */ | |
57 | + private String husbandAddressRegister; | |
58 | + | |
59 | + /** | |
60 | + * @auther HuJiaqi | |
61 | + * @createTime 2016年12月20日 14时43分 | |
62 | + * @discription 建档时间 | |
63 | + */ | |
64 | + private String bookbuildingDate; | |
65 | + | |
66 | + /** | |
67 | + * @auther HuJiaqi | |
68 | + * @createTime 2016年12月20日 14时43分 | |
69 | + * @discription 建档医生 | |
70 | + */ | |
71 | + private String bookbuildingDoctor; | |
72 | + | |
73 | + /** | |
74 | + * @auther HuJiaqi | |
75 | + * @createTime 2016年12月20日 14时43分 | |
76 | + * @discription 服务类型 | |
77 | + */ | |
78 | + private String serviceType; | |
79 | + | |
80 | + public String getUsername() { | |
81 | + return username; | |
82 | + } | |
83 | + | |
84 | + public void setUsername(String username) { | |
85 | + this.username = username; | |
86 | + } | |
87 | + | |
88 | + public Integer getAge() { | |
89 | + return age; | |
90 | + } | |
91 | + | |
92 | + public void setAge(Integer age) { | |
93 | + this.age = age; | |
94 | + } | |
95 | + | |
96 | + public String getPhone() { | |
97 | + return phone; | |
98 | + } | |
99 | + | |
100 | + public void setPhone(String phone) { | |
101 | + this.phone = phone; | |
102 | + } | |
103 | + | |
104 | + public String getCardNo() { | |
105 | + return cardNo; | |
106 | + } | |
107 | + | |
108 | + public void setCardNo(String cardNo) { | |
109 | + this.cardNo = cardNo; | |
110 | + } | |
111 | + | |
112 | + public String getHusbandName() { | |
113 | + return husbandName; | |
114 | + } | |
115 | + | |
116 | + public void setHusbandName(String husbandName) { | |
117 | + this.husbandName = husbandName; | |
118 | + } | |
119 | + | |
120 | + public String getAddressRegister() { | |
121 | + return addressRegister; | |
122 | + } | |
123 | + | |
124 | + public void setAddressRegister(String addressRegister) { | |
125 | + this.addressRegister = addressRegister; | |
126 | + } | |
127 | + | |
128 | + public String getHusbandAddressRegister() { | |
129 | + return husbandAddressRegister; | |
130 | + } | |
131 | + | |
132 | + public void setHusbandAddressRegister(String husbandAddressRegister) { | |
133 | + this.husbandAddressRegister = husbandAddressRegister; | |
134 | + } | |
135 | + | |
136 | + public String getBookbuildingDate() { | |
137 | + return bookbuildingDate; | |
138 | + } | |
139 | + | |
140 | + public void setBookbuildingDate(String bookbuildingDate) { | |
141 | + this.bookbuildingDate = bookbuildingDate; | |
142 | + } | |
143 | + | |
144 | + public String getBookbuildingDoctor() { | |
145 | + return bookbuildingDoctor; | |
146 | + } | |
147 | + | |
148 | + public void setBookbuildingDoctor(String bookbuildingDoctor) { | |
149 | + this.bookbuildingDoctor = bookbuildingDoctor; | |
150 | + } | |
151 | + | |
152 | + public String getServiceType() { | |
153 | + return serviceType; | |
154 | + } | |
155 | + | |
156 | + public void setServiceType(String serviceType) { | |
157 | + this.serviceType = serviceType; | |
158 | + } | |
159 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PatientManagerResult.java
View file @
63b9091