迁移 积分相关
This commit is contained in:
@@ -18,8 +18,8 @@ public class CodeGen {
|
|||||||
private final static String DATABASE = "czg_cashier";
|
private final static String DATABASE = "czg_cashier";
|
||||||
private final static String OLD_DATABASE = "fycashier_test";
|
private final static String OLD_DATABASE = "fycashier_test";
|
||||||
|
|
||||||
// private final static boolean isOldVersion = false;
|
private final static boolean isOldVersion = false;
|
||||||
private final static boolean isOldVersion = true;
|
// private final static boolean isOldVersion = true;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
//配置数据源
|
//配置数据源
|
||||||
@@ -81,7 +81,7 @@ public class CodeGen {
|
|||||||
//设置表前缀和只生成哪些表,setGenerateTable 未配置时,生成所有表
|
//设置表前缀和只生成哪些表,setGenerateTable 未配置时,生成所有表
|
||||||
globalConfig.getStrategyConfig()
|
globalConfig.getStrategyConfig()
|
||||||
.setTablePrefix("tb_")
|
.setTablePrefix("tb_")
|
||||||
.setGenerateTable("tb_shop_table");
|
.setGenerateTable("tb_member_points_log");
|
||||||
|
|
||||||
EntityConfig entityConfig = globalConfig.getEntityConfig();
|
EntityConfig entityConfig = globalConfig.getEntityConfig();
|
||||||
if (isOldVersion) {
|
if (isOldVersion) {
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.czg.mergedata.controller;
|
||||||
|
|
||||||
|
import com.czg.mergedata.common.resp.CzgResult;
|
||||||
|
import com.czg.mergedata.cur.service.CurPointsBasicSettingService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author GYJoker
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/points")
|
||||||
|
public class PointsController {
|
||||||
|
@Resource
|
||||||
|
private CurPointsBasicSettingService curPointsBasicSettingService;
|
||||||
|
|
||||||
|
@RequestMapping("/mergePoints")
|
||||||
|
public CzgResult<String> mergePoints() {
|
||||||
|
return curPointsBasicSettingService.mergeData();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.czg.mergedata.cur.entity;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.Column;
|
||||||
|
import com.mybatisflex.annotation.Id;
|
||||||
|
import com.mybatisflex.annotation.KeyType;
|
||||||
|
import com.mybatisflex.annotation.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员积分变动记录 实体类。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Table("tb_member_points_log")
|
||||||
|
public class CurMemberPointsLog implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id(keyType = KeyType.Auto)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺id
|
||||||
|
*/
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 摘要信息(如:兑换某个商品/消费多少钱/充值多少钱/新会员赠送积分等)
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浮动类型 add-累加 subtract-扣减
|
||||||
|
*/
|
||||||
|
private String floatType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浮动积分(非0正负数)
|
||||||
|
*/
|
||||||
|
private Integer floatPoints;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package com.czg.mergedata.cur.entity;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.Column;
|
||||||
|
import com.mybatisflex.annotation.Id;
|
||||||
|
import com.mybatisflex.annotation.KeyType;
|
||||||
|
import com.mybatisflex.annotation.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分基本设置 实体类。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Table("tb_points_basic_setting")
|
||||||
|
public class CurPointsBasicSetting implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id(keyType = KeyType.Auto)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺id
|
||||||
|
*/
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启消费赠送积分 1-开启 0-关闭
|
||||||
|
*/
|
||||||
|
private Integer enableRewards;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 赠积分适用群体 all-全部 vip-仅会员
|
||||||
|
*/
|
||||||
|
private String rewardsGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每消费xx元赠送1积分
|
||||||
|
*/
|
||||||
|
private BigDecimal consumeAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启下单积分抵扣 1-开启 0-关闭
|
||||||
|
*/
|
||||||
|
private Integer enableDeduction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抵扣适用群体 all-全部 vip-仅会员
|
||||||
|
*/
|
||||||
|
private String deductionGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单实付抵扣门槛
|
||||||
|
*/
|
||||||
|
private BigDecimal minPaymentAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单最高抵扣比例
|
||||||
|
*/
|
||||||
|
private BigDecimal maxDeductionRatio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单抵扣积分比例 1元=?积分
|
||||||
|
*/
|
||||||
|
private Integer equivalentPoints;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启积分商城
|
||||||
|
*/
|
||||||
|
private Integer enablePointsMall;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浏览模式 list-列表 grid-宫格
|
||||||
|
*/
|
||||||
|
private String browseMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
package com.czg.mergedata.cur.entity;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.Column;
|
||||||
|
import com.mybatisflex.annotation.Id;
|
||||||
|
import com.mybatisflex.annotation.KeyType;
|
||||||
|
import com.mybatisflex.annotation.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换记录 实体类。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Table("tb_points_exchange_record")
|
||||||
|
public class CurPointsExchangeRecord implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id(keyType = KeyType.Auto)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺id
|
||||||
|
*/
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品id
|
||||||
|
*/
|
||||||
|
private Long pointsGoodsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品名称
|
||||||
|
*/
|
||||||
|
private String pointsGoodsName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品图片URL
|
||||||
|
*/
|
||||||
|
private String goodsImageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领取方式 self-自取 post-邮寄
|
||||||
|
*/
|
||||||
|
private String pickupMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员id
|
||||||
|
*/
|
||||||
|
private Long memberId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员名称
|
||||||
|
*/
|
||||||
|
private String memberName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员头像
|
||||||
|
*/
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消耗积分
|
||||||
|
*/
|
||||||
|
private Integer spendPoints;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 额外支付
|
||||||
|
*/
|
||||||
|
private BigDecimal extraPaymentAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 兑换券券码
|
||||||
|
*/
|
||||||
|
private String couponCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付平台订单号
|
||||||
|
*/
|
||||||
|
private String payOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 渠道订单号(微信/支付宝订单号)
|
||||||
|
*/
|
||||||
|
private String channelTradeNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式 积分支付/积分+微信/积分+支付宝
|
||||||
|
*/
|
||||||
|
private String payMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付类型 POINTS-积分 WECHAT-微信 ALIPAY-支付宝 UNIONPAY-银联云闪付
|
||||||
|
*/
|
||||||
|
private String payType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 unpaid-待支付 waiting-待自取 done-已完成 cancel-已取消
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消/退款原因
|
||||||
|
*/
|
||||||
|
private String cancelOrRefundReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消/退款时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime cancelOrRefundTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际支付时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime payTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间(下单时间)
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间(核销时间)
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package com.czg.mergedata.cur.entity;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.Column;
|
||||||
|
import com.mybatisflex.annotation.Id;
|
||||||
|
import com.mybatisflex.annotation.KeyType;
|
||||||
|
import com.mybatisflex.annotation.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品设置 实体类。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Table("tb_points_goods_setting")
|
||||||
|
public class CurPointsGoodsSetting implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id(keyType = KeyType.Auto)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺id
|
||||||
|
*/
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品类型 physical-实物 coupon-优惠劵
|
||||||
|
*/
|
||||||
|
private String goodsCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品图片URL
|
||||||
|
*/
|
||||||
|
private String goodsImageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所需积分
|
||||||
|
*/
|
||||||
|
private Integer requiredPoints;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 额外价格
|
||||||
|
*/
|
||||||
|
private BigDecimal extraPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序(权重),数字越高,显示约靠前
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品详情
|
||||||
|
*/
|
||||||
|
private String goodsDescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计兑换数量
|
||||||
|
*/
|
||||||
|
private Integer totalExchangeCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否上架 1-是 0-否
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除标志 1-是 0-否
|
||||||
|
*/
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.czg.mergedata.cur.mapper;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.UseDataSource;
|
||||||
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
import com.czg.mergedata.cur.entity.CurMemberPointsLog;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员积分变动记录 映射层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@UseDataSource("ds1")
|
||||||
|
public interface CurMemberPointsLogMapper extends BaseMapper<CurMemberPointsLog> {
|
||||||
|
@Select("truncate tb_member_points_log")
|
||||||
|
void truncateTable();
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.czg.mergedata.cur.mapper;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.UseDataSource;
|
||||||
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
import com.czg.mergedata.cur.entity.CurPointsBasicSetting;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分基本设置 映射层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@UseDataSource("ds1")
|
||||||
|
public interface CurPointsBasicSettingMapper extends BaseMapper<CurPointsBasicSetting> {
|
||||||
|
@Select("truncate tb_points_basic_setting")
|
||||||
|
void truncateTable();
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.czg.mergedata.cur.mapper;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.UseDataSource;
|
||||||
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
import com.czg.mergedata.cur.entity.CurPointsExchangeRecord;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换记录 映射层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@UseDataSource("ds1")
|
||||||
|
public interface CurPointsExchangeRecordMapper extends BaseMapper<CurPointsExchangeRecord> {
|
||||||
|
@Select("truncate tb_points_exchange_record")
|
||||||
|
void truncateTable();
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.czg.mergedata.cur.mapper;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.UseDataSource;
|
||||||
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
import com.czg.mergedata.cur.entity.CurPointsGoodsSetting;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品设置 映射层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@UseDataSource("ds1")
|
||||||
|
public interface CurPointsGoodsSettingMapper extends BaseMapper<CurPointsGoodsSetting> {
|
||||||
|
@Select("truncate tb_points_goods_setting")
|
||||||
|
void truncateTable();
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.czg.mergedata.cur.service;
|
||||||
|
|
||||||
|
import com.mybatisflex.core.service.IService;
|
||||||
|
import com.czg.mergedata.cur.entity.CurMemberPointsLog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员积分变动记录 服务层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
public interface CurMemberPointsLogService extends IService<CurMemberPointsLog> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.czg.mergedata.cur.service;
|
||||||
|
|
||||||
|
import com.czg.mergedata.common.resp.CzgResult;
|
||||||
|
import com.mybatisflex.core.service.IService;
|
||||||
|
import com.czg.mergedata.cur.entity.CurPointsBasicSetting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分基本设置 服务层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
public interface CurPointsBasicSettingService extends IService<CurPointsBasicSetting> {
|
||||||
|
CzgResult<String> mergeData();
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.czg.mergedata.cur.service;
|
||||||
|
|
||||||
|
import com.mybatisflex.core.service.IService;
|
||||||
|
import com.czg.mergedata.cur.entity.CurPointsExchangeRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换记录 服务层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
public interface CurPointsExchangeRecordService extends IService<CurPointsExchangeRecord> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.czg.mergedata.cur.service;
|
||||||
|
|
||||||
|
import com.mybatisflex.core.service.IService;
|
||||||
|
import com.czg.mergedata.cur.entity.CurPointsGoodsSetting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品设置 服务层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
public interface CurPointsGoodsSettingService extends IService<CurPointsGoodsSetting> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.czg.mergedata.cur.service.impl;
|
||||||
|
|
||||||
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
|
import com.czg.mergedata.cur.entity.CurMemberPointsLog;
|
||||||
|
import com.czg.mergedata.cur.mapper.CurMemberPointsLogMapper;
|
||||||
|
import com.czg.mergedata.cur.service.CurMemberPointsLogService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员积分变动记录 服务层实现。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CurMemberPointsLogServiceImpl extends ServiceImpl<CurMemberPointsLogMapper, CurMemberPointsLog> implements CurMemberPointsLogService{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
package com.czg.mergedata.cur.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.czg.mergedata.common.resp.CzgResult;
|
||||||
|
import com.czg.mergedata.common.utils.PageUtils;
|
||||||
|
import com.czg.mergedata.cur.entity.CurMemberPointsLog;
|
||||||
|
import com.czg.mergedata.cur.entity.CurPointsExchangeRecord;
|
||||||
|
import com.czg.mergedata.cur.entity.CurPointsGoodsSetting;
|
||||||
|
import com.czg.mergedata.cur.mapper.CurMemberPointsLogMapper;
|
||||||
|
import com.czg.mergedata.cur.mapper.CurPointsExchangeRecordMapper;
|
||||||
|
import com.czg.mergedata.cur.mapper.CurPointsGoodsSettingMapper;
|
||||||
|
import com.czg.mergedata.cur.service.CurShopIdRelationService;
|
||||||
|
import com.czg.mergedata.old.entity.OldMemberPointsLog;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsBasicSetting;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsExchangeRecord;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsGoodsSetting;
|
||||||
|
import com.czg.mergedata.old.service.OldMemberPointsLogService;
|
||||||
|
import com.czg.mergedata.old.service.OldPointsBasicSettingService;
|
||||||
|
import com.czg.mergedata.old.service.OldPointsExchangeRecordService;
|
||||||
|
import com.czg.mergedata.old.service.OldPointsGoodsSettingService;
|
||||||
|
import com.mybatisflex.core.paginate.Page;
|
||||||
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
|
import com.czg.mergedata.cur.entity.CurPointsBasicSetting;
|
||||||
|
import com.czg.mergedata.cur.mapper.CurPointsBasicSettingMapper;
|
||||||
|
import com.czg.mergedata.cur.service.CurPointsBasicSettingService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分基本设置 服务层实现。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CurPointsBasicSettingServiceImpl extends ServiceImpl<CurPointsBasicSettingMapper, CurPointsBasicSetting> implements CurPointsBasicSettingService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CurShopIdRelationService curShopIdRelationService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CurPointsExchangeRecordMapper curPointsExchangeRecordMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CurPointsGoodsSettingMapper curPointsGoodsSettingMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CurMemberPointsLogMapper curMemberPointsLogMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OldPointsBasicSettingService oldPointsBasicSettingService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OldMemberPointsLogService oldMemberPointsLogService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OldPointsExchangeRecordService oldPointsExchangeRecordService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OldPointsGoodsSettingService oldPointsGoodsSettingService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public CzgResult<String> mergeData() {
|
||||||
|
getMapper().truncateTable();
|
||||||
|
curPointsExchangeRecordMapper.truncateTable();
|
||||||
|
curPointsGoodsSettingMapper.truncateTable();
|
||||||
|
curMemberPointsLogMapper.truncateTable();
|
||||||
|
|
||||||
|
Map<Long, Long> oldAndCurShopIdMap = curShopIdRelationService.getOldShopIdRelation();
|
||||||
|
|
||||||
|
execPointsBasicSetting(oldAndCurShopIdMap);
|
||||||
|
execPointsExchangeRecord(oldAndCurShopIdMap);
|
||||||
|
execPointsGoodsSetting(oldAndCurShopIdMap);
|
||||||
|
execMemberPointsLog(oldAndCurShopIdMap);
|
||||||
|
|
||||||
|
return CzgResult.success("迁移成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void execPointsBasicSetting(Map<Long, Long> oldAndCurShopIdMap) {
|
||||||
|
Page<OldPointsBasicSetting> page = oldPointsBasicSettingService.page(PageUtils.buildPage());
|
||||||
|
|
||||||
|
while (!page.getRecords().isEmpty()) {
|
||||||
|
savePointsBasicSetting(page.getRecords(), oldAndCurShopIdMap);
|
||||||
|
|
||||||
|
page = oldPointsBasicSettingService.page(PageUtils.buildPage(page.getPageNumber() + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void execPointsExchangeRecord(Map<Long, Long> oldAndCurShopIdMap) {
|
||||||
|
Page<OldPointsExchangeRecord> page = oldPointsExchangeRecordService.page(PageUtils.buildPage());
|
||||||
|
while (!page.getRecords().isEmpty()) {
|
||||||
|
savePointsExchangeRecord(page.getRecords(), oldAndCurShopIdMap);
|
||||||
|
page = oldPointsExchangeRecordService.page(PageUtils.buildPage(page.getPageNumber() + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void execPointsGoodsSetting(Map<Long, Long> oldAndCurShopIdMap) {
|
||||||
|
Page<OldPointsGoodsSetting> page = oldPointsGoodsSettingService.page(PageUtils.buildPage());
|
||||||
|
while (!page.getRecords().isEmpty()) {
|
||||||
|
savePointsGoodsSetting(page.getRecords(), oldAndCurShopIdMap);
|
||||||
|
page = oldPointsGoodsSettingService.page(PageUtils.buildPage(page.getPageNumber() + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void execMemberPointsLog(Map<Long, Long> oldAndCurShopIdMap) {
|
||||||
|
Page<OldMemberPointsLog> page = oldMemberPointsLogService.page(PageUtils.buildPage());
|
||||||
|
while (!page.getRecords().isEmpty()) {
|
||||||
|
saveMemberPointsLog(page.getRecords(), oldAndCurShopIdMap);
|
||||||
|
page = oldMemberPointsLogService.page(PageUtils.buildPage(page.getPageNumber() + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void savePointsBasicSetting(List<OldPointsBasicSetting> oldPointsBasicSettingList, Map<Long, Long> oldAndCurShopIdMap) {
|
||||||
|
List<CurPointsBasicSetting> curPointsBasicSettingList = new ArrayList<>();
|
||||||
|
for (OldPointsBasicSetting oldPointsBasicSetting : oldPointsBasicSettingList) {
|
||||||
|
CurPointsBasicSetting curPointsBasicSetting = BeanUtil.toBean(oldPointsBasicSetting, CurPointsBasicSetting.class);
|
||||||
|
|
||||||
|
curPointsBasicSetting.setShopId(oldAndCurShopIdMap.get(oldPointsBasicSetting.getShopId()));
|
||||||
|
|
||||||
|
curPointsBasicSettingList.add(curPointsBasicSetting);
|
||||||
|
}
|
||||||
|
|
||||||
|
saveBatch(curPointsBasicSettingList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void savePointsExchangeRecord(List<OldPointsExchangeRecord> oldPointsExchangeRecordList, Map<Long, Long> oldAndCurShopIdMap) {
|
||||||
|
List<CurPointsExchangeRecord> curPointsExchangeRecordList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (OldPointsExchangeRecord oldPointsExchangeRecord : oldPointsExchangeRecordList) {
|
||||||
|
CurPointsExchangeRecord curPointsExchangeRecord = BeanUtil.toBean(oldPointsExchangeRecord, CurPointsExchangeRecord.class);
|
||||||
|
curPointsExchangeRecord.setShopId(oldAndCurShopIdMap.get(oldPointsExchangeRecord.getShopId()));
|
||||||
|
curPointsExchangeRecordList.add(curPointsExchangeRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
curPointsExchangeRecordMapper.insertBatch(curPointsExchangeRecordList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void savePointsGoodsSetting(List<OldPointsGoodsSetting> oldPointsGoodsSettingList, Map<Long, Long> oldAndCurShopIdMap) {
|
||||||
|
List<CurPointsGoodsSetting> curPointsGoodsSettingList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (OldPointsGoodsSetting oldPointsGoodsSetting : oldPointsGoodsSettingList) {
|
||||||
|
CurPointsGoodsSetting curPointsGoodsSetting = BeanUtil.toBean(oldPointsGoodsSetting, CurPointsGoodsSetting.class);
|
||||||
|
curPointsGoodsSetting.setShopId(oldAndCurShopIdMap.get(oldPointsGoodsSetting.getShopId()));
|
||||||
|
curPointsGoodsSettingList.add(curPointsGoodsSetting);
|
||||||
|
}
|
||||||
|
|
||||||
|
curPointsGoodsSettingMapper.insertBatch(curPointsGoodsSettingList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveMemberPointsLog(List<OldMemberPointsLog> oldMemberPointsLogList, Map<Long, Long> oldAndCurShopIdMap) {
|
||||||
|
List<CurMemberPointsLog> curMemberPointsLogs = new ArrayList<>();
|
||||||
|
|
||||||
|
for (OldMemberPointsLog oldMemberPointsLog : oldMemberPointsLogList) {
|
||||||
|
CurMemberPointsLog memberPointsLog = BeanUtil.toBean(oldMemberPointsLog, CurMemberPointsLog.class);
|
||||||
|
memberPointsLog.setShopId(oldAndCurShopIdMap.get(oldMemberPointsLog.getShopId()));
|
||||||
|
curMemberPointsLogs.add(memberPointsLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
curMemberPointsLogMapper.insertBatch(curMemberPointsLogs);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.czg.mergedata.cur.service.impl;
|
||||||
|
|
||||||
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
|
import com.czg.mergedata.cur.entity.CurPointsExchangeRecord;
|
||||||
|
import com.czg.mergedata.cur.mapper.CurPointsExchangeRecordMapper;
|
||||||
|
import com.czg.mergedata.cur.service.CurPointsExchangeRecordService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换记录 服务层实现。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CurPointsExchangeRecordServiceImpl extends ServiceImpl<CurPointsExchangeRecordMapper, CurPointsExchangeRecord> implements CurPointsExchangeRecordService{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.czg.mergedata.cur.service.impl;
|
||||||
|
|
||||||
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
|
import com.czg.mergedata.cur.entity.CurPointsGoodsSetting;
|
||||||
|
import com.czg.mergedata.cur.mapper.CurPointsGoodsSettingMapper;
|
||||||
|
import com.czg.mergedata.cur.service.CurPointsGoodsSettingService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品设置 服务层实现。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CurPointsGoodsSettingServiceImpl extends ServiceImpl<CurPointsGoodsSettingMapper, CurPointsGoodsSetting> implements CurPointsGoodsSettingService{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package com.czg.mergedata.old.entity;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.Column;
|
||||||
|
import com.mybatisflex.annotation.Id;
|
||||||
|
import com.mybatisflex.annotation.KeyType;
|
||||||
|
import com.mybatisflex.annotation.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员积分变动记录 实体类。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Table("tb_member_points_log")
|
||||||
|
public class OldMemberPointsLog implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id(keyType = KeyType.Auto)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺id
|
||||||
|
*/
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员id
|
||||||
|
*/
|
||||||
|
private Long memberId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员名称
|
||||||
|
*/
|
||||||
|
private String memberName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员头像
|
||||||
|
*/
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 摘要信息(如:兑换某个商品/消费多少钱/充值多少钱/新会员赠送积分等)
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浮动类型 add-累加 subtract-扣减
|
||||||
|
*/
|
||||||
|
private String floatType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浮动积分(非0正负数)
|
||||||
|
*/
|
||||||
|
private Integer floatPoints;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package com.czg.mergedata.old.entity;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.Column;
|
||||||
|
import com.mybatisflex.annotation.Id;
|
||||||
|
import com.mybatisflex.annotation.KeyType;
|
||||||
|
import com.mybatisflex.annotation.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分基本设置 实体类。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Table("tb_points_basic_setting")
|
||||||
|
public class OldPointsBasicSetting implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id(keyType = KeyType.Auto)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺id
|
||||||
|
*/
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启消费赠送积分 1-开启 0-关闭
|
||||||
|
*/
|
||||||
|
private Integer enableRewards;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 赠积分适用群体 all-全部 vip-仅会员
|
||||||
|
*/
|
||||||
|
private String rewardsGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每消费xx元赠送1积分
|
||||||
|
*/
|
||||||
|
private BigDecimal consumeAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启下单积分抵扣 1-开启 0-关闭
|
||||||
|
*/
|
||||||
|
private Integer enableDeduction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抵扣适用群体 all-全部 vip-仅会员
|
||||||
|
*/
|
||||||
|
private String deductionGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单实付抵扣门槛
|
||||||
|
*/
|
||||||
|
private BigDecimal minPaymentAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单最高抵扣比例
|
||||||
|
*/
|
||||||
|
private BigDecimal maxDeductionRatio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单抵扣积分比例 1元=?积分
|
||||||
|
*/
|
||||||
|
private Integer equivalentPoints;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启积分商城
|
||||||
|
*/
|
||||||
|
private Integer enablePointsMall;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浏览模式 list-列表 grid-宫格
|
||||||
|
*/
|
||||||
|
private String browseMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
package com.czg.mergedata.old.entity;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.Column;
|
||||||
|
import com.mybatisflex.annotation.Id;
|
||||||
|
import com.mybatisflex.annotation.KeyType;
|
||||||
|
import com.mybatisflex.annotation.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换记录 实体类。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Table("tb_points_exchange_record")
|
||||||
|
public class OldPointsExchangeRecord implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id(keyType = KeyType.Auto)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺id
|
||||||
|
*/
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品id
|
||||||
|
*/
|
||||||
|
private Long pointsGoodsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品名称
|
||||||
|
*/
|
||||||
|
private String pointsGoodsName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品图片URL
|
||||||
|
*/
|
||||||
|
private String goodsImageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领取方式 self-自取 post-邮寄
|
||||||
|
*/
|
||||||
|
private String pickupMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员id
|
||||||
|
*/
|
||||||
|
private Long memberId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员名称
|
||||||
|
*/
|
||||||
|
private String memberName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员头像
|
||||||
|
*/
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消耗积分
|
||||||
|
*/
|
||||||
|
private Integer spendPoints;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 额外支付
|
||||||
|
*/
|
||||||
|
private BigDecimal extraPaymentAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 兑换券券码
|
||||||
|
*/
|
||||||
|
private String couponCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付平台订单号
|
||||||
|
*/
|
||||||
|
private String payOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 渠道订单号(微信/支付宝订单号)
|
||||||
|
*/
|
||||||
|
private String channelTradeNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式 积分支付/积分+微信/积分+支付宝
|
||||||
|
*/
|
||||||
|
private String payMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付类型 POINTS-积分 WECHAT-微信 ALIPAY-支付宝 UNIONPAY-银联云闪付
|
||||||
|
*/
|
||||||
|
private String payType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 unpaid-待支付 waiting-待自取 done-已完成 cancel-已取消
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消/退款原因
|
||||||
|
*/
|
||||||
|
private String cancelOrRefundReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消/退款时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime cancelOrRefundTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际支付时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime payTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间(下单时间)
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间(核销时间)
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package com.czg.mergedata.old.entity;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.Column;
|
||||||
|
import com.mybatisflex.annotation.Id;
|
||||||
|
import com.mybatisflex.annotation.KeyType;
|
||||||
|
import com.mybatisflex.annotation.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品设置 实体类。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Table("tb_points_goods_setting")
|
||||||
|
public class OldPointsGoodsSetting implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id(keyType = KeyType.Auto)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺id
|
||||||
|
*/
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品类型 physical-实物 coupon-优惠劵
|
||||||
|
*/
|
||||||
|
private String goodsCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品图片URL
|
||||||
|
*/
|
||||||
|
private String goodsImageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所需积分
|
||||||
|
*/
|
||||||
|
private Integer requiredPoints;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 额外价格
|
||||||
|
*/
|
||||||
|
private BigDecimal extraPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序(权重),数字越高,显示约靠前
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品详情
|
||||||
|
*/
|
||||||
|
private String goodsDescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计兑换数量
|
||||||
|
*/
|
||||||
|
private Integer totalExchangeCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否上架 1-是 0-否
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除标志 1-是 0-否
|
||||||
|
*/
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.czg.mergedata.old.mapper;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.UseDataSource;
|
||||||
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
import com.czg.mergedata.old.entity.OldMemberPointsLog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员积分变动记录 映射层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@UseDataSource("ds2")
|
||||||
|
public interface OldMemberPointsLogMapper extends BaseMapper<OldMemberPointsLog> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.czg.mergedata.old.mapper;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.UseDataSource;
|
||||||
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsBasicSetting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分基本设置 映射层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@UseDataSource("ds2")
|
||||||
|
public interface OldPointsBasicSettingMapper extends BaseMapper<OldPointsBasicSetting> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.czg.mergedata.old.mapper;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.UseDataSource;
|
||||||
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsExchangeRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换记录 映射层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@UseDataSource("ds2")
|
||||||
|
public interface OldPointsExchangeRecordMapper extends BaseMapper<OldPointsExchangeRecord> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.czg.mergedata.old.mapper;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.UseDataSource;
|
||||||
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsGoodsSetting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品设置 映射层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@UseDataSource("ds2")
|
||||||
|
public interface OldPointsGoodsSettingMapper extends BaseMapper<OldPointsGoodsSetting> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.czg.mergedata.old.service;
|
||||||
|
|
||||||
|
import com.mybatisflex.core.service.IService;
|
||||||
|
import com.czg.mergedata.old.entity.OldMemberPointsLog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员积分变动记录 服务层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
public interface OldMemberPointsLogService extends IService<OldMemberPointsLog> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.czg.mergedata.old.service;
|
||||||
|
|
||||||
|
import com.mybatisflex.core.service.IService;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsBasicSetting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分基本设置 服务层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
public interface OldPointsBasicSettingService extends IService<OldPointsBasicSetting> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.czg.mergedata.old.service;
|
||||||
|
|
||||||
|
import com.mybatisflex.core.service.IService;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsExchangeRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换记录 服务层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
public interface OldPointsExchangeRecordService extends IService<OldPointsExchangeRecord> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.czg.mergedata.old.service;
|
||||||
|
|
||||||
|
import com.mybatisflex.core.service.IService;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsGoodsSetting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品设置 服务层。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
public interface OldPointsGoodsSettingService extends IService<OldPointsGoodsSetting> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.czg.mergedata.old.service.impl;
|
||||||
|
|
||||||
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
|
import com.czg.mergedata.old.entity.OldMemberPointsLog;
|
||||||
|
import com.czg.mergedata.old.mapper.OldMemberPointsLogMapper;
|
||||||
|
import com.czg.mergedata.old.service.OldMemberPointsLogService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员积分变动记录 服务层实现。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OldMemberPointsLogServiceImpl extends ServiceImpl<OldMemberPointsLogMapper, OldMemberPointsLog> implements OldMemberPointsLogService{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.czg.mergedata.old.service.impl;
|
||||||
|
|
||||||
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsBasicSetting;
|
||||||
|
import com.czg.mergedata.old.mapper.OldPointsBasicSettingMapper;
|
||||||
|
import com.czg.mergedata.old.service.OldPointsBasicSettingService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分基本设置 服务层实现。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OldPointsBasicSettingServiceImpl extends ServiceImpl<OldPointsBasicSettingMapper, OldPointsBasicSetting> implements OldPointsBasicSettingService{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.czg.mergedata.old.service.impl;
|
||||||
|
|
||||||
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsExchangeRecord;
|
||||||
|
import com.czg.mergedata.old.mapper.OldPointsExchangeRecordMapper;
|
||||||
|
import com.czg.mergedata.old.service.OldPointsExchangeRecordService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换记录 服务层实现。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OldPointsExchangeRecordServiceImpl extends ServiceImpl<OldPointsExchangeRecordMapper, OldPointsExchangeRecord> implements OldPointsExchangeRecordService{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.czg.mergedata.old.service.impl;
|
||||||
|
|
||||||
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
|
import com.czg.mergedata.old.entity.OldPointsGoodsSetting;
|
||||||
|
import com.czg.mergedata.old.mapper.OldPointsGoodsSettingMapper;
|
||||||
|
import com.czg.mergedata.old.service.OldPointsGoodsSettingService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分商品设置 服务层实现。
|
||||||
|
*
|
||||||
|
* @author mac
|
||||||
|
* @since 2025-02-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OldPointsGoodsSettingServiceImpl extends ServiceImpl<OldPointsGoodsSettingMapper, OldPointsGoodsSetting> implements OldPointsGoodsSettingService{
|
||||||
|
|
||||||
|
}
|
||||||
7
src/main/resources/mapper/cur/MemberPointsLogMapper.xml
Normal file
7
src/main/resources/mapper/cur/MemberPointsLogMapper.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.czg.mergedata.cur.mapper.CurMemberPointsLogMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.czg.mergedata.cur.mapper.CurPointsBasicSettingMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.czg.mergedata.cur.mapper.CurPointsExchangeRecordMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.czg.mergedata.cur.mapper.CurPointsGoodsSettingMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
7
src/main/resources/mapper/old/MemberPointsLogMapper.xml
Normal file
7
src/main/resources/mapper/old/MemberPointsLogMapper.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.czg.mergedata.old.mapper.OldMemberPointsLogMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.czg.mergedata.old.mapper.OldPointsBasicSettingMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.czg.mergedata.old.mapper.OldPointsExchangeRecordMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.czg.mergedata.old.mapper.OldPointsGoodsSettingMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user