Commit 23877f522516513fb51b6f9d9bc5958c3539f245
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 14 changed files
- 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-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java
- platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/SyncDataWork.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/AntExRecordFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.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/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/utils/HttpClientUtil.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
23877f5
... | ... | @@ -1366,6 +1366,20 @@ |
1366 | 1366 | return result; |
1367 | 1367 | } |
1368 | 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 | + | |
1369 | 1383 | public static void main(String[] args) { |
1370 | 1384 | /* List<Map<String, Date>> monthBetween = getRange(parseYMD("2017-1-11"), parseYMD("2017-3-11")); |
1371 | 1385 | for (Map<String, Date> map : monthBetween) { |
... | ... | @@ -1391,6 +1405,7 @@ |
1391 | 1405 | System.out.println("当前年的最后一天: " + getYear(date, 0, 0).toLocaleString()); |
1392 | 1406 | System.out.println("上一年的第一天: " + getYear(date, -1, 1).toLocaleString()); |
1393 | 1407 | System.out.println("上一年的最后一天: " + getYear(date, -1, 0).toLocaleString()); |
1408 | + System.out.println(getBetweenDay(7)); | |
1394 | 1409 | } |
1395 | 1410 | |
1396 | 1411 | } |
platform-common/src/main/java/com/lyms/platform/common/utils/LymsEncodeUtil.java
View file @
23877f5
... | ... | @@ -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 @
23877f5
... | ... | @@ -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-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java
View file @
23877f5
... | ... | @@ -218,6 +218,19 @@ |
218 | 218 | private String levelId; |
219 | 219 | private String rFactor; |
220 | 220 | |
221 | + /** | |
222 | + * 高危因素集合 | |
223 | + */ | |
224 | + private List<String> rFactorList; | |
225 | + | |
226 | + public List<String> getrFactorList() { | |
227 | + return rFactorList; | |
228 | + } | |
229 | + | |
230 | + public void setrFactorList(List<String> rFactorList) { | |
231 | + this.rFactorList = rFactorList; | |
232 | + } | |
233 | + | |
221 | 234 | public String getrFactor() { |
222 | 235 | return rFactor; |
223 | 236 | } |
... | ... | @@ -434,6 +447,9 @@ |
434 | 447 | if (StringUtils.isNotEmpty(levelId)) { |
435 | 448 | condition = condition.and("hLevel", levelId, MongoOper.IN); |
436 | 449 | } |
450 | + if(null!=rFactorList &&!rFactorList.isEmpty()){ | |
451 | + condition = condition.and("hRisk", rFactorList, MongoOper.IN); | |
452 | + }else | |
437 | 453 | if (StringUtils.isNotEmpty(rFactor)) { |
438 | 454 | condition = condition.and("hRisk", rFactor, MongoOper.IN); |
439 | 455 | } |
platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/SyncDataWork.java
View file @
23877f5
... | ... | @@ -819,14 +819,14 @@ |
819 | 819 | StopWatch stopWatch3 = new StopWatch("SyncWork-" + hospitalId + "-patient-" + patients.getId()); |
820 | 820 | com.lymsh.mommybaby.maindata.model.Patients mamiPatient = ConvertHelper |
821 | 821 | .convertPatient(patients); |
822 | - if (StringUtils.isNotEmpty(mamiPatient.getPhone())) { | |
822 | + /* if (StringUtils.isNotEmpty(mamiPatient.getPhone())) { | |
823 | 823 | MembersQuery membersQuery = new MembersQuery(); |
824 | 824 | membersQuery.setPhone(mamiPatient.getPhone()); |
825 | 825 | List<Members> memberses = membersService.queryMembers(membersQuery); |
826 | 826 | if (CollectionUtils.isNotEmpty(memberses)) { |
827 | 827 | mamiPatient.setMemberId(memberses.get(0).getId()); |
828 | 828 | } |
829 | - } | |
829 | + }*/ | |
830 | 830 | |
831 | 831 | mamiPatient.setCrisis(setCric(patients)); |
832 | 832 | logger.info("aouPatients" + patients.getId()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
23877f5
... | ... | @@ -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/AntExRecordFacade.java
View file @
23877f5
... | ... | @@ -88,6 +88,7 @@ |
88 | 88 | // antExRecordQuery.setName(antExManagerQueryRequest.getName()); |
89 | 89 | // antExRecordQuery.setPhone(antExManagerQueryRequest.getPhone()); |
90 | 90 | antExRecordQuery.setrFactor(antExManagerQueryRequest.getRiskFactorId()); |
91 | + antExRecordQuery.setrFactorList(com.lyms.platform.common.utils.StringUtils.covertToList(antExManagerQueryRequest.getRiskFactorId(), String.class)); | |
91 | 92 | antExRecordQuery.setLevelId(antExManagerQueryRequest.getLevel()); |
92 | 93 | antExRecordQuery.setBarCode(antExManagerQueryRequest.getBarCode()); |
93 | 94 | // antExRecordQuery.setCardNo(antExManagerQueryRequest.getCardNo()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
23877f5
... | ... | @@ -319,15 +319,18 @@ |
319 | 319 | } |
320 | 320 | }*/ |
321 | 321 | Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); |
322 | - patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); | |
322 | + Patients patients1 =new Patients(); | |
323 | + patients1.setId(patients.getId()); | |
324 | + patients1.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); | |
323 | 325 | |
324 | - model.setPid(patients.getPid()); | |
325 | - if (StringUtils.isNotEmpty(patients.getEnable()) && "0".equals(patients.getEnable())) { | |
326 | - patients.setEnable("1"); | |
326 | + model.setPid(patients1.getPid()); | |
327 | + if (StringUtils.isNotEmpty(patients1.getEnable()) && "0".equals(patients1.getEnable())) { | |
328 | + patients1.setEnable("1"); | |
327 | 329 | } |
330 | + | |
328 | 331 | patientsService.updateNextCheckTime(antExAddRequest.getNextCheckTime(), patients.getId()); |
329 | - patientsService.updatePatient(patients); | |
330 | -// patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
332 | + patientsService.updatePatient(patients1); | |
333 | + patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
331 | 334 | |
332 | 335 | antenatalExaminationService.addOneBabyAnt(model); |
333 | 336 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
23877f5
... | ... | @@ -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 @
23877f5
... | ... | @@ -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/service/SyncDataTaskService.java
View file @
23877f5
... | ... | @@ -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 @
23877f5
... | ... | @@ -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/utils/HttpClientUtil.java
View file @
23877f5
... | ... | @@ -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 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java
View file @
23877f5
... | ... | @@ -146,7 +146,7 @@ |
146 | 146 | |
147 | 147 | riskPatientsResult.setcTimes(i + b); |
148 | 148 | riskPatientsResult.setcHTimes(chi + chb); |
149 | - String nextCheckTime = ""; | |
149 | + String nextCheckTime = null; | |
150 | 150 | |
151 | 151 | if(null!=patients.getNextCheckTime()){ |
152 | 152 | nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime()); |