Commit 34177792a896ae9c446f8c340ac3580aaab3e650
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 2 changed files
platform-dal/src/main/java/com/lyms/platform/pojo/NewbornVisit.java
View file @
3417779
| ... | ... | @@ -13,6 +13,9 @@ |
| 13 | 13 | @Document(collection="lyms_newborn_visit") |
| 14 | 14 | public class NewbornVisit { |
| 15 | 15 | |
| 16 | + /** 优惠券 */ | |
| 17 | + private String hemoglobinCoupon; | |
| 18 | + | |
| 16 | 19 | private String id; |
| 17 | 20 | |
| 18 | 21 | private Date created; |
| ... | ... | @@ -151,6 +154,14 @@ |
| 151 | 154 | |
| 152 | 155 | // 下次访视时间 |
| 153 | 156 | private Date nextVisitTimeDesc; |
| 157 | + | |
| 158 | + public String getHemoglobinCoupon() { | |
| 159 | + return hemoglobinCoupon; | |
| 160 | + } | |
| 161 | + | |
| 162 | + public void setHemoglobinCoupon(String hemoglobinCoupon) { | |
| 163 | + this.hemoglobinCoupon = hemoglobinCoupon; | |
| 164 | + } | |
| 154 | 165 | |
| 155 | 166 | public String getId() { |
| 156 | 167 | return id; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
View file @
3417779
| ... | ... | @@ -20,6 +20,7 @@ |
| 20 | 20 | import com.lyms.platform.permission.dao.slave.OrganizationMapper; |
| 21 | 21 | import com.lyms.platform.permission.dao.slave.UsersMapper; |
| 22 | 22 | import com.lyms.platform.permission.model.Users; |
| 23 | +import com.lyms.platform.permission.service.CouponService; | |
| 23 | 24 | import com.lyms.platform.pojo.*; |
| 24 | 25 | import com.lyms.platform.query.DataPermissionsModelQuery; |
| 25 | 26 | import com.mongodb.WriteResult; |
| ... | ... | @@ -60,6 +61,9 @@ |
| 60 | 61 | @Autowired |
| 61 | 62 | private CouponMapper mapper; |
| 62 | 63 | |
| 64 | + @Autowired | |
| 65 | + private CouponService couponService; | |
| 66 | + | |
| 63 | 67 | @Override |
| 64 | 68 | public BaseObjectResponse init() { |
| 65 | 69 | List<Map<String, Object>> feedType = EnumUtil.toJson(FeedTypeEnums.class); |
| ... | ... | @@ -81,6 +85,14 @@ |
| 81 | 85 | return RespBuilder.buildSuccess(ResponseCode.NEED_BUILD); |
| 82 | 86 | } |
| 83 | 87 | newbornVisit.setId(UUID.randomUUID().toString().replace("-", "")); |
| 88 | + | |
| 89 | + | |
| 90 | + /** 使用优惠券 */ | |
| 91 | + if(StringUtils.isNotBlank(newbornVisit.getHemoglobinCoupon())) { | |
| 92 | + couponService.use(autoMatchFacade.getHospitalId(userId), newbornVisit.getHemoglobinCoupon(), userId, newbornVisit.getId()); | |
| 93 | + newbornVisit.setHemoglobinCoupon(null); /** 去除掉优惠券信息 不保存到数据库 */ | |
| 94 | + } | |
| 95 | + | |
| 84 | 96 | newbornVisit.setOperationId(userId.toString()); |
| 85 | 97 | newbornVisit.setCreated(new Date()); |
| 86 | 98 | newbornVisit.setYn("1"); |