Commit 032e6603027199fa2a36e30e71df25e1a90770b7
1 parent
e50d12b510
Exists in
master
and in
6 other branches
产前诊断定时任务
Showing 2 changed files with 50 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/DiagnosisFacaed.java
View file @
032e660
| ... | ... | @@ -640,5 +640,37 @@ |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | |
| 643 | + /** | |
| 644 | + * 处理产前诊断满足11孕周自动流转 | |
| 645 | + */ | |
| 646 | + public void handleWork(){ | |
| 647 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 648 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 649 | + List<Patients> patients = patientsService.queryPatient(patientsQuery); | |
| 650 | + if(patients != null && patients.size() > 0){ | |
| 651 | + for(Patients pat : patients){ | |
| 652 | + int days = DateUtil.daysBetween(pat.getLastMenses(), new Date()); | |
| 653 | + if(77 > days){ | |
| 654 | + continue; | |
| 655 | + } | |
| 656 | + DiagnosisQuery diagnosisQuery = new DiagnosisQuery(); | |
| 657 | + diagnosisQuery.setParentId(pat.getId()); | |
| 658 | + List<DiagnosisModel> dia = diagnosisService.queryDiagnosis(diagnosisQuery); | |
| 659 | + if(dia != null && dia.size() > 0){ | |
| 660 | + continue; | |
| 661 | + } | |
| 662 | + DiagnosisModel diagnosisModel = new DiagnosisModel(); | |
| 663 | + diagnosisModel.setParentId(pat.getId()); | |
| 664 | + diagnosisModel.setHospitalId(pat.getHospitalId()); | |
| 665 | + diagnosisModel.setLastMenses(pat.getLastMenses()); | |
| 666 | + diagnosisModel.setDiaStatus("0");//未申请状态 | |
| 667 | + diagnosisModel.setStatus("2");//数据来源 | |
| 668 | + diagnosisModel.setRefStatus("0");//未转诊默认状态 | |
| 669 | + diagnosisService.addDiagnosis(diagnosisModel);//插入数据 | |
| 670 | + } | |
| 671 | + } | |
| 672 | + | |
| 673 | + } | |
| 674 | + | |
| 643 | 675 | } |
platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml
View file @
032e660
| ... | ... | @@ -314,7 +314,23 @@ |
| 314 | 314 | <property name="cronExpression" value="0 0 20 * * ?"></property> |
| 315 | 315 | </bean> |
| 316 | 316 | |
| 317 | + <!-- 产前诊断数据自动流转 --> | |
| 318 | + <bean id="diaSieveWorker" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> | |
| 319 | + <!-- 要调用的bean --> | |
| 320 | + <property name="targetObject" ref="diagnosisFacaed"></property> | |
| 321 | + <!-- 要调用的Method --> | |
| 322 | + <property name="targetMethod" value="handleWork"></property> | |
| 323 | + <!-- 是否并发,false表示 如果发生错误也不影响下一次的调用 --> | |
| 324 | + <property name="concurrent" value="false"></property> | |
| 325 | + </bean> | |
| 317 | 326 | |
| 327 | + | |
| 328 | + <bean id="diaSieveTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> | |
| 329 | + <property name="jobDetail" ref="diaSieveWorker"></property> | |
| 330 | + <property name="cronExpression" value="0 0 21 * * ?"></property> | |
| 331 | + </bean> | |
| 332 | + | |
| 333 | + | |
| 318 | 334 | <!-- 服务结束任务--> |
| 319 | 335 | <bean id="patientSerivceEndJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> |
| 320 | 336 | <!-- 要调用的bean --> |
| ... | ... | @@ -331,7 +347,6 @@ |
| 331 | 347 | </bean> |
| 332 | 348 | |
| 333 | 349 | |
| 334 | - | |
| 335 | 350 | <!-- 总调度,用于启动定时器 --> |
| 336 | 351 | <bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> |
| 337 | 352 | <property name="triggers" > |
| ... | ... | @@ -349,6 +364,8 @@ |
| 349 | 364 | <ref bean="firstDandleAutoReachDueTrigger" /> |
| 350 | 365 | <!--血压报告触发器 --> |
| 351 | 366 | <ref bean="bpReportTrigger" /> |
| 367 | + <!-- 产前诊断--> | |
| 368 | + <!--<ref bean="diaSieveTrigger"/>--> | |
| 352 | 369 | <!-- 承德公共卫生接口--> |
| 353 | 370 | <!--<ref bean="cdGongWeiTrigger"/>--> |
| 354 | 371 | <!-- 秦皇岛天英--> |