yuhongqi hace 4 semanas
padre
commit
68e9ee8e90

+ 14 - 0
fs-admin/src/main/resources/application.yml

@@ -11,4 +11,18 @@ spring:
 #    active: druid-sft
 #    active: druid-fby
     active: dev
+  liquibase:
+    # 是否启用 Liquibase
+    enabled: true
+    # changelog 文件路径(只扫描 liquibase 目录下的文件)
+    change-log: "classpath:liquibase/db.changelog-master.yml"
+    # 默认数据源(使用 master 数据源)
+    default-schema:
+    # 是否删除数据库锁
+    drop-first: false
+    parameters:
+      # 校验和控制
+      liquibase.validateCheckSum: false
+      liquibase.validCheckSum: "*"
+      liquibase.duplicateFileMode: "RERUN"
 

+ 55 - 0
fs-framework/src/main/java/com/fs/framework/config/LiquibaseConfig.java

@@ -0,0 +1,55 @@
+package com.fs.framework.config;
+
+import liquibase.integration.spring.SpringLiquibase;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.sql.DataSource;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Liquibase 配置类
+ * 配置 Liquibase 使用 master 数据源
+ * 注入 DataSourceConfig 中的 mysql 主数据源
+ */
+@Configuration
+@EnableConfigurationProperties(LiquibaseProperties.class)
+public class LiquibaseConfig {
+
+    /**
+     * 配置 Liquibase,使用 DataSourceConfig 中的 master 数据源
+     */
+    @Bean
+    public SpringLiquibase liquibase(@Qualifier("masterDataSource") DataSource masterDataSource,
+                                     LiquibaseProperties properties) {
+        // 跳过校验和验证(允许修改已执行的 changeset)
+        SpringLiquibase liquibase = new SpringLiquibase();
+        liquibase.setDataSource(masterDataSource);
+        liquibase.setChangeLog("classpath:liquibase/db.changelog-master.yml");
+        liquibase.setContexts(properties.getContexts());
+        liquibase.setDefaultSchema(properties.getDefaultSchema());
+        liquibase.setDropFirst(properties.isDropFirst());
+        liquibase.setShouldRun(properties.isEnabled());
+        liquibase.setLabels(properties.getLabels());
+
+        // 设置参数,包括跳过校验和验证
+        Map<String, String> parameters = new HashMap<>();
+        if (properties.getParameters() != null) {
+            parameters.putAll(properties.getParameters());
+        }
+        // 强制设置跳过校验和
+        parameters.put("liquibase.validateCheckSum", "false");
+        parameters.put("liquibase.validCheckSum", "*");
+        parameters.put("liquibase.duplicateFileMode", "RERUN");
+
+        parameters.put("liquibase.hub.mode", "off");  // 关闭 Liquibase Hub
+        liquibase.setChangeLogParameters(parameters);
+        
+        liquibase.setRollbackFile(properties.getRollbackFile());
+        return liquibase;
+    }
+}

+ 11 - 0
fs-service/pom.xml

@@ -298,6 +298,17 @@
             <version>1.0.250</version>
         </dependency>
 
+        <!-- Liquibase 数据库版本管理 -->
+        <dependency>
+            <groupId>org.liquibase</groupId>
+            <artifactId>liquibase-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid</artifactId>
+            <version>1.2.8</version>
+            <scope>compile</scope>
+        </dependency>
 
     </dependencies>
 

+ 254 - 4
fs-service/src/main/java/com/fs/live/vo/LiveOrderVo.java

@@ -1,13 +1,263 @@
 package com.fs.live.vo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.hisStore.vo.FsStoreOrderItemVO;
 import lombok.Data;
 
+import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
+/**
+ * 订单对象 live_order
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
 @Data
-public class LiveOrderVo {
-    private String timeOptions;
-    private String timeGranularity;
-    private String liveId;
+public class LiveOrderVO implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 订单ID */
+    private Long id;
+
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderCode;
+    @Excel(name = "会员ID")
+    private Long userId;
+    /** 额外订单号 */
+    @Excel(name = "管易云订单号")
+    private String extendOrderId;
+
+    @Excel(name = "所属公司")
+    private String companyName;
+    @Excel(name = "所属销售")
+    private String companyUserNickName;
+    @Excel(name = "销售电话")
+    private String companyUserePhonenumber;
+
+    @Excel(name = "推线编号")
+    private String registerCode;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "推线时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date registerDate;
+
+    @Excel(name = "渠道来源")
+    private String source;
+
+    @Excel(name = "成单类型", dictType = "store_order_type")
+    private String orderType;
+
+
+
+    /** 用户姓名 */
+    @Excel(name = "收货人姓名")
+    private String realName;
+
+    /** 用户电话 */
+    @Excel(name = "收货人电话")
+    private String userPhone;
+
+    /** 详细地址 */
+    @Excel(name = "详细地址")
+    private String userAddress;
+
+    /** 购物车id */
+    private String cartId;
+
+    /** 运费金额 */
+    private BigDecimal freightPrice;
+
+    /** 订单商品总数 */
+    private Long totalNum;
+
+    /** 订单总价 */
+    @Excel(name = "商品金额",cellType= Excel.ColumnType.NUMERIC)
+    private BigDecimal totalPrice;
+
+    /** 邮费 */
+    private BigDecimal totalPostage;
+
+    /** 实际支付金额 */
+    @Excel(name = "应付金额",cellType= Excel.ColumnType.NUMERIC)
+    private BigDecimal payPrice;
+
+    @Excel(name = "实付金额",cellType= Excel.ColumnType.NUMERIC)
+    private BigDecimal payMoney;
+
+    @Excel(name = "尾款实付金额",cellType= Excel.ColumnType.NUMERIC)
+    private BigDecimal lastPayMoney;
+
+    @Excel(name = "物流代收金额",cellType= Excel.ColumnType.NUMERIC)
+    private BigDecimal payDelivery;
+
+
+    /** 支付邮费 */
+
+    private BigDecimal payPostage;
+
+    /** 抵扣金额 */
+    private BigDecimal deductionPrice;
+
+    /** 优惠券id */
+    private Long couponId;
+
+    /** 优惠券金额 */
+    @Excel(name = "优惠券金额",cellType= Excel.ColumnType.NUMERIC)
+    private BigDecimal couponPrice;
+
+    /** 支付状态 */
+    private Integer paid;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date payTime;
+
+    /** 支付方式 */
+//    @Excel(name = "支付方式")
+    private String payType;
+
+    /** 订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货;3:已完成;-1:已退款) */
+    @Excel(name = "订单状态", dictType = "store_order_status")
+    private String status;
+
+    /** 0 未退款 1 申请中 2 已退款 */
+//    @Excel(name = "0 未退款 1 申请中 2 已退款")
+    private Integer refundStatus;
+
+    /** 退款图片 */
+//    @Excel(name = "退款图片")
+    private String refundReasonWapImg;
+
+    /** 退款用户说明 */
+//    @Excel(name = "退款用户说明")
+    private String refundReasonWapExplain;
+
+    /** 退款时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+//    @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date refundReasonTime;
+
+    /** 前台退款原因 */
+//    @Excel(name = "前台退款原因")
+    private String refundReasonWap;
+
+    /** 不退款的理由 */
+//    @Excel(name = "不退款的理由")
+    private String refundReason;
+
+    /** 退款金额 */
+//    @Excel(name = "退款金额",cellType= Excel.ColumnType.NUMERIC)
+    private BigDecimal refundPrice;
+
+    /** 快递公司编号 */
+    @Excel(name = "快递公司编号")
+    private String deliverySn;
+
+    /** 快递名称/送货人姓名 */
+    @Excel(name = "快递公司")
+    private String deliveryName;
+
+    /** 发货类型 */
+    @Excel(name = "发货类型")
+    private String deliveryType;
+
+    /** 快递单号/手机号 */
+    @Excel(name = "快递单号")
+    private String deliveryId;
+
+    /** 消费赚取积分 */
+    private BigDecimal gainIntegral;
+
+    /** 使用积分 */
+    private BigDecimal useIntegral;
+
+    /** 实际支付积分 */
+    private BigDecimal payIntegral;
+
+    /** 给用户退了多少积分 */
+    private BigDecimal backIntegral;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String mark;
+
+    /** 是否删除 */
+    private Integer isDel;
+
+    /** 成本价 */
+    private BigDecimal cost;
+
+    /** 核销码 */
+    private String verifyCode;
+
+    /** 门店id */
+    private Long storeId;
+
+    /** 配送方式 1=快递 ,2=门店自提 */
+    private Integer shippingType;
+
+    /** 支付渠道(0微信公众号1微信小程序) */
+    private Integer isChannel;
+
+    /** 是否提醒 */
+    private Integer isRemind;
+
+    /** 是否系统删除 */
+    private Integer isSysDel;
+
+    private String nickname;
+
+    private String phone;
+
+
+    private Date finishTime;
+
+    private Integer isPackage;
+
+    private List<FsStoreOrderItemVO> items;
+
+    private Integer deliveryStatus;
+
+    @Excel(name = "物流代收结算状态", dictType = "store_delivery_pay_status")
+    private Integer deliveryPayStatus;
+
+    @Excel(name = "快递帐单日期")
+    private String deliveryTime;
+
+    @Excel(name = "快递结算日期")
+    private String deliveryPayTime;
+    @Excel(name = "物流代收金额")
+    private BigDecimal deliveryPayMoney;
+
+    private String itemJson;
+
+    private String orderVisit;
+
+    private String orderMedium;
+
+    //小程序名称
+    private String miniProgramName;
+
+
+    //erp推送号码
+    private String erpPhone;
+
+    //erp推送账号
+    private String erpAccount;
+
+    /** 银行交易流水号 */
+    @Excel(name = "银行交易流水号")
+    private String bankTransactionId;
+
+
 }

+ 40 - 0
fs-service/src/main/resources/liquibase/changelog/sql/001-create-sys-menu-table.sql

@@ -0,0 +1,40 @@
+--liquibase formatted sql
+
+--changeset yuhongqi:1
+--comment: create table sys_menu
+CREATE TABLE IF NOT EXISTS `sys_menu` (
+  `menu_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '菜单ID',
+  `menu_name` VARCHAR(50) NOT NULL COMMENT '菜单名称',
+  `parent_id` BIGINT DEFAULT 0 COMMENT '父菜单ID',
+  `order_num` VARCHAR(10) DEFAULT NULL COMMENT '显示顺序',
+  `path` VARCHAR(200) DEFAULT NULL COMMENT '路由地址',
+  `component` VARCHAR(255) DEFAULT NULL COMMENT '组件路径',
+  `query` VARCHAR(255) DEFAULT NULL COMMENT '路由参数',
+  `is_frame` CHAR(1) DEFAULT '1' COMMENT '是否为外链(0是 1否)',
+  `is_cache` CHAR(1) DEFAULT '0' COMMENT '是否缓存(0缓存 1不缓存)',
+  `menu_type` CHAR(1) DEFAULT NULL COMMENT '类型(M目录 C菜单 F按钮)',
+  `visible` CHAR(1) DEFAULT '0' COMMENT '显示状态(0显示 1隐藏)',
+  `status` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0正常 1停用)',
+  `perms` VARCHAR(100) DEFAULT NULL COMMENT '权限字符串',
+  `icon` VARCHAR(100) DEFAULT NULL COMMENT '菜单图标',
+  `create_by` VARCHAR(64) DEFAULT '' COMMENT '创建者',
+  `create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
+  `update_by` VARCHAR(64) DEFAULT '' COMMENT '更新者',
+  `update_time` DATETIME DEFAULT NULL COMMENT '更新时间',
+  `remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`menu_id`) USING BTREE,
+  KEY `idx_sys_menu_parent_id` (`parent_id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='菜单权限表';
+
+--changeset yuhongqi:2
+--comment: create table cc
+INSERT INTO `live` ( `company_id`, `company_user_id`, `talent_id`, `live_name`, `live_desc`, `show_type`, `status`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `anchor_id`, `live_type`,
+                    `start_time`, `finish_time`, `live_img_url`, `live_config`, `is_show`, `is_del`, `qw_qr_code`, `rtmp_url`, `config_json`, `is_audit`, `flv_hls_url`, `id_card_url`, `global_visible`)
+VALUES  ( 329, 9769, NULL, '测试新增直播间', '<p>123</p>', 1, 3, '2025-11-03 17:16:19', NULL, NULL, '2025-12-16 16:29:35', NULL, NULL, 2, '2025-11-07 09:21:01', '2025-12-16 16:29:34', 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/fs/20251024/a2a9b292ae204321aef7833e6c01bb39.png', NULL, 1, 0, NULL, NULL, '{\"scoreAmount\":\"1\",\"showGuide\":\"1\",\"scoreGuideText\":\"1\",\"watchDuration\":\"1\",\"redPacketAmount\":\"\",\"redPacketType\":\"1\",\"scoreGuideLink\":\"1\",\"liveId\":128,\"enabled\":true,\"receivePrompt\":\"\",\"redPacketCount\":\"\",\"receiveMethod\":\"1\",\"guideText\":\"\",\"participateCondition\":\"1\",\"action\":\"2\",\"id\":127}', 1, NULL, '1', 1);
+
+
+--changeset yuhongqi:3
+--comment: create table aa
+INSERT INTO `live` ( `company_id`, `company_user_id`, `talent_id`, `live_name`, `live_desc`, `show_type`, `status`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `anchor_id`, `live_type`,
+                     `start_time`, `finish_time`, `live_img_url`, `live_config`, `is_show`, `is_del`, `qw_qr_code`, `rtmp_url`, `config_json`, `is_audit`, `flv_hls_url`, `id_card_url`, `global_visible`)
+VALUES  ( 329, 9769, NULL, '测试新增直播间', '<p>123</p>', 1, 3, '2025-11-03 17:16:19', NULL, NULL, '2025-12-16 16:29:35', NULL, NULL, 2, '2025-11-07 09:21:01', '2025-12-16 16:29:34', 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/fs/20251024/a2a9b292ae204321aef7833e6c01bb39.png', NULL, 1, 0, NULL, NULL, '{\"scoreAmount\":\"1\",\"showGuide\":\"1\",\"scoreGuideText\":\"1\",\"watchDuration\":\"1\",\"redPacketAmount\":\"\",\"redPacketType\":\"1\",\"scoreGuideLink\":\"1\",\"liveId\":128,\"enabled\":true,\"receivePrompt\":\"\",\"redPacketCount\":\"\",\"receiveMethod\":\"1\",\"guideText\":\"\",\"participateCondition\":\"1\",\"action\":\"2\",\"id\":127}', 1, NULL, '1', 1);

+ 7 - 0
fs-service/src/main/resources/liquibase/db.changelog-master.yml

@@ -0,0 +1,7 @@
+databaseChangeLog:
+  # 自动扫描 changelog/sql 目录下的所有 SQL changelog 文件(带 --changeset 注释的 SQL 文件)
+  - include:
+      file: changelog/sql/001-create-sys-menu-table.sql
+      relativeToChangelogFile: true
+      errorIfMissingOrEmpty: false
+