Commit cbf30219bb79f894cfc4dbc603796618731f46d3
1 parent
75ba64d6d0
Exists in
master
and in
1 other branch
commit
Showing 1 changed file with 37 additions and 12 deletions
platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/SyncDataWork.java
View file @
cbf3021
| ... | ... | @@ -45,7 +45,7 @@ |
| 45 | 45 | * <p> |
| 46 | 46 | * Created by Administrator on 2016/9/29 0029. |
| 47 | 47 | */ |
| 48 | -//@Component | |
| 48 | +@Component | |
| 49 | 49 | public class SyncDataWork { |
| 50 | 50 | |
| 51 | 51 | |
| ... | ... | @@ -326,6 +326,18 @@ |
| 326 | 326 | for (Patients patients : patientses) { |
| 327 | 327 | StopWatch stopWatch3=new StopWatch("SyncWork-"+hospitalId+"-patient-"+patients.getId()); |
| 328 | 328 | com.lymsh.mommybaby.maindata.model.Patients mamiPatient = ConvertHelper.convertPatient(patients); |
| 329 | + //增加建档记录 | |
| 330 | + patientsService.aouPatients(mamiPatient); | |
| 331 | + //绑定用户 | |
| 332 | + bandingMember(mamiPatient); | |
| 333 | + | |
| 334 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 335 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 336 | + antExChuQuery.setParentId(patients.getId()); | |
| 337 | + if(-1!=lastSyncTime){ | |
| 338 | + antExChuQuery.setGteModified(new Date(lastSyncTime)); | |
| 339 | + } | |
| 340 | + | |
| 329 | 341 | DoctorUsersPatientsMaps doctorUsersPatientsMaps = new DoctorUsersPatientsMaps(); |
| 330 | 342 | doctorUsersPatientsMaps.setCreated(new Date()); |
| 331 | 343 | doctorUsersPatientsMaps.setYn(YnEnums.YES.getId()); |
| ... | ... | @@ -336,8 +348,11 @@ |
| 336 | 348 | doctorUsersPatientsMaps.setStatus(1); |
| 337 | 349 | doctorUsersPatientsMaps.setStatusName("待处理"); |
| 338 | 350 | stopWatch3.start("aouPatients"); |
| 339 | - //增加建档记录 | |
| 340 | - patientsService.aouPatients(mamiPatient); | |
| 351 | + //设置为高危 | |
| 352 | + if(null!=patients.getRiskScore() &&patients.getRiskScore()>0){ | |
| 353 | + doctorUsersPatientsMaps.setGroupId(2); | |
| 354 | + } | |
| 355 | + | |
| 341 | 356 | stopWatch3.stop(); |
| 342 | 357 | doctorUsersPatientsMaps.setPatientId(mamiPatient.getId()); |
| 343 | 358 | if (StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { |
| 344 | 359 | |
| ... | ... | @@ -346,16 +361,7 @@ |
| 346 | 361 | doctorUsersPatientsMapsService.aouDoctorUsersPatientsMaps(doctorUsersPatientsMaps); |
| 347 | 362 | stopWatch3.stop(); |
| 348 | 363 | } |
| 349 | - //绑定用户 | |
| 350 | - bandingMember(mamiPatient); | |
| 351 | 364 | |
| 352 | - AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 353 | - antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 354 | - antExChuQuery.setParentId(patients.getId()); | |
| 355 | - if(-1!=lastSyncTime){ | |
| 356 | - antExChuQuery.setGteModified(new Date(lastSyncTime)); | |
| 357 | - } | |
| 358 | - | |
| 359 | 365 | List<AntExChuModel> antExChuModel = antenatalExaminationService.queryAntExChu(antExChuQuery); |
| 360 | 366 | if (CollectionUtils.isEmpty(antExChuModel)) { |
| 361 | 367 | continue; |
| ... | ... | @@ -389,6 +395,25 @@ |
| 389 | 395 | stopWatch3.stop(); |
| 390 | 396 | logger.info(stopWatch3.toString()); |
| 391 | 397 | |
| 398 | + | |
| 399 | + DoctorUsersPatientsMaps reportdoctorUsersPatientsMaps = new DoctorUsersPatientsMaps(); | |
| 400 | + reportdoctorUsersPatientsMaps.setCreated(new Date()); | |
| 401 | + reportdoctorUsersPatientsMaps.setYn(YnEnums.YES.getId()); | |
| 402 | + | |
| 403 | + //门诊患者 | |
| 404 | + reportdoctorUsersPatientsMaps.setGroupId(4); | |
| 405 | + if(null!=patients.getRiskScore() &&patients.getRiskScore()>0){ | |
| 406 | + doctorUsersPatientsMaps.setGroupId(2); | |
| 407 | + } | |
| 408 | + //设置为待处理 | |
| 409 | + reportdoctorUsersPatientsMaps.setStatus(1); | |
| 410 | + reportdoctorUsersPatientsMaps.setStatusName("待处理"); | |
| 411 | + if (StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { | |
| 412 | + doctorUsersPatientsMaps.setDoctorUserId(userMapping.get(Integer.valueOf(antExChuModel1.getProdDoctor()))); | |
| 413 | + stopWatch3.start("report aouDoctorUsersPatientsMaps"); | |
| 414 | + doctorUsersPatientsMapsService.aouDoctorUsersPatientsMaps(reportdoctorUsersPatientsMaps); | |
| 415 | + stopWatch3.stop(); | |
| 416 | + } | |
| 392 | 417 | } |
| 393 | 418 | } |
| 394 | 419 | } |