- 前端:支付单列表
- 前端:退款单列表
This commit is contained in:
@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("admins/coupon")
|
||||
@Api("优惠劵(码)模块")
|
||||
@@ -48,10 +50,10 @@ public class AdminsCouponController {
|
||||
@RequestParam(value = "preferentialType", required = false) Integer preferentialType,
|
||||
@RequestParam(value = "pageNo", defaultValue = "0") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
CommonResult<CouponTemplatePageBO> result = couponService.getCouponTemplatePage(new CouponTemplatePageDTO()
|
||||
CouponTemplatePageBO result = couponService.getCouponTemplatePage(new CouponTemplatePageDTO()
|
||||
.setType(type).setTitle(title).setStatus(status).setPreferentialType(preferentialType)
|
||||
.setPageNo(pageNo).setPageSize(pageSize));
|
||||
return CouponTemplateConvert.INSTANCE.convert(result);
|
||||
return success(CouponTemplateConvert.ADMINS.convertPage(result));
|
||||
}
|
||||
|
||||
@PostMapping("/template/add_card")
|
||||
@@ -103,9 +105,9 @@ public class AdminsCouponController {
|
||||
.setFixedBeginTerm(fixedBeginTerm).setFixedEndTerm(fixedEndTerm)
|
||||
.setPreferentialType(preferentialType).setPriceOff(priceOff).setPercentOff(percentOff).setDiscountPriceLimit(discountPriceLimit);
|
||||
// 提交请求
|
||||
CommonResult<CouponTemplateBO> result = couponService.addCouponCardTemplate(couponCardTemplateAddDTO);
|
||||
CouponTemplateBO result = couponService.addCouponCardTemplate(couponCardTemplateAddDTO);
|
||||
// 返回结果
|
||||
return CouponTemplateConvert.INSTANCE.convert2(result);
|
||||
return success(CouponTemplateConvert.ADMINS.convert(result));
|
||||
}
|
||||
|
||||
@PostMapping("/template/update_card")
|
||||
@@ -132,7 +134,7 @@ public class AdminsCouponController {
|
||||
.setTitle(title).setDescription(description)
|
||||
.setQuota(quota).setTotal(total)
|
||||
.setRangeType(rangeType).setRangeValues(rangeValues);
|
||||
return couponService.updateCouponCardTemplate(couponCardTemplateUpdateDTO);
|
||||
return success(couponService.updateCouponCardTemplate(couponCardTemplateUpdateDTO));
|
||||
}
|
||||
|
||||
@PostMapping("/template/update_status")
|
||||
@@ -143,7 +145,7 @@ public class AdminsCouponController {
|
||||
})
|
||||
public CommonResult<Boolean> templateUpdateStatus(@RequestParam("id") Integer id,
|
||||
@RequestParam("status") Integer status) {
|
||||
return couponService.updateCouponTemplateStatus(AdminSecurityContextHolder.getContext().getAdminId(), id, status);
|
||||
return success(couponService.updateCouponTemplateStatus(AdminSecurityContextHolder.getContext().getAdminId(), id, status));
|
||||
}
|
||||
|
||||
// ========== 优惠劵 ==========
|
||||
|
||||
@@ -20,6 +20,8 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("users/coupon")
|
||||
@Api("优惠劵(码)模块")
|
||||
@@ -35,8 +37,8 @@ public class UsersCouponController {
|
||||
@ApiImplicitParam(name = "id", value = "优惠劵(码)模板编号", required = true, example = "10")
|
||||
@PermitAll
|
||||
public CommonResult<UsersCouponTemplateVO> templateGet(@RequestParam("id") Integer id) {
|
||||
CouponTemplateBO template = couponService.getCouponTemplate(id).getData();
|
||||
return CommonResult.success(CouponTemplateConvert.INSTANCE.convert2(template));
|
||||
CouponTemplateBO template = couponService.getCouponTemplate(id);
|
||||
return success(CouponTemplateConvert.USERS.convert2(template));
|
||||
}
|
||||
|
||||
// ========== 优惠劵 ==========
|
||||
@@ -51,18 +53,18 @@ public class UsersCouponController {
|
||||
public CommonResult<UsersCouponCardPageVO> cardPage(@RequestParam(value = "status", required = false) Integer status,
|
||||
@RequestParam(value = "pageNo", defaultValue = "0") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
CommonResult<CouponCardPageBO> result = couponService.getCouponCardPage(new CouponCardPageDTO()
|
||||
CouponCardPageBO result = couponService.getCouponCardPage(new CouponCardPageDTO()
|
||||
.setStatus(status).setUserId(UserSecurityContextHolder.getContext().getUserId())
|
||||
.setPageNo(pageNo).setPageSize(pageSize));
|
||||
return CouponCardConvert.INSTANCE.convert2(result);
|
||||
return success(CouponCardConvert.INSTANCE.convert2(result));
|
||||
}
|
||||
|
||||
@PostMapping("/card/add")
|
||||
@ApiOperation(value = "领取优惠劵")
|
||||
@ApiImplicitParam(name = "templateId", value = "优惠劵(码)模板编号", required = true, example = "10")
|
||||
public CommonResult<UsersCouponCardVO> cardAdd(@RequestParam("templateId") Integer templateId) {
|
||||
CommonResult<CouponCardBO> result = couponService.addCouponCard(UserSecurityContextHolder.getContext().getUserId(), templateId);
|
||||
return CouponCardConvert.INSTANCE.convert(result);
|
||||
CouponCardBO result = couponService.addCouponCard(UserSecurityContextHolder.getContext().getUserId(), templateId);
|
||||
return success(CouponCardConvert.INSTANCE.convert(result));
|
||||
}
|
||||
|
||||
// ========== 优惠码 ==========
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.mall.promotion.application.convert;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.promotion.api.bo.CouponCardBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.CouponCardPageBO;
|
||||
import cn.iocoder.mall.promotion.application.vo.users.UsersCouponCardPageVO;
|
||||
@@ -15,13 +14,15 @@ public interface CouponCardConvert {
|
||||
CouponCardConvert INSTANCE = Mappers.getMapper(CouponCardConvert.class);
|
||||
|
||||
@Mappings({})
|
||||
CommonResult<UsersCouponCardVO> convert(CommonResult<CouponCardBO> result);
|
||||
UsersCouponCardVO convert(CouponCardBO result);
|
||||
|
||||
@Mappings({})
|
||||
CommonResult<UsersCouponCardPageVO> convert2(CommonResult<CouponCardPageBO> result);
|
||||
UsersCouponCardPageVO convert2(CouponCardPageBO result);
|
||||
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<UsersCouponTemplateVO> convertList2(List<CouponTemplateBO> banners);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package cn.iocoder.mall.promotion.application.convert;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.promotion.api.bo.CouponTemplateBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.CouponTemplatePageBO;
|
||||
import cn.iocoder.mall.promotion.application.vo.admins.AdminsCouponTemplatePageVO;
|
||||
@@ -15,25 +14,30 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface CouponTemplateConvert {
|
||||
|
||||
CouponTemplateConvert INSTANCE = Mappers.getMapper(CouponTemplateConvert.class);
|
||||
Users USERS = Mappers.getMapper(Users.class);
|
||||
|
||||
@Mappings({})
|
||||
AdminsCouponTemplateVO convert(CouponTemplateBO template);
|
||||
Admins ADMINS = Mappers.getMapper(Admins.class);
|
||||
|
||||
@Mappings({})
|
||||
CommonResult<AdminsCouponTemplateVO> convert2(CommonResult<CouponTemplateBO> result);
|
||||
@Mapper
|
||||
interface Admins {
|
||||
|
||||
@Mappings({})
|
||||
CommonResult<AdminsCouponTemplatePageVO> convert(CommonResult<CouponTemplatePageBO> result);
|
||||
@Mappings({})
|
||||
AdminsCouponTemplateVO convert(CouponTemplateBO template);
|
||||
|
||||
@Mappings({})
|
||||
List<AdminsCouponTemplateVO> convertList(List<CouponTemplateBO> templates);
|
||||
@Mappings({})
|
||||
AdminsCouponTemplatePageVO convertPage(CouponTemplatePageBO result);
|
||||
|
||||
@Mappings({})
|
||||
UsersCouponTemplateVO convert2(CouponTemplateBO template);
|
||||
@Mappings({})
|
||||
List<AdminsCouponTemplateVO> convertList(List<CouponTemplateBO> templates);
|
||||
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<UsersCouponTemplateVO> convertList2(List<CouponTemplateBO> banners);
|
||||
}
|
||||
|
||||
@Mapper
|
||||
interface Users {
|
||||
|
||||
@Mappings({})
|
||||
UsersCouponTemplateVO convert2(CouponTemplateBO template);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user