Commit 304016ccc1dd3960fc45c1d453ff4fabb3b8bbed
1 parent
ac4de13c79
Exists in
master
and in
6 other branches
产检节点统计
Showing 3 changed files with 119 additions and 110 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java
View file @
304016c
| ... | ... | @@ -44,6 +44,10 @@ |
| 44 | 44 | @Autowired |
| 45 | 45 | private IAntExRecordMDao iAntExRecordMDao; |
| 46 | 46 | |
| 47 | + | |
| 48 | + @Autowired | |
| 49 | + private AntenatalExaminationService antenatalExaminationService; | |
| 50 | + | |
| 47 | 51 | public List aggregateOne(AntExRecordQuery antExRecordQuery) { |
| 48 | 52 | return antExRecordDao.aggregateOne(antExRecordQuery.convertToQuery()); |
| 49 | 53 | } |
| ... | ... | @@ -176,6 +180,9 @@ |
| 176 | 180 | antExRecordDao.findAndMove(antExRecordQuery1.convertToQuery()); |
| 177 | 181 | |
| 178 | 182 | syncSingle(parentId); |
| 183 | + | |
| 184 | + //产检节点统计孕妇范围首次计算 | |
| 185 | + antenatalExaminationService.handleCheckPoint(parentId); | |
| 179 | 186 | } |
| 180 | 187 | |
| 181 | 188 |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntenatalExaminationService.java
View file @
304016c
| ... | ... | @@ -130,16 +130,18 @@ |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | + //产检节点统计孕妇范围首次计算 | |
| 133 | 134 | handleCheckPoint(antExRecordModel.getPid()); |
| 134 | 135 | } |
| 135 | 136 | } |
| 136 | 137 | |
| 137 | 138 | |
| 138 | 139 | /** |
| 139 | - * 产检统计中计算各个产检节点 的是否是节点中的首次节点 | |
| 140 | + * 产检统计中计算各个产检节点 | |
| 141 | + * 的是否是节点中的首次节点 | |
| 140 | 142 | * @param pid |
| 141 | 143 | */ |
| 142 | - private void handleCheckPoint(String pid) | |
| 144 | + public void handleCheckPoint(String pid) | |
| 143 | 145 | { |
| 144 | 146 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 145 | 147 | patientsQuery.setYn(YnEnums.YES.getId()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
304016c
| ... | ... | @@ -67,7 +67,6 @@ |
| 67 | 67 | @Autowired |
| 68 | 68 | private AntenatalExaminationService antenatalExaminationService; |
| 69 | 69 | |
| 70 | - | |
| 71 | 70 | @Autowired |
| 72 | 71 | private AntenatalExaminationFacade antenatalExaminationFacade; |
| 73 | 72 | |
| ... | ... | @@ -388,113 +387,114 @@ |
| 388 | 387 | public void run() { |
| 389 | 388 | for(PersonModel person : models) |
| 390 | 389 | { |
| 391 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
| 392 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
| 393 | - patientsQuery.setPid(person.getId()); | |
| 394 | - List<Patients> pats = patientsService.queryPatient1(patientsQuery,"created"); | |
| 395 | - | |
| 396 | - Map<String,List<Patients>> temps = new HashMap<String, List<Patients>>(); | |
| 397 | - | |
| 398 | - if (CollectionUtils.isNotEmpty(pats)) | |
| 399 | - { | |
| 400 | - for(Patients pat : pats) | |
| 401 | - { | |
| 402 | - if (pat.getLastMenses() != null) | |
| 403 | - { | |
| 404 | - Object obj = temps.get(DateUtil.getyyyy_MM_dd(pat.getLastMenses())); | |
| 405 | - if (obj != null) | |
| 406 | - { | |
| 407 | - List<Patients> cc = (List<Patients>)obj; | |
| 408 | - cc.add(pat); | |
| 409 | - temps.put(DateUtil.getyyyy_MM_dd(pat.getLastMenses()),cc); | |
| 410 | - } | |
| 411 | - else | |
| 412 | - { | |
| 413 | - List<Patients> cc = new ArrayList<Patients>(); | |
| 414 | - cc.add(pat); | |
| 415 | - temps.put(DateUtil.getyyyy_MM_dd(pat.getLastMenses()),cc); | |
| 416 | - } | |
| 417 | - } | |
| 418 | - } | |
| 419 | - } | |
| 420 | - | |
| 421 | - if (!temps.isEmpty()) | |
| 422 | - { | |
| 423 | - for(String key : temps.keySet()) | |
| 424 | - { | |
| 425 | - List<String> ids = new ArrayList<String>(); | |
| 426 | - List<Patients> patientses = temps.get(key); | |
| 427 | - if (CollectionUtils.isNotEmpty(patientses)) | |
| 428 | - { | |
| 429 | - for(Patients patients : patientses) | |
| 430 | - { | |
| 431 | - ids.add(patients.getId()); | |
| 432 | - } | |
| 433 | - } | |
| 434 | - | |
| 435 | - if (CollectionUtils.isNotEmpty(ids)) | |
| 436 | - { | |
| 437 | - AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
| 438 | - antExRecordQuery.setParentIds(ids); | |
| 439 | - for (int i = 0 ; i < 7 ; i++) | |
| 440 | - { | |
| 441 | - if (i == 0) | |
| 442 | - { | |
| 443 | - antExRecordQuery.setcDueWeekStart(0); | |
| 444 | - antExRecordQuery.setcDueWeekEnd((12 + 1) * 7 - 1); | |
| 445 | - } | |
| 446 | - else if (i == 1) | |
| 447 | - { | |
| 448 | - antExRecordQuery.setcDueWeekStart(13*7); | |
| 449 | - antExRecordQuery.setcDueWeekEnd((15 + 1) * 7 - 1); | |
| 450 | - } | |
| 451 | - else if (i == 2) | |
| 452 | - { | |
| 453 | - antExRecordQuery.setcDueWeekStart(16*7); | |
| 454 | - antExRecordQuery.setcDueWeekEnd((20 + 1) * 7 - 1); | |
| 455 | - } | |
| 456 | - else if (i == 3) | |
| 457 | - { | |
| 458 | - antExRecordQuery.setcDueWeekStart(21*7); | |
| 459 | - antExRecordQuery.setcDueWeekEnd((24 + 1) * 7 - 1); | |
| 460 | - } | |
| 461 | - else if (i == 4) | |
| 462 | - { | |
| 463 | - antExRecordQuery.setcDueWeekStart(25*7); | |
| 464 | - antExRecordQuery.setcDueWeekEnd((27 + 1) * 7 - 1); | |
| 465 | - } | |
| 466 | - else if (i == 5) | |
| 467 | - { | |
| 468 | - antExRecordQuery.setcDueWeekStart(28*7); | |
| 469 | - antExRecordQuery.setcDueWeekEnd((36 + 1) * 7 - 1); | |
| 470 | - } | |
| 471 | - else if (i == 6) | |
| 472 | - { | |
| 473 | - antExRecordQuery.setcDueWeekStart(37*7); | |
| 474 | - antExRecordQuery.setcDueWeekEnd((40 + 1) * 7 - 1); | |
| 475 | - } | |
| 476 | - | |
| 477 | - List<AntExRecordModel> list = recordService.queryAntExRecords(antExRecordQuery); | |
| 478 | - if (CollectionUtils.isNotEmpty(list)) | |
| 479 | - { | |
| 480 | - for (int j = 0 ; j < list.size() ; j++) | |
| 481 | - { | |
| 482 | - AntExRecordModel m = list.get(j); | |
| 483 | - if (j == (list.size() - 1)) | |
| 484 | - { | |
| 485 | - m.setIsFirst(1); | |
| 486 | - } | |
| 487 | - else | |
| 488 | - { | |
| 489 | - m.setIsFirst(2); | |
| 490 | - } | |
| 491 | - recordService.updateOne(m,m.getId()); | |
| 492 | - } | |
| 493 | - } | |
| 494 | - } | |
| 495 | - } | |
| 496 | - } | |
| 497 | - } | |
| 390 | + antenatalExaminationService.handleCheckPoint(person.getId()); | |
| 391 | +// PatientsQuery patientsQuery = new PatientsQuery(); | |
| 392 | +// patientsQuery.setYn(YnEnums.YES.getId()); | |
| 393 | +// patientsQuery.setPid(person.getId()); | |
| 394 | +// List<Patients> pats = patientsService.queryPatient1(patientsQuery,"created"); | |
| 395 | +// | |
| 396 | +// Map<String,List<Patients>> temps = new HashMap<String, List<Patients>>(); | |
| 397 | +// | |
| 398 | +// if (CollectionUtils.isNotEmpty(pats)) | |
| 399 | +// { | |
| 400 | +// for(Patients pat : pats) | |
| 401 | +// { | |
| 402 | +// if (pat.getLastMenses() != null) | |
| 403 | +// { | |
| 404 | +// Object obj = temps.get(DateUtil.getyyyy_MM_dd(pat.getLastMenses())); | |
| 405 | +// if (obj != null) | |
| 406 | +// { | |
| 407 | +// List<Patients> cc = (List<Patients>)obj; | |
| 408 | +// cc.add(pat); | |
| 409 | +// temps.put(DateUtil.getyyyy_MM_dd(pat.getLastMenses()),cc); | |
| 410 | +// } | |
| 411 | +// else | |
| 412 | +// { | |
| 413 | +// List<Patients> cc = new ArrayList<Patients>(); | |
| 414 | +// cc.add(pat); | |
| 415 | +// temps.put(DateUtil.getyyyy_MM_dd(pat.getLastMenses()),cc); | |
| 416 | +// } | |
| 417 | +// } | |
| 418 | +// } | |
| 419 | +// } | |
| 420 | +// | |
| 421 | +// if (!temps.isEmpty()) | |
| 422 | +// { | |
| 423 | +// for(String key : temps.keySet()) | |
| 424 | +// { | |
| 425 | +// List<String> ids = new ArrayList<String>(); | |
| 426 | +// List<Patients> patientses = temps.get(key); | |
| 427 | +// if (CollectionUtils.isNotEmpty(patientses)) | |
| 428 | +// { | |
| 429 | +// for(Patients patients : patientses) | |
| 430 | +// { | |
| 431 | +// ids.add(patients.getId()); | |
| 432 | +// } | |
| 433 | +// } | |
| 434 | +// | |
| 435 | +// if (CollectionUtils.isNotEmpty(ids)) | |
| 436 | +// { | |
| 437 | +// AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
| 438 | +// antExRecordQuery.setParentIds(ids); | |
| 439 | +// for (int i = 0 ; i < 7 ; i++) | |
| 440 | +// { | |
| 441 | +// if (i == 0) | |
| 442 | +// { | |
| 443 | +// antExRecordQuery.setcDueWeekStart(0); | |
| 444 | +// antExRecordQuery.setcDueWeekEnd((12 + 1) * 7 - 1); | |
| 445 | +// } | |
| 446 | +// else if (i == 1) | |
| 447 | +// { | |
| 448 | +// antExRecordQuery.setcDueWeekStart(13*7); | |
| 449 | +// antExRecordQuery.setcDueWeekEnd((15 + 1) * 7 - 1); | |
| 450 | +// } | |
| 451 | +// else if (i == 2) | |
| 452 | +// { | |
| 453 | +// antExRecordQuery.setcDueWeekStart(16*7); | |
| 454 | +// antExRecordQuery.setcDueWeekEnd((20 + 1) * 7 - 1); | |
| 455 | +// } | |
| 456 | +// else if (i == 3) | |
| 457 | +// { | |
| 458 | +// antExRecordQuery.setcDueWeekStart(21*7); | |
| 459 | +// antExRecordQuery.setcDueWeekEnd((24 + 1) * 7 - 1); | |
| 460 | +// } | |
| 461 | +// else if (i == 4) | |
| 462 | +// { | |
| 463 | +// antExRecordQuery.setcDueWeekStart(25*7); | |
| 464 | +// antExRecordQuery.setcDueWeekEnd((27 + 1) * 7 - 1); | |
| 465 | +// } | |
| 466 | +// else if (i == 5) | |
| 467 | +// { | |
| 468 | +// antExRecordQuery.setcDueWeekStart(28*7); | |
| 469 | +// antExRecordQuery.setcDueWeekEnd((36 + 1) * 7 - 1); | |
| 470 | +// } | |
| 471 | +// else if (i == 6) | |
| 472 | +// { | |
| 473 | +// antExRecordQuery.setcDueWeekStart(37*7); | |
| 474 | +// antExRecordQuery.setcDueWeekEnd((40 + 1) * 7 - 1); | |
| 475 | +// } | |
| 476 | +// | |
| 477 | +// List<AntExRecordModel> list = recordService.queryAntExRecords(antExRecordQuery); | |
| 478 | +// if (CollectionUtils.isNotEmpty(list)) | |
| 479 | +// { | |
| 480 | +// for (int j = 0 ; j < list.size() ; j++) | |
| 481 | +// { | |
| 482 | +// AntExRecordModel m = list.get(j); | |
| 483 | +// if (j == (list.size() - 1)) | |
| 484 | +// { | |
| 485 | +// m.setIsFirst(1); | |
| 486 | +// } | |
| 487 | +// else | |
| 488 | +// { | |
| 489 | +// m.setIsFirst(2); | |
| 490 | +// } | |
| 491 | +// recordService.updateOne(m,m.getId()); | |
| 492 | +// } | |
| 493 | +// } | |
| 494 | +// } | |
| 495 | +// } | |
| 496 | +// } | |
| 497 | +// } | |
| 498 | 498 | } |
| 499 | 499 | } |
| 500 | 500 | }); |