-3
@@ -10,7 +10,6 @@ public class UuidToNewIdHolder
|
|||||||
private String oldId;
|
private String oldId;
|
||||||
private Long newId;
|
private Long newId;
|
||||||
private Long newIncomeId;
|
private Long newIncomeId;
|
||||||
private Long newPayId;
|
|
||||||
private String orderNo;
|
private String orderNo;
|
||||||
private String status;
|
private String status;
|
||||||
private String failReason;
|
private String failReason;
|
||||||
@@ -31,8 +30,6 @@ public class UuidToNewIdHolder
|
|||||||
public void setNewId(Long newId) { this.newId = newId; }
|
public void setNewId(Long newId) { this.newId = newId; }
|
||||||
public Long getNewIncomeId() { return newIncomeId; }
|
public Long getNewIncomeId() { return newIncomeId; }
|
||||||
public void setNewIncomeId(Long newIncomeId) { this.newIncomeId = newIncomeId; }
|
public void setNewIncomeId(Long newIncomeId) { this.newIncomeId = newIncomeId; }
|
||||||
public Long getNewPayId() { return newPayId; }
|
|
||||||
public void setNewPayId(Long newPayId) { this.newPayId = newPayId; }
|
|
||||||
public String getOrderNo() { return orderNo; }
|
public String getOrderNo() { return orderNo; }
|
||||||
public void setOrderNo(String orderNo) { this.orderNo = orderNo; }
|
public void setOrderNo(String orderNo) { this.orderNo = orderNo; }
|
||||||
public String getStatus() { return status; }
|
public String getStatus() { return status; }
|
||||||
|
|||||||
-15
@@ -39,27 +39,12 @@ public interface UuidToNewSyncMapper
|
|||||||
|
|
||||||
int insertIncomeFeeNew(UuidToNewIdHolder holder);
|
int insertIncomeFeeNew(UuidToNewIdHolder holder);
|
||||||
|
|
||||||
List<String> selectPayIds(@Param("oldBillId") String oldBillId);
|
|
||||||
|
|
||||||
int insertPayBillNew(UuidToNewIdHolder holder);
|
|
||||||
|
|
||||||
List<UuidToNewFeeRow> selectPayFees(@Param("oldBillId") String oldBillId);
|
|
||||||
|
|
||||||
int insertPayFeeNew(UuidToNewIdHolder holder);
|
|
||||||
|
|
||||||
int updatePayFeeIdEqualsId(@Param("id") Long id);
|
|
||||||
|
|
||||||
int insertArDetailNew(@Param("oldBillId") String oldBillId, @Param("newBillId") Long newBillId);
|
int insertArDetailNew(@Param("oldBillId") String oldBillId, @Param("newBillId") Long newBillId);
|
||||||
|
|
||||||
List<UuidToNewFeeRow> selectArDetailFees(@Param("oldBillId") String oldBillId);
|
List<UuidToNewFeeRow> selectArDetailFees(@Param("oldBillId") String oldBillId);
|
||||||
|
|
||||||
int insertArDetailFeeNew(@Param("detailFeeId") Long detailFeeId, @Param("newFeeId") Long newFeeId);
|
int insertArDetailFeeNew(@Param("detailFeeId") Long detailFeeId, @Param("newFeeId") Long newFeeId);
|
||||||
|
|
||||||
List<UuidToNewFeeRow> selectPayBillLines(@Param("oldBillId") String oldBillId);
|
|
||||||
|
|
||||||
int insertPayBillLineNew(@Param("lineId") Long lineId, @Param("newBillId") Long newBillId,
|
|
||||||
@Param("newFeeId") Long newFeeId);
|
|
||||||
|
|
||||||
int insertBillingTaskNew(@Param("oldBillId") String oldBillId, @Param("newBillId") Long newBillId);
|
int insertBillingTaskNew(@Param("oldBillId") String oldBillId, @Param("newBillId") Long newBillId);
|
||||||
|
|
||||||
int insertJobLogStart(UuidToNewIdHolder holder);
|
int insertJobLogStart(UuidToNewIdHolder holder);
|
||||||
|
|||||||
+1
-56
@@ -27,7 +27,7 @@ import com.bms.price.migration.mapper.UuidToNewSyncMapper;
|
|||||||
import com.bms.price.migration.service.IUuidToNewSyncService;
|
import com.bms.price.migration.service.IUuidToNewSyncService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UUID -> bigint 阴影同步:占坑独立提交;业务拷贝一单一事务;批内可多线程
|
* UUID -> bigint 阴影同步:占坑独立提交;一单一事务;批内可多线程。
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class UuidToNewSyncServiceImpl implements IUuidToNewSyncService
|
public class UuidToNewSyncServiceImpl implements IUuidToNewSyncService
|
||||||
@@ -295,8 +295,6 @@ public class UuidToNewSyncServiceImpl implements IUuidToNewSyncService
|
|||||||
|
|
||||||
Map<String, Long> incomeMap = new HashMap<String, Long>();
|
Map<String, Long> incomeMap = new HashMap<String, Long>();
|
||||||
Map<String, Long> feeMap = new HashMap<String, Long>();
|
Map<String, Long> feeMap = new HashMap<String, Long>();
|
||||||
Map<String, Long> payMap = new HashMap<String, Long>();
|
|
||||||
Map<String, Long> payFeeMap = new HashMap<String, Long>();
|
|
||||||
|
|
||||||
UuidToNewIdHolder order = new UuidToNewIdHolder();
|
UuidToNewIdHolder order = new UuidToNewIdHolder();
|
||||||
order.setOldBillId(oldBillId);
|
order.setOldBillId(oldBillId);
|
||||||
@@ -352,44 +350,6 @@ public class UuidToNewSyncServiceImpl implements IUuidToNewSyncService
|
|||||||
feeMap.put(row.getFeeId(), h.getNewId());
|
feeMap.put(row.getFeeId(), h.getNewId());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (String oldPayId : syncMapper.selectPayIds(oldBillId))
|
|
||||||
{
|
|
||||||
UuidToNewIdHolder h = new UuidToNewIdHolder();
|
|
||||||
h.setOldId(oldPayId);
|
|
||||||
h.setNewBillId(newBillId);
|
|
||||||
syncMapper.insertPayBillNew(h);
|
|
||||||
if (h.getNewId() == null)
|
|
||||||
{
|
|
||||||
throw new IllegalStateException("insert pay_new no id for " + oldPayId);
|
|
||||||
}
|
|
||||||
payMap.put(oldPayId, h.getNewId());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (UuidToNewFeeRow row : syncMapper.selectPayFees(oldBillId))
|
|
||||||
{
|
|
||||||
Long newPayId = null;
|
|
||||||
if (row.getParentId() != null && !row.getParentId().isEmpty())
|
|
||||||
{
|
|
||||||
newPayId = payMap.get(row.getParentId());
|
|
||||||
if (newPayId == null)
|
|
||||||
{
|
|
||||||
throw new IllegalStateException("payMap miss " + row.getParentId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
UuidToNewIdHolder h = new UuidToNewIdHolder();
|
|
||||||
h.setOldId(row.getFeeId());
|
|
||||||
h.setNewBillId(newBillId);
|
|
||||||
h.setNewPayId(newPayId);
|
|
||||||
syncMapper.insertPayFeeNew(h);
|
|
||||||
Long rowId = h.getNewId();
|
|
||||||
if (rowId == null)
|
|
||||||
{
|
|
||||||
throw new IllegalStateException("insert pay_fee_new no id for " + row.getFeeId());
|
|
||||||
}
|
|
||||||
syncMapper.updatePayFeeIdEqualsId(rowId);
|
|
||||||
payFeeMap.put(row.getFeeId(), rowId);
|
|
||||||
}
|
|
||||||
|
|
||||||
syncMapper.insertArDetailNew(oldBillId, newBillId);
|
syncMapper.insertArDetailNew(oldBillId, newBillId);
|
||||||
|
|
||||||
for (UuidToNewFeeRow row : syncMapper.selectArDetailFees(oldBillId))
|
for (UuidToNewFeeRow row : syncMapper.selectArDetailFees(oldBillId))
|
||||||
@@ -403,21 +363,6 @@ public class UuidToNewSyncServiceImpl implements IUuidToNewSyncService
|
|||||||
syncMapper.insertArDetailFeeNew(detailFeeId, newFeeId);
|
syncMapper.insertArDetailFeeNew(detailFeeId, newFeeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (UuidToNewFeeRow row : syncMapper.selectPayBillLines(oldBillId))
|
|
||||||
{
|
|
||||||
Long lineId = Long.valueOf(row.getParentId());
|
|
||||||
Long newFeeId = null;
|
|
||||||
if (row.getFeeId() != null && !row.getFeeId().isEmpty())
|
|
||||||
{
|
|
||||||
newFeeId = payFeeMap.get(row.getFeeId());
|
|
||||||
if (newFeeId == null)
|
|
||||||
{
|
|
||||||
throw new IllegalStateException("payFeeMap miss for line fee " + row.getFeeId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
syncMapper.insertPayBillLineNew(lineId, newBillId, newFeeId);
|
|
||||||
}
|
|
||||||
|
|
||||||
syncMapper.insertBillingTaskNew(oldBillId, newBillId);
|
syncMapper.insertBillingTaskNew(oldBillId, newBillId);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -234,57 +234,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
where f.fee_id = #{oldId}
|
where f.fee_id = #{oldId}
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="selectPayIds" resultType="String">
|
|
||||||
select pay_bill_id from prc_pay_bill where bill_id = #{oldBillId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertPayBillNew" useGeneratedKeys="true" keyProperty="newId" keyColumn="pay_bill_id">
|
|
||||||
insert into prc_pay_bill_new (
|
|
||||||
bill_id, currency, product_amount, redline_amount,
|
|
||||||
cost_amount, pay_total, amount_a, amount_b,
|
|
||||||
amount_c, amount_d, belong_saler, belong_saler_code,
|
|
||||||
settlement_man, settlement_man_code, create_by, create_time,
|
|
||||||
update_by, update_time
|
|
||||||
)
|
|
||||||
select
|
|
||||||
#{newBillId}, p.currency, p.product_amount, p.redline_amount,
|
|
||||||
p.cost_amount, p.pay_total, p.amount_a, p.amount_b,
|
|
||||||
p.amount_c, p.amount_d, p.belong_saler, p.belong_saler_code,
|
|
||||||
p.settlement_man, p.settlement_man_code, p.create_by, p.create_time,
|
|
||||||
p.update_by, p.update_time
|
|
||||||
from prc_pay_bill p
|
|
||||||
where p.pay_bill_id = #{oldId}
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<select id="selectPayFees" resultType="com.bms.price.migration.domain.UuidToNewFeeRow">
|
|
||||||
select fee_id as feeId, pay_bill_id as parentId
|
|
||||||
from prc_pay_bill_fee
|
|
||||||
where bill_id = #{oldBillId}
|
|
||||||
order by fee_id
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertPayFeeNew" useGeneratedKeys="true" keyProperty="newId" keyColumn="id">
|
|
||||||
insert into prc_pay_bill_fee_new (
|
|
||||||
fee_id, bill_id, pay_bill_id, fee_type,
|
|
||||||
sc_id, fee_level, amount, currency,
|
|
||||||
round_mode, remark, fee_source, source_id,
|
|
||||||
is_deleted, statement_line_id, settle_supplier_id, settle_supplier_name,
|
|
||||||
create_time
|
|
||||||
)
|
|
||||||
select
|
|
||||||
0, #{newBillId}, #{newPayId}, f.fee_type,
|
|
||||||
f.sc_id, f.fee_level, f.amount, f.currency,
|
|
||||||
f.round_mode, f.remark, f.fee_source, f.source_id,
|
|
||||||
f.is_deleted, f.statement_line_id, f.settle_supplier_id, f.settle_supplier_name,
|
|
||||||
f.create_time
|
|
||||||
from prc_pay_bill_fee f
|
|
||||||
where f.fee_id = #{oldId}
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="updatePayFeeIdEqualsId">
|
|
||||||
update prc_pay_bill_fee_new set fee_id = id where id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<insert id="insertArDetailNew">
|
<insert id="insertArDetailNew">
|
||||||
insert into ar_bill_detail_new (
|
insert into ar_bill_detail_new (
|
||||||
detail_id, ar_bill_id, prc_order_bill_id, detail_no,
|
detail_id, ar_bill_id, prc_order_bill_id, detail_no,
|
||||||
@@ -335,33 +284,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
where f.detail_fee_id = #{detailFeeId}
|
where f.detail_fee_id = #{detailFeeId}
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="selectPayBillLines" resultType="com.bms.price.migration.domain.UuidToNewFeeRow">
|
|
||||||
select cast(line_id as char) as parentId, fee_id as feeId
|
|
||||||
from pay_bill_line
|
|
||||||
where order_bill_id = #{oldBillId}
|
|
||||||
order by line_id
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertPayBillLineNew">
|
|
||||||
insert into pay_bill_line_new (
|
|
||||||
line_id, bill_id, fee_id, order_bill_id,
|
|
||||||
order_no, lading_no, lading_fee_id, fee_name,
|
|
||||||
fee_source, fee_level, amount, supplier_amount,
|
|
||||||
diff_amount, diff_status, tax_rate, amount_net,
|
|
||||||
tax_amount, base_amount, currency, price_date,
|
|
||||||
version_no, remote_flag, density_level, line_source
|
|
||||||
)
|
|
||||||
select
|
|
||||||
l.line_id, l.bill_id, #{newFeeId}, #{newBillId},
|
|
||||||
l.order_no, l.lading_no, l.lading_fee_id, l.fee_name,
|
|
||||||
l.fee_source, l.fee_level, l.amount, l.supplier_amount,
|
|
||||||
l.diff_amount, l.diff_status, l.tax_rate, l.amount_net,
|
|
||||||
l.tax_amount, l.base_amount, l.currency, l.price_date,
|
|
||||||
l.version_no, l.remote_flag, l.density_level, l.line_source
|
|
||||||
from pay_bill_line l
|
|
||||||
where l.line_id = #{lineId}
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<insert id="insertBillingTaskNew">
|
<insert id="insertBillingTaskNew">
|
||||||
insert into prc_billing_task_new (
|
insert into prc_billing_task_new (
|
||||||
task_id, transfer_no, tracking_no, order_no,
|
task_id, transfer_no, tracking_no, order_no,
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
-- 全字段复制;仅 UUID(varchar36) 相关列改为 bigint;不加 old_*
|
-- 全字段复制;仅 UUID(varchar36) 相关列改为 bigint;不加 old_*
|
||||||
-- UUID 追踪仅 mig_bi_order_done;无 mig_bi_map_*;无外键;旧表不动
|
-- UUID 追踪仅 mig_bi_order_done;无 mig_bi_map_*;无外键;旧表不动
|
||||||
-- 注意:测试库 prc_pay_bill_fee 已有 id AI 主键,fee_id 只改 bigint 不设 AI
|
-- 注意:测试库 prc_pay_bill_fee 已有 id AI 主键,fee_id 只改 bigint 不设 AI
|
||||||
|
-- 应付阴影表(prc_pay_bill_new / prc_pay_bill_fee_new / pay_bill_line_new)暂不建,后续脚本补
|
||||||
|
|
||||||
SET NAMES utf8mb4;
|
SET NAMES utf8mb4;
|
||||||
|
|
||||||
|
|
||||||
@@ -380,64 +382,6 @@ CREATE TABLE IF NOT EXISTS `prc_income_bill_fee_new` (
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='应收费用明细';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='应收费用明细';
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `prc_pay_bill_new`;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `prc_pay_bill_new` (
|
|
||||||
`pay_bill_id` bigint NOT NULL AUTO_INCREMENT COMMENT '应付主表ID',
|
|
||||||
`bill_id` bigint NOT NULL COMMENT '计费订单ID',
|
|
||||||
`currency` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'CNY' COMMENT '币种',
|
|
||||||
`product_amount` decimal(12,4) DEFAULT NULL COMMENT '产品价合计',
|
|
||||||
`redline_amount` decimal(12,4) DEFAULT NULL COMMENT '红线价合计',
|
|
||||||
`cost_amount` decimal(12,4) DEFAULT NULL COMMENT '成本价合计(当前计费结果)',
|
|
||||||
`pay_total` decimal(12,4) DEFAULT NULL COMMENT '应付合计(当前等于成本价)',
|
|
||||||
`amount_a` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'A段合计',
|
|
||||||
`amount_b` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'B段合计',
|
|
||||||
`amount_c` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'C段合计',
|
|
||||||
`amount_d` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'D段合计',
|
|
||||||
`belong_saler` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '业务员/销售员',
|
|
||||||
`belong_saler_code` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '销售员编码',
|
|
||||||
`settlement_man` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '结算员',
|
|
||||||
`settlement_man_code` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '结算员编码',
|
|
||||||
`create_by` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
|
|
||||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
|
||||||
`update_by` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
|
|
||||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
|
||||||
PRIMARY KEY (`pay_bill_id`) USING BTREE,
|
|
||||||
UNIQUE KEY `uk_pay_bill_order_bill` (`bill_id`) USING BTREE,
|
|
||||||
KEY `idx_pay_bill_saler` (`belong_saler`) USING BTREE,
|
|
||||||
KEY `idx_pay_bill_settlement` (`settlement_man`) USING BTREE
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='应付主表(订单计费与应付费用中间层,与订单一对一)';
|
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `prc_pay_bill_fee_new`;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `prc_pay_bill_fee_new` (
|
|
||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
|
|
||||||
`fee_id` bigint NOT NULL COMMENT '费用明细ID',
|
|
||||||
`bill_id` bigint NOT NULL COMMENT '订单主表ID',
|
|
||||||
`pay_bill_id` bigint DEFAULT NULL COMMENT '应付主表ID',
|
|
||||||
`fee_type` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '费用类型(字典bms_fee_type)',
|
|
||||||
`sc_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '附加费配置ID',
|
|
||||||
`fee_level` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '费用所属阶段:1、a段(头程仓储);2、b段(提单运输);3、c段(清关);4、d段(尾程)',
|
|
||||||
`amount` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '金额',
|
|
||||||
`currency` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CNY' COMMENT '币种',
|
|
||||||
`round_mode` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'HALF_UP' COMMENT '取值方式',
|
|
||||||
`remark` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
|
|
||||||
`fee_source` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CALC' COMMENT 'CALC计算 LADING提单分摊 MANUAL人工',
|
|
||||||
`source_id` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '来源数据id',
|
|
||||||
`is_deleted` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0' COMMENT '是否删除:0未删除 1已删除',
|
|
||||||
`statement_line_id` bigint(20) DEFAULT NULL COMMENT '已进入的应付账单行ID,空表示未出账',
|
|
||||||
`settle_supplier_id` bigint(20) DEFAULT NULL COMMENT '结算供应商ID,空表示还没标明付款对象',
|
|
||||||
`settle_supplier_name` varchar(32) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '结算供应商名称',
|
|
||||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
|
||||||
UNIQUE KEY `uk_pay_bill_fee_item` (`bill_id`,`fee_type`,`sc_id`) USING BTREE,
|
|
||||||
KEY `idx_pay_bill_fee_type` (`fee_type`) USING BTREE,
|
|
||||||
KEY `idx_pay_fee_pay_bill` (`pay_bill_id`) USING BTREE,
|
|
||||||
KEY `idx_pay_fee_settle` (`settle_supplier_id`,`statement_line_id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='应付费用明细';
|
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `ar_bill_detail_new`;
|
DROP TABLE IF EXISTS `ar_bill_detail_new`;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `ar_bill_detail_new` (
|
CREATE TABLE IF NOT EXISTS `ar_bill_detail_new` (
|
||||||
@@ -510,40 +454,6 @@ CREATE TABLE IF NOT EXISTS `ar_bill_detail_fee_new` (
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='应收账单费用快照';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='应收账单费用快照';
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `pay_bill_line_new`;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `pay_bill_line_new` (
|
|
||||||
`line_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '账单行ID',
|
|
||||||
`bill_id` bigint(20) NOT NULL COMMENT '应付账单ID',
|
|
||||||
`fee_id` bigint DEFAULT NULL COMMENT '应付费用明细ID',
|
|
||||||
`order_bill_id` bigint DEFAULT NULL COMMENT '订单ID',
|
|
||||||
`order_no` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单号',
|
|
||||||
`lading_no` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '提单号',
|
|
||||||
`lading_fee_id` bigint(20) DEFAULT NULL COMMENT '留在主单上的费用',
|
|
||||||
`fee_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '费用名称',
|
|
||||||
`fee_source` varchar(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'CALC计算 LADING提单分摊 MANUAL人工',
|
|
||||||
`fee_level` varchar(8) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '费用阶段 1A 2B 3C 4D',
|
|
||||||
`amount` decimal(12,4) NOT NULL COMMENT '金额快照',
|
|
||||||
`supplier_amount` decimal(12,4) DEFAULT NULL COMMENT '对方金额',
|
|
||||||
`diff_amount` decimal(12,4) DEFAULT NULL COMMENT '差额,对方减我方',
|
|
||||||
`diff_status` varchar(20) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'NONE' COMMENT 'NONE无差异 OPEN待处理 ACCEPT_OURS接受我方 ACCEPT_THEIRS接受对方',
|
|
||||||
`tax_rate` decimal(8,4) NOT NULL DEFAULT '0.0000' COMMENT '税率,0.06 表示 6%',
|
|
||||||
`amount_net` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT '不含税金额',
|
|
||||||
`tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT '税额',
|
|
||||||
`base_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT '本位币金额,人民币',
|
|
||||||
`currency` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '币种',
|
|
||||||
`price_date` date DEFAULT NULL COMMENT '取价日',
|
|
||||||
`version_no` int(11) DEFAULT NULL COMMENT '价卡版本',
|
|
||||||
`remote_flag` char(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Y偏远 N非偏远',
|
|
||||||
`density_level` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'HIGH MEDIUM LOW',
|
|
||||||
`line_source` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'ORDER订单费用 LADING主单费用',
|
|
||||||
PRIMARY KEY (`line_id`),
|
|
||||||
KEY `idx_pay_bill_line_bill` (`bill_id`),
|
|
||||||
KEY `idx_pay_bill_line_order` (`order_bill_id`),
|
|
||||||
KEY `idx_pay_bill_line_lading_fee` (`lading_fee_id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='应付账单费用明细';
|
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `prc_billing_task_new`;
|
DROP TABLE IF EXISTS `prc_billing_task_new`;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `prc_billing_task_new` (
|
CREATE TABLE IF NOT EXISTS `prc_billing_task_new` (
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
-- 删除应付阴影表(改为后续脚本补)
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
DROP TABLE IF EXISTS `pay_bill_line_new`;
|
||||||
|
DROP TABLE IF EXISTS `prc_pay_bill_fee_new`;
|
||||||
|
DROP TABLE IF EXISTS `prc_pay_bill_new`;
|
||||||
Reference in New Issue
Block a user