优惠券
This commit is contained in:
@@ -11,10 +11,13 @@ import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* 优惠券信息Controller
|
||||
@@ -53,14 +56,14 @@ public class PlayCouponInfoController {
|
||||
// @PreAuthorize("@customSs.hasPermission('shop:coupon:create')")
|
||||
@Log(title = "优惠券信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayCouponInfoAddVo vo) {
|
||||
public R create(@Validated @RequestBody PlayCouponInfoAddVo vo) {
|
||||
PlayCouponInfoEntity entity = ConvertUtil.entityToVo(vo, PlayCouponInfoEntity.class);
|
||||
if ("1".equals(vo.getValidityPeriodType())) {
|
||||
if (vo.getProductiveTime() == null || vo.getProductiveTime().size() != 2) {
|
||||
throw new CustomException("用券时间输入错误");
|
||||
}
|
||||
LocalDateTime startTime = LocalDateTime.parse(vo.getProductiveTime().get(0));
|
||||
LocalDateTime endTime = LocalDateTime.parse(vo.getProductiveTime().get(1));
|
||||
LocalDateTime startTime = LocalDateTime.parse(vo.getProductiveTime().get(0), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
LocalDateTime endTime = LocalDateTime.parse(vo.getProductiveTime().get(1), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
if (endTime.isBefore(startTime)) {
|
||||
throw new CustomException("用券时间输入错误,结束时间大于开始时间");
|
||||
}
|
||||
@@ -70,8 +73,18 @@ public class PlayCouponInfoController {
|
||||
if ("2".equals(vo.getValidityPeriodType()) && vo.getEffectiveDay() <= 0) {
|
||||
throw new CustomException("用券时间输入错误,有效天数不能为0");
|
||||
}
|
||||
|
||||
|
||||
String discountContent = "";
|
||||
if (BigDecimal.ZERO.compareTo(vo.getUseMinAmount()) == 0) {
|
||||
discountContent = "无门槛";
|
||||
} else {
|
||||
discountContent = "满" + vo.getUseMinAmount() + "船票";
|
||||
}
|
||||
if ("0".equals(vo.getDiscountType())) {
|
||||
discountContent += ("减" + vo.getDiscountAmount() + "船票");
|
||||
} else {
|
||||
discountContent += ("打" + vo.getDiscountAmount() + "折");
|
||||
}
|
||||
entity.setDiscountContent(discountContent);
|
||||
boolean success = playCouponInfoService.create(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.List;
|
||||
@TableName(value = "play_coupon_info", autoResultMap = true)
|
||||
public class PlayCouponInfoEntity extends BaseEntity<PlayCouponInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
@@ -64,7 +63,7 @@ public class PlayCouponInfoEntity extends BaseEntity<PlayCouponInfoEntity> {
|
||||
private Integer effectiveDay;
|
||||
|
||||
/**
|
||||
* 使用优惠券最近消费金额
|
||||
* 使用优惠券最低消费金额
|
||||
**/
|
||||
private BigDecimal useMinAmount;
|
||||
|
||||
@@ -125,16 +124,30 @@ public class PlayCouponInfoEntity extends BaseEntity<PlayCouponInfoEntity> {
|
||||
private String claimConditionType;
|
||||
|
||||
/**
|
||||
* 顾客等级
|
||||
* 顾客等级选择状态(0:未选择,1:选择)
|
||||
*/
|
||||
private String customLevelCheckType;
|
||||
|
||||
/**
|
||||
* 店员等级
|
||||
*/
|
||||
@TableField(typeHandler = StringTypeHandler.class)
|
||||
private List<String> customLevel;
|
||||
|
||||
/**
|
||||
* 用户关注公众号选择状态(0:未选择,1:选择)
|
||||
*/
|
||||
private String customFollowStatusCheckType;
|
||||
|
||||
/**
|
||||
* 顾客关注公众号状态(0:未关注,1:已关注)
|
||||
*/
|
||||
private String customFollowStatus;
|
||||
|
||||
/**
|
||||
* 顾客性别选择状态(0:未选择,1:选择)
|
||||
*/
|
||||
private String customSexCheckType;
|
||||
/**
|
||||
* 顾客性别(0:未知;1:男,2:女)
|
||||
*/
|
||||
@@ -144,7 +157,7 @@ public class PlayCouponInfoEntity extends BaseEntity<PlayCouponInfoEntity> {
|
||||
/**
|
||||
* 仅限新用户领取(0:不是;1:是)(没有下过单的用户,下单后再退单也不算)
|
||||
*/
|
||||
private String isNewUser;
|
||||
private String newUser;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.starry.admin.modules.shop.module.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.starry.admin.common.conf.StringTypeHandler;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@@ -62,7 +61,7 @@ public class PlayCouponInfoAddVo {
|
||||
/**
|
||||
* 折扣值
|
||||
*/
|
||||
@NotNull(message = "优惠类型不能为空")
|
||||
@NotNull(message = "优惠金额不能为空")
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/**
|
||||
@@ -76,8 +75,8 @@ public class PlayCouponInfoAddVo {
|
||||
* 下单类型(0:指定单,1:随机单。2:打赏单)
|
||||
*/
|
||||
@NotNull(message = "订单类型不能为空")
|
||||
@Pattern(regexp = "[01]", message = "订单类型只能为0或1")
|
||||
private String placeType;
|
||||
@Size(min = 1, message = "下单类型不能为空")
|
||||
private List<String> placeType;
|
||||
|
||||
/**
|
||||
* 店员范围(0:所有店员)
|
||||
@@ -86,6 +85,12 @@ public class PlayCouponInfoAddVo {
|
||||
@Pattern(regexp = "[0]", message = "店员范围只能为0")
|
||||
private String clerkType;
|
||||
|
||||
/**
|
||||
* 优惠券数量限制(0:不限制,1:限制)
|
||||
*/
|
||||
@NotNull(message = "优惠券总数不能为空")
|
||||
@Pattern(regexp = "[01]", message = "优惠券数量限制只能为0或1")
|
||||
private String couponQuantityType;
|
||||
/**
|
||||
* 优惠券总数(-1表示不限制数量)
|
||||
*/
|
||||
@@ -102,6 +107,13 @@ public class PlayCouponInfoAddVo {
|
||||
*/
|
||||
private Integer remainingQuantity;
|
||||
|
||||
/**
|
||||
* 店员获得最大数量是否限制
|
||||
*/
|
||||
@NotNull(message = "店员获得最大数量是否限制不能为空")
|
||||
@Pattern(regexp = "[01]", message = "店员获得最大数量是否限制只能为0或1")
|
||||
private String clerkObtainedMaxQuantityType;
|
||||
|
||||
/**
|
||||
* 店员获得最大数量
|
||||
*/
|
||||
@@ -115,24 +127,45 @@ public class PlayCouponInfoAddVo {
|
||||
@Pattern(regexp = "[0|1]", message = "店员范围只能为0或者1")
|
||||
private String claimConditionType;
|
||||
|
||||
|
||||
/**
|
||||
* 顾客等级
|
||||
* 顾客等级选择状态(0:未选择,1:选择)
|
||||
*/
|
||||
private String customLevelCheckType;
|
||||
|
||||
/**
|
||||
* 店员等级
|
||||
*/
|
||||
@TableField(typeHandler = StringTypeHandler.class)
|
||||
private List<String> customLevel;
|
||||
|
||||
|
||||
/**
|
||||
* 用户关注公众号选择状态(0:未选择,1:选择)
|
||||
*/
|
||||
private String customFollowStatusCheckType;
|
||||
|
||||
|
||||
/**
|
||||
* 顾客关注公众号状态(0:未关注,1:已关注)
|
||||
*/
|
||||
private String customFollowStatus;
|
||||
|
||||
/**
|
||||
* 顾客性别关注状态(0:未选择,1:选择)
|
||||
*/
|
||||
private String customSexCheckType;
|
||||
/**
|
||||
* 顾客性别(0:未知;1:男,2:女)
|
||||
*/
|
||||
private String customSex;
|
||||
private List<String> customSex;
|
||||
|
||||
/**
|
||||
* 仅限新用户领取选择状态(0:未选择,1:已选择)
|
||||
*/
|
||||
private String isNewUserCheckType;
|
||||
|
||||
/**
|
||||
* 仅限新用户领取(0:不是;1:是)(没有下过单的用户,下单后再退单也不算)
|
||||
*/
|
||||
private String isNewUser;
|
||||
private String newUser;
|
||||
}
|
||||
|
||||
@@ -116,16 +116,30 @@ public class PlayCouponInfoReturnVo {
|
||||
private String claimConditionType;
|
||||
|
||||
/**
|
||||
* 顾客等级
|
||||
* 顾客等级选择状态(0:未选择,1:选择)
|
||||
*/
|
||||
private String customLevelCheckType;
|
||||
|
||||
/**
|
||||
* 店员等级
|
||||
*/
|
||||
@TableField(typeHandler = StringTypeHandler.class)
|
||||
private List<String> customLevel;
|
||||
|
||||
/**
|
||||
* 用户关注公众号选择状态(0:未选择,1:选择)
|
||||
*/
|
||||
private String customFollowStatusCheckType;
|
||||
|
||||
/**
|
||||
* 顾客关注公众号状态(0:未关注,1:已关注)
|
||||
*/
|
||||
private String customFollowStatus;
|
||||
|
||||
/**
|
||||
* 顾客性别选择状态(0:未选择,1:选择)
|
||||
*/
|
||||
private String customSexCheckType;
|
||||
/**
|
||||
* 顾客性别(0:未知;1:男,2:女)
|
||||
*/
|
||||
@@ -135,6 +149,7 @@ public class PlayCouponInfoReturnVo {
|
||||
/**
|
||||
* 仅限新用户领取(0:不是;1:是)(没有下过单的用户,下单后再退单也不算)
|
||||
*/
|
||||
private String isNewUser;
|
||||
private String newUser;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -43,12 +43,11 @@ public interface IPlayCouponDetailsService extends IService<PlayCouponDetailsEnt
|
||||
* 根据顾客ID,查询当前顾客优惠券列表
|
||||
*
|
||||
* @param customId 顾客ID
|
||||
* @param canBeUsed 是否可以被使用
|
||||
* @return List<com.starry.admin.modules.shop.module.entity.PlayCouponDetailsEntity>
|
||||
* @author 杭州世平信息科技有限公司-xuhq
|
||||
* @since 2024/7/5 11:37
|
||||
**/
|
||||
List<PlayCouponDetailsEntity> selectByCustomId(String customId, boolean canBeUsed);
|
||||
List<PlayCouponDetailsEntity> selectByCustomId(String customId);
|
||||
|
||||
/**
|
||||
* 新增优惠券详情
|
||||
|
||||
@@ -95,9 +95,10 @@ public class PlayCouponDetailsServiceImpl extends ServiceImpl<PlayCouponDetailsM
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PlayCouponDetailsEntity> selectByCustomId(String customId, boolean canBeUsed) {
|
||||
public List<PlayCouponDetailsEntity> selectByCustomId(String customId) {
|
||||
MPJLambdaWrapper<PlayCouponDetailsEntity> lambdaWrapper = new MPJLambdaWrapper<>();
|
||||
lambdaWrapper.eq(PlayCouponDetailsEntity::getCustomId, customId);
|
||||
return this.baseMapper.selectList(lambdaWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,6 +44,7 @@ public class PlayCouponInfoServiceImpl extends ServiceImpl<PlayCouponInfoMapper,
|
||||
public IPage<PlayCouponInfoReturnVo> selectByPage(PlayCouponInfoQueryVo vo) {
|
||||
MPJLambdaWrapper<PlayCouponInfoEntity> lambdaQueryWrapper = new MPJLambdaWrapper<>();
|
||||
lambdaQueryWrapper.selectAll(PlayCouponInfoEntity.class);
|
||||
lambdaQueryWrapper.orderByDesc(PlayCouponInfoEntity::getCreatedTime);
|
||||
return this.baseMapper.selectJoinPage(new Page<>(vo.getPageNum(), vo.getPageSize()), PlayCouponInfoReturnVo.class, lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,28 @@
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.starry.admin.common.aspect.CustomUserLogin;
|
||||
import com.starry.admin.common.conf.ThreadLocalRequestDetail;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCouponDetailsEntity;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCouponInfoEntity;
|
||||
import com.starry.admin.modules.shop.service.IPlayCouponDetailsService;
|
||||
import com.starry.admin.modules.shop.service.IPlayCouponInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.WxCouponQueryVo;
|
||||
import com.starry.admin.modules.weichat.entity.WxCouponReturnVo;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
@@ -23,21 +37,54 @@ public class WxCouponController {
|
||||
@Resource
|
||||
IPlayCouponDetailsService couponDetailsService;
|
||||
|
||||
@Resource
|
||||
IPlayCouponInfoService couponInfoService;
|
||||
|
||||
/**
|
||||
* 顾客查询本人优惠券列表
|
||||
*/
|
||||
@CustomUserLogin
|
||||
@GetMapping("/custom/queryAll")
|
||||
public R queryAll() {
|
||||
// couponDetailsService.selectByPage()
|
||||
// List<PlayCustomLevelInfoEntity> list = levelInfoService.selectAll();
|
||||
// List<PlayCustomLevelInfoReturnVo> result = new ArrayList<>();
|
||||
// for (PlayCustomLevelInfoEntity entity : list) {
|
||||
// PlayCustomLevelInfoReturnVo vo = new PlayCustomLevelInfoReturnVo();
|
||||
// BeanUtils.copyProperties(entity, vo);
|
||||
// result.add(vo);
|
||||
// }
|
||||
return R.ok("");
|
||||
@PostMapping("/custom/queryAll")
|
||||
public R queryAll(@Validated @RequestBody WxCouponQueryVo vo) {
|
||||
List<PlayCouponDetailsEntity> list = couponDetailsService.selectByCustomId(ThreadLocalRequestDetail.getCustomUserInfo().getId());
|
||||
//不可用订单优惠券列表
|
||||
List<WxCouponReturnVo> notAvailable = new ArrayList<>();
|
||||
//可用优惠券列表
|
||||
List<WxCouponReturnVo> available = new ArrayList<>();
|
||||
for (PlayCouponDetailsEntity couponDetails : list) {
|
||||
PlayCouponInfoEntity couponInfo = couponInfoService.selectPlayCouponInfoById(couponDetails.getCouponId());
|
||||
WxCouponReturnVo wxCouponReturnVo = ConvertUtil.entityToVo(couponDetails, WxCouponReturnVo.class);
|
||||
String couponReasonForUnavailableUse = getCouponReasonForUnavailableUse(couponInfo, vo.getPlaceType(), vo.getCommodityId(), vo.getCommodityQuantity());
|
||||
if (StrUtil.isEmpty(couponReasonForUnavailableUse)) {
|
||||
wxCouponReturnVo.setAvailable("1");
|
||||
available.add(wxCouponReturnVo);
|
||||
} else {
|
||||
wxCouponReturnVo.setAvailable("0");
|
||||
wxCouponReturnVo.setReasonForUnavailableUse(couponReasonForUnavailableUse);
|
||||
notAvailable.add(wxCouponReturnVo);
|
||||
}
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("notAvailable", notAvailable);
|
||||
result.put("available", available);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取优惠券不可用的原因
|
||||
*
|
||||
* @param couponInfo 优惠券信息
|
||||
* @param placeType 下单类型
|
||||
* @param commodityId 商品ID
|
||||
* @param commodityQuantity 商品数量
|
||||
* @return 不可用原因
|
||||
*/
|
||||
public String getCouponReasonForUnavailableUse(PlayCouponInfoEntity couponInfo, String placeType, String commodityId, Integer commodityQuantity) {
|
||||
if (StrUtil.isEmpty(commodityId) || commodityQuantity <= 0) {
|
||||
return "订单满0船票余额时可用";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import com.starry.admin.common.aspect.ClerkUserLogin;
|
||||
import com.starry.admin.modules.personnel.module.entity.PlayPersonnelGroupInfoEntity;
|
||||
import com.starry.admin.modules.personnel.service.IPlayPersonnelGroupInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.PlayGroupWagesQueryVo;
|
||||
import com.starry.admin.modules.weichat.entity.PlayGroupWagesReturnVo;
|
||||
import com.starry.common.result.R;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 微信查询组长工资
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024/7/6 下午3:46
|
||||
**/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/wx/group")
|
||||
public class WxPersonnelGroupInfoController {
|
||||
|
||||
|
||||
@Resource
|
||||
private IPlayPersonnelGroupInfoService playClerkGroupInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询组长公工资
|
||||
*/
|
||||
@ClerkUserLogin
|
||||
@PostMapping("/wages/listAll")
|
||||
public R listGroupWagesAll(@Validated @RequestBody PlayGroupWagesQueryVo vo) {
|
||||
List<PlayPersonnelGroupInfoEntity> list = playClerkGroupInfoService.selectAll();
|
||||
List<PlayGroupWagesReturnVo> data = new ArrayList<>();
|
||||
for (PlayPersonnelGroupInfoEntity entity : list) {
|
||||
PlayGroupWagesReturnVo bean = new PlayGroupWagesReturnVo();
|
||||
bean.setGroupName(entity.getGroupName());
|
||||
data.add(bean);
|
||||
}
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组长工资查询对象
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024/7/6 下午3:56
|
||||
**/
|
||||
@Data
|
||||
public class PlayGroupWagesQueryVo {
|
||||
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
private List<String> statisticalTime;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 组长工资查询对象
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024/7/6 下午3:56
|
||||
**/
|
||||
@Data
|
||||
public class PlayGroupWagesReturnVo {
|
||||
|
||||
/**
|
||||
* 组名称
|
||||
*/
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private BigDecimal orderMoney = BigDecimal.ZERO;
|
||||
|
||||
|
||||
/**
|
||||
* 订单最终金额(支付金额)
|
||||
*/
|
||||
private BigDecimal finalAmount = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 续单比例
|
||||
*/
|
||||
private final double orderContinueProportion = 0.0;
|
||||
/**
|
||||
* 续单金额
|
||||
*/
|
||||
private final BigDecimal orderTotalAmount = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 续费率
|
||||
*/
|
||||
private final BigDecimal orderContinueRechargeProportion = BigDecimal.ZERO;
|
||||
/**
|
||||
* 退单率
|
||||
*/
|
||||
private final BigDecimal orderChargebackProportion = BigDecimal.ZERO;
|
||||
/**
|
||||
* 续客率
|
||||
*/
|
||||
private final BigDecimal continuousCustomProportion = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 订单平均价格
|
||||
*/
|
||||
private final BigDecimal averageUnitPrice = BigDecimal.ZERO;
|
||||
|
||||
|
||||
/**
|
||||
* 组长工资
|
||||
*/
|
||||
private final BigDecimal commission = BigDecimal.ZERO;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 顾客优惠券查询对象
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024/7/6 下午4:16
|
||||
**/
|
||||
@Data
|
||||
public class WxCouponQueryVo {
|
||||
|
||||
|
||||
private String commodityId;
|
||||
|
||||
|
||||
/**
|
||||
* 下单类型(-1:其他类型;0:指定单;1:随机单;2:打赏单)
|
||||
*/
|
||||
@NotNull(message = "下单类型不能为空")
|
||||
@Pattern(regexp = "[0|1]", message = "订单类型必须为0或者1")
|
||||
private String placeType;
|
||||
|
||||
|
||||
private int commodityQuantity;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 顾客优惠券查询对象
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024/7/6 下午4:16
|
||||
**/
|
||||
@Data
|
||||
public class WxCouponReturnVo {
|
||||
|
||||
/**
|
||||
* 优惠券ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
* 优惠券名称
|
||||
**/
|
||||
private String couponName;
|
||||
|
||||
|
||||
/**
|
||||
* 有效期类型(0:永久有效;1:固定时间内有效;2:领取后几天内有效)
|
||||
*/
|
||||
private String validityPeriodType;
|
||||
|
||||
/**
|
||||
* 生效时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime productiveTime;
|
||||
|
||||
/**
|
||||
* 到期时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime expirationTime;
|
||||
|
||||
/**
|
||||
* 生效时长,validityPeriodType=2时有效
|
||||
**/
|
||||
private Integer effectiveDay;
|
||||
|
||||
/**
|
||||
* 使用优惠券最低消费金额
|
||||
**/
|
||||
private BigDecimal useMinAmount;
|
||||
|
||||
/**
|
||||
* 优惠类型(0:满减;1:折扣)
|
||||
*/
|
||||
private String discountType;
|
||||
|
||||
/**
|
||||
* 折扣值
|
||||
*/
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/**
|
||||
* 优惠是否可使用(0:不可使用,1:可使用)
|
||||
*/
|
||||
private String available;
|
||||
|
||||
/**
|
||||
* 优惠券不可用的原因
|
||||
*/
|
||||
private String reasonForUnavailableUse;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user