|
@@ -773,6 +773,31 @@ public class InstitutionService {
|
|
|
log.warn("支付宝 institution.modify 异常: {}", e.getMessage());
|
|
log.warn("支付宝 institution.modify 异常: {}", e.getMessage());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 同步适用范围变更到支付宝 scope.modify
|
|
|
|
|
+ if (dto.getApplicableScope() != null && dto.getScopeOwnerIdList() != null
|
|
|
|
|
+ && !dto.getScopeOwnerIdList().isEmpty()) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ String adapterType = mapScopeToAdapterType(dto.getApplicableScope());
|
|
|
|
|
+ AlipayEbppInvoiceInstitutionScopeModifyModel scopeModel =
|
|
|
|
|
+ new AlipayEbppInvoiceInstitutionScopeModifyModel();
|
|
|
|
|
+ scopeModel.setInstitutionId(existing.getInstitutionId());
|
|
|
|
|
+ scopeModel.setEnterpriseId(existing.getEnterpriseId());
|
|
|
|
|
+ scopeModel.setAdapterType(adapterType);
|
|
|
|
|
+ if (dto.getScopeOwnerType() != null) {
|
|
|
|
|
+ scopeModel.setOwnerType(dto.getScopeOwnerType());
|
|
|
|
|
+ }
|
|
|
|
|
+ scopeModel.setAddOwnerIdList(dto.getScopeOwnerIdList());
|
|
|
|
|
+ AlipayEbppInvoiceInstitutionScopeModifyRequest scopeReq =
|
|
|
|
|
+ new AlipayEbppInvoiceInstitutionScopeModifyRequest();
|
|
|
|
|
+ scopeReq.setBizModel(scopeModel);
|
|
|
|
|
+ alipayClientFactory.getClient(existing.getEnterpriseId()).execute(scopeReq);
|
|
|
|
|
+ log.info("修改制度时同步适用范围成功: institutionId={}, adapterType={}",
|
|
|
|
|
+ existing.getInstitutionId(), adapterType);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.warn("修改制度时同步适用范围失败(不影响主流程): {}", e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// TODO E1: sync modify_standard_detail_info when amount/limit changes
|
|
// TODO E1: sync modify_standard_detail_info when amount/limit changes
|
|
|
// When dto.amount or dto.singleLimit changed, build modifyStandardDetailInfo
|
|
// When dto.amount or dto.singleLimit changed, build modifyStandardDetailInfo
|
|
|
// and call Alipay institution.modify again with the updated standard detail info.
|
|
// and call Alipay institution.modify again with the updated standard detail info.
|