Commit 50cb6e99828e010a14cec3134ef8f2fd4d475cbc
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 18 changed files
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/HospitalDoctService.java
- platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
- platform-common/src/main/java/com/lyms/platform/common/utils/LymsEncodeUtil.java
- platform-dal/src/main/java/com/lyms/platform/pojo/PatientWeight.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/MatdeliverFollowController.java
- 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/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/facade/MatdeliverFollowFacade.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/facade/RiskReportFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverFollowAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/MatdeliverFollowListResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HttpClientUtil.java
platform-biz-service/src/main/java/com/lyms/platform/permission/model/HospitalDoctService.java
View file @
50cb6e9
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
50cb6e9
... | ... | @@ -88,6 +88,37 @@ |
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | + * 获取半年的时间 | |
92 | + */ | |
93 | + public static Date getHalfDay(Date date, Integer addHalt, Integer day) { | |
94 | + if(date != null) { | |
95 | + if(getMonth(date) > 6) { | |
96 | + Calendar calendar = Calendar.getInstance(); | |
97 | + calendar.setTime(date); | |
98 | + calendar.set(Calendar.MONTH, day == 0 ? 6 + (addHalt + 1) * 6 : 6 + addHalt * 6); | |
99 | + calendar.set(Calendar.DAY_OF_MONTH, day); | |
100 | + return getYmdDate(calendar.getTime()); | |
101 | + } | |
102 | + } | |
103 | + return null; | |
104 | + } | |
105 | + | |
106 | + /** | |
107 | + * 获取一年的时间 | |
108 | + */ | |
109 | + public static Date getYear(Date date, Integer addYear, Integer day) { | |
110 | + if(date != null) { | |
111 | + Calendar calendar = Calendar.getInstance(); | |
112 | + calendar.setTime(date); | |
113 | + calendar.add(Calendar.YEAR, addYear); | |
114 | + calendar.set(Calendar.MONTH, day == 0 ? 11 : 0); | |
115 | + calendar.set(Calendar.DAY_OF_MONTH, day == 0 ? 31 : 1); | |
116 | + return getYmdDate(calendar.getTime()); | |
117 | + } | |
118 | + return null; | |
119 | + } | |
120 | + | |
121 | + /** | |
91 | 122 | * 1月~3月 4~6 7~9 10~11 |
92 | 123 | * 获取当前时间属于哪个季度 |
93 | 124 | * @param date |
... | ... | @@ -1335,6 +1366,20 @@ |
1335 | 1366 | return result; |
1336 | 1367 | } |
1337 | 1368 | |
1369 | + /** | |
1370 | + * 获取近xx天的时间 | |
1371 | + */ | |
1372 | + public static List<String> getBetweenDay(int size) { | |
1373 | + List<String> restList = new ArrayList<>(); | |
1374 | + Calendar calendar = Calendar.getInstance(); | |
1375 | + restList.add(getyyyy_MM_dd(calendar.getTime())); | |
1376 | + for (int i = 1; i < size; i++) { | |
1377 | + calendar.add(Calendar.DAY_OF_MONTH, -1); | |
1378 | + restList.add(getyyyy_MM_dd(calendar.getTime())); | |
1379 | + } | |
1380 | + return restList; | |
1381 | + } | |
1382 | + | |
1338 | 1383 | public static void main(String[] args) { |
1339 | 1384 | /* List<Map<String, Date>> monthBetween = getRange(parseYMD("2017-1-11"), parseYMD("2017-3-11")); |
1340 | 1385 | for (Map<String, Date> map : monthBetween) { |
... | ... | @@ -1343,14 +1388,24 @@ |
1343 | 1388 | System.out.println(" end>> " + getyyyy_MM_dd(map.get("end"))); |
1344 | 1389 | }*/ |
1345 | 1390 | |
1346 | - System.out.println("当月第一天: " + getMonthDay(new Date(), 0, 1).toLocaleString()); | |
1347 | - System.out.println("当月最后一天: " + getMonthDay(new Date(), 0, 0).toLocaleString()); | |
1348 | - System.out.println("上月第一天: " + getMonthDay(new Date(), -1, 1).toLocaleString()); | |
1349 | - System.out.println("上月最后一天: " + getMonthDay(new Date(), -1, 0).toLocaleString()); | |
1350 | - System.out.println("当前季度第一天: " + getQuartDay(new Date(), 0, 1).toLocaleString()); | |
1351 | - System.out.println("当前季度最后一天: " + getQuartDay(new Date(), 0, 0).toLocaleString()); | |
1352 | - System.out.println("上个季度第一天: " + getQuartDay(new Date(), -1, 1).toLocaleString()); | |
1353 | - System.out.println("上个季度最后一天: " + getQuartDay(new Date(), -1, 0).toLocaleString()); | |
1391 | + Date date = parseDate("2017-12-11"); | |
1392 | + System.out.println("当月第一天: " + getMonthDay(date, 0, 1).toLocaleString()); | |
1393 | + System.out.println("当月最后一天: " + getMonthDay(date, 0, 0).toLocaleString()); | |
1394 | + System.out.println("上月第一天: " + getMonthDay(date, -1, 1).toLocaleString()); | |
1395 | + System.out.println("上月最后一天: " + getMonthDay(date, -1, 0).toLocaleString()); | |
1396 | + System.out.println("当前季度第一天: " + getQuartDay(date, 0, 1).toLocaleString()); | |
1397 | + System.out.println("当前季度最后一天: " + getQuartDay(date, 0, 0).toLocaleString()); | |
1398 | + System.out.println("上个季度第一天: " + getQuartDay(date, -1, 1).toLocaleString()); | |
1399 | + System.out.println("上个季度最后一天: " + getQuartDay(date, -1, 0).toLocaleString()); | |
1400 | + System.out.println("半年的第一天: " + getHalfDay(date, 0, 1).toLocaleString()); | |
1401 | + System.out.println("半年的最后一天: " + getHalfDay(date, 0, 0).toLocaleString()); | |
1402 | + System.out.println("上个半年的第一天: " + getHalfDay(date, -1, 1).toLocaleString()); | |
1403 | + System.out.println("上个半年的最后一天: " + getHalfDay(date, -1, 0).toLocaleString()); | |
1404 | + System.out.println("当前年的第一天: " + getYear(date, 0, 1).toLocaleString()); | |
1405 | + System.out.println("当前年的最后一天: " + getYear(date, 0, 0).toLocaleString()); | |
1406 | + System.out.println("上一年的第一天: " + getYear(date, -1, 1).toLocaleString()); | |
1407 | + System.out.println("上一年的最后一天: " + getYear(date, -1, 0).toLocaleString()); | |
1408 | + System.out.println(getBetweenDay(7)); | |
1354 | 1409 | } |
1355 | 1410 | |
1356 | 1411 | } |
platform-common/src/main/java/com/lyms/platform/common/utils/LymsEncodeUtil.java
View file @
50cb6e9
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | |
27 | 27 | String encrypt = aesEncrypt("com.lyms.platform.pojo.PatientWeight", key); System.out.println("加密后:" + encrypt); |
28 | 28 | |
29 | - String json = aesDecrypt("26EB0301C4A2410E90985A3E55856E4BCB0B8BBABA86F0708151BE6D196C9E96ED08D7D1CEACE8584EAB3D90C3637802", key); | |
29 | + String json = aesDecrypt("522E50C6944F903BCAAF46E5078F8A517CEC505DC2BA5ABA52E16CC7A5593909", key); | |
30 | 30 | System.out.println("解密后:" + json); |
31 | 31 | |
32 | 32 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/PatientWeight.java
View file @
50cb6e9
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.beans.SerialIdEnum; |
4 | 4 | import com.lyms.platform.common.result.BaseModel; |
5 | +import org.springframework.data.annotation.Transient; | |
5 | 6 | import org.springframework.data.mongodb.core.mapping.Document; |
6 | 7 | |
7 | 8 | import java.util.*; |
... | ... | @@ -11,6 +12,17 @@ |
11 | 12 | */ |
12 | 13 | @Document(collection="lyms_patient_weight") |
13 | 14 | public class PatientWeight extends BaseModel { |
15 | + | |
16 | + @Transient | |
17 | + private List<Map<String, Object>> weightInfo; | |
18 | + | |
19 | + public List<Map<String, Object>> getWeightInfo() { | |
20 | + return weightInfo; | |
21 | + } | |
22 | + | |
23 | + public void setWeightInfo(List<Map<String, Object>> weightInfo) { | |
24 | + this.weightInfo = weightInfo; | |
25 | + } | |
14 | 26 | |
15 | 27 | private String hospitalName; |
16 | 28 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ConfigServiceController.java
View file @
50cb6e9
... | ... | @@ -7,8 +7,13 @@ |
7 | 7 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
8 | 8 | import com.lyms.platform.common.result.BaseListResponse; |
9 | 9 | import com.lyms.platform.common.result.BaseResponse; |
10 | +import com.lyms.platform.common.utils.StringUtils; | |
10 | 11 | import com.lyms.platform.operate.web.facade.ConfigServiceFacade; |
11 | -import com.lyms.platform.permission.model.PatientService; | |
12 | +import com.lyms.platform.operate.web.utils.CollectionUtils; | |
13 | +import com.lyms.platform.permission.model.HospitalServiceContent; | |
14 | +import com.lyms.platform.permission.model.Organization; | |
15 | +import com.lyms.platform.permission.model.OrganizationQuery; | |
16 | +import com.lyms.platform.permission.service.OrganizationService; | |
12 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
13 | 18 | import org.springframework.stereotype.Controller; |
14 | 19 | import org.springframework.web.bind.annotation.RequestMapping; |
... | ... | @@ -16,6 +21,7 @@ |
16 | 21 | import org.springframework.web.bind.annotation.ResponseBody; |
17 | 22 | |
18 | 23 | import javax.servlet.http.HttpServletRequest; |
24 | +import java.util.List; | |
19 | 25 | |
20 | 26 | /** |
21 | 27 | * @auther yangfei |
22 | 28 | |
... | ... | @@ -28,7 +34,10 @@ |
28 | 34 | |
29 | 35 | @Autowired |
30 | 36 | private ConfigServiceFacade configServiceFacade; |
37 | + @Autowired | |
38 | + private OrganizationService organizationService; | |
31 | 39 | |
40 | + | |
32 | 41 | /** |
33 | 42 | * 初始化接口 |
34 | 43 | * |
35 | 44 | |
36 | 45 | |
37 | 46 | |
38 | 47 | |
39 | 48 | |
... | ... | @@ -48,24 +57,39 @@ |
48 | 57 | * 新增或修改服务开通记录 |
49 | 58 | * |
50 | 59 | * @param ps 服务开通记录 |
60 | + * @param isAutoDoct 是否自动生成专家咨询的服务的数据 | |
61 | + * @param hospitalName 医院名称 | |
51 | 62 | * @param request |
52 | 63 | * @return |
53 | 64 | */ |
54 | 65 | @ResponseBody |
55 | 66 | @TokenRequired |
56 | 67 | @RequestMapping(value = "/addOrUpdate", method = RequestMethod.POST) |
57 | - public BaseResponse addOrUpdatePatientService(PatientService ps, HttpServletRequest request) { | |
68 | + public BaseResponse addOrUpdatePatientService(HospitalServiceContent ps,String hospitalName,boolean isAutoDoct, HttpServletRequest request) { | |
58 | 69 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
70 | + | |
71 | + if(StringUtils.isNotEmpty(hospitalName)){ | |
72 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
73 | + organizationQuery.setName(hospitalName); | |
74 | + List<Organization> organizations = organizationService.queryOrganization(organizationQuery); | |
75 | + if(CollectionUtils.isNotEmpty(organizations)){ | |
76 | + Organization organization = organizations.get(0); | |
77 | + ps.setHospitalId(String.valueOf(organization.getId())); | |
78 | + } | |
79 | + } | |
80 | + | |
81 | + | |
59 | 82 | try { |
60 | 83 | BaseResponse baseResponse = validatePatient(ps); |
61 | 84 | if (baseResponse.getErrorcode() != ErrorCodeConstants.SUCCESS) { |
62 | 85 | return baseResponse; |
63 | 86 | } |
64 | - return configServiceFacade.addHospitalService(ps, loginState.getId()); | |
87 | + return configServiceFacade.addHospitalService(ps,isAutoDoct, loginState.getId()); | |
65 | 88 | } catch (Exception e) { |
89 | + e.printStackTrace(); | |
66 | 90 | BaseResponse baseResponse = new BaseResponse(); |
67 | 91 | baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); |
68 | - baseResponse.setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION); | |
92 | + baseResponse.setErrormsg(e.getMessage()); | |
69 | 93 | return baseResponse; |
70 | 94 | } |
71 | 95 | |
72 | 96 | |
... | ... | @@ -108,9 +132,25 @@ |
108 | 132 | * @param ps |
109 | 133 | * @return |
110 | 134 | */ |
111 | - public BaseResponse validatePatient(PatientService ps) { | |
135 | + public BaseResponse validatePatient(HospitalServiceContent ps) { | |
112 | 136 | BaseResponse baseResponse = new BaseResponse(); |
113 | - | |
137 | + //医院Id | |
138 | + if(StringUtils.isEmpty(ps.getHospitalId())){ | |
139 | + baseResponse.setErrormsg("请传入hospitalId"); | |
140 | + baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
141 | + return baseResponse; | |
142 | + } | |
143 | + //服务价格 | |
144 | + if(ps.getSerType()==null){ | |
145 | + baseResponse.setErrormsg("请传入serType:1-孕期精准医疗、2-体重管理、3-血糖管理、4-血压管理、5-专家咨询、6-标准服务"); | |
146 | + baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
147 | + return baseResponse; | |
148 | + } | |
149 | + if(ps.getSerPrice()==null){ | |
150 | + baseResponse.setErrormsg("请传入serPrice服务价格"); | |
151 | + baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
152 | + return baseResponse; | |
153 | + } | |
114 | 154 | baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
115 | 155 | return baseResponse; |
116 | 156 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatdeliverFollowController.java
View file @
50cb6e9
... | ... | @@ -55,46 +55,27 @@ |
55 | 55 | @TokenRequired |
56 | 56 | @RequestMapping(value = "/addMatdeliverInfo", method = RequestMethod.POST) |
57 | 57 | public BaseResponse addMatdeliverInfo(MatDeliverFollowAddRequest matDeliverFollowAddRequest, HttpServletRequest request) { |
58 | - System.out.println(matDeliverFollowAddRequest); | |
58 | + System.out.println("保存或修改随访记录:"+matDeliverFollowAddRequest); | |
59 | 59 | Integer userId = getUserId(request); |
60 | 60 | return matdeliverFollowFacade.addOrUpdateMatDeliverFollow(matDeliverFollowAddRequest, userId); |
61 | 61 | } |
62 | 62 | |
63 | - // /** | |
64 | - // * 查询分娩记录、随访记录 | |
65 | - // * @param pid 产妇pid | |
66 | - // * @param id 分娩记录id | |
67 | - // * @param request | |
68 | - // * @return | |
69 | - // */ | |
70 | - // @ResponseBody | |
71 | - // @TokenRequired | |
72 | - // @RequestMapping(method = RequestMethod.GET) | |
73 | - // public BaseResponse findpostpartumFollowMakeList(String pid, String id, HttpServletRequest request) { | |
74 | - // LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
75 | - // | |
76 | - // return postpartumFollowMakeFacade.findPostpartumFollowMakeList(pid, id, loginState.getId()); | |
77 | - // } | |
63 | + /** | |
64 | + * 查询分娩记录、随访记录 | |
65 | + * | |
66 | + * @param pid 产妇pid | |
67 | + * @param id 分娩记录id | |
68 | + * @param request | |
69 | + * @return | |
70 | + */ | |
71 | + @ResponseBody | |
72 | + @TokenRequired | |
73 | + @RequestMapping(method = RequestMethod.GET) | |
74 | + public BaseResponse findpostpartumFollowMakeList(String pid, String id, HttpServletRequest request) { | |
75 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
78 | 76 | |
79 | - // @ResponseBody | |
80 | - // @TokenRequired | |
81 | - // @RequestMapping(method = RequestMethod.POST) | |
82 | - // public BaseResponse addOrUpdatePostpartumFollowMake(PostpartumFollowMake ps, HttpServletRequest request) { | |
83 | - // LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
84 | - // try { | |
85 | - // if (StringUtils.isEmpty(ps.getId())) { | |
86 | - // return postpartumFollowMakeFacade.addPostpartumFollowMake(ps, loginState.getId()); | |
87 | - // } else { | |
88 | - // return postpartumFollowMakeFacade.updatePostpartumFollowMake(ps, loginState.getId()); | |
89 | - // } | |
90 | - // } catch (Exception e) { | |
91 | - // BaseResponse baseResponse = new BaseResponse(); | |
92 | - // baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); | |
93 | - // baseResponse.setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION); | |
94 | - // return baseResponse; | |
95 | - // } | |
96 | - // | |
97 | - // } | |
77 | + return matdeliverFollowFacade.findPostpartumFollowMakeList(pid, id, loginState.getId()); | |
78 | + } | |
98 | 79 | |
99 | 80 | @ResponseBody |
100 | 81 | @TokenRequired |
... | ... | @@ -113,6 +94,5 @@ |
113 | 94 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
114 | 95 | return matdeliverFollowFacade.getPostpartumFollowMake(MatdeliverFollowRequest, loginState.getId()); |
115 | 96 | } |
116 | - | |
117 | 97 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
50cb6e9
... | ... | @@ -347,6 +347,7 @@ |
347 | 347 | BaseListResponse baseListResponse; |
348 | 348 | try { |
349 | 349 | patientManagerRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); |
350 | +// PatientManagerResult patientManagerResult = patientFacade.patientManager(patientManagerRequest); | |
350 | 351 | PatientManagerResult patientManagerResult = patientFacade.patientManager(patientManagerRequest); |
351 | 352 | if (patientManagerResult.getErrorcode() != ErrorCodeConstants.SUCCESS) { |
352 | 353 | baseListResponse = new BaseListResponse().setErrorcode(patientManagerResult.getErrorcode()).setErrormsg(patientManagerResult.getErrormsg()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ConfigServiceFacade.java
View file @
50cb6e9
... | ... | @@ -4,7 +4,6 @@ |
4 | 4 | import com.lyms.platform.common.base.PageInfo; |
5 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
6 | 6 | import com.lyms.platform.common.enums.HospitalSerStatusEnums; |
7 | -import com.lyms.platform.common.enums.OptActionEnums; | |
8 | 7 | import com.lyms.platform.common.enums.PatientSerEnums; |
9 | 8 | import com.lyms.platform.common.result.BaseListResponse; |
10 | 9 | import com.lyms.platform.common.result.BaseObjectResponse; |
11 | 10 | |
... | ... | @@ -17,11 +16,11 @@ |
17 | 16 | import com.lyms.platform.permission.model.*; |
18 | 17 | import com.lyms.platform.permission.service.*; |
19 | 18 | import com.lyms.platform.pojo.BasicConfig; |
20 | -import com.lyms.platform.pojo.Patients; | |
21 | 19 | import org.apache.commons.collections.CollectionUtils; |
22 | 20 | import org.springframework.beans.factory.annotation.Autowired; |
23 | 21 | import org.springframework.stereotype.Component; |
24 | 22 | |
23 | +import java.math.BigDecimal; | |
25 | 24 | import java.util.*; |
26 | 25 | |
27 | 26 | /** |
28 | 27 | |
... | ... | @@ -90,11 +89,11 @@ |
90 | 89 | List<HospitalServiceContent> hospitalServiceContents = hospitalServiceContentService.queryHospitalServiceContent(hscQuery); |
91 | 90 | List<HospitalServiceContentResult> hscResult = new ArrayList<>(); |
92 | 91 | |
93 | - Map<String,HospitalServiceContentResult> hscMap = new HashMap<>(); | |
94 | - for(HospitalServiceContent hsc:hospitalServiceContents){ | |
92 | + Map<String, HospitalServiceContentResult> hscMap = new HashMap<>(); | |
93 | + for (HospitalServiceContent hsc : hospitalServiceContents) { | |
95 | 94 | HospitalServiceContentResult convertResult = convertToResult(hsc); |
96 | 95 | hscResult.add(convertResult); |
97 | - hscMap.put(hsc.getId(),convertResult); | |
96 | + hscMap.put(hsc.getId(), convertResult); | |
98 | 97 | } |
99 | 98 | HospitalDoctServiceQuery hospitalDoctServiceQuery = new HospitalDoctServiceQuery(); |
100 | 99 | //状态 1--有效 |
101 | 100 | |
... | ... | @@ -102,9 +101,9 @@ |
102 | 101 | hospitalDoctServiceQuery.setHospId(hsId); |
103 | 102 | List<HospitalDoctService> hospitalDoctServiceList = hospitalDoctService.queryHospitalDoctService(hospitalDoctServiceQuery); |
104 | 103 | //给医院服务加入医生的服务价格信息 |
105 | - for(HospitalDoctService hds:hospitalDoctServiceList){ | |
104 | + for (HospitalDoctService hds : hospitalDoctServiceList) { | |
106 | 105 | HospitalServiceContentResult hsc = hscMap.get(hds.getHospServiceId()); |
107 | - if(hsc!=null){ | |
106 | + if (hsc != null) { | |
108 | 107 | hsc.getHospitalDoctServices().add(doctServiceConvertToResult(hds)); |
109 | 108 | } |
110 | 109 | } |
111 | 110 | |
112 | 111 | |
113 | 112 | |
114 | 113 | |
115 | 114 | |
116 | 115 | |
117 | 116 | |
118 | 117 | |
119 | 118 | |
... | ... | @@ -118,52 +117,57 @@ |
118 | 117 | |
119 | 118 | |
120 | 119 | /** |
121 | - * 新增服务开通记录 | |
120 | + * 新增医院服务配置 | |
122 | 121 | * |
123 | 122 | * @param ps |
124 | 123 | * @param id |
125 | 124 | * @return |
126 | 125 | */ |
127 | - public BaseResponse addHospitalService(PatientService ps, Integer id) throws Exception { | |
126 | + public BaseResponse addHospitalService(HospitalServiceContent ps,boolean isAutoDoct, Integer id) throws Exception { | |
128 | 127 | //根据用户id获取医院ID |
129 | - String hospitalId = autoMatchFacade.getHospitalId(id); | |
130 | - List<Map<String, String>> serInfos = ps.getSerInfos(); | |
128 | + HospitalServiceContentQuery patientQuery = new HospitalServiceContentQuery(); | |
129 | + patientQuery.setHospitalId(ps.getHospitalId()); | |
130 | + patientQuery.setSerType(ps.getSerType()); | |
131 | 131 | |
132 | - List<PatientService> patientServiceList = new ArrayList<>(); | |
133 | - for (Map<String, String> serInfo : serInfos) { | |
134 | - //先根据孕妇id和开通服务类型、开通医生进行查询,如果已经开通过则开通失败 | |
135 | - PatientServiceQuery patientQuery = new PatientServiceQuery(); | |
136 | - patientQuery.setHospitalId(hospitalId); | |
137 | - patientQuery.setParentid(ps.getParentid()); | |
138 | - patientQuery.setSerType(Integer.parseInt(serInfo.get("serType"))); | |
139 | 132 | |
140 | - | |
141 | - List<PatientService> patientServices = patientServiceService.queryPatientService(patientQuery); | |
142 | - if (CollectionUtils.isNotEmpty(patientServices)) { | |
143 | - continue; | |
144 | - } | |
145 | - | |
146 | - Patients patients = patientsService.findOnePatientById(ps.getParentid()); | |
147 | - if (patients != null) { | |
148 | - ps.setPid(patients.getPid()); | |
149 | - } | |
133 | + List<HospitalServiceContent> patientServices = hospitalServiceContentService.queryGroupHospitalServiceContent(patientQuery); | |
134 | + if (CollectionUtils.isNotEmpty(patientServices)) {//修改 | |
135 | + HospitalServiceContent hospitalServiceContent = patientServices.get(0); | |
136 | + hospitalServiceContent.setSyncStatus(0); | |
137 | + hospitalServiceContent.setSerPrice(ps.getSerPrice()); | |
138 | + hospitalServiceContentService.updateHospitalServiceContent(hospitalServiceContent); | |
139 | + }else{ | |
150 | 140 | ps.setId(UUID.randomUUID().toString().replace("-", "")); |
151 | - | |
152 | - ps.setHospitalId(hospitalId); | |
141 | + ps.setSyncStatus(0); | |
153 | 142 | //默认开通状态 |
154 | - ps.setSerStatus(PatientSerEnums.SerStatusEnums.kt.getId()); | |
143 | + ps.setStatus(1); | |
155 | 144 | //服务类型 |
156 | - ps.setSerType(Integer.parseInt(serInfo.get("serType"))); | |
157 | - if (serInfo.containsKey(serInfo.get("serDoct"))) { | |
158 | - ps.setSerDoct(serInfo.get("serDoct")); | |
159 | - } | |
160 | - patientServiceService.addPatientService(ps); | |
145 | + ps.setCreateDate(new Date()); | |
146 | + ps.setCreateUser(String.valueOf(id)); | |
147 | + hospitalServiceContentService.addHospitalServiceContent(ps); | |
161 | 148 | |
162 | - operateLogFacade.addAddOptLog(id, Integer.valueOf(hospitalId), ps, OptActionEnums.ADD.getId(), "开通增值服务"); | |
163 | - | |
164 | - patientServiceList.add(ps); | |
149 | + //自动创建专家咨询服务医生配置 | |
150 | + if(ps.getSerType() == PatientSerEnums.SerTypeEnums.zjzx.getId() && isAutoDoct){ | |
151 | + //查询医院 | |
152 | + String hospitalId = ps.getHospitalId(); | |
153 | + UsersQuery usersQuery = new UsersQuery(); | |
154 | + usersQuery.setOrgId(Integer.parseInt(hospitalId)); | |
155 | + usersQuery.setYn(1); | |
156 | + usersQuery.setEnable(1); | |
157 | + List<Users> users = usersService.queryUsers(usersQuery); | |
158 | + for(Users us:users){ | |
159 | + HospitalDoctService doctService = new HospitalDoctService(); | |
160 | + doctService.setId(UUID.randomUUID().toString().replace("-", "")); | |
161 | + doctService.setSyncStatus(0); | |
162 | + doctService.setStatus(1); | |
163 | + doctService.setDoctId(String.valueOf(us.getId())); | |
164 | + doctService.setDoctPrice(new BigDecimal(0)); | |
165 | + doctService.setHospId(ps.getHospitalId()); | |
166 | + doctService.setHospServiceId(ps.getId()); | |
167 | + hospitalDoctService.addHospitalDoctService(doctService); | |
168 | + } | |
169 | + } | |
165 | 170 | } |
166 | - | |
167 | 171 | BaseResponse baseResponse = new BaseResponse(); |
168 | 172 | baseResponse.setObject(ps.getId()); |
169 | 173 | baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
... | ... | @@ -207,7 +211,7 @@ |
207 | 211 | } |
208 | 212 | } |
209 | 213 | |
210 | - if(hs.getStatus()!=null){ | |
214 | + if (hs.getStatus() != null) { | |
211 | 215 | result.setStatus(HospitalSerStatusEnums.getNameById(hs.getStatus())); |
212 | 216 | } |
213 | 217 | return result; |
214 | 218 | |
215 | 219 | |
216 | 220 | |
217 | 221 | |
218 | 222 | |
... | ... | @@ -261,23 +265,23 @@ |
261 | 265 | } |
262 | 266 | } |
263 | 267 | |
264 | - if(StringUtils.isNotEmpty(hs.getSerTypes())){ | |
265 | - String serTypes [] = hs.getSerTypes().split(","); | |
268 | + if (StringUtils.isNotEmpty(hs.getSerTypes())) { | |
269 | + String serTypes[] = hs.getSerTypes().split(","); | |
266 | 270 | StringBuffer stb = new StringBuffer(); |
267 | - for(String st:serTypes){ | |
271 | + for (String st : serTypes) { | |
268 | 272 | String serType = PatientSerEnums.SerTypeEnums.getTitle(Integer.parseInt(st)); |
269 | - stb.append(serType+"/"); | |
273 | + stb.append(serType + "/"); | |
270 | 274 | } |
271 | - result.setSerTypeName(stb.toString().substring(0,stb.length()-1)); | |
275 | + result.setSerTypeName(stb.toString().substring(0, stb.length() - 1)); | |
272 | 276 | } |
273 | 277 | |
274 | - if(hs.getSerType()!=null){ | |
278 | + if (hs.getSerType() != null) { | |
275 | 279 | result.setSerTypeName(PatientSerEnums.SerTypeEnums.getTitle(hs.getSerType())); |
276 | 280 | } |
277 | 281 | result.setSerPrice(hs.getSerPrice()); |
278 | 282 | result.setSerType(hs.getSerType()); |
279 | 283 | result.setCreateDate(DateUtil.getyyyy_MM_dd(hs.getCreateDate())); |
280 | - if(hs.getStatus()!=null){ | |
284 | + if (hs.getStatus() != null) { | |
281 | 285 | result.setStatus(HospitalSerStatusEnums.getNameById(hs.getStatus())); |
282 | 286 | } |
283 | 287 | return result; |
284 | 288 | |
... | ... | @@ -286,13 +290,13 @@ |
286 | 290 | /** |
287 | 291 | * 根据条件查询医院服务记录 |
288 | 292 | * |
289 | - * @param pageInfo 分页信息 | |
293 | + * @param pageInfo 分页信息 | |
290 | 294 | * @return |
291 | 295 | */ |
292 | 296 | public BaseListResponse getHospitalService(PageInfo pageInfo, Integer id) { |
293 | 297 | //根据用户id获取医院ID |
294 | 298 | String hospitalId = autoMatchFacade.getHospitalId(id); |
295 | - HospitalServiceContentQuery hdsQuery = new HospitalServiceContentQuery(); | |
299 | + HospitalServiceContentQuery hdsQuery = new HospitalServiceContentQuery(); | |
296 | 300 | hdsQuery.setHospitalId(hospitalId); |
297 | 301 | hdsQuery.setSort("create_date desc"); |
298 | 302 | hdsQuery.setNeed("y"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
50cb6e9
... | ... | @@ -1217,6 +1217,7 @@ |
1217 | 1217 | |
1218 | 1218 | for(MaternalDeliverModel deliverModel : maternalDeliverModelList){ |
1219 | 1219 | MatdeliverFollowListResult matdeliverFollowListResult = patientsMap.get(deliverModel.getParentId()); |
1220 | + matdeliverFollowListResult.setId(deliverModel.getId()); | |
1220 | 1221 | //机构信息 |
1221 | 1222 | Organization organization = organizationService.getOrganization(Integer.valueOf(deliverModel.getFmHospital())); |
1222 | 1223 | // 市 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatdeliverFollowFacade.java
View file @
50cb6e9
... | ... | @@ -54,6 +54,15 @@ |
54 | 54 | map.put("visitResult", PostpartumFollowMakeEnums.getResultEnum()); |
55 | 55 | //访视状态(1-待访视、2-已访视) |
56 | 56 | map.put("visitStatus", PostpartumFollowMakeEnums.getStatusEnum()); |
57 | + //访视类型 | |
58 | + map.put("followType", PostpartumFollowMakeEnums.getTypeEnum()); | |
59 | + //异常 | |
60 | + map.put("errorType", PostpartumFollowMakeEnums.getErrorTypeEnum()); | |
61 | + //预约失败原因 | |
62 | + map.put("contactReasonEnum", PostpartumFollowMakeEnums.getContactReasonEnum()); | |
63 | + //访视确认 | |
64 | + map.put("visitAffirm", PostpartumFollowMakeEnums.getVisitAffirmEnum()); | |
65 | + | |
57 | 66 | |
58 | 67 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setData(map); |
59 | 68 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
50cb6e9
... | ... | @@ -1106,6 +1106,116 @@ |
1106 | 1106 | return patientManagerResult; |
1107 | 1107 | } |
1108 | 1108 | |
1109 | + public PatientManagerResult patientManager2(PatientManagerRequest patientManagerRequest) { | |
1110 | + PatientManagerResult patientManagerResult = new PatientManagerResult(); | |
1111 | + | |
1112 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
1113 | + | |
1114 | + if (patientManagerRequest.getBuildWeekStart() != null) { | |
1115 | + patientsQuery.setBuildDaysStart(patientManagerRequest.getBuildWeekStart() * 7); | |
1116 | + } | |
1117 | + | |
1118 | + if (patientManagerRequest.getBuildWeekEnd() != null) { | |
1119 | + patientsQuery.setBuildDaysEnd((patientManagerRequest.getBuildWeekEnd() + 1) * 7 - 1); | |
1120 | + } | |
1121 | + | |
1122 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
1123 | + if (!patientManagerRequest.isExcel()) { | |
1124 | + patientsQuery.setNeed("need"); | |
1125 | + patientsQuery.setLimit(patientManagerRequest.getLimit()); | |
1126 | + patientsQuery.setPage(patientManagerRequest.getPage()); | |
1127 | + } | |
1128 | + //排查本院隐藏建档 | |
1129 | + patientsQuery.setExtEnable(false); | |
1130 | + patientsQuery.setBuildTypeNot(1); | |
1131 | + patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(patientManagerRequest.getOperatorId())); | |
1132 | + patientsQuery.setProvinceId(StringUtils.isEmpty(patientManagerRequest.getProvinceRegisterId()) ? null : patientManagerRequest.getProvinceRegisterId()); | |
1133 | + patientsQuery.setCityId(StringUtils.isEmpty(patientManagerRequest.getCityRegisterId()) ? null : patientManagerRequest.getCityRegisterId()); | |
1134 | + patientsQuery.setAreaId(StringUtils.isEmpty(patientManagerRequest.getAreaRegisterId()) ? null : patientManagerRequest.getAreaRegisterId()); | |
1135 | + patientsQuery.setStreetId(StringUtils.isEmpty(patientManagerRequest.getStreetRegisterId()) ? null : patientManagerRequest.getStreetRegisterId()); | |
1136 | + patientsQuery.setStreetRegisterId(StringUtils.isEmpty(patientManagerRequest.getStreetId()) ? null : patientManagerRequest.getStreetId()); | |
1137 | + // UsersQuery usersQuery = new UsersQuery(); | |
1138 | + // usersQuery.setName(patientManagerRequest.getBookbuildingDoctor()); | |
1139 | + // usersQuery.setYn(YnEnums.YES.getId()); | |
1140 | + // List<Users> usersList = usersService.queryUsers(usersQuery); | |
1141 | + // if (CollectionUtils.isNotEmpty(usersList)) { | |
1142 | + // List<String> bookbuildingDoctorList = new ArrayList<>(); | |
1143 | + // for (Users users : usersList) { | |
1144 | + // bookbuildingDoctorList.add(users.getId().toString()); | |
1145 | + // } | |
1146 | + // patientsQuery.setBookbuildingDoctorList(bookbuildingDoctorList); | |
1147 | + // } | |
1148 | + patientsQuery.setBookbuildingDoctor(StringUtils.isEmpty(patientManagerRequest.getBookbuildingDoctor()) ? null : patientManagerRequest.getBookbuildingDoctor()); | |
1149 | + patientsQuery.setProvinceRegisterId(StringUtils.isEmpty(patientManagerRequest.getProvinceId()) ? null : patientManagerRequest.getProvinceId()); | |
1150 | + patientsQuery.setCityRegisterId(StringUtils.isEmpty(patientManagerRequest.getCityId()) ? null : patientManagerRequest.getCityId()); | |
1151 | + patientsQuery.setAreaRegisterId(StringUtils.isEmpty(patientManagerRequest.getAreaId()) ? null : patientManagerRequest.getAreaId()); | |
1152 | + if (StringUtils.isNotEmpty(patientManagerRequest.getBookBuildingDate())) { | |
1153 | + try { | |
1154 | + patientsQuery.setBookbuildingDateStart(DateUtil.getSNDate(patientManagerRequest.getBookBuildingDate())[0]); | |
1155 | + patientsQuery.setBookbuildingDateEnd(DateUtil.getSNDate(patientManagerRequest.getBookBuildingDate())[1]); | |
1156 | + } catch (Exception e) { | |
1157 | + // 什么都不做,这里是数据传入错误了 | |
1158 | + } | |
1159 | + } | |
1160 | + patientsQuery.setQueryNo(StringUtils.isEmpty(patientManagerRequest.getQueryNo()) ? null : patientManagerRequest.getQueryNo()); | |
1161 | + | |
1162 | + List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
1163 | + List<PatientManagerQueryModel> patientManagerQueryModelList = new ArrayList<>(); | |
1164 | + if (CollectionUtils.isNotEmpty(patientsList)) { | |
1165 | + for (Patients patients : patientsList) { | |
1166 | + PatientManagerQueryModel patientManagerQueryModel = new PatientManagerQueryModel(); | |
1167 | + BeanUtils.copy(patients, patientManagerQueryModel); | |
1168 | + patientManagerQueryModel.setAge(DateUtil.getAge(patients.getBirth())); | |
1169 | + patientManagerQueryModel.setpId(patients.getPid()); | |
1170 | + String dueWeek = ""; | |
1171 | + try { | |
1172 | + // && patients.getBuildType() == 2 | |
1173 | + if (patients.getBookbuildingDate().getTime() - patients.getDueDate().getTime() > 0) { | |
1174 | + dueWeek = "已分娩"; | |
1175 | + } else { | |
1176 | + int days = DateUtil.daysBetween(patients.getLastMenses(), patients.getBookbuildingDate()); | |
1177 | + if (days > 7 * 42 - 1) { | |
1178 | + dueWeek = "已分娩"; | |
1179 | + } else { | |
1180 | + String week = (days / 7) + ""; | |
1181 | + int day = (days % 7); | |
1182 | + dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); | |
1183 | + } | |
1184 | + } | |
1185 | + } catch (Exception e) { | |
1186 | + // 什么都不干 | |
1187 | + } | |
1188 | + patientManagerQueryModel.setPhone(DefenceUtils.getPhone(patients.getPhone())); | |
1189 | + patientManagerQueryModel.setCardNo(DefenceUtils.getCardNo(patients.getCardNo())); | |
1190 | + patientManagerQueryModel.setBuildWeek(dueWeek); | |
1191 | + | |
1192 | + String bookbuildingDoctor = ""; | |
1193 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { | |
1194 | + Users user = usersService.getUsers(Integer.valueOf(patients.getBookbuildingDoctor())); | |
1195 | + if (user != null) { | |
1196 | + bookbuildingDoctor = user.getName(); | |
1197 | + } else { | |
1198 | + System.out.println(patients.getId() + ";no user bookbuildingDoctor" + patients.getBookbuildingDoctor()); | |
1199 | + } | |
1200 | + } | |
1201 | + | |
1202 | + | |
1203 | + patientManagerQueryModel.setBookbuildingDoctor(bookbuildingDoctor); | |
1204 | + patientManagerQueryModel.setBookbuildingDate(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); | |
1205 | + patientManagerQueryModel.setAddressRegister(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); | |
1206 | + patientManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
1207 | + patientManagerQueryModel.setId(patients.getId()); | |
1208 | + patientManagerQueryModelList.add(patientManagerQueryModel); | |
1209 | + } | |
1210 | + } | |
1211 | + | |
1212 | + patientManagerResult.setPageInfo(patientsQuery.getPageInfo()); | |
1213 | + patientManagerResult.setData(patientManagerQueryModelList); | |
1214 | + patientManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
1215 | + patientManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
1216 | + return patientManagerResult; | |
1217 | + } | |
1218 | + | |
1109 | 1219 | public BaseResponse findPatient2(PatientQueryRequest patientQueryRequest, Integer userId) { |
1110 | 1220 | PatientsQuery patientsQuery = new PatientsQuery(); |
1111 | 1221 | patientsQuery.setPid(patientQueryRequest.getPid()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
50cb6e9
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | import com.lyms.platform.operate.web.result.*; |
14 | 14 | import com.lyms.platform.operate.web.utils.AreaHighRiskCountExportTask; |
15 | 15 | import com.lyms.platform.operate.web.utils.HiskCountTask; |
16 | +import com.lyms.platform.operate.web.utils.MathUtil; | |
16 | 17 | import com.lyms.platform.operate.web.utils.MongoUtil; |
17 | 18 | import com.lyms.platform.permission.model.Organization; |
18 | 19 | import com.lyms.platform.permission.model.OrganizationQuery; |
... | ... | @@ -528,6 +529,7 @@ |
528 | 529 | idQuery.setYn(YnEnums.YES.getId()); |
529 | 530 | |
530 | 531 | List<String> items = new ArrayList<>(); |
532 | + | |
531 | 533 | for (Map<String, Object> addr : list) |
532 | 534 | { |
533 | 535 | String id = String.valueOf(addr.get("id")); |
... | ... | @@ -555,6 +557,42 @@ |
555 | 557 | } |
556 | 558 | map.put("data",items); |
557 | 559 | series.add(map); |
560 | + | |
561 | + | |
562 | + | |
563 | +// List<Map<String,Object>> bfbItem = new ArrayList<>(); | |
564 | +// | |
565 | +// if (CollectionUtils.isNotEmpty(series)) | |
566 | +// { | |
567 | +// int index = 0; | |
568 | +// for (Map<String,Object> seriseMap : series) | |
569 | +// { | |
570 | +// Map<String,Object> percent = new HashMap<>(); | |
571 | +// percent.put("name",seriseMap.get("name")); | |
572 | +// percent.put("type","line"); | |
573 | +// | |
574 | +// | |
575 | +// //占比/环比百分比 | |
576 | +// List<String> bfb = new ArrayList<>(); | |
577 | +// | |
578 | +// | |
579 | +// index++; | |
580 | +// List colums = (List)seriseMap.get("data"); | |
581 | +// Object obj = colums.get(index); | |
582 | +// int total = 0; | |
583 | +// | |
584 | +// for (Map<String,Object> sMap : series) | |
585 | +// { | |
586 | +// List colums1 = (List)sMap.get("data"); | |
587 | +// Object obj1 = colums1.get(index); | |
588 | +// | |
589 | +// total += Integer.valueOf(String.valueOf(obj1)); | |
590 | +// } | |
591 | +// bfb.add(MathUtil.getProportion(Integer.valueOf(String.valueOf(obj)),total); | |
592 | +// } | |
593 | +// } | |
594 | + | |
595 | + | |
558 | 596 | } |
559 | 597 | } |
560 | 598 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverFollowAddRequest.java
View file @
50cb6e9
... | ... | @@ -564,5 +564,56 @@ |
564 | 564 | public void setReferHospital(String referHospital) { |
565 | 565 | this.referHospital = referHospital; |
566 | 566 | } |
567 | + | |
568 | + @Override | |
569 | + public String toString() { | |
570 | + return "MatDeliverFollowAddRequest{" + | |
571 | + "id='" + id + '\'' + | |
572 | + ", hospitalId='" + hospitalId + '\'' + | |
573 | + ", deliveryDate=" + deliveryDate + | |
574 | + ", deliverId='" + deliverId + '\'' + | |
575 | + ", parentid='" + parentid + '\'' + | |
576 | + ", pid='" + pid + '\'' + | |
577 | + ", contactResult=" + contactResult + | |
578 | + ", makeType=" + makeType + | |
579 | + ", makeRemark='" + makeRemark + '\'' + | |
580 | + ", makeCreateUser='" + makeCreateUser + '\'' + | |
581 | + ", makeCreateDate=" + makeCreateDate + | |
582 | + ", contactReason=" + contactReason + | |
583 | + ", makeVisitDate=" + makeVisitDate + | |
584 | + ", visitResult=" + visitResult + | |
585 | + ", visitReason=" + visitReason + | |
586 | + ", visitAffirm=" + visitAffirm + | |
587 | + ", visitDate=" + visitDate + | |
588 | + ", visitDoctor='" + visitDoctor + '\'' + | |
589 | + ", visitStatus=" + visitStatus + | |
590 | + ", visitRemark='" + visitRemark + '\'' + | |
591 | + ", visitCreateUser='" + visitCreateUser + '\'' + | |
592 | + ", visitCreateDate=" + visitCreateDate + | |
593 | + ", nextVisitDate=" + nextVisitDate + | |
594 | + ", isClose=" + isClose + | |
595 | + ", postFollowId='" + postFollowId + '\'' + | |
596 | + ", fmDate=" + fmDate + | |
597 | + ", leaveDate=" + leaveDate + | |
598 | + ", temperature='" + temperature + '\'' + | |
599 | + ", fitnessDesc='" + fitnessDesc + '\'' + | |
600 | + ", mentalityDesc='" + mentalityDesc + '\'' + | |
601 | + ", bpv=" + bpv + | |
602 | + ", bpk=" + bpk + | |
603 | + ", breast='" + breast + '\'' + | |
604 | + ", lochia='" + lochia + '\'' + | |
605 | + ", matrix='" + matrix + '\'' + | |
606 | + ", wound='" + wound + '\'' + | |
607 | + ", otherDesc='" + otherDesc + '\'' + | |
608 | + ", healthType=" + healthType + | |
609 | + ", guideSuggest='" + guideSuggest + '\'' + | |
610 | + ", guideOtherDesc='" + guideOtherDesc + '\'' + | |
611 | + ", isRefer=" + isRefer + | |
612 | + ", referReason='" + referReason + '\'' + | |
613 | + ", referHospital='" + referHospital + '\'' + | |
614 | + ", updateDate=" + updateDate + | |
615 | + ", updateUser='" + updateUser + '\'' + | |
616 | + '}'; | |
617 | + } | |
567 | 618 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/MatdeliverFollowListResult.java
View file @
50cb6e9
... | ... | @@ -7,7 +7,10 @@ |
7 | 7 | */ |
8 | 8 | public class MatdeliverFollowListResult { |
9 | 9 | |
10 | - | |
10 | + /** | |
11 | + * 分娩记录主键id | |
12 | + */ | |
13 | + private String id; | |
11 | 14 | private String patientId; |
12 | 15 | |
13 | 16 | private String pid; |
... | ... | @@ -75,6 +78,13 @@ |
75 | 78 | */ |
76 | 79 | private Integer isClose; |
77 | 80 | |
81 | + public String getId() { | |
82 | + return id; | |
83 | + } | |
84 | + | |
85 | + public void setId(String id) { | |
86 | + this.id = id; | |
87 | + } | |
78 | 88 | |
79 | 89 | public Integer getIsClose() { |
80 | 90 | return isClose; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
View file @
50cb6e9
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | @Service("syncDataTaskService") |
43 | 43 | public class SyncDataTaskService { |
44 | 44 | |
45 | - private static final Map<String,String> urls = new HashMap<>(); | |
45 | + private static final Map<String,String> urls = new LinkedHashMap<>(); | |
46 | 46 | |
47 | 47 | static |
48 | 48 | { |
... | ... | @@ -54,7 +54,7 @@ |
54 | 54 | urls.put("rp-hbnq-api.healthbaby.com.cn:18019","内丘"); |
55 | 55 | urls.put("area-chengde-api.healthbaby.com.cn:12356","承德"); |
56 | 56 | urls.put("area-kaifeng-api.healthbaby.com.cn:12356","开封"); |
57 | -// urls.put("area-weixian-api.healthbaby.com.cn:12356","威县"); | |
57 | + urls.put("area-weixian-api.healthbaby.com.cn:12356","威县"); | |
58 | 58 | urls.put("area-zhucheng-api.healthbaby.com.cn:12356","诸城市妇幼保健院"); |
59 | 59 | } |
60 | 60 | |
... | ... | @@ -160,6 +160,7 @@ |
160 | 160 | for (final String url : urls.keySet()) |
161 | 161 | { |
162 | 162 | try{ |
163 | + System.out.println(" areaurl = "+ url ); | |
163 | 164 | String areaName = urls.get(url); |
164 | 165 | String json = HttpClientUtil.doPost("https://"+url+"/findSyncData", new HashMap<String, String>(), "utf-8"); |
165 | 166 | if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(json)) |
... | ... | @@ -199,6 +200,7 @@ |
199 | 200 | } |
200 | 201 | }catch(Exception ex){ |
201 | 202 | ExceptionUtils.catchException(ex, url+": syncData Error."); |
203 | + continue; | |
202 | 204 | } |
203 | 205 | } |
204 | 206 | |
205 | 207 | |
206 | 208 | |
... | ... | @@ -843,102 +845,107 @@ |
843 | 845 | |
844 | 846 | public static void main(String[] a) throws Exception { |
845 | 847 | // new SyncDataTaskService().syncQhdfyCsv(); |
846 | - List<String> list = FileUtils.readLines(new File("D:\\qhd-jd.csv"), "utf-8"); | |
847 | - int linenum = 0; | |
848 | - DateTime dt = new DateTime(); | |
849 | - Set<String> set = new HashSet<>(); | |
850 | - Map<String, String> riskMap = buildRiskMap(); | |
851 | - int riskcount = 0; | |
852 | - int risktotalcount = 0; | |
853 | - for (String line : list) { | |
854 | - linenum++; | |
855 | - if (linenum > 14035) { | |
856 | - break; | |
857 | - } | |
858 | - try { | |
859 | - int tempIndex = line.indexOf(",,,,,,,,,,,,,,,"); | |
860 | - line = line.substring(0, tempIndex + 1); | |
861 | - String ss[] = line.split(","); | |
862 | - Patients patients = new Patients(); | |
863 | - patients.setServiceStatus(0); | |
864 | - patients.setServiceType(0); | |
865 | - patients.setType(1); | |
866 | - patients.setPcountryId("0da4334f-49e7-4180-b690-5cea668f75e9"); | |
867 | - patients.setPnationId("a628ab3a-1e0c-4219-ab14-a14636c5cdaa"); | |
868 | - patients.setPcerteTypeId("57e1dcd3f0f02e7ca519d6c6"); | |
869 | - patients.setBuildType(0); | |
870 | - patients.setYn(1); | |
871 | - System.out.println(ss[3].trim()); | |
872 | - patients.setAge(Integer.valueOf(ss[3].trim())); | |
873 | - DateTime agetime = dt.minusYears(Integer.valueOf(ss[3].trim())); | |
874 | - patients.setBirth(agetime.toDate()); | |
875 | - // 末次月经6,7,8 | |
876 | - String month = ss[7].trim(); | |
877 | - if (month.length() == 1) { | |
878 | - month = "0" + month; | |
879 | - } | |
880 | - String day = ss[8].trim(); | |
881 | - if (day.length() == 1) { | |
882 | - day = "0" + day; | |
883 | - } | |
884 | - patients.setLastMenses(DateUtil.getYmdhmDate("20" + ss[6].trim() + month + day + "0000")); | |
885 | - // > 41zhou | |
886 | - if (DateUtil.getWeek(patients.getLastMenses(), new Date()) > 41) { | |
887 | - continue; | |
888 | - } | |
889 | - // 预产期9,10,11 | |
890 | - month = ss[10].trim(); | |
891 | - if (month.length() == 1) { | |
892 | - month = "0" + month; | |
893 | - } | |
894 | - day = ss[11].trim(); | |
895 | - if (day.length() == 1) { | |
896 | - day = "0" + day; | |
897 | - } | |
898 | - patients.setDueDate(DateUtil.getYmdhmDate("20" + ss[9].trim() + month + day + "0000")); | |
848 | +// List<String> list = FileUtils.readLines(new File("D:\\qhd-jd.csv"), "utf-8"); | |
849 | +// int linenum = 0; | |
850 | +// DateTime dt = new DateTime(); | |
851 | +// Set<String> set = new HashSet<>(); | |
852 | +// Map<String, String> riskMap = buildRiskMap(); | |
853 | +// int riskcount = 0; | |
854 | +// int risktotalcount = 0; | |
855 | +// for (String line : list) { | |
856 | +// linenum++; | |
857 | +// if (linenum > 14035) { | |
858 | +// break; | |
859 | +// } | |
860 | +// try { | |
861 | +// int tempIndex = line.indexOf(",,,,,,,,,,,,,,,"); | |
862 | +// line = line.substring(0, tempIndex + 1); | |
863 | +// String ss[] = line.split(","); | |
864 | +// Patients patients = new Patients(); | |
865 | +// patients.setServiceStatus(0); | |
866 | +// patients.setServiceType(0); | |
867 | +// patients.setType(1); | |
868 | +// patients.setPcountryId("0da4334f-49e7-4180-b690-5cea668f75e9"); | |
869 | +// patients.setPnationId("a628ab3a-1e0c-4219-ab14-a14636c5cdaa"); | |
870 | +// patients.setPcerteTypeId("57e1dcd3f0f02e7ca519d6c6"); | |
871 | +// patients.setBuildType(0); | |
872 | +// patients.setYn(1); | |
873 | +// System.out.println(ss[3].trim()); | |
874 | +// patients.setAge(Integer.valueOf(ss[3].trim())); | |
875 | +// DateTime agetime = dt.minusYears(Integer.valueOf(ss[3].trim())); | |
876 | +// patients.setBirth(agetime.toDate()); | |
877 | +// // 末次月经6,7,8 | |
878 | +// String month = ss[7].trim(); | |
879 | +// if (month.length() == 1) { | |
880 | +// month = "0" + month; | |
881 | +// } | |
882 | +// String day = ss[8].trim(); | |
883 | +// if (day.length() == 1) { | |
884 | +// day = "0" + day; | |
885 | +// } | |
886 | +// patients.setLastMenses(DateUtil.getYmdhmDate("20" + ss[6].trim() + month + day + "0000")); | |
887 | +// // > 41zhou | |
888 | +// if (DateUtil.getWeek(patients.getLastMenses(), new Date()) > 41) { | |
889 | +// continue; | |
890 | +// } | |
891 | +// // 预产期9,10,11 | |
892 | +// month = ss[10].trim(); | |
893 | +// if (month.length() == 1) { | |
894 | +// month = "0" + month; | |
895 | +// } | |
896 | +// day = ss[11].trim(); | |
897 | +// if (day.length() == 1) { | |
898 | +// day = "0" + day; | |
899 | +// } | |
900 | +// patients.setDueDate(DateUtil.getYmdhmDate("20" + ss[9].trim() + month + day + "0000")); | |
901 | +// | |
902 | +// // 风险因素13 | |
903 | +// String risks = ss[13].trim().replace(" ", " "); | |
904 | +// if (risks != null && risks.length() > 1) { | |
905 | +// Integer score = 0; | |
906 | +// patients.setLastRhTime(patients.getBookbuildingDate()); | |
907 | +// String[] riskArray = risks.split(" |\\+"); | |
908 | +// for (String r : riskArray) { | |
909 | +// risktotalcount++; | |
910 | +// boolean boo = true; | |
911 | +// for (String s : riskMap.keySet()) { | |
912 | +// if (s.indexOf(r) >= 0 || r.indexOf(s) >= 0) { | |
913 | +// riskcount++; | |
914 | +// boo = false; | |
915 | +// break; | |
916 | +// } | |
917 | +// } | |
918 | +// if (boo) { | |
919 | +// set.add(r); | |
920 | +// } | |
921 | +// } | |
922 | +// } | |
923 | +//// System.out.println(JsonUtil.obj2JsonString(patients)); | |
924 | +// } catch (Exception e) { | |
925 | +//// e.printStackTrace(); | |
926 | +// } | |
927 | +// } | |
928 | +// Map<String, String> map = new HashMap<>(); | |
929 | +// System.out.println("riskcount:" + riskcount); | |
930 | +// System.out.println("risktotalcount:" + risktotalcount); | |
931 | +// for (String s : set) { | |
932 | +// System.out.println(s); | |
933 | +// } | |
934 | +// | |
935 | +// AntExChuModel chuModel = new AntExChuModel(); | |
936 | +// chuModel.setLastMenses(new Date()); | |
937 | +// Map<String, Object> omap = ReflectionUtils.getUpdateField(chuModel); | |
938 | +// for (String key : omap.keySet()) { | |
939 | +// System.out.println(key + "--" + omap.get(key)); | |
940 | +// } | |
941 | +// UpdateMultiData data = new UpdateMultiData(); | |
942 | +// data.setUpdate(omap); | |
943 | +// System.out.println(JsonUtil.obj2Str(data)); | |
899 | 944 | |
900 | - // 风险因素13 | |
901 | - String risks = ss[13].trim().replace(" ", " "); | |
902 | - if (risks != null && risks.length() > 1) { | |
903 | - Integer score = 0; | |
904 | - patients.setLastRhTime(patients.getBookbuildingDate()); | |
905 | - String[] riskArray = risks.split(" |\\+"); | |
906 | - for (String r : riskArray) { | |
907 | - risktotalcount++; | |
908 | - boolean boo = true; | |
909 | - for (String s : riskMap.keySet()) { | |
910 | - if (s.indexOf(r) >= 0 || r.indexOf(s) >= 0) { | |
911 | - riskcount++; | |
912 | - boo = false; | |
913 | - break; | |
914 | - } | |
915 | - } | |
916 | - if (boo) { | |
917 | - set.add(r); | |
918 | - } | |
919 | - } | |
920 | - } | |
921 | -// System.out.println(JsonUtil.obj2JsonString(patients)); | |
922 | - } catch (Exception e) { | |
923 | -// e.printStackTrace(); | |
924 | - } | |
945 | + for (final String url : urls.keySet()) | |
946 | + { | |
947 | + System.out.println(url); | |
925 | 948 | } |
926 | - Map<String, String> map = new HashMap<>(); | |
927 | - System.out.println("riskcount:" + riskcount); | |
928 | - System.out.println("risktotalcount:" + risktotalcount); | |
929 | - for (String s : set) { | |
930 | - System.out.println(s); | |
931 | - } | |
932 | - | |
933 | - AntExChuModel chuModel = new AntExChuModel(); | |
934 | - chuModel.setLastMenses(new Date()); | |
935 | - Map<String, Object> omap = ReflectionUtils.getUpdateField(chuModel); | |
936 | - for (String key : omap.keySet()) { | |
937 | - System.out.println(key + "--" + omap.get(key)); | |
938 | - } | |
939 | - UpdateMultiData data = new UpdateMultiData(); | |
940 | - data.setUpdate(omap); | |
941 | - System.out.println(JsonUtil.obj2Str(data)); | |
942 | 949 | } |
943 | 950 | |
944 | 951 | private static Map<String, String> buildRiskMap() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
50cb6e9
... | ... | @@ -296,6 +296,24 @@ |
296 | 296 | public BaseResponse edit(String id) { |
297 | 297 | PatientWeight patientWeight = mongoTemplate.findById(id, PatientWeight.class); |
298 | 298 | patientWeight.setHospitalName(couponMapper.getHospitalName(patientWeight.getHospitalId())); |
299 | + List<Map<String, Object>> weightInfo = new ArrayList<>(); | |
300 | + List<String> betweenDay = DateUtil.getBetweenDay(7); | |
301 | + for (String date : betweenDay) { | |
302 | + Map<String, Object> temp = new HashMap<>(); | |
303 | + weightInfo.add(temp); | |
304 | + temp.put("id", date); | |
305 | + for (Map<String, Object> map : patientWeight.getDayWeights2()) { | |
306 | + if(date.equals(map.get("date").toString())) { | |
307 | + temp.put("name", map.get("nowWeight")); | |
308 | + break; | |
309 | + } | |
310 | + } | |
311 | + if(!temp.containsKey("name")) { | |
312 | + temp.put("name", "--"); | |
313 | + } | |
314 | + } | |
315 | + patientWeight.setWeightInfo(weightInfo); | |
316 | + | |
299 | 317 | return RespBuilder.buildSuccess(patientWeight); |
300 | 318 | } |
301 | 319 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
50cb6e9
... | ... | @@ -371,17 +371,36 @@ |
371 | 371 | Date beforeEnd = null; |
372 | 372 | switch (statistVal) { //1=月 2=季度 3=半年 4=年 |
373 | 373 | case 1: |
374 | - start = DateUtil.getMonthDay(new Date(), 0, 1); | |
375 | - end = DateUtil.getMonthDay(new Date(), 0, 0); | |
376 | - beforeStart = DateUtil.getMonthDay(new Date(), -1, 1); | |
377 | - beforeEnd = DateUtil.getMonthDay(new Date(), -1, 0); | |
374 | + start = DateUtil.getMonthDay(startDate, 0, 1); | |
375 | + end = DateUtil.getMonthDay(startDate, 0, 0); | |
376 | + beforeStart = DateUtil.getMonthDay(startDate, -1, 1); | |
377 | + beforeEnd = DateUtil.getMonthDay(startDate, -1, 0); | |
378 | 378 | break; |
379 | 379 | case 2: |
380 | + start = DateUtil.getQuartDay(startDate, 0, 1); | |
381 | + end = DateUtil.getQuartDay(startDate, 0, 0); | |
382 | + beforeStart = DateUtil.getQuartDay(startDate, -1, 1); | |
383 | + beforeEnd = DateUtil.getQuartDay(startDate, -1, 0); | |
380 | 384 | break; |
381 | 385 | case 3: |
386 | + start = DateUtil.getHalfDay(startDate, 0, 1); | |
387 | + end = DateUtil.getHalfDay(startDate, 0, 0); | |
388 | + beforeStart = DateUtil.getHalfDay(startDate, -1, 1); | |
389 | + beforeEnd = DateUtil.getHalfDay(startDate, -1, 0); | |
382 | 390 | break; |
383 | 391 | case 4: |
392 | + start = DateUtil.getYear(startDate, 0, 1); | |
393 | + end = DateUtil.getYear(startDate, 0, 0); | |
394 | + beforeStart = DateUtil.getYear(startDate, -1, 1); | |
395 | + beforeEnd = DateUtil.getYear(startDate, -1, 0); | |
384 | 396 | break; |
397 | + } | |
398 | + List<Map<String, Object>> hospitalInfos = mongoUtil.getHospitals(userId, provinceId, cityId, aredId, streetId); | |
399 | + List<String> hospitalIds = CollectionUtils.getListByKey(hospitalInfos, "id"); | |
400 | + Criteria c = new Criteria(); | |
401 | + c.and("hospitalId").in(hospitalIds).and("yn").ne(0).and("enable").ne("2").and("buildType").ne(1); | |
402 | + if(startDate != null && endDate != null) { | |
403 | + c.and("bookbuildingDate").gte(startDate).lt(DateUtil.addDay(endDate, 1)); | |
385 | 404 | } |
386 | 405 | } |
387 | 406 | lineMap.put("data", line); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HttpClientUtil.java
View file @
50cb6e9
... | ... | @@ -83,7 +83,8 @@ |
83 | 83 | } |
84 | 84 | } |
85 | 85 | }catch(Exception ex){ |
86 | - ex.printStackTrace(); | |
86 | + ExceptionUtils.catchException(ex, url + ": doPost syncData Error."); | |
87 | + return null; | |
87 | 88 | } |
88 | 89 | return result; |
89 | 90 | } |
... | ... | @@ -199,5 +200,20 @@ |
199 | 200 | } |
200 | 201 | return json1; |
201 | 202 | } |
203 | +// | |
204 | +// public static void main(String[] args) | |
205 | +// { | |
206 | +// SqlRequest request = new SqlRequest(); | |
207 | +// try { | |
208 | +// request.setSql(org.apache.commons.codec.binary.Base64.encodeBase64String("asdafsd".getBytes("utf-8"))); | |
209 | +// } catch (UnsupportedEncodingException e) { | |
210 | +// e.printStackTrace(); | |
211 | +// } | |
212 | +// request.setSqlId("11"); | |
213 | +// String json = JsonUtil.obj2Str(request); | |
214 | +// String result = HttpClientUtil.doPostSSL("https://area-lc-api.healthbaby.com.cn:55581/syncMysqlData",json,"3d19960bf3e81e7d816c4f26051c49ba"); | |
215 | +// System.out.print(result); | |
216 | +// } | |
217 | + | |
202 | 218 | } |