Authored by chenchao

base coupon support modify end time

@@ -27,6 +27,11 @@ public interface ICouponService { @@ -27,6 +27,11 @@ public interface ICouponService {
27 27
28 PageResponseBO<UidCouponQueryResp> queryUserCouponList(UserCouponQueryReq req); 28 PageResponseBO<UidCouponQueryResp> queryUserCouponList(UserCouponQueryReq req);
29 29
  30 + /**
  31 + * 作废用户券
  32 + * @param request
  33 + * @return
  34 + */
30 ApiResponse invalidateUserCoupon(UserCouponBaseRequest request); 35 ApiResponse invalidateUserCoupon(UserCouponBaseRequest request);
31 36
32 } 37 }
@@ -181,7 +181,7 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ @@ -181,7 +181,7 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{
181 if (!couponTypeEnum.isPresent()){ 181 if (!couponTypeEnum.isPresent()){
182 throw new ServiceException(400, "错误:不合法的优惠券类型"); 182 throw new ServiceException(400, "错误:不合法的优惠券类型");
183 } 183 }
184 -// parseSkupForbidType(req); 184 + //parseSkupForbidType(req);
185 req.setSkupForbidType(SKUP_FORBID_TYPE_NONE); 185 req.setSkupForbidType(SKUP_FORBID_TYPE_NONE);
186 parseSkupAllowType(req); 186 parseSkupAllowType(req);
187 187
@@ -233,6 +233,12 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ @@ -233,6 +233,12 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{
233 // 优惠券说明 233 // 优惠券说明
234 couponSaveUpdateReq.setRemark(req.getRemark()); 234 couponSaveUpdateReq.setRemark(req.getRemark());
235 235
  236 + //结束时间
  237 + Integer endTime;
  238 + if (Objects.nonNull(endTime=req.getEndTime())){
  239 + couponSaveUpdateReq.setEndTime(endTime);
  240 + }
  241 +
236 LOGGER.info("has coupon send, saveOrUpdateCoupon#update,req is {}",req); 242 LOGGER.info("has coupon send, saveOrUpdateCoupon#update,req is {}",req);
237 couponMapper.updateByCouponSaveUpdateReq(couponSaveUpdateReq); 243 couponMapper.updateByCouponSaveUpdateReq(couponSaveUpdateReq);
238 }else{ 244 }else{
@@ -406,6 +412,11 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ @@ -406,6 +412,11 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{
406 return new PageResponseBO<>(total, result, req.getRows(), req.getPage()); 412 return new PageResponseBO<>(total, result, req.getRows(), req.getPage());
407 } 413 }
408 414
  415 + /**
  416 + * 作废用户券
  417 + * @param request
  418 + * @return
  419 + */
409 @Override 420 @Override
410 public ApiResponse invalidateUserCoupon(UserCouponBaseRequest request) { 421 public ApiResponse invalidateUserCoupon(UserCouponBaseRequest request) {
411 if (request == null || StringUtils.isEmpty(request.getCouponCode()) || Objects.isNull(request.getUid())) { 422 if (request == null || StringUtils.isEmpty(request.getCouponCode()) || Objects.isNull(request.getUid())) {