记得上下班打卡 | git大法好,push需谨慎

Commit 8dd99b34 authored by 胡佳晨's avatar 胡佳晨

提交 券 领取

parent b5d03e38
...@@ -18,39 +18,39 @@ public class CandyCouponVo implements Serializable, Cloneable { ...@@ -18,39 +18,39 @@ public class CandyCouponVo implements Serializable, Cloneable {
private static final long serialVersionUID = 4073256621782131606L; private static final long serialVersionUID = 4073256621782131606L;
/* --- --- --- CandyCoupon */ /* --- --- --- CandyCoupon */
@ApiModelProperty(value = "标题",example = "标题") @ApiModelProperty(value = "标题", example = "标题")
private String title; private String title;
@ApiModelProperty(value = "标注",example = "标注") @ApiModelProperty(value = "标注", example = "标注")
private String label; private String label;
@ApiModelProperty(value = "须知",example = "须知") @ApiModelProperty(value = "须知", example = "须知")
private String notice; private String notice;
// private Integer exclusive;//专享标识[0-常规|1-会员礼包] // private Integer exclusive;//专享标识[0-常规|1-会员礼包]
@ApiModelProperty(value = "业务类别[0-全场|1-演出|2-商品|3-优先购]",example = "0") @ApiModelProperty(value = "业务类别[0-全场|1-演出|2-商品|3-优先购]", example = "0")
private Integer busiType; private Integer busiType;
@ApiModelProperty(value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券 | 101-优先券]",example = "1") @ApiModelProperty(value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券 | 101-优先券]", example = "1")
private Integer couType; private Integer couType;
@ApiModelProperty(value = "[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]",example = "1") @ApiModelProperty(value = "[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]", example = "1")
private Integer bindType; private Integer bindType;
@ApiModelProperty(value = "折扣 可null",example = "0.5") @ApiModelProperty(value = "折扣 可null", example = "0.5")
private BigDecimal discount; private BigDecimal discount;
@ApiModelProperty(value = "面值 可null",example = "1") @ApiModelProperty(value = "面值 可null", example = "1")
private BigDecimal valFace; private BigDecimal valFace;
@ApiModelProperty(value = "满减~满 可null",example = "100") @ApiModelProperty(value = "满减~满 可null", example = "100")
private BigDecimal valOver; private BigDecimal valOver;
@ApiModelProperty(value = "满减~减少 可null",example = "5") @ApiModelProperty(value = "满减~减少 可null", example = "5")
private BigDecimal valMinus; private BigDecimal valMinus;
@ApiModelProperty(value = "过期时间 可null",example = "2021-09-25") @ApiModelProperty(value = "过期时间 可null", example = "2021-09-25")
private String expireAt; private String expireAt;
/* --- --- --- CandyUserCoupon */ /* --- --- --- CandyUserCoupon */
@ApiModelProperty(value = "券id",example = "6d74a49d3d1d13f96ba09215abcc49af") @ApiModelProperty(value = "券id", example = "6d74a49d3d1d13f96ba09215abcc49af")
private String ucouponId; private String ucouponId;
@ApiModelProperty(value = "券状态[1-可用|2-无效|3-已过期 |31-未到期|5-已使用 |21-不可用]",example = "1") @ApiModelProperty(value = "券状态[1-可用|2-无效|3-已过期 |31-未到期|5-已使用 |21-不可用 | 22-需领取]", example = "1")
private Integer state; private Integer state;
// private String bindAt;//激活时间 // private String bindAt;//激活时间
@ApiModelProperty(value = "使用时间 可null",example = "2021-09-25") @ApiModelProperty(value = "使用时间 可null", example = "2021-09-25")
private String usedAt; private String usedAt;
@ApiModelProperty(value = "购买内容 可null",example = "北京草莓") @ApiModelProperty(value = "购买内容 可null", example = "北京草莓")
private String usedFor; private String usedFor;
......
package com.liquidnet.service.candy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 券码信息 前端控制器
* </p>
*
* @author liquidnet
* @since 2021-08-18
*/
@RestController
@RequestMapping("/candy-coupon-code")
public class CandyCouponCodeController {
}
package com.liquidnet.service.candy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 券适用规则 前端控制器
* </p>
*
* @author liquidnet
* @since 2021-08-18
*/
@RestController
@RequestMapping("/candy-coupon-rule")
public class CandyCouponRuleController {
}
package com.liquidnet.service.candy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 券发放管理 前端控制器
* </p>
*
* @author liquidnet
* @since 2021-08-18
*/
@RestController
@RequestMapping("/candy-mgt-coupon")
public class CandyMgtCouponController {
}
package com.liquidnet.service.candy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 用户券信息 前端控制器
* </p>
*
* @author liquidnet
* @since 2021-08-18
*/
@RestController
@RequestMapping("/candy-user-coupon")
public class CandyUserCouponController {
}
...@@ -72,6 +72,9 @@ public class CandyCouponServiceImpl implements ICandyCouponService { ...@@ -72,6 +72,9 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
if (baseVo.getState().equals(1)) { if (baseVo.getState().equals(1)) {
continue; continue;
} }
}
if(baseVo.getBindType().equals("3")){
} }
if (dtoItem.getExclusive().equals(1)) { //会员券 if (dtoItem.getExclusive().equals(1)) { //会员券
memberCoupon.add(baseVo); memberCoupon.add(baseVo);
...@@ -313,7 +316,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService { ...@@ -313,7 +316,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
if (dto == null) { if (dto == null) {
return null;//券不存在 return null;//券不存在
} }
return CouponBaseUtil.getCouponState(LocalDateTime.now(), dto.getDuedAt(), dto.getBindAt(), dto.getState()); return CouponBaseUtil.getCouponState(LocalDateTime.now(), dto.getDuedAt(), dto.getBindAt(), dto.getState(),dto.getBindType());
} }
@Override @Override
......
...@@ -59,7 +59,7 @@ public class CouponBaseUtil { ...@@ -59,7 +59,7 @@ public class CouponBaseUtil {
if (dtoItem.getDuedAt() == null) { if (dtoItem.getDuedAt() == null) {
return null; return null;
} }
vo.setState(getCouponState(now, dtoItem.getDuedAt(), dtoItem.getBindAt(), dtoItem.getState())); vo.setState(getCouponState(now, dtoItem.getDuedAt(), dtoItem.getBindAt(), dtoItem.getState(), dtoItem.getBindType()));
vo.setUseRules(rulesVoList); vo.setUseRules(rulesVoList);
return vo; return vo;
} }
...@@ -144,7 +144,7 @@ public class CouponBaseUtil { ...@@ -144,7 +144,7 @@ public class CouponBaseUtil {
} else { } else {
vo.setCouType(dtoItem.getCouType()); vo.setCouType(dtoItem.getCouType());
} }
int state = getCouponState(now, dtoItem.getDuedAt(), dtoItem.getBindAt(), dtoItem.getState()); int state = getCouponState(now, dtoItem.getDuedAt(), dtoItem.getBindAt(), dtoItem.getState(), dtoItem.getBindType());
if (isTarget) { if (isTarget) {
vo.setState(state); vo.setState(state);
} else { } else {
...@@ -227,7 +227,7 @@ public class CouponBaseUtil { ...@@ -227,7 +227,7 @@ public class CouponBaseUtil {
} else { } else {
vo.setCouType(dtoItem.getCouType()); vo.setCouType(dtoItem.getCouType());
} }
int state = getCouponState(now, dtoItem.getDuedAt(), dtoItem.getBindAt(), dtoItem.getState()); int state = getCouponState(now, dtoItem.getDuedAt(), dtoItem.getBindAt(), dtoItem.getState(), dtoItem.getBindType());
if (isTarget) { if (isTarget) {
vo.setState(state); vo.setState(state);
...@@ -272,7 +272,7 @@ public class CouponBaseUtil { ...@@ -272,7 +272,7 @@ public class CouponBaseUtil {
* @param state 券状态 * @param state 券状态
* @return 判断过后的券状态 * @return 判断过后的券状态
*/ */
public static Integer getCouponState(LocalDateTime currentTime, LocalDateTime expireAt, LocalDateTime effectAt, Integer state) { public static Integer getCouponState(LocalDateTime currentTime, LocalDateTime expireAt, LocalDateTime effectAt, Integer state, Integer bindType) {
//券状态 //券状态
Integer data; Integer data;
if (state.equals(1)) { if (state.equals(1)) {
...@@ -281,7 +281,11 @@ public class CouponBaseUtil { ...@@ -281,7 +281,11 @@ public class CouponBaseUtil {
} else if (currentTime.isBefore(effectAt)) { } else if (currentTime.isBefore(effectAt)) {
data = 31; data = 31;
} else { } else {
data = state; if (bindType == 3) {
data = 21;
} else {
data = state;
}
} }
} else { } else {
data = state; data = state;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment