Commit f4f741af092dee52047265382c9aab472d699e1b
1 parent
0f0026e408
Exists in
master
and in
6 other branches
bug修复
Showing 8 changed files with 40 additions and 2 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/CouponService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyCheckPageResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java
View file @
f4f741a
platform-biz-service/src/main/java/com/lyms/platform/permission/service/CouponService.java
View file @
f4f741a
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java
View file @
f4f741a
... | ... | @@ -554,6 +554,14 @@ |
554 | 554 | } |
555 | 555 | |
556 | 556 | @Override |
557 | + public String findByType(String usedId, int type) { | |
558 | + Map<String, Object> map = new HashMap<>(); | |
559 | + map.put("usedId", usedId); | |
560 | + map.put("type", type); | |
561 | + return couponMapper.findByType(map); | |
562 | + } | |
563 | + | |
564 | + @Override | |
557 | 565 | public List<Map<String, Object>> queryCouponItemsByType(Map<String, Object> params) { |
558 | 566 | return couponMapper.queryCouponItemsByType(params); |
559 | 567 | } |
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
View file @
f4f741a
... | ... | @@ -137,6 +137,11 @@ |
137 | 137 | select sequence_id from coupon_info where used_id = #{id} limit 0,1 |
138 | 138 | </select> |
139 | 139 | |
140 | + <select id="findByType" parameterType="map" resultType="string"> | |
141 | + select a.sequence_id, c.type from coupon_info a, coupon_template b, coupon_type c | |
142 | + where a.coupon_template_id = b.id and b.type_id = c.id and a.used_id = #{userId} and c.type = #{type} limit 0,1 | |
143 | + </select> | |
144 | + | |
140 | 145 | <select id="findCityId" parameterType="string" resultType="string"> |
141 | 146 | select city_id from organization where id = #{hospitalId} |
142 | 147 | </select> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
f4f741a
... | ... | @@ -911,7 +911,7 @@ |
911 | 911 | result = getBabyCheckResult(checkModel); |
912 | 912 | result.setCouponCode(couponService.findByUsedId(id)); |
913 | 913 | /** 优惠券编号 */ |
914 | - String hemoglobinCoupon = couponService.findByUsedId(id); | |
914 | + String hemoglobinCoupon = couponService.findByType(id, 10); | |
915 | 915 | if(StringUtils.isNotEmpty(hemoglobinCoupon)) { |
916 | 916 | result.setHemoglobinCoupon(hemoglobinCoupon); |
917 | 917 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
f4f741a
... | ... | @@ -2870,6 +2870,11 @@ |
2870 | 2870 | |
2871 | 2871 | /** 优惠券编号 */ |
2872 | 2872 | result.setCouponCode(couponService.findByUsedId(id)); |
2873 | + /** 优惠券编号血红蛋白 */ | |
2874 | + String hemoglobinCoupon = couponService.findByType(id, 10); | |
2875 | + if(com.lyms.platform.common.utils.StringUtils.isNotEmpty(hemoglobinCoupon)) { | |
2876 | + result.setHemoglobinCoupon(hemoglobinCoupon); | |
2877 | + } | |
2873 | 2878 | |
2874 | 2879 | } |
2875 | 2880 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyCheckPageResult.java
View file @
f4f741a
... | ... | @@ -6,6 +6,8 @@ |
6 | 6 | */ |
7 | 7 | public class BabyCheckPageResult { |
8 | 8 | |
9 | + private String hemoglobinCoupon; | |
10 | + | |
9 | 11 | private String id; |
10 | 12 | |
11 | 13 | //建档ID |
... | ... | @@ -260,6 +262,14 @@ |
260 | 262 | private String navel; |
261 | 263 | |
262 | 264 | private String couponCode; |
265 | + | |
266 | + public String getHemoglobinCoupon() { | |
267 | + return hemoglobinCoupon; | |
268 | + } | |
269 | + | |
270 | + public void setHemoglobinCoupon(String hemoglobinCoupon) { | |
271 | + this.hemoglobinCoupon = hemoglobinCoupon; | |
272 | + } | |
263 | 273 | |
264 | 274 | public String getNavel() { |
265 | 275 | return navel; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
View file @
f4f741a
... | ... | @@ -142,7 +142,7 @@ |
142 | 142 | List<String> hospitalIds = organizationGroupsFacade.findGroupHospital(userId, true); |
143 | 143 | if (CollectionUtils.isNotEmpty(hospitalIds)) { |
144 | 144 | BabyModel babyModel = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").in(hospitalIds) |
145 | - .and("pid").is(pid)).with(new Sort(Sort.Direction.DESC, "created")), BabyModel.class); | |
145 | + .and("pid").is(pid).and("enable").ne("2")).with(new Sort(Sort.Direction.DESC, "created")), BabyModel.class); | |
146 | 146 | if(babyModel == null) { |
147 | 147 | return false; // 需 要建档 |
148 | 148 | } |