⚡ 调整金蝶付款同步:付款计划暂不传经A102-4反查勾稽,付款完成模拟收敛为一键方法
This commit is contained in:
+29
-29
@@ -41,7 +41,6 @@ import org.springblade.system.pojo.entity.DictBiz;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiApBillQueryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiApBillSaveDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiApBillSaveEntryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiApBillSavePlanDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiPayApplyPushDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiPayApplyPushEntryDTO;
|
||||
import org.springblade.thirdparty.bfi.pojo.dto.BfiPayApplyQueryDTO;
|
||||
@@ -112,7 +111,6 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -825,7 +823,8 @@ public class PaymentApplicationServiceImpl extends BaseServiceImpl<PaymentApplic
|
||||
|
||||
/**
|
||||
* 查询正式结算单下绑定、单据状态为审核通过(approved)的付款信息(blade_formal_settlement_payment)。
|
||||
* 付款申请可能关联多张正式结算单,按结算明细归属的结算单汇总去重后查询,创建时间升序
|
||||
* 付款申请可能关联多张正式结算单,按结算明细归属的结算单汇总去重后查询,创建时间升序。
|
||||
* 当前付款计划 planentity 暂不传、本方法未启用,保留待付款计划启用后供 A102-2 取数
|
||||
*
|
||||
* @param entity 付款申请实体
|
||||
* @param context 金蝶同步上下文(缓存载体)
|
||||
@@ -1039,8 +1038,8 @@ public class PaymentApplicationServiceImpl extends BaseServiceImpl<PaymentApplic
|
||||
* 幂等跳过保存并返回已有单据编号(说明上次同步已在后续下推/落库环节中断,应续推而非拦截报错),
|
||||
* 由调用方先经 A103-2 预检付款申请单是否已下推成功,再决定继续下推或直接回填。
|
||||
* 明细分录按结算明细货物编码+计量单位分组推送,金额取各组结算金额(含税/不含税);
|
||||
* 付款计划送正式结算单下绑定、单据状态为审核通过(approved)的付款信息(awrp_entry_code_p 取付款单号),
|
||||
* 无审核通过付款信息时不传、由金蝶自动汇总生成
|
||||
* 付款计划 planentity 暂不传(启用方案见方法内注释,取数方法 approvedSettlementPayments 已保留),
|
||||
* 当前由金蝶按明细自动汇总生成
|
||||
*
|
||||
* @param entity 付款申请实体
|
||||
* @param entryGroups 结算明细聚合出的应付单分录组
|
||||
@@ -1151,29 +1150,30 @@ public class PaymentApplicationServiceImpl extends BaseServiceImpl<PaymentApplic
|
||||
}
|
||||
param.setDetailentry(detailentry);
|
||||
|
||||
// 付款计划 planentity:送正式结算单下绑定、单据状态为审核通过(approved)的付款信息,每条付款信息一行;
|
||||
// awrp_entry_code_p 取付款单号(A103-1 下推 awrp_finapbill_entryid 的勾稽值);
|
||||
// 无审核通过的付款信息时不传,由金蝶按明细自动汇总生成,A103-1 推送前再经 A102-4 反查 awrp_entry_code_p
|
||||
List<FormalSettlementPayment> approvedPayments = approvedSettlementPayments(entity, context);
|
||||
// 付款计划 planentity 暂不传(联调待确认后启用):启用后送正式结算单下绑定、单据状态为审核通过(approved)
|
||||
// 的付款信息,每条付款信息一行,awrp_entry_code_p 取付款单号(A103-1 下推 awrp_finapbill_entryid 勾稽此值,
|
||||
// 取数见 approvedSettlementPayments);当前不传由金蝶按明细自动汇总生成,A103-1 推送前经 A102-4 反查 awrp_entry_code_p
|
||||
// List<FormalSettlementPayment> approvedPayments = approvedSettlementPayments(entity, context);
|
||||
// if (Func.isNotEmpty(approvedPayments)) {
|
||||
// List<BfiApBillSavePlanDTO> planentity = new ArrayList<>();
|
||||
// for (FormalSettlementPayment payment : approvedPayments) {
|
||||
// BfiApBillSavePlanDTO plan = new BfiApBillSavePlanDTO();
|
||||
// // 外部系统来源分录标识(候选键):付款单号
|
||||
// plan.setAwrpEntryCodeP(payment.getPaymentNo());
|
||||
// // 应付金额:付款信息申请付款金额
|
||||
// plan.setPlanpricetax(money(payment.getAppliedAmount()));
|
||||
// // 【必填】项目.项目编码(联调期临时传金蝶测试档案值)
|
||||
// plan.setPlanprojectNumber(KingdeeBfiConstant.BFI_AP_BILL_PROJECT_NUMBER_TEST);
|
||||
// // 到期日:付款信息创建日期(yyyy-MM-dd)
|
||||
// plan.setPlanduedate(payment.getCreateTime() == null ? null
|
||||
// : payment.getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().toString());
|
||||
// planentity.add(plan);
|
||||
// planEntryCodes.add(payment.getPaymentNo());
|
||||
// }
|
||||
// param.setPlanentity(planentity);
|
||||
// }
|
||||
// 付款计划未传时勾稽标识集合保持为空,A103-1 推送前经 A102-4 反查金蝶生成的 awrp_entry_code_p
|
||||
List<String> planEntryCodes = new ArrayList<>();
|
||||
if (Func.isNotEmpty(approvedPayments)) {
|
||||
List<BfiApBillSavePlanDTO> planentity = new ArrayList<>();
|
||||
for (FormalSettlementPayment payment : approvedPayments) {
|
||||
BfiApBillSavePlanDTO plan = new BfiApBillSavePlanDTO();
|
||||
// 外部系统来源分录标识(候选键):付款单号
|
||||
plan.setAwrpEntryCodeP(payment.getPaymentNo());
|
||||
// 应付金额:付款信息申请付款金额
|
||||
plan.setPlanpricetax(money(payment.getAppliedAmount()));
|
||||
// 【必填】项目.项目编码(联调期临时传金蝶测试档案值)
|
||||
plan.setPlanprojectNumber(KingdeeBfiConstant.BFI_AP_BILL_PROJECT_NUMBER_TEST);
|
||||
// 到期日:付款信息创建日期(yyyy-MM-dd)
|
||||
plan.setPlanduedate(payment.getCreateTime() == null ? null
|
||||
: payment.getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().toString());
|
||||
planentity.add(plan);
|
||||
planEntryCodes.add(payment.getPaymentNo());
|
||||
}
|
||||
param.setPlanentity(planentity);
|
||||
}
|
||||
// TODO 待业务确认:存在预付款抵扣时是否需传预付信息 preentry(y_billtype/y_billid/y_settleamt),本期不传、后续迭代
|
||||
|
||||
BfiBillSaveResultVO saveResult = bfiService.saveApBill(param);
|
||||
@@ -1185,8 +1185,8 @@ public class PaymentApplicationServiceImpl extends BaseServiceImpl<PaymentApplic
|
||||
/**
|
||||
* 推送金蝶付款申请(A103-1 应付下推付款申请,正式结算付款第二步),返回星瀚付款申请单id。
|
||||
* 付款申请分录与财务应付单明细分录一一对应,申请金额取各组结算金额(含税);
|
||||
* awrp_finapbill_entryid 勾稽 A102-2 付款计划分录 awrp_entry_code_p(审核通过的付款信息单据号,
|
||||
* 无审核通过付款信息时经 A102-4 反查金蝶自动生成的值);awrp_entry_code 填结算明细单据号
|
||||
* awrp_finapbill_entryid 勾稽 A102-2 付款计划分录 awrp_entry_code_p:付款计划暂不传,统一经 A102-4 反查
|
||||
* 金蝶自动生成的值;付款计划启用后优先取审核通过的付款信息单据号。awrp_entry_code 填结算明细单据号
|
||||
*
|
||||
* @param entity 付款申请实体
|
||||
* @param entryGroups 结算明细聚合出的应付单分录组
|
||||
|
||||
Reference in New Issue
Block a user