Commit 0069c6ac8a4bc68354bf15690c7ab29d932d56bd
1 parent
9d4c134c7d
Exists in
master
and in
6 other branches
美生县医院系统数据分析报告-2.3.2.二级漏检提醒,2
Showing 1 changed file with 25 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
0069c6a
... | ... | @@ -5035,6 +5035,7 @@ |
5035 | 5035 | Criteria criteria2 = Criteria.where("parentId").is(antExChuModel.getParentId()) |
5036 | 5036 | .and("hospitalId").is(hospitalId) |
5037 | 5037 | .and("type").is(1) |
5038 | + .and("dueStatus").in(0,2) | |
5038 | 5039 | .and("yn").is(1); |
5039 | 5040 | final long count = mongoTemplate.count(Query.query(criteria2), AntExRecordModel.class); |
5040 | 5041 | if(count==0){ |
5041 | 5042 | |
5042 | 5043 | |
5043 | 5044 | |
5044 | 5045 | |
... | ... | @@ -5078,16 +5079,37 @@ |
5078 | 5079 | public BaseResponse getFinallyCheckOverdue(String hospitalId, Date startDate, Date endDate) { |
5079 | 5080 | BaseResponse br = new BaseResponse(); |
5080 | 5081 | List <Map <String, Object>> mapList=new ArrayList<>(); |
5081 | - Criteria criteria = Criteria.where("nextCheckTime") | |
5082 | + Criteria criteria = Criteria.where("lastCTime") | |
5082 | 5083 | .gte(startDate).lte(endDate) |
5083 | - .and("") | |
5084 | + .and("nextCheckTime").lt(new Date()) | |
5085 | + .and("type").is(1) | |
5084 | 5086 | .and("hospitalId").is(hospitalId) |
5085 | 5087 | .and("yn").is(1); |
5086 | 5088 | AggregationOperation match = Aggregation.match(criteria); |
5087 | - AggregationOperation group = Aggregation.group("prodDoctor").count().as("count"); | |
5089 | + AggregationOperation group = Aggregation.group("lastCheckEmployeeId").count().as("count"); | |
5088 | 5090 | Aggregation aggregation= Aggregation.newAggregation(match, group); |
5089 | 5091 | AggregationResults<HashMap> result = mongoTemplate.aggregate(aggregation,"lyms_patient", HashMap.class); |
5092 | + int count=0;//逾期合计 | |
5093 | + for (HashMap mappedResult : result.getMappedResults()) { | |
5094 | + Map <String, Object> map=new HashMap<>(); | |
5090 | 5095 | |
5096 | + if (null!=mappedResult.get("_id")) { | |
5097 | + //接生医生姓名 | |
5098 | + String doctor = ""; | |
5099 | + Users users = usersService.getUsers(Integer.parseInt(mappedResult.get("_id").toString())); | |
5100 | + if (users != null && users.getYn() == YnEnums.YES.getId()) { | |
5101 | + doctor = users.getName(); | |
5102 | + } | |
5103 | + map.put("name", doctor); | |
5104 | + map.put("count", mappedResult.get("count")); | |
5105 | + count+=Integer.parseInt(mappedResult.get("count").toString()); | |
5106 | + mapList.add(map); | |
5107 | + } | |
5108 | + } | |
5109 | + Map<String, Object> totalMap=new HashedMap(); | |
5110 | + totalMap.put("name","合计(逾期未检)"); | |
5111 | + totalMap.put("count",count); | |
5112 | + mapList.add(totalMap); | |
5091 | 5113 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
5092 | 5114 | br.setErrormsg("成功"); |
5093 | 5115 | br.setObject(mapList); |