|
@@ -76,19 +76,6 @@ public class CouponController {
|
|
|
coupon.setCouponIssueId(couponIssueId);
|
|
|
//领取油站所分发的优惠券
|
|
|
List<Coupon> couponsList = couponService.selectStaGrantCouponList(coupon);
|
|
|
-// if(cgcInfo !=null){
|
|
|
-// //更新次数
|
|
|
-// Integer issueGiveCount = cgcInfo.getIssueGiveCount();
|
|
|
-// int i = issueGiveCount + 1;
|
|
|
-// couponUserGiveCount.setIssueGiveCount(i);
|
|
|
-// couponUserGiveCount.setUpdateTime(new Date());
|
|
|
-// couponService.updateCouponUserGiveCount(couponUserGiveCount);
|
|
|
-// }else {
|
|
|
-// //新增次数
|
|
|
-// couponUserGiveCount.setIssueGiveCount(1);
|
|
|
-// couponUserGiveCount.setCreteTime(new Date());
|
|
|
-// couponService.addCouponUserGiveCount(couponUserGiveCount);
|
|
|
-// }
|
|
|
resultData = ResultData.success(couponsList);
|
|
|
}
|
|
|
}else {
|
|
@@ -273,6 +260,26 @@ public class CouponController {
|
|
|
resultMap.put("notClaimedCouponList", notClaimedCouponList);
|
|
|
resultMap.put("couponReceiveNumList", couponReceiveNumList);
|
|
|
logger.info("用户领取到的优惠券:" + resultMap.toString());
|
|
|
+ //记录用户在该领取方式操作
|
|
|
+ CouponUserGiveCount couponUserGiveCount = new CouponUserGiveCount();
|
|
|
+ couponUserGiveCount.setStationId(stationId);
|
|
|
+ couponUserGiveCount.setUnionId(unionId);
|
|
|
+ couponUserGiveCount.setCouponIssueId(couponIssueId);
|
|
|
+ //用户能进入领取界面的次数
|
|
|
+ CouponUserGiveCount cgcInfo = couponService.selectCouponUserGiveCount(couponUserGiveCount);
|
|
|
+ if(cgcInfo !=null){
|
|
|
+ //更新次数
|
|
|
+ Integer issueGiveCount = cgcInfo.getIssueGiveCount();
|
|
|
+ int i = issueGiveCount + 1;
|
|
|
+ couponUserGiveCount.setIssueGiveCount(i);
|
|
|
+ couponUserGiveCount.setUpdateTime(new Date());
|
|
|
+ couponService.updateCouponUserGiveCount(couponUserGiveCount);
|
|
|
+ }else {
|
|
|
+ //新增次数
|
|
|
+ couponUserGiveCount.setIssueGiveCount(1);
|
|
|
+ couponUserGiveCount.setCreteTime(new Date());
|
|
|
+ couponService.addCouponUserGiveCount(couponUserGiveCount);
|
|
|
+ }
|
|
|
resultData = ResultData.success(resultMap);
|
|
|
}else {
|
|
|
resultData = ResultData.error(CodeMsg.NO_COUPON_ISSUE);
|