Commit c0910536b53eca788dabc049c42d9cc3422dbada
1 parent
da0d739706
Exists in
master
and in
8 other branches
code update
Showing 2 changed files with 51 additions and 15 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/AntenatalExaminationDaoImpl.java
View file @
c091053
... | ... | @@ -74,7 +74,7 @@ |
74 | 74 | public List<AntenatalExaminationModel> queryYuyueAntenatalExamination(Date yuYueDate,String hospitalId) { |
75 | 75 | |
76 | 76 | Criteria criteria = new Criteria(); |
77 | - Criteria criteria2= Criteria.where("nextCheckTime").gte(yuYueDate).lte(yuYueDate); | |
77 | + Criteria criteria2= Criteria.where("nextCheckTime").is(yuYueDate); | |
78 | 78 | Criteria criteria1= Criteria.where("nextCheckTime").exists(false); |
79 | 79 | criteria.orOperator(criteria2,criteria1); |
80 | 80 |
platform-data-api/src/main/java/com/lyms/platform/data/service/impl/SmsServiceImpl.java
View file @
c091053
... | ... | @@ -356,7 +356,7 @@ |
356 | 356 | { |
357 | 357 | System.out.println(DateUtil.getyyyy_MM_dd_hms(new Date())+"孕妇ams短信=======" + msg.getContent()); |
358 | 358 | } |
359 | - | |
359 | + allMsgs.clear(); | |
360 | 360 | } |
361 | 361 | |
362 | 362 | |
... | ... | @@ -532,7 +532,7 @@ |
532 | 532 | System.out.println(DateUtil.getyyyy_MM_dd_hms(new Date())+"儿童ams短信=======" + msg.getContent()); |
533 | 533 | } |
534 | 534 | |
535 | - | |
535 | + allMsgs.clear(); | |
536 | 536 | } |
537 | 537 | |
538 | 538 | |
539 | 539 | |
... | ... | @@ -656,8 +656,8 @@ |
656 | 656 | { |
657 | 657 | System.out.println(DateUtil.getyyyy_MM_dd_hms(new Date())+"产妇ams短信=======" + msg.getContent()); |
658 | 658 | } |
659 | + allMsgs.clear(); | |
659 | 660 | |
660 | - | |
661 | 661 | } |
662 | 662 | |
663 | 663 | /** |
... | ... | @@ -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(249 + ""); | |
712 | +// configQuery.setHospitalId(221 + ""); | |
713 | 713 | |
714 | 714 | //查询出对应医院配置 |
715 | 715 | List<SmsConfigModel> configs = smsConfigService.querySmsConfig(configQuery); |
... | ... | @@ -752,10 +752,6 @@ |
752 | 752 | //循环每一个模板,根据模板条件查询到用户 发送短信 |
753 | 753 | for (SmsTemplateModel template : templates) |
754 | 754 | { |
755 | -// if (!("57d605380cf2e638ab9a7036".equals(template.getId())) ) | |
756 | -// { | |
757 | -// continue; | |
758 | -// } | |
759 | 755 | |
760 | 756 | //模板属于的医院id |
761 | 757 | String tempHid = template.getHospitalId(); |
... | ... | @@ -1147,7 +1143,6 @@ |
1147 | 1143 | messages.add(request); |
1148 | 1144 | } |
1149 | 1145 | } |
1150 | - //messages.addAll(getBabyMessageRequestList( babyModelQuery, config, template)); | |
1151 | 1146 | } |
1152 | 1147 | } |
1153 | 1148 | } |
... | ... | @@ -1853,6 +1848,8 @@ |
1853 | 1848 | { |
1854 | 1849 | System.out.println(DateUtil.getyyyy_MM_dd_hms(new Date())+"模板短信=======" + msg.getContent()); |
1855 | 1850 | } |
1851 | + | |
1852 | + allMsgs.clear(); | |
1856 | 1853 | } |
1857 | 1854 | |
1858 | 1855 | |
1859 | 1856 | |
1860 | 1857 | |
1861 | 1858 | |
1862 | 1859 | |
1863 | 1860 | |
... | ... | @@ -2253,20 +2250,59 @@ |
2253 | 2250 | if (CollectionUtils.isNotEmpty(patientses)) |
2254 | 2251 | { |
2255 | 2252 | //复诊不存在 才添加 |
2256 | - List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
2253 | + List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
2257 | 2254 | if (!CollectionUtils.isNotEmpty(list)) |
2258 | 2255 | { |
2259 | 2256 | idset.add(chu.getParentId()); |
2260 | 2257 | } |
2258 | + | |
2261 | 2259 | } |
2262 | 2260 | |
2263 | 2261 | } |
2264 | - List<AntenatalExaminationModel> fuzs = antenatalExaminationService.queryYuyueAntenatalExamination(yuYueDate, tempHid); | |
2265 | 2262 | |
2266 | - for (AntenatalExaminationModel f : fuzs) | |
2263 | + PatientsQuery patientQuery = new PatientsQuery(); | |
2264 | + patientQuery.setYn(YnEnums.YES.getId()); | |
2265 | + List buildType = new ArrayList(); | |
2266 | + buildType.add(0); | |
2267 | + buildType.add(2); | |
2268 | + patientQuery.setBuildTypeList(buildType); | |
2269 | + //1孕妇 3 产妇 | |
2270 | + patientQuery.setType(1); | |
2271 | + //分娩状态 | |
2272 | + patientQuery.setDueStatus(0); | |
2273 | + patientQuery.setHospitalId(tempHid); | |
2274 | + | |
2275 | + //末次月经必须大于当前时间减去42周视为未分娩孕妇 | |
2276 | + Date lastMensesMax = DateUtil.getNewDate(-42, "周", 1); | |
2277 | + patientQuery.setLastMensesStart(lastMensesMax); | |
2278 | + | |
2279 | + List<Patients> patientses = patientsService.queryPatient(patientQuery); | |
2280 | + if (CollectionUtils.isNotEmpty(patientses)) | |
2267 | 2281 | { |
2268 | - idset.add(f.getId()); //这里的id就是parentid | |
2282 | + for (Patients pat : patientses) | |
2283 | + { | |
2284 | + AntExQuery antExQuery = new AntExQuery(); | |
2285 | + antExQuery.setParentId(pat.getId()); | |
2286 | + antExQuery.setYn(YnEnums.YES.getId()); | |
2287 | + List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
2288 | + if (CollectionUtils.isNotEmpty(list)) | |
2289 | + { | |
2290 | + AntenatalExaminationModel ae = list.get(0); | |
2291 | + if (ae != null && ae.getNextCheckTime() != null) | |
2292 | + { | |
2293 | + if (DateUtil.getyyyy_MM_dd(yuYueDate).equals(DateUtil.getyyyy_MM_dd(ae.getNextCheckTime()))) { | |
2294 | + idset.add(ae.getParentId()); | |
2295 | + } | |
2296 | + } | |
2297 | + } | |
2298 | + } | |
2269 | 2299 | } |
2300 | +// List<AntenatalExaminationModel> fuzs = antenatalExaminationService.queryYuyueAntenatalExamination(yuYueDate, tempHid); | |
2301 | +// | |
2302 | +// for (AntenatalExaminationModel f : fuzs) | |
2303 | +// { | |
2304 | +// idset.add(f.getId()); //这里的id就是parentid | |
2305 | +// } | |
2270 | 2306 | return idset; |
2271 | 2307 | } |
2272 | 2308 | |
... | ... | @@ -2306,7 +2342,7 @@ |
2306 | 2342 | antExQuery.setParentId(chu.getParentId()); |
2307 | 2343 | antExQuery.setYn(YnEnums.YES.getId()); |
2308 | 2344 | //复诊不存在 才添加 |
2309 | - List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
2345 | + List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
2310 | 2346 | if (!CollectionUtils.isNotEmpty(list)) |
2311 | 2347 | { |
2312 | 2348 | idset.add(chu.getParentId()); |