diff --git a/platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/SyncDataWork.java b/platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/SyncDataWork.java index ffa526e..4fb45b2 100644 --- a/platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/SyncDataWork.java +++ b/platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/SyncDataWork.java @@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit; *

* Created by Administrator on 2016/9/29 0029. */ -//@Component +@Component public class SyncDataWork { @@ -326,6 +326,18 @@ public class SyncDataWork { for (Patients patients : patientses) { StopWatch stopWatch3=new StopWatch("SyncWork-"+hospitalId+"-patient-"+patients.getId()); com.lymsh.mommybaby.maindata.model.Patients mamiPatient = ConvertHelper.convertPatient(patients); + //增加建档记录 + patientsService.aouPatients(mamiPatient); + //绑定用户 + bandingMember(mamiPatient); + + AntExChuQuery antExChuQuery = new AntExChuQuery(); + antExChuQuery.setYn(YnEnums.YES.getId()); + antExChuQuery.setParentId(patients.getId()); + if(-1!=lastSyncTime){ + antExChuQuery.setGteModified(new Date(lastSyncTime)); + } + DoctorUsersPatientsMaps doctorUsersPatientsMaps = new DoctorUsersPatientsMaps(); doctorUsersPatientsMaps.setCreated(new Date()); doctorUsersPatientsMaps.setYn(YnEnums.YES.getId()); @@ -336,8 +348,11 @@ public class SyncDataWork { doctorUsersPatientsMaps.setStatus(1); doctorUsersPatientsMaps.setStatusName("待处理"); stopWatch3.start("aouPatients"); - //增加建档记录 - patientsService.aouPatients(mamiPatient); + //设置为高危 + if(null!=patients.getRiskScore() &&patients.getRiskScore()>0){ + doctorUsersPatientsMaps.setGroupId(2); + } + stopWatch3.stop(); doctorUsersPatientsMaps.setPatientId(mamiPatient.getId()); if (StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { @@ -346,15 +361,6 @@ public class SyncDataWork { doctorUsersPatientsMapsService.aouDoctorUsersPatientsMaps(doctorUsersPatientsMaps); stopWatch3.stop(); } - //绑定用户 - bandingMember(mamiPatient); - - AntExChuQuery antExChuQuery = new AntExChuQuery(); - antExChuQuery.setYn(YnEnums.YES.getId()); - antExChuQuery.setParentId(patients.getId()); - if(-1!=lastSyncTime){ - antExChuQuery.setGteModified(new Date(lastSyncTime)); - } List antExChuModel = antenatalExaminationService.queryAntExChu(antExChuQuery); if (CollectionUtils.isEmpty(antExChuModel)) { @@ -389,6 +395,25 @@ public class SyncDataWork { stopWatch3.stop(); logger.info(stopWatch3.toString()); + + DoctorUsersPatientsMaps reportdoctorUsersPatientsMaps = new DoctorUsersPatientsMaps(); + reportdoctorUsersPatientsMaps.setCreated(new Date()); + reportdoctorUsersPatientsMaps.setYn(YnEnums.YES.getId()); + + //门诊患者 + reportdoctorUsersPatientsMaps.setGroupId(4); + if(null!=patients.getRiskScore() &&patients.getRiskScore()>0){ + doctorUsersPatientsMaps.setGroupId(2); + } + //设置为待处理 + reportdoctorUsersPatientsMaps.setStatus(1); + reportdoctorUsersPatientsMaps.setStatusName("待处理"); + if (StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { + doctorUsersPatientsMaps.setDoctorUserId(userMapping.get(Integer.valueOf(antExChuModel1.getProdDoctor()))); + stopWatch3.start("report aouDoctorUsersPatientsMaps"); + doctorUsersPatientsMapsService.aouDoctorUsersPatientsMaps(reportdoctorUsersPatientsMaps); + stopWatch3.stop(); + } } } }