Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
371eba55
提交
371eba55
authored
4月 16, 2019
作者:
sin
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
5de4ebfd
974b9650
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
446 行增加
和
31 行删除
+446
-31
detail.vue
mobile-web/src/page/product/detail.vue
+16
-2
pom.xml
order/order-application/pom.xml
+1
-2
pom.xml
order/order-service-api/pom.xml
+5
-0
CartService.java
.../src/main/java/cn/iocoder/mall/order/api/CartService.java
+3
-4
CalcOrderPriceBO.java
...n/java/cn/iocoder/mall/order/api/bo/CalcOrderPriceBO.java
+16
-2
CalcSkuPriceBO.java
...ain/java/cn/iocoder/mall/order/api/bo/CalcSkuPriceBO.java
+31
-0
CartServiceImpl.java
...va/cn/iocoder/mall/order/biz/service/CartServiceImpl.java
+6
-4
PromotionActivityService.java
.../iocoder/mall/promotion/api/PromotionActivityService.java
+17
-0
PromotionActivityBO.java
...cn/iocoder/mall/promotion/api/bo/PromotionActivityBO.java
+134
-0
PreferentialTypeEnum.java
...der/mall/promotion/api/constant/PreferentialTypeEnum.java
+6
-3
PromotionActivityStatusEnum.java
...l/promotion/api/constant/PromotionActivityStatusEnum.java
+41
-0
PromotionActivityTypeEnum.java
...all/promotion/api/constant/PromotionActivityTypeEnum.java
+2
-2
RangeTypeEnum.java
...cn/iocoder/mall/promotion/api/constant/RangeTypeEnum.java
+3
-3
CouponCardTemplateAddDTO.java
...oder/mall/promotion/api/dto/CouponCardTemplateAddDTO.java
+4
-4
CouponCardTemplateUpdateDTO.java
...r/mall/promotion/api/dto/CouponCardTemplateUpdateDTO.java
+2
-2
PromotionActivityDO.java
...er/mall/promotion/biz/dataobject/PromotionActivityDO.java
+157
-1
CouponServiceImpl.java
...iocoder/mall/promotion/biz/service/CouponServiceImpl.java
+2
-2
没有找到文件。
mobile-web/src/page/product/detail.vue
浏览文件 @
371eba55
...
...
@@ -6,8 +6,22 @@
<img
:src=
"thumb"
>
</van-swipe-item>
</van-swipe>
<van-cell-group>
<!-- TODO 这里需要优化下,芋艿 -->
<div
class=
"limit-dising-banner"
>
<div
class=
"row no-wrap flex-center limit-price"
>
<span
class=
"font-13 pusht"
>
¥
</span><span
class=
"price"
>
2.8
</span>
<div
class=
"pushl"
>
<div><del>
¥14
</del></div>
<div><span
class=
"tag"
>
限时抢购
</span></div>
</div>
</div>
<div
class=
"counting"
>
<p>
距离结束仅剩
</p>
<div
class=
"row no-wrap flex-center counting-clock"
style=
"display: block;"
><span
class=
"num"
>
71
</span><i
class=
"wxIcon wxIcon-colon"
></i><span
class=
"num"
>
42
</span><i
class=
"wxIcon wxIcon-colon"
></i><span
class=
"num"
>
02
</span></div>
</div>
</div>
<van-cell-group>
<van-cell>
<span
class=
"goods-price"
>
{{
formatPrice
(
initialSku
.
price
)
}}
</span>
<!--
<span
class=
"goods-market-price"
>
{{
formatPrice
(
goods
.
market_price
)
}}
</span>
-->
...
...
order/order-application/pom.xml
浏览文件 @
371eba55
...
...
@@ -124,4 +124,4 @@
</plugins>
</build>
</project>
\ No newline at end of file
</project>
order/order-service-api/pom.xml
浏览文件 @
371eba55
...
...
@@ -22,6 +22,11 @@
<artifactId>
product-service-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
promotion-service-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
javax.validation
</groupId>
...
...
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/CartService.java
浏览文件 @
371eba55
package
cn
.
iocoder
.
mall
.
order
.
api
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.order.api.bo.CalcOrderPriceBO
;
import
cn.iocoder.mall.order.api.bo.CartBO
;
import
cn.iocoder.mall.order.api.bo.CartItemBO
;
import
cn.iocoder.mall.order.api.bo.OrderCreateBO
;
import
cn.iocoder.mall.order.api.bo.*
;
import
cn.iocoder.mall.order.api.dto.CalcOrderPriceDTO
;
import
org.springframework.lang.Nullable
;
...
...
@@ -90,6 +87,8 @@ public interface CartService {
*/
CommonResult
<
CalcOrderPriceBO
>
calcOrderPrice
(
CalcOrderPriceDTO
calcOrderPriceDTO
);
CommonResult
<
CalcSkuPriceBO
>
calcSkuPrice
(
Integer
skuId
);
/**
* 获得购物车明细
*
...
...
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/CalcOrderPriceBO.java
浏览文件 @
371eba55
package
cn
.
iocoder
.
mall
.
order
.
api
.
bo
;
import
cn.iocoder.mall.product.api.bo.ProductSkuDetailBO
;
import
cn.iocoder.mall.promotion.api.bo.PromotionActivityBO
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
...
...
@@ -35,8 +36,11 @@ public class CalcOrderPriceBO {
@Accessors
(
chain
=
true
)
public
static
class
ItemGroup
{
// TODO 优惠活动
private
Object
activity
;
/**
* 优惠活动
*/
// TODO 芋艿,目前只会有【满减送】的情况,未来有新的促销方式,可能需要改成数组
private
PromotionActivityBO
activity
;
/**
* 商品数组
*/
...
...
@@ -56,6 +60,16 @@ public class CalcOrderPriceBO {
* 购买数量
*/
private
Integer
buyQuantity
;
/**
* 优惠活动
*/
private
PromotionActivityBO
activity
;
/**
* 费用
*
* TODO 芋艿,这里先偷懒,postageTotal 字段用不到。
*/
private
Fee
fee
;
}
...
...
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/CalcSkuPriceBO.java
0 → 100644
浏览文件 @
371eba55
package
cn
.
iocoder
.
mall
.
order
.
api
.
bo
;
import
cn.iocoder.mall.promotion.api.bo.PromotionActivityBO
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
* 计算商品 SKU 价格结果 BO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
CalcSkuPriceBO
{
/**
* 满减送促销活动
*/
private
PromotionActivityBO
fullPrivilege
;
/**
* 电视和折扣促销活动
*/
private
PromotionActivityBO
timeLimitedDiscount
;
/**
* 原价格,单位:分。
*/
private
Integer
originalPrice
;
/**
* 最终价格,单位:分。
*/
private
Integer
presentPrice
;
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/CartServiceImpl.java
浏览文件 @
371eba55
...
...
@@ -4,10 +4,7 @@ import cn.iocoder.common.framework.constant.CommonStatusEnum;
import
cn.iocoder.common.framework.util.ServiceExceptionUtil
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.order.api.CartService
;
import
cn.iocoder.mall.order.api.bo.CalcOrderPriceBO
;
import
cn.iocoder.mall.order.api.bo.CartBO
;
import
cn.iocoder.mall.order.api.bo.CartItemBO
;
import
cn.iocoder.mall.order.api.bo.OrderCreateBO
;
import
cn.iocoder.mall.order.api.bo.*
;
import
cn.iocoder.mall.order.api.constant.CartItemStatusEnum
;
import
cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum
;
import
cn.iocoder.mall.order.api.dto.CalcOrderPriceDTO
;
...
...
@@ -190,6 +187,11 @@ public class CartServiceImpl implements CartService {
return
CommonResult
.
success
(
calcOrderPriceBO
);
}
@Override
public
CommonResult
<
CalcSkuPriceBO
>
calcSkuPrice
(
Integer
skuId
)
{
return
null
;
}
@Override
public
CommonResult
<
CartBO
>
details
(
Integer
userId
)
{
return
null
;
...
...
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/PromotionActivityService.java
0 → 100644
浏览文件 @
371eba55
package
cn
.
iocoder
.
mall
.
promotion
.
api
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.promotion.api.bo.PromotionActivityBO
;
import
java.util.Collection
;
import
java.util.List
;
public
interface
PromotionActivityService
{
CommonResult
<
List
<
PromotionActivityBO
>>
getPromotionActivityListBySpuId
(
Integer
spuId
,
Collection
<
Integer
>
activityStatuses
);
CommonResult
<
List
<
PromotionActivityBO
>>
getPromotionActivityListBySpuIds
(
Collection
<
Integer
>
spuIds
,
Collection
<
Integer
>
activityStatuses
);
}
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/bo/PromotionActivityBO.java
0 → 100644
浏览文件 @
371eba55
package
cn
.
iocoder
.
mall
.
promotion
.
api
.
bo
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.List
;
import
java.util.Set
;
@Data
@Accessors
(
chain
=
true
)
public
class
PromotionActivityBO
{
/**
* 活动编号
*/
private
Integer
id
;
/**
* 活动标题
*/
private
String
title
;
/**
* 活动类型
*
* 参见 {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityTypeEnum} 枚举
*/
private
Integer
type
;
/**
* 活动状态
*
* 参见 {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityStatusEnum} 枚举
*/
private
Integer
status
;
/**
* 匹配的商品 SPU 编号
*/
private
Set
<
Integer
>
spuIds
;
/**
* 限制折扣
*/
@Data
@Accessors
(
chain
=
true
)
public
static
class
TimeLimitedDiscount
{
/**
* 商品折扣
*/
@Data
@Accessors
(
chain
=
true
)
public
static
class
Item
{
/**
* 商品 SPU 编号
*/
private
Integer
spuId
;
/**
* 优惠类型
*/
private
Integer
preferentialType
;
/**
* 优惠值
*/
private
Integer
preferentialValue
;
}
/**
* 每人每种限购多少
*
* 当 quota = 0 时,表示不限购
*/
private
Integer
quota
;
/**
* 商品折扣数组
*/
private
List
<
Item
>
items
;
}
/**
* 满减送
*/
@Data
@Accessors
(
chain
=
true
)
public
static
class
FullPrivilege
{
/**
* 优惠
*/
@Data
@Accessors
(
chain
=
true
)
public
static
class
Privilege
{
/**
* 满足类型
*
* 1 - 金额
* 2 - 件数
*/
private
Integer
meetType
;
/**
* 满足值
*/
private
Integer
meetValue
;
/**
* 优惠类型
*/
private
Integer
preferentialType
;
/**
* 优惠值
*/
private
Integer
preferentialValue
;
}
/**
* 可用范围的类型
*
* 参见 {@link cn.iocoder.mall.promotion.api.constant.RangeTypeEnum} 枚举
* 暂时只用 “所有可用” + “PRODUCT_INCLUDE_PRT”
*/
private
Integer
rangeType
;
/**
* 指定可用商品列表
*/
private
List
<
Integer
>
rangeValues
;
/**
* 优惠数组
*/
private
List
<
Privilege
>
privileges
;
}
}
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/constant/
CouponTemplate
PreferentialTypeEnum.java
→
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/constant/PreferentialTypeEnum.java
浏览文件 @
371eba55
...
...
@@ -4,13 +4,16 @@ import cn.iocoder.common.framework.core.IntArrayValuable;
import
java.util.Arrays
;
public
enum
CouponTemplatePreferentialTypeEnum
implements
IntArrayValuable
{
/**
* 优惠类型枚举
*/
public
enum
PreferentialTypeEnum
implements
IntArrayValuable
{
PRICE
(
1
,
"代金卷"
),
DISCOUNT
(
2
,
"折扣卷"
),
;
public
static
final
int
[]
ARRAYS
=
Arrays
.
stream
(
values
()).
mapToInt
(
CouponTemplate
PreferentialTypeEnum:
:
getValue
).
toArray
();
public
static
final
int
[]
ARRAYS
=
Arrays
.
stream
(
values
()).
mapToInt
(
PreferentialTypeEnum:
:
getValue
).
toArray
();
/**
* 值
...
...
@@ -21,7 +24,7 @@ public enum CouponTemplatePreferentialTypeEnum implements IntArrayValuable {
*/
private
final
String
name
;
CouponTemplate
PreferentialTypeEnum
(
Integer
value
,
String
name
)
{
PreferentialTypeEnum
(
Integer
value
,
String
name
)
{
this
.
value
=
value
;
this
.
name
=
name
;
}
...
...
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/constant/PromotionActivityStatusEnum.java
0 → 100644
浏览文件 @
371eba55
package
cn
.
iocoder
.
mall
.
promotion
.
api
.
constant
;
/**
* 促销活动状态枚举
*/
public
enum
PromotionActivityStatusEnum
{
WAIT
(
10
,
"未开始"
),
RUN
(
20
,
"进行中"
),
END
(
30
,
"已结束"
),
/**
* 1. WAIT、RUN、END 可以转换成 INVALID 状态。
* 2. INVALID 只可以转换成 DELETED 状态。
*/
INVALID
(
40
,
"已撤销"
),
DELETED
(
50
,
"已删除"
),
;
/**
* 状态值
*/
private
final
Integer
value
;
/**
* 状态名
*/
private
final
String
name
;
PromotionActivityStatusEnum
(
Integer
value
,
String
name
)
{
this
.
value
=
value
;
this
.
name
=
name
;
}
public
Integer
getValue
()
{
return
value
;
}
public
String
getName
()
{
return
name
;
}
}
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/constant/PromotionActivityTypeEnum.java
浏览文件 @
371eba55
...
...
@@ -5,8 +5,8 @@ package cn.iocoder.mall.promotion.api.constant;
*/
public
enum
PromotionActivityTypeEnum
{
LIMIT
_DISCOUNT
(
1
,
"限时折扣"
),
MEET_REDUC
E
(
2
,
"满减送"
),
TIME_LIMITED
_DISCOUNT
(
1
,
"限时折扣"
),
FULL_PRIVILEG
E
(
2
,
"满减送"
),
;
/**
...
...
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/constant/
CouponTemplate
RangeTypeEnum.java
→
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/constant/RangeTypeEnum.java
浏览文件 @
371eba55
...
...
@@ -4,7 +4,7 @@ import cn.iocoder.common.framework.core.IntArrayValuable;
import
java.util.Arrays
;
public
enum
CouponTemplate
RangeTypeEnum
implements
IntArrayValuable
{
public
enum
RangeTypeEnum
implements
IntArrayValuable
{
ALL
(
10
,
"所有可用"
),
PRODUCT_INCLUDE_PRT
(
20
,
"部分商品可用,或指定商品可用"
),
...
...
@@ -13,7 +13,7 @@ public enum CouponTemplateRangeTypeEnum implements IntArrayValuable {
CATEGORY_EXCLUDE_PRT
(
31
,
"部分分类不可用,或指定分类可用"
),
;
public
static
final
int
[]
ARRAYS
=
Arrays
.
stream
(
values
()).
mapToInt
(
CouponTemplate
RangeTypeEnum:
:
getValue
).
toArray
();
public
static
final
int
[]
ARRAYS
=
Arrays
.
stream
(
values
()).
mapToInt
(
RangeTypeEnum:
:
getValue
).
toArray
();
/**
* 值
...
...
@@ -24,7 +24,7 @@ public enum CouponTemplateRangeTypeEnum implements IntArrayValuable {
*/
private
final
String
name
;
CouponTemplate
RangeTypeEnum
(
Integer
value
,
String
name
)
{
RangeTypeEnum
(
Integer
value
,
String
name
)
{
this
.
value
=
value
;
this
.
name
=
name
;
}
...
...
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/dto/CouponCardTemplateAddDTO.java
浏览文件 @
371eba55
...
...
@@ -2,8 +2,8 @@ package cn.iocoder.mall.promotion.api.dto;
import
cn.iocoder.common.framework.validator.InEnum
;
import
cn.iocoder.mall.promotion.api.constant.CouponTemplateDateTypeEnum
;
import
cn.iocoder.mall.promotion.api.constant.
CouponTemplate
PreferentialTypeEnum
;
import
cn.iocoder.mall.promotion.api.constant.
CouponTemplate
RangeTypeEnum
;
import
cn.iocoder.mall.promotion.api.constant.PreferentialTypeEnum
;
import
cn.iocoder.mall.promotion.api.constant.RangeTypeEnum
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
org.hibernate.validator.constraints.Length
;
...
...
@@ -70,7 +70,7 @@ public class CouponCardTemplateAddDTO {
* 31-部分(PART):部分分类不可用,或指定分类可用
*/
@NotNull
(
message
=
"可用范围的类型不能为空"
)
@InEnum
(
value
=
CouponTemplate
RangeTypeEnum
.
class
,
message
=
"可用范围的类型必须在 {value}"
)
@InEnum
(
value
=
RangeTypeEnum
.
class
,
message
=
"可用范围的类型必须在 {value}"
)
private
Integer
rangeType
;
/**
* 指定商品 / 分类列表,使用逗号分隔商品编号
...
...
@@ -115,7 +115,7 @@ public class CouponCardTemplateAddDTO {
* 2-折扣卷
*/
@NotNull
(
message
=
"优惠类型不能为空"
)
@InEnum
(
value
=
CouponTemplate
PreferentialTypeEnum
.
class
,
message
=
"优惠类型必须在 {value}"
)
@InEnum
(
value
=
PreferentialTypeEnum
.
class
,
message
=
"优惠类型必须在 {value}"
)
private
Integer
preferentialType
;
/**
* 优惠金额,单位:分
...
...
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/dto/CouponCardTemplateUpdateDTO.java
浏览文件 @
371eba55
package
cn
.
iocoder
.
mall
.
promotion
.
api
.
dto
;
import
cn.iocoder.common.framework.validator.InEnum
;
import
cn.iocoder.mall.promotion.api.constant.
CouponTemplate
RangeTypeEnum
;
import
cn.iocoder.mall.promotion.api.constant.RangeTypeEnum
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
org.hibernate.validator.constraints.Length
;
...
...
@@ -69,7 +69,7 @@ public class CouponCardTemplateUpdateDTO {
* 31-部分(PART):部分分类不可用,或指定分类可用
*/
@NotNull
(
message
=
"可用范围的类型不能为空"
)
@InEnum
(
value
=
CouponTemplate
RangeTypeEnum
.
class
,
message
=
"可用范围的类型必须在 {value}"
)
@InEnum
(
value
=
RangeTypeEnum
.
class
,
message
=
"可用范围的类型必须在 {value}"
)
private
Integer
rangeType
;
/**
* 指定商品 / 分类列表,使用逗号分隔商品编号
...
...
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/dataobject/PromotionActivityDO.java
浏览文件 @
371eba55
...
...
@@ -4,6 +4,9 @@ import cn.iocoder.common.framework.dataobject.BaseDO;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
import
java.util.List
;
/**
* 促销活动 DO
*/
...
...
@@ -21,7 +24,160 @@ public class PromotionActivityDO extends BaseDO {
private
String
title
;
/**
* 活动类型
*
* 参见 {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityTypeEnum} 枚举
*/
private
Integer
activityType
;
// /**
// * 促销类型
// * // TODO 芋艿 https://jos.jd.com/api/complexTemplate.htm?webPamer=promotion_v_o&groupName=%E4%BF%83%E9%94%80API&id=54&restName=jingdong.seller.promotion.list&isMulti=false 促销类型,可选值:单品促销(1),赠品促销(4),套装促销(6),总价促销(10)
// */
// private Integer promotionType;
/**
* 活动状态
*
* 参见 {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityStatusEnum} 枚举
*/
private
Integer
status
;
/**
* 开始时间
*/
private
Date
startTime
;
/**
* 结束时间
*/
private
Date
endTime
;
/**
* 失效时间
*/
private
Date
invalidTime
;
/**
* 删除时间
*/
private
Date
deleteTime
;
/**
* 限制折扣字符串,使用 JSON 序列化成字符串存储
*/
private
String
timeLimitedDiscount
;
/**
* 满减送字符串,使用 JSON 序列化成字符串存储
*/
private
Integer
type
;
private
String
fullPrivilege
;
/**
* 限制折扣
*/
@Data
@Accessors
(
chain
=
true
)
public
static
class
TimeLimitedDiscount
{
/**
* 商品折扣
*/
@Data
@Accessors
(
chain
=
true
)
public
static
class
Item
{
/**
* 商品 SPU 编号
*/
private
Integer
spuId
;
/**
* 优惠类型
*/
private
Integer
preferentialType
;
/**
* 优惠值
*/
private
Integer
preferentialValue
;
}
/**
* 每人每种限购多少
*
* 当 quota = 0 时,表示不限购
*/
private
Integer
quota
;
/**
* 商品折扣数组
*/
private
List
<
Item
>
items
;
}
/**
* 满减送
*/
@Data
@Accessors
(
chain
=
true
)
public
static
class
FullPrivilege
{
/**
* 优惠
*/
@Data
@Accessors
(
chain
=
true
)
public
static
class
Privilege
{
/**
* 满足类型
*
* 1 - 金额
* 2 - 件数
*/
private
Integer
meetType
;
/**
* 满足值
*/
private
Integer
meetValue
;
/**
* 优惠类型
*/
private
Integer
preferentialType
;
/**
* 优惠值
*/
private
Integer
preferentialValue
;
// /**
// * 是否包邮
// */
// private Boolean isPostage;
// /**
// * 积分
// */
// private Integer score;
// /**
// * 优惠劵(码)分组编号
// */
// private Integer couponTemplateId;
// /**
// * 优惠劵(码)数量
// */
// private Integer couponNum;
// /**
// * 赠品编号
// */
// private Integer presentId;
}
/**
* 可用范围的类型
*
* 参见 {@link cn.iocoder.mall.promotion.api.constant.RangeTypeEnum} 枚举
* 暂时只用 “所有可用” + “PRODUCT_INCLUDE_PRT”
*/
private
Integer
rangeType
;
/**
* 指定可用商品列表
*/
private
List
<
Integer
>
rangeValues
;
/**
* 优惠数组
*/
private
List
<
Privilege
>
privileges
;
}
}
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/service/CouponServiceImpl.java
浏览文件 @
371eba55
...
...
@@ -158,14 +158,14 @@ public class CouponServiceImpl implements CouponService {
private
CommonResult
<
Boolean
>
checkCouponTemplatePreferentialType
(
Integer
preferentialType
,
Integer
percentOff
,
Integer
priceOff
,
Integer
priceAvailable
)
{
if
(
CouponTemplate
PreferentialTypeEnum
.
PRICE
.
getValue
().
equals
(
preferentialType
))
{
if
(
PreferentialTypeEnum
.
PRICE
.
getValue
().
equals
(
preferentialType
))
{
if
(
priceOff
==
null
)
{
return
CommonResult
.
error
(
SysErrorCodeEnum
.
VALIDATION_REQUEST_PARAM_ERROR
.
getCode
(),
"优惠金额不能为空"
);
}
if
(
priceOff
>=
priceAvailable
)
{
return
CommonResult
.
error
(
SysErrorCodeEnum
.
VALIDATION_REQUEST_PARAM_ERROR
.
getCode
(),
"优惠金额不能d大于等于使用金额门槛"
);
}
}
else
if
(
CouponTemplate
PreferentialTypeEnum
.
DISCOUNT
.
getValue
().
equals
(
preferentialType
))
{
}
else
if
(
PreferentialTypeEnum
.
DISCOUNT
.
getValue
().
equals
(
preferentialType
))
{
if
(
percentOff
==
null
)
{
return
CommonResult
.
error
(
SysErrorCodeEnum
.
VALIDATION_REQUEST_PARAM_ERROR
.
getCode
(),
"折扣百分比不能为空"
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论