|
@@ -82,6 +82,19 @@ public class CouponController {
|
|
|
if(cgcInfo !=null && cgcInfo.getIssueGiveCount() >= cgcInfo.getGiveCount()){
|
|
|
resultData = ResultData.error(CodeMsg.COUPON_GIVE_COUNT_MAX);
|
|
|
}else {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
//该领取方式能领取优惠券的时间类型
|
|
|
String availableControl = couponIssuesList.get(0).getAvailableControl();
|
|
|
switch (availableControl){
|