Commit 4d3a41056906220a3251c451cb0e1a26e70889d7
1 parent
4f75ca9701
Exists in
master
and in
6 other branches
优惠券
Showing 2 changed files with 14 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
4d3a410
| ... | ... | @@ -5697,7 +5697,9 @@ |
| 5697 | 5697 | @ResponseBody |
| 5698 | 5698 | public void eyeCheckLh(HttpServletResponse response) { |
| 5699 | 5699 | Criteria criteria = Criteria.where("yn").is(YnEnums.YES.getId()).and("hospitalId").is("2100001605") |
| 5700 | - .and("lhywgInfo").exists(false); | |
| 5700 | + ; | |
| 5701 | + criteria.orOperator(Criteria.where("lhywgInfo").exists(false),Criteria.where("lhywgInfo").is(new HashMap<>())); | |
| 5702 | + System.out.println(new Query(criteria).toString()); | |
| 5701 | 5703 | List<LhBabyEyeCheck> models = mongoTemplate.find(new Query(criteria), LhBabyEyeCheck.class); |
| 5702 | 5704 | if (CollectionUtils.isNotEmpty(models)) { |
| 5703 | 5705 | for (LhBabyEyeCheck model : models) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/OrgCouponServiceImpl.java
View file @
4d3a410
| ... | ... | @@ -244,6 +244,17 @@ |
| 244 | 244 | couponInfo.put("type_desc", s); |
| 245 | 245 | } |
| 246 | 246 | Date useDate = (Date) couponInfo.get("use_date"); |
| 247 | + | |
| 248 | + List<Patients> patients = mongoTemplate.find(Query.query(Criteria.where("pid").is(couponInfo.get("user_id")) | |
| 249 | + .and("yn").is(1)), Patients.class); | |
| 250 | + String age = ""; | |
| 251 | + if (CollectionUtils.isNotEmpty(patients) && useDate != null) | |
| 252 | + { | |
| 253 | + Date birth = patients.get(0).getBirth(); | |
| 254 | + age = DateUtil.getAge(birth,useDate)+""; | |
| 255 | + } | |
| 256 | + couponInfo.put("age",age); | |
| 257 | + | |
| 247 | 258 | couponInfo.put("use_date", DateUtil.getyyyy_MM_dd(useDate)); |
| 248 | 259 | /** 设置产检日期、姓名、产检孕周、产检第次、产检机构、产检医生、联系电话 */ |
| 249 | 260 | setUsedInfo((Integer) couponInfo.get("type"), (String) couponInfo.get("used_id"), |