wanglang 4 днів тому
батько
коміт
76ef1b6131

+ 636 - 0
trade-service/src/main/resources/data.init/v1.1/wl20241022.sql

@@ -0,0 +1,636 @@
+-- 入账表
+DROP TABLE IF EXISTS `billing_income`;
+CREATE TABLE `billing_income`
+(
+    `id`                        bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `customer_user_id`          BIGINT UNSIGNED DEFAULT 0 COMMENT '客户id',
+    `sales_contract_no`         varchar(64)    default '' comment '合同编号',
+    `contract_name`             varchar(300)   default '' comment '合同名称',
+    `sale_order_no`             varchar(64)    default '' comment '销售订单编号',
+    `importer_cert_no`          VARCHAR(32)    DEFAULT '' COMMENT '进口商统一社会信用代码/注册号',
+    `importer_enterprise_name`  VARCHAR(300)   DEFAULT NULL COMMENT '进口商企业名称',
+    `agency_cert_no`            VARCHAR(32)    DEFAULT '' COMMENT '代理公司统一社会信用代码/注册号',
+    `agency_enterprise_name`    VARCHAR(300)   DEFAULT NULL COMMENT '代理公司企业名称',
+    `financier_identifier`      varchar(64)    DEFAULT '' COMMENT '资金方标识',
+    `payment_type`              varchar(2)     DEFAULT '' comment '款项类型1出口退税款2贸易回款3预收货款4贸易融资款',
+    `payment_way`               varchar(2)     DEFAULT '' comment '入账方式1入账申请2系统录入',
+    `status`                    varchar(2)     DEFAULT '' COMMENT '入账状态1待确认2已收款',
+    `transaction_number`        varchar(64)    DEFAULT '' COMMENT '交易编号',
+    `apply_amount`              DECIMAL(17, 2) DEFAULT NULL COMMENT '申请金额',
+    `actual_amount`             DECIMAL(17, 2) DEFAULT NULL COMMENT '实际到账金额',
+    `settlement_amount`         DECIMAL(17, 2) DEFAULT NULL COMMENT '结汇人民币金额',
+    `actual_retained_amount`    DECIMAL(17, 2) DEFAULT NULL COMMENT '实际留存人民币金额',
+    `trade_receivable_amount`   DECIMAL(17, 2) DEFAULT NULL COMMENT '应收货款金额',
+    `apply_currency`            CHAR(3)        DEFAULT '' COMMENT '申请币种代码',
+    `actual_currency`           CHAR(3)        DEFAULT '' COMMENT '实际到账币种代码',
+    `settlement_currency`       CHAR(3)        DEFAULT '' COMMENT '结汇人民币币种代码',
+    `actual_retained_currency`  CHAR(3)        DEFAULT '' COMMENT '实际留存人民币币种代码',
+    `trade_receivable_currency` CHAR(3)        DEFAULT '' COMMENT '应收货款币种代码',
+    `apply_entry_date`          DATETIME       DEFAULT NULL COMMENT '申请入账日期',
+    `actual_entry_date`         DATETIME       DEFAULT NULL COMMENT '实际入账日期',
+    `business_number`           varchar(64)    default '' comment '业务编号',
+    `payer_name`                VARCHAR(300)   DEFAULT NULL COMMENT '付款方名称',
+    `payee_type`                varchar(2)     DEFAULT '' comment '收款方类型1客户2资金方',
+    `payer_type`                varchar(2)     DEFAULT '' comment '付款方类型1代理公司2资金方3税务局',
+    `payee_name`                VARCHAR(300)   DEFAULT NULL COMMENT '收款方名称',
+    `remark`                    VARCHAR(512)   DEFAULT '' COMMENT '备注',
+    `deleted`                   TINYINT(1) DEFAULT 0 COMMENT '删除标识',
+    `gmt_create`                TIMESTAMP      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`              TIMESTAMP      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    INDEX                       contract_no (`sales_contract_no`),
+    INDEX                       idx_cui (`customer_user_id`)
+) ENGINE = InnoDB
+  DEFAULT CHARACTER SET utf8mb4
+  COLLATE utf8mb4_bin COMMENT ='入账表';
+
+-- 入账信息表
+DROP TABLE IF EXISTS `billing_income_info`;
+CREATE TABLE `billing_income_info`
+(
+    `id`                            bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `billing_income_id`             BIGINT UNSIGNED DEFAULT 0 COMMENT '入账主表id',
+    `customs_declaration_no`        varchar(32)  DEFAULT NULL COMMENT '海关报关单号(18位)',
+    `export_customs_declaration_no` varchar(32)  DEFAULT NULL COMMENT '出口货物报关单号(21位)',
+    `declaration_month_year`        varchar(8)   DEFAULT NULL COMMENT '申报年月(所属期)',
+    `declaration_batch`             varchar(16)  DEFAULT '0' COMMENT '申报批次',
+    `detail_ids`                    JSON         DEFAULT NULL COMMENT '出口明细表ids',
+    `voucher_no`                    varchar(64)  DEFAULT NULL COMMENT '凭证号',
+    `account_name`                  VARCHAR(50)  DEFAULT '' COMMENT '账户名称',
+    `account_number`                VARCHAR(50)  DEFAULT '' COMMENT '账号',
+    `opening_bank`                  VARCHAR(300) DEFAULT '' COMMENT '开户行名称',
+    `bank_name`                     VARCHAR(128) DEFAULT '' COMMENT '银行名称',
+    `deleted`                       TINYINT(1) DEFAULT 0 COMMENT '删除标识',
+    `gmt_create`                    TIMESTAMP    DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`                  TIMESTAMP    DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    INDEX                           idx_bii (`billing_income_id`)
+) ENGINE = InnoDB
+  DEFAULT CHARACTER SET utf8mb4
+  COLLATE utf8mb4_bin COMMENT ='入账信息表';
+
+-- 出账表
+DROP TABLE IF EXISTS `billing_disbursement`;
+CREATE TABLE `billing_disbursement`
+(
+    `id`                            bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `customer_user_id`              BIGINT UNSIGNED DEFAULT 0 COMMENT '客户id',
+    `payment_basic_id`              BIGINT UNSIGNED DEFAULT 0 COMMENT '支付基础表id',
+    `separate_accounts_info_id`     BIGINT UNSIGNED DEFAULT 0 COMMENT '分账信息主表id',
+    `business_number`               varchar(64)    default '' comment '业务编号',
+    `entry_business_number`         varchar(64)    default '' comment '入账业务编号',
+    `sales_contract_no`             varchar(64)    default '' comment '合同编号',
+    `contract_name`                 varchar(300)   default '' comment '合同名称',
+    `importer_cert_no`              VARCHAR(32)    DEFAULT '' COMMENT '进口商统一社会信用代码/注册号',
+    `importer_enterprise_name`      VARCHAR(300)   DEFAULT NULL COMMENT '进口商企业名称',
+    `agency_cert_no`                VARCHAR(32)    DEFAULT '' COMMENT '代理公司统一社会信用代码/注册号',
+    `agency_enterprise_name`        VARCHAR(300)   DEFAULT NULL COMMENT '代理公司企业名称',
+    `financier_identifier`          varchar(64)    DEFAULT '' COMMENT '资金方标识',
+    `trade_participants_identifier` varchar(64)    default '' comment '贸易参与方标识',
+    `payment_type`                  varchar(2)     DEFAULT '' comment '款项类型分账类型1出口退税款2贸易回款3预收货款4贸易融资款5贷款差额6贷款结汇差额',
+    `status`                        varchar(2)     DEFAULT '' COMMENT '入账状态1待确认2已收款',
+    `transaction_number`            varchar(64)    DEFAULT '' COMMENT '交易编号',
+    `payment_amount`                DECIMAL(17, 2) DEFAULT NULL COMMENT '付款金额',
+    `payment_currency`              CHAR(3)        DEFAULT '' COMMENT '付款金额币种代码',
+    `payment_date`                  DATETIME       DEFAULT NULL COMMENT '付款日期',
+    `payer_name`                    VARCHAR(300)   DEFAULT NULL COMMENT '付款方名称',
+    `payee_type`                    varchar(2)     DEFAULT '' comment '收款方类型1客户2资金方',
+    `payer_type`                    varchar(2)     DEFAULT '' comment '付款方类型1代理公司2资金方3税务局',
+    `account_number`                VARCHAR(50)    DEFAULT '' COMMENT '账号',
+    `voucher_no`                    varchar(64)    DEFAULT NULL COMMENT '凭证号',
+    `source`                        TINYINT(2) DEFAULT 0 COMMENT '来源1B端2C端',
+    `deleted`                       TINYINT(1) DEFAULT 0 COMMENT '删除标识',
+    `gmt_create`                    TIMESTAMP      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`                  TIMESTAMP      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    INDEX                           contract_no (`sales_contract_no`),
+    INDEX                           idx_cui (`customer_user_id`),
+    INDEX                           idx_pbi (`payment_basic_id`)
+) ENGINE = InnoDB
+  DEFAULT CHARACTER SET utf8mb4
+  COLLATE utf8mb4_bin COMMENT ='出账表';
+
+-- 出入账操作表
+DROP TABLE IF EXISTS `payment_collection_operate`;
+CREATE TABLE `payment_collection_operate`
+(
+    `id`               BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+    `business_id`      BIGINT UNSIGNED DEFAULT 0 COMMENT '出入账表id',
+    `business_type`    TINYINT(1) DEFAULT 0 COMMENT '业务类型1入账2出账3分账4支付',
+    `reviewer`         VARCHAR(128)       DEFAULT '' COMMENT '审核人',
+    `applicant`        VARCHAR(128)       DEFAULT '' COMMENT '申请人',
+    `apply_date`       DATETIME           DEFAULT NULL COMMENT '申请时间',
+    `review_date`      DATETIME           DEFAULT NULL COMMENT '审核时间',
+    `applicant_remark` VARCHAR(512)       DEFAULT '' COMMENT '申请人备注',
+    `review_remark`    VARCHAR(512)       DEFAULT '' COMMENT '备注',
+    `deleted`          TINYINT(1) DEFAULT 0 COMMENT '删除标识',
+    `gmt_create`       TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`     TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    INDEX              idx_business_id (`business_id`)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT='出入账操作表';
+
+
+-- 分账表
+DROP TABLE IF EXISTS `separate_accounts`;
+CREATE TABLE `separate_accounts`
+(
+    `id`                       bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `customer_user_id`         BIGINT UNSIGNED DEFAULT 0 COMMENT '客户id',
+    `billing_income_id`        BIGINT UNSIGNED DEFAULT 0 COMMENT '入账表id',
+    `sales_contract_no`        varchar(64)    default '' comment '销售合同编号',
+    `contract_name`            varchar(300)   default '' comment '销售合同名称',
+    `importer_cert_no`         VARCHAR(32)    DEFAULT '' COMMENT '进口商统一社会信用代码/注册号',
+    `importer_enterprise_name` VARCHAR(300)   DEFAULT NULL COMMENT '进口商企业名称',
+    `agency_cert_no`           VARCHAR(32)    DEFAULT '' COMMENT '代理公司统一社会信用代码/注册号',
+    `agency_enterprise_name`   VARCHAR(300)   DEFAULT NULL COMMENT '代理公司企业名称',
+    `financier_identifier`     varchar(64)    DEFAULT '' COMMENT '资金方标识',
+    `payment_type`             varchar(2)     DEFAULT '' comment '款项类型1出口退税款2贸易回款3预收货款4贸易融资款',
+    `status`                   varchar(2)     DEFAULT '' COMMENT '分账状态1待处理2已完成',
+    `transaction_number`       varchar(64)    DEFAULT '' COMMENT '交易编号',
+    `business_number`          varchar(64)    default '' comment '业务编号',
+    `entry_amount`             DECIMAL(17, 2) DEFAULT NULL COMMENT '入账金额',
+    `entry_currency`           CHAR(3)        DEFAULT '' COMMENT '入账金额币种代码',
+    `settlement_amount`        DECIMAL(17, 2) DEFAULT NULL COMMENT '结汇人民币金额',
+    `actual_retained_amount`   DECIMAL(17, 2) DEFAULT NULL COMMENT '实际留存人民币金额',
+    `settlement_currency`      CHAR(3)        DEFAULT '' COMMENT '结汇人民币币种代码',
+    `actual_retained_currency` CHAR(3)        DEFAULT '' COMMENT '实际留存人民币币种代码',
+    `entry_date`               DATETIME       DEFAULT NULL COMMENT '入账日期',
+    `deleted`                  TINYINT(1) DEFAULT 0 COMMENT '删除标识',
+    `gmt_create`               TIMESTAMP      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`             TIMESTAMP      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    INDEX                      contract_no (`sales_contract_no`),
+    INDEX                      idx_cui (`customer_user_id`)
+) ENGINE = InnoDB
+  DEFAULT CHARACTER SET utf8mb4
+  COLLATE utf8mb4_bin COMMENT ='分账表';
+
+-- 分账信息表
+DROP TABLE IF EXISTS `separate_accounts_info`;
+CREATE TABLE `separate_accounts_info`
+(
+    `id`                            bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `separate_accounts_id`          BIGINT UNSIGNED DEFAULT 0 COMMENT '分账主表id',
+    `trade_participants_identifier` varchar(64)    default '' comment '贸易参与方标识',
+    `trade_participants_name`       varchar(300)   default '' comment '贸易参与方名称',
+    `ledger_type`                   varchar(2)     DEFAULT '' comment '分账类型1出口退税款2贸易回款3预收货款4贸易融资款5贷款差额6贷款结汇差额',
+    `ledger_ratio`                  int            DEFAULT 0 COMMENT '分账比例单位%',
+    `transaction_number`            varchar(64)    DEFAULT '' COMMENT '交易编号',
+    `ledger_amount`                 DECIMAL(17, 2) DEFAULT NULL COMMENT '分账金额',
+    `ledger_currency`               CHAR(3)        DEFAULT '' COMMENT '分账金额币种代码',
+    `plan_entry_date`               DATETIME       DEFAULT NULL COMMENT '付款日期',
+    `account_name`                  VARCHAR(50)    DEFAULT '' COMMENT '账户名称',
+    `account_number`                VARCHAR(50)    DEFAULT '' COMMENT '账号',
+    `opening_bank`                  VARCHAR(300)   DEFAULT '' COMMENT '开户行名称',
+    `bank_name`                     VARCHAR(128)   DEFAULT '' COMMENT '银行名称',
+    `deleted`                       TINYINT(1) DEFAULT 0 COMMENT '删除标识',
+    `gmt_create`                    TIMESTAMP      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`                  TIMESTAMP      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    INDEX                           idx_sai (`separate_accounts_id`)
+) ENGINE = InnoDB
+  DEFAULT CHARACTER SET utf8mb4
+  COLLATE utf8mb4_bin COMMENT ='分账信息表';
+
+
+-- 支付基础表
+DROP TABLE IF EXISTS `payment_basic`;
+CREATE TABLE `payment_basic`
+(
+    `id`                        bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `customer_user_id`          BIGINT UNSIGNED DEFAULT 0 COMMENT '客户id',
+    `separate_accounts_info_id` BIGINT UNSIGNED DEFAULT 0 COMMENT '分账信息主表id',
+    `sales_contract_no`         varchar(64)    default '' comment '销售合同编号',
+    `contract_name`             varchar(300)   default '' comment '销售合同名称',
+    `importer_cert_no`          VARCHAR(32)    DEFAULT '' COMMENT '进口商统一社会信用代码/注册号',
+    `importer_enterprise_name`  VARCHAR(300)   DEFAULT NULL COMMENT '进口商企业名称',
+    `agency_cert_no`            VARCHAR(32)    DEFAULT '' COMMENT '代理公司统一社会信用代码/注册号',
+    `agency_enterprise_name`    VARCHAR(300)   DEFAULT NULL COMMENT '代理公司企业名称',
+    `financier_identifier`      varchar(64)    DEFAULT '' COMMENT '资金方标识',
+    `payment_type`              varchar(2)     DEFAULT '' comment '款项类型1出口退税款2贷款差额3贷款结汇差额',
+    `status`                    varchar(2)     DEFAULT '' COMMENT '支付状态1待审批2退回3出账确认中4出账已确认',
+    `transaction_number`        varchar(64)    DEFAULT '' COMMENT '交易编号',
+    `business_number`           varchar(64)    DEFAULT '' COMMENT '业务编号',
+    `payment_amount`            DECIMAL(17, 2) DEFAULT NULL COMMENT '付款金额',
+    `payment_currency`          CHAR(3)        DEFAULT '' COMMENT '付款金额币种代码',
+    `settlement_amount`         DECIMAL(17, 2) DEFAULT NULL COMMENT '结汇人民币金额',
+    `actual_retained_amount`    DECIMAL(17, 2) DEFAULT NULL COMMENT '实际留存人民币金额',
+    `settlement_currency`       CHAR(3)        DEFAULT '' COMMENT '结汇人民币币种代码',
+    `actual_retained_currency`  CHAR(3)        DEFAULT '' COMMENT '实际留存人民币币种代码',
+    `apply_date`                DATETIME       DEFAULT NULL COMMENT '申请日期',
+    `deleted`                   TINYINT(1) DEFAULT 0 COMMENT '删除标识',
+    `gmt_create`                TIMESTAMP      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`              TIMESTAMP      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    INDEX                       contract_no (`sales_contract_no`),
+    INDEX                       idx_cui (`customer_user_id`)
+) ENGINE = InnoDB
+  DEFAULT CHARACTER SET utf8mb4
+  COLLATE utf8mb4_bin COMMENT ='支付基础表';
+
+-- 支付基础信息表
+DROP TABLE IF EXISTS `payment_basic_info`;
+CREATE TABLE `payment_basic_info`
+(
+    `id`                            bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `payment_basic_id`              BIGINT UNSIGNED DEFAULT 0 COMMENT '支付信息主表id',
+    `trade_participants_identifier` varchar(64)    default '' comment '贸易参与方标识',
+    `trade_participants_name`       varchar(300)   default '' comment '贸易参与方名称',
+    `payment_amount`                DECIMAL(17, 2) DEFAULT NULL COMMENT '付款金额',
+    `payment_currency`              CHAR(3)        DEFAULT '' COMMENT '付款金额币种代码',
+    `payment_date`                  DATETIME       DEFAULT NULL COMMENT '付款日期',
+    `account_name`                  VARCHAR(50)    DEFAULT '' COMMENT '账户名称',
+    `account_number`                VARCHAR(50)    DEFAULT '' COMMENT '账号',
+    `opening_bank`                  VARCHAR(300)   DEFAULT '' COMMENT '开户行名称',
+    `bank_name`                     VARCHAR(128)   DEFAULT '' COMMENT '银行名称',
+    `deleted`                       TINYINT(1) DEFAULT 0 COMMENT '删除标识',
+    `gmt_create`                    TIMESTAMP      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`                  TIMESTAMP      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    INDEX                           idx_pbi (`payment_basic_id`)
+) ENGINE = InnoDB
+  DEFAULT CHARACTER SET utf8mb4
+  COLLATE utf8mb4_bin COMMENT ='支付基础信息表';
+
+-- 订单与入账关联表
+DROP TABLE IF EXISTS `order_income_association`;
+CREATE TABLE `order_income_association`
+(
+    `id`                        bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `customer_user_id`          BIGINT UNSIGNED DEFAULT 0 COMMENT '客户id',
+    `payment_type`              varchar(2)     DEFAULT '' comment '款项类型1出口退税款2贸易回款3预收货款4贸易融资款5技术服务费6出口退税服务费',
+    `expected_payment_due_date` DATETIME       DEFAULT NULL COMMENT '预计付款日期',
+    `sales_contract_no`         varchar(64)    default '' comment '销售合同编号',
+    `sale_contract_id`          BIGINT(20) UNSIGNED DEFAULT NULL COMMENT '销售合同id',
+    `original_receive_payment`  DECIMAL(17, 2) DEFAULT 0.00 COMMENT '订单原有收款金额/应收货款金额',
+    `original_currency`         CHAR(3)        DEFAULT '' COMMENT '订单原有收款金额币种代码',
+    `receive_payment`           DECIMAL(17, 2) DEFAULT 0.00 COMMENT '收款金额/实际收款金额',
+    `currency`                  CHAR(3)        DEFAULT '' COMMENT '收款金额币种代码',
+    `account_number`            VARCHAR(50)    DEFAULT '' COMMENT '收款银行账号',
+    `remark`                    VARCHAR(512)   DEFAULT '' COMMENT '备注',
+    `file_ids`                  JSON           DEFAULT NULL COMMENT '文件id集合',
+    `voucher_no`                varchar(64)    DEFAULT NULL COMMENT '凭证号',
+    `billing_income_id`         BIGINT UNSIGNED DEFAULT 0 COMMENT '入账表id',
+    `business_batch_number`     VARCHAR(64)    DEFAULT NULL COMMENT '业务批次编号',
+    `order_info`                JSON           DEFAULT NULL COMMENT '订单详情/订单id与商品id',
+    `order_goods_info`          JSON           DEFAULT NULL COMMENT '商品id',
+    `prompt_receiving_currency` CHAR(3)        DEFAULT '' COMMENT '提示收款币种代码',
+    `source`                    TINYINT(2) DEFAULT 0 COMMENT '来源1B端2C端',
+    `deleted`                   TINYINT(1) DEFAULT 0 COMMENT '删除标识',
+    `gmt_create`                TIMESTAMP      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`              TIMESTAMP      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    INDEX                       idx_cui (`billing_income_id`),
+    INDEX                       idx_bbn (`business_batch_number`)
+) ENGINE = InnoDB
+  DEFAULT CHARACTER SET utf8mb4
+  COLLATE utf8mb4_bin COMMENT ='订单与入账关联表';
+
+
+-- 订单与收款关联表
+DROP TABLE IF EXISTS `order_receive_payment_association`;
+CREATE TABLE `order_receive_payment_association`
+(
+    `id`                       bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `customer_user_id`         BIGINT UNSIGNED DEFAULT 0 COMMENT '客户id',
+    `order_id`                 BIGINT UNSIGNED DEFAULT 0 COMMENT '销售订单id',
+    `order_no`                 VARCHAR(32)    DEFAULT NULL COMMENT '订单编号',
+    `goods_amount`             DECIMAL(17, 2) DEFAULT 0.00 COMMENT '订单原有收款金额/应收货款金额',
+    `goods_currency`           CHAR(3)        DEFAULT 'USD' COMMENT '订单原有收款金额币种代码',
+    `actual_received_amount`   DECIMAL(17, 2) DEFAULT 0.00 COMMENT '收款金额/实际收款金额',
+    `actual_received_currency` CHAR(3)        DEFAULT 'USD' COMMENT '收款金额币种代码',
+    `remark`                   VARCHAR(512)   DEFAULT '' COMMENT '备注',
+    `file_id`                  BIGINT UNSIGNED DEFAULT NULL COMMENT '补充协议文件',
+    `business_batch_number`    VARCHAR(64)    DEFAULT NULL COMMENT '业务批次编号',
+    `status`                   varchar(2)     DEFAULT '1' comment '1草稿2正式',
+    `source`                   TINYINT(2) DEFAULT 0 COMMENT '来源1B端2C端',
+    `deleted`                  TINYINT(1) DEFAULT 0 COMMENT '删除标识',
+    `gmt_create`               TIMESTAMP      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`             TIMESTAMP      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    INDEX                      idx_bbn (`business_batch_number`)
+) ENGINE = InnoDB
+  DEFAULT CHARACTER SET utf8mb4
+  COLLATE utf8mb4_bin COMMENT ='订单与收款关联表';
+
+-- 应付账款
+DROP TABLE IF EXISTS `payable_accounts`;
+CREATE TABLE `payable_accounts`
+(
+    `id`                bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `customer_user_id`  BIGINT UNSIGNED DEFAULT 0 COMMENT '客户id',
+    `billing_income_id` BIGINT UNSIGNED DEFAULT 0 COMMENT '入账表id',
+    `payment_type`      varchar(2)     DEFAULT '' comment '付款类型1技术服务费2出口退税服务费',
+    `payment_amount`    DECIMAL(17, 2) DEFAULT NULL COMMENT '付款金额',
+    `payment_currency`  CHAR(3)        DEFAULT '' COMMENT '付款金额币种代码',
+    `apply_no`          varchar(64)    default '' comment '融资申请编号或其他编号',
+    `sales_contract_no` varchar(64)    default '' comment '合同编号',
+    `contract_name`     varchar(300)   default '' comment '合同名称',
+    `payment_deadline`  DATETIME       DEFAULT NULL COMMENT '付款截至时间',
+    `payment_time`      DATETIME       DEFAULT NULL COMMENT '付款时间',
+    `voucher_no`        varchar(64)    DEFAULT NULL COMMENT '凭证号',
+    `status`            varchar(2)     DEFAULT '' COMMENT '支付状态1待支付2未支付(超时未付)3已完成',
+    `payee_type`        varchar(2)     DEFAULT '' comment '收款方类型1客户2资金方3代理公司4长银科技公司',
+    `payee_name`        VARCHAR(300)   DEFAULT NULL COMMENT '收款方名称',
+    `contact_file_id`   BIGINT UNSIGNED DEFAULT NULL COMMENT '合同文件id',
+    `source`            TINYINT(2) DEFAULT 0 COMMENT '来源1B端2C端',
+    `deleted`           TINYINT(1) DEFAULT 0 COMMENT '删除标识',
+    `gmt_create`        TIMESTAMP      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`      TIMESTAMP      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    INDEX               contract_no (`sales_contract_no`),
+    INDEX               idx_cui (`customer_user_id`),
+    INDEX               idx_bii (`billing_income_id`)
+) ENGINE = InnoDB
+  DEFAULT CHARACTER SET utf8mb4
+  COLLATE utf8mb4_bin COMMENT ='应付账款';
+
+DROP TABLE IF EXISTS `sales_contract_i18n`;
+CREATE TABLE `sales_contract_i18n`
+(
+    `id`               bigint(20) NOT NULL,
+    `language`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `port_departure`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `port_destination` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    PRIMARY KEY (`id`, `language`) USING BTREE,
+    UNIQUE INDEX `id_idx` (`id`, `language`) USING BTREE
+) ENGINE = InnoDB
+  CHARACTER SET = utf8mb4
+  COLLATE = utf8mb4_general_ci
+  ROW_FORMAT = Dynamic;
+
+DROP TABLE IF EXISTS `sales_commodity_i18n`;
+CREATE TABLE `sales_commodity_i18n`
+(
+    `id`               bigint(20) NOT NULL,
+    `language`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `declaration_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `measurement_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    PRIMARY KEY (`id`, `language`) USING BTREE,
+    UNIQUE INDEX `id_idx` (`id`, `language`) USING BTREE
+) ENGINE = InnoDB
+  CHARACTER SET = utf8mb4
+  COLLATE = utf8mb4_general_ci
+  ROW_FORMAT = Dynamic;
+
+DROP TABLE IF EXISTS `contract_terms_i18n`;
+CREATE TABLE `contract_terms_i18n`
+(
+    `id`           bigint(20) NOT NULL,
+    `language`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `account_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `opening_bank` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `bank_name`    VARCHAR(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `remark`       varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    PRIMARY KEY (`id`, `language`) USING BTREE,
+    UNIQUE INDEX `id_idx` (`id`, `language`) USING BTREE
+) ENGINE = InnoDB
+  CHARACTER SET = utf8mb4
+  COLLATE = utf8mb4_general_ci
+  ROW_FORMAT = Dynamic;
+
+DROP TABLE IF EXISTS `contract_terms_extend_i18n`;
+CREATE TABLE `contract_terms_extend_i18n`
+(
+    `id`           bigint(20) NOT NULL,
+    `language`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `payment_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `payment_time` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `term_title`   varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `content`      TEXT                                                          DEFAULT NULL COMMENT '内容',
+    PRIMARY KEY (`id`, `language`) USING BTREE,
+    UNIQUE INDEX `id_idx` (`id`, `language`) USING BTREE
+) ENGINE = InnoDB
+  CHARACTER SET = utf8mb4
+  COLLATE = utf8mb4_general_ci
+  ROW_FORMAT = Dynamic;
+
+DROP TABLE IF EXISTS `importer_entity_i18n`;
+CREATE TABLE `importer_entity_i18n`
+(
+    `id`                bigint(20) NOT NULL,
+    `language`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `entity_name`       varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `business_province` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `business_city`     varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `business_address`  varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `contact_name`      varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    PRIMARY KEY (`id`, `language`) USING BTREE,
+    UNIQUE INDEX `id_idx` (`id`, `language`) USING BTREE
+) ENGINE = InnoDB
+  CHARACTER SET = utf8mb4
+  COLLATE = utf8mb4_general_ci
+  ROW_FORMAT = Dynamic;
+
+ALTER TABLE `purchase_order_logistics`
+    ADD COLUMN transport_invoice_number VARCHAR(32) DEFAULT '' COMMENT '运输发票号码' AFTER`logistics_order_number`;
+ALTER TABLE `purchase_order_logistics`
+    ADD COLUMN`kprq` DATETIME DEFAULT NULL COMMENT '开票日期' AFTER`transport_invoice_number`;
+ALTER TABLE `purchase_order_invoice`
+    ADD COLUMN source TINYINT(2) DEFAULT 0 COMMENT '发票来源1B端2C端' AFTER`purchase_voucher_no`;
+ALTER TABLE `purchase_order_invoice`
+    ADD COLUMN pull_state TINYINT(2) DEFAULT 0 COMMENT '文件拉取状态0未拉取1已拉取' AFTER`source`;
+
+ALTER TABLE `sales_order`
+    ADD COLUMN pending_received_amount DECIMAL(17, 2) DEFAULT 0.00 COMMENT '待收货款金额' AFTER`amount`;
+ALTER TABLE `sales_order_goods`
+    ADD COLUMN receive_payment_status TINYINT(2) DEFAULT 0 COMMENT '收款状态0未收款1审核中2已收款3已转出' AFTER`model`;
+UPDATE `sales_order`
+SET pending_received_amount = amount;
+
+ALTER TABLE `contract_terms`
+    ADD COLUMN `bank_name` VARCHAR(300) DEFAULT '' COMMENT '银行名称' AFTER`opening_bank`;
+
+INSERT INTO `sys_dict_type`(`dict_name`, `dict_type`, `status`, `create_by`, `remark`)
+VALUES ('出账状态', 'disbursement_status', '0', '长安银科', NULL);
+INSERT INTO `sys_dict_type`(`dict_name`, `dict_type`, `status`, `create_by`, `remark`)
+VALUES ('分账类型', 'ledger_type', '0', '长安银科', NULL);
+INSERT INTO `sys_dict_type`(`dict_name`, `dict_type`, `status`, `create_by`, `remark`)
+VALUES ('分账状态', 'separate_status', '0', '长安银科', NULL);
+INSERT INTO `sys_dict_type`(`dict_name`, `dict_type`, `status`, `create_by`, `remark`)
+VALUES ('入账方式', 'entry_way', '0', '长安银科', NULL);
+INSERT INTO `sys_dict_type`(`dict_name`, `dict_type`, `status`, `create_by`, `remark`)
+VALUES ('入账状态', 'entry_status', '0', '长安银科', NULL);
+INSERT INTO `sys_dict_type`(`dict_name`, `dict_type`, `status`, `create_by`, `remark`)
+VALUES ('入账款项类型', 'entry_payment_type', '0', '长安银科', NULL);
+INSERT INTO `sys_dict_type`(`dict_name`, `dict_type`, `status`, `create_by`, `remark`)
+VALUES ('付款方类型', 'payer_type', '0', '长安银科', NULL);
+INSERT INTO `sys_dict_type`(`dict_name`, `dict_type`, `status`, `create_by`, `remark`)
+VALUES ('收款方类型', 'payee_type', '0', '长安银科', NULL);
+
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (3, '进口商', '4', 'payer_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (2, '税务局', '3', 'payer_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '资金方', '2', 'payer_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '代理公司', '1', 'payer_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+
+
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (3, '长银科技公司', '4', 'payee_type', NULL, 'default', 'N', '0', '长安银科', '长安银科', NULL);
+
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (2, '代理公司', '3', 'payee_type', NULL, 'default', 'N', '0', '长安银科', '长安银科', NULL);
+
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '资金方', '2', 'payee_type', NULL, 'default', 'N', '0', '长安银科', '长安银科', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '客户', '1', 'payee_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '已完成', '2', 'disbursement_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '待确认', '1', 'disbursement_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (5, '贷款结汇差额', '6', 'ledger_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (4, '贷款差额', '5', 'ledger_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (3, '贸易融资款', '4', 'ledger_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (2, '预收货款', '3', 'ledger_type', NULL, 'default', 'N', '0', '长安银科', '长安银科', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '贸易回款', '2', 'ledger_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '出口退税款', '1', 'ledger_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '已完成', '2', 'separate_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '待处理', '1', 'separate_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (5, '出口退税服务费', '6', 'entry_payment_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (4, '技术服务费', '5', 'entry_payment_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (3, '贸易融资款', '4', 'entry_payment_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (2, '预收货款', '3', 'entry_payment_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (2, '已到账', '2', 'rebate_payment_status', NULL, 'default', 'N', '0', '长安银科', '长安银科', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '未到账', '0', 'rebate_payment_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '入账申请', '2', 'entry_way', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '系统录入', '1', 'entry_way', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '已收款', '2', 'entry_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '待确认', '1', 'entry_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '贸易回款', '2', 'entry_payment_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                            `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '出口退税款', '1', 'entry_payment_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+
+-- 销售订单状态
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (6, '部分完成', '6', 'sales_order_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (7, '已收款', '7', 'sales_order_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+
+
+-- 销售订单商品状态
+INSERT INTO `sys_dict_type` (`dict_name`, `dict_type`, `status`, `create_by`, `remark`, `update_by`)
+VALUES ('销售订单商品状态', 'sales_order_goods_status', '0', '长安银科', NULL, '');
+
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '未收款', '0', 'sales_order_goods_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '审核中', '1', 'sales_order_goods_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (2, '已收款', '2', 'sales_order_goods_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (3, '已转出', '3', 'sales_order_goods_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+
+
+-- C端我的付款
+INSERT INTO `sys_dict_type` (`dict_name`, `dict_type`, `status`, `create_by`, `remark`)
+VALUES ('应付账款支付状态', 'payable_accounts_payment_status', '0', '长安银科', NULL);
+
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '待支付', '1', 'payable_accounts_payment_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '未支付(超时未付)', '2', 'payable_accounts_payment_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '已完成', '3', 'payable_accounts_payment_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+
+INSERT INTO `sys_dict_type` (`dict_name`, `dict_type`, `status`, `create_by`, `remark`)
+VALUES ('应付账款款项类型', 'payable_accounts_payment_type', '0', '长安银科', NULL);
+
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (0, '技术服务费', '1', 'payable_accounts_payment_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '出口退税服务费', '2', 'payable_accounts_payment_type', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+
+INSERT INTO `sys_dict_type` (`dict_name`, `dict_type`, `status`, `create_by`, `remark`)
+VALUES ('B端销售订单状态', 'b_sales_order_status', '0', '长安银科', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (1, '待发货', '1', 'b_sales_order_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (2, '运输中', '2', 'b_sales_order_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (9, '交易完成', '8', 'b_sales_order_status', NULL, 'default', 'N', '0', '长安银科', '长安银科', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (3, '部分收款', '3', 'b_sales_order_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (4, '部分回款审核中', '4', 'b_sales_order_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (5, '回款审核中', '5', 'b_sales_order_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (6, '部分完成', '6', 'b_sales_order_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`,
+                             `is_default`, `status`, `create_by`, `update_by`, `remark`)
+VALUES (7, '已收款', '7', 'b_sales_order_status', NULL, 'default', 'N', '0', '长安银科', '', NULL);