✨ 新增金蝶同步常量类并维护单据类型映射字典

This commit is contained in:
刘泉佳
2026-09-17 10:38:34 +08:00
parent c941a51bb5
commit d1833a7ac1
@@ -0,0 +1,121 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.constant;
import java.util.Map;
/**
* 付款同步金蝶(星瀚)固定值。
* 金蝶侧档案编码暂以常量维护,待金蝶侧确认取值后直接修改常量重新发包。
*
* @author Chill
*/
public final class KingdeeBfiConstant {
/** 往来类型:供应商(付款申请与财务应付单共用)。 */
public static final String BFI_SUPPLIER_ASSTACT_TYPE = "bd_supplier";
/** 来源单据类型:上游合同(有合同时传 awrp_src_bt)。 */
public static final String BFI_CONTRACT_SRC_BT = "awrp_contract_info";
/** 无项目时传的项目编码占位值。 */
public static final String BFI_PROJECT_NUMBER_NONE = "999";
/** 付款类型编码:正式付款(结算付款)。 */
public static final String BFI_PAYMENT_TYPE_FORMAL = "201";
/** 付款类型编码:预付款。 */
public static final String BFI_PAYMENT_TYPE_PREPAY = "202";
/** A102-2 默认单据类型名称:服务采购应付(经 AP_BILL_BILLTYPE_MAP 转换为编码)。待确认:具体类型需金蝶侧最终确认,确认后修改此名称即可。 */
public static final String BFI_AP_BILL_BILLTYPE_NAME = "服务采购应付";
/** A102-2 款项性质编码(暂按 2001 材料采购)。待确认:编码需金蝶侧最终确认,确认后如有调整直接改此常量。 */
public static final String BFI_AP_BILL_PAY_PROPERTY = "2001";
/**
* A102-2 付款方式(赊购 CREDIT,允许金蝶侧后续调整付款金额;
* 现购 CASH 会由金蝶自动 100% 推付款)。待确认:如业务要求现购再调整。
*/
public static final String BFI_AP_BILL_PUR_MODE = "CREDIT";
/**
* A102-2 明细必填:物料编码。TMS 无物料档案,当前为占位空值,
* 推送前会校验拦截。待确认:需金蝶侧提供运输服务类物料编码后补充。
*/
public static final String BFI_AP_BILL_MATERIAL = "";
/**
* A102-2 明细必填:计量单位编码。TMS 无对应档案,当前为占位空值,
* 推送前会校验拦截。待确认:需金蝶侧确认编码(如"吨")后补充。
*/
public static final String BFI_AP_BILL_MEASURE_UNIT = "";
/** A102-2 必填:外部单据类型(应付单来源标识)。待确认:取值需金蝶侧确认,确认后如有调整直接改此常量。 */
public static final String BFI_AP_BILL_SRC_TYPE = "TMS财务应付单";
/** 财务应付单(ap_finapbill)单据类型映射:中文名称 -> 星瀚编码。 */
public static final Map<String, String> AP_BILL_BILLTYPE_MAP = Map.ofEntries(
Map.entry("借贷项调整", "ApFin_borr_BT_S"),
Map.entry("费用采购应付", "ApFin_fee_BT_S"),
Map.entry("其他应付", "ApFin_other_BT_S"),
Map.entry("产品委外应付", "ApFin_product_BT_S"),
Map.entry("标准采购应付", "ApFin_pur_BT_S"),
Map.entry("采购费用应付", "ApFin_purfee_BT_S"),
Map.entry("销售费用应付", "ApFin_salefee_BT_S"),
Map.entry("服务采购应付", "ApFin_service_BT_S"),
Map.entry("资产采购应付", "ap_finapbill_asset_BT_S")
);
/** 财务应收单(ar_finarbill)单据类型映射:中文名称 -> 星瀚编码(当前付款链路未启用,应收结算单推送规则待业务确认)。 */
public static final Map<String, String> AR_BILL_BILLTYPE_MAP = Map.ofEntries(
Map.entry("借贷项调整", "arfin_borrowar_BT_S"),
Map.entry("其他应收", "arfin_other_BT_S"),
Map.entry("销售费用应收", "arfin_salefee_BT_S"),
Map.entry("服务销售应收", "arfin_sersal_BT_S"),
Map.entry("标准销售应收", "arfin_standard_BT_S")
);
/** 付款申请单(ap_payapply)单据类型映射:中文名称 -> 星瀚编码(使用规则待业务确认)。 */
public static final Map<String, String> PAY_APPLY_BILLTYPE_MAP = Map.of(
"采购付款申请", "ap_payapply_BT_S",
"其他付款申请", "ap_payapply_oth_BT_S"
);
/**
* 按中文名称从映射字典转换单据类型编码。
*
* @param billtypeMap 单据类型映射字典
* @param name 单据类型中文名称
* @return 星瀚单据类型编码,未维护时返回 null
*/
public static String billtypeBy(Map<String, String> billtypeMap, String name) {
return billtypeMap.get(name);
}
private KingdeeBfiConstant() {
}
}