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

Commit 6dcf58a5 authored by liuran's avatar liuran

Merge remote-tracking branch 'origin/dev_20211205' into dev_20211205

parents c2202343 281bdb3e
......@@ -41,7 +41,7 @@ public class CandyMemberCouponBuildParam {
@ApiModelProperty(required = true, value = "券类型[1-代金券|2-满减券|101-优先券]", allowableValues = "1,2,101")
private Integer couType;
// @NotNull(message = "券领取方式不能为空")
// @ApiModelProperty(required = true, value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取]", allowableValues = "0,1,2,3")
// @ApiModelProperty(required = true, value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]", allowableValues = "0,1,2,3,4")
// private Integer bindType;
// @ApiModelProperty(required = false, value = "折扣[8折即0.8]", example = "0.8")
// private BigDecimal discount;
......
......@@ -72,7 +72,7 @@ public class CandyMgtCouponBuildParam {
@Min(value = 1, message = "发放量不能小于1")
@ApiModelProperty(required = true, value = "发放量", example = "1")
private Integer eventAmt;
@ApiModelProperty(required = false, value = "发放类型[0-保留|1-会员|2-手机号|10-全体用户]", allowableValues = "0,1,2,10")
@ApiModelProperty(required = false, value = "发放类型[0-保留|1-会员|2-手机号10-全体用户]", allowableValues = "0,1,2,10")
private Integer eventType;
@ApiModelProperty(required = false, value = "`发放类型`为2-手机号时发放手机号以,分隔", example = "18510957291,17701223310")
private String eventLimit;
......
......@@ -36,8 +36,14 @@ public class SweetStrawberryParam implements Serializable {
@NotBlank(message = "cityCode不能为空")
private String cityCode;
@ApiModelProperty(position = 10, required = true, value = "customText", example = "customText")
@NotBlank(message = "customText不能为空")
private String customText;
@Valid
@ApiModelProperty(value = "阵容列表", example = "")
@ApiModelProperty(value = "阵容列表", example = "[{\"lineup\": [{\"lineupNum\": \"lineup1\", \"musicianId\": 9999, \"musicianName\": \"歌手1\"},\n" +
"{\"lineupNum\": \"lineup1\",\"musicianId\": 23233,\"musicianName\": \"歌手D\"}]},\n" +
"{\"lineup\": [{ \"lineupNum\": \"lineup2\",\"musicianId\": 1111,\"musicianName\": \"歌手2\"}]}]")
@NotNull(message = "musicianList")
private List<SweetStrawListParam> musicianList;
......@@ -50,7 +56,4 @@ public class SweetStrawberryParam implements Serializable {
return new SweetStrawberryParam();
}
}
}
}
\ No newline at end of file
......@@ -34,6 +34,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -248,6 +249,32 @@ public class AdamMemberAdminController extends BaseController {
@PostMapping("edit_coupon")
@ResponseBody
public AjaxResult editCoupon(@RequestBody @Validated CandyMemberCouponMatchParam parameter) {
switch (parameter.getBusiType()) {// 券类别类型配置校验
case 0:
case 1:
if (!Arrays.asList(1, 2).contains(parameter.getCouType())) {
String msg = String.format("会员券类别【%s】", parameter.getBusiType() == 0 ? "全场" : "演出");
logger.warn("{}暂不支持所选券类型[{}]", msg, parameter.getCouType());
return this.error(AjaxResult.Type.WARN, String.format("%s暂不支持所选券类型", msg));
}
break;
case 2:
if (!Arrays.asList(1, 2, 3).contains(parameter.getCouType())) {
logger.warn("券类别【商品】暂不支持所选券类型[{}]", parameter.getCouType());
return this.error(AjaxResult.Type.WARN, "会员券类别【商品】暂不支持所选券类型");
}
break;
case 3:
if (101 != parameter.getCouType()) {
logger.warn("会员券类别【优先购买】暂不支持所选券类型[{}]", parameter.getCouType());
return this.error(AjaxResult.Type.WARN, "会员券类别【优先购买】暂不支持所选券类型");
}
break;
default:
logger.warn("Invalid argument[parameter.busiType={}]", parameter.getBusiType());
return this.error(AjaxResult.Type.WARN, "无效的券类别");
}
LambdaQueryWrapper<AdamMemberRights> memberRightsLambdaQueryWrapper = Wrappers.lambdaQuery();
memberRightsLambdaQueryWrapper.eq(AdamMemberRights::getMrightsId, parameter.getMrightsId());
memberRightsLambdaQueryWrapper.eq(AdamMemberRights::getState, 1);
......
......@@ -8,11 +8,14 @@ import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponAdminService;
import com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponRuleAdminService;
import com.liquidnet.service.candy.dto.admin.CandyCouponFilterDto;
import com.liquidnet.service.candy.dto.admin.CandyCouponListParam;
import com.liquidnet.service.candy.dto.admin.CandyCouponTemplateDto;
import com.liquidnet.service.candy.entity.CandyCoupon;
import com.liquidnet.service.candy.entity.CandyCouponRule;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -22,7 +25,11 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@Api(tags = "我的券包")
@Controller
......@@ -35,10 +42,17 @@ public class CandyCouponAdminController extends BaseController {
ICandyCouponRuleAdminService candyCouponRuleAdminService;
@ApiOperation(value = "券列表")
@ApiImplicitParams({
@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 = "String", name = "bindType", value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属],多种方式则以,分隔入参"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "keyword", value = "搜索关键字"),
})
@PostMapping("list")
@ResponseBody
public TableDataInfo list(CandyCouponListParam listParam) {
LambdaQueryWrapper<CandyCoupon> queryWrapper = Wrappers.lambdaQuery(CandyCoupon.class);
queryWrapper.eq(CandyCoupon::getState, 1);
queryWrapper.select(CandyCoupon::getCouponId, CandyCoupon::getTitle);
queryWrapper.orderByDesc(CandyCoupon::getCreatedAt);
......@@ -52,13 +66,26 @@ public class CandyCouponAdminController extends BaseController {
if (null != listParam.getCouType()) {
queryWrapper.eq(CandyCoupon::getCouType, listParam.getCouType());
}
if (null != listParam.getBindType()) {
queryWrapper.eq(CandyCoupon::getBindType, listParam.getBindType());
// if (null != listParam.getBindType()) {
// queryWrapper.eq(CandyCoupon::getBindType, listParam.getBindType());
// }
if (null != listParam.getBindType() && Pattern.matches("^[\\d,]*$", listParam.getBindType())) {
String[] bindTypeArr = listParam.getBindType().split(",");
if (bindTypeArr.length > 0) {
queryWrapper.in(CandyCoupon::getBindType, Arrays.stream(bindTypeArr).toArray());
}
}
}
startPage();
return getDataTable(candyCouponAdminService.list(queryWrapper));
List<CandyCoupon> list = candyCouponAdminService.list(queryWrapper);
TableDataInfo dataTable = getDataTable(list);
List<CandyCouponFilterDto> dtoList = new ArrayList<>();
list.forEach(r -> {
dtoList.add(CandyCouponFilterDto.getNew().copy(r));
});
dataTable.setRows(dtoList);
return dataTable;
}
@ApiOperation(value = "券详情")
......
......@@ -279,7 +279,7 @@ public class CandyMgtCouponAdminController extends BaseController {
// }
// }
switch (buildParam.getBindType()) {// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取]
switch (buildParam.getBindType()) {// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]
case 0:
buildParam.setEventType(0);
buildParam.setEventLimit(null);
......@@ -295,6 +295,7 @@ public class CandyMgtCouponAdminController extends BaseController {
}
}
break;
case 4:// 新增券领取类型(4-会员专属)处理逻辑同(2-积分兑换)
case 2:// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分兑换)
buildParam.setEventType(0);
buildParam.setEventLimit(null);
......
......@@ -14,7 +14,7 @@
margin-bottom: 20px;
}
#searchIpt {
display: none;
/* display: none; */
}
.phoneNumber,.playMethod {
display: none;
......@@ -158,15 +158,15 @@
<div id="scoreType" class="main_type">
<span class="labelName"><i class="required">*</i>类别:</span>
<div class="layui-input-block" style="display: flex">
<input type="radio" value="0" name="selectType" checked><span>商品</span>
<input type="radio" value="1" name="selectType"><span></span>
<!-- <input type="radio" value="0" name="selectType" checked><span>商品</span> -->
<input type="radio" value="1" name="selectType" checked><span></span>
</div>
</div>
<div class="scope_application" id="scope_application">
<span class="labelName"><i class="required">*</i>券名称:</span>
<div class="search_ipt" style="position: relative;display: inline;">
<input type="text" id="searchIpt" autocomplete="off" class="layui-input" placeholder="全部">
<input type="text" id="searchIptMall" autocomplete="off" class="layui-input" placeholder="全部">
<!-- <input type="text" id="searchIptMall" autocomplete="off" class="layui-input" placeholder="全部"> -->
<ul id="dataList" style="position: absolute;"></ul>
</div>
</div>
......@@ -278,8 +278,9 @@
let showPicture = ''; // 展示图片
let limit = ''; // 限兑次数
let itemId = ''; //
let selectType = ''
let selectType = '1'
let type = '';
console.log('检测')
$(document).ready(function() {
var $summernote = $('#summernote').summernote({
height: 300,
......@@ -551,7 +552,7 @@
delete data.endTime
}
if (selectType == 1) {
delete data.targetId
// delete data.targetId
data['type'] = 1
} else {
data['type'] = 11
......
......@@ -33,6 +33,7 @@ import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Slf4j
......@@ -73,7 +74,7 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
// initCoupon.setExclusive(1);
// initCoupon.setBusiType(parameter.getBusiType());
// initCoupon.setCouType(parameter.getCouType());
// initCoupon.setBindType(1);// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取]
// initCoupon.setBindType(1);// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]
// //initCoupon.setDiscount();
// initCoupon.setValFace(parameter.getValFace());
// initCoupon.setValOver(parameter.getValOver());
......@@ -228,6 +229,7 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
mgtCouponOper.setEventType(2);
//mgtCouponOper.setEventLimit();
//mgtCouponOper.setEventAt();
mgtCouponOper.setExclusively(1);
mgtCouponOper.setOperator(operator);
mgtCouponOper.setCreatedAt(nowTime);
......@@ -298,6 +300,7 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
mgtCouponOper.setState(10);// 发放状态[0-未发放|1-已发放|2-无效|9-发放中|10-会员礼包初始模版]
mgtCouponOper.setEventAmt(parameter.getEventAmt());
mgtCouponOper.setEventType(2);
mgtCouponOper.setExclusively(1);
mgtCouponOper.setOperator(operator);
mgtCouponOper.setCreatedAt(nowTime);
......@@ -406,7 +409,8 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
initMgtCoupon.setMcouponId(IDGenerator.nextMilliId());
initMgtCoupon.setCouponId(initCoupon.getCouponId());
// 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.setEventAmt(parameter.getEventAmt());
initMgtCoupon.setEventType(parameter.getEventType());
initMgtCoupon.setEventLimit(parameter.getEventLimit());
......
......@@ -19,7 +19,7 @@ public class CandyCommonCouponBasicDto implements Serializable ,Cloneable{
private String title;
private String label;
private String notice;
private Integer exclusive;
//private Integer exclusive;
private Integer busiType;
private Integer couType;
private Integer bindType;
......@@ -44,6 +44,7 @@ public class CandyCommonCouponBasicDto implements Serializable ,Cloneable{
private String ccouponId;
private String mcouponId;
//private String couponId;
private Integer exclusive;
private Integer state;
private Integer ranged;
//private String operator;
......@@ -71,7 +72,7 @@ public class CandyCommonCouponBasicDto implements Serializable ,Cloneable{
this.setTitle(coupon.getTitle());
this.setLabel(coupon.getLabel());
this.setNotice(coupon.getNotice());
this.setExclusive(coupon.getExclusive());
//this.setExclusive(coupon.getExclusive());
this.setBusiType(coupon.getBusiType());
this.setCouType(coupon.getCouType());
this.setBindType(coupon.getBindType());
......@@ -90,6 +91,7 @@ public class CandyCommonCouponBasicDto implements Serializable ,Cloneable{
this.setCcouponId(commonCoupon.getCcouponId());
this.setMcouponId(commonCoupon.getMcouponId());
this.setExclusive(commonCoupon.getExclusive());
this.setState(commonCoupon.getState());
this.setRanged(commonCoupon.getRanged());
this.setCreatedAt(commonCoupon.getCreatedAt());
......
......@@ -19,7 +19,7 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable {
private String title;
private String label;
private String notice;
private Integer exclusive;
//private Integer exclusive;
private Integer busiType;
private Integer couType;
private Integer bindType;
......@@ -45,6 +45,7 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable {
private String mcouponId;
private String uid;
//private String couponId;
private Integer exclusive;
private Integer state;
private String ccode;
private LocalDateTime bindAt;
......@@ -77,7 +78,7 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable {
this.setTitle(coupon.getTitle());
this.setLabel(coupon.getLabel());
this.setNotice(coupon.getNotice());
this.setExclusive(coupon.getExclusive());
//this.setExclusive(coupon.getExclusive());
this.setBusiType(coupon.getBusiType());
this.setCouType(coupon.getCouType());
this.setBindType(coupon.getBindType());
......@@ -95,6 +96,7 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable {
this.setUcouponId(userCoupon.getUcouponId());
this.setMcouponId(userCoupon.getMcouponId());
this.setUid(userCoupon.getUid());
this.setExclusive(userCoupon.getExclusive());
this.setState(userCoupon.getState());
this.setCcode(userCoupon.getCcode());
this.setBindAt(userCoupon.getBindAt());
......
package com.liquidnet.service.candy.dto.admin;
import com.liquidnet.service.candy.entity.CandyCoupon;
import lombok.Data;
import java.io.Serializable;
@Data
public class CandyCouponFilterDto implements Serializable, Cloneable {
private static final long serialVersionUID = -3287018184399499549L;
private String couponId;
private String title;
private static final CandyCouponFilterDto obj = new CandyCouponFilterDto();
public static CandyCouponFilterDto getNew() {
try {
return (CandyCouponFilterDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new CandyCouponFilterDto();
}
}
public CandyCouponFilterDto copy(CandyCoupon source) {
if (null == source) return this;
this.setCouponId(source.getCouponId());
this.setTitle(source.getTitle());
return this;
}
}
......@@ -10,9 +10,12 @@ public class CandyCouponListParam {
*/
private String keyword;
/**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取]
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]
* <p>
* 多种方式则以,分隔入参
* </p>
*/
private Integer bindType;
private String bindType;
/**
* 业务类别[0-全场|1-演出|2-商品|3-优先购]
*/
......@@ -34,11 +37,11 @@ public class CandyCouponListParam {
this.keyword = keyword;
}
public Integer getBindType() {
public String getBindType() {
return bindType;
}
public void setBindType(Integer bindType) {
public void setBindType(String bindType) {
this.bindType = bindType;
}
......
......@@ -12,7 +12,7 @@ public class CandyMgtCouponListParam {
*/
private String keyword;
/**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取]
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]
*/
private Integer bindType;
/**
......
......@@ -37,6 +37,18 @@ public class CandyCommonCoupon implements Serializable {
*/
private String couponId;
/**
* 专享标识[0-常规|1-会员专属]
* <p>
* 变更前:`candy_coupon.exclusive`用于根据会员有效期设置券有效期及标识用户端券分类(普通券、会员券等);
* 变更后:
* 原`candy_coupon.exclusive`废除
* 实际发放逻辑中,原标识"是否根据会员有效期设置券有效期"的`candy_coupon.exclusive`字段改为`candy_mgt_coupon.exclusively`
* 在`candy_user_coupon`及`candy_common_coupon`中添加`exclusive`字段,发放时直接由`candy_mgt_coupon.exclusively`赋值该属性
* </p>
*/
private Integer exclusive;
/**
* 公有券状态[1-可用|2-无效|3-已过期]
*/
......
......@@ -65,7 +65,7 @@ public class CandyCoupon implements Serializable {
private Integer couType;
/**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取]
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]
*/
private Integer bindType;
......
......@@ -2,11 +2,12 @@ package com.liquidnet.service.candy.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 券发放管理
......@@ -59,8 +60,11 @@ public class CandyMgtCoupon implements Serializable {
/**
* 专享标识[0-常规|1-会员专属]
* <p>
* 同`candy_coupon.exclusive`,按实际需求场景灵活使用;
* 目前`candy_coupon.exclusive`用于根据会员有效期设置券有效期;
* 变更前:`candy_coupon.exclusive`用于根据会员有效期设置券有效期及标识用户端券分类(普通券、会员券等);
* 变更后:
* 原`candy_coupon.exclusive`废除
* 实际发放逻辑中,原标识"是否根据会员有效期设置券有效期"的`candy_coupon.exclusive`字段改为`candy_mgt_coupon.exclusively`
* 在`candy_user_coupon`及`candy_common_coupon`中添加`exclusive`字段,发放时直接由`candy_mgt_coupon.exclusively`赋值该属性
* </p>
*/
private Integer exclusively;
......
......@@ -43,6 +43,18 @@ public class CandyUserCoupon implements Serializable,Cloneable {
*/
private String couponId;
/**
* 专享标识[0-常规|1-会员专属]
* <p>
* 变更前:`candy_coupon.exclusive`用于根据会员有效期设置券有效期及标识用户端券分类(普通券、会员券等);
* 变更后:
* 原`candy_coupon.exclusive`废除
* 实际发放逻辑中,原标识"是否根据会员有效期设置券有效期"的`candy_coupon.exclusive`字段改为`candy_mgt_coupon.exclusively`
* 在`candy_user_coupon`及`candy_common_coupon`中添加`exclusive`字段,发放时直接由`candy_mgt_coupon.exclusively`赋值该属性
* </p>
*/
private Integer exclusive;
/**
* 用户券状态[1-可用|2-无效|3-已过期|5-已使用]
*/
......
......@@ -8,7 +8,7 @@
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="label" jdbcType="VARCHAR" property="label"/>
<result column="notice" jdbcType="VARCHAR" property="notice"/>
<result column="exclusive" jdbcType="SMALLINT" property="exclusive"/>
<!-- <result column="exclusive" jdbcType="SMALLINT" property="exclusive"/>-->
<result column="busi_type" jdbcType="SMALLINT" property="busiType"/>
<result column="cou_type" jdbcType="SMALLINT" property="couType"/>
<result column="bind_type" jdbcType="SMALLINT" property="bindType"/>
......@@ -32,6 +32,7 @@
<result column="ccoupon_id" jdbcType="VARCHAR" property="ccouponId"/>
<result column="mcoupon_id" jdbcType="VARCHAR" property="mcouponId"/>
<!-- <result column="coupon_id" jdbcType="VARCHAR" property="couponId" />-->
<result column="exclusive" jdbcType="SMALLINT" property="exclusive"/>
<result column="state" jdbcType="TINYINT" property="state"/>
<result column="ranged" jdbcType="TINYINT" property="ranged"/>
<!-- <result column="operator" jdbcType="VARCHAR" property="operator" />-->
......@@ -41,11 +42,11 @@
</resultMap>
<sql id="Rst_CommonCouponBasicDto_Column_List">
cc.coupon_id, cc.title, cc.`label`, cc.notice, cc.`exclusive`, cc.busi_type, cc.cou_type, cc.bind_type,
cc.coupon_id, cc.title, cc.`label`, cc.notice, cc.busi_type, cc.cou_type, cc.bind_type,
cc.discount, cc.val_face, cc.val_over, cc.val_minus, cc.`overlay`, cc.overlay_level,
cc.validity, cc.redeem_validity, cc.redeem_start, cc.redeem_stop, cc.effect_at, cc.expire_at,
ccc.ccoupon_id, ccc.mcoupon_id, ccc.`state`, ccc.ranged, ccc.created_at
ccc.ccoupon_id, ccc.mcoupon_id, ccc.`exclusive`, ccc.`state`, ccc.ranged, ccc.created_at
</sql>
<select id="selectMultiForCommonCouponBasicDto" resultMap="Rst_CommonCouponBasicDto">
......
......@@ -8,7 +8,7 @@
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="label" jdbcType="VARCHAR" property="label"/>
<result column="notice" jdbcType="VARCHAR" property="notice"/>
<result column="exclusive" jdbcType="SMALLINT" property="exclusive"/>
<!-- <result column="exclusive" jdbcType="SMALLINT" property="exclusive"/>-->
<result column="busi_type" jdbcType="SMALLINT" property="busiType"/>
<result column="cou_type" jdbcType="SMALLINT" property="couType"/>
<result column="bind_type" jdbcType="SMALLINT" property="bindType"/>
......@@ -33,6 +33,7 @@
<!-- <result column="mcoupon_id" jdbcType="VARCHAR" property="mcouponId" />-->
<result column="uid" jdbcType="VARCHAR" property="uid"/>
<!-- <result column="coupon_id" jdbcType="VARCHAR" property="couponId" />-->
<result column="exclusive" jdbcType="SMALLINT" property="exclusive"/>
<result column="state" jdbcType="TINYINT" property="state"/>
<result column="ccode" jdbcType="VARCHAR" property="ccode"/>
<result column="bind_at" jdbcType="TIMESTAMP" property="bindAt"/>
......@@ -43,11 +44,11 @@
</resultMap>
<sql id="Rst_UserCouponBasicDto_Column_List">
cc.coupon_id, cc.title, cc.`label`, cc.notice, cc.`exclusive`, cc.busi_type, cc.cou_type, cc.bind_type,
cc.coupon_id, cc.title, cc.`label`, cc.notice, cc.busi_type, cc.cou_type, cc.bind_type,
cc.discount, cc.val_face, cc.val_over, cc.val_minus, cc.`overlay`, cc.overlay_level,
cc.validity, cc.redeem_validity, cc.redeem_start, cc.redeem_stop,
cuc.ucoupon_id, cuc.mcoupon_id, cuc.`uid`, cuc.`state`, cuc.ccode, cuc.bind_at, cuc.dued_at, cuc.used_at, cuc.used_for
cuc.ucoupon_id, cuc.mcoupon_id, cuc.`uid`, cuc.`exclusive`, cuc.`state`, cuc.ccode, cuc.bind_at, cuc.dued_at, cuc.used_at, cuc.used_for
</sql>
<select id="selectMultiForUserCouponBasicDto" resultMap="Rst_UserCouponBasicDto">
......
......@@ -166,7 +166,7 @@ public class AdamUserInfoServiceImpl implements IAdamUserInfoService {
adamRdmService.setUserInfoVoByUid(existUserInfoVo.getUid(), existUserInfoVo);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
String sexStr = JsonUtils.toJson(existUserInfoVo.getSex());
String sexStr = null == existUserInfoVo.getSex() ? null : JsonUtils.toJson(existUserInfoVo.getSex());
String tagMeStr = JsonUtils.toJson(tagMe);
if (syncChimeFlg || null == beforeSex || (null != parameter.getSex() && !parameter.getSex().getVal().equals(beforeSex.getVal()))) {
ResponseDto<String> chimeRegisterRstFlg = null;
......
......@@ -39,7 +39,7 @@ create table candy_coupon
exclusive smallint comment '专享标识[0-常规|1-会员礼包]',
busi_type smallint comment '业务类别[0-全场|1-演出|2-商品|3-优先购]',
cou_type smallint comment '券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]',
bind_type smallint comment '领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取]',
bind_type smallint comment '领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]',
discount decimal(8, 2) comment '折扣[8折即0.8]',
val_face decimal(8, 2) comment '面值',
......@@ -151,8 +151,16 @@ create table candy_common_coupon
comment varchar(255)
) engine = InnoDB comment '公有券信息';
-- >>------------------------------------------------------------------------------------|20211125会员券发放调整
# `candy_coupon.exclusive`,按实际需求场景灵活使用,目前`candy_coupon.exclusive`用于根据会员有效期设置券有效期;
alter table candy_mgt_coupon add exclusively int default 0 null comment '专享标识[0-常规|1-会员专属]' after event_at;
# 专享标识[0-常规|1-会员专属]
# <p>
# 变更前:`candy_coupon.exclusive`用于根据会员有效期设置券有效期及标识用户端券分类(普通券、会员券等);
# 变更后:
# `candy_coupon.exclusive`废除
# 实际发放逻辑中,原标识"是否根据会员有效期设置券有效期"`candy_coupon.exclusive`字段改为`candy_mgt_coupon.exclusively`
# `candy_user_coupon``candy_common_coupon`中添加`exclusive`字段,发放时直接由`candy_mgt_coupon.exclusively`赋值该属性
alter table candy_mgt_coupon add exclusively smallint default 0 null comment '专享标识[0-常规|1-会员专属]' after event_at;
alter table candy_user_coupon add exclusive smallint null comment '专享标识[0-常规|1-会员礼包]' after coupon_id;
alter table candy_common_coupon add exclusive smallint null comment '专享标识[0-常规|1-会员礼包]' after coupon_id;
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
......
......@@ -35,7 +35,7 @@ public class ConsumerSweetPosterRdsReceiverConfig {
/*
*
* */
private Subscription receiveSqlRemind(StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer, int t) {
private Subscription posterSqlRemind(StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer, int t) {
return listenerContainer.receiveAutoAck(
Consumer.from(SWEET_POSTER.getGroup(), SWEET_POSTER.name() + t),
StreamOffset.create(SWEET_POSTER.getKey(), ReadOffset.lastConsumed()), consumerSweetPosterRdsReceiver
......@@ -44,7 +44,7 @@ public class ConsumerSweetPosterRdsReceiverConfig {
@Bean
public Subscription subscriptionSqlRemind(RedisConnectionFactory factory) {
var listenerContainer = this.buildStreamMessageListenerContainer(factory);
var subscription = receiveSqlRemind(listenerContainer, 1);
var subscription = posterSqlRemind(listenerContainer, 1);
listenerContainer.start();
return subscription;
}
......@@ -52,7 +52,7 @@ public class ConsumerSweetPosterRdsReceiverConfig {
@Bean
public Subscription subscriptionSqlRemind2(RedisConnectionFactory factory) {
var listenerContainer = this.buildStreamMessageListenerContainer(factory);
var subscription = receiveSqlRemind(listenerContainer, 1);
var subscription = posterSqlRemind(listenerContainer, 1);
listenerContainer.start();
return subscription;
}
......@@ -60,7 +60,7 @@ public class ConsumerSweetPosterRdsReceiverConfig {
@Bean
public Subscription subscriptionSqlRemind3(RedisConnectionFactory factory) {
var listenerContainer = this.buildStreamMessageListenerContainer(factory);
var subscription = receiveSqlRemind(listenerContainer, 1);
var subscription = posterSqlRemind(listenerContainer, 1);
listenerContainer.start();
return subscription;
}
......
......@@ -55,7 +55,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
String couponInfoDtoKey = CandyRedisConst.BASIC_COUPON_INFO.concat(couponInfoDto.getCouponId());
redisDataSourceUtil.getRedisCandyUtil().set(couponInfoDtoKey, couponInfoDto);
switch (coupon.getBindType()) {// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取]
switch (coupon.getBindType()) {// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]
case 0:
this.processingCouponCode(mgtCoupon, coupon);
break;
......@@ -76,6 +76,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
// }
// break;
case 3:// 新增券领取类型(3-发放需领取)处理逻辑同(1-发放至用户|2-积分兑换)
case 4:// 新增券领取类型(4-会员专属)处理逻辑同(1-发放至用户|2-积分兑换)
case 2:// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分兑换),这里`1-发放至用户|2-积分兑换`做同逻辑处理
switch (mgtCoupon.getEventType()) {// 发放类型[1-会员|2-手机号|10-全体用户]
case 1:
......@@ -161,6 +162,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
commonCoupon.setCcouponId(IDGenerator.nextTimeId2());
commonCoupon.setMcouponId(mgtCoupon.getMcouponId());
commonCoupon.setCouponId(coupon.getCouponId());
commonCoupon.setExclusive(mgtCoupon.getExclusively());
commonCoupon.setState(1);
commonCoupon.setRanged(mgtCoupon.getEventType());
commonCoupon.setOperator("system");
......@@ -211,7 +213,8 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
log.info("发放券处理中:目标全体会员[总数:{},发放量:{}]", userMemberCount, eventAmt);
// 会员权益券失效时间duedAt需要同步会员到期时间expiryAt
boolean isMemberRightsCoupon = coupon.getExclusive() == 1;
Integer exclusively = mgtCoupon.getExclusively();
boolean isMemberRightsCoupon = exclusively == 1;
queryWrapper.select(AdamUserMember::getUid).orderByAsc(AdamUserMember::getMid);
while (totalCount > 0) {
initUserCouponList.clear();
......@@ -231,6 +234,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
userCoupon.setMcouponId(mgtCoupon.getMcouponId());
userCoupon.setUid(userMember.getUid());
userCoupon.setCouponId(coupon.getCouponId());
userCoupon.setExclusive(exclusively);
userCoupon.setState(1);
userCoupon.setBindAt(coupon.getEffectAt());
// userCoupon.setDuedAt(coupon.getExpireAt());
......@@ -292,7 +296,8 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
AbstractRedisUtil redisAdamUtil = redisDataSourceUtil.getRedisAdamUtil();
// 指定手机号发放券中,会员权益券失效时间duedAt需要同步会员到期时间expiryAt
boolean isMemberRightsCoupon = coupon.getExclusive() == 1;
Integer exclusively = mgtCoupon.getExclusively();
boolean isMemberRightsCoupon = exclusively == 1;
for (int i = 0; i < eventAmt; i++) {
for (String r : eventLimitArr) {
String uid = (String) redisAdamUtil.get(AdamRedisConst.IDENTITY_MOBILE.concat(r));
......@@ -303,6 +308,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
userCoupon.setMcouponId(mgtCoupon.getMcouponId());
userCoupon.setUid(uid);
userCoupon.setCouponId(coupon.getCouponId());
userCoupon.setExclusive(exclusively);
userCoupon.setState(1);
userCoupon.setBindAt(coupon.getEffectAt());
......
......@@ -8,6 +8,8 @@ CREATE TABLE `sweet_strawberry_poster`
`union_id` varchar(200) NOT NULL DEFAULT '' COMMENT 'union_id',
`nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '姓名',
`city_name` varchar(255) NOT NULL DEFAULT '' COMMENT '城市',
`city_code` varchar(255) NOT NULL DEFAULT '' COMMENT '城市code',
`custom_text` varchar(255) NOT NULL DEFAULT '' COMMENT '自定义文本',
`created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`mid`),
......@@ -24,7 +26,7 @@ CREATE TABLE `sweet_strawberry_poster_lineup`
`mid` bigint unsigned NOT NULL AUTO_INCREMENT,
`lineup_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'lineup_id',
`poster_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'poster_id',
`lineup_num` int NOT NULL DEFAULT 0 COMMENT '阵容编号',
`lineup_num` varchar(255) NOT NULL DEFAULT 0 COMMENT '阵容编号',
`musician_id` int NOT NULL DEFAULT 0 COMMENT '音乐人id',
`musician_name` varchar(255) NOT NULL DEFAULT '' COMMENT '音乐人姓名',
`created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
......
......@@ -3,18 +3,12 @@ package com.liquidnet.service.sweet.controller;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.sweet.dto.param.poster.SweetStrawberryParam;
import com.liquidnet.service.sweet.entity.SweetStrawberry;
import com.liquidnet.service.sweet.service.ISweetStrawberryPosterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
/**
* <p>
* 2021草莓音乐节海报活动表 前端控制器
......
package com.liquidnet.service.sweet.service.impl;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.sweet.constant.SweetConstant;
import com.liquidnet.service.sweet.dto.param.poster.SweetStrawListParam;
import com.liquidnet.service.sweet.dto.param.poster.SweetStrawMusicianParam;
import com.liquidnet.service.sweet.dto.param.poster.SweetStrawberryParam;
import com.liquidnet.service.sweet.entity.SweetStrawberry;
import com.liquidnet.service.sweet.entity.SweetStrawberryPoster;
import com.liquidnet.service.sweet.entity.SweetStrawberryPosterLineup;
import com.liquidnet.service.sweet.mapper.SweetStrawberryPosterMapper;
import com.liquidnet.service.sweet.service.ISweetStrawberryPosterService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.service.sweet.utils.QueueUtils;
import com.liquidnet.service.sweet.utils.RedisDataUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
......@@ -62,7 +53,8 @@ public class SweetStrawberryPosterServiceImpl extends ServiceImpl<SweetStrawberr
String nickname=sweetStrawberry.getNickname();
String cityCode=sweetStrawberry.getCityCode();
String cityName=sweetStrawberry.getCityName();
List<SweetStrawListParam> musicianList = sweetStrawberry.getMusicianList();
String customText = sweetStrawberry.getCustomText();
List<SweetStrawListParam> musicianList = sweetStrawberry.getMusicianList();
for (SweetStrawListParam sweetStrawListParam : musicianList) {
List<SweetStrawMusicianParam> lineup = sweetStrawListParam.getLineup();
for (SweetStrawMusicianParam param : lineup) {
......@@ -82,7 +74,7 @@ public class SweetStrawberryPosterServiceImpl extends ServiceImpl<SweetStrawberr
LinkedList<String> sqls = CollectionUtil.linkedListString();
LinkedList<Object[]> sqlsDataA = CollectionUtil.linkedListObjectArr();
sqls.add(SqlMapping.get("sweet_strawberry_poster_user"));
sqlsDataA.add(new Object[]{openId,posterId,unionId,nickname,cityName,cityCode,localDateTime,null});
sqlsDataA.add(new Object[]{openId,posterId,unionId,nickname,cityName,cityCode,customText,localDateTime,null});
queueUtils.sendMsgByRedis(MQConst.SweetQueue.SWEET_POSTER.getKey(),
SqlMapping.gets(sqls, sqlsDataA));
......
......@@ -55,5 +55,5 @@ sweet_wechat_users.insert=INSERT INTO sweet_wechat_users (wechat_user_id,type,op
sweet_wechat_users.delete=DELETE FROM sweet_wechat_users WHERE union_id = ? and type = ?
#---------------------------音乐节活动海报--------------------------------
sweet_strawberry_poster_user=INSERT INTO sweet_strawberry_poster(open_id,poster_id,union_id,nickname,city_name,city_code,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?)
sweet_strawberry_poster_user=INSERT INTO sweet_strawberry_poster(open_id,poster_id,union_id,nickname,city_name,city_code,custom_text,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?)
sweet_strawberry_poster_Musician=INSERT INTO sweet_strawberry_poster_lineup(lineup_id,poster_id,lineup_num,musician_id,musician_name,created_at,updated_at) VALUES (?,?,?,?,?,?,?)
\ No newline at end of file
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