/*
 Navicat Premium Data Transfer

 Source Server         : 贸理通
 Source Server Type    : MySQL
 Source Server Version : 50721
 Source Host           : 192.168.3.6:3106
 Source Schema         : factoring_trade_v2_online

 Target Server Type    : MySQL
 Target Server Version : 50721
 File Encoding         : 65001

 Date: 06/02/2024 14:47:37
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for acceptance_approval
-- ----------------------------
DROP TABLE IF EXISTS `acceptance_approval`;
CREATE TABLE `acceptance_approval`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `c_acceptance_basic_info_id` bigint(20)  DEFAULT NULL COMMENT '验收单基础信息表id',
  `approval_comment` varchar(3000)  DEFAULT '' COMMENT '审批意见',
  `approval_conclusion` varchar(50)  COMMENT '审批结论',
  `auditor_id` bigint(20)   DEFAULT 0 COMMENT '审核人Id',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  `sign_confirm` tinyint(3) NOT NULL DEFAULT 0 COMMENT '签署确认 0否 1是',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1  COMMENT = '验收单管理-审核表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for acceptance_his_goods_info
-- ----------------------------
DROP TABLE IF EXISTS `acceptance_his_goods_info`;
CREATE TABLE `acceptance_his_goods_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `goods_name` varchar(500)  DEFAULT NULL COMMENT '货物名称',
  `goods_material` varchar(500)  DEFAULT NULL COMMENT '货物材质',
  `goods_type` varchar(500)  DEFAULT NULL COMMENT '型号',
  `goods_factory` varchar(500)  DEFAULT NULL COMMENT '厂家',
  `goods_unit` varchar(50)  DEFAULT NULL COMMENT '单位',
  `goods_quantity` decimal(17, 4)  DEFAULT NULL COMMENT '数量',
  `acceptance_date` datetime(0)  COMMENT '验收日期',
  `acceptance_his_info_id` bigint(20)  DEFAULT NULL COMMENT '验收单历史信息表id',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  `sales_price` decimal(17, 4)  DEFAULT NULL COMMENT '销售单价',
  `reference_price` decimal(17, 4)  DEFAULT NULL COMMENT '参考价格',
  `floating_price` decimal(17, 4)  DEFAULT NULL COMMENT '浮动单价',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '验收单-历史货物信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for acceptance_his_info
-- ----------------------------
DROP TABLE IF EXISTS `acceptance_his_info`;
CREATE TABLE `acceptance_his_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `business_number` varchar(250)  DEFAULT NULL COMMENT '业务编号',
  `trading_platform_id` bigint(20)  DEFAULT NULL COMMENT '贸易平台Id',
  `c_project_core_enterprise_id` bigint(20)  DEFAULT NULL COMMENT '核心企业Id',
  `c_supplier_info_id` bigint(20)  DEFAULT NULL COMMENT '供应商企业信息Id',
  `acceptance_number` varchar(250)  DEFAULT NULL COMMENT '验收单号',
  `expected_settlement_date` datetime(0)  DEFAULT NULL COMMENT '预计结算日期 ',
  `sign_confirm` tinyint(3)  DEFAULT NULL COMMENT '是否签署确认 0否 1是',
  `specification` varchar(50)  DEFAULT '' COMMENT '特别说明',
  `check_operator_supplier` varchar(32)  DEFAULT NULL COMMENT '验收经办人（供应商）',
  `check_operator_enterprise` varchar(32)  DEFAULT NULL COMMENT '验收经办人（核心企业）',
  `check_operator_supplier_contact` varchar(50)  DEFAULT '' COMMENT '验收经办人（供应商）联系方式',
  `check_operator_enterprise_contact` varchar(50)  DEFAULT '' COMMENT '验收经办人（核心企业）联系方式',
  `steel_waiter` tinyint(3)  DEFAULT NULL COMMENT '1是 0否  是否为刚小二',
  `acceptance_status` bigint(20)  DEFAULT NULL COMMENT '状态',
  `additional_remarks` varchar(500)  DEFAULT NULL COMMENT '补充说明信息',
  `is_settlement` tinyint(1)  DEFAULT NULL COMMENT '是否已结算，0:未结算 1:已结算  （注：结算未审核完成统一视为未结算）',
  `is_receivables` tinyint(1)  DEFAULT NULL COMMENT '是否做底层，0:未做底层 1:已做底层',
  `is_approval` tinyint(1)  DEFAULT NULL COMMENT '申请审核，0:不申请 1:申请',
  `stage` varchar(32)  DEFAULT '' COMMENT '业务当前阶段',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  `signer` bigint(20)  DEFAULT NULL COMMENT '验收单签署人Id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1  COMMENT = '下游验收单-基础信息历史表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for acceptance_person_info_history
-- ----------------------------
DROP TABLE IF EXISTS `acceptance_person_info_history`;
CREATE TABLE `acceptance_person_info_history`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `acceptance_basic_info_id` bigint(20) NOT NULL COMMENT '验收单Id',
  `name` varchar(50)  DEFAULT NULL COMMENT '用户名',
  `card_type` varchar(50)  DEFAULT '' COMMENT '证件类型',
  `type` varchar(50)  DEFAULT '' COMMENT '人员类型',
  `socialCreditCode` varchar(18)  DEFAULT NULL COMMENT '证件号码',
  `mobile` varchar(50)  DEFAULT NULL COMMENT '联系电话',
  `remark` varchar(1024)  DEFAULT NULL COMMENT '备注',
  `user_create` varchar(32)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(32)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单_人员历史信息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for acceptance_price_adjust_approval_info
-- ----------------------------
DROP TABLE IF EXISTS `acceptance_price_adjust_approval_info`;
CREATE TABLE `acceptance_price_adjust_approval_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `c_acceptance_price_adjust_info_id` bigint(20)  DEFAULT NULL COMMENT '验收单单价调整表id',
  `approval_comment` varchar(3000)  DEFAULT '' COMMENT '审批意见',
  `approval_conclusion` varchar(50)  COMMENT '审批结论',
  `auditor_id` bigint(20) DEFAULT 0 COMMENT '审核人Id',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单-单价调整审核表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for acceptance_price_approval
-- ----------------------------
DROP TABLE IF EXISTS `acceptance_price_approval`;
CREATE TABLE `acceptance_price_approval`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `c_acceptance_price_adjust_info_id` bigint(20)  DEFAULT NULL COMMENT '验收单-单价调整表ID',
  `approval_comment` varchar(3000)  DEFAULT '' COMMENT '审批意见',
  `approval_conclusion` varchar(50)  COMMENT '审批结论',
  `auditor_id` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '审核人Id',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单单价调整-审核表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for acceptance_price_goods_his_info
-- ----------------------------
DROP TABLE IF EXISTS `acceptance_price_goods_his_info`;
CREATE TABLE `acceptance_price_goods_his_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `goods_name` varchar(500)  DEFAULT NULL COMMENT '货物名称',
  `acceptance_goods_number` varchar(250)  DEFAULT NULL COMMENT '验收单编号',
  `goods_material` varchar(500)  DEFAULT NULL COMMENT '货物材质',
  `goods_type` varchar(500)  DEFAULT NULL COMMENT '型号',
  `goods_factory` varchar(500)  DEFAULT NULL COMMENT '厂家',
  `goods_unit` varchar(50)  DEFAULT NULL COMMENT '单位',
  `goods_quantity` decimal(17, 4) NULL DEFAULT NULL COMMENT '数量',
  `acceptance_date` datetime(0) NULL DEFAULT NULL COMMENT '验收日期',
  `c_acceptance_price_adjust_his_info_id` bigint(20) NULL DEFAULT NULL COMMENT '验收单-单价调整历史表ID',
  `sales_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '销售单价',
  `reference_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '参考价格',
  `floating_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '浮动单价',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 93 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单单价调整-货物信息历史表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for acceptance_sell_bill_ref
-- ----------------------------
DROP TABLE IF EXISTS `acceptance_sell_bill_ref`;
CREATE TABLE `acceptance_sell_bill_ref`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `acceptance_basic_info_id` bigint(20) NULL DEFAULT NULL COMMENT '下游验收单-基础信息表',
  `sell_bill_id` bigint(20) NULL DEFAULT NULL COMMENT '钢小二-销售单信息id',
  `sell_bill_number` varchar(300)  DEFAULT '' COMMENT '销售单号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '钢小二-销售单和验收单关联关系表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for acceptance_sell_bill_ref_his
-- ----------------------------
DROP TABLE IF EXISTS `acceptance_sell_bill_ref_his`;
CREATE TABLE `acceptance_sell_bill_ref_his`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `acceptance_his_info_id` bigint(20) NULL DEFAULT NULL COMMENT '下游验收单-基础信息历史表ID',
  `sell_bill_id` bigint(20) NULL DEFAULT NULL COMMENT '钢小二-销售单信息id',
  `sell_bill_number` varchar(300)  DEFAULT '' COMMENT '销售单号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '钢小二-销售单和验收单关联关系历史表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for acceptance_sign_confirmation_electronic_info_history
-- ----------------------------
DROP TABLE IF EXISTS `acceptance_sign_confirmation_electronic_info_history`;
CREATE TABLE `acceptance_sign_confirmation_electronic_info_history`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `c_acceptance_sign_confirmation_id` bigint(20) NOT NULL COMMENT '验收单签署确认表Id',
  `contract_name` varchar(500)  DEFAULT NULL COMMENT '合同名称',
  `contract_id` varchar(500)  DEFAULT NULL COMMENT '合同id',
  `file_id` bigint(20) NULL DEFAULT NULL COMMENT '电子签文件',
  `electronic_signature_personal_id` bigint(20) NOT NULL COMMENT '电子签个人信息表Id',
  `transaction_id` varchar(255)  DEFAULT NULL COMMENT '客户合同交易id',
  `sign_status` tinyint(1) NULL DEFAULT NULL COMMENT '客户签署状态',
  `back_file_id` bigint(20) NULL DEFAULT NULL COMMENT '电子签回调文件',
  `report_file_id` bigint(20) NULL DEFAULT NULL COMMENT '出证电子签文件',
  `user_create` varchar(32)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(32)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单_签署确认合同信息历史表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for acceptance_sign_confirmation_history
-- ----------------------------
DROP TABLE IF EXISTS `acceptance_sign_confirmation_history`;
CREATE TABLE `acceptance_sign_confirmation_history`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `c_acceptance_basic_info_id` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '验收单-基础信息表ID',
  `contract_link` varchar(2048)  DEFAULT NULL COMMENT '合同链接',
  `short_contract_link` varchar(1024)  DEFAULT NULL COMMENT '客户合同链接短连接',
  `short_contract_link_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '短链接创建时间',
  `sign_conclusion` tinyint(1) NULL DEFAULT NULL COMMENT '签署结论 1完成',
  `remark` varchar(1024)  DEFAULT NULL COMMENT '说明',
  `user_create` varchar(32)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(32)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单_签署确认历史表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_basic_info
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_basic_info`;
CREATE TABLE `c_acceptance_basic_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `business_number` varchar(250)  DEFAULT NULL COMMENT '业务编号',
  `trading_platform_id` bigint(20) NULL DEFAULT NULL COMMENT '贸易平台Id',
  `c_project_core_enterprise_id` bigint(20) NULL DEFAULT NULL COMMENT '核心企业Id',
  `c_supplier_info_id` bigint(20) NULL DEFAULT NULL COMMENT '供应商企业信息Id',
  `acceptance_number` varchar(250)  DEFAULT NULL COMMENT '验收单号',
  `expected_settlement_date` datetime(0) NULL DEFAULT NULL COMMENT '预计结算日期 ',
  `sign_confirm` tinyint(3) NULL DEFAULT NULL COMMENT '是否签署确认 0否 1是',
  `specification` varchar(50)  DEFAULT '' COMMENT '特别说明',
  `check_operator_supplier` varchar(32)  DEFAULT NULL COMMENT '验收经办人（供应商）',
  `check_operator_enterprise` varchar(32)  DEFAULT NULL COMMENT '验收经办人（核心企业）',
  `check_operator_supplier_contact` varchar(50)  DEFAULT '' COMMENT '验收经办人（供应商）联系方式',
  `check_operator_enterprise_contact` varchar(50)  DEFAULT '' COMMENT '验收经办人（核心企业）联系方式',
  `steel_waiter` tinyint(3) NULL DEFAULT NULL COMMENT '1是 0否  是否为刚小二',
  `acceptance_status` varchar(50)  DEFAULT '' COMMENT '状态',
  `additional_remarks` varchar(500)  DEFAULT NULL COMMENT '补充说明信息',
  `is_settlement` tinyint(1) NULL DEFAULT NULL COMMENT '是否已结算，0:未结算 1:已结算  （注：结算未审核完成统一视为未结算）',
  `is_receivables` tinyint(1) NULL DEFAULT NULL COMMENT '是否做底层，0:未做底层 1:已做底层',
  `is_approval` tinyint(1) NULL DEFAULT NULL COMMENT '申请审核，0:不申请 1:申请',
  `stage` varchar(32)  DEFAULT '' COMMENT '业务当前阶段',
  `sys_user_id` bigint(20) NULL DEFAULT NULL COMMENT '客户Id',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  `signer` bigint(20) NULL DEFAULT NULL COMMENT '验收单签署人Id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '下游验收单-基础信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_basic_info_his
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_basic_info_his`;
CREATE TABLE `c_acceptance_basic_info_his`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `business_number` varbinary(100) NULL DEFAULT NULL COMMENT '业务编号',
  `c_supplier_info_id` bigint(20) NULL DEFAULT NULL COMMENT '供应商id',
  `c_project_core_enterprise_id` bigint(20) NULL DEFAULT NULL COMMENT '核心企业id',
  `trading_platform_id` bigint(20) NULL DEFAULT NULL COMMENT '贸易平台Id',
  `acceptance_number` varchar(250)  DEFAULT NULL COMMENT '验收单号',
  `expected_settlement_date` datetime(0) NULL DEFAULT NULL COMMENT '预计结算日期 ',
  `sign_confirm` tinyint(3) NULL DEFAULT NULL COMMENT '是否签署确认 0否 1是',
  `specification` varchar(50)  DEFAULT '' COMMENT '特别说明',
  `check_operator_supplier` varchar(32)  DEFAULT NULL COMMENT '验收经办人（供应商）',
  `check_operator_enterprise` varchar(32)  DEFAULT NULL COMMENT '验收经办人（核心企业）',
  `check_operator_supplier_contact` varchar(50)  DEFAULT '' COMMENT '验收经办人（供应商）联系方式',
  `check_operator_enterprise_contact` varchar(50)  DEFAULT '' COMMENT '验收经办人（核心企业）联系方式',
  `steel_waiter` tinyint(3) NULL DEFAULT NULL COMMENT '1是 0否  是否为刚小二',
  `acceptance_status` varchar(100)  DEFAULT NULL COMMENT '状态: 已创建、已录入、已驳回、已审核',
  `additional_remarks` varchar(500)  DEFAULT NULL COMMENT '补充说明信息',
  `is_settlement` tinyint(1) NULL DEFAULT NULL COMMENT '是否已结算，0:未结算 1:已结算  （注：结算未审核完成统一视为未结算）',
  `is_receivables` tinyint(1) NULL DEFAULT NULL COMMENT '是否做底层，0:未做底层 1:已做底层',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  `signer` bigint(20) NULL DEFAULT NULL COMMENT '验收单签署人Id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '下游验收单-基础信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_goods_info
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_goods_info`;
CREATE TABLE `c_acceptance_goods_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `acceptance_goods_number` varchar(250)  DEFAULT NULL COMMENT '验收单编号',
  `goods_name` varchar(500)  DEFAULT NULL COMMENT '货物名称',
  `goods_material` varchar(500)  DEFAULT NULL COMMENT '货物材质',
  `goods_type` varchar(500)  DEFAULT NULL COMMENT '型号',
  `goods_factory` varchar(500)  DEFAULT NULL COMMENT '厂家',
  `goods_unit` varchar(50)  DEFAULT NULL COMMENT '单位',
  `goods_quantity` decimal(17, 4) NULL DEFAULT NULL COMMENT '数量',
  `acceptance_date` datetime(0) NULL DEFAULT NULL COMMENT '验收日期',
  `c_acceptance_basic_info_id` bigint(20) NULL DEFAULT NULL COMMENT '验收单基础信息表id',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  `sales_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '销售单价',
  `reference_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '参考价格',
  `floating_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '浮动单价',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 87 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单-货物信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_his_goods_info
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_his_goods_info`;
CREATE TABLE `c_acceptance_his_goods_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `acceptance_goods_number` varchar(250)  DEFAULT NULL COMMENT '验收单编号',
  `goods_name` varchar(500)  DEFAULT NULL COMMENT '货物名称',
  `goods_material` varchar(500)  DEFAULT NULL COMMENT '货物材质',
  `goods_type` varchar(500)  DEFAULT NULL COMMENT '型号',
  `goods_factory` varchar(500)  DEFAULT NULL COMMENT '厂家',
  `goods_unit` varchar(50)  DEFAULT NULL COMMENT '单位',
  `goods_quantity` decimal(17, 4) NULL DEFAULT NULL COMMENT '数量',
  `acceptance_date` datetime(0) NULL DEFAULT NULL COMMENT '验收日期',
  `acceptance_his_info_id` bigint(20) NULL DEFAULT NULL COMMENT '验收单历史信息表id',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  `sales_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '销售单价',
  `reference_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '参考价格',
  `floating_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '浮动单价',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单-历史货物信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_person_info
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_person_info`;
CREATE TABLE `c_acceptance_person_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `c_acceptance_basic_info_id` bigint(20) NOT NULL COMMENT '验收单Id',
  `name` varchar(50)  DEFAULT NULL COMMENT '用户名',
  `card_type` varchar(50)  DEFAULT '' COMMENT '证件类型',
  `type` varchar(50)  DEFAULT '' COMMENT '人员类型',
  `socialCreditCode` varchar(18)  DEFAULT NULL COMMENT '证件号码',
  `mobile` varchar(50)  DEFAULT NULL COMMENT '联系电话',
  `remark` varchar(1024)  DEFAULT NULL COMMENT '备注',
  `user_create` varchar(32)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(32)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单_人员信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_person_info_history
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_person_info_history`;
CREATE TABLE `c_acceptance_person_info_history`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `acceptance_basic_info_id` bigint(20) NOT NULL COMMENT '验收单Id',
  `name` varchar(50)  DEFAULT NULL COMMENT '用户名',
  `card_type` varchar(50)  DEFAULT '' COMMENT '证件类型',
  `type` varchar(50)  DEFAULT '' COMMENT '人员类型',
  `socialCreditCode` varchar(18)  DEFAULT NULL COMMENT '证件号码',
  `mobile` varchar(50)  DEFAULT NULL COMMENT '联系电话',
  `remark` varchar(1024)  DEFAULT NULL COMMENT '备注',
  `user_create` varchar(32)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(32)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单_人员历史信息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_price_adjust_his_info
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_price_adjust_his_info`;
CREATE TABLE `c_acceptance_price_adjust_his_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `c_acceptance_price_adjust_info_id` bigint(20) NULL DEFAULT NULL COMMENT '验收单-单价调整表ID',
  `expected_settlement_date` datetime(0) NULL DEFAULT NULL COMMENT '预计结算日期 ',
  `supplement_description` varchar(50)  DEFAULT '' COMMENT '补充说明',
  `check_operator_supplier` varchar(32)  DEFAULT NULL COMMENT '验收经办人（供应商）',
  `mobile` varchar(11)  DEFAULT NULL COMMENT '手机号',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单单价调整历史表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_price_adjust_info
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_price_adjust_info`;
CREATE TABLE `c_acceptance_price_adjust_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `c_acceptance_basic_info_id` bigint(20) NULL DEFAULT NULL COMMENT '验收单_基础信息表ID',
  `expected_settlement_date` datetime(0) NULL DEFAULT NULL COMMENT '预计结算日期 ',
  `supplement_description` varchar(50)  DEFAULT '' COMMENT '补充说明',
  `check_operator_supplier` varchar(32)  DEFAULT NULL COMMENT '验收经办人（供应商）',
  `mobile` varchar(11)  DEFAULT NULL COMMENT '联系方式',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单单价调整表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_price_goods_info
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_price_goods_info`;
CREATE TABLE `c_acceptance_price_goods_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `goods_id` bigint(20) DEFAULT NULL COMMENT '验收单货物id',
  `goods_name` varchar(500)  DEFAULT NULL COMMENT '货物名称',
  `acceptance_goods_number` varchar(250)  DEFAULT NULL COMMENT '验收单编号',
  `goods_material` varchar(500)  DEFAULT NULL COMMENT '货物材质',
  `goods_type` varchar(500)  DEFAULT NULL COMMENT '型号',
  `goods_factory` varchar(500)  DEFAULT NULL COMMENT '厂家',
  `goods_unit` varchar(50)  DEFAULT NULL COMMENT '单位',
  `goods_quantity` decimal(17, 4) NULL DEFAULT NULL COMMENT '数量',
  `acceptance_date` datetime(0) NULL DEFAULT NULL COMMENT '验收日期',
  `c_acceptance_price_adjust_info_id` bigint(20) NULL DEFAULT NULL COMMENT '验收单-单价调整表ID',
  `sales_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '销售单价',
  `reference_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '参考价格',
  `floating_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '浮动单价',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 95 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单单价调整-货物信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_sell_bill_ref
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_sell_bill_ref`;
CREATE TABLE `c_acceptance_sell_bill_ref`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `c_acceptance_basic_info_id` bigint(20) NULL DEFAULT NULL COMMENT '验收单-基础信息表ID',
  `sell_bill_id` bigint(20) NULL DEFAULT NULL COMMENT '钢小二-销售单信息id',
  `sell_bill_number` varchar(300)  DEFAULT '' COMMENT '销售单号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '钢小二-销售单和验收单关联关系表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_sign_confirmation
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_sign_confirmation`;
CREATE TABLE `c_acceptance_sign_confirmation`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `c_acceptance_basic_info_id` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '验收单-基础信息表ID',
  `contract_link` varchar(2048)  DEFAULT NULL COMMENT '合同链接',
  `short_contract_link` varchar(1024)  DEFAULT NULL COMMENT '客户合同链接短连接',
  `short_contract_link_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '短链接创建时间',
  `sign_conclusion` tinyint(1) NULL DEFAULT NULL COMMENT '签署结论 1完成',
  `remark` varchar(1024)  DEFAULT NULL COMMENT '说明',
  `user_create` varchar(32)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(32)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单签署确认表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_sign_confirmation_electronic_info
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_sign_confirmation_electronic_info`;
CREATE TABLE `c_acceptance_sign_confirmation_electronic_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `c_acceptance_sign_confirmation_id` bigint(20) NOT NULL COMMENT '验收单签署确认表Id',
  `contract_name` varchar(500)  DEFAULT NULL COMMENT '合同名称',
  `contract_id` varchar(500)  DEFAULT NULL COMMENT '合同id',
  `file_id` bigint(20) NULL DEFAULT NULL COMMENT '电子签文件',
  `electronic_signature_personal_id` bigint(20) NOT NULL COMMENT '电子签个人信息表Id',
  `transaction_id` varchar(255)  DEFAULT NULL COMMENT '客户合同交易id',
  `sign_status` tinyint(1) NULL DEFAULT NULL COMMENT '客户签署状态',
  `back_file_id` bigint(20) NULL DEFAULT NULL COMMENT '电子签回调文件',
  `report_file_id` bigint(20) NULL DEFAULT NULL COMMENT '出证电子签文件',
  `user_create` varchar(32)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(32)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  `call_back` tinyint(3) NULL DEFAULT NULL COMMENT '是否回调',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '验收单签署确认合同信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for c_acceptance_sign_confirmation_goods_info
-- ----------------------------
DROP TABLE IF EXISTS `c_acceptance_sign_confirmation_goods_info`;
CREATE TABLE `c_acceptance_sign_confirmation_goods_info`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `c_acceptance_sign_confirmation_id` bigint(20) NULL DEFAULT NULL COMMENT '验收单信息表id',
  `goods_name` varchar(500)  DEFAULT NULL COMMENT '货物名称',
  `goods_material` varchar(500)  DEFAULT NULL COMMENT '货物材质',
  `goods_type` varchar(500)  DEFAULT NULL COMMENT '型号',
  `goods_factory` varchar(500)  DEFAULT NULL COMMENT '厂家',
  `goods_unit` varchar(50)  DEFAULT NULL COMMENT '单位',
  `goods_quantity` decimal(17, 4) NULL DEFAULT NULL COMMENT '数量',
  `reference_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '参考价格',
  `floating_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '浮动单价',
  `sales_price` decimal(17, 4) NULL DEFAULT NULL COMMENT '销售单价',
  `acceptance_date` datetime(0) NOT NULL COMMENT '验收日期',
  `user_create` varchar(50)  DEFAULT '' COMMENT '创建人',
  `user_modified` varchar(50)  DEFAULT '' COMMENT '修改人',
  `gmt_create` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `gmt_modified` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '下游验收单-签署确认货物信息表' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;














alter table c_acceptance_person_info add column other bit(1)  comment "是否是 其他" after c_acceptance_basic_info_id;
alter table c_acceptance_basic_info add column submit_status tinyint(3) NOT NULL COMMENT '0暂存 1 提交' after signer;
update  c_acceptance_basic_info set  submit_status = 1 ;
update  c_acceptance_person_info set  other  = flase;


alter table c_acceptance_basic_info add column business_approval_status tinyint(3)  COMMENT '业务审核状态（0/null 未审核 1 已审核）' after submit_status;
alter table c_acceptance_basic_info_his add column is_approval tinyint(1)   COMMENT '申请审核，0:不申请 1:申请'  after signer;


alter table acceptance_approval add column c_acceptance_basic_his_id  bigint(20) DEFAULT NULL COMMENT '验收单历史表id' after c_acceptance_basic_info_id;




CREATE TABLE `acceptance_business_approval` (
                                                `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
                                                `c_acceptance_basic_info_id` bigint(20) DEFAULT NULL COMMENT '验收单基础信息表id',
                                                `c_acceptance_basic_his_id` bigint(20) DEFAULT NULL COMMENT '验收单历史信息表id',
                                                `approval_comment` varchar(3000) DEFAULT '' COMMENT '审批意见',
                                                `approval_conclusion` varchar(50) DEFAULT NULL COMMENT '审批结论',
                                                `auditor_id` bigint(20) DEFAULT '0' COMMENT '审核人Id',
                                                `user_create` varchar(50) DEFAULT '' COMMENT '创建人',
                                                `user_modified` varchar(50) DEFAULT '' COMMENT '修改人',
                                                `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                                `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                                `sign_confirm` tinyint(3) NOT NULL DEFAULT '0' COMMENT '签署确认 0否 1是',
                                                PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='验收单管理-业务审核表';





