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

Commit e00a7329 authored by 张国柄's avatar 张国柄

PM临时+券发放类型:积分兑换;

parent db74e1d0
...@@ -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-发放至用户]', # 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-发放至用户]', 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-发放至用户]", allowableValues = "0,1") // @ApiModelProperty(required = true, value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]", allowableValues = "0,1")
// 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;
......
...@@ -28,7 +28,7 @@ public class CandyMgtCouponBuildParam { ...@@ -28,7 +28,7 @@ public class CandyMgtCouponBuildParam {
@ApiModelProperty(required = true, value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]", allowableValues = "1,2,3,4,101") @ApiModelProperty(required = true, value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]", allowableValues = "1,2,3,4,101")
private Integer couType; private Integer couType;
@NotNull(message = "券领取方式不能为空") @NotNull(message = "券领取方式不能为空")
@ApiModelProperty(required = true, value = "领取方式[0-用户输入兑换|1-发放至用户]", allowableValues = "0,1") @ApiModelProperty(required = true, value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]", allowableValues = "0,1,2")
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;
......
...@@ -161,6 +161,9 @@ public class CandyMgtCouponAdminController extends BaseController { ...@@ -161,6 +161,9 @@ public class CandyMgtCouponAdminController extends BaseController {
@ResponseBody @ResponseBody
public AjaxResult addSave(@RequestBody @Validated CandyMgtCouponBuildParam buildParam) { public AjaxResult addSave(@RequestBody @Validated CandyMgtCouponBuildParam buildParam) {
logger.info("operator:{},buildParam:{}", ShiroUtils.getLoginName(), JsonUtils.toJson(buildParam)); logger.info("operator:{},buildParam:{}", ShiroUtils.getLoginName(), JsonUtils.toJson(buildParam));
if (buildParam.getBindType() == 1 && buildParam.getEventType() == 2 && StringUtils.isBlank(buildParam.getEventLimit())) {
buildParam.setBindType(2);// TODO: 2021/11/9 PM上线前两天临时加的发放类型,页面交互只做逻辑实现,这里根据条件纠正`bindType`
}
AjaxResult ajaxResult = this.buildValidProcessing(buildParam); AjaxResult ajaxResult = this.buildValidProcessing(buildParam);
if (((int) ajaxResult.get(AjaxResult.CODE_TAG)) != 0) { if (((int) ajaxResult.get(AjaxResult.CODE_TAG)) != 0) {
return ajaxResult; return ajaxResult;
...@@ -243,18 +246,42 @@ public class CandyMgtCouponAdminController extends BaseController { ...@@ -243,18 +246,42 @@ public class CandyMgtCouponAdminController extends BaseController {
buildParam.setCouponRuleList(null); buildParam.setCouponRuleList(null);
} }
if (0 == buildParam.getBindType()) { // if (0 == buildParam.getBindType()) {
buildParam.setEventType(0); // buildParam.setEventType(0);
buildParam.setEventLimit(null); // buildParam.setEventLimit(null);
if (null == buildParam.getRedeemValidity()) { // if (null == buildParam.getRedeemValidity()) {
return AjaxResult.warn("兑换有效期无效"); // return AjaxResult.warn("兑换有效期无效");
} // }
} else { // } else {
if (buildParam.getEventType() == 2) {// 指定用户手机号 // if (buildParam.getEventType() == 2) {// 指定用户手机号
if (StringUtils.isBlank(buildParam.getEventLimit())) { // if (StringUtils.isBlank(buildParam.getEventLimit())) {
return AjaxResult.warn("请指定手机号"); // return AjaxResult.warn("请指定手机号");
// }
// }
// }
switch (buildParam.getBindType()) {// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]
case 0:
buildParam.setEventType(0);
buildParam.setEventLimit(null);
if (null == buildParam.getRedeemValidity()) {
return AjaxResult.warn("兑换有效期无效");
} }
} break;
case 1:
if (buildParam.getEventType() == 2) {// 指定用户手机号
if (StringUtils.isBlank(buildParam.getEventLimit())) {
return AjaxResult.warn("请指定手机号");
}
}
break;
case 2:
buildParam.setEventType(0);
buildParam.setEventLimit(null);
break;
default:
logger.warn("Invalid operation[buildParam.bindType={}]", buildParam.getBindType());
return this.error(AjaxResult.Type.WARN, "券领取方式无效");
} }
return AjaxResult.success(); return AjaxResult.success();
} }
......
...@@ -73,7 +73,7 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa ...@@ -73,7 +73,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-发放至用户] initCoupon.setBindType(1);// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]
//initCoupon.setDiscount(); //initCoupon.setDiscount();
initCoupon.setValFace(parameter.getValFace()); initCoupon.setValFace(parameter.getValFace());
initCoupon.setValOver(parameter.getValOver()); initCoupon.setValOver(parameter.getValOver());
...@@ -253,7 +253,8 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa ...@@ -253,7 +253,8 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
CandyMgtCoupon initMgtCoupon = new CandyMgtCoupon(); CandyMgtCoupon initMgtCoupon = new CandyMgtCoupon();
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上线前两天临时加的发放类型,页面交互只做逻辑实现,这里根据条件设置该记录不执行发放逻辑
initMgtCoupon.setEventAmt(parameter.getEventAmt()); initMgtCoupon.setEventAmt(parameter.getEventAmt());
initMgtCoupon.setEventType(parameter.getEventType()); initMgtCoupon.setEventType(parameter.getEventType());
initMgtCoupon.setEventLimit(parameter.getEventLimit()); initMgtCoupon.setEventLimit(parameter.getEventLimit());
......
...@@ -12,7 +12,7 @@ public class CandyMgtCouponListParam { ...@@ -12,7 +12,7 @@ public class CandyMgtCouponListParam {
*/ */
private String keyword; private String keyword;
/** /**
* 领取方式[0-用户输入兑换|1-发放至用户] * 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]
*/ */
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-发放至用户] * 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]
*/ */
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-发放至用户]', # 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-发放至用户]', 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 '面值',
......
...@@ -55,7 +55,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C ...@@ -55,7 +55,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
String couponInfoDtoKey = CandyRedisConst.BASIC_COUPON_INFO.concat(couponInfoDto.getCouponId()); String couponInfoDtoKey = CandyRedisConst.BASIC_COUPON_INFO.concat(couponInfoDto.getCouponId());
redisDataSourceUtil.getRedisCandyUtil().set(couponInfoDtoKey, couponInfoDto); redisDataSourceUtil.getRedisCandyUtil().set(couponInfoDtoKey, couponInfoDto);
switch (coupon.getBindType()) {// 领取方式[0-用户输入兑换|1-发放至用户] switch (coupon.getBindType()) {// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]
case 0: case 0:
this.processingCouponCode(mgtCoupon, coupon); this.processingCouponCode(mgtCoupon, coupon);
break; break;
......
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