Commit 248aa51341a13204ebb74443d3a168daa55dd2f6
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 15 changed files
- platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
 - platform-dal/src/main/java/com/lyms/platform/pojo/ResidentsArchiveModel.java
 - platform-dal/src/main/java/com/lyms/platform/pojo/TrackDownRecord.java
 - platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
 - platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java
 - platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TrackDownController.java
 - platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
 - platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
 - platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ResidentsArchiveAddRequest.java
 - platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/ITrackDownService.java
 - platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TrackDownServiceImpl.java
 - platform-transfer/src/main/java/com/lyms/platform/microelement/MicroelementWorker.java
 - platform-transfer/src/main/java/com/lyms/platform/worker/BoneWorker.java
 - platform-transfer/src/main/java/com/lyms/platform/worker/MicroelementWorker.java
 - platform-transfer/src/main/resources/spring/applicationContext-quartz.xml
 
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
248aa51
| ... | ... | @@ -322,6 +322,16 @@ | 
| 322 | 322 | //条码号 | 
| 323 | 323 | private String numberCode; | 
| 324 | 324 | |
| 325 | + private String trackHospitalId; | |
| 326 | + | |
| 327 | + public String getTrackHospitalId() { | |
| 328 | + return trackHospitalId; | |
| 329 | + } | |
| 330 | + | |
| 331 | + public void setTrackHospitalId(String trackHospitalId) { | |
| 332 | + this.trackHospitalId = trackHospitalId; | |
| 333 | + } | |
| 334 | + | |
| 325 | 335 | public String getNumberCode() { | 
| 326 | 336 | return numberCode; | 
| 327 | 337 | } | 
platform-dal/src/main/java/com/lyms/platform/pojo/ResidentsArchiveModel.java
View file @
248aa51
| ... | ... | @@ -6,6 +6,7 @@ | 
| 6 | 6 | import org.springframework.data.mongodb.core.mapping.Document; | 
| 7 | 7 | |
| 8 | 8 | import java.util.Date; | 
| 9 | +import java.util.List; | |
| 9 | 10 | |
| 10 | 11 | /** | 
| 11 | 12 | * 居民健康档案(妇女健康 )模型 | 
| ... | ... | @@ -60,6 +61,7 @@ | 
| 60 | 61 | private String areaId; | 
| 61 | 62 | private String streetId; | 
| 62 | 63 | private String address; | 
| 64 | + private List<String> childExtAddrs; | |
| 63 | 65 | //户籍地址 | 
| 64 | 66 | private String provinceRegisterId; | 
| 65 | 67 | private String cityRegisterId; | 
| ... | ... | @@ -175,6 +177,25 @@ | 
| 175 | 177 | private String jtbm;//注明具体病名 | 
| 176 | 178 | |
| 177 | 179 | private String photo; | 
| 180 | + | |
| 181 | + | |
| 182 | + private String trackHospitalId; | |
| 183 | + | |
| 184 | + public String getTrackHospitalId() { | |
| 185 | + return trackHospitalId; | |
| 186 | + } | |
| 187 | + | |
| 188 | + public void setTrackHospitalId(String trackHospitalId) { | |
| 189 | + this.trackHospitalId = trackHospitalId; | |
| 190 | + } | |
| 191 | + | |
| 192 | + public List<String> getChildExtAddrs() { | |
| 193 | + return childExtAddrs; | |
| 194 | + } | |
| 195 | + | |
| 196 | + public void setChildExtAddrs(List<String> childExtAddrs) { | |
| 197 | + this.childExtAddrs = childExtAddrs; | |
| 198 | + } | |
| 178 | 199 | |
| 179 | 200 | public String getPhoto() { | 
| 180 | 201 | return photo; | 
platform-dal/src/main/java/com/lyms/platform/pojo/TrackDownRecord.java
View file @
248aa51
| ... | ... | @@ -81,6 +81,16 @@ | 
| 81 | 81 | //历史数据是否处理 | 
| 82 | 82 | private boolean isHistory; | 
| 83 | 83 | |
| 84 | + private String trackHospitalId; | |
| 85 | + | |
| 86 | + public String getTrackHospitalId() { | |
| 87 | + return trackHospitalId; | |
| 88 | + } | |
| 89 | + | |
| 90 | + public void setTrackHospitalId(String trackHospitalId) { | |
| 91 | + this.trackHospitalId = trackHospitalId; | |
| 92 | + } | |
| 93 | + | |
| 84 | 94 | public boolean isHistory() { | 
| 85 | 95 | return isHistory; | 
| 86 | 96 | } | 
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
248aa51
| ... | ... | @@ -368,6 +368,16 @@ | 
| 368 | 368 | //条码号 | 
| 369 | 369 | private String numberCode; | 
| 370 | 370 | |
| 371 | + private String trackHospitalId; | |
| 372 | + | |
| 373 | + public String getTrackHospitalId() { | |
| 374 | + return trackHospitalId; | |
| 375 | + } | |
| 376 | + | |
| 377 | + public void setTrackHospitalId(String trackHospitalId) { | |
| 378 | + this.trackHospitalId = trackHospitalId; | |
| 379 | + } | |
| 380 | + | |
| 371 | 381 | public String getNumberCode() { | 
| 372 | 382 | return numberCode; | 
| 373 | 383 | } | 
| ... | ... | @@ -711,6 +721,18 @@ | 
| 711 | 721 | MongoCondition c = MongoCondition.newInstance(); | 
| 712 | 722 | MongoCondition con1 = MongoCondition.newInstance("riskLevelId", noRlevel, MongoOper.NIN); | 
| 713 | 723 | MongoCondition con2 = MongoCondition.newInstance("riskLevelId", true, MongoOper.EXISTS); | 
| 724 | + if (c1 != null) { | |
| 725 | + c1 = c1.andOperator(c.orCondition(new MongoCondition[]{con1, con2}).getCriteria()); | |
| 726 | + } else { | |
| 727 | + c1 = c.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); | |
| 728 | + } | |
| 729 | + } | |
| 730 | + | |
| 731 | + | |
| 732 | + if (org.apache.commons.lang.StringUtils.isNotBlank(trackHospitalId)) { | |
| 733 | + MongoCondition c = MongoCondition.newInstance(); | |
| 734 | + MongoCondition con1 = MongoCondition.newInstance("trackHospitalId", trackHospitalId, MongoOper.IS); | |
| 735 | + MongoCondition con2 = MongoCondition.newInstance("hospitalId", trackHospitalId, MongoOper.IS); | |
| 714 | 736 | if (c1 != null) { | 
| 715 | 737 | c1 = c1.andOperator(c.orCondition(new MongoCondition[]{con1, con2}).getCriteria()); | 
| 716 | 738 | } else { | 
platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java
View file @
248aa51
| ... | ... | @@ -48,6 +48,7 @@ | 
| 48 | 48 | private String professionTypeId; | 
| 49 | 49 | //医院ID | 
| 50 | 50 | private String hospitalId; | 
| 51 | + private String trackHospitalId; | |
| 51 | 52 | //年龄 | 
| 52 | 53 | private Integer age; | 
| 53 | 54 | /************联系方式*************/ | 
| ... | ... | @@ -135,6 +136,14 @@ | 
| 135 | 136 | //历史数据是否同步 | 
| 136 | 137 | private boolean isHistory; | 
| 137 | 138 | |
| 139 | + public String getTrackHospitalId() { | |
| 140 | + return trackHospitalId; | |
| 141 | + } | |
| 142 | + | |
| 143 | + public void setTrackHospitalId(String trackHospitalId) { | |
| 144 | + this.trackHospitalId = trackHospitalId; | |
| 145 | + } | |
| 146 | + | |
| 138 | 147 | public boolean isHistory() { | 
| 139 | 148 | return isHistory; | 
| 140 | 149 | } | 
| ... | ... | @@ -336,6 +345,17 @@ | 
| 336 | 345 | c1 = c1.lte(endBuildDay); | 
| 337 | 346 | } else { | 
| 338 | 347 | c1 = Criteria.where("buildDay").lte(endBuildDay); | 
| 348 | + } | |
| 349 | + } | |
| 350 | + | |
| 351 | + if (StringUtils.isNotBlank(trackHospitalId)) { | |
| 352 | + MongoCondition c = MongoCondition.newInstance(); | |
| 353 | + MongoCondition con1 = MongoCondition.newInstance("trackHospitalId", trackHospitalId, MongoOper.IS); | |
| 354 | + MongoCondition con2 = MongoCondition.newInstance("hospitalId", trackHospitalId, MongoOper.IS); | |
| 355 | + if (c1 != null) { | |
| 356 | + c1 = c1.andOperator(c.orCondition(new MongoCondition[]{con1, con2}).getCriteria()); | |
| 357 | + } else { | |
| 358 | + c1 = c.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); | |
| 339 | 359 | } | 
| 340 | 360 | } | 
| 341 | 361 | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TrackDownController.java
View file @
248aa51
| ... | ... | @@ -86,9 +86,9 @@ | 
| 86 | 86 | @RequestMapping(value = "/all", method = RequestMethod.GET) | 
| 87 | 87 | public BaseResponse all(Date buildStart, Date buildEnd, Date checkStart, Date checkEnd, Date fmStart, Date fmEnd, String key, Integer type, | 
| 88 | 88 | @RequestParam Integer page, @RequestParam Integer limit, HttpServletRequest request, | 
| 89 | - Integer check, String checkup, String pregnantBuild, Integer followupStatus, String isDeliver, Integer encryption) { | |
| 89 | + Integer check, String checkup, String pregnantBuild, Integer followupStatus, String isDeliver, Integer encryption,@RequestParam(required = false,defaultValue = "false") boolean isArea) { | |
| 90 | 90 | return trackDownService.all(buildStart, buildEnd, checkStart, checkEnd, fmStart, fmEnd, key, | 
| 91 | - page, limit, getUserId(request), type, check, checkup, pregnantBuild, followupStatus, isDeliver, encryption); | |
| 91 | + page, limit, getUserId(request), type, check, checkup, pregnantBuild, followupStatus, isDeliver, encryption,isArea); | |
| 92 | 92 | } | 
| 93 | 93 | |
| 94 | 94 | @ResponseBody | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
248aa51
| ... | ... | @@ -178,6 +178,9 @@ | 
| 178 | 178 | private ITrackDownService trackDownService; | 
| 179 | 179 | |
| 180 | 180 | @Autowired | 
| 181 | + private PostVisitHospitalService postVisitHospitalService; | |
| 182 | + | |
| 183 | + @Autowired | |
| 181 | 184 | private TrackDownRecordService trackDownRecordService; | 
| 182 | 185 | |
| 183 | 186 | @Autowired | 
| ... | ... | @@ -341,7 +344,7 @@ | 
| 341 | 344 | |
| 342 | 345 | //生成条形码 | 
| 343 | 346 | getNumberCode(patient); | 
| 344 | - | |
| 347 | + getTrackHospital(patient); | |
| 345 | 348 | //孕妇档案 | 
| 346 | 349 | Patients p = yunBookbuildingService.addPregnantBookbuilding(patient); | 
| 347 | 350 | |
| 348 | 351 | |
| ... | ... | @@ -510,7 +513,22 @@ | 
| 510 | 513 | return br; | 
| 511 | 514 | } | 
| 512 | 515 | |
| 516 | + private void getTrackHospital(Patients patients) | |
| 517 | + { | |
| 518 | + if (CollectionUtils.isNotEmpty(patients.getChildExtAddrs())) | |
| 519 | + { | |
| 520 | + PostVisitHospitalModelQuery postQuery = new PostVisitHospitalModelQuery(); | |
| 521 | + postQuery.setAreaTiters(patients.getChildExtAddrs()); | |
| 522 | + List<PostVisitHospitalModel> postVisitHospitalModels = postVisitHospitalService.queryPostVisitHospitalModel(postQuery); | |
| 523 | + if (CollectionUtils.isNotEmpty(postVisitHospitalModels)) | |
| 524 | + { | |
| 525 | + System.out.println("setTrackHospitalId==="+postVisitHospitalModels.get(0).getPostHosptial()); | |
| 526 | + patients.setTrackHospitalId(postVisitHospitalModels.get(0).getPostHosptial()); | |
| 527 | + } | |
| 528 | + } | |
| 529 | + } | |
| 513 | 530 | |
| 531 | + | |
| 514 | 532 | private void getNumberCode(Patients patients) | 
| 515 | 533 | { | 
| 516 | 534 | String numberCode = ""; | 
| ... | ... | @@ -579,6 +597,9 @@ | 
| 579 | 597 | trackDownRecord.setSieveAppointmentDate(new Date()); | 
| 580 | 598 | //设置默认分娩住院时间 | 
| 581 | 599 | trackDownRecord.setFmzyAppointmentDate(new Date()); | 
| 600 | + | |
| 601 | + trackDownRecord.setTrackHospitalId(patient.getTrackHospitalId()); | |
| 602 | + | |
| 582 | 603 | trackDownService.addOrupdateTrackDownRecord(userId, trackDownRecord); | 
| 583 | 604 | } | 
| 584 | 605 | }); | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
View file @
248aa51
| ... | ... | @@ -21,10 +21,8 @@ | 
| 21 | 21 | import com.lyms.platform.permission.model.Users; | 
| 22 | 22 | import com.lyms.platform.permission.service.OrganizationService; | 
| 23 | 23 | import com.lyms.platform.permission.service.UsersService; | 
| 24 | -import com.lyms.platform.pojo.PremaritalCheckup; | |
| 25 | -import com.lyms.platform.pojo.ResidentsArchiveModel; | |
| 26 | -import com.lyms.platform.pojo.SmsConfigModel; | |
| 27 | -import com.lyms.platform.pojo.TrackDownRecord; | |
| 24 | +import com.lyms.platform.pojo.*; | |
| 25 | +import com.lyms.platform.query.PostVisitHospitalModelQuery; | |
| 28 | 26 | import com.lyms.platform.query.PremaritalCheckupQuery; | 
| 29 | 27 | import com.lyms.platform.query.ResidentsArchiveQuery; | 
| 30 | 28 | import com.lyms.platform.query.TrackDownRecordQuery; | 
| ... | ... | @@ -67,6 +65,9 @@ | 
| 67 | 65 | @Autowired | 
| 68 | 66 | private ITrackDownService trackDownService; | 
| 69 | 67 | @Autowired | 
| 68 | + private PostVisitHospitalService postVisitHospitalService; | |
| 69 | + | |
| 70 | + @Autowired | |
| 70 | 71 | private TrackDownRecordService trackDownRecordService; | 
| 71 | 72 | |
| 72 | 73 | public BaseObjectResponse findResidentsArchive(ResidentsArchiveQueryRequest queryRequest, Integer userId) { | 
| ... | ... | @@ -295,6 +296,8 @@ | 
| 295 | 296 | model.setPublishName(users.getName()); | 
| 296 | 297 | } | 
| 297 | 298 | |
| 299 | + getTrackHospital(model); | |
| 300 | + | |
| 298 | 301 | model.setId(id); | 
| 299 | 302 | residentsArchiveService.updateResident(model, id); | 
| 300 | 303 | |
| ... | ... | @@ -379,6 +382,8 @@ | 
| 379 | 382 | archiveModel.setBuildDoctor(u.getName()); | 
| 380 | 383 | }*/ | 
| 381 | 384 | |
| 385 | + getTrackHospital(archiveModel); | |
| 386 | + | |
| 382 | 387 | ResidentsArchiveModel residentsArchiveModel = residentsArchiveService.addResident(archiveModel); | 
| 383 | 388 | |
| 384 | 389 | //新增婚检追访信息,默认进入婚检追访 | 
| 385 | 390 | |
| ... | ... | @@ -439,8 +444,26 @@ | 
| 439 | 444 | } | 
| 440 | 445 | } | 
| 441 | 446 | |
| 447 | + trackDownRecord.setTrackHospitalId(residentsArchiveModel.getTrackHospitalId()); | |
| 448 | + | |
| 442 | 449 | trackDownService.addOrupdateTrackDownRecord(userId, trackDownRecord); | 
| 443 | 450 | } | 
| 451 | + | |
| 452 | + | |
| 453 | + private void getTrackHospital(ResidentsArchiveModel residentsArchiveModel) | |
| 454 | + { | |
| 455 | + if (CollectionUtils.isNotEmpty(residentsArchiveModel.getChildExtAddrs())) | |
| 456 | + { | |
| 457 | + PostVisitHospitalModelQuery postQuery = new PostVisitHospitalModelQuery(); | |
| 458 | + postQuery.setAreaTiters(residentsArchiveModel.getChildExtAddrs()); | |
| 459 | + List<PostVisitHospitalModel> postVisitHospitalModels = postVisitHospitalService.queryPostVisitHospitalModel(postQuery); | |
| 460 | + if (CollectionUtils.isNotEmpty(postVisitHospitalModels)) | |
| 461 | + { | |
| 462 | + residentsArchiveModel.setTrackHospitalId(postVisitHospitalModels.get(0).getPostHosptial()); | |
| 463 | + } | |
| 464 | + } | |
| 465 | + } | |
| 466 | + | |
| 444 | 467 | |
| 445 | 468 | /** | 
| 446 | 469 | * 通过ID查看居民建档详情 | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ResidentsArchiveAddRequest.java
View file @
248aa51
| ... | ... | @@ -9,6 +9,7 @@ | 
| 9 | 9 | import org.hibernate.validator.constraints.NotEmpty; | 
| 10 | 10 | |
| 11 | 11 | import java.util.Date; | 
| 12 | +import java.util.List; | |
| 12 | 13 | import java.util.Map; | 
| 13 | 14 | |
| 14 | 15 | /** | 
| ... | ... | @@ -81,6 +82,7 @@ | 
| 81 | 82 | private String areaId; | 
| 82 | 83 | private String streetId; | 
| 83 | 84 | private String address; | 
| 85 | + private List<String> childExtAddrs; | |
| 84 | 86 | //户籍地址 | 
| 85 | 87 | private String provinceRegisterId; | 
| 86 | 88 | private String cityRegisterId; | 
| 87 | 89 | |
| ... | ... | @@ -253,9 +255,18 @@ | 
| 253 | 255 | model.setJtbm(jtbm); | 
| 254 | 256 | //追访时间默认为当前建档时间 | 
| 255 | 257 | model.setFollowupTime(new Date()); | 
| 258 | + model.setChildExtAddrs(childExtAddrs); | |
| 256 | 259 | |
| 257 | 260 | |
| 258 | 261 | return model; | 
| 262 | + } | |
| 263 | + | |
| 264 | + public List<String> getChildExtAddrs() { | |
| 265 | + return childExtAddrs; | |
| 266 | + } | |
| 267 | + | |
| 268 | + public void setChildExtAddrs(List<String> childExtAddrs) { | |
| 269 | + this.childExtAddrs = childExtAddrs; | |
| 259 | 270 | } | 
| 260 | 271 | |
| 261 | 272 | public String getPhoto() { | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/ITrackDownService.java
View file @
248aa51
| ... | ... | @@ -18,7 +18,7 @@ | 
| 18 | 18 | |
| 19 | 19 | BaseObjectResponse all(Date buildStart, Date buildEnd, Date checkStart, Date checkEnd, Date fmStart, | 
| 20 | 20 | Date fmEnd, String key, Integer page, Integer limit, Integer userId, Integer type, | 
| 21 | - Integer check, String checkup, String pregnantBuild, Integer followupStatus, String isDeliver, Integer encryption); | |
| 21 | + Integer check, String checkup, String pregnantBuild, Integer followupStatus, String isDeliver, Integer encryption,boolean isArea); | |
| 22 | 22 | |
| 23 | 23 | void Export(Date buildStart, Date buildEnd, Date checkStart, Date checkEnd, Date fmStart, Date fmEnd, String key, | 
| 24 | 24 | Integer userId, Integer type, Integer check, String checkup, String pregnantBuild, | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TrackDownServiceImpl.java
View file @
248aa51
| ... | ... | @@ -73,7 +73,7 @@ | 
| 73 | 73 | @Override | 
| 74 | 74 | public BaseObjectResponse all(Date buildStart, Date buildEnd, Date checkStart, Date checkEnd, Date fmStart, Date fmEnd, String key, | 
| 75 | 75 | Integer page, Integer limit, Integer userId, Integer type, Integer check, String checkup, String pregnantBuild, | 
| 76 | - Integer followupStatus, String isDeliver, Integer encryption) { | |
| 76 | + Integer followupStatus, String isDeliver, Integer encryption,boolean isArea) { | |
| 77 | 77 | String hospitalId = autoMatchFacade.getHospitalId(userId); | 
| 78 | 78 | List<Map<String, Object>> restList = new ArrayList<>(); | 
| 79 | 79 | Integer archiveModelCount = 0; | 
| ... | ... | @@ -85,7 +85,16 @@ | 
| 85 | 85 | query.setNeed("1"); | 
| 86 | 86 | query.setYn(YnEnums.YES.getId()); | 
| 87 | 87 | query.setQueryNo(key); | 
| 88 | - query.setHospitalId(hospitalId); | |
| 88 | + | |
| 89 | + if (isArea) | |
| 90 | + { | |
| 91 | + query.setTrackHospitalId(hospitalId); | |
| 92 | + } | |
| 93 | + else | |
| 94 | + { | |
| 95 | + query.setHospitalId(hospitalId); | |
| 96 | + } | |
| 97 | + | |
| 89 | 98 | //只查询女性 | 
| 90 | 99 | query.setSex(SystemConfig.WOMAN_ID); | 
| 91 | 100 | query.setStartBuildDay(buildStart); | 
| ... | ... | @@ -142,7 +151,15 @@ | 
| 142 | 151 | patientsQuery.setNeed("need"); | 
| 143 | 152 | patientsQuery.setLimit(limit); | 
| 144 | 153 | patientsQuery.setPage(page); | 
| 145 | - patientsQuery.setHospitalId(hospitalId); | |
| 154 | + if (isArea) | |
| 155 | + { | |
| 156 | + patientsQuery.setTrackHospitalId(hospitalId); | |
| 157 | + } | |
| 158 | + else | |
| 159 | + { | |
| 160 | + patientsQuery.setHospitalId(hospitalId); | |
| 161 | + } | |
| 162 | + | |
| 146 | 163 | patientsQuery.setQueryNo(key); | 
| 147 | 164 | patientsQuery.setFollowupStatus(followupStatus); | 
| 148 | 165 | patientsQuery.setIsDeliver(isDeliver); | 
platform-transfer/src/main/java/com/lyms/platform/microelement/MicroelementWorker.java
View file @
248aa51
| 1 | -package com.lyms.platform.microelement; | |
| 2 | - | |
| 3 | -import com.lyms.platform.common.utils.HttpClientUtil; | |
| 4 | -import com.lyms.platform.common.utils.JsonUtil; | |
| 5 | -import com.lyms.platform.common.utils.PropertiesUtils; | |
| 6 | -import com.lyms.platform.common.utils.StringUtils; | |
| 7 | -import com.lyms.platform.conn.MicroelementConnection; | |
| 8 | - | |
| 9 | -import java.sql.Connection; | |
| 10 | -import java.sql.ResultSet; | |
| 11 | -import java.sql.SQLException; | |
| 12 | -import java.sql.Statement; | |
| 13 | -import java.util.ArrayList; | |
| 14 | -import java.util.HashMap; | |
| 15 | -import java.util.List; | |
| 16 | -import java.util.Map; | |
| 17 | - | |
| 18 | -public class MicroelementWorker { | |
| 19 | - | |
| 20 | - public static final String url = PropertiesUtils.getPropertyValue("url"); | |
| 21 | - | |
| 22 | - public static void getMicroelementRecords() | |
| 23 | - { | |
| 24 | - System.out.println("getMicroelementRecords start"); | |
| 25 | - Connection conn = null; | |
| 26 | - Statement sta = null; | |
| 27 | - ResultSet rst = null; | |
| 28 | - try { | |
| 29 | - conn = MicroelementConnection.getConnection(); | |
| 30 | - sta = conn.createStatement(); | |
| 31 | - rst = sta.executeQuery("select * from BaseInfo where status is null "); | |
| 32 | - while (rst.next()){ | |
| 33 | - Map<String,Object> data = new HashMap<>(); | |
| 34 | - String numberCode = rst.getString("编号"); | |
| 35 | - String autoId = rst.getString("AUTOID"); | |
| 36 | - data.put("numberCode",numberCode); | |
| 37 | - data.put("autoId",autoId); | |
| 38 | - getMicroelementRecords(data); | |
| 39 | - } | |
| 40 | - } | |
| 41 | - catch (SQLException e) { | |
| 42 | - } | |
| 43 | - finally { | |
| 44 | - MicroelementConnection.close(conn, sta,rst); | |
| 45 | - } | |
| 46 | - } | |
| 47 | - | |
| 48 | - | |
| 49 | - public static void getMicroelementRecords(Map<String,Object> data) | |
| 50 | - { | |
| 51 | - Connection conn = null; | |
| 52 | - Statement sta = null; | |
| 53 | - ResultSet rst = null; | |
| 54 | - try { | |
| 55 | - conn = MicroelementConnection.getConnection(); | |
| 56 | - String autoId = data.get("autoId").toString(); | |
| 57 | - sta = conn.createStatement(); | |
| 58 | - rst = sta.executeQuery("select * from ItemsInfo where BaseAutoId = "+autoId); | |
| 59 | - | |
| 60 | - List<Map> microelements = new ArrayList<>(); | |
| 61 | - while (rst.next()) { | |
| 62 | - Map map = new HashMap(); | |
| 63 | - String eleName = rst.getString("元素名称"); | |
| 64 | - String value = rst.getString("测量值"); | |
| 65 | - String result = StringUtils.checkNum(value); | |
| 66 | - map.put("result",result); | |
| 67 | - map.put("unit",value.contains("mmol") ? "mmol/l" : (value.contains("umol") ? "umol/l" : "ug/l")); | |
| 68 | - map.put("eleName",eleName); | |
| 69 | - map.put("refValue","");//TODO | |
| 70 | - microelements.add(map); | |
| 71 | - } | |
| 72 | - data.put("microelements", microelements); | |
| 73 | - data.remove("autoId"); | |
| 74 | - if (microelements.size() > 0) | |
| 75 | - { | |
| 76 | - String response = autoTransfer(data); | |
| 77 | - if (response.contains("0")) | |
| 78 | - { | |
| 79 | - sta.executeUpdate("update BaseInfo set status='1' where AUTOID="+autoId); | |
| 80 | - conn.commit(); | |
| 81 | - } | |
| 82 | - } | |
| 83 | - | |
| 84 | - } | |
| 85 | - catch (Exception e) { | |
| 86 | - try { | |
| 87 | - conn.rollback(); | |
| 88 | - } catch (SQLException e1) { | |
| 89 | - e1.printStackTrace(); | |
| 90 | - } | |
| 91 | - } | |
| 92 | - finally { | |
| 93 | - MicroelementConnection.close(conn, sta,rst); | |
| 94 | - } | |
| 95 | - } | |
| 96 | - | |
| 97 | - public static String autoTransfer(Map<String,Object> data) | |
| 98 | - { | |
| 99 | - if (data != null && data.size() > 0) | |
| 100 | - { | |
| 101 | - String json = JsonUtil.obj2Str(data); | |
| 102 | - System.out.println(json); | |
| 103 | - String result = HttpClientUtil.doPostSSL(url+"/saveMicroelement",json); | |
| 104 | - System.out.println("http result= "+result); | |
| 105 | - return result; | |
| 106 | - } | |
| 107 | - return ""; | |
| 108 | - } | |
| 109 | - | |
| 110 | -} | 
platform-transfer/src/main/java/com/lyms/platform/worker/BoneWorker.java
View file @
248aa51
| 1 | +package com.lyms.platform.worker; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.utils.HttpClientUtil; | |
| 4 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 5 | +import com.lyms.platform.common.utils.PropertiesUtils; | |
| 6 | +import com.lyms.platform.common.utils.StringUtils; | |
| 7 | +import com.lyms.platform.conn.MicroelementConnection; | |
| 8 | + | |
| 9 | +import java.sql.Connection; | |
| 10 | +import java.sql.ResultSet; | |
| 11 | +import java.sql.SQLException; | |
| 12 | +import java.sql.Statement; | |
| 13 | +import java.util.HashMap; | |
| 14 | +import java.util.Map; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * 骨密度 | |
| 18 | + */ | |
| 19 | +public class BoneWorker { | |
| 20 | + | |
| 21 | + public static final String url = PropertiesUtils.getPropertyValue("url"); | |
| 22 | + | |
| 23 | + public static void getBoneRecords() | |
| 24 | + { | |
| 25 | + System.out.println("getBoneRecords start"); | |
| 26 | + Connection conn = null; | |
| 27 | + Statement sta = null; | |
| 28 | + ResultSet rst = null; | |
| 29 | + try { | |
| 30 | + conn = MicroelementConnection.getConnection(); | |
| 31 | + sta = conn.createStatement(); | |
| 32 | + rst = sta.executeQuery("select PatientID,ZScore,TScore,dbSos,dbBqi,dbRrf,dbEoa,YoungAdult,ageMatched,dbAge from PatientInfo where status is null"); | |
| 33 | + while (rst.next()) { | |
| 34 | + Map map = new HashMap(); | |
| 35 | + | |
| 36 | + String PatientID = rst.getString("PatientID"); //身份证后八位 | |
| 37 | + //String position = rst.getString(""); | |
| 38 | + map.put("cardNo",PatientID); | |
| 39 | + map.put("position","左侧桡骨远端1/3处"); | |
| 40 | + | |
| 41 | + String ZScore = rst.getString("ZScore"); | |
| 42 | + String TScore = rst.getString("TScore"); | |
| 43 | + String dbSos = rst.getString("dbSos"); | |
| 44 | + | |
| 45 | + String bqi = rst.getString("dbBqi"); | |
| 46 | + String rrf = rst.getString("dbRrf"); | |
| 47 | + String eoa = rst.getString("dbEoa"); | |
| 48 | + | |
| 49 | + String adultPercent = rst.getString("YoungAdult"); | |
| 50 | + String agePercent = rst.getString("ageMatched"); | |
| 51 | + String age = rst.getString("dbAge"); | |
| 52 | + | |
| 53 | + map.put("zvalue",ZScore); | |
| 54 | + map.put("tvalue",TScore); | |
| 55 | + map.put("sos",dbSos); | |
| 56 | + | |
| 57 | + map.put("bqi",bqi); | |
| 58 | + map.put("rrf",rrf); | |
| 59 | + map.put("eoa",eoa); | |
| 60 | + | |
| 61 | + map.put("adultPercent",adultPercent); | |
| 62 | + map.put("agePercent",agePercent); | |
| 63 | + map.put("age",age); | |
| 64 | + | |
| 65 | + if (map.size() > 0 && StringUtils.isNotEmpty(PatientID)) | |
| 66 | + { | |
| 67 | + String response = autoTransfer(map); | |
| 68 | + if (response.contains("0")) | |
| 69 | + { | |
| 70 | + sta.executeUpdate("update PatientInfo set status='1' where PatientID='"+PatientID+"'"); | |
| 71 | + conn.commit(); | |
| 72 | + } | |
| 73 | + } | |
| 74 | + } | |
| 75 | + } catch (Exception e) { | |
| 76 | + try { | |
| 77 | + conn.rollback(); | |
| 78 | + } catch (SQLException e1) { | |
| 79 | + e1.printStackTrace(); | |
| 80 | + } | |
| 81 | + } | |
| 82 | + finally { | |
| 83 | + MicroelementConnection.close(conn, sta,rst); | |
| 84 | + } | |
| 85 | + } | |
| 86 | + | |
| 87 | + public static String autoTransfer(Map<String,Object> data) | |
| 88 | + { | |
| 89 | + if (data != null && data.size() > 0) | |
| 90 | + { | |
| 91 | + String json = JsonUtil.obj2Str(data); | |
| 92 | + System.out.println(json); | |
| 93 | + String result = HttpClientUtil.doPostSSL(url+"/saveBone",json); | |
| 94 | + System.out.println("http result= "+result); | |
| 95 | + return result; | |
| 96 | + } | |
| 97 | + return ""; | |
| 98 | + } | |
| 99 | +} | 
platform-transfer/src/main/java/com/lyms/platform/worker/MicroelementWorker.java
View file @
248aa51
| 1 | +package com.lyms.platform.worker; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.utils.HttpClientUtil; | |
| 4 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 5 | +import com.lyms.platform.common.utils.PropertiesUtils; | |
| 6 | +import com.lyms.platform.common.utils.StringUtils; | |
| 7 | +import com.lyms.platform.conn.MicroelementConnection; | |
| 8 | + | |
| 9 | +import java.sql.Connection; | |
| 10 | +import java.sql.ResultSet; | |
| 11 | +import java.sql.SQLException; | |
| 12 | +import java.sql.Statement; | |
| 13 | +import java.util.ArrayList; | |
| 14 | +import java.util.HashMap; | |
| 15 | +import java.util.List; | |
| 16 | +import java.util.Map; | |
| 17 | + | |
| 18 | +public class MicroelementWorker { | |
| 19 | + | |
| 20 | + public static final String url = PropertiesUtils.getPropertyValue("url"); | |
| 21 | + | |
| 22 | + public static void getMicroelementRecords() | |
| 23 | + { | |
| 24 | + System.out.println("getMicroelementRecords start"); | |
| 25 | + Connection conn = null; | |
| 26 | + Statement sta = null; | |
| 27 | + ResultSet rst = null; | |
| 28 | + try { | |
| 29 | + conn = MicroelementConnection.getConnection(); | |
| 30 | + sta = conn.createStatement(); | |
| 31 | + rst = sta.executeQuery("select * from BaseInfo where status is null "); | |
| 32 | + while (rst.next()){ | |
| 33 | + Map<String,Object> data = new HashMap<>(); | |
| 34 | + String numberCode = rst.getString("编号"); | |
| 35 | + String autoId = rst.getString("AUTOID"); | |
| 36 | + data.put("numberCode",numberCode); | |
| 37 | + data.put("autoId",autoId); | |
| 38 | + getMicroelementRecords(data); | |
| 39 | + } | |
| 40 | + } | |
| 41 | + catch (SQLException e) { | |
| 42 | + } | |
| 43 | + finally { | |
| 44 | + MicroelementConnection.close(conn, sta,rst); | |
| 45 | + } | |
| 46 | + } | |
| 47 | + | |
| 48 | + | |
| 49 | + public static void getMicroelementRecords(Map<String,Object> data) | |
| 50 | + { | |
| 51 | + Connection conn = null; | |
| 52 | + Statement sta = null; | |
| 53 | + ResultSet rst = null; | |
| 54 | + try { | |
| 55 | + conn = MicroelementConnection.getConnection(); | |
| 56 | + String autoId = data.get("autoId").toString(); | |
| 57 | + sta = conn.createStatement(); | |
| 58 | + rst = sta.executeQuery("select * from ItemsInfo where BaseAutoId = "+autoId); | |
| 59 | + | |
| 60 | + List<Map> microelements = new ArrayList<>(); | |
| 61 | + while (rst.next()) { | |
| 62 | + Map map = new HashMap(); | |
| 63 | + String eleName = rst.getString("元素名称"); | |
| 64 | + String value = rst.getString("测量值"); | |
| 65 | + String result = StringUtils.checkNum(value); | |
| 66 | + map.put("result",result); | |
| 67 | + map.put("unit",value.contains("mmol") ? "mmol/l" : (value.contains("umol") ? "umol/l" : "ug/l")); | |
| 68 | + map.put("eleName",eleName); | |
| 69 | + map.put("refValue","");//TODO | |
| 70 | + microelements.add(map); | |
| 71 | + } | |
| 72 | + data.put("microelements", microelements); | |
| 73 | + data.remove("autoId"); | |
| 74 | + if (microelements.size() > 0) | |
| 75 | + { | |
| 76 | + String response = autoTransfer(data); | |
| 77 | + if (response.contains("0")) | |
| 78 | + { | |
| 79 | + sta.executeUpdate("update BaseInfo set status='1' where AUTOID="+autoId); | |
| 80 | + conn.commit(); | |
| 81 | + } | |
| 82 | + } | |
| 83 | + | |
| 84 | + } | |
| 85 | + catch (Exception e) { | |
| 86 | + try { | |
| 87 | + conn.rollback(); | |
| 88 | + } catch (SQLException e1) { | |
| 89 | + e1.printStackTrace(); | |
| 90 | + } | |
| 91 | + } | |
| 92 | + finally { | |
| 93 | + MicroelementConnection.close(conn, sta,rst); | |
| 94 | + } | |
| 95 | + } | |
| 96 | + | |
| 97 | + public static String autoTransfer(Map<String,Object> data) | |
| 98 | + { | |
| 99 | + if (data != null && data.size() > 0) | |
| 100 | + { | |
| 101 | + String json = JsonUtil.obj2Str(data); | |
| 102 | + System.out.println(json); | |
| 103 | + String result = HttpClientUtil.doPostSSL(url+"/saveMicroelement",json); | |
| 104 | + System.out.println("http result= "+result); | |
| 105 | + return result; | |
| 106 | + } | |
| 107 | + return ""; | |
| 108 | + } | |
| 109 | + | |
| 110 | +} | 
platform-transfer/src/main/resources/spring/applicationContext-quartz.xml
View file @
248aa51
| ... | ... | @@ -9,8 +9,8 @@ | 
| 9 | 9 | http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd | 
| 10 | 10 | http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"> | 
| 11 | 11 | |
| 12 | - <bean id="microelementWorker" class="com.lyms.platform.microelement.MicroelementWorker"></bean> | |
| 13 | - <bean id="boneWorker" class="com.lyms.platform.bone.BoneWorker"></bean> | |
| 12 | + <bean id="microelementWorker" class="com.lyms.platform.worker.MicroelementWorker"></bean> | |
| 13 | + <bean id="boneWorker" class="com.lyms.platform.worker.BoneWorker"></bean> | |
| 14 | 14 | <!-- 微量元素 --> | 
| 15 | 15 | <bean id="microelementWorkTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> | 
| 16 | 16 | <!-- 要调用的bean --> |