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

Commit 81a1765f authored by 张国柄's avatar 张国柄

~创建券同步券基础信息至RDS(替换原发放券同步券基础信息至RDS);

parent 9a7a2291
...@@ -174,7 +174,7 @@ create table candy_mgt_coupon ...@@ -174,7 +174,7 @@ create table candy_mgt_coupon
coupon_id varchar(64) not null comment '~candy_coupon.coupon_id', coupon_id varchar(64) not null comment '~candy_coupon.coupon_id',
state tinyint comment '发放状态[0-未发放|1-已发放|2-无效|3-已取消|9-发放中|10-会员礼包初始模版]', state tinyint comment '发放状态[0-未发放|1-已发放|2-无效|3-已取消|9-发放中|10-会员礼包初始模版]',
# bind_type smallint comment '领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]', # bind_type smallint comment '领取方式[0-用户输入兑换|1-发放至用户|2-积分商品]',
event_amt int comment '发放量', event_amt int comment '发放量',
event_type tinyint comment '发放类型[0-保留|1-会员|2-手机号|10-全体用户]', event_type tinyint comment '发放类型[0-保留|1-会员|2-手机号|10-全体用户]',
event_limit text comment '`发放类型`为2-手机号时发放手机号以,分隔', event_limit text comment '`发放类型`为2-手机号时发放手机号以,分隔',
...@@ -203,7 +203,7 @@ create table candy_coupon ...@@ -203,7 +203,7 @@ create table candy_coupon
exclusive smallint comment '专享标识[0-常规|1-会员礼包]', exclusive smallint comment '专享标识[0-常规|1-会员礼包]',
busi_type smallint comment '业务类别[0-全场|1-演出|2-商品|3-优先购]', busi_type smallint comment '业务类别[0-全场|1-演出|2-商品|3-优先购]',
cou_type smallint comment '券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]', cou_type smallint comment '券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]',
bind_type smallint comment '领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]', bind_type smallint comment '领取方式[0-用户输入兑换|1-发放至用户|2-积分商品]',
discount decimal(8, 2) comment '折扣[8折即0.8]', discount decimal(8, 2) comment '折扣[8折即0.8]',
val_face decimal(8, 2) comment '面值', val_face decimal(8, 2) comment '面值',
......
...@@ -41,7 +41,7 @@ public class CandyMemberCouponBuildParam { ...@@ -41,7 +41,7 @@ public class CandyMemberCouponBuildParam {
@ApiModelProperty(required = true, value = "券类型[1-代金券|2-满减券|101-优先券]", allowableValues = "1,2,101") @ApiModelProperty(required = true, value = "券类型[1-代金券|2-满减券|101-优先券]", allowableValues = "1,2,101")
private Integer couType; private Integer couType;
// @NotNull(message = "券领取方式不能为空") // @NotNull(message = "券领取方式不能为空")
// @ApiModelProperty(required = true, value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]", allowableValues = "0,1,2,3,4") // @ApiModelProperty(required = true, value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]", allowableValues = "0,1,2,3,4")
// private Integer bindType; // private Integer bindType;
// @ApiModelProperty(required = false, value = "折扣[8折即0.8]", example = "0.8") // @ApiModelProperty(required = false, value = "折扣[8折即0.8]", example = "0.8")
// private BigDecimal discount; // private BigDecimal discount;
......
...@@ -23,7 +23,7 @@ public class CandyCouponBasicVo implements Serializable, Cloneable { ...@@ -23,7 +23,7 @@ public class CandyCouponBasicVo implements Serializable, Cloneable {
private Integer busiType; private Integer busiType;
@ApiModelProperty(value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券 | 101-优先券]") @ApiModelProperty(value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券 | 101-优先券]")
private Integer couType; private Integer couType;
@ApiModelProperty(value = "[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]") @ApiModelProperty(value = "[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]")
private Integer bindType; private Integer bindType;
@ApiModelProperty(value = "折扣") @ApiModelProperty(value = "折扣")
private BigDecimal discount; private BigDecimal discount;
......
...@@ -29,7 +29,7 @@ public class CandyCouponVo implements Serializable, Cloneable { ...@@ -29,7 +29,7 @@ public class CandyCouponVo implements Serializable, Cloneable {
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;
......
...@@ -26,7 +26,7 @@ public class IntegralActivityCouponVo implements Serializable, Cloneable { ...@@ -26,7 +26,7 @@ public class IntegralActivityCouponVo implements Serializable, Cloneable {
private Integer busiType; private Integer busiType;
@ApiModelProperty(value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券 | 101-优先券]") @ApiModelProperty(value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券 | 101-优先券]")
private Integer couType; private Integer couType;
@ApiModelProperty(value = "[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]") @ApiModelProperty(value = "[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]")
private Integer bindType; private Integer bindType;
@ApiModelProperty(value = "折扣") @ApiModelProperty(value = "折扣")
private BigDecimal discount; private BigDecimal discount;
......
...@@ -44,7 +44,7 @@ public class CandyCouponAdminController extends BaseController { ...@@ -44,7 +44,7 @@ public class CandyCouponAdminController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "busiType", value = "业务类别[0-全场|1-演出|2-商品|3-优先购]"), @ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "busiType", value = "业务类别[0-全场|1-演出|2-商品|3-优先购]"),
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "couType", value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]"), @ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "couType", value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "bindType", value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属],多种方式则以,分隔入参"), @ApiImplicitParam(type = "form", required = false, dataType = "String", name = "bindType", value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属],多种方式则以,分隔入参"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "keyword", value = "搜索关键字"), @ApiImplicitParam(type = "form", required = false, dataType = "String", name = "keyword", value = "搜索关键字"),
}) })
@PostMapping("list") @PostMapping("list")
......
...@@ -287,7 +287,7 @@ public class CandyMgtCouponAdminController extends BaseController { ...@@ -287,7 +287,7 @@ public class CandyMgtCouponAdminController extends BaseController {
// } // }
// } // }
switch (buildParam.getBindType()) {// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属] switch (buildParam.getBindType()) {// 领取方式[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]
case 0: case 0:
buildParam.setEventType(0); buildParam.setEventType(0);
buildParam.setEventLimit(null); buildParam.setEventLimit(null);
...@@ -303,8 +303,8 @@ public class CandyMgtCouponAdminController extends BaseController { ...@@ -303,8 +303,8 @@ public class CandyMgtCouponAdminController extends BaseController {
} }
} }
break; break;
case 4:// 新增券领取类型(4-会员专属)处理逻辑同(2-积分兑换 case 4:// 新增券领取类型(4-会员专属)处理逻辑同(2-积分商品
case 2:// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分兑换 case 2:// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分商品
buildParam.setEventType(0); buildParam.setEventType(0);
buildParam.setEventLimit(null); buildParam.setEventLimit(null);
break; break;
......
...@@ -17,6 +17,9 @@ import com.liquidnet.commons.lang.util.IDGenerator; ...@@ -17,6 +17,9 @@ import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.adam.constant.AdamRedisConst; import com.liquidnet.service.adam.constant.AdamRedisConst;
import com.liquidnet.service.adam.dto.vo.AdamMemberRightsCouponRuleVo; import com.liquidnet.service.adam.dto.vo.AdamMemberRightsCouponRuleVo;
import com.liquidnet.service.adam.dto.vo.AdamMemberRightsCouponVo; import com.liquidnet.service.adam.dto.vo.AdamMemberRightsCouponVo;
import com.liquidnet.service.candy.constant.CandyRedisConst;
import com.liquidnet.service.candy.dto.CandyCouponInfoDto;
import com.liquidnet.service.candy.dto.CandyCouponRuleDto;
import com.liquidnet.service.candy.dto.admin.*; import com.liquidnet.service.candy.dto.admin.*;
import com.liquidnet.service.candy.entity.CandyCoupon; import com.liquidnet.service.candy.entity.CandyCoupon;
import com.liquidnet.service.candy.entity.CandyCouponRule; import com.liquidnet.service.candy.entity.CandyCouponRule;
...@@ -25,6 +28,7 @@ import com.liquidnet.service.candy.mapper.CandyCouponMapper; ...@@ -25,6 +28,7 @@ import com.liquidnet.service.candy.mapper.CandyCouponMapper;
import com.liquidnet.service.candy.mapper.CandyMgtCouponMapper; import com.liquidnet.service.candy.mapper.CandyMgtCouponMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -74,7 +78,7 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa ...@@ -74,7 +78,7 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
// initCoupon.setExclusive(1); // initCoupon.setExclusive(1);
// initCoupon.setBusiType(parameter.getBusiType()); // initCoupon.setBusiType(parameter.getBusiType());
// initCoupon.setCouType(parameter.getCouType()); // initCoupon.setCouType(parameter.getCouType());
// initCoupon.setBindType(1);// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属] // initCoupon.setBindType(1);// 领取方式[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]
// //initCoupon.setDiscount(); // //initCoupon.setDiscount();
// initCoupon.setValFace(parameter.getValFace()); // initCoupon.setValFace(parameter.getValFace());
// initCoupon.setValOver(parameter.getValOver()); // initCoupon.setValOver(parameter.getValOver());
...@@ -409,7 +413,7 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa ...@@ -409,7 +413,7 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
initMgtCoupon.setMcouponId(IDGenerator.nextMilliId()); initMgtCoupon.setMcouponId(IDGenerator.nextMilliId());
initMgtCoupon.setCouponId(initCoupon.getCouponId()); initMgtCoupon.setCouponId(initCoupon.getCouponId());
// initMgtCoupon.setState(0); // initMgtCoupon.setState(0);
// initMgtCoupon.setState(initCoupon.getBindType() == 2 ? 1 : 0);// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分兑换),这里根据发放类型设置该记录不执行发放 // initMgtCoupon.setState(initCoupon.getBindType() == 2 ? 1 : 0);// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分商品),这里根据发放类型设置该记录不执行发放
initMgtCoupon.setState(Arrays.asList(2, 4).contains(initCoupon.getBindType()) ? 1 : 0); initMgtCoupon.setState(Arrays.asList(2, 4).contains(initCoupon.getBindType()) ? 1 : 0);
initMgtCoupon.setEventAmt(parameter.getEventAmt()); initMgtCoupon.setEventAmt(parameter.getEventAmt());
initMgtCoupon.setEventType(parameter.getEventType()); initMgtCoupon.setEventType(parameter.getEventType());
...@@ -442,6 +446,18 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa ...@@ -442,6 +446,18 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
throw new LiquidnetServiceException(); throw new LiquidnetServiceException();
} }
List<CandyCouponRuleDto> couponRuleDtoList = new ArrayList<>();
initCouponRuleList.forEach(r -> {
couponRuleDtoList.add(CandyCouponRuleDto.getNew().copy(r));
});
CandyCouponInfoDto couponInfoDto = new CandyCouponInfoDto();
BeanUtils.copyProperties(initCoupon, couponInfoDto);
couponInfoDto.setUseRules(couponRuleDtoList);
String couponInfoDtoKey = CandyRedisConst.BASIC_COUPON_INFO.concat(couponInfoDto.getCouponId());
redisDataSourceUtil.getRedisCandyUtil().set(couponInfoDtoKey, couponInfoDto);
// switch (initCoupon.getExclusive()) { // switch (initCoupon.getExclusive()) {
// case 0: // case 0:
// break; // break;
......
package com.liquidnet.service.candy.dto; package com.liquidnet.service.candy.dto;
import com.liquidnet.service.candy.entity.CandyCouponRule;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -25,4 +26,14 @@ public class CandyCouponRuleDto implements Serializable, Cloneable { ...@@ -25,4 +26,14 @@ public class CandyCouponRuleDto implements Serializable, Cloneable {
return new CandyCouponRuleDto(); return new CandyCouponRuleDto();
} }
} }
public CandyCouponRuleDto copy(CandyCouponRule source) {
if (null == source) return this;
this.setCruleId(source.getCruleId());
this.setCouponId(source.getCouponId());
this.setUseScope(source.getUseScope());
this.setBusiName(source.getBusiName());
this.setBusiId(source.getBusiId());
return this;
}
} }
...@@ -10,7 +10,7 @@ public class CandyCouponListParam { ...@@ -10,7 +10,7 @@ public class CandyCouponListParam {
*/ */
private String keyword; private String keyword;
/** /**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属] * 领取方式[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]
* <p> * <p>
* 多种方式则以,分隔入参 * 多种方式则以,分隔入参
* </p> * </p>
......
...@@ -12,7 +12,7 @@ public class CandyMgtCouponListParam { ...@@ -12,7 +12,7 @@ public class CandyMgtCouponListParam {
*/ */
private String keyword; private String keyword;
/** /**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属] * 领取方式[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]
*/ */
private Integer bindType; private Integer bindType;
/** /**
......
...@@ -65,7 +65,7 @@ public class CandyCoupon implements Serializable { ...@@ -65,7 +65,7 @@ public class CandyCoupon implements Serializable {
private Integer couType; private Integer couType;
/** /**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属] * 领取方式[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]
*/ */
private Integer bindType; private Integer bindType;
......
...@@ -10,7 +10,7 @@ create table candy_mgt_coupon ...@@ -10,7 +10,7 @@ create table candy_mgt_coupon
coupon_id varchar(64) not null comment '~candy_coupon.coupon_id', coupon_id varchar(64) not null comment '~candy_coupon.coupon_id',
state tinyint comment '发放状态[0-未发放|1-已发放|2-无效|3-已取消|9-发放中|10-会员礼包初始模版]', state tinyint comment '发放状态[0-未发放|1-已发放|2-无效|3-已取消|9-发放中|10-会员礼包初始模版]',
# bind_type smallint comment '领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]', # bind_type smallint comment '领取方式[0-用户输入兑换|1-发放至用户|2-积分商品]',
event_amt int comment '发放量', event_amt int comment '发放量',
event_type tinyint comment '发放类型[0-保留|1-会员|2-手机号|10-全体用户]', event_type tinyint comment '发放类型[0-保留|1-会员|2-手机号|10-全体用户]',
event_limit text comment '`发放类型`为2-手机号时发放手机号以,分隔', event_limit text comment '`发放类型`为2-手机号时发放手机号以,分隔',
...@@ -39,7 +39,7 @@ create table candy_coupon ...@@ -39,7 +39,7 @@ create table candy_coupon
exclusive smallint comment '专享标识[0-常规|1-会员礼包]', exclusive smallint comment '专享标识[0-常规|1-会员礼包]',
busi_type smallint comment '业务类别[0-全场|1-演出|2-商品|3-优先购]', busi_type smallint comment '业务类别[0-全场|1-演出|2-商品|3-优先购]',
cou_type smallint comment '券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]', cou_type smallint comment '券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]',
bind_type smallint comment '领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]', bind_type smallint comment '领取方式[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]',
discount decimal(8, 2) comment '折扣[8折即0.8]', discount decimal(8, 2) comment '折扣[8折即0.8]',
val_face decimal(8, 2) comment '面值', val_face decimal(8, 2) comment '面值',
......
...@@ -48,14 +48,15 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C ...@@ -48,14 +48,15 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
private void issueCouponProcessing(final CandyMgtCoupon mgtCoupon, final CandyCoupon coupon) { private void issueCouponProcessing(final CandyMgtCoupon mgtCoupon, final CandyCoupon coupon) {
List<CandyCouponRuleDto> couponRuleDtoList = platformCandyCouponRuleService.listForCouponRuleDto(coupon.getCouponId()); List<CandyCouponRuleDto> couponRuleDtoList = platformCandyCouponRuleService.listForCouponRuleDto(coupon.getCouponId());
CandyCouponInfoDto couponInfoDto = new CandyCouponInfoDto(); // 后台创建券时,同步至REDIS,这里不再同步
BeanUtils.copyProperties(coupon, couponInfoDto); // CandyCouponInfoDto couponInfoDto = new CandyCouponInfoDto();
couponInfoDto.setUseRules(couponRuleDtoList); // BeanUtils.copyProperties(coupon, couponInfoDto);
// couponInfoDto.setUseRules(couponRuleDtoList);
String couponInfoDtoKey = CandyRedisConst.BASIC_COUPON_INFO.concat(couponInfoDto.getCouponId()); //
redisDataSourceUtil.getRedisCandyUtil().set(couponInfoDtoKey, couponInfoDto); // String couponInfoDtoKey = CandyRedisConst.BASIC_COUPON_INFO.concat(couponInfoDto.getCouponId());
// redisDataSourceUtil.getRedisCandyUtil().set(couponInfoDtoKey, couponInfoDto);
switch (coupon.getBindType()) {// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]
switch (coupon.getBindType()) {// 领取方式[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]
case 0: case 0:
this.processingCouponCode(mgtCoupon, coupon); this.processingCouponCode(mgtCoupon, coupon);
break; break;
...@@ -75,9 +76,9 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C ...@@ -75,9 +76,9 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
// break; // break;
// } // }
// break; // break;
case 3:// 新增券领取类型(3-发放需领取)处理逻辑同(1-发放至用户|2-积分兑换 case 3:// 新增券领取类型(3-发放需领取)处理逻辑同(1-发放至用户|2-积分商品
case 4:// 新增券领取类型(4-会员专属)处理逻辑同(1-发放至用户|2-积分兑换 case 4:// 新增券领取类型(4-会员专属)处理逻辑同(1-发放至用户|2-积分商品
case 2:// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分兑换),这里`1-发放至用户|2-积分兑换`做同逻辑处理 case 2:// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分商品),这里`1-发放至用户|2-积分商品`做同逻辑处理
switch (mgtCoupon.getEventType()) {// 发放类型[1-会员|2-手机号|10-全体用户] switch (mgtCoupon.getEventType()) {// 发放类型[1-会员|2-手机号|10-全体用户]
case 1: case 1:
this.processForAllMember(mgtCoupon, coupon, couponRuleDtoList); this.processForAllMember(mgtCoupon, coupon, couponRuleDtoList);
......
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