Commit 1d5829d6b94f1d10dfe9307d899aa545695f6aa0
1 parent
2c983d7581
Exists in
master
and in
6 other branches
男性婚前检查流转到下一流程
Showing 6 changed files with 149 additions and 66 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
- platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/TrackDownRecordQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownJobFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TrackDownServiceImpl.java
- platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
View file @
1d5829d
| ... | ... | @@ -18,6 +18,7 @@ |
| 18 | 18 | import org.springframework.data.domain.Sort; |
| 19 | 19 | import org.springframework.stereotype.Service; |
| 20 | 20 | |
| 21 | +import java.util.Arrays; | |
| 21 | 22 | import java.util.Date; |
| 22 | 23 | import java.util.List; |
| 23 | 24 | |
| ... | ... | @@ -28,7 +29,7 @@ |
| 28 | 29 | public class PatientsService { |
| 29 | 30 | private Logger logger = LoggerFactory.getLogger("SIEVE-JOB"); |
| 30 | 31 | |
| 31 | - public static final String his_version = PropertiesUtils.getPropertyValue("his_version"); | |
| 32 | + public static final String his_version = PropertiesUtils.getPropertyValue("his_version"); | |
| 32 | 33 | |
| 33 | 34 | @Autowired |
| 34 | 35 | private IPatientDao iPatientDao; |
| 35 | 36 | |
| ... | ... | @@ -78,11 +79,11 @@ |
| 78 | 79 | query.start(patientsQuery.getOffset()).end(patientsQuery.getLimit()); |
| 79 | 80 | } |
| 80 | 81 | |
| 81 | - if(!StringUtils.isEmpty(patientsQuery.getDesc())){ | |
| 82 | + if (!StringUtils.isEmpty(patientsQuery.getDesc())) { | |
| 82 | 83 | return iPatientDao.queryPatient(query.addOrder(Sort.Direction.DESC, patientsQuery.getSort())); |
| 83 | 84 | } |
| 84 | - if(!StringUtils.isEmpty(patientsQuery.getSort())){ | |
| 85 | - return iPatientDao.queryPatient(query.addOrder(Sort.Direction.ASC, patientsQuery.getSort())); | |
| 85 | + if (!StringUtils.isEmpty(patientsQuery.getSort())) { | |
| 86 | + return iPatientDao.queryPatient(query.addOrder(Sort.Direction.ASC, patientsQuery.getSort())); | |
| 86 | 87 | } |
| 87 | 88 | |
| 88 | 89 | return iPatientDao.queryPatient(query.addOrder(Sort.Direction.DESC, "id")); |
| ... | ... | @@ -102,7 +103,7 @@ |
| 102 | 103 | return iPatientDao.queryPatient(query.addOrder(Sort.Direction.DESC, field)); |
| 103 | 104 | } |
| 104 | 105 | |
| 105 | - public List<Patients> queryPatientBySort(PatientsQuery patientsQuery, String field,String sort) { | |
| 106 | + public List<Patients> queryPatientBySort(PatientsQuery patientsQuery, String field, String sort) { | |
| 106 | 107 | MongoQuery query = patientsQuery.convertToQuery(); |
| 107 | 108 | if (StringUtils.isNotEmpty(patientsQuery.getNeed())) { |
| 108 | 109 | patientsQuery.mysqlBuild(iPatientDao.queryPatientCount(query)); |
| ... | ... | @@ -140,8 +141,7 @@ |
| 140 | 141 | return iPatientDao.getPatient(id); |
| 141 | 142 | } |
| 142 | 143 | |
| 143 | - public void updatePatientOneCol(String id,Object colValue) | |
| 144 | - { | |
| 144 | + public void updatePatientOneCol(String id, Object colValue) { | |
| 145 | 145 | iPatientDao.updatePatientOneCol(id, colValue); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | |
| ... | ... | @@ -151,25 +151,25 @@ |
| 151 | 151 | * @param nextCheckTime |
| 152 | 152 | * @param id |
| 153 | 153 | */ |
| 154 | - public void updateNextCheckTime(String nextCheckTime,String id){ | |
| 155 | - if(StringUtils.isNotEmpty(id)){ | |
| 156 | - Patients patients= findOnePatientById(id); | |
| 154 | + public void updateNextCheckTime(String nextCheckTime, String id) { | |
| 155 | + if (StringUtils.isNotEmpty(id)) { | |
| 156 | + Patients patients = findOnePatientById(id); | |
| 157 | 157 | //修改主档 |
| 158 | - if(null!=patients&&StringUtils.isNotEmpty(patients.getSource())){ | |
| 158 | + if (null != patients && StringUtils.isNotEmpty(patients.getSource())) { | |
| 159 | 159 | Patients p = findOnePatientById(patients.getSource()); |
| 160 | - updatePatientOneCol(p.getId(),com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
| 161 | - }else if(null!=patients){ | |
| 162 | - PatientsQuery patientsQuery1=new PatientsQuery(); | |
| 160 | + updatePatientOneCol(p.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
| 161 | + } else if (null != patients) { | |
| 162 | + PatientsQuery patientsQuery1 = new PatientsQuery(); | |
| 163 | 163 | patientsQuery1.setSource(id); |
| 164 | 164 | patientsQuery1.setYn(YnEnums.YES.getId()); |
| 165 | - List<Patients> list= queryPatient(patientsQuery1); | |
| 166 | - if(CollectionUtils.isNotEmpty(list)){ | |
| 167 | - for(Patients p:list){ | |
| 168 | - updatePatientOneCol(p.getId(),com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
| 165 | + List<Patients> list = queryPatient(patientsQuery1); | |
| 166 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 167 | + for (Patients p : list) { | |
| 168 | + updatePatientOneCol(p.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | - updatePatientOneCol(id,com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
| 172 | + updatePatientOneCol(id, com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| ... | ... | @@ -186,9 +186,8 @@ |
| 186 | 186 | Date endDate = DateUtil.addDay(DateUtil.formatDate(new Date()), -105); |
| 187 | 187 | Date start = DateUtil.addDay(DateUtil.formatDate(new Date()), -146); |
| 188 | 188 | //诸城产筛范围未11到 20+6 |
| 189 | - if(his_version != null && "21".equals(his_version)) | |
| 190 | - { | |
| 191 | - endDate = DateUtil.addDay(DateUtil.formatDate(new Date()), -77); | |
| 189 | + if (his_version != null && "21".equals(his_version)) { | |
| 190 | + endDate = DateUtil.addDay(DateUtil.formatDate(new Date()), -77); | |
| 192 | 191 | } |
| 193 | 192 | |
| 194 | 193 | PatientsQuery patientsQuery = new PatientsQuery(); |
| ... | ... | @@ -246,7 +245,7 @@ |
| 246 | 245 | /** |
| 247 | 246 | * 处理预产期前两周的孕妇数据,进入分娩住院追访 |
| 248 | 247 | */ |
| 249 | - public void dandleReachDue(){ | |
| 248 | + public void dandleReachDue() { | |
| 250 | 249 | //查询出满足预产期前两周的孕妇 |
| 251 | 250 | Date endDate = DateUtil.addDay(DateUtil.formatDate(new Date()), +14); |
| 252 | 251 | PatientsQuery patientsQuery = new PatientsQuery(); |
| ... | ... | @@ -258,10 +257,7 @@ |
| 258 | 257 | List<Patients> patientses = iPatientDao.queryPatient(patientsQuery.convertToQuery()); |
| 259 | 258 | if (CollectionUtils.isNotEmpty(patientses)) { |
| 260 | 259 | logger.info("处理预产期前两周的孕妇数据,进入分娩住院追访 size:" + patientses.size()); |
| 261 | - for(Patients patient:patientses){ | |
| 262 | - if(patient.getHospitalId().equals("216")){ | |
| 263 | - System.out.println("cardNo:"+patient.getCardNo()); | |
| 264 | - } | |
| 260 | + for (Patients patient : patientses) { | |
| 265 | 261 | //添加产后追访信息 |
| 266 | 262 | TrackDownRecord trackDownRecord = patient.build(); |
| 267 | 263 | //添加产后追访信息 |
| 268 | 264 | |
| 269 | 265 | |
| 270 | 266 | |
| ... | ... | @@ -269,21 +265,48 @@ |
| 269 | 265 | downRecordQuery.setParentId(trackDownRecord.getParentId()); |
| 270 | 266 | List<TrackDownRecord> records = trackDownRecordService.queryTrackDown(downRecordQuery); |
| 271 | 267 | //不存在追访或者追访未结束流程并且追访类型小于分娩住院 |
| 272 | - if(CollectionUtils.isEmpty(records)||(records.get(0).getStatus() == 1 && records.get(0).getTrackType()<TrackDownDateEnums.E.getId())){ | |
| 268 | + if (CollectionUtils.isEmpty(records) || (records.get(0).getStatus() == 1 && records.get(0).getTrackType() < TrackDownDateEnums.E.getId())) { | |
| 273 | 269 | trackDownRecord.setHospitalId(patient.getHospitalId()); |
| 274 | 270 | trackDownRecord.setSource(patient.getId()); |
| 275 | 271 | trackDownRecord.setStatus(1); |
| 276 | 272 | trackDownRecord.setTrackType(TrackDownDateEnums.E.getId()); |
| 277 | - if(CollectionUtils.isEmpty(records)){ | |
| 273 | + if (CollectionUtils.isEmpty(records)) { | |
| 278 | 274 | trackDownRecordService.addTrackDown(trackDownRecord); |
| 279 | - }else{ | |
| 280 | - trackDownRecordService.updateTrackDown(trackDownRecord,records.get(0).getId()); | |
| 275 | + } else { | |
| 276 | + trackDownRecordService.updateTrackDown(trackDownRecord, records.get(0).getId()); | |
| 281 | 277 | } |
| 282 | 278 | } |
| 283 | 279 | } |
| 284 | 280 | } |
| 285 | 281 | } |
| 286 | 282 | |
| 283 | + /** | |
| 284 | + * 处理产后复查、产后追访数据显示及自动流转 | |
| 285 | + */ | |
| 286 | + public void dandleAutoReachDue() { | |
| 287 | + //添加产后追访信息 | |
| 288 | + TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 289 | + downRecordQuery.setTrackTypes(Arrays.asList(TrackDownDateEnums.F.getId(), TrackDownDateEnums.G.getId(), | |
| 290 | + TrackDownDateEnums.K.getId())); | |
| 291 | + List<TrackDownRecord> records = trackDownRecordService.queryTrackDown(downRecordQuery); | |
| 292 | + for (TrackDownRecord tr : records) { | |
| 293 | + Patients patients = iPatientDao.getPatient(tr.getParentId()); | |
| 294 | + if (patients != null&&patients.getFmDate()!=null) {//分娩时间不为空 | |
| 295 | + //分娩距当前时间天数 | |
| 296 | + int day = DateUtil.daysBetween(patients.getFmDate(), new Date()); | |
| 297 | + if (day <= 60) {//产后60天内,可做产后访视或产后复查环节 | |
| 298 | + if (day > 42) {//不需要做产后访视追访记录,只做产后复查追访 | |
| 299 | + if(tr.getTrackType() == TrackDownDateEnums.K.getId()){//如果已经是产后复查已经转出,则不显示数据了 | |
| 300 | + tr.setStatus(0); | |
| 301 | + }else{//否则进入产后复查追访 | |
| 302 | + tr.setTrackType(TrackDownDateEnums.J.getId()); | |
| 303 | + } | |
| 304 | + trackDownRecordService.updateTrackDown(tr, tr.getId()); | |
| 305 | + } | |
| 306 | + } | |
| 307 | + } | |
| 308 | + } | |
| 309 | + } | |
| 287 | 310 | |
| 288 | 311 | |
| 289 | 312 | /** |
| ... | ... | @@ -335,7 +358,7 @@ |
| 335 | 358 | // remoteService.invalidCoupon(patients.getPid(), "2", RemoteUrlEnum.INVALID_COUPON_URL); |
| 336 | 359 | |
| 337 | 360 | //作废产检劵 |
| 338 | - /* patientCheckTicketService.cancelCheckTicket(patients.getHospitalId(), patients.getId());*/ | |
| 361 | + /* patientCheckTicketService.cancelCheckTicket(patients.getHospitalId(), patients.getId());*/ | |
| 339 | 362 | PersonModelQuery personYunModelQuery = new PersonModelQuery(); |
| 340 | 363 | personYunModelQuery.setYn(YnEnums.YES.getId()); |
| 341 | 364 | personYunModelQuery.setId(patients.getPid()); |
| 342 | 365 | |
| ... | ... | @@ -365,15 +388,15 @@ |
| 365 | 388 | /** |
| 366 | 389 | * 修改非建档医院基本信息 |
| 367 | 390 | */ |
| 368 | - public void updateBaseData(Patients patients){ | |
| 369 | - PatientsQuery patientsQuery2=new PatientsQuery(); | |
| 391 | + public void updateBaseData(Patients patients) { | |
| 392 | + PatientsQuery patientsQuery2 = new PatientsQuery(); | |
| 370 | 393 | patientsQuery2.setPid(patients.getPid()); |
| 371 | 394 | patientsQuery2.setEnable("2"); |
| 372 | 395 | patientsQuery2.setSource(patients.getId()); |
| 373 | 396 | //查询出其他医院的隐藏建档 |
| 374 | - List<Patients> patientses=queryPatient(patientsQuery2); | |
| 375 | - if(CollectionUtils.isNotEmpty(patientses)){ | |
| 376 | - for(Patients patients1:patientses){ | |
| 397 | + List<Patients> patientses = queryPatient(patientsQuery2); | |
| 398 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
| 399 | + for (Patients patients1 : patientses) { | |
| 377 | 400 | patients.setId(patients1.getId()); |
| 378 | 401 | // patients.setBookbuildingDate(patients1.getBookbuildingDate()); |
| 379 | 402 | patients.setHospitalId(patients1.getHospitalId()); |
| 380 | 403 | |
| 381 | 404 | |
| ... | ... | @@ -386,13 +409,14 @@ |
| 386 | 409 | } |
| 387 | 410 | } |
| 388 | 411 | } |
| 412 | + | |
| 389 | 413 | //修改产检管理的孕妇基本信息 |
| 390 | - private void updateExRecord(Patients patients){ | |
| 391 | - AntExRecordQuery antExRecordQuery=new AntExRecordQuery(); | |
| 414 | + private void updateExRecord(Patients patients) { | |
| 415 | + AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
| 392 | 416 | antExRecordQuery.setParentId(patients.getId()); |
| 393 | 417 | |
| 394 | - if(iAntExRecordDao.count(antExRecordQuery.convertToQuery())>0){ | |
| 395 | - AntExRecordModel antExRecordModel=new AntExRecordModel(); | |
| 418 | + if (iAntExRecordDao.count(antExRecordQuery.convertToQuery()) > 0) { | |
| 419 | + AntExRecordModel antExRecordModel = new AntExRecordModel(); | |
| 396 | 420 | antExRecordModel.setLastMenses(patients.getLastMenses()); |
| 397 | 421 | antExRecordModel.setBuildTime(patients.getBookbuildingDate()); |
| 398 | 422 | antExRecordModel.setDueDate(patients.getDueDate()); |
| 399 | 423 | |
| ... | ... | @@ -408,9 +432,9 @@ |
| 408 | 432 | antExRecordModel.setCardNo(patients.getCardNo()); |
| 409 | 433 | |
| 410 | 434 | Patients dbPatients = findOnePatientById(patients.getId()); |
| 411 | - if(dbPatients.getType()==1){ | |
| 435 | + if (dbPatients.getType() == 1) { | |
| 412 | 436 | antExRecordModel.setStatus(2); |
| 413 | - }else { | |
| 437 | + } else { | |
| 414 | 438 | antExRecordModel.setStatus(1); |
| 415 | 439 | } |
| 416 | 440 | antExRecordModel.setModified(new Date()); |
| ... | ... | @@ -418,6 +442,7 @@ |
| 418 | 442 | iAntExRecordDao.batchUpdateRecord(antExRecordModel, antExRecordQuery.convertToQuery()); |
| 419 | 443 | } |
| 420 | 444 | } |
| 445 | + | |
| 421 | 446 | /** |
| 422 | 447 | * 修改产筛数据 |
| 423 | 448 | * |
| ... | ... | @@ -444,7 +469,7 @@ |
| 444 | 469 | sieveModel.setName(patients.getUsername()); |
| 445 | 470 | sieveModel.setLastMenses(patients.getLastMenses()); |
| 446 | 471 | sieveModel.setCardNo(patients.getCardNo()); |
| 447 | - if (null != sieveModel.getDueWeek()&&null!=sieveModel.getApplyDate()) { | |
| 472 | + if (null != sieveModel.getDueWeek() && null != sieveModel.getApplyDate()) { | |
| 448 | 473 | sieveModel.setDueWeek(DateUtil.daysBetween(patients.getLastMenses(), sieveModel.getApplyDate())); |
| 449 | 474 | } |
| 450 | 475 | SieveService.handOrder(sieveModel); |
| ... | ... | @@ -482,7 +507,7 @@ |
| 482 | 507 | sieveModel.setName(patients.getUsername()); |
| 483 | 508 | sieveModel.setLastMenses(patients.getLastMenses()); |
| 484 | 509 | sieveModel.setCardNo(patients.getCardNo()); |
| 485 | - if (null != sieveModel.getDueWeek() &&null!=sieveModel.getApplyDate()) { | |
| 510 | + if (null != sieveModel.getDueWeek() && null != sieveModel.getApplyDate()) { | |
| 486 | 511 | sieveModel.setDueWeek(DateUtil.daysBetween(patients.getLastMenses(), sieveModel.getApplyDate())); |
| 487 | 512 | } |
| 488 | 513 | SieveService.handOrder(sieveModel); |
| ... | ... | @@ -506,7 +531,7 @@ |
| 506 | 531 | referralApplyOrderModel1.setBirth(babyModel.getBirth()); |
| 507 | 532 | referralApplyOrderModel1.setName(babyModel.getName()); |
| 508 | 533 | referralApplyOrderModel1.setCardNo(babyModel.getCardNo()); |
| 509 | - if(null!=patients){ | |
| 534 | + if (null != patients) { | |
| 510 | 535 | referralApplyOrderModel1.setPhone(patients.getPhone()); |
| 511 | 536 | referralApplyOrderModel1.setmCardNo(patients.getCardNo()); |
| 512 | 537 | referralApplyOrderModel1.setMname(patients.getUsername()); |
| 513 | 538 | |
| 514 | 539 | |
| 515 | 540 | |
| 516 | 541 | |
| ... | ... | @@ -594,21 +619,21 @@ |
| 594 | 619 | sieveQuery.setParentId(patient.getId()); |
| 595 | 620 | List<SieveModel> list = sieveDao.queryList(sieveQuery.convertToQuery()); |
| 596 | 621 | if (CollectionUtils.isEmpty(list)) { |
| 597 | - logger.info("find sieve empty parentid:"+patient.getId()); | |
| 622 | + logger.info("find sieve empty parentid:" + patient.getId()); | |
| 598 | 623 | SieveModel sieveModel = convertToModel(patient); |
| 599 | 624 | sieveModel.setFrom("0"); |
| 600 | - SieveApplyOrderQuery sieveApplyOrderQuery=new SieveApplyOrderQuery(); | |
| 625 | + SieveApplyOrderQuery sieveApplyOrderQuery = new SieveApplyOrderQuery(); | |
| 601 | 626 | sieveApplyOrderQuery.setParentId(patient.getId()); |
| 602 | 627 | sieveApplyOrderQuery.setYn(YnEnums.YES.getId()); |
| 603 | 628 | List<SieveApplyOrderModel> orders = sieveApplyOrderDao.queryList(sieveApplyOrderQuery.convertToQuery()); |
| 604 | - if(CollectionUtils.isNotEmpty(orders)){ | |
| 629 | + if (CollectionUtils.isNotEmpty(orders)) { | |
| 605 | 630 | sieveModel.setStatus(SieveStatusEnums.O1.getId()); |
| 606 | 631 | |
| 607 | - SieveResultQuery sieveResultQuery=new SieveResultQuery(); | |
| 632 | + SieveResultQuery sieveResultQuery = new SieveResultQuery(); | |
| 608 | 633 | sieveResultQuery.setParentId(patient.getId()); |
| 609 | 634 | sieveResultQuery.setYn(YnEnums.YES.getId()); |
| 610 | - List<SieveResultModel> result= sieveDao.queryListSieveResult(sieveResultQuery.convertToQuery()); | |
| 611 | - if(CollectionUtils.isNotEmpty(result)){ | |
| 635 | + List<SieveResultModel> result = sieveDao.queryListSieveResult(sieveResultQuery.convertToQuery()); | |
| 636 | + if (CollectionUtils.isNotEmpty(result)) { | |
| 612 | 637 | sieveModel.setStatus(SieveStatusEnums.O2.getId()); |
| 613 | 638 | } |
| 614 | 639 | } |
platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java
View file @
1d5829d
| ... | ... | @@ -179,6 +179,9 @@ |
| 179 | 179 | if (created != null) { |
| 180 | 180 | condition = condition.and("created", created, MongoOper.IS); |
| 181 | 181 | } |
| 182 | + if (marriageId != null) { | |
| 183 | + condition = condition.and("marriageId", marriageId, MongoOper.IS); | |
| 184 | + } | |
| 182 | 185 | if (StringUtils.isNotBlank(buildDoctor)) { |
| 183 | 186 | condition = condition.and("buildDoctor", buildDoctor, MongoOper.IS); |
| 184 | 187 | } |
platform-dal/src/main/java/com/lyms/platform/query/TrackDownRecordQuery.java
View file @
1d5829d
| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 | private String hospitalId; |
| 40 | 40 | private String residentsArchiveId; |
| 41 | 41 | private String source; |
| 42 | - private String status; | |
| 42 | + private Integer status; | |
| 43 | 43 | private String cardNo; |
| 44 | 44 | private String phone; |
| 45 | 45 | /** |
| 46 | 46 | |
| ... | ... | @@ -88,11 +88,11 @@ |
| 88 | 88 | this.source = source; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - public String getStatus() { | |
| 91 | + public Integer getStatus() { | |
| 92 | 92 | return status; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - public void setStatus(String status) { | |
| 95 | + public void setStatus(Integer status) { | |
| 96 | 96 | this.status = status; |
| 97 | 97 | } |
| 98 | 98 | |
| ... | ... | @@ -200,7 +200,7 @@ |
| 200 | 200 | public MongoQuery convertToQuery() { |
| 201 | 201 | MongoCondition condition = MongoCondition.newInstance(); |
| 202 | 202 | |
| 203 | - if (StringUtils.isNotEmpty(status)) { | |
| 203 | + if (status!=null) { | |
| 204 | 204 | condition = condition.and("status", status, MongoOper.IS); |
| 205 | 205 | } else { |
| 206 | 206 | //默认只查询显示的数据 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownJobFacade.java
View file @
1d5829d
| ... | ... | @@ -114,13 +114,13 @@ |
| 114 | 114 | //婚前检查数据加载 |
| 115 | 115 | downJobHandlers.add(new HJTrackDownDataLoader()); |
| 116 | 116 | //怀孕建档数据加载 |
| 117 | - downJobHandlers.add(new HYTrackDownDataLoader()); | |
| 117 | + // downJobHandlers.add(new HYTrackDownDataLoader()); | |
| 118 | 118 | //产检数据加载 |
| 119 | - downJobHandlers.add(new CJTrackDownDataLoader()); | |
| 119 | + // downJobHandlers.add(new CJTrackDownDataLoader()); | |
| 120 | 120 | //分娩数据加载,有自动任务处理 |
| 121 | 121 | // downJobHandlers.add(new FMTrackDownDataLoader()); |
| 122 | 122 | //产后访视和产后复查的数据加载 产后访视和产后复查的规则一样 |
| 123 | - downJobHandlers.add(new CHTrackDownDataLoader()); | |
| 123 | + // downJobHandlers.add(new CHTrackDownDataLoader()); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 | |
| ... | ... | @@ -294,11 +294,14 @@ |
| 294 | 294 | |
| 295 | 295 | @Override |
| 296 | 296 | public void execute() { |
| 297 | + System.out.println("开始生成妇女档案生成追访数据!"); | |
| 297 | 298 | int page = 1; |
| 298 | 299 | List<ResidentsArchiveModel> data = null; |
| 300 | + //处理女性档案 | |
| 299 | 301 | do { |
| 300 | 302 | ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); |
| 301 | 303 | archiveQuery.setYn(YnEnums.YES.getId()); |
| 304 | + archiveQuery.setSex("c23779f1-cb6e-44d0-9fc8-0a990bf6184c"); | |
| 302 | 305 | archiveQuery.setSort("created asc"); |
| 303 | 306 | archiveQuery.setNeed("1"); |
| 304 | 307 | archiveQuery.setPage(page); |
| ... | ... | @@ -313,6 +316,30 @@ |
| 313 | 316 | } |
| 314 | 317 | page++; |
| 315 | 318 | } while (CollectionUtils.isNotEmpty(data) && data.size() == limit); |
| 319 | + | |
| 320 | + //处理男性未婚档案 | |
| 321 | + page = 1; | |
| 322 | + do { | |
| 323 | + ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); | |
| 324 | + archiveQuery.setYn(YnEnums.YES.getId()); | |
| 325 | + archiveQuery.setSort("created asc"); | |
| 326 | + archiveQuery.setMarriageId("d049eaaa-7265-4cdb-879f-992ab6320a3a"); | |
| 327 | + archiveQuery.setSex("5d0b782f-b61b-441b-b8c5-4bf55eece273"); | |
| 328 | + archiveQuery.setNeed("1"); | |
| 329 | + archiveQuery.setPage(page); | |
| 330 | + archiveQuery.setLimit(limit); | |
| 331 | + //查询妇女建档 | |
| 332 | + data = residentsArchiveService.queryResident(archiveQuery); | |
| 333 | + if (CollectionUtils.isNotEmpty(data)) { | |
| 334 | + for (ResidentsArchiveModel model : data) { | |
| 335 | + //单条数据处理 | |
| 336 | + handOneByOne(model); | |
| 337 | + } | |
| 338 | + } | |
| 339 | + page++; | |
| 340 | + } while (CollectionUtils.isNotEmpty(data) && data.size() == limit); | |
| 341 | + | |
| 342 | + System.out.println("妇女档案生成追访数据完成!"); | |
| 316 | 343 | } |
| 317 | 344 | |
| 318 | 345 | /** |
| ... | ... | @@ -322,11 +349,11 @@ |
| 322 | 349 | * @param model |
| 323 | 350 | */ |
| 324 | 351 | public void handOneByOne(ResidentsArchiveModel model) { |
| 325 | - if ("5d0b782f-b61b-441b-b8c5-4bf55eece273".equals(model.getSex())) {//男 | |
| 326 | - if ("d75d1902-61a5-4a17-a68a-5b8a9826537b".equals(model.getMarriageId())) {//已婚,不添加追访信息 | |
| 327 | - return; | |
| 328 | - } | |
| 329 | - } | |
| 352 | + // if ("5d0b782f-b61b-441b-b8c5-4bf55eece273".equals(model.getSex())) {//男 | |
| 353 | + // if ("d75d1902-61a5-4a17-a68a-5b8a9826537b".equals(model.getMarriageId())) {//已婚,不添加追访信息 | |
| 354 | + // return; | |
| 355 | + // } | |
| 356 | + // } | |
| 330 | 357 | |
| 331 | 358 | if (null != model && StringUtils.isNotEmpty(model.getId())) { |
| 332 | 359 | PremaritalCheckupQuery premaritalCheckupQuery = new PremaritalCheckupQuery(); |
| ... | ... | @@ -340,7 +367,7 @@ |
| 340 | 367 | TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); |
| 341 | 368 | downRecordQuery.setHospitalId(model.getHospitalId()); |
| 342 | 369 | if (StringUtils.isNotEmpty(model.getCertificateNum())) { |
| 343 | - downRecordQuery.setKey(model.getCertificateNum()); | |
| 370 | + downRecordQuery.setCardNo(model.getCertificateNum()); | |
| 344 | 371 | } else if (StringUtils.isNotEmpty(model.getPhone())) { |
| 345 | 372 | downRecordQuery.setPhone(model.getPhone()); |
| 346 | 373 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TrackDownServiceImpl.java
View file @
1d5829d
| ... | ... | @@ -225,7 +225,8 @@ |
| 225 | 225 | return RespBuilder.buildErro(ResponseCode.DATA_ERROR, "数据已经被修改请回到列表刷新后再操作!"); |
| 226 | 226 | } |
| 227 | 227 | if (TrackDownDateEnums.A.getId() == trackDown.getTrackDownDateType() |
| 228 | - && "5d0b782f-b61b-441b-b8c5-4bf55eece273".equals(trackDownRecord.getSex())) {//性别男:特殊处理,流转到下一流程时结束流程 | |
| 228 | + && "5d0b782f-b61b-441b-b8c5-4bf55eece273".equals(trackDownRecord.getSex()) | |
| 229 | + &&TrackDownTransferEnums.B.getId() == trackDown.getTrackDownTransfer()) {//性别男:特殊处理,流转到下一流程时结束流程 | |
| 229 | 230 | trackDown.setTrackDownTransfer(TrackDownTransferEnums.C.getId()); |
| 230 | 231 | } |
| 231 | 232 | } |
platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml
View file @
1d5829d
| ... | ... | @@ -71,6 +71,16 @@ |
| 71 | 71 | <property name="concurrent" value="false"></property> |
| 72 | 72 | </bean> |
| 73 | 73 | |
| 74 | + <!--处理产后复查、产后追访数据显示及自动流转追访任务 --> | |
| 75 | + <bean id="dandleAutoReachDue" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> | |
| 76 | + <!-- 要调用的bean --> | |
| 77 | + <property name="targetObject" ref="patientsServiceLocal"></property> | |
| 78 | + <!-- 要调用的Method --> | |
| 79 | + <property name="targetMethod" value="dandleAutoReachDue"></property> | |
| 80 | + <!-- 是否并发,false表示 如果发生错误也不影响下一次的调用 --> | |
| 81 | + <property name="concurrent" value="false"></property> | |
| 82 | + </bean> | |
| 83 | + | |
| 74 | 84 | <bean id="delSieveTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> |
| 75 | 85 | <!-- 要调用的bean --> |
| 76 | 86 | <property name="targetObject" ref="patientsServiceLocal"></property> |
| ... | ... | @@ -156,6 +166,11 @@ |
| 156 | 166 | <property name="jobDetail" ref="dandleReachDue"></property> |
| 157 | 167 | <property name="cronExpression" value="0 0 2 * * ?"></property> |
| 158 | 168 | </bean> |
| 169 | + <!-- 配置一个触发器 --> | |
| 170 | + <bean id="dandleAutoReachDueTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> | |
| 171 | + <property name="jobDetail" ref="dandleAutoReachDue"></property> | |
| 172 | + <property name="cronExpression" value="0 30 2 * * ?"></property> | |
| 173 | + </bean> | |
| 159 | 174 | |
| 160 | 175 | <!-- 配置一个触发器 --> |
| 161 | 176 | <bean id="delSieveTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> |
| 162 | 177 | |
| ... | ... | @@ -212,7 +227,15 @@ |
| 212 | 227 | <property name="repeatCount" value="0" /> |
| 213 | 228 | </bean> |
| 214 | 229 | |
| 230 | + <!-- 分娩前20周分娩住院追访配置项目启动后任务就执行一次 --> | |
| 231 | + <bean id="firstDandleAutoReachDueTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean"> | |
| 232 | + <property name="jobDetail" ref="dandleAutoReachDue" /> | |
| 233 | + <property name="startDelay" value="500" /> | |
| 234 | + <property name="repeatInterval" value="0" /> | |
| 235 | + <property name="repeatCount" value="0" /> | |
| 236 | + </bean> | |
| 215 | 237 | |
| 238 | + | |
| 216 | 239 | <!-- 孕妇学校定时任务 --> |
| 217 | 240 | <bean id="courseWorker" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> |
| 218 | 241 | <!-- 要调用的bean --> |
| ... | ... | @@ -262,6 +285,10 @@ |
| 262 | 285 | <ref bean="dandleReachDueTrigger"/> |
| 263 | 286 | <!--预产期前两周自动创建分娩住院追访启动时执行一次--> |
| 264 | 287 | <ref bean="firstDandleReachDueTrigger" /> |
| 288 | + <!--处理产后复查、产后追访数据显示及自动流转--> | |
| 289 | + <ref bean="dandleAutoReachDueTrigger"/> | |
| 290 | + <!--处理产后复查、产后追访数据显示及自动流转--> | |
| 291 | + <ref bean="firstDandleAutoReachDueTrigger" /> | |
| 265 | 292 | <!--乐陵住院系统同步--> |
| 266 | 293 | <!--<ref bean="synLlHisDataTrigger"/>--> |
| 267 | 294 | <!--乐陵住院启动时执行一次--> |