新增ar_bill_detail_fee表的income_fee_id字段,更新UUID到新同步逻辑

This commit is contained in:
wuweihua
2026-11-15 09:39:57 +08:00
parent 0179a35942
commit 206e4e786b
6 changed files with 71 additions and 9 deletions
@@ -8,7 +8,7 @@ import com.bms.price.migration.domain.UuidToNewIdHolder;
import com.bms.price.migration.domain.UuidToNewProgressVo;
/**
* UUID -> bigint 阴影同步 Mapper(订单+income *_new + 关联表 order_id)
* UUID -> bigint 阴影同步 Mapper(订单+income *_new + order_id / income_fee_id)
*/
public interface UuidToNewSyncMapper
{
@@ -39,6 +39,9 @@ public interface UuidToNewSyncMapper
int insertIncomeFeeNew(UuidToNewIdHolder holder);
/** 回写 ar_bill_detail_fee.income_fee_id(= prc_income_bill_fee_new.fee_id) */
int updateArDetailFeeIncomeFeeId(@Param("oldFeeId") String oldFeeId, @Param("newFeeId") Long newFeeId);
/** 回写现网关联表 order_id(= prc_order_bill_new.bill_id) */
int updatePayBillOrderId(@Param("oldBillId") String oldBillId, @Param("newBillId") Long newBillId);
@@ -351,10 +351,13 @@ public class UuidToNewSyncServiceImpl implements IUuidToNewSyncService
h.setNewBillId(newBillId);
h.setNewIncomeId(newIncomeId);
syncMapper.insertIncomeFeeNew(h);
if (h.getNewId() == null)
Long newFeeId = h.getNewId();
if (newFeeId == null)
{
throw new IllegalStateException("insert income_fee_new no id for " + row.getFeeId());
}
// 回写现网 AR 费用行:旧 UUID 列不动,income_fee_id=新 fee_id
syncMapper.updateArDetailFeeIncomeFeeId(row.getFeeId(), newFeeId);
}
}
@@ -234,6 +234,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where f.fee_id = #{oldId}
</insert>
<update id="updateArDetailFeeIncomeFeeId">
update ar_bill_detail_fee
set income_fee_id = #{newFeeId}
where prc_income_bill_fee_id = #{oldFeeId}
</update>
<!-- 现网关联表回写 order_id(旧 UUID 列不动) -->
<update id="updatePayBillOrderId">