Commit cf412d702a4e9b662cc977979511cf1b6c36e53b
1 parent
ef5b0e131b
Exists in
master
and in
6 other branches
改bug
Showing 5 changed files with 28 additions and 1 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/BookbuildingFacade.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java
View file @
cf412d7
platform-biz-service/src/main/java/com/lyms/platform/permission/service/CouponService.java
View file @
cf412d7
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 4 | 4 | |
| 5 | +import java.util.Date; | |
| 5 | 6 | import java.util.List; |
| 6 | 7 | import java.util.Map; |
| 7 | 8 | import java.util.Set; |
| ... | ... | @@ -56,5 +57,7 @@ |
| 56 | 57 | * @return |
| 57 | 58 | */ |
| 58 | 59 | String findByType(String id, int i); |
| 60 | + | |
| 61 | + void invalid2(String pid, Date created, String s); | |
| 59 | 62 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java
View file @
cf412d7
| ... | ... | @@ -565,6 +565,15 @@ |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | @Override |
| 568 | + public void invalid2(String pid, Date created, String couponTypes) { | |
| 569 | + Map<String, Object> param = new HashMap<>(); | |
| 570 | + param.put("personId", pid); | |
| 571 | + param.put("couponTypes", com.lyms.platform.common.utils.StringUtils.covertToList(couponTypes, Integer.class)); | |
| 572 | + param.put("created", created); | |
| 573 | + couponMapper.invalid2(param); | |
| 574 | + } | |
| 575 | + | |
| 576 | + @Override | |
| 568 | 577 | public List<Map<String, Object>> queryCouponItemsByType(Map<String, Object> params) { |
| 569 | 578 | return couponMapper.queryCouponItemsByType(params); |
| 570 | 579 | } |
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
View file @
cf412d7
| ... | ... | @@ -133,6 +133,18 @@ |
| 133 | 133 | ) b on a.id = b.id set a.status = 3 |
| 134 | 134 | </update> |
| 135 | 135 | |
| 136 | + <update id="invalid2" parameterType="map"> | |
| 137 | + update coupon_info a inner join ( | |
| 138 | + select a.id | |
| 139 | + from coupon_info a, coupon_template b, coupon_type c | |
| 140 | + where a.coupon_template_id = b.id and b.type_id = c.id and a.status=1 and a.create_date > #{created} and c.type in | |
| 141 | + <foreach collection="couponTypes" open="(" close=")" separator="," item="type"> | |
| 142 | + #{type} | |
| 143 | + </foreach> | |
| 144 | + and a.user_id = #{personId} | |
| 145 | + ) b on a.id = b.id set a.status = 3 | |
| 146 | + </update> | |
| 147 | + | |
| 136 | 148 | <select id="findByUsedId" parameterType="string" resultType="string"> |
| 137 | 149 | select sequence_id from coupon_info where used_id = #{id} limit 0,1 |
| 138 | 150 | </select> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
cf412d7
| ... | ... | @@ -1429,7 +1429,8 @@ |
| 1429 | 1429 | |
| 1430 | 1430 | |
| 1431 | 1431 | /** 删除建档应该是把全部未使用的优惠券状态更新为3【已作废】 */ |
| 1432 | - couponService.invalid(patients.getPid(), "1,2,3,4,5,6,7,8"); | |
| 1432 | +// couponService.invalid(patients.getPid(), "1,2,3,4,5,6,7,8"); | |
| 1433 | + couponService.invalid2(patients.getPid(), patients.getCreated(), "1,2,3,4,5,6,7,8,9,10"); | |
| 1433 | 1434 | } |
| 1434 | 1435 | |
| 1435 | 1436 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |