| | |
| | | import com.xiaopeng.api.model.account.XpAppUserCoupon; |
| | | import com.xiaopeng.api.model.operation.XpCoupon; |
| | | import com.xiaopeng.api.query.account.XpAppUserCouponPageListQuery; |
| | | import com.xiaopeng.api.vo.account.AppUserCouponSaveBatchVo; |
| | | import com.xiaopeng.api.vo.account.CalculateDiscountAmountVo; |
| | | import com.xiaopeng.api.vo.account.NavigationCouponPickerVo; |
| | | import com.xiaopeng.api.vo.account.UserCouponVo; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | import com.xiaopeng.unifiedverification.interceptor.XpClientCheck; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @PostMapping("/v1/api/appUserCoupon/deleteByIds") |
| | | @ApiOperation(value = "根据ids删除用户优惠券", tags = {"管理后台-白名单-删除用户优惠券"}) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.APP_USER_COUPON, |
| | | operationType = AdminOperationType.DELETE, |
| | | content = "根据ids删除用户优惠券", |
| | | appendRequestData = true |
| | | ) |
| | | public R<Boolean> deleteByIds(@RequestBody XpAppUserCouponPageListQuery query ) { |
| | | if (query.getIds() == null || query.getIds().isEmpty()) { |
| | | return R.fail("ID列表不能为空"); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/logan/inner/appUserCoupon/useUserCoupon") |
| | | public R<BigDecimal> useUserCoupon(@RequestBody UseUserCouponDto dto) { |
| | | XpAppUserCoupon appUserCoupon = xpAppUserCouponService.getById(dto.getUserCouponId()); |
| | |
| | | |
| | | @PostMapping("/api/v1/appUserCoupon/saveInfo_activity") |
| | | @ApiOperation(value = "活动发放优惠券", tags = {"管理后台-活动发放优惠券"}) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.APP_USER_COUPON, |
| | | operationType = AdminOperationType.ISSUE, |
| | | content = "活动发放优惠券", |
| | | appendRequestData = true |
| | | ) |
| | | public R<String> saveInfo_activity(@RequestBody UseUserCouponDto dto) { |
| | | xpAppUserCouponService.saveInfo_activity(dto); |
| | | return R.ok(); |
| | |
| | | */ |
| | | @PostMapping("/api/v1/appUserCoupon/send") |
| | | @ApiOperation(value = "发放优惠券", tags = {"管理后台-发放优惠券"}) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.APP_USER_COUPON, |
| | | operationType = AdminOperationType.ISSUE, |
| | | content = "发放优惠券", |
| | | appendRequestData = true |
| | | ) |
| | | public R<String> send(@RequestBody SendCouponDto dto) { |
| | | xpAppUserCouponService.send(dto); |
| | | return R.ok(); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 计算优惠金额 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @PostMapping("/logan/inner/appUserCoupon/calculateDiscountAmount") |
| | | public R<BigDecimal> calculateDiscountAmount(@RequestParam CalculateDiscountAmountVo vo){ |
| | | BigDecimal bigDecimal = xpAppUserCouponService.calculateDiscountAmount(vo); |
| | | return R.ok(bigDecimal); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 批量保存数据 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @PostMapping("/logan/inner/appUserCoupon/saveBatch") |
| | | public R<?> saveBatch(@RequestBody AppUserCouponSaveBatchVo vo){ |
| | | xpAppUserCouponService.saveBatch(vo.getXpAppUserCoupons()); |
| | | return R.ok(); |
| | | } |
| | | } |