提交
This commit is contained in:
parent
bd9dd194dc
commit
0465071510
|
@ -23,4 +23,6 @@ public class DictTypeConstants {
|
|||
public static final String CUSTOMER_SERVICE_TYPE = "customer_service_type";
|
||||
// 充值渠道类型
|
||||
public static final String RECHARGE_CHANNEL_TYPE = "recharge_channel_type";
|
||||
// 会员等级状态
|
||||
public static final String VIP_LEVEL_STATUS = "vip_level_status";
|
||||
}
|
||||
|
|
|
@ -22,14 +22,12 @@ import com.ruoyi.ss.bonus.domain.vo.ProvideBonusVO;
|
|||
import com.ruoyi.ss.bonus.mapper.BonusMapper;
|
||||
import com.ruoyi.ss.bonus.service.BonusService;
|
||||
import com.ruoyi.ss.recordBalance.domain.enums.RecordBalanceBstType;
|
||||
import com.ruoyi.ss.store.service.StoreService;
|
||||
import com.ruoyi.ss.transactionBill.domain.vo.TransactionBillVO;
|
||||
import com.ruoyi.ss.user.domain.SmUserVO;
|
||||
import com.ruoyi.ss.user.service.UserAssembler;
|
||||
import com.ruoyi.ss.user.service.UserService;
|
||||
import com.ruoyi.system.domain.enums.config.ConfigKey;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -41,7 +39,6 @@ import java.time.LocalDateTime;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -63,21 +60,12 @@ public class BonusServiceImpl implements BonusService
|
|||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Autowired
|
||||
private StoreService storeService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService sysConfigService;
|
||||
|
||||
@Autowired
|
||||
private UserAssembler userAssembler;
|
||||
|
||||
@Autowired
|
||||
private ScheduledExecutorService scheduledExecutorService;
|
||||
|
||||
/**
|
||||
* 查询分成明细
|
||||
*
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.ruoyi.ss.transactionBill.service.TransactionBillService;
|
|||
import com.ruoyi.ss.transactionBill.service.TransactionBillValidator;
|
||||
import com.ruoyi.ss.user.domain.SmUserVO;
|
||||
import com.ruoyi.ss.user.service.UserValidator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -50,6 +51,7 @@ import java.util.stream.Collectors;
|
|||
* 2024/4/22
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TransactionBillValidatorImpl extends BaseValidator implements TransactionBillValidator {
|
||||
|
||||
@Autowired
|
||||
|
@ -176,9 +178,11 @@ public class TransactionBillValidatorImpl extends BaseValidator implements Trans
|
|||
return error("当前套餐时间已发生变化,请重新下单");
|
||||
}
|
||||
if (!CollectionUtils.equals(suit.getGearAmount(), dto.getSuitGearAmount())) {
|
||||
log.error("套餐收费方式已发生变化,请重新下单:suit.getGearAmount()={}, dto.getSuitGearAmount()={}", suit.getGearAmount(), dto.getSuitGearAmount());
|
||||
return error("套餐收费方式已发生变化,请重新下单");
|
||||
}
|
||||
if (!CollectionUtils.equals(suit.getGearTime(), dto.getSuitGearTime())) {
|
||||
log.error("套餐收费方式已发生变化,请重新下单:suit.getGearTime()={}, dto.getSuitGearTime()={}", suit.getGearTime(), dto.getSuitGearTime());
|
||||
return error("套餐收费方式已发生变化,请重新下单");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
package com.ruoyi.ss.vip.domain;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.core.domain.ValidGroup;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员对象 ss_vip
|
||||
|
@ -21,6 +20,7 @@ import javax.validation.constraints.NotNull;
|
|||
* @date 2024-12-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class Vip extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -29,23 +29,33 @@ public class Vip extends BaseEntity
|
|||
|
||||
@Excel(name = "用户ID")
|
||||
@ApiModelProperty("用户ID")
|
||||
@NotNull(message = "用户不允许为空", groups = {ValidGroup.Create.class})
|
||||
private Long userId;
|
||||
|
||||
@Excel(name = "店铺ID")
|
||||
@ApiModelProperty("店铺ID")
|
||||
private Long storeId;
|
||||
|
||||
@Excel(name = "会员等级ID")
|
||||
@ApiModelProperty("会员等级ID")
|
||||
@NotNull(message = "会员等级不允许为空", groups = {ValidGroup.Create.class})
|
||||
private Long levelId;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("有效期")
|
||||
private LocalDateTime expireTime;
|
||||
@Excel(name = "有效期(起始)", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("有效期(起始)")
|
||||
@NotNull(message = "有效期(起始)不允许为空", groups = {ValidGroup.Create.class})
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "有效期(结束)", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("有效期(结束)")
|
||||
@NotNull(message = "有效期(结束)不允许为空", groups = {ValidGroup.Create.class})
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Excel(name = "折扣")
|
||||
@ApiModelProperty("折扣")
|
||||
private BigDecimal discount;
|
||||
|
||||
@Excel(name = "可用店铺ID列表")
|
||||
@ApiModelProperty("可用店铺ID列表")
|
||||
private List<Long> storeIds;
|
||||
|
||||
|
||||
@Excel(name = "过期类型", readConverterExp = "1=永久,2=时限")
|
||||
@ApiModelProperty("过期类型")
|
||||
private String expireType;
|
||||
}
|
||||
|
|
|
@ -10,26 +10,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select
|
||||
sv.id,
|
||||
sv.user_id,
|
||||
sv.store_id,
|
||||
sv.level_id,
|
||||
sv.expire_time,
|
||||
sv.create_time,
|
||||
sv.start_time,
|
||||
sv.end_time,
|
||||
sv.discount,
|
||||
sv.store_ids
|
||||
if(su.is_real, su.real_name, su.user_name) as user_name,
|
||||
ss.name as store_name,
|
||||
ss.user_id as store_mch_id,
|
||||
svl.name as vip_level_name,
|
||||
svl.mch_id as vip_mch_id
|
||||
from ss_vip sv
|
||||
left join sm_user su on su.user_id = sv.user_id
|
||||
left join sm_store ss on ss.store_id = sv.store_id
|
||||
left join ss_vip_level svl on svl.id = sv.level_id
|
||||
</sql>
|
||||
|
||||
<sql id="searchCondition">
|
||||
<if test="query.id != null "> and sv.id = #{query.id}</if>
|
||||
<if test="query.userId != null "> and sv.user_id = #{query.userId}</if>
|
||||
<if test="query.storeId != null "> and sv.store_id = #{query.storeId}</if>
|
||||
<if test="query.levelId != null "> and sv.level_id = #{query.levelId}</if>
|
||||
<if test="query.startTime != null "> and sv.start_time = #{query.startTime}</if>
|
||||
<if test="query.endTime != null "> and sv.end_time = #{query.endTime}</if>
|
||||
<if test="query.discount != null "> and sv.discount = #{query.discount}</if>
|
||||
<if test="query.storeIds != null and query.storeIds != ''"> and sv.store_ids = #{query.storeIds}</if>
|
||||
<if test="query.userName != null and query.userName != ''">and if(su.is_real, su.real_name, su.user_name) like concat('%',#{query.userName},'%')</if>
|
||||
<if test="query.storeName != null and query.storeName != ''">and ss.name like concat('%',#{query.storeName},'%')</if>
|
||||
<if test="query.vipLevelName != null and query.vipLevelName != ''">and svl.name like concat('%',#{query.vipLevelName},'%')</if>
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
package com.ruoyi.ss.vipLevel.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.constants.DictTypeConstants;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.core.domain.ValidGroup;
|
||||
import com.ruoyi.system.valid.DictValid;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员等级对象 ss_vip_level
|
||||
|
@ -19,32 +23,52 @@ import javax.validation.constraints.*;
|
|||
* @date 2024-12-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class VipLevel extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "商户ID")
|
||||
@ApiModelProperty("商户ID")
|
||||
@NotNull(message = "商户不允许为空", groups = {ValidGroup.Create.class})
|
||||
@NotNull(message = "商户ID不允许为空", groups = {ValidGroup.Create.class})
|
||||
private Long mchId;
|
||||
|
||||
@Excel(name = "等级名称")
|
||||
@ApiModelProperty("等级名称")
|
||||
@NotBlank(message = "等级名称不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
|
||||
@Size(max = 30, message = "等级名称长度不能超过30个字符")
|
||||
private String name;
|
||||
|
||||
@Excel(name = "折扣")
|
||||
@ApiModelProperty("折扣")
|
||||
@NotNull(message = "折扣不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
|
||||
@Min(value = 0, message = "折扣不允许小于0折")
|
||||
@Max(value = 10, message = "折扣不允许大于10折")
|
||||
private BigDecimal discount;
|
||||
|
||||
@Excel(name = "描述文本")
|
||||
@ApiModelProperty("描述文本")
|
||||
@Size(max = 1000, message = "描述不允许超过1000个字符")
|
||||
@Size(max = 1000, message = "描述文本长度不能超过1000个字符")
|
||||
private String description;
|
||||
|
||||
@Excel(name = "价格")
|
||||
@ApiModelProperty("价格")
|
||||
@NotNull(message = "价格不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
|
||||
@Min(value = 0, message = "价格不允许小于0")
|
||||
private BigDecimal price;
|
||||
|
||||
@Excel(name = "时长(天)")
|
||||
@ApiModelProperty("时长(天)")
|
||||
@NotNull(message = "时长不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
|
||||
@Min(value = 0, message = "时长不允许小于0天")
|
||||
private Long time;
|
||||
|
||||
@Excel(name = "可用店铺ID列表")
|
||||
@ApiModelProperty("可用店铺ID列表")
|
||||
@NotNull(message = "可用店铺ID列表不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
|
||||
private List<Long> storeIds;
|
||||
|
||||
@Excel(name = "状态", dictType = DictTypeConstants.VIP_LEVEL_STATUS)
|
||||
@ApiModelProperty("状态")
|
||||
@DictValid(type = DictTypeConstants.VIP_LEVEL_STATUS, allowNull = false, message = "非法的状态")
|
||||
private String status;
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
svl.discount,
|
||||
svl.create_time,
|
||||
svl.description,
|
||||
svl.price,
|
||||
svl.time,
|
||||
svl.store_ids,
|
||||
svl.status
|
||||
if (mch.is_real, mch.real_name, mch.user_name) as mch_name
|
||||
from ss_vip_level svl
|
||||
left join sm_user mch on mch.user_id = svl.mch_id
|
||||
|
@ -24,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.mchId != null "> and svl.mch_id = #{query.mchId}</if>
|
||||
<if test="query.name != null and query.name != ''"> and svl.name like concat('%', #{query.name}, '%')</if>
|
||||
<if test="query.description != null and query.description != ''"> and svl.description like concat('%', #{query.description}, '%')</if>
|
||||
<if test="query.status != null and query.status != ''"> and svl.status = #{query.status}</if>
|
||||
<if test="query.mchName != null and query.mchName != ''">
|
||||
and if (mch.is_real, mch.real_name, mch.user_name) like concat('%', #{query.mchName}, '%')
|
||||
</if>
|
||||
|
@ -51,10 +56,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
insert into ss_vip_level
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="mchId != null">mch_id,</if>
|
||||
<if test="name != null and name != ''">`name`,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="discount != null">discount,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="description != null">`description`,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="time != null">time,</if>
|
||||
<if test="storeIds != null">store_ids,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="mchId != null">#{mchId},</if>
|
||||
|
@ -62,6 +71,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="discount != null">#{discount},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="time != null">#{time},</if>
|
||||
<if test="storeIds != null">#{storeIds},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -75,10 +88,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="updateColumns">
|
||||
<if test="data.mchId != null">mch_id = #{data.mchId},</if>
|
||||
<if test="data.name != null and data.name != ''">`name` = #{data.name},</if>
|
||||
<if test="data.name != null and data.name != ''">name = #{data.name},</if>
|
||||
<if test="data.discount != null">discount = #{data.discount},</if>
|
||||
<if test="data.createTime != null">create_time = #{data.createTime},</if>
|
||||
<if test="data.description != null">`description` = #{data.description},</if>
|
||||
<if test="data.description != null">description = #{data.description},</if>
|
||||
<if test="data.price != null">price = #{data.price},</if>
|
||||
<if test="data.time != null">time = #{data.time},</if>
|
||||
<if test="data.storeIds != null">store_ids = #{data.storeIds},</if>
|
||||
<if test="data.status != null and data.status != ''">status = #{data.status},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteVipLevelById" parameterType="Long">
|
||||
|
|
Loading…
Reference in New Issue
Block a user