Commit c8b9077dabba34aeddada5ed46a980f7d272dba3
1 parent
77eb6ad03e
Exists in
master
and in
6 other branches
孕产妇数据统计-建档逻辑修改
Showing 1 changed file with 29 additions and 9 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
c8b9077
| ... | ... | @@ -4414,7 +4414,9 @@ |
| 4414 | 4414 | //建档 |
| 4415 | 4415 | Criteria criteria = Criteria.where("bookbuildingDate").gte(startDate).lte(endDate) |
| 4416 | 4416 | .and("hospitalId").is(hospitalId) |
| 4417 | - .and("yn").is(YnEnums.YES.getId()); | |
| 4417 | + .and("yn").is(YnEnums.YES.getId()) | |
| 4418 | + .and("enable").nin(Arrays.asList("1","2")) | |
| 4419 | + .and("buildType").ne(1); | |
| 4418 | 4420 | List<Patients> patientsList = mongoTemplate.find(Query.query(criteria), Patients.class); |
| 4419 | 4421 | //初诊 |
| 4420 | 4422 | Criteria criteria2 = Criteria.where("checkTime").gte(startDate).lte(endDate) |
| ... | ... | @@ -4476,7 +4478,9 @@ |
| 4476 | 4478 | Criteria criteria8 = Criteria.where("bookbuildingDate").gte(antExChuModel.getLastMenses()).lt(startDate) |
| 4477 | 4479 | .and("parentId").is(antExChuModel.getParentId()) |
| 4478 | 4480 | .and("hospitalId").is(hospitalId) |
| 4479 | - .and("yn").is(YnEnums.YES.getId()); | |
| 4481 | + .and("yn").is(YnEnums.YES.getId()) | |
| 4482 | + .and("enable").nin(Arrays.asList("1","2")) | |
| 4483 | + .and("buildType").ne(1); | |
| 4480 | 4484 | Patients patient = mongoTemplate.findOne(Query.query(criteria8), Patients.class); |
| 4481 | 4485 | if(null!=patient){ |
| 4482 | 4486 | filingBefore++; |
| ... | ... | @@ -4489,7 +4493,9 @@ |
| 4489 | 4493 | .gte(DateUtil.getMonthDay(startDate,-1,1)).lte(DateUtil.getMonthDay(startDate,-1,0)) |
| 4490 | 4494 | .and("parentId").is(antExChuModel.getParentId()) |
| 4491 | 4495 | .and("hospitalId").is(hospitalId) |
| 4492 | - .and("yn").is(YnEnums.YES.getId()); | |
| 4496 | + .and("yn").is(YnEnums.YES.getId()) | |
| 4497 | + .and("enable").nin(Arrays.asList("1","2")) | |
| 4498 | + .and("buildType").ne(1); | |
| 4493 | 4499 | Patients patient = mongoTemplate.findOne(Query.query(criteria9), Patients.class); |
| 4494 | 4500 | if(null!=patient){ |
| 4495 | 4501 | filingLastMonth++; |
| ... | ... | @@ -4502,7 +4508,9 @@ |
| 4502 | 4508 | .gte(antExChuModel.getLastMenses()).lt(DateUtil.getMonthDay(startDate,-1,1)) |
| 4503 | 4509 | .and("parentId").is(antExChuModel.getParentId()) |
| 4504 | 4510 | .and("hospitalId").is(hospitalId) |
| 4505 | - .and("yn").is(YnEnums.YES.getId()); | |
| 4511 | + .and("yn").is(YnEnums.YES.getId()) | |
| 4512 | + .and("enable").nin(Arrays.asList("1","2")) | |
| 4513 | + .and("buildType").ne(1); | |
| 4506 | 4514 | Patients patient = mongoTemplate.findOne(Query.query(criteria10), Patients.class); |
| 4507 | 4515 | if(null!=patient){ |
| 4508 | 4516 | filingEarly++; |
| ... | ... | @@ -4582,7 +4590,9 @@ |
| 4582 | 4590 | int dueWeek12=0,dueWeek13=0,dueWeek20=0,dueWeek25=0,dueWeek29=0; |
| 4583 | 4591 | Criteria criteria = Criteria.where("bookbuildingDate").gte(startDate).lte(endDate) |
| 4584 | 4592 | .and("hospitalId").is(hospitalId) |
| 4585 | - .and("yn").is(YnEnums.YES.getId()); | |
| 4593 | + .and("yn").is(YnEnums.YES.getId()) | |
| 4594 | + .and("enable").nin(Arrays.asList("1","2")) | |
| 4595 | + .and("buildType").ne(1); | |
| 4586 | 4596 | List<Patients> patientsList = mongoTemplate.find(Query.query(criteria), Patients.class); |
| 4587 | 4597 | for (Patients patients : patientsList) { |
| 4588 | 4598 | //避免末次月经字段空。但是这样统计结果不准确。前端该字段是必填。但是历史数据不保证。 |
| ... | ... | @@ -4768,6 +4778,8 @@ |
| 4768 | 4778 | patientsQuery.setNeed("yse"); |
| 4769 | 4779 | patientsQuery.setPage(page); |
| 4770 | 4780 | patientsQuery.setLimit(limit); |
| 4781 | + patientsQuery.setExtEnable(false); | |
| 4782 | + patientsQuery.setBuildTypeNot(1); | |
| 4771 | 4783 | patientsList = patientsService.queryPatientBySort(patientsQuery, "bookbuildingDate", "DESC"); |
| 4772 | 4784 | for (Patients patient : patientsList) { |
| 4773 | 4785 | Map<String, Object> map = new HashMap<>(); |
| ... | ... | @@ -4989,7 +5001,9 @@ |
| 4989 | 5001 | //建档 |
| 4990 | 5002 | Criteria criteria = Criteria.where("bookbuildingDate").gte(startDate).lte(endDate) |
| 4991 | 5003 | .and("hospitalId").is(hospitalId) |
| 4992 | - .and("yn").is(YnEnums.YES.getId()); | |
| 5004 | + .and("yn").is(YnEnums.YES.getId()) | |
| 5005 | + .and("enable").nin(Arrays.asList("1","2")) | |
| 5006 | + .and("buildType").ne(1); | |
| 4993 | 5007 | List<Patients> patientsList = mongoTemplate.find(Query.query(criteria), Patients.class); |
| 4994 | 5008 | //建档未初诊(包含外院初诊) |
| 4995 | 5009 | List<String> antExChuNotList = new ArrayList<>(); |
| ... | ... | @@ -5088,7 +5102,9 @@ |
| 5088 | 5102 | .and("nextCheckTime").lt(new Date()) |
| 5089 | 5103 | .and("type").is(1) |
| 5090 | 5104 | .and("hospitalId").is(hospitalId) |
| 5091 | - .and("yn").is(1); | |
| 5105 | + .and("yn").is(1) | |
| 5106 | + .and("enable").nin(Arrays.asList("1","2")) | |
| 5107 | + .and("buildType").ne(1); | |
| 5092 | 5108 | AggregationOperation match = Aggregation.match(criteria); |
| 5093 | 5109 | AggregationOperation group = Aggregation.group("lastCheckEmployeeId").count().as("count"); |
| 5094 | 5110 | Aggregation aggregation= Aggregation.newAggregation(match, group); |
| ... | ... | @@ -5129,7 +5145,9 @@ |
| 5129 | 5145 | .and("areaRegisterId").is(areaId) |
| 5130 | 5146 | .and("type").is(1) |
| 5131 | 5147 | .and("hospitalId").is(hospitalId) |
| 5132 | - .and("yn").is(1); | |
| 5148 | + .and("yn").is(1) | |
| 5149 | + .and("enable").nin(Arrays.asList("1","2")) | |
| 5150 | + .and("buildType").ne(1); | |
| 5133 | 5151 | AggregationOperation match = Aggregation.match(criteria); |
| 5134 | 5152 | AggregationOperation group = Aggregation.group("streetRegisterId").count().as("count"); |
| 5135 | 5153 | Aggregation aggregation= Aggregation.newAggregation(match, group); |
| ... | ... | @@ -5149,7 +5167,9 @@ |
| 5149 | 5167 | .and("type").is(1) |
| 5150 | 5168 | .and("hospitalId").is(hospitalId) |
| 5151 | 5169 | .and("yn").is(1) |
| 5152 | - .and("nextCheckTime").lt(new Date()); | |
| 5170 | + .and("nextCheckTime").lt(new Date()) | |
| 5171 | + .and("enable").nin(Arrays.asList("1","2")) | |
| 5172 | + .and("buildType").ne(1); | |
| 5153 | 5173 | //逾期人数 |
| 5154 | 5174 | long count = mongoTemplate.count(Query.query(criteria2), Patients.class); |
| 5155 | 5175 | map.put("overdueCount", count); |