diff --git a/yudao-module-mall/pom.xml b/yudao-module-mall/pom.xml index 23812b4cc..68c1825cc 100644 --- a/yudao-module-mall/pom.xml +++ b/yudao-module-mall/pom.xml @@ -15,17 +15,18 @@ ${project.artifactId} - 商城大模块,由 product 商品、market 营销、trade 交易等组成 + 商城大模块,由 product 商品、market 营销、trade 交易 coupon等组成 + yudao-module-coupon-api + yudao-module-coupon-biz yudao-module-market-api yudao-module-market-biz yudao-module-product-api yudao-module-product-biz yudao-module-trade-api yudao-module-trade-biz - yudao-module-coupon-api - yudao-module-coupon-biz + diff --git a/yudao-module-mall/yudao-module-coupon-api/pom.xml b/yudao-module-mall/yudao-module-coupon-api/pom.xml index e98526f9c..6dab80613 100644 --- a/yudao-module-mall/yudao-module-coupon-api/pom.xml +++ b/yudao-module-mall/yudao-module-coupon-api/pom.xml @@ -23,6 +23,13 @@ cn.iocoder.boot yudao-common + + + + org.springframework.boot + spring-boot-starter-validation + true + \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponExpireTimeTypeEnum.java b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponExpireTimeTypeEnum.java index be6d2a90e..0e1e17ece 100644 --- a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponExpireTimeTypeEnum.java +++ b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponExpireTimeTypeEnum.java @@ -14,7 +14,8 @@ import lombok.RequiredArgsConstructor; @Getter public enum CouponExpireTimeTypeEnum { - OPEN(1,"不开启"),CLOSE(0,"开启"),; + OPEN(1,"不开启"), + CLOSE(0,"开启"),; /** * 是否开启过期提醒 diff --git a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponFetchTypeEnum.java b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponFetchTypeEnum.java index ffdd99c28..66a86bc84 100644 --- a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponFetchTypeEnum.java +++ b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponFetchTypeEnum.java @@ -14,7 +14,8 @@ import lombok.RequiredArgsConstructor; @Getter public enum CouponFetchTypeEnum { - LIMIT(0,"否"),NOT_LIMIT(0,"开启"),; + LIMIT(1,"限制"), + NOT_LIMIT(0,"不限制"),; /** * 是否开启过期提醒 diff --git a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponProductTypeEnum.java b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponForbidPreferenceEnum.java similarity index 66% rename from yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponProductTypeEnum.java rename to yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponForbidPreferenceEnum.java index f5e6cf995..1ac9e9f68 100644 --- a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponProductTypeEnum.java +++ b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponForbidPreferenceEnum.java @@ -6,17 +6,16 @@ import lombok.RequiredArgsConstructor; /** - * 优惠券 - 优惠券类型 + * 优惠券 - 优惠叠加类型 * * @author Sin */ @RequiredArgsConstructor @Getter -public enum CouponProductTypeEnum { +public enum CouponForbidPreferenceEnum { - PROCESSING(1,"进行中"), - END(2,"已结束"), - CLOSE(3,"已关闭"),; + UN_FORBID(0,"不限制"), + FORBID(1,"优惠券仅原价购买商品时可用"); /** * 优惠券类型 diff --git a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponGoodsTypeEnum.java b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponGoodsTypeEnum.java new file mode 100644 index 000000000..e0946b7a0 --- /dev/null +++ b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponGoodsTypeEnum.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.CouponTemplete.enums; + + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + + +/** + * 优惠券 - 优惠券商品使用类型 + * + * @author Sin + */ +@RequiredArgsConstructor +@Getter +public enum CouponGoodsTypeEnum { + + ALL(1,"全部商品可用"), + POINT_PRODUCT(2,"指定商品可用"), + POINT_PRODUCT_NOT(3,"指定商品不可用"),; + + /** + * 优惠券商品使用类型 + */ + private final Integer type; + /** + * 优惠券商品使用类型名 + */ + private final String name; + +} diff --git a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponStatusTypeEnum.java b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponStatusTypeEnum.java index c58ce36b4..813084731 100644 --- a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponStatusTypeEnum.java +++ b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponStatusTypeEnum.java @@ -6,7 +6,7 @@ import lombok.RequiredArgsConstructor; /** - * 优惠券 - 优惠券类型 + * 优惠券 - 优惠券状态类型 * * @author Sin */ @@ -14,9 +14,9 @@ import lombok.RequiredArgsConstructor; @Getter public enum CouponStatusTypeEnum { - ALL(1,"全部商品可用"), - POINT_PRODUCT(2,"指定商品可用"), - POINT_PRODUCT_NOT(3,"指定商品不可用不能为空"),; + PROCESSING(1,"进行中"), + END(2,"已结束"), + CLOSE(3,"已关闭"),; /** * 优惠券类型 diff --git a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponUseLimitEnum.java b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponUseLimitEnum.java index 61d2f429b..beb530f0c 100644 --- a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponUseLimitEnum.java +++ b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponUseLimitEnum.java @@ -6,7 +6,7 @@ import lombok.RequiredArgsConstructor; /** - * 优惠券 - 优惠券类型 + * 优惠券使用类型 - 优惠券使用类型类型 * * @author Sin */ @@ -18,11 +18,11 @@ public enum CouponUseLimitEnum { NO_LIMIT(2,"有门槛"),; /** - * 优惠券类型 + * 优惠券使用类型 */ private final Integer type; /** - * 优惠券类型名 + * 优惠券使用类型名 */ private final String name; diff --git a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponValidityTypeEnum.java b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponValidityTypeEnum.java index 6411ecbf9..798cf1e0f 100644 --- a/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponValidityTypeEnum.java +++ b/yudao-module-mall/yudao-module-coupon-api/src/main/java/cn/iocoder/yudao/module/CouponTemplete/enums/CouponValidityTypeEnum.java @@ -14,7 +14,7 @@ public enum CouponValidityTypeEnum { TIME_RANGE_EXPIRTED(1,"时间范围过期"), EXPIRES_AFTER_FIXED_DATE(2,"领取之日固定日期后过期"), - EXPIRES_DATE_NEXT_FIEXD_DATE(3,"领取次日固定日期后过期不能为空"),; + EXPIRES_DATE_NEXT_FIEXD_DATE(3,"领取次日固定日期后过期"),; /** diff --git a/yudao-module-mall/yudao-module-coupon-biz/pom.xml b/yudao-module-mall/yudao-module-coupon-biz/pom.xml index 735d5180d..eda16bd16 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/pom.xml +++ b/yudao-module-mall/yudao-module-coupon-biz/pom.xml @@ -3,19 +3,18 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - yudao-module-mall cn.iocoder.boot + yudao-module-mall ${revision} 4.0.0 - yudao-module-coupon-biz jar - + yudao-module-coupon-biz ${project.artifactId} + - trade 模块,主要实现交易相关功能 - 例如:订单、退款、购物车等功能。 + coupon模块,主要负责优惠券的一些业务,含发布优惠券模板,分发优惠券等 diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/CouponController.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/CouponController.java index 6e099269a..8ee02c366 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/CouponController.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/CouponController.java @@ -21,7 +21,7 @@ import cn.iocoder.yudao.module.coupon.service.coupon.CouponService; @Api(tags = "管理后台 - 优惠券") @RestController -@RequestMapping("/coupon/coupon/") +@RequestMapping("/coupon/item") @Validated public class CouponController { @@ -69,7 +69,7 @@ public class CouponController { @GetMapping("/list") @ApiOperation("获得优惠券列表") -// @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) @PreAuthorize("@ss.hasPermission('coupon::query')") public CommonResult> getList(@RequestParam("ids") Collection ids) { List list = couponService.getList(ids); diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponBaseVO.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponBaseVO.java index 20dba42d8..31cc828f7 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponBaseVO.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponBaseVO.java @@ -68,7 +68,7 @@ public class CouponBaseVO { private Boolean whetherForbidPreference; @ApiModelProperty(value = "是否开启过期提醒0-不开启 1-开启", required = true) - @NotNull(message = "是否开启过期提醒0-不开启 1-开启不能为空") + @NotNull(message = "是否开启过期提醒0-不开启 1-开启") private Boolean whetherExpireNotice; @ApiModelProperty(value = "过期前N天提醒", required = true) diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/CouponTempleteController.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/CouponTempleteController.java deleted file mode 100644 index 40d9ac429..000000000 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/CouponTempleteController.java +++ /dev/null @@ -1,81 +0,0 @@ -package cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete; - -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.*; -import cn.iocoder.yudao.module.coupon.convert.CouponTemplete.CouponTempleteConvert; -import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO; -import cn.iocoder.yudao.module.coupon.service.CouponTemplete.CouponTempleteService; -import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import io.swagger.annotations.*; - -import javax.validation.*; -import java.util.*; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; - -@Api(tags = "管理后台 - 优惠券模板") -@RestController -@RequestMapping("/coupon/CouponTemplete/") -@Validated -public class CouponTempleteController { - - @Resource - private CouponTempleteService Service; - - @PostMapping("/create") - @ApiOperation("创建优惠券模板") - @PreAuthorize("@ss.hasPermission('CouponTemplete::create')") - public CommonResult create(@Valid @RequestBody CouponTempleteCreateReqVO createReqVO) { - return success(Service.create(createReqVO)); - } - - @PutMapping("/update") - @ApiOperation("更新优惠券模板") - @PreAuthorize("@ss.hasPermission('CouponTemplete::update')") - public CommonResult update(@Valid @RequestBody CouponTempleteUpdateReqVO updateReqVO) { - Service.update(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @ApiOperation("删除优惠券模板") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) - @PreAuthorize("@ss.hasPermission('CouponTemplete::delete')") - public CommonResult delete(@RequestParam("id") Long id) { - Service.delete(id); - return success(true); - } - - @GetMapping("/get") - @ApiOperation("获得优惠券模板") -// @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) - @PreAuthorize("@ss.hasPermission('CouponTemplete::query')") - public CommonResult get(@RequestParam("id") Long id) { - CouponTempleteDO couponTempleteDO = Service.get(id); - return success(CouponTempleteConvert.INSTANCE.convert(couponTempleteDO)); - } - - @GetMapping("/list") - @ApiOperation("获得优惠券模板列表") -// @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) - @PreAuthorize("@ss.hasPermission('CouponTemplete::query')") - public CommonResult> getList(@RequestParam("ids") Collection ids) { - List list = Service.getList(ids); - return success(CouponTempleteConvert.INSTANCE.convertList(list)); - } - - @GetMapping("/page") - @ApiOperation("获得优惠券模板分页") - @PreAuthorize("@ss.hasPermission('CouponTemplete::query')") - public CommonResult> getPage(@Valid CouponTempletePageReqVO pageVO) { - PageResult pageResult = Service.getPage(pageVO); - return success(CouponTempleteConvert.INSTANCE.convertPage(pageResult)); - } - - - -} diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/CouponTempleteController.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/CouponTempleteController.java new file mode 100644 index 000000000..a81f53c09 --- /dev/null +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/CouponTempleteController.java @@ -0,0 +1,81 @@ +package cn.iocoder.yudao.module.coupon.controller.admin.templete; + +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.*; +import cn.iocoder.yudao.module.coupon.convert.CouponTemplete.CouponTempleteConvert; +import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO; +import cn.iocoder.yudao.module.coupon.service.CouponTemplete.CouponTempleteService; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.annotations.*; + +import javax.validation.*; +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Api(tags = "管理后台 - 优惠券模板") +@RestController +@RequestMapping("/coupon/template") +@Validated +public class CouponTempleteController { + + @Resource + private CouponTempleteService couponTempleteServiceService; + + @PostMapping("/create") + @ApiOperation("创建优惠券模板") + @PreAuthorize("@ss.hasPermission('CouponTemplete::create')") + public CommonResult create(@Valid @RequestBody CouponTempleteCreateReqVO createReqVO) { + return success(couponTempleteServiceService.create(createReqVO)); + } + +// @PutMapping("/update") +// @ApiOperation("更新优惠券模板") +// @PreAuthorize("@ss.hasPermission('CouponTemplete::update')") +// public CommonResult update(@Valid @RequestBody CouponTempleteUpdateReqVO updateReqVO) { +// couponTempleteServiceService.update(updateReqVO); +// return success(true); +// } +// +// @DeleteMapping("/delete") +// @ApiOperation("删除优惠券模板") +// @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) +// @PreAuthorize("@ss.hasPermission('CouponTemplete::delete')") +// public CommonResult delete(@RequestParam("id") Long id) { +// couponTempleteServiceService.delete(id); +// return success(true); +// } +// +// @GetMapping("/get") +// @ApiOperation("获得优惠券模板") +// @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) +// @PreAuthorize("@ss.hasPermission('CouponTemplete::query')") +// public CommonResult get(@RequestParam("id") Long id) { +// CouponTempleteDO couponTempleteDO = couponTempleteServiceService.get(id); +// return success(CouponTempleteConvert.INSTANCE.convert(couponTempleteDO)); +// } +// +// @GetMapping("/list") +// @ApiOperation("获得优惠券模板列表") +// @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) +// @PreAuthorize("@ss.hasPermission('CouponTemplete::query')") +// public CommonResult> getList(@RequestParam("ids") Collection ids) { +// List list = couponTempleteServiceService.getList(ids); +// return success(CouponTempleteConvert.INSTANCE.convertList(list)); +// } +// + @GetMapping("/page") + @ApiOperation("获得优惠券模板分页") + @PreAuthorize("@ss.hasPermission('CouponTemplete::query')") + public CommonResult> getPage(@Valid CouponTempletePageReqVO pageVO) { + PageResult pageResult = couponTempleteServiceService.getPage(pageVO); + return success(CouponTempleteConvert.INSTANCE.convertPage(pageResult)); + } + + + +} diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteBaseVO.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteBaseVO.java similarity index 97% rename from yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteBaseVO.java rename to yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteBaseVO.java index d9818344f..942abe896 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteBaseVO.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteBaseVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo; +package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo; import lombok.*; import java.util.*; @@ -34,7 +34,7 @@ public class CouponTempleteBaseVO { @ApiModelProperty(value = "适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用", required = true) @NotNull(message = "适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用不能为空") - private Boolean goodsType; + private Integer goodsType; @ApiModelProperty(value = "适用商品id") private String productIds; @@ -104,7 +104,7 @@ public class CouponTempleteBaseVO { @ApiModelProperty(value = "领取是否无限制0-否 1是", required = true) - @NotNull(message = "是否无限制0-否 1是 不能为空") + @NotNull(message = "是否无限制0-否 1是") private Boolean whetherLimitless; @ApiModelProperty(value = "每人最大领取个数", required = true) diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteCreateReqVO.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteCreateReqVO.java similarity index 77% rename from yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteCreateReqVO.java rename to yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteCreateReqVO.java index fa13b77a5..8e1d9a51a 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteCreateReqVO.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteCreateReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo; +package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo; import lombok.*; import io.swagger.annotations.*; diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteExcelVO.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteExcelVO.java similarity index 95% rename from yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteExcelVO.java rename to yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteExcelVO.java index a09b3ff71..1101f9b61 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteExcelVO.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteExcelVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo; +package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo; import lombok.*; import java.util.*; @@ -39,7 +39,7 @@ public class CouponTempleteExcelVO { private Integer usedCount; @ExcelProperty("适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用") - private Boolean goodsType; + private Integer goodsType; @ExcelProperty("适用商品id") private String productIds; @@ -66,7 +66,7 @@ public class CouponTempleteExcelVO { private BigDecimal maxMoney; @ExcelProperty("过期类型1-时间范围过期 2-领取之日固定日期后过期 3-领取次日固定日期后过期") - private Boolean validityType; + private Integer validityType; @ExcelProperty("使用开始日期 过期类型1时必填") private Date startUseTime; diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteExportReqVO.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteExportReqVO.java similarity index 98% rename from yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteExportReqVO.java rename to yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteExportReqVO.java index b8b8fced1..0420e3d9e 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteExportReqVO.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteExportReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo; +package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo; import lombok.*; diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempletePageReqVO.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempletePageReqVO.java similarity index 98% rename from yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempletePageReqVO.java rename to yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempletePageReqVO.java index 92622d793..3ff5710c7 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempletePageReqVO.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempletePageReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo; +package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo; import lombok.*; diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteRespVO.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteRespVO.java similarity index 85% rename from yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteRespVO.java rename to yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteRespVO.java index 318492a24..b65f7c259 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteRespVO.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteRespVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo; +package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo; import lombok.*; import java.util.*; diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteUpdateReqVO.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteUpdateReqVO.java similarity index 84% rename from yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteUpdateReqVO.java rename to yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteUpdateReqVO.java index 7d0fb7544..1ee8b539d 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupontemplete/vo/CouponTempleteUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteUpdateReqVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo; +package cn.iocoder.yudao.module.coupon.controller.admin.templete.vo; import lombok.*; import io.swagger.annotations.*; diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/convert/CouponTemplete/CouponTempleteConvert.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/convert/CouponTemplete/CouponTempleteConvert.java index ddd774053..a7f37919d 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/convert/CouponTemplete/CouponTempleteConvert.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/convert/CouponTemplete/CouponTempleteConvert.java @@ -4,10 +4,10 @@ import java.util.*; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.CouponTempleteCreateReqVO; -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.CouponTempleteExcelVO; -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.CouponTempleteRespVO; -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.CouponTempleteUpdateReqVO; +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteCreateReqVO; +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteExcelVO; +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteRespVO; +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteUpdateReqVO; import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/dataobject/CouponTemplete/CouponTempleteDO.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/dataobject/CouponTemplete/CouponTempleteDO.java index 106c459a1..e33771808 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/dataobject/CouponTemplete/CouponTempleteDO.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/dataobject/CouponTemplete/CouponTempleteDO.java @@ -57,7 +57,7 @@ public class CouponTempleteDO extends BaseDO { /** * 适用商品类型1-全部商品可用;2-指定商品可用;3-指定商品不可用 */ - private Boolean goodsType; + private Integer goodsType; /** * 适用商品id */ @@ -93,7 +93,7 @@ public class CouponTempleteDO extends BaseDO { /** * 过期类型1-时间范围过期 2-领取之日固定日期后过期 3-领取次日固定日期后过期 */ - private Boolean validityType; + private Integer validityType; /** * 使用开始日期 过期类型1时必填 */ diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/mysql/CouponTemplete/CouponTempleteMapper.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/mysql/CouponTemplete/CouponTempleteMapper.java index b930f113f..3243ce17a 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/mysql/CouponTemplete/CouponTempleteMapper.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/mysql/CouponTemplete/CouponTempleteMapper.java @@ -5,8 +5,8 @@ import java.util.*; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.CouponTempleteExportReqVO; -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.CouponTempletePageReqVO; +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteExportReqVO; +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempletePageReqVO; import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO; import org.apache.ibatis.annotations.Mapper; diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/package-info.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/package-info.java new file mode 100644 index 000000000..6743fd141 --- /dev/null +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/package-info.java @@ -0,0 +1,6 @@ +/** + * coupon模块,主要负责麦一些优惠券的额增删 + * + * 1. Controller URL:以 /coumon/ 开头,避免和其它 Module 冲突 + */ +package cn.iocoder.yudao.module.coupon; diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/CouponTemplete/CouponTempleteService.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/CouponTemplete/CouponTempleteService.java index f0ad215c8..0527d11b7 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/CouponTemplete/CouponTempleteService.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/CouponTemplete/CouponTempleteService.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.coupon.service.CouponTemplete; import java.util.*; import javax.validation.*; -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.*; +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.*; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO; diff --git a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/CouponTemplete/CouponTempleteServiceImpl.java b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/CouponTemplete/CouponTempleteServiceImpl.java index f3f826b81..6f07c4b2a 100644 --- a/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/CouponTemplete/CouponTempleteServiceImpl.java +++ b/yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/service/CouponTemplete/CouponTempleteServiceImpl.java @@ -2,14 +2,13 @@ package cn.iocoder.yudao.module.coupon.service.CouponTemplete; import cn.iocoder.yudao.module.CouponTemplete.enums.CouponTypeEnum; import cn.iocoder.yudao.module.CouponTemplete.enums.CouponValidityTypeEnum; -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.CouponTempleteCreateReqVO; -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.CouponTempleteExportReqVO; -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.CouponTempletePageReqVO; -import cn.iocoder.yudao.module.coupon.controller.admin.coupontemplete.vo.CouponTempleteUpdateReqVO; +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteCreateReqVO; +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteExportReqVO; +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempletePageReqVO; +import cn.iocoder.yudao.module.coupon.controller.admin.templete.vo.CouponTempleteUpdateReqVO; import cn.iocoder.yudao.module.coupon.convert.CouponTemplete.CouponTempleteConvert; import cn.iocoder.yudao.module.coupon.dal.dataobject.CouponTemplete.CouponTempleteDO; import cn.iocoder.yudao.module.coupon.dal.mysql.CouponTemplete.CouponTempleteMapper; -import cn.iocoder.yudao.module.coupon.service.CouponTemplete.CouponTempleteService; import org.springframework.stereotype.Service; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -41,7 +40,7 @@ public class CouponTempleteServiceImpl implements CouponTempleteService { /* 验证类型、判断必填*/ checkCouponType(createReqVO); - /*todo 验证过期类型、判断必填*/ + /*验证过期类型、判断必填*/ checkValidityType(createReqVO); diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index c7090aa6e..852a9dff0 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -56,6 +56,11 @@ yudao-module-trade-biz ${revision} + + cn.iocoder.boot + yudao-module-coupon-biz + ${revision} + diff --git a/yudao-ui-admin/src/api/mall/CouponTemplete/CouponTemplete.js b/yudao-ui-admin/src/api/mall/CouponTemplete/CouponTemplete.js index 429dfb8dc..639a75a1d 100644 --- a/yudao-ui-admin/src/api/mall/CouponTemplete/CouponTemplete.js +++ b/yudao-ui-admin/src/api/mall/CouponTemplete/CouponTemplete.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 创建优惠券模板 export function create(data) { return request({ - url: '/coupon/CouponTemplete/create', + url: '/coupon/template/create', method: 'post', data: data }) @@ -12,7 +12,7 @@ export function create(data) { // 更新优惠券模板 export function update(data) { return request({ - url: '/coupon/CouponTemplete/update', + url: '/coupon/template/update', method: 'put', data: data }) @@ -21,7 +21,7 @@ export function update(data) { // 删除优惠券模板 export function deleteCouponTemplete (id) { return request({ - url: '/coupon/CouponTemplete/delete?id=' + id, + url: '/coupon/template/delete?id=' + id, method: 'delete' }) } @@ -29,7 +29,7 @@ export function deleteCouponTemplete (id) { // 获得优惠券模板 export function get(id) { return request({ - url: '/coupon/CouponTemplete/get?id=' + id, + url: '/coupon/template/get?id=' + id, method: 'get' }) } @@ -37,7 +37,7 @@ export function get(id) { // 获得优惠券模板分页 export function getPage(query) { return request({ - url: '/coupon/CouponTemplete/page', + url: '/coupon/template/page', method: 'get', params: query }) @@ -46,7 +46,7 @@ export function getPage(query) { // 导出优惠券模板 Excel export function exportExcel(query) { return request({ - url: '/coupon/CouponTemplete/export-excel', + url: '/coupon/template/export-excel', method: 'get', params: query, responseType: 'blob' diff --git a/yudao-ui-admin/src/views/mall/CouponTemplete/index.vue b/yudao-ui-admin/src/views/mall/CouponTemplete/index.vue index 47be4afd3..945bb03ea 100644 --- a/yudao-ui-admin/src/views/mall/CouponTemplete/index.vue +++ b/yudao-ui-admin/src/views/mall/CouponTemplete/index.vue @@ -43,7 +43,6 @@ - @@ -229,6 +228,7 @@