Commit 5984e41c89c4ac1dd3a484c555faf18088346b0c
1 parent
443e6103c3
Exists in
master
and in
7 other branches
分娩作废产检劵
Showing 2 changed files with 9 additions and 7 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/AntExRecordDaoImpl.java
View file @
5984e41
| ... | ... | @@ -10,6 +10,9 @@ |
| 10 | 10 | import com.mongodb.DBObject; |
| 11 | 11 | import com.mongodb.MapReduceCommand; |
| 12 | 12 | import com.mongodb.MapReduceOutput; |
| 13 | +import org.springframework.data.mongodb.core.aggregation.Aggregation; | |
| 14 | +import org.springframework.data.mongodb.core.aggregation.AggregationOperation; | |
| 15 | +import org.springframework.data.mongodb.core.aggregation.AggregationResults; | |
| 13 | 16 | import org.springframework.stereotype.Repository; |
| 14 | 17 | |
| 15 | 18 | import java.util.ArrayList; |
| 16 | 19 | |
| 17 | 20 | |
| 18 | 21 | |
| ... | ... | @@ -37,17 +40,16 @@ |
| 37 | 40 | * @return |
| 38 | 41 | */ |
| 39 | 42 | public List<HashMap> aggregateOne(MongoQuery mongoQuery){ |
| 40 | - /*AggregationOperation match = Aggregation.match(*//*Criteria.where("hospitalId").is(hospitalId)*//*mongoQuery.getCriteria()); | |
| 43 | + AggregationOperation match = Aggregation.match(mongoQuery.getCriteria()); | |
| 41 | 44 | |
| 42 | - String[] str= new String[]{"checkDoctor","pid"}; | |
| 43 | - AggregationOperation group = Aggregation.group(str).count().as("count"); | |
| 45 | + AggregationOperation group = Aggregation.group("checkDoctor").count().as("count"); | |
| 44 | 46 | |
| 45 | 47 | Aggregation aggregation= Aggregation.newAggregation(match, group); |
| 46 | 48 | |
| 47 | 49 | AggregationResults<HashMap> result = mongoTemplate.aggregate(aggregation,"lyms_antexrecord", HashMap.class); |
| 48 | - return result.getMappedResults();*/ | |
| 50 | + return result.getMappedResults(); | |
| 49 | 51 | |
| 50 | - | |
| 52 | +/* | |
| 51 | 53 | String map = "function() {\n" + |
| 52 | 54 | "\t\temit({checkDoctor:this.checkDoctor}, \n" + |
| 53 | 55 | "\t\t{\"data\":[{\"pid\":this.pid}]});\n" + |
| ... | ... | @@ -86,7 +88,7 @@ |
| 86 | 88 | ids.add(map1); |
| 87 | 89 | } |
| 88 | 90 | } |
| 89 | - return ids; | |
| 91 | + return ids;*/ | |
| 90 | 92 | } |
| 91 | 93 | |
| 92 | 94 | public void batchAddRecord(List<AntExRecordModel> list){ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
5984e41
| ... | ... | @@ -406,7 +406,7 @@ |
| 406 | 406 | for (HashMap map : list) { |
| 407 | 407 | CjStatisticsResult cjStatisticsResult = new CjStatisticsResult(); |
| 408 | 408 | String dId = null; |
| 409 | - Object id = map.get("checkDoctor"); | |
| 409 | + Object id = map.get("_id"); | |
| 410 | 410 | if (null != id) { |
| 411 | 411 | dId = id.toString(); |
| 412 | 412 | } else { |