Commit bcd56cb7236801daaab58643a401816280bcd9cb
1 parent
d46ffdbb6b
Exists in
master
and in
8 other branches
code update
Showing 4 changed files with 96 additions and 64 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/AntenatalExaminationDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/BabyBookbuildingDaoImpl.java
- platform-data-api/src/main/java/com/lyms/platform/data/service/impl/SmsServiceImpl.java
- platform-data-api/src/main/java/com/lyms/platform/data/util/AmsMessageService.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/AntenatalExaminationDaoImpl.java
View file @
bcd56cb
... | ... | @@ -20,6 +20,7 @@ |
20 | 20 | import org.springframework.data.mongodb.core.aggregation.AggregationOperation; |
21 | 21 | import org.springframework.data.mongodb.core.aggregation.AggregationResults; |
22 | 22 | import org.springframework.data.mongodb.core.query.Criteria; |
23 | +import org.springframework.data.mongodb.core.query.Query; | |
23 | 24 | import org.springframework.stereotype.Repository; |
24 | 25 | |
25 | 26 | import java.text.ParseException; |
26 | 27 | |
27 | 28 | |
28 | 29 | |
29 | 30 | |
30 | 31 | |
... | ... | @@ -71,38 +72,64 @@ |
71 | 72 | |
72 | 73 | @Override |
73 | 74 | public List<AntenatalExaminationModel> queryYuyueAntenatalExamination(Date yuYueDate,String hospitalId) { |
74 | - AggregationOperation match = Aggregation.match(Criteria.where("nextCheckTime").gte(yuYueDate).lte(yuYueDate).and("hospitalId").is(hospitalId)); | |
75 | + | |
76 | + Criteria criteria = new Criteria(); | |
77 | + Criteria criteria2= Criteria.where("nextCheckTime").gte(yuYueDate).lte(yuYueDate); | |
78 | + Criteria criteria1= Criteria.where("nextCheckTime").exists(false); | |
79 | + criteria.orOperator(criteria2,criteria1); | |
80 | + | |
81 | + AggregationOperation match = Aggregation.match(Criteria.where("hospitalId").is(hospitalId).andOperator(criteria)); | |
75 | 82 | AggregationOperation group = Aggregation.group("parentId").max("created").as("created"); |
76 | - Aggregation aggregation = Aggregation.newAggregation(match,group); | |
83 | + Aggregation aggregation = Aggregation.newAggregation(match, group); | |
77 | 84 | AggregationResults<AntenatalExaminationModel> result = this.mongoTemplate.aggregate(aggregation, "lyms_antex", AntenatalExaminationModel.class); |
78 | - return result.getMappedResults(); | |
79 | -// AggregationOperation match = Aggregation.match(Criteria.where("hospitalId").is(hospitalId)); | |
80 | -// AggregationOperation group = Aggregation.group("parentId").max("created").as("created"); | |
81 | -// Aggregation aggregation = Aggregation.newAggregation(match, group); | |
82 | -// AggregationResults<AntenatalExaminationModel> result = this.mongoTemplate.aggregate(aggregation, "lyms_antex", AntenatalExaminationModel.class); | |
83 | -// | |
84 | -// | |
85 | -// List<AntenatalExaminationModel> fuzs = result.getMappedResults(); | |
86 | -// | |
87 | -// for (AntenatalExaminationModel f : fuzs) { | |
88 | -// String parentId = f.getId(); //这里的id就是parentid | |
89 | -// MongoCondition condition = MongoCondition.newInstance("parentId", parentId, MongoOper.IS).and("yn", YnEnums.YES.getId(), MongoOper.IS).and("nextCheckTime", yuYueDate, MongoOper.IS); | |
90 | -// MongoQuery query = condition.toMongoQuery().addOrder(Sort.Direction.DESC, "created"); | |
91 | -// List<AntenatalExaminationModel> results = find(query.convertToMongoQuery()); | |
92 | -// if (CollectionUtils.isNotEmpty(results)) | |
93 | -// { | |
94 | -// | |
95 | -// } | |
96 | -// } | |
97 | -// return ; | |
85 | + List<AntenatalExaminationModel> fuzs = result.getMappedResults(); | |
86 | + List<AntenatalExaminationModel> yuyues = new ArrayList<>(); | |
87 | + for (AntenatalExaminationModel f : fuzs) { | |
88 | + String parentId = f.getId(); //这里的id就是parentid | |
89 | + | |
90 | + MongoCondition condition1 = MongoCondition.newInstance("_id", parentId, MongoOper.IS).and("yn", YnEnums.YES.getId(), MongoOper.IS).and("type", 1, MongoOper.IS); | |
91 | + MongoQuery query1 = condition1.toMongoQuery().addOrder(Sort.Direction.DESC, "created"); | |
92 | + List<Patients> patientses = this.mongoTemplate.find(query1.convertToMongoQuery(), Patients.class); | |
93 | + if (CollectionUtils.isNotEmpty(patientses)) | |
94 | + { | |
95 | + MongoCondition condition = MongoCondition.newInstance("parentId", parentId, MongoOper.IS).and("yn", YnEnums.YES.getId(), MongoOper.IS); | |
96 | + MongoQuery query = condition.toMongoQuery().addOrder(Sort.Direction.DESC, "created"); | |
97 | + List<AntenatalExaminationModel> results = find(query.convertToMongoQuery()); | |
98 | + if (CollectionUtils.isNotEmpty(results)) | |
99 | + { | |
100 | + if (results.get(0).getNextCheckTime() != null ) | |
101 | + { | |
102 | + yuyues.add(f); | |
103 | + } | |
104 | + } | |
105 | + } | |
106 | + } | |
107 | + return yuyues; | |
98 | 108 | } |
109 | + | |
99 | 110 | @Override |
100 | 111 | public List<AntenatalExaminationModel> queryYuyueAntenatalExamination(Date startDate,String hospitalId,String parentId) { |
101 | - | |
102 | 112 | AggregationOperation match = Aggregation.match(Criteria.where("nextCheckTime").gte(startDate).and("parentId").is(parentId).and("hospitalId").is(hospitalId)); |
103 | 113 | AggregationOperation group = Aggregation.group("parentId").max("created").as("created"); |
104 | 114 | Aggregation aggregation = Aggregation.newAggregation(match, group); |
105 | 115 | AggregationResults<AntenatalExaminationModel> result = this.mongoTemplate.aggregate(aggregation, "lyms_antex", AntenatalExaminationModel.class); |
116 | + | |
117 | + MongoCondition condition1 = MongoCondition.newInstance("_id", parentId, MongoOper.IS).and("yn", YnEnums.YES.getId(), MongoOper.IS).and("type", 1, MongoOper.IS); | |
118 | + MongoQuery query1 = condition1.toMongoQuery().addOrder(Sort.Direction.DESC, "created"); | |
119 | + List<Patients> patientses = this.mongoTemplate.find(query1.convertToMongoQuery(), Patients.class); | |
120 | + if (CollectionUtils.isNotEmpty(patientses)) | |
121 | + { | |
122 | + MongoCondition condition = MongoCondition.newInstance("parentId", parentId, MongoOper.IS).and("yn", YnEnums.YES.getId(), MongoOper.IS); | |
123 | + MongoQuery query = condition.toMongoQuery().addOrder(Sort.Direction.DESC, "created"); | |
124 | + List<AntenatalExaminationModel> results = find(query.convertToMongoQuery()); | |
125 | + if (CollectionUtils.isNotEmpty(results)) | |
126 | + { | |
127 | + if (results.get(0).getNextCheckTime() == null ) | |
128 | + { | |
129 | + return new ArrayList<AntenatalExaminationModel>(); | |
130 | + } | |
131 | + } | |
132 | + } | |
106 | 133 | return result.getMappedResults(); |
107 | 134 | } |
108 | 135 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/BabyBookbuildingDaoImpl.java
View file @
bcd56cb
... | ... | @@ -48,6 +48,18 @@ |
48 | 48 | |
49 | 49 | @Override |
50 | 50 | public List<BabyCheckModel> queryBabyYuYueRecord(Date yuYueDate, String hospitalId) { |
51 | + | |
52 | +// Criteria criteria = new Criteria(); | |
53 | +// Criteria criteria2= Criteria.where("nextDate").gte(yuYueDate).lte(yuYueDate); | |
54 | +// Criteria criteria1= Criteria.where("nextDate").exists(false); | |
55 | +// criteria.orOperator(criteria2, criteria1); | |
56 | +// | |
57 | +// AggregationOperation match = Aggregation.match(Criteria.where("hospitalId").is(hospitalId).andOperator(criteria)); | |
58 | +// AggregationOperation group = Aggregation.group("buildId").max("created").as("created"); | |
59 | +// Aggregation aggregation = Aggregation.newAggregation(match, group); | |
60 | +// AggregationResults<BabyCheckModel> result = this.mongoTemplate.aggregate(aggregation, "lyms_babycheck", BabyCheckModel.class); | |
61 | +// return result.getMappedResults(); | |
62 | + | |
51 | 63 | AggregationOperation match = Aggregation.match(Criteria.where("nextDate").gte(yuYueDate).lte(yuYueDate).and("hospitalId").is(hospitalId)); |
52 | 64 | AggregationOperation group = Aggregation.group("buildId").max("created").as("created"); |
53 | 65 | Aggregation aggregation = Aggregation.newAggregation(match, group); |
platform-data-api/src/main/java/com/lyms/platform/data/service/impl/SmsServiceImpl.java
View file @
bcd56cb
... | ... | @@ -709,7 +709,7 @@ |
709 | 709 | SmsConfigQuery configQuery = new SmsConfigQuery(); |
710 | 710 | configQuery.setYn(YnEnums.YES.getId()); |
711 | 711 | configQuery.setPrefixTypes(new Integer[]{0, 1}); |
712 | - configQuery.setHospitalId(221 + ""); | |
712 | +// configQuery.setHospitalId(249 + ""); | |
713 | 713 | |
714 | 714 | //查询出对应医院配置 |
715 | 715 | List<SmsConfigModel> configs = smsConfigService.querySmsConfig(configQuery); |
... | ... | @@ -1492,6 +1492,7 @@ |
1492 | 1492 | |
1493 | 1493 | //查询出产妇预约 |
1494 | 1494 | List<PostReviewModel> orderModels = postReviewService.queryPostOrder(actualSendDate, tempHid); |
1495 | + | |
1495 | 1496 | if(CollectionUtils.isNotEmpty(orderModels)) |
1496 | 1497 | { |
1497 | 1498 | for(PostReviewModel orderModel : orderModels) |
1498 | 1499 | |
1499 | 1500 | |
1500 | 1501 | |
... | ... | @@ -2242,30 +2243,29 @@ |
2242 | 2243 | AntExQuery antExQuery = new AntExQuery(); |
2243 | 2244 | antExQuery.setParentId(chu.getParentId()); |
2244 | 2245 | antExQuery.setYn(YnEnums.YES.getId()); |
2245 | - //复诊不存在 才添加 | |
2246 | - List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
2247 | - if (!CollectionUtils.isNotEmpty(list)) | |
2246 | + | |
2247 | + PatientsQuery patientQuery = new PatientsQuery(); | |
2248 | + patientQuery.setYn(YnEnums.YES.getId()); | |
2249 | + patientQuery.setType(1); | |
2250 | + patientQuery.setId(chu.getParentId()); | |
2251 | + | |
2252 | + List<Patients> patientses = patientsService.queryPatient(patientQuery); | |
2253 | + if (CollectionUtils.isNotEmpty(patientses)) | |
2248 | 2254 | { |
2249 | - idset.add(chu.getParentId()); | |
2255 | + //复诊不存在 才添加 | |
2256 | + List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
2257 | + if (!CollectionUtils.isNotEmpty(list)) | |
2258 | + { | |
2259 | + idset.add(chu.getParentId()); | |
2260 | + } | |
2250 | 2261 | } |
2262 | + | |
2251 | 2263 | } |
2252 | 2264 | List<AntenatalExaminationModel> fuzs = antenatalExaminationService.queryYuyueAntenatalExamination(yuYueDate, tempHid); |
2253 | 2265 | |
2254 | 2266 | for (AntenatalExaminationModel f : fuzs) |
2255 | 2267 | { |
2256 | 2268 | idset.add(f.getId()); //这里的id就是parentid |
2257 | -// AntExQuery antExQuery = new AntExQuery(); | |
2258 | -// antExQuery.setYn(YnEnums.YES.getId()); | |
2259 | -// antExQuery.setParentId(f.getId()); | |
2260 | -// | |
2261 | -// List<AntenatalExaminationModel> list = antenatalExaminationService.queryLastAntenatalExamination(antExQuery.convertToQuery()); | |
2262 | -// if (CollectionUtils.isNotEmpty(list)) | |
2263 | -// { | |
2264 | -// if (list.get(0).getNextCheckTime() != null) | |
2265 | -// { | |
2266 | -// idset.add(f.getId()); //这里的id就是parentid | |
2267 | -// } | |
2268 | -// } | |
2269 | 2269 | } |
2270 | 2270 | return idset; |
2271 | 2271 | } |
2272 | 2272 | |
2273 | 2273 | |
2274 | 2274 | |
2275 | 2275 | |
2276 | 2276 | |
... | ... | @@ -2294,37 +2294,30 @@ |
2294 | 2294 | List<AntExChuModel> chus = antenatalExaminationService.queryAntExChu(antExChuQuery); |
2295 | 2295 | for (AntExChuModel chu : chus) |
2296 | 2296 | { |
2297 | - idset.add(chu.getParentId()); | |
2297 | + PatientsQuery patientQuery = new PatientsQuery(); | |
2298 | + patientQuery.setYn(YnEnums.YES.getId()); | |
2299 | + patientQuery.setType(1); | |
2300 | + patientQuery.setId(chu.getParentId()); | |
2298 | 2301 | |
2299 | - AntExQuery antExQuery = new AntExQuery(); | |
2300 | - antExQuery.setParentId(chu.getParentId()); | |
2301 | - antExQuery.setYn(YnEnums.YES.getId()); | |
2302 | - //复诊不存在 才添加 | |
2303 | - List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
2304 | - if (!CollectionUtils.isNotEmpty(list)) | |
2302 | + List<Patients> patientses = patientsService.queryPatient(patientQuery); | |
2303 | + if (CollectionUtils.isNotEmpty(patientses)) | |
2305 | 2304 | { |
2306 | - idset.add(chu.getParentId()); | |
2305 | + AntExQuery antExQuery = new AntExQuery(); | |
2306 | + antExQuery.setParentId(chu.getParentId()); | |
2307 | + antExQuery.setYn(YnEnums.YES.getId()); | |
2308 | + //复诊不存在 才添加 | |
2309 | + List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
2310 | + if (!CollectionUtils.isNotEmpty(list)) | |
2311 | + { | |
2312 | + idset.add(chu.getParentId()); | |
2313 | + } | |
2307 | 2314 | } |
2308 | - | |
2309 | 2315 | } |
2310 | - List<AntenatalExaminationModel> fuzs = antenatalExaminationService.queryYuyueAntenatalExamination(startDate,tempHid,pid); | |
2316 | + List<AntenatalExaminationModel> fuzs = antenatalExaminationService.queryYuyueAntenatalExamination(startDate, tempHid, pid); | |
2311 | 2317 | |
2312 | 2318 | for (AntenatalExaminationModel f : fuzs) |
2313 | 2319 | { |
2314 | 2320 | idset.add(f.getId()); //这里的id就是parentid |
2315 | - | |
2316 | -// AntExQuery antExQuery = new AntExQuery(); | |
2317 | -// antExQuery.setYn(YnEnums.YES.getId()); | |
2318 | -// antExQuery.setParentId(f.getId()); | |
2319 | -// | |
2320 | -// List<AntenatalExaminationModel> list = antenatalExaminationService.queryLastAntenatalExamination(antExQuery.convertToQuery()); | |
2321 | -// if (CollectionUtils.isNotEmpty(list)) | |
2322 | -// { | |
2323 | -// if (list.get(0).getNextCheckTime() != null) | |
2324 | -// { | |
2325 | -// idset.add(f.getId()); //这里的id就是parentid | |
2326 | -// } | |
2327 | -// } | |
2328 | 2321 | } |
2329 | 2322 | return idset.size() > 0; |
2330 | 2323 | } |
platform-data-api/src/main/java/com/lyms/platform/data/util/AmsMessageService.java
View file @
bcd56cb
... | ... | @@ -183,7 +183,7 @@ |
183 | 183 | |
184 | 184 | |
185 | 185 | public static void main(String[] args) { |
186 | - Map<String,List<MessageContent>> list = getMessageTemplateMap("221", | |
186 | + Map<String,List<MessageContent>> list = getMessageTemplateMap("249", | |
187 | 187 | AmsServiceTypeEnum.CHILD_GUIDE); |
188 | 188 | |
189 | 189 | List<MessageContent> msgs = list.get("肺结核"); |