迁移 订单
This commit is contained in:
parent
9238d42f45
commit
ff4d088a66
|
|
@ -18,8 +18,8 @@ public class CodeGen {
|
|||
private final static String DATABASE = "czg_cashier_test";
|
||||
private final static String OLD_DATABASE = "fycashier";
|
||||
|
||||
private final static boolean isOldVersion = false;
|
||||
// private final static boolean isOldVersion = true;
|
||||
// private final static boolean isOldVersion = false;
|
||||
private final static boolean isOldVersion = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
//配置数据源
|
||||
|
|
@ -81,7 +81,7 @@ public class CodeGen {
|
|||
//设置表前缀和只生成哪些表,setGenerateTable 未配置时,生成所有表
|
||||
globalConfig.getStrategyConfig()
|
||||
.setTablePrefix("tb_")
|
||||
.setGenerateTable("tb_shop_activate_coupon_record");
|
||||
.setGenerateTable("tb_order_info", "tb_order_detail");
|
||||
|
||||
EntityConfig entityConfig = globalConfig.getEntityConfig();
|
||||
if (isOldVersion) {
|
||||
|
|
@ -95,19 +95,19 @@ public class CodeGen {
|
|||
.setWithLombok(true)
|
||||
.setJdkVersion(23);
|
||||
|
||||
//可以单独配置某个列
|
||||
ColumnConfig createTime = new ColumnConfig();
|
||||
createTime.setColumnName("create_time");
|
||||
createTime.setOnInsertValue("now()");
|
||||
globalConfig.getStrategyConfig()
|
||||
.setColumnConfig(createTime);
|
||||
|
||||
ColumnConfig updateTime = new ColumnConfig();
|
||||
updateTime.setColumnName("update_time");
|
||||
updateTime.setOnUpdateValue("now()");
|
||||
updateTime.setOnInsertValue("now()");
|
||||
globalConfig.getStrategyConfig()
|
||||
.setColumnConfig(updateTime);
|
||||
// //可以单独配置某个列
|
||||
// ColumnConfig createTime = new ColumnConfig();
|
||||
// createTime.setColumnName("create_time");
|
||||
// createTime.setOnInsertValue("now()");
|
||||
// globalConfig.getStrategyConfig()
|
||||
// .setColumnConfig(createTime);
|
||||
//
|
||||
// ColumnConfig updateTime = new ColumnConfig();
|
||||
// updateTime.setColumnName("update_time");
|
||||
// updateTime.setOnUpdateValue("now()");
|
||||
// updateTime.setOnInsertValue("now()");
|
||||
// globalConfig.getStrategyConfig()
|
||||
// .setColumnConfig(updateTime);
|
||||
|
||||
// ColumnConfig deleted = new ColumnConfig();
|
||||
// deleted.setColumnName("deleted");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.czg.mergedata.controller;
|
||||
|
||||
import com.czg.mergedata.common.resp.CzgResult;
|
||||
import com.czg.mergedata.cur.service.CurOrderInfoService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author GYJoker
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/order")
|
||||
public class OrderController {
|
||||
@Resource
|
||||
private CurOrderInfoService orderService;
|
||||
|
||||
@RequestMapping("/mergeOrder")
|
||||
public CzgResult<String> mergeOrder() {
|
||||
return orderService.mergeOrderData();
|
||||
}
|
||||
|
||||
@RequestMapping("/mergeRefundOrder")
|
||||
public CzgResult<String> mergeRefundOrder() {
|
||||
return orderService.mergeRefundOrderData();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -73,10 +72,10 @@ public class CurCallConfig implements Serializable {
|
|||
*/
|
||||
private Integer nearNum;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -95,7 +94,7 @@ public class CurCallQueue implements Serializable {
|
|||
/**
|
||||
* 排号时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -88,10 +87,10 @@ public class CurCallTable implements Serializable {
|
|||
*/
|
||||
private Integer isPostpone;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.czg.mergedata.cur.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
|
|
@ -37,10 +36,10 @@ public class CurCouponCategory implements Serializable {
|
|||
*/
|
||||
private String name;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 会员积分变动记录 实体类。
|
||||
*
|
||||
|
|
@ -69,7 +67,7 @@ public class CurMemberPointsLog implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,175 @@
|
|||
package com.czg.mergedata.cur.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 订单详情 实体类。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_order_detail")
|
||||
public class CurOrderDetail implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
private Long productId;
|
||||
|
||||
private String productImg;
|
||||
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 商品类型:单规格商品 single 多规格商品 sku 套餐商品 package 称重商品 weigh 团购券 coupon
|
||||
*/
|
||||
private String productType;
|
||||
|
||||
private Long skuId;
|
||||
|
||||
private String skuName;
|
||||
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 会员价
|
||||
*/
|
||||
private BigDecimal memberPrice;
|
||||
|
||||
/**
|
||||
* 临时价
|
||||
*/
|
||||
private BigDecimal discountSaleAmount;
|
||||
|
||||
/**
|
||||
* 最终单价(付款时 使用的单价)
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 折扣金额
|
||||
*/
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/**
|
||||
* 打包费(单价)
|
||||
*/
|
||||
private BigDecimal packAmount;
|
||||
|
||||
/**
|
||||
* 支付金额,去除优惠券优惠金额的商品金额 不包含打包费
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 已退款金额
|
||||
*/
|
||||
private BigDecimal returnAmount;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 打包数量
|
||||
*/
|
||||
private BigDecimal packNumber;
|
||||
|
||||
/**
|
||||
* 优惠券抵扣数量
|
||||
*/
|
||||
private BigDecimal couponNum;
|
||||
|
||||
/**
|
||||
* 退菜数量(不管价格)
|
||||
*/
|
||||
private BigDecimal returnNum;
|
||||
|
||||
/**
|
||||
* 退单数量
|
||||
*/
|
||||
private BigDecimal refundNum;
|
||||
|
||||
/**
|
||||
* 退款单号
|
||||
*/
|
||||
private String refundNo;
|
||||
|
||||
/**
|
||||
* 临时改价备注
|
||||
*/
|
||||
private String discountSaleNote;
|
||||
|
||||
/**
|
||||
* 状态: wait-pay 待支付;in-production 制作中;wait-out 待取餐;refunding 退款中; part-refund 部分退单; refund-退单; done 完成;
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 当前下单次数
|
||||
*/
|
||||
private Integer placeNum;
|
||||
|
||||
/**
|
||||
* 是否是临时菜品
|
||||
*/
|
||||
private Integer isTemporary;
|
||||
|
||||
/**
|
||||
* 是否打票
|
||||
*/
|
||||
private Integer isPrint;
|
||||
|
||||
/**
|
||||
* 是否等叫
|
||||
*/
|
||||
private Integer isWaitCall;
|
||||
|
||||
/**
|
||||
* 套餐商品选择信息
|
||||
*/
|
||||
private String proGroupInfo;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 退款备注
|
||||
*/
|
||||
private String refundRemark;
|
||||
|
||||
//
|
||||
private LocalDateTime createTime;
|
||||
|
||||
//
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,269 @@
|
|||
package com.czg.mergedata.cur.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 订单表 实体类。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_order_info")
|
||||
public class CurOrderInfo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
pc 收银机客户端 PC+雪花ID
|
||||
wechat 微信小程序 WX+雪花ID
|
||||
alipay 支付宝小程序 ALI+雪花ID
|
||||
admin-pc PC管理端 WEB+雪花ID
|
||||
admin-app APP管理端 APP+雪花ID
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 店铺Id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 用户Id user_info表的id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 退单金额
|
||||
*/
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 订单原金额 不含折扣价格
|
||||
*/
|
||||
private BigDecimal originAmount;
|
||||
|
||||
/**
|
||||
* 抹零金额
|
||||
*/
|
||||
private BigDecimal roundAmount;
|
||||
|
||||
/**
|
||||
* 订单金额 (扣除各类折扣)
|
||||
*/
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
/**
|
||||
* 实际支付金额
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 积分抵扣金额
|
||||
*/
|
||||
private BigDecimal pointsDiscountAmount;
|
||||
|
||||
/**
|
||||
* 使用的积分数量
|
||||
*/
|
||||
private Integer pointsNum;
|
||||
|
||||
/**
|
||||
* 商品优惠券抵扣金额
|
||||
*/
|
||||
private BigDecimal productCouponDiscountAmount;
|
||||
|
||||
/**
|
||||
* 用户使用的卡券 券id集合
|
||||
*/
|
||||
private String couponInfoList;
|
||||
|
||||
/**
|
||||
* 满减优惠券抵扣金额
|
||||
*/
|
||||
private BigDecimal fullCouponDiscountAmount;
|
||||
|
||||
/**
|
||||
* 手动优惠金额
|
||||
*/
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/**
|
||||
* 折扣比例
|
||||
*/
|
||||
private BigDecimal discountRatio;
|
||||
|
||||
/**
|
||||
* 打包费
|
||||
*/
|
||||
private BigDecimal packFee;
|
||||
|
||||
/**
|
||||
* 台桌编号
|
||||
*/
|
||||
private String tableCode;
|
||||
|
||||
/**
|
||||
* 台桌名称
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 订单类型-
|
||||
cash收银(除小程序以外 都属于收银)
|
||||
miniapp小程序
|
||||
*/
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 平台类型
|
||||
微信小程序 WX
|
||||
支付宝小程序 ALI
|
||||
收银机客户端 PC
|
||||
PC管理端 APC
|
||||
APP管理端 APP
|
||||
*/
|
||||
private String platformType;
|
||||
|
||||
/**
|
||||
* 用餐模式 堂食 dine-in 外带 take-out 外卖 take-away
|
||||
*/
|
||||
private String dineMode;
|
||||
|
||||
/**
|
||||
* 支付模式:
|
||||
后付费 after-pay
|
||||
先付费 before-pay
|
||||
无桌码 no-table
|
||||
*/
|
||||
private String payMode;
|
||||
|
||||
/**
|
||||
* 支付类型
|
||||
主扫 main-scan
|
||||
被扫 back-scan
|
||||
微信小程序 wechat-mini
|
||||
支付宝小程序 alipay-mini
|
||||
会员支付 vip-pay
|
||||
现金支付 cash-pay
|
||||
挂账支付 credit-pay
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 状态: unpaid-待支付;in-production 制作中;wait-out 待取餐;;done-订单完成;refunding-申请退单;refund-退单;part-refund 部分退单;cancelled-取消订单
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 折扣信息 json
|
||||
*/
|
||||
private String discountInfo;
|
||||
|
||||
/**
|
||||
* 是否支持退款,1支持退单, 0不支持退单
|
||||
*/
|
||||
private Integer refundAble;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private LocalDateTime paidTime;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
//
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 支付订单号
|
||||
tb_order_payment.id tb_shop_user_flow.id
|
||||
|
||||
*/
|
||||
private Long payOrderId;
|
||||
|
||||
/**
|
||||
* 交易日期
|
||||
*/
|
||||
private String tradeDay;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 取餐码
|
||||
*/
|
||||
private String takeCode;
|
||||
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
private Long staffId;
|
||||
|
||||
/**
|
||||
* 当前订单下单次数
|
||||
*/
|
||||
private Integer placeNum;
|
||||
|
||||
/**
|
||||
* 用餐人数
|
||||
*/
|
||||
private Integer seatNum;
|
||||
|
||||
/**
|
||||
* 餐位费
|
||||
*/
|
||||
private BigDecimal seatAmount;
|
||||
|
||||
/**
|
||||
* 退款备注
|
||||
*/
|
||||
private String refundRemark;
|
||||
|
||||
/**
|
||||
* 是否使用了霸王餐
|
||||
*/
|
||||
private Integer isFreeDine;
|
||||
|
||||
/**
|
||||
* 是否等叫 0 否 1 等叫
|
||||
*/
|
||||
private Integer isWaitCall;
|
||||
|
||||
/**
|
||||
* 挂账人id
|
||||
*/
|
||||
private Long creditBuyerId;
|
||||
|
||||
/**
|
||||
* 是否回收站 0-否,1回收站
|
||||
*/
|
||||
private Integer isDel;
|
||||
|
||||
/**
|
||||
* 退款失败原因
|
||||
*/
|
||||
private String failMsg;
|
||||
|
||||
}
|
||||
|
|
@ -1,19 +1,17 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Pad商品布局版式 实体类。
|
||||
*
|
||||
|
|
@ -64,7 +62,7 @@ public class CurPadLayout implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -69,13 +68,13 @@ public class CurPadProductCategory implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -49,7 +48,7 @@ public class CurPadProductCategoryDetail implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.czg.mergedata.cur.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -88,7 +87,7 @@ public class CurPointsBasicSetting implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -145,13 +144,13 @@ public class CurPointsExchangeRecord implements Serializable {
|
|||
/**
|
||||
* 创建时间(下单时间)
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间(核销时间)
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -95,13 +94,13 @@ public class CurPointsGoodsSetting implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
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.sql.Time;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
|
@ -82,10 +80,10 @@ public class CurProdGroup implements Serializable {
|
|||
*/
|
||||
private String saleEndTime;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,18 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 商品SKU 实体类。
|
||||
*
|
||||
|
|
@ -110,13 +108,13 @@ public class CurProdSku implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -176,13 +175,13 @@ public class CurProduct implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -61,10 +60,10 @@ public class CurShopActivate implements Serializable {
|
|||
*/
|
||||
private String coupons;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,18 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 活动赠送优惠券记录表 实体类。
|
||||
*
|
||||
|
|
@ -94,10 +92,10 @@ public class CurShopActivateCouponRecord implements Serializable {
|
|||
*/
|
||||
private LocalDateTime useEndTime;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private String couponJson;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -43,10 +42,10 @@ public class CurShopCoupon implements Serializable {
|
|||
*/
|
||||
private Integer status;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -142,10 +141,10 @@ public class CurShopInfo implements Serializable {
|
|||
*/
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -84,13 +83,13 @@ public class CurShopProdCategory implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -79,13 +78,13 @@ public class CurShopProdSpec implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -64,13 +63,13 @@ public class CurShopProdUnit implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -67,10 +66,10 @@ public class CurShopStaff implements Serializable {
|
|||
*/
|
||||
private Long shopId;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,20 +1,18 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 台桌配置 实体类。
|
||||
*
|
||||
|
|
@ -76,10 +74,10 @@ public class CurShopTable implements Serializable {
|
|||
*/
|
||||
private String status;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
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.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 店铺区域 实体类。
|
||||
*
|
||||
|
|
@ -51,10 +49,10 @@ public class CurShopTableArea implements Serializable {
|
|||
*/
|
||||
private String name;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updatedTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -132,7 +131,7 @@ public class CurShopTableBooking implements Serializable {
|
|||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
|
|
@ -148,7 +147,7 @@ public class CurShopTableBooking implements Serializable {
|
|||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,20 +1,18 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 商户储值会员 实体类。
|
||||
*
|
||||
|
|
@ -127,10 +125,10 @@ public class CurShopUser implements Serializable {
|
|||
*/
|
||||
private Integer sex;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,18 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户余额流水 实体类。
|
||||
*
|
||||
|
|
@ -74,7 +72,7 @@ adminRefund 管理员退款充值 adminOut管理员消费 adminInOut管理员充
|
|||
|
||||
private String remark;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -99,13 +98,13 @@ public class CurSysUser implements Serializable {
|
|||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -91,10 +90,10 @@ public class CurUserInfo implements Serializable {
|
|||
*/
|
||||
private String payPwd;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.czg.mergedata.cur.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.mergedata.cur.entity.CurOrderDetail;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 订单详情 映射层。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
public interface CurOrderDetailMapper extends BaseMapper<CurOrderDetail> {
|
||||
@Select("truncate tb_order_detail")
|
||||
void truncateTable();
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.czg.mergedata.cur.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.mergedata.cur.entity.CurOrderInfo;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 订单表 映射层。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
public interface CurOrderInfoMapper extends BaseMapper<CurOrderInfo> {
|
||||
@Select("truncate tb_order_info")
|
||||
void truncateTable();
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.mergedata.cur.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.mergedata.cur.entity.CurOrderDetail;
|
||||
|
||||
/**
|
||||
* 订单详情 服务层。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
public interface CurOrderDetailService extends IService<CurOrderDetail> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
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.CurOrderInfo;
|
||||
|
||||
/**
|
||||
* 订单表 服务层。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
public interface CurOrderInfoService extends IService<CurOrderInfo> {
|
||||
CzgResult<String> mergeOrderData();
|
||||
|
||||
CzgResult<String> mergeRefundOrderData();
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.czg.mergedata.cur.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.mergedata.cur.entity.CurOrderDetail;
|
||||
import com.czg.mergedata.cur.mapper.CurOrderDetailMapper;
|
||||
import com.czg.mergedata.cur.service.CurOrderDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 订单详情 服务层实现。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
@Service
|
||||
public class CurOrderDetailServiceImpl extends ServiceImpl<CurOrderDetailMapper, CurOrderDetail> implements CurOrderDetailService{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,369 @@
|
|||
package com.czg.mergedata.cur.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.mergedata.common.resp.CzgResult;
|
||||
import com.czg.mergedata.common.utils.PageUtils;
|
||||
import com.czg.mergedata.cur.entity.CurOrderDetail;
|
||||
import com.czg.mergedata.cur.entity.CurOrderInfo;
|
||||
import com.czg.mergedata.cur.entity.CurOrderPayment;
|
||||
import com.czg.mergedata.cur.entity.CurStaffIdRelation;
|
||||
import com.czg.mergedata.cur.mapper.CurOrderDetailMapper;
|
||||
import com.czg.mergedata.cur.mapper.CurOrderInfoMapper;
|
||||
import com.czg.mergedata.cur.mapper.CurOrderPaymentMapper;
|
||||
import com.czg.mergedata.cur.service.CurOrderDetailService;
|
||||
import com.czg.mergedata.cur.service.CurOrderInfoService;
|
||||
import com.czg.mergedata.cur.service.CurStaffIdRelationService;
|
||||
import com.czg.mergedata.old.entity.OldOrderDetail;
|
||||
import com.czg.mergedata.old.entity.OldOrderInfo;
|
||||
import com.czg.mergedata.old.service.OldOrderDetailService;
|
||||
import com.czg.mergedata.old.service.OldOrderInfoService;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 订单表 服务层实现。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CurOrderInfoServiceImpl extends ServiceImpl<CurOrderInfoMapper, CurOrderInfo> implements CurOrderInfoService {
|
||||
|
||||
@Resource
|
||||
private CurOrderDetailMapper curOrderDetailMapper;
|
||||
|
||||
@Resource
|
||||
private OldOrderInfoService oldOrderInfoService;
|
||||
|
||||
@Resource
|
||||
private CurOrderPaymentMapper curOrderPaymentMapper;
|
||||
|
||||
@Resource
|
||||
private CurStaffIdRelationService curStaffIdRelationService;
|
||||
|
||||
@Resource
|
||||
private OldOrderDetailService oldOrderDetailService;
|
||||
|
||||
@Resource
|
||||
private CurOrderDetailService curOrderDetailService;
|
||||
|
||||
private Date startTime;
|
||||
|
||||
private AtomicInteger index = new AtomicInteger(0);
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public CzgResult<String> mergeOrderData() {
|
||||
getMapper().truncateTable();
|
||||
curOrderDetailMapper.truncateTable();
|
||||
curOrderPaymentMapper.deleteByQuery(new QueryWrapper().in(CurOrderPayment::getPayType, "order", "refund"));
|
||||
|
||||
startTime = DateUtil.date();
|
||||
|
||||
index = new AtomicInteger(0);
|
||||
|
||||
execNotRefundOrderData(1L);
|
||||
|
||||
return CzgResult.success("迁移成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CzgResult<String> mergeRefundOrderData() {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void execNotRefundOrderData(Long pageIndex) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper().isNull(OldOrderInfo::getSource);
|
||||
Page<OldOrderInfo> pageInfo = oldOrderInfoService.page(PageUtils.buildPage(pageIndex, 7000L), queryWrapper);
|
||||
|
||||
if (pageInfo.getRecords().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<List<OldOrderInfo>> lists = ListUtil.splitAvg(pageInfo.getRecords(), 7);
|
||||
System.out.println(lists);
|
||||
|
||||
List<CompletableFuture<Void>> futures = new ArrayList<>();
|
||||
|
||||
for (List<OldOrderInfo> list : lists) {
|
||||
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> makeCurOrderInfo(list)).whenComplete((m, k) -> {
|
||||
log.info("一个任务已经完成。。。。");
|
||||
index.incrementAndGet();
|
||||
log.info("当前进度:{}", index.get());
|
||||
});
|
||||
futures.add(future);
|
||||
}
|
||||
|
||||
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).whenComplete((m, k) -> {
|
||||
Date endTime = new Date();
|
||||
log.info("所有任务已经完成 当前耗时:{}秒", (endTime.getTime() - startTime.getTime()) / 1000);
|
||||
|
||||
execNotRefundOrderData(pageInfo.getPageNumber() + 1);
|
||||
});
|
||||
}
|
||||
|
||||
private void makeCurOrderInfo(List<OldOrderInfo> oldOrderInfos) {
|
||||
List<CurOrderInfo> curOrderInfos = new ArrayList<>();
|
||||
List<CurOrderDetail> curOrderDetails = new ArrayList<>();
|
||||
|
||||
for (OldOrderInfo oldOrderInfo : oldOrderInfos) {
|
||||
CurOrderInfo curOrderInfo = new CurOrderInfo();
|
||||
curOrderInfo.setId(oldOrderInfo.getId());
|
||||
curOrderInfo.setOrderNo(oldOrderInfo.getOrderNo());
|
||||
curOrderInfo.setShopId(StrUtil.isBlank(oldOrderInfo.getShopId()) ? 0L : Long.parseLong(oldOrderInfo.getShopId()));
|
||||
curOrderInfo.setUserId(StrUtil.isBlank(oldOrderInfo.getUserId()) ? 0L : Long.parseLong(oldOrderInfo.getUserId()));
|
||||
curOrderInfo.setRefundAmount(oldOrderInfo.getRefundAmount());
|
||||
curOrderInfo.setOriginAmount(oldOrderInfo.getOriginAmount());
|
||||
curOrderInfo.setRoundAmount(oldOrderInfo.getSmallChange());
|
||||
curOrderInfo.setOrderAmount(oldOrderInfo.getOrderAmount());
|
||||
curOrderInfo.setPayAmount(oldOrderInfo.getPayAmount() == null ? BigDecimal.ZERO : oldOrderInfo.getPayAmount());
|
||||
curOrderInfo.setPointsDiscountAmount(oldOrderInfo.getPointsDiscountAmount() == null ? BigDecimal.ZERO : oldOrderInfo.getPointsDiscountAmount());
|
||||
curOrderInfo.setPointsNum(oldOrderInfo.getPointsNum() == null ? 0 : oldOrderInfo.getPointsNum().intValue());
|
||||
curOrderInfo.setProductCouponDiscountAmount(oldOrderInfo.getProductCouponDiscountAmount() == null ? BigDecimal.ZERO : oldOrderInfo.getProductCouponDiscountAmount());
|
||||
curOrderInfo.setCouponInfoList(oldOrderInfo.getCouponInfoList());
|
||||
curOrderInfo.setFullCouponDiscountAmount(oldOrderInfo.getFullCouponDiscountAmount() == null ? BigDecimal.ZERO : oldOrderInfo.getFullCouponDiscountAmount());
|
||||
curOrderInfo.setDiscountAmount(oldOrderInfo.getDiscountAmount() == null ? BigDecimal.ZERO : oldOrderInfo.getDiscountAmount());
|
||||
curOrderInfo.setDiscountRatio(oldOrderInfo.getDiscountRatio() == null ? BigDecimal.ZERO : oldOrderInfo.getDiscountRatio());
|
||||
curOrderInfo.setPackFee(oldOrderInfo.getPackFee() == null ? BigDecimal.ZERO : oldOrderInfo.getPackFee());
|
||||
curOrderInfo.setTableCode(oldOrderInfo.getTableId());
|
||||
curOrderInfo.setTableName(oldOrderInfo.getTableName());
|
||||
curOrderInfo.setOrderType("miniapp".equals(oldOrderInfo.getOrderType()) ? "miniapp" : "cash");
|
||||
curOrderInfo.setPlatformType(getPlatformType(oldOrderInfo));
|
||||
curOrderInfo.setDineMode(getDineMode(oldOrderInfo));
|
||||
curOrderInfo.setPayMode(getPayMode(oldOrderInfo));
|
||||
curOrderInfo.setPayType(getPayType(oldOrderInfo));
|
||||
curOrderInfo.setStatus(getOrderStatus(oldOrderInfo));
|
||||
curOrderInfo.setDiscountInfo("{}");
|
||||
curOrderInfo.setRefundAble(oldOrderInfo.getRefundAble());
|
||||
curOrderInfo.setPaidTime(DateUtil.toLocalDateTime(oldOrderInfo.getPaidTime() == null ? null : new Date(oldOrderInfo.getPaidTime())));
|
||||
curOrderInfo.setCreateTime(DateUtil.toLocalDateTime(oldOrderInfo.getCreatedAt() == null ? new Date() : new Date(oldOrderInfo.getCreatedAt())));
|
||||
curOrderInfo.setUpdateTime(DateUtil.toLocalDateTime(oldOrderInfo.getUpdatedAt() == null ? new Date() : new Date(oldOrderInfo.getUpdatedAt())));
|
||||
curOrderInfo.setPayOrderId(getPayOrderId(oldOrderInfo));
|
||||
curOrderInfo.setTradeDay(oldOrderInfo.getTradeDay());
|
||||
curOrderInfo.setRemark(oldOrderInfo.getRemark());
|
||||
curOrderInfo.setTakeCode(oldOrderInfo.getMasterId());
|
||||
curOrderInfo.setStaffId(getStaffId(oldOrderInfo));
|
||||
curOrderInfo.setPlaceNum(oldOrderInfo.getPlaceNum() == null ? 1 : oldOrderInfo.getPlaceNum());
|
||||
curOrderInfo.setSeatNum(oldOrderInfo.getSeatCount() == null ? 0 : oldOrderInfo.getSeatCount());
|
||||
curOrderInfo.setSeatAmount(oldOrderInfo.getSeatAmount() == null ? BigDecimal.ZERO : oldOrderInfo.getSeatAmount());
|
||||
curOrderInfo.setRefundRemark(oldOrderInfo.getRefundRemark());
|
||||
curOrderInfo.setIsFreeDine(oldOrderInfo.getIsFreeDine() == null ? 0 : oldOrderInfo.getIsFreeDine());
|
||||
curOrderInfo.setIsWaitCall(oldOrderInfo.getIsWaitCall() == null ? 0 : oldOrderInfo.getIsWaitCall());
|
||||
curOrderInfo.setCreditBuyerId(oldOrderInfo.getCreditBuyerId() == null ? 0L : Long.parseLong(oldOrderInfo.getCreditBuyerId()));
|
||||
curOrderInfo.setIsDel(oldOrderInfo.getIsDel());
|
||||
|
||||
curOrderInfos.add(curOrderInfo);
|
||||
|
||||
List<CurOrderDetail> details = getOrderDetails(oldOrderInfo);
|
||||
curOrderDetails.addAll(details);
|
||||
}
|
||||
|
||||
saveBatch(curOrderInfos);
|
||||
curOrderDetailService.saveBatch(curOrderDetails);
|
||||
}
|
||||
|
||||
private List<CurOrderDetail> getOrderDetails(OldOrderInfo oldOrderInfo) {
|
||||
List<CurOrderDetail> curOrderDetails = new ArrayList<>();
|
||||
|
||||
List<OldOrderDetail> list = oldOrderDetailService.list(new QueryWrapper().eq(OldOrderDetail::getOrderId, oldOrderInfo.getId()));
|
||||
|
||||
for (OldOrderDetail oldOrderDetail : list) {
|
||||
CurOrderDetail curOrderDetail = new CurOrderDetail();
|
||||
curOrderDetail.setId(Long.valueOf(oldOrderDetail.getId()));
|
||||
curOrderDetail.setOrderId(Long.valueOf(oldOrderDetail.getOrderId()));
|
||||
curOrderDetail.setShopId(StrUtil.isBlank(oldOrderInfo.getShopId()) ? 0L : Long.parseLong(oldOrderInfo.getShopId()));
|
||||
curOrderDetail.setProductId(oldOrderDetail.getProductId() == null ? 0L : Long.valueOf(oldOrderDetail.getProductId()));
|
||||
curOrderDetail.setProductImg(oldOrderDetail.getProductImg());
|
||||
curOrderDetail.setProductName(oldOrderDetail.getProductName());
|
||||
curOrderDetail.setProductType("");
|
||||
curOrderDetail.setSkuId(oldOrderDetail.getProductSkuId() == null ? 0L : Long.valueOf(oldOrderDetail.getProductSkuId()));
|
||||
curOrderDetail.setSkuName(oldOrderDetail.getProductSkuName());
|
||||
curOrderDetail.setPrice(oldOrderDetail.getPrice());
|
||||
curOrderDetail.setMemberPrice(oldOrderDetail.getMemberPrice());
|
||||
curOrderDetail.setDiscountSaleAmount(oldOrderDetail.getDiscountSaleAmount());
|
||||
curOrderDetail.setUnitPrice(oldOrderDetail.getPrice());
|
||||
curOrderDetail.setDiscountAmount(oldOrderInfo.getDiscountAmount());
|
||||
curOrderDetail.setPackAmount(oldOrderDetail.getPackAmount());
|
||||
curOrderDetail.setPayAmount(oldOrderDetail.getPriceAmount());
|
||||
curOrderDetail.setReturnAmount(BigDecimal.ZERO);
|
||||
curOrderDetail.setReturnNum(BigDecimal.ZERO);
|
||||
curOrderDetail.setNum(oldOrderDetail.getNum());
|
||||
curOrderDetail.setPackNumber(oldOrderDetail.getPackAmount().compareTo(BigDecimal.ZERO) > 0 ? new BigDecimal(1) : new BigDecimal(0));
|
||||
curOrderDetail.setCouponNum(oldOrderDetail.getUserCouponId() == null ? BigDecimal.ZERO : new BigDecimal(1));
|
||||
curOrderDetail.setReturnNum(BigDecimal.ZERO);
|
||||
curOrderDetail.setRefundNum(oldOrderDetail.getReturnNum());
|
||||
curOrderDetail.setDiscountSaleNote(oldOrderDetail.getDiscountSaleNote());
|
||||
curOrderDetail.setStatus(getOrderDetailStatus(oldOrderDetail));
|
||||
curOrderDetail.setPlaceNum(oldOrderDetail.getPlaceNum());
|
||||
curOrderDetail.setIsTemporary(oldOrderDetail.getIsTemporary());
|
||||
curOrderDetail.setIsPrint(oldOrderDetail.getIsPrint());
|
||||
curOrderDetail.setIsWaitCall(oldOrderDetail.getIsWaitCall());
|
||||
curOrderDetail.setProGroupInfo(oldOrderDetail.getProGroupInfo());
|
||||
curOrderDetail.setRemark(oldOrderDetail.getNote());
|
||||
curOrderDetail.setRefundRemark(oldOrderInfo.getRefundRemark());
|
||||
curOrderDetail.setCreateTime(oldOrderDetail.getCreateTime());
|
||||
curOrderDetail.setUpdateTime(oldOrderDetail.getUpdateTime());
|
||||
|
||||
curOrderDetails.add(curOrderDetail);
|
||||
}
|
||||
|
||||
return curOrderDetails;
|
||||
}
|
||||
|
||||
private String getPlatformType(OldOrderInfo oldOrderInfo) {
|
||||
if ("ali_lite".equals(oldOrderInfo.getPayType())) {
|
||||
return "ALI";
|
||||
}
|
||||
if ("wx_lite".equals(oldOrderInfo.getPayType())) {
|
||||
return "WX";
|
||||
}
|
||||
return "PC";
|
||||
}
|
||||
|
||||
private String getDineMode(OldOrderInfo oldOrderInfo) {
|
||||
if (StrUtil.isBlank(oldOrderInfo.getUseType())) {
|
||||
return "dine-in";
|
||||
}
|
||||
|
||||
if (oldOrderInfo.getUseType().contains("dine-i") || "afterPay".equals(oldOrderInfo.getUseType())) {
|
||||
return "dine-in";
|
||||
}
|
||||
|
||||
return "dine-out";
|
||||
}
|
||||
|
||||
private String getPayMode(OldOrderInfo oldOrderInfo) {
|
||||
if (StrUtil.isBlank(oldOrderInfo.getTableId())) {
|
||||
return "no-table";
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(oldOrderInfo.getUseType())) {
|
||||
return "before-pay";
|
||||
}
|
||||
|
||||
return "after-pay";
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付类型
|
||||
* 主扫 main_scan
|
||||
* 被扫 back_scan
|
||||
* 微信小程序 wechat_mini
|
||||
* 支付宝小程序 alipay_mini
|
||||
* 会员支付 vip_pay
|
||||
* 现金支付 cash_pay
|
||||
* 挂账支付 credit_pay
|
||||
*/
|
||||
private String getPayType(OldOrderInfo oldOrderInfo) {
|
||||
if (StrUtil.isBlank(oldOrderInfo.getPayType())) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String type = "";
|
||||
switch (oldOrderInfo.getPayType()) {
|
||||
case "scanCode" -> type = "back_scan";
|
||||
case "cash" -> type = "cash_pay";
|
||||
case "deposit" -> type = "vip_pay";
|
||||
case "wx_lite", "WECHAT", "wechatPay" -> type = "wechat_mini";
|
||||
case "ali_lite", "ALIPAY" -> type = "alipay_mini";
|
||||
case "creditBuyer" -> type = "credit_pay";
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
* unpaid-待支付;
|
||||
* in-production 制作中;
|
||||
* wait-out 待取餐;
|
||||
* done 订单完成;
|
||||
* refunding-申请退单;
|
||||
* refund-退单;
|
||||
* part-refund 部分退单;
|
||||
* cancelled-取消订单
|
||||
*/
|
||||
private String getOrderStatus(OldOrderInfo oldOrderInfo) {
|
||||
String status = "";
|
||||
|
||||
switch (oldOrderInfo.getStatus()) {
|
||||
case "paying", "pending", "unpaid" -> status = "unpaid";
|
||||
case "cancelled", "cancel", "fail" -> status = "cancelled";
|
||||
case "closed" -> status = "done";
|
||||
case "refund" -> status = "refund";
|
||||
case "refunding" -> status = "refunding";
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
private Long getPayOrderId(OldOrderInfo oldOrderInfo) {
|
||||
if (StrUtil.isBlank(oldOrderInfo.getPayOrderNo())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CurOrderPayment curOrderPayment = new CurOrderPayment();
|
||||
curOrderPayment.setShopId(Long.valueOf(oldOrderInfo.getShopId()));
|
||||
curOrderPayment.setSourceId(oldOrderInfo.getId());
|
||||
curOrderPayment.setPayType("order");
|
||||
curOrderPayment.setOrderNo(oldOrderInfo.getPayOrderNo() + "_O");
|
||||
curOrderPayment.setAmount(oldOrderInfo.getAmount() == null ? BigDecimal.ZERO : oldOrderInfo.getAmount());
|
||||
curOrderPayment.setPayTime(DateUtil.toLocalDateTime(oldOrderInfo.getUpdatedAt() == null ? new Date() : new Date(oldOrderInfo.getUpdatedAt())));
|
||||
curOrderPayment.setRespJson("{}");
|
||||
|
||||
curOrderPaymentMapper.insert(curOrderPayment);
|
||||
|
||||
return curOrderPayment.getId();
|
||||
}
|
||||
|
||||
private Long getStaffId(OldOrderInfo oldOrderInfo) {
|
||||
if (oldOrderInfo.getStaffId() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CurStaffIdRelation one = curStaffIdRelationService.getOne(new QueryWrapper().eq(CurStaffIdRelation::getOldStaffId, oldOrderInfo.getStaffId()));
|
||||
if (one == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return one.getCurStaffId();
|
||||
}
|
||||
|
||||
/**
|
||||
* wait-pay 待支付;
|
||||
* in-production 制作中;
|
||||
* wait-out 待取餐;
|
||||
* refunding 退款中;
|
||||
* part-refund 部分退单;
|
||||
* refund-退单;
|
||||
* done 完成;
|
||||
* cancelled 取消;
|
||||
*/
|
||||
private String getOrderDetailStatus(OldOrderDetail oldOrderDetail) {
|
||||
String status = "";
|
||||
switch (oldOrderDetail.getStatus()) {
|
||||
case "paying", "pending", "unpaid" -> status = "wait-pay";
|
||||
case "cancelled", "cancel", "fail" -> status = "cancelled";
|
||||
case "closed" -> status = "done";
|
||||
case "refund" -> status = "refund";
|
||||
case "refunding" -> status = "refunding";
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.czg.mergedata.cur.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.czg.mergedata.common.resp.CzgResult;
|
||||
import com.czg.mergedata.common.utils.PageUtils;
|
||||
|
|
@ -20,8 +21,10 @@ import jakarta.annotation.Resource;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* 商户储值会员 服务层实现。
|
||||
|
|
@ -50,39 +53,63 @@ public class CurShopUserServiceImpl extends ServiceImpl<CurShopUserMapper, CurSh
|
|||
getMapper().truncateTable();
|
||||
curUserInfoMapper.truncateTable();
|
||||
|
||||
execUserInfo();
|
||||
execShopUser();
|
||||
execUserInfo(1L);
|
||||
execShopUser(1L);
|
||||
|
||||
return CzgResult.success("处理成功");
|
||||
}
|
||||
|
||||
private void execUserInfo() {
|
||||
private void execUserInfo(Long pageIndex) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.ne(OldUserInfo::getId, 1);
|
||||
|
||||
Page<OldUserInfo> page = oldUserInfoService.page(PageUtils.buildPage(), queryWrapper);
|
||||
Page<OldUserInfo> page = oldUserInfoService.page(PageUtils.buildPage(pageIndex, 5000L), queryWrapper);
|
||||
|
||||
while (!page.getRecords().isEmpty()) {
|
||||
saveCurUserInfo(page.getRecords());
|
||||
|
||||
page = oldUserInfoService.page(PageUtils.buildPage(page.getPageNumber() + 1), queryWrapper);
|
||||
if (page.getRecords().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<List<OldUserInfo>> lists = ListUtil.splitAvg(page.getRecords(), 10);
|
||||
|
||||
List<CompletableFuture<Void>> futures = new ArrayList<>();
|
||||
|
||||
for (List<OldUserInfo> list : lists) {
|
||||
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> saveCurUserInfo(list)).whenComplete((m, k) -> System.out.println("一个任务已经完成。。。。"));
|
||||
futures.add(future);
|
||||
}
|
||||
|
||||
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).whenComplete((m, k) -> {
|
||||
System.out.println("所有任务已经完成 m = " + m + " k = " + k);
|
||||
execUserInfo(page.getPageNumber() + 1);
|
||||
});
|
||||
}
|
||||
|
||||
private void execShopUser() {
|
||||
Page<OldShopUser> page = oldShopUserService.page(PageUtils.buildPage());
|
||||
private void execShopUser(Long pageIndex) {
|
||||
Page<OldShopUser> page = oldShopUserService.page(PageUtils.buildPage(pageIndex, 5000L));
|
||||
|
||||
while (!page.getRecords().isEmpty()) {
|
||||
saveCurShopUser(page.getRecords());
|
||||
|
||||
page = oldShopUserService.page(PageUtils.buildPage(page.getPageNumber() + 1));
|
||||
if (page.getRecords().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<List<OldShopUser>> lists = ListUtil.splitAvg(page.getRecords(), 10);
|
||||
|
||||
List<CompletableFuture<Void>> futures = new ArrayList<>();
|
||||
|
||||
for (List<OldShopUser> list : lists) {
|
||||
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> saveCurShopUser(list)).whenComplete((m, k) -> System.out.println("一个任务已经完成。。。。"));
|
||||
futures.add(future);
|
||||
}
|
||||
|
||||
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).whenComplete((m, k) -> {
|
||||
System.out.println("所有任务已经完成 m = " + m + " k = " + k);
|
||||
execShopUser(page.getPageNumber() + 1);
|
||||
});
|
||||
}
|
||||
|
||||
private void saveCurUserInfo(List<OldUserInfo> oldUserInfoList) {
|
||||
// List<CurUserInfo> curShopUserList = new ArrayList<>();
|
||||
// oldUserInfoList.forEach();
|
||||
List<CurUserInfo> curShopUserList =oldUserInfoList.stream().map(oldUserInfo -> {
|
||||
List<CurUserInfo> curShopUserList = oldUserInfoList.stream().map(oldUserInfo -> {
|
||||
CurUserInfo curUserInfo = new CurUserInfo();
|
||||
curUserInfo.setId(Long.valueOf(oldUserInfo.getId()));
|
||||
curUserInfo.setHeadImg(oldUserInfo.getHeadImg());
|
||||
|
|
@ -96,9 +123,10 @@ public class CurShopUserServiceImpl extends ServiceImpl<CurShopUserMapper, CurSh
|
|||
curUserInfo.setWechatOpenId(oldUserInfo.getMiniAppOpenId());
|
||||
}
|
||||
curUserInfo.setStatus(oldUserInfo.getStatus());
|
||||
curUserInfo.setLastLoginTime(DateUtil.toLocalDateTime(oldUserInfo.getLastLeaveAt() == null ? new Date() : new Date(oldUserInfo.getLastLeaveAt())));
|
||||
curUserInfo.setLastLoginTime(DateUtil.toLocalDateTime(oldUserInfo.getLastLogInAt() == null ? new Date() : new Date(oldUserInfo.getLastLogInAt())));
|
||||
curUserInfo.setPayPwd(oldUserInfo.getPwd());
|
||||
curUserInfo.setCreateTime(DateUtil.toLocalDateTime(oldUserInfo.getCreatedAt() == null? new Date() : new Date(oldUserInfo.getCreatedAt())));
|
||||
curUserInfo.setCreateTime(DateUtil.toLocalDateTime(oldUserInfo.getCreatedAt() == null ? new Date() : new Date(oldUserInfo.getCreatedAt())));
|
||||
curUserInfo.setUpdateTime(DateUtil.toLocalDateTime(oldUserInfo.getUpdatedAt() == null ? new Date() : new Date(oldUserInfo.getUpdatedAt())));
|
||||
|
||||
return curUserInfo;
|
||||
}).toList();
|
||||
|
|
@ -128,6 +156,7 @@ public class CurShopUserServiceImpl extends ServiceImpl<CurShopUserMapper, CurSh
|
|||
curShopUser.setBirthDay(oldShopUser.getBirthDay());
|
||||
curShopUser.setSex(curShopUser.getSex());
|
||||
curShopUser.setCreateTime(DateUtil.toLocalDateTime(oldShopUser.getCreatedAt() == null ? new Date() : new Date(oldShopUser.getCreatedAt())));
|
||||
curShopUser.setUpdateTime(DateUtil.toLocalDateTime(oldShopUser.getUpdatedAt() == null ? new Date() : new Date(oldShopUser.getUpdatedAt())));
|
||||
|
||||
return curShopUser;
|
||||
}).toList();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -65,10 +64,10 @@ public class OldActivate implements Serializable {
|
|||
*/
|
||||
private Integer num;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,18 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 活动商品赠送记录表 实体类。
|
||||
*
|
||||
|
|
@ -101,10 +99,10 @@ public class OldActivateInRecord implements Serializable {
|
|||
*/
|
||||
private LocalDateTime useEndTime;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private String couponJson;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -70,10 +69,10 @@ public class OldActivateOutRecord implements Serializable {
|
|||
*/
|
||||
private String status;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 叫号配置表 实体类。
|
||||
*
|
||||
|
|
@ -68,10 +66,10 @@ public class OldCallConfig implements Serializable {
|
|||
*/
|
||||
private Integer shopId;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 叫号排号表 实体类。
|
||||
*
|
||||
|
|
@ -66,7 +64,7 @@ public class OldCallQueue implements Serializable {
|
|||
/**
|
||||
* 排号时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 叫号桌型表 实体类。
|
||||
*
|
||||
|
|
@ -78,10 +76,10 @@ public class OldCallTable implements Serializable {
|
|||
*/
|
||||
private String qrcode;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.czg.mergedata.old.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
|
|
@ -37,10 +36,10 @@ public class OldCouponCategory implements Serializable {
|
|||
*/
|
||||
private String name;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 活动赠送商品表 实体类。
|
||||
*
|
||||
|
|
@ -48,10 +46,10 @@ public class OldCouponProduct implements Serializable {
|
|||
*/
|
||||
private Integer num;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -84,7 +83,7 @@ public class OldMemberPointsLog implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,185 @@
|
|||
package com.czg.mergedata.old.entity;
|
||||
|
||||
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-03-13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_order_detail")
|
||||
public class OldOrderDetail implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Integer id;
|
||||
|
||||
private Integer orderId;
|
||||
|
||||
private Integer shopId;
|
||||
|
||||
private Integer productId;
|
||||
|
||||
private Integer productSkuId;
|
||||
|
||||
private BigDecimal num;
|
||||
|
||||
private String productName;
|
||||
|
||||
private String productSkuName;
|
||||
|
||||
private String productImg;
|
||||
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 商品售价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 会员单价
|
||||
*/
|
||||
private BigDecimal memberPrice;
|
||||
|
||||
/**
|
||||
* 总价格 包含打包费
|
||||
*/
|
||||
private BigDecimal priceAmount;
|
||||
|
||||
/**
|
||||
* return 已退菜 closed 完成 refund 已退款 refunding 退款中
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 打包费
|
||||
*/
|
||||
private BigDecimal packAmount;
|
||||
|
||||
/**
|
||||
* 退单数量
|
||||
*/
|
||||
private BigDecimal returnNum;
|
||||
|
||||
/**
|
||||
* vip专属
|
||||
*/
|
||||
private Integer isVip;
|
||||
|
||||
/**
|
||||
* 当前下单次数
|
||||
*/
|
||||
private Integer placeNum;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String note;
|
||||
|
||||
private Integer cartId;
|
||||
|
||||
/**
|
||||
* 用餐类型
|
||||
*/
|
||||
private String useType;
|
||||
|
||||
/**
|
||||
* 退款备注
|
||||
*/
|
||||
private String refundRemark;
|
||||
|
||||
/**
|
||||
* 抵扣的优惠券id
|
||||
*/
|
||||
private Integer userCouponId;
|
||||
|
||||
/**
|
||||
* 是否使用了会员价
|
||||
*/
|
||||
private Integer isMember;
|
||||
|
||||
/**
|
||||
* 是否是临时菜品
|
||||
*/
|
||||
private Integer isTemporary;
|
||||
|
||||
/**
|
||||
* 单品改价折扣金额
|
||||
*/
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/**
|
||||
* 单口改价备注
|
||||
*/
|
||||
private String discountSaleNote;
|
||||
|
||||
/**
|
||||
* 是否打票
|
||||
*/
|
||||
private Integer isPrint;
|
||||
|
||||
/**
|
||||
* 使用的优惠券信息
|
||||
*/
|
||||
private String useCouponInfo;
|
||||
|
||||
/**
|
||||
* 实际退款金额
|
||||
*/
|
||||
private BigDecimal returnAmount;
|
||||
|
||||
/**
|
||||
* 可退金额
|
||||
*/
|
||||
private BigDecimal canReturnAmount;
|
||||
|
||||
/**
|
||||
* 是否使用了团购券
|
||||
*/
|
||||
private Integer isThirdCoupon;
|
||||
|
||||
/**
|
||||
* 是否等叫
|
||||
*/
|
||||
private Integer isWaitCall;
|
||||
|
||||
/**
|
||||
* 单品改价金额
|
||||
*/
|
||||
private BigDecimal discountSaleAmount;
|
||||
|
||||
/**
|
||||
* 套餐商品选择信息
|
||||
*/
|
||||
private String proGroupInfo;
|
||||
|
||||
/**
|
||||
* 是否称重商品
|
||||
*/
|
||||
private Integer isWeight;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,353 @@
|
|||
package com.czg.mergedata.old.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 订单表 实体类。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_order_info")
|
||||
public class OldOrderInfo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 商户结算金额
|
||||
*/
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
/**
|
||||
* 商品售价
|
||||
*/
|
||||
private BigDecimal productAmount;
|
||||
|
||||
/**
|
||||
* 退单金额
|
||||
*/
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 订单原金额 不含折扣价格
|
||||
*/
|
||||
private BigDecimal originAmount;
|
||||
|
||||
/**
|
||||
* 订单金额 (扣除各类折扣)
|
||||
*/
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
/**
|
||||
* 实际支付金额
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 最终金额---退单后,金额变动
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 订单邮递费用
|
||||
*/
|
||||
private BigDecimal freightAmount;
|
||||
|
||||
/**
|
||||
* 使用的积分数量
|
||||
*/
|
||||
private BigDecimal pointsNum;
|
||||
|
||||
/**
|
||||
* 积分抵扣金额
|
||||
*/
|
||||
private BigDecimal pointsDiscountAmount;
|
||||
|
||||
/**
|
||||
* 商品优惠券抵扣金额
|
||||
*/
|
||||
private BigDecimal productCouponDiscountAmount;
|
||||
|
||||
/**
|
||||
* 折扣金额
|
||||
*/
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/**
|
||||
* 用户使用的卡券
|
||||
*/
|
||||
private String couponInfoList;
|
||||
|
||||
/**
|
||||
* 满减优惠券抵扣金额
|
||||
*/
|
||||
private BigDecimal fullCouponDiscountAmount;
|
||||
|
||||
/**
|
||||
* 折扣比例
|
||||
*/
|
||||
private BigDecimal discountRatio;
|
||||
|
||||
/**
|
||||
* 包装费
|
||||
*/
|
||||
private BigDecimal packFee;
|
||||
|
||||
/**
|
||||
* 支付类型
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 台桌Id
|
||||
*/
|
||||
private String tableId;
|
||||
|
||||
/**
|
||||
* 订单抹零
|
||||
*/
|
||||
private BigDecimal smallChange;
|
||||
|
||||
/**
|
||||
* 发货类型post快递,takeaway外卖,takeself,自提table---堂食
|
||||
*/
|
||||
private String sendType;
|
||||
|
||||
/**
|
||||
* 订单类型-cash收银-miniapp小程序-offline线下,return 退单 coupon 团购订单
|
||||
|
||||
*/
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 订单里面商品的类型
|
||||
*/
|
||||
private String productType;
|
||||
|
||||
/**
|
||||
* 状态: unpaid-待支付;unsend-待发货;closed-订单完成;send-已发;refunding-申请退单;refund-退单;cancelled-取消订单;merge-合台;paying-正在支付;
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* orderType为union-minor时,parentId生效,为其上级合单id
|
||||
*/
|
||||
private String billingId;
|
||||
|
||||
/**
|
||||
* 对于平台订单,是收款商户Id
|
||||
*/
|
||||
private String merchantId;
|
||||
|
||||
/**
|
||||
* 店铺Id
|
||||
*/
|
||||
private String shopId;
|
||||
|
||||
/**
|
||||
* 是否vip订单
|
||||
*/
|
||||
private Integer isVip;
|
||||
|
||||
/**
|
||||
* 商户会员Id shop_user的id
|
||||
*/
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 用户Id user_info表的id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 该订单商品赠送的积分
|
||||
*/
|
||||
private Integer productScore;
|
||||
|
||||
/**
|
||||
* 抵扣积分
|
||||
*/
|
||||
private Integer deductScore;
|
||||
|
||||
/**
|
||||
* 用户使用的卡券
|
||||
*/
|
||||
private String userCouponId;
|
||||
|
||||
private BigDecimal activateInDiscountAmount;
|
||||
|
||||
/**
|
||||
* 是否是后付费 0 先付费 1 后付费
|
||||
*/
|
||||
private Integer isPostpaid;
|
||||
|
||||
/**
|
||||
* 是否等叫 0 否 1 等叫
|
||||
*/
|
||||
private Integer isWaitCall;
|
||||
|
||||
/**
|
||||
* 挂账人id
|
||||
*/
|
||||
private String creditBuyerId;
|
||||
|
||||
/**
|
||||
* 满减优惠券抵扣金额
|
||||
*/
|
||||
private BigDecimal fullReductionCouponAmount;
|
||||
|
||||
/**
|
||||
* 是否支持退款,1支持退单, 0不支持退单
|
||||
*/
|
||||
private Integer refundAble;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private Long paidTime;
|
||||
|
||||
/**
|
||||
* 是否生效,若订单合单之后,则原订单不会生效
|
||||
*/
|
||||
private Integer isEffect;
|
||||
|
||||
/**
|
||||
* 是否合台
|
||||
*/
|
||||
private Integer isGroup;
|
||||
|
||||
private Long updatedAt;
|
||||
|
||||
/**
|
||||
* 系统时间
|
||||
*/
|
||||
private Long systemTime;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
/**
|
||||
* 收银台是否已接单
|
||||
*/
|
||||
private Integer isAccepted;
|
||||
|
||||
/**
|
||||
* 支付订单号
|
||||
*/
|
||||
private String payOrderNo;
|
||||
|
||||
/**
|
||||
* 交易日期
|
||||
*/
|
||||
private String tradeDay;
|
||||
|
||||
/**
|
||||
* 原订单Id (退款单专用)
|
||||
*/
|
||||
private Integer source;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 取餐码
|
||||
*/
|
||||
private String masterId;
|
||||
|
||||
/**
|
||||
* 付款备注
|
||||
*/
|
||||
private String payRemark;
|
||||
|
||||
/**
|
||||
* 桌码
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 是否购买优惠券
|
||||
*/
|
||||
private String isBuyCoupon;
|
||||
|
||||
/**
|
||||
* 是否使用优惠券
|
||||
*/
|
||||
private String isUseCoupon;
|
||||
|
||||
/**
|
||||
* 取餐号
|
||||
*/
|
||||
private String outNumber;
|
||||
|
||||
/**
|
||||
* 用餐类型
|
||||
*/
|
||||
private String useType;
|
||||
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
private Integer staffId;
|
||||
|
||||
/**
|
||||
* 是否回收站 0-否,1回收站
|
||||
*/
|
||||
private Integer isDel;
|
||||
|
||||
/**
|
||||
* 当前订单下单次数
|
||||
*/
|
||||
private Integer placeNum;
|
||||
|
||||
/**
|
||||
* 用餐人数
|
||||
*/
|
||||
private Integer seatCount;
|
||||
|
||||
/**
|
||||
* 餐位费
|
||||
*/
|
||||
private BigDecimal seatAmount;
|
||||
|
||||
/**
|
||||
* 退款备注
|
||||
*/
|
||||
private String refundRemark;
|
||||
|
||||
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 是否使用了霸王餐
|
||||
*/
|
||||
private Integer isFreeDine;
|
||||
|
||||
private BigDecimal userCouponAmount;
|
||||
|
||||
private String useCouponInfo;
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -64,7 +63,7 @@ public class OldPadLayout implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
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;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Pad商品自定义分类 实体类。
|
||||
*
|
||||
|
|
@ -69,13 +67,13 @@ public class OldPadProductCategory implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -49,7 +48,7 @@ public class OldPadProductCategoryDetail implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -95,7 +94,7 @@ public class OldPointsBasicSetting implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -145,13 +144,13 @@ public class OldPointsExchangeRecord implements Serializable {
|
|||
/**
|
||||
* 创建时间(下单时间)
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间(核销时间)
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -95,13 +94,13 @@ public class OldPointsGoodsSetting implements Serializable {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -135,10 +134,10 @@ public class OldShopCoupon implements Serializable {
|
|||
*/
|
||||
private Integer status;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,19 @@
|
|||
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.sql.Date;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Date;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 店铺台桌预订 实体类。
|
||||
*
|
||||
|
|
@ -132,7 +130,7 @@ public class OldShopTableBooking implements Serializable {
|
|||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
|
|
@ -148,7 +146,7 @@ public class OldShopTableBooking implements Serializable {
|
|||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -44,7 +43,7 @@ public class OldShopUserFlow implements Serializable {
|
|||
|
||||
private String bizName;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private String type;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -109,13 +108,13 @@ public class OldSysUser implements Serializable {
|
|||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.OldOrderDetail;
|
||||
|
||||
/**
|
||||
* 映射层。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
@UseDataSource("ds2")
|
||||
public interface OldOrderDetailMapper extends BaseMapper<OldOrderDetail> {
|
||||
|
||||
}
|
||||
|
|
@ -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.OldOrderInfo;
|
||||
|
||||
/**
|
||||
* 订单表 映射层。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
@UseDataSource("ds2")
|
||||
public interface OldOrderInfoMapper extends BaseMapper<OldOrderInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.mergedata.old.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.mergedata.old.entity.OldOrderDetail;
|
||||
|
||||
/**
|
||||
* 服务层。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
public interface OldOrderDetailService extends IService<OldOrderDetail> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.mergedata.old.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.mergedata.old.entity.OldOrderInfo;
|
||||
|
||||
/**
|
||||
* 订单表 服务层。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
public interface OldOrderInfoService extends IService<OldOrderInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.czg.mergedata.old.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.mergedata.old.entity.OldOrderDetail;
|
||||
import com.czg.mergedata.old.mapper.OldOrderDetailMapper;
|
||||
import com.czg.mergedata.old.service.OldOrderDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 服务层实现。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
@Service
|
||||
public class OldOrderDetailServiceImpl extends ServiceImpl<OldOrderDetailMapper, OldOrderDetail> implements OldOrderDetailService{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.czg.mergedata.old.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.mergedata.old.entity.OldOrderInfo;
|
||||
import com.czg.mergedata.old.mapper.OldOrderInfoMapper;
|
||||
import com.czg.mergedata.old.service.OldOrderInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 订单表 服务层实现。
|
||||
*
|
||||
* @author mac
|
||||
* @since 2025-03-13
|
||||
*/
|
||||
@Service
|
||||
public class OldOrderInfoServiceImpl extends ServiceImpl<OldOrderInfoMapper, OldOrderInfo> implements OldOrderInfoService{
|
||||
|
||||
}
|
||||
|
|
@ -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.CurOrderDetailMapper">
|
||||
|
||||
</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.CurOrderInfoMapper">
|
||||
|
||||
</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.OldOrderDetailMapper">
|
||||
|
||||
</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.OldOrderInfoMapper">
|
||||
|
||||
</mapper>
|
||||
10
收银机数据迁移关系.md
10
收银机数据迁移关系.md
|
|
@ -119,4 +119,14 @@
|
|||
- tb_pad_product_category_detail 表
|
||||
|
||||
|
||||
### 17. 订单
|
||||
> /merge/order/mergeOrder
|
||||
#### 执行表
|
||||
- tb_order_info 表
|
||||
- tb_order_detail 表
|
||||
|
||||
|
||||
### 18. 退款订单
|
||||
> /merge/order/mergeRefundOrder
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue