16 次代码提交 24e001192c ... c6516f4ff4

作者 SHA1 备注 提交日期
  liutao c6516f4ff4 fix(苏商银行):续授信逻辑修改 1 月之前
  liuj e2fae2f1d6 付款审核显示问题修复 1 月之前
  liuj 2bbda55722 Merge remote-tracking branch 'origin/smb' into smb 1 月之前
  liuj c4ddd56c39 付款审核文件预览问题修复 1 月之前
  liutao 1bc4c1fa41 fix(苏商银行):续授信逻辑修改 1 月之前
  liutao c219a11425 fix(苏商银行):续授信逻辑修改 1 月之前
  liutao 9db06e6a99 Merge remote-tracking branch 'origin/smb' into smb 1 月之前
  liutao c1a0d66083 fix(苏商银行):续授信逻辑修改 1 月之前
  liuj 15037fbd00 还款周期由20号改成21号 1 月之前
  liuj 7d9af2bfb1 部分问题修复 1 月之前
  liutao 54450e1d00 fix(苏商银行):续授信逻辑修改 1 月之前
  liutao 903ab18929 Merge branch 'smb' 1 月之前
  liutao bd6b4c0c7f Merge remote-tracking branch 'origin/smb' into smb 1 月之前
  liuj 0d77c0986b 融资申请查看历史页面问题修复 1 月之前
  liuj da2b18e026 权限sql提交 1 月之前
  liuj 1b12eb1fee 贸理通推送sop逻辑优化 1 月之前

+ 1 - 1
build.gradle

@@ -9,7 +9,7 @@ targetCompatibility = 1.8
 
 jar {
     baseName = 'factoring-trade-prod'
-    version = '1.0.64'
+    version = '1.0.67'
 }
 
 springBoot {

+ 0 - 70
src/main/java/com/sunxung/factoring/entity/financing/payment/PaymentApplyHis.java

@@ -94,36 +94,6 @@ public class PaymentApplyHis extends BaseEntity {
     @TableField(exist = false)
     private String taskId;
 
-    /**
-     * 是否为苏商资方
-     */
-    @TableField(exist = false)
-    private Boolean smbManagement;
-
-    /**
-     * 销售合同已签署文件
-     */
-    @TableField(exist = false)
-    private List<FileStorage> salesContractFileList;
-
-    /**
-     * 采购合同已签署文件
-     */
-    @TableField(exist = false)
-    private List<FileStorage> purchContractFileList;
-
-    /**
-     * 验收单已签署文件
-     */
-    @TableField(exist = false)
-    private List<FileStorage> acceptanceFileList;
-
-    /**
-     * 代偿承诺书
-     */
-    @TableField(exist = false)
-    private List<FileStorage> commitmentFileList;
-
     public Long getPaymentInfoId() {
         return paymentInfoId;
     }
@@ -235,44 +205,4 @@ public class PaymentApplyHis extends BaseEntity {
     public void setPaymentApplyId(Long paymentApplyId) {
         this.paymentApplyId = paymentApplyId;
     }
-
-    public Boolean getSmbManagement() {
-        return smbManagement;
-    }
-
-    public void setSmbManagement(Boolean smbManagement) {
-        this.smbManagement = smbManagement;
-    }
-
-    public List<FileStorage> getSalesContractFileList() {
-        return salesContractFileList;
-    }
-
-    public void setSalesContractFileList(List<FileStorage> salesContractFileList) {
-        this.salesContractFileList = salesContractFileList;
-    }
-
-    public List<FileStorage> getPurchContractFileList() {
-        return purchContractFileList;
-    }
-
-    public void setPurchContractFileList(List<FileStorage> purchContractFileList) {
-        this.purchContractFileList = purchContractFileList;
-    }
-
-    public List<FileStorage> getAcceptanceFileList() {
-        return acceptanceFileList;
-    }
-
-    public void setAcceptanceFileList(List<FileStorage> acceptanceFileList) {
-        this.acceptanceFileList = acceptanceFileList;
-    }
-
-    public List<FileStorage> getCommitmentFileList() {
-        return commitmentFileList;
-    }
-
-    public void setCommitmentFileList(List<FileStorage> commitmentFileList) {
-        this.commitmentFileList = commitmentFileList;
-    }
 }

+ 18 - 16
src/main/java/com/sunxung/factoring/service/financing/contract/impl/ContractLegalFinalApprovalServiceImpl.java

@@ -150,23 +150,25 @@ public class ContractLegalFinalApprovalServiceImpl extends ServiceImpl<ContractL
         ReviewQuotaDisburse reviewQuotaDisburse = reviewQuotaDisburseService.getById(reviewFinancingInfo.getReviewQuotaDisburseId());
         CFinancingBasicInfo cFinancingBasicInfo = financingBasicInfoService.getById(reviewQuotaDisburse.getFinancingBasicInfoId());
         SupplierInfo supplierInfo = supplierInfoService.getByEnterpriseId(cFinancingBasicInfo.getMainEnterpriseId());
-        List<FinancingFromInvestors> financingFromInvestorsList = financingFromInvestorsService.lambdaQuery().eq(FinancingFromInvestors::getSupplierInfoId, supplierInfo.getId()).orderByDesc(FinancingFromInvestors::getId).list();
-        if(CollectionUtil.isNotEmpty(financingFromInvestorsList)){
-            FinancingFromInvestors financingFromInvestors = financingFromInvestorsList.get(0);
-            //查询账户信息
-            AccountInfoQuery accountInfoQuery = new AccountInfoQuery();
-            accountInfoQuery.setSceneCode("3");
-            accountInfoQuery.setAcctType("5");
-            List<AccountInfoQueryResp> accountInfoQueryResps = smbApiService.accountInfoQuery(accountInfoQuery, financingFromInvestors.getOpenId());
-            if(CollectionUtil.isEmpty(accountInfoQueryResps)){
-                throw new BusinessException(CodeUtil.FAIL,"为查询到账户信息");
-            }
-            AccountInfoQueryResp accountInfoQueryResp = accountInfoQueryResps.get(0);
+        if(reviewFinancingInfo.getInstitutionName().equals(ConstantUtil.JIANGSU_SUSHANG_BANK)){
+            List<FinancingFromInvestors> financingFromInvestorsList = financingFromInvestorsService.lambdaQuery().eq(FinancingFromInvestors::getSupplierInfoId, supplierInfo.getId()).orderByDesc(FinancingFromInvestors::getId).list();
+            if(CollectionUtil.isNotEmpty(financingFromInvestorsList)){
+                FinancingFromInvestors financingFromInvestors = financingFromInvestorsList.get(0);
+                //查询账户信息
+                AccountInfoQuery accountInfoQuery = new AccountInfoQuery();
+                accountInfoQuery.setSceneCode("3");
+                accountInfoQuery.setAcctType("5");
+                List<AccountInfoQueryResp> accountInfoQueryResps = smbApiService.accountInfoQuery(accountInfoQuery, financingFromInvestors.getOpenId());
+                if(CollectionUtil.isEmpty(accountInfoQueryResps)){
+                    throw new BusinessException(CodeUtil.FAIL,"为查询到账户信息");
+                }
+                AccountInfoQueryResp accountInfoQueryResp = accountInfoQueryResps.get(0);
 
-            financingFromInvestors.setRepaymentAccount(accountInfoQueryResp.getClientAcct());
-            financingFromInvestors.setRepaymentAccountName(accountInfoQueryResp.getAcctName());
-            financingFromInvestors.setRepaymentAccountType("内部户");
-            financingFromInvestorsService.updateById(financingFromInvestors);
+                financingFromInvestors.setRepaymentAccount(accountInfoQueryResp.getClientAcct());
+                financingFromInvestors.setRepaymentAccountName(accountInfoQueryResp.getAcctName());
+                financingFromInvestors.setRepaymentAccountType("内部户");
+                financingFromInvestorsService.updateById(financingFromInvestors);
+            }
         }
 
         if (null == contractLegalFinalApproval) {

+ 14 - 2
src/main/java/com/sunxung/factoring/service/financing/payment/IPaymentApplyService.java

@@ -6,6 +6,8 @@ import com.sunxung.factoring.entity.financing.payment.PaymentApply;
 import com.sunxung.factoring.entity.financing.payment.PaymentApproval;
 import com.sunxung.factoring.entity.financing.payment.PaymentCondition;
 import com.sunxung.factoring.entity.financing.sop.RefinancingRepaymentPlan;
+import com.sunxung.factoring.entity.financing.sop.RefinancingUseCreditReport;
+import com.sunxung.factoring.entity.smb.FinancingFromInvestorsNotice;
 import com.sunxung.factoring.entity.smb.FinancingLoanInfo;
 import com.sunxung.factoring.service.smbApi.dto.LoanCreditRiskMsgDto;
 
@@ -70,9 +72,19 @@ public interface IPaymentApplyService extends IService<PaymentApply> {
          *
          * @param financingBasicInfo
          * @param management
-         * @param payoutDate
+         * @param loanInfo
          */
-    void financingToSop(CFinancingBasicInfo financingBasicInfo, String management, String payoutDate);
+    void financingToSop(CFinancingBasicInfo financingBasicInfo, String management, FinancingLoanInfo loanInfo);
+
+
+    /**
+     * 构建再融资上报信息
+     *
+     * @param businessNo
+     * @param notice
+     * @param financingLoanInfo
+     */
+    RefinancingUseCreditReport createUseCreditReport(String businessNo, FinancingFromInvestorsNotice notice, FinancingLoanInfo financingLoanInfo);
 
     /**
      * 构建sop再融资计划

+ 1 - 136
src/main/java/com/sunxung/factoring/service/financing/payment/impl/PaymentApplyHisServiceImpl.java

@@ -63,26 +63,6 @@ public class PaymentApplyHisServiceImpl extends ServiceImpl<PaymentApplyHisMappe
     @Autowired
     private FileStorageService fileStorageService;
     @Autowired
-    private ISysAttachmentRefService sysAttachmentRefService;
-    @Autowired
-    private PurchContractService purchContractService;
-    @Autowired
-    private PurchContractBasicInfoService purchContractBasicInfoService;
-    @Autowired
-    private SalesContractService salesContractService;
-    @Autowired
-    private ICSalesContractBasicInfoService salesContractBasicInfoService;
-    @Autowired
-    private ICSalesSignConfirmationService salesSignConfirmationService;
-    @Autowired
-    private ICSalesSignConfirmationElectronicInfoService signConfirmationElectronicInfoService;
-    @Autowired
-    private FileService fileService;
-    @Autowired
-    private ICFinancingBasicInfoService financingBasicInfoService;
-    @Autowired
-    private ICFinancingGoodsInfoService financingGoodsInfoService;
-    @Autowired
     private IPaymentApplyService paymentApplyService;
 
     @Override
@@ -111,7 +91,7 @@ public class PaymentApplyHisServiceImpl extends ServiceImpl<PaymentApplyHisMappe
 
         List<PaymentConditionHis> conditionHisList = paymentConditionHisService.list(new QueryWrapper<PaymentConditionHis>()
                 .eq("payment_apply_his_id", paymentApplyHis.getId()));
-        if (CollectionUtil.isNotEmpty(conditionHisList)){
+        if (CollectionUtil.isNotEmpty(conditionHisList)) {
             for (PaymentConditionHis conditionHis : conditionHisList) {
                 List<PaymentConditionFileRefHis> conditionFileRefs = paymentConditionFileRefHisService.list(new QueryWrapper<PaymentConditionFileRefHis>()
                         .eq("payment_condition_his_id", conditionHis.getId()));
@@ -126,121 +106,6 @@ public class PaymentApplyHisServiceImpl extends ServiceImpl<PaymentApplyHisMappe
             }
         }
         paymentApplyHis.setConditionList(conditionHisList);
-
-        //判断如果是苏宁资方、需要拉取合同文件
-        Boolean smbManagement = false;
-        if (reviewFinancingInfo != null && ConstantUtil.JIANGSU_SUSHANG_BANK.equals(reviewFinancingInfo.getInstitutionName())) {
-            smbManagement = true;
-            //销售合同
-            List<FileStorage> salesContractFiles = getSalesContractFile(paymentInfo.getBusinessNo());
-            paymentApplyHis.setSalesContractFileList(salesContractFiles);
-            //采购合同
-            List<FileStorage> purchContractFiles = getPurchContractFiles(paymentInfo.getBusinessNo());
-            paymentApplyHis.setPurchContractFileList(purchContractFiles);
-            //验收单
-            List<FileStorage> acceptanceFiles = getAcceptanceFile(id);
-            paymentApplyHis.setAcceptanceFileList(acceptanceFiles);
-            //代偿承诺函
-            AttachmentDto attachmentDto = AttachmentDto.builder()
-                    .setEntityId(paymentApply.getId())
-                    .setChildEnum(FileModuleDict.ChildEnum.SU_SHANG_COMPENSATION_COMMITMENT_LETTER)
-                    .build();
-            List<FileStorage> commitmentFileList = sysAttachmentRefService.getFiles(attachmentDto);
-            paymentApplyHis.setCommitmentFileList(commitmentFileList);
-        }
-        paymentApplyHis.setSmbManagement(smbManagement);
         return paymentApplyHis;
     }
-
-    /**
-     * 填充销售合同文件
-     *
-     * @param businessNo
-     */
-    private List<FileStorage> getSalesContractFile(String businessNo) {
-        List<FileStorage> salesContractFileList = new ArrayList<>();
-        CSalesContract salesContractManagement = salesContractService.getByBusinessNumber(businessNo);
-        CSalesContractBasicInfo salesContractBasicInfo = salesContractBasicInfoService.getOne(new QueryWrapper<CSalesContractBasicInfo>().eq("c_sales_contract_management_id", salesContractManagement.getId()));
-
-        //已签署的文件
-        CSalesSignConfirmation salesSignConfirmation = salesSignConfirmationService
-                .lambdaQuery().eq(CSalesSignConfirmation::getcSalesContractManagementId, salesContractManagement.getId()).one();
-        if (salesSignConfirmation != null) {
-            List<CSalesSignConfirmationElectronicInfo> signElectronicInfos = signConfirmationElectronicInfoService
-                    .list(new QueryWrapper<CSalesSignConfirmationElectronicInfo>().eq("c_sales_sign_confirmation_id", salesSignConfirmation.getId()));
-            if (CollectionUtil.isNotEmpty(signElectronicInfos)) {
-                signElectronicInfos.forEach(signElectronicInfo -> {
-                    salesContractFileList.addAll(sysAttachmentRefService.getFiles(AttachmentDto.builder()
-                            .setChildEnum(FileModuleDict.ChildEnum.SIGN_CONFIRM_BACK_FILE).setEntityId(signElectronicInfo.getId()).build()));
-                });
-            }
-        } else {
-            //没有的话拉取销售合同原件
-            //合同文件
-            List<FileStorageDO> fileStorageDOList = fileService.findByBusinessId(salesContractBasicInfo.getId(), FileModuleDict.ChildEnum.SALES_CONTRACT_FILE.getCode());
-            if (CollectionUtil.isNotEmpty(fileStorageDOList)) {
-                fileStorageDOList.forEach(fileStorageDO -> {
-                    FileStorage fileStorage = new FileStorage();
-                    fileStorage.setAbsolutePath(fileStorageDO.getAbsolutePath());
-                    fileStorage.setName(fileStorageDO.getOriginalName());
-                    fileStorage.setPath(fileStorageDO.getPath());
-                    fileStorage.setId(fileStorageDO.getId());
-                    fileStorage.setOriginalName(fileStorageDO.getOriginalName());
-                    salesContractFileList.add(fileStorage);
-                });
-            }
-        }
-        return salesContractFileList;
-    }
-
-    /**
-     * 填充采购合同附件
-     *
-     * @param businessNo
-     */
-    private List<FileStorage> getPurchContractFiles(String businessNo) {
-        //采购合同 文件
-        PurchContractManagement purchContractManagement = purchContractService
-                .getOne(new QueryWrapper<PurchContractManagement>().eq("business_number", businessNo)
-                );
-        PurchContractBasicInfo purchContractBasicInfo = purchContractBasicInfoService.lambdaQuery().eq(PurchContractBasicInfo::getPurchContractManagementId, purchContractManagement.getId()).one();
-
-        List<FileStorage> purchaseContract = sysAttachmentRefService.getFiles(AttachmentDto.builder()
-                .setChildEnum(FileModuleDict.ChildEnum.PURCHASE_CONTRACT_SIGN_FILE)
-                .setEntityId(purchContractBasicInfo.getId()).build());
-
-        return purchaseContract;
-    }
-
-    /**
-     * 填充验收单签署文件
-     *
-     * @param financingBasicInfoId
-     * @return
-     */
-    private List<FileStorage> getAcceptanceFile(Long financingBasicInfoId) {
-        List<FileStorage> acceptanceFiles = new ArrayList<>();
-        CFinancingBasicInfo financingBasicInfo = financingBasicInfoService.getById(financingBasicInfoId);
-        if (financingBasicInfo != null) {
-            List<CFinancingGoodsInfo> financingGoodsInfoList = financingGoodsInfoService.list(new QueryWrapper<CFinancingGoodsInfo>()
-                    .select("DISTINCT acceptance_basic_info_id AS cAcceptanceBasicInfoId")
-                    .eq("c_financing_basic_info_id", financingBasicInfo.getId()));
-            if (CollectionUtil.isNotEmpty(financingGoodsInfoList)) {
-                for (CFinancingGoodsInfo goodsInfo : financingGoodsInfoList) {
-                    if (goodsInfo.getcAcceptanceBasicInfoId() != null) {
-                        //获取已签署文件
-                        AttachmentDto attachmentDto = AttachmentDto.builder()
-                                .setEntityId(goodsInfo.getcAcceptanceBasicInfoId())
-                                .setChildEnum(FileModuleDict.ChildEnum.ACCEPTANCE_UPSTREAM_FILE_SIGN)
-                                .build();
-                        List<FileStorage> files = sysAttachmentRefService.getFiles(attachmentDto);
-                        if (CollectionUtil.isNotEmpty(files)) {
-                            acceptanceFiles.addAll(files);
-                        }
-                    }
-                }
-            }
-        }
-        return acceptanceFiles;
-    }
 }

+ 25 - 13
src/main/java/com/sunxung/factoring/service/financing/payment/impl/PaymentApplyServiceImpl.java

@@ -560,6 +560,20 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
                         if (CollectionUtil.isNotEmpty(files)) {
                             acceptanceFiles.addAll(files);
                         }
+                        //获取下游验收文件
+                        List<FileStorageDO> fileStorageDOList = fileService.findByBusinessId(goodsInfo.getcAcceptanceBasicInfoId(), FileModuleDict.ChildEnum.ACCEPTANCE_FILE.getCode());
+                        if (CollectionUtil.isNotEmpty(fileStorageDOList)) {
+                            fileStorageDOList.forEach(fileStorageDO -> {
+                                FileStorage fileStorage = new FileStorage();
+                                fileStorage.setAbsolutePath(fileStorageDO.getAbsolutePath());
+                                fileStorage.setName(fileStorageDO.getOriginalName());
+                                fileStorage.setPath(fileStorageDO.getPath());
+                                fileStorage.setId(fileStorageDO.getId());
+                                fileStorage.setOriginalName(fileStorageDO.getOriginalName());
+                                fileStorage.setFileType(fileStorageDO.getType());
+                                acceptanceFiles.add(fileStorage);
+                            });
+                        }
 //                        AcceptanceSignConfirmation acceptanceSignConfirmation = acceptanceSignConfirmationService.lambdaQuery()
 //                                .eq(AcceptanceSignConfirmation::getAcceptanceBasicInfoId, goodsInfo.getcAcceptanceBasicInfoId()).one();
 //                        if (acceptanceSignConfirmation != null) {
@@ -742,10 +756,10 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
                     String bizNo = createBizNo();
                     LoanApplyResp loanApplyResp = withdrawApplyBySmb(financingBasicInfo, reviewFinancingInfo, fileInfoList, bizNo);
                     //保存资方放款信息
-                    saveFinancingLoanInfo(financingBasicInfo, reviewFinancingInfo, loanApplyResp, bizNo);
+                    FinancingLoanInfo loanInfo = saveFinancingLoanInfo(financingBasicInfo, reviewFinancingInfo, loanApplyResp, bizNo);
                     if ("02".equals(loanApplyResp.getStatus())) {
                         //成功,向sop推送融资信息
-                        financingToSop(financingBasicInfo, ConstantUtil.JIANGSU_SUSHANG_BANK, loanApplyResp.getPayoutDate());
+                        financingToSop(financingBasicInfo, ConstantUtil.JIANGSU_SUSHANG_BANK, loanInfo);
                     }
                 } else {
                     //向sop推送融资信息
@@ -899,10 +913,10 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
      *
      * @param financingBasicInfo 融资信息
      * @param management         资方名称
-     * @param payoutDate         放款日期
+     * @param loanInfo           放款信息
      */
     @Override
-    public void financingToSop(CFinancingBasicInfo financingBasicInfo, String management, String payoutDate) {
+    public void financingToSop(CFinancingBasicInfo financingBasicInfo, String management, FinancingLoanInfo loanInfo) {
         //查询sop对应的业务编号
         String getBusinessNoByTradeUrl = getBusinessNoByTrade + "?businessNumber=" + financingBasicInfo.getBusinessNumber();
         ResponseEntity<String> responseEntity = restTemplate.getForEntity(getBusinessNoByTradeUrl, String.class);
@@ -943,7 +957,7 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
         List<ReviewIncomeExpenditurePlan> planList;
         if (ConstantUtil.JIANGSU_SUSHANG_BANK.equals(management)) {
             //如果是苏宁资方,重新调用还款计划试算接口获取最新的收支计划
-            Date loanDate = DateUtil.getGeneralDateYMD(payoutDate);
+            Date loanDate = DateUtil.getGeneralDateYMD(loanInfo.getPayoutDate());
             reviewFinancingInfo.setStartingDate(loanDate);
             ReviewFinancingInfoApi reviewFinancingInfoApi = autoFinancingInfoApi(reviewFinancingInfo);
             quotaDisburseReport.setReviewFinancingInfo(reviewFinancingInfoApi);
@@ -1000,12 +1014,9 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
         if (ConstantUtil.JIANGSU_SUSHANG_BANK.equals(management)) {
             //如果资方是苏商银行、支用上报完成后、还需要再融资上报
             FinancingFromInvestorsNotice notice = reviewQuotaDisburseService.getFinancingFromInvestorsNotice(financingBasicInfo.getId());
-            //查询借据编号
-            FinancingLoanInfo financingLoanInfo = financingLoanInfoService.lambdaQuery().eq(FinancingLoanInfo::getcFinancingBasicInfoId, financingBasicInfo.getId())
-                    .eq(FinancingLoanInfo::getPayoutStatus, "02").one();
-            if (financingLoanInfo != null && financingLoanInfo.getDueBillNo() != null) {
+            if (loanInfo != null && loanInfo.getDueBillNo() != null) {
                 //构建再融资上报
-                RefinancingUseCreditReport useCreditReport = createUseCreditReport(businessNo, notice, financingLoanInfo);
+                RefinancingUseCreditReport useCreditReport = createUseCreditReport(businessNo, notice, loanInfo);
 
                 //再融资上报
                 ResponseEntity<String> refinancingResponseEntity = restTemplate.postForEntity(refinancingUseCreditReportUrl, useCreditReport, String.class);
@@ -1024,7 +1035,7 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
      * @param notice
      * @param financingLoanInfo
      */
-    private RefinancingUseCreditReport createUseCreditReport(String businessNo, FinancingFromInvestorsNotice notice, FinancingLoanInfo financingLoanInfo) {
+    public RefinancingUseCreditReport createUseCreditReport(String businessNo, FinancingFromInvestorsNotice notice, FinancingLoanInfo financingLoanInfo) {
         RefinancingUseCreditReport useCreditReport = new RefinancingUseCreditReport();
         //业务编号
         useCreditReport.setBusinessNo(businessNo);
@@ -1250,8 +1261,8 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
      * @param loanApplyResp
      * @param bizNo
      */
-    private void saveFinancingLoanInfo(CFinancingBasicInfo financingBasicInfo, ReviewFinancingInfo reviewFinancingInfo,
-                                       LoanApplyResp loanApplyResp, String bizNo) {
+    private FinancingLoanInfo saveFinancingLoanInfo(CFinancingBasicInfo financingBasicInfo, ReviewFinancingInfo reviewFinancingInfo,
+                                                    LoanApplyResp loanApplyResp, String bizNo) {
 
         FinancingLoanInfo loanInfo = new FinancingLoanInfo();
         loanInfo.setcFinancingBasicInfoId(financingBasicInfo.getId());
@@ -1299,6 +1310,7 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
         loanInfo.setRepayAcctType(financingFromInvestors.getRepaymentAccountType());
         loanInfo.setBizNo(bizNo);
         financingLoanInfoService.save(loanInfo);
+        return loanInfo;
     }
 
     /**

+ 190 - 0
src/main/java/com/sunxung/factoring/service/financing/payment/impl/PaymentApprovalServiceImpl.java

@@ -4,15 +4,41 @@ import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.sunxung.factoring.component.exception.BusinessException;
+import com.sunxung.factoring.component.exception.ValidatorException;
 import com.sunxung.factoring.component.util.CodeUtil;
+import com.sunxung.factoring.component.util.ConstantUtil;
+import com.sunxung.factoring.dict.impl.FileModuleDict;
+import com.sunxung.factoring.entity.financing.apply.CFinancingBasicInfo;
+import com.sunxung.factoring.entity.financing.apply.CFinancingGoodsInfo;
 import com.sunxung.factoring.entity.financing.payment.*;
+import com.sunxung.factoring.entity.financing.review.ReviewFinancingInfo;
+import com.sunxung.factoring.entity.purchcontractmanagement.PurchContractBasicInfo;
+import com.sunxung.factoring.entity.purchcontractmanagement.PurchContractManagement;
+import com.sunxung.factoring.entity.salescontractmanagement.CSalesContract;
+import com.sunxung.factoring.entity.salescontractmanagement.CSalesContractBasicInfo;
+import com.sunxung.factoring.entity.salescontractmanagement.CSalesSignConfirmation;
+import com.sunxung.factoring.entity.salescontractmanagement.CSalesSignConfirmationElectronicInfo;
 import com.sunxung.factoring.entity.sys.FileStorage;
+import com.sunxung.factoring.entity.sys.FileStorageDO;
 import com.sunxung.factoring.mapper.financing.payment.PaymentApprovalMapper;
+import com.sunxung.factoring.service.financing.apply.ICFinancingBasicInfoService;
+import com.sunxung.factoring.service.financing.apply.ICFinancingGoodsInfoService;
 import com.sunxung.factoring.service.financing.payment.*;
+import com.sunxung.factoring.service.financing.review.ReviewFinancingInfoService;
+import com.sunxung.factoring.service.purchcontractmanagement.PurchContractBasicInfoService;
+import com.sunxung.factoring.service.purchcontractmanagement.PurchContractService;
+import com.sunxung.factoring.service.salescontractmanagement.ICSalesContractBasicInfoService;
+import com.sunxung.factoring.service.salescontractmanagement.ICSalesSignConfirmationElectronicInfoService;
+import com.sunxung.factoring.service.salescontractmanagement.ICSalesSignConfirmationService;
+import com.sunxung.factoring.service.salescontractmanagement.SalesContractService;
+import com.sunxung.factoring.service.sys.FileService;
 import com.sunxung.factoring.service.sys.FileStorageService;
+import com.sunxung.factoring.service.sys.ISysAttachmentRefService;
+import com.sunxung.factoring.service.sys.dto.AttachmentDto;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -38,6 +64,32 @@ public class PaymentApprovalServiceImpl extends ServiceImpl<PaymentApprovalMappe
     private IReceivablesRegisterInfoService receivablesRegisterInfoService;
     @Autowired
     private IReceivablesRegisterFileService receivablesRegisterFileService;
+    @Autowired
+    private IPaymentApplyService paymentApplyService;
+    @Autowired
+    private IPaymentInfoService paymentInfoService;
+    @Autowired
+    private ReviewFinancingInfoService reviewFinancingInfoService;
+    @Autowired
+    private ISysAttachmentRefService sysAttachmentRefService;
+    @Autowired
+    private PurchContractService purchContractService;
+    @Autowired
+    private PurchContractBasicInfoService purchContractBasicInfoService;
+    @Autowired
+    private SalesContractService salesContractService;
+    @Autowired
+    private ICSalesContractBasicInfoService salesContractBasicInfoService;
+    @Autowired
+    private ICSalesSignConfirmationService salesSignConfirmationService;
+    @Autowired
+    private ICSalesSignConfirmationElectronicInfoService signConfirmationElectronicInfoService;
+    @Autowired
+    private FileService fileService;
+    @Autowired
+    private ICFinancingBasicInfoService financingBasicInfoService;
+    @Autowired
+    private ICFinancingGoodsInfoService financingGoodsInfoService;
 
     @Override
     public PaymentApproval getView(Long id) {
@@ -45,6 +97,14 @@ public class PaymentApprovalServiceImpl extends ServiceImpl<PaymentApprovalMappe
         if (paymentApproval == null) {
             throw new BusinessException(CodeUtil.FAIL, "获取不到对应的付款审批信息");
         }
+        PaymentApply paymentApply = paymentApplyService.getById(paymentApproval.getPaymentApplyId());
+        if (paymentApply == null) {
+            throw new ValidatorException(CodeUtil.FAIL, "查询不到对应的付款申请信息!");
+        }
+        PaymentInfo paymentInfo = paymentInfoService.getById(paymentApply.getPaymentInfoId());
+        if (paymentInfo == null) {
+            throw new ValidatorException(CodeUtil.FAIL, "查询不到对应的付款信息!");
+        }
 
         //应收账款登记信息
         ReceivablesRegisterInfo receivablesRegisterInfo = receivablesRegisterInfoService.getOne(new QueryWrapper<ReceivablesRegisterInfo>()
@@ -96,6 +156,136 @@ public class PaymentApprovalServiceImpl extends ServiceImpl<PaymentApprovalMappe
         }
         paymentApproval.setPaymentConditionList(paymentConditionList);
 
+        ReviewFinancingInfo reviewFinancingInfo = reviewFinancingInfoService.getOne(new QueryWrapper<ReviewFinancingInfo>()
+                .eq("review_quota_disburse_id", paymentInfo.getQuotaDisburseId()));
+        //判断如果是苏宁资方、需要拉取合同文件
+        Boolean smbManagement = false;
+        if (reviewFinancingInfo != null && ConstantUtil.JIANGSU_SUSHANG_BANK.equals(reviewFinancingInfo.getInstitutionName())) {
+            smbManagement = true;
+            //销售合同
+            List<FileStorage> salesContractFiles = getSalesContractFile(paymentInfo.getBusinessNo());
+            paymentApproval.setSalesContractFileList(salesContractFiles);
+            //采购合同
+            List<FileStorage> purchContractFiles = getPurchContractFiles(paymentInfo.getBusinessNo());
+            paymentApproval.setPurchContractFileList(purchContractFiles);
+            //验收单
+            List<FileStorage> acceptanceFiles = getAcceptanceFile(paymentInfo.getFinancingBasicInfoId());
+            paymentApproval.setAcceptanceFileList(acceptanceFiles);
+            //代偿承诺函
+            AttachmentDto attachmentDto = AttachmentDto.builder()
+                    .setEntityId(paymentApply.getId())
+                    .setChildEnum(FileModuleDict.ChildEnum.SU_SHANG_COMPENSATION_COMMITMENT_LETTER)
+                    .build();
+            List<FileStorage> commitmentFileList = sysAttachmentRefService.getFiles(attachmentDto);
+            paymentApproval.setCommitmentFileList(commitmentFileList);
+        }
+        paymentApproval.setSmbManagement(smbManagement);
         return paymentApproval;
     }
+
+    /**
+     * 填充销售合同文件
+     *
+     * @param businessNo
+     */
+    private List<FileStorage> getSalesContractFile(String businessNo) {
+        List<FileStorage> salesContractFileList = new ArrayList<>();
+        CSalesContract salesContractManagement = salesContractService.getByBusinessNumber(businessNo);
+        CSalesContractBasicInfo salesContractBasicInfo = salesContractBasicInfoService.getOne(new QueryWrapper<CSalesContractBasicInfo>().eq("c_sales_contract_management_id", salesContractManagement.getId()));
+
+        //已签署的文件
+        CSalesSignConfirmation salesSignConfirmation = salesSignConfirmationService
+                .lambdaQuery().eq(CSalesSignConfirmation::getcSalesContractManagementId, salesContractManagement.getId()).one();
+        if (salesSignConfirmation != null) {
+            List<CSalesSignConfirmationElectronicInfo> signElectronicInfos = signConfirmationElectronicInfoService
+                    .list(new QueryWrapper<CSalesSignConfirmationElectronicInfo>().eq("c_sales_sign_confirmation_id", salesSignConfirmation.getId()));
+            if (CollectionUtil.isNotEmpty(signElectronicInfos)) {
+                signElectronicInfos.forEach(signElectronicInfo -> {
+                    salesContractFileList.addAll(sysAttachmentRefService.getFiles(AttachmentDto.builder()
+                            .setChildEnum(FileModuleDict.ChildEnum.SIGN_CONFIRM_BACK_FILE).setEntityId(signElectronicInfo.getId()).build()));
+                });
+            }
+        } else {
+            //没有的话拉取销售合同原件
+            //合同文件
+            List<FileStorageDO> fileStorageDOList = fileService.findByBusinessId(salesContractBasicInfo.getId(), FileModuleDict.ChildEnum.SALES_CONTRACT_FILE.getCode());
+            if (CollectionUtil.isNotEmpty(fileStorageDOList)) {
+                fileStorageDOList.forEach(fileStorageDO -> {
+                    FileStorage fileStorage = new FileStorage();
+                    fileStorage.setAbsolutePath(fileStorageDO.getAbsolutePath());
+                    fileStorage.setName(fileStorageDO.getOriginalName());
+                    fileStorage.setPath(fileStorageDO.getPath());
+                    fileStorage.setId(fileStorageDO.getId());
+                    fileStorage.setOriginalName(fileStorageDO.getOriginalName());
+                    salesContractFileList.add(fileStorage);
+                });
+            }
+        }
+        return salesContractFileList;
+    }
+
+    /**
+     * 填充采购合同附件
+     *
+     * @param businessNo
+     */
+    private List<FileStorage> getPurchContractFiles(String businessNo) {
+        //采购合同 文件
+        PurchContractManagement purchContractManagement = purchContractService
+                .getOne(new QueryWrapper<PurchContractManagement>().eq("business_number", businessNo)
+                );
+        PurchContractBasicInfo purchContractBasicInfo = purchContractBasicInfoService.lambdaQuery().eq(PurchContractBasicInfo::getPurchContractManagementId, purchContractManagement.getId()).one();
+
+        List<FileStorage> purchaseContract = sysAttachmentRefService.getFiles(AttachmentDto.builder()
+                .setChildEnum(FileModuleDict.ChildEnum.PURCHASE_CONTRACT_SIGN_FILE)
+                .setEntityId(purchContractBasicInfo.getId()).build());
+
+        return purchaseContract;
+    }
+
+    /**
+     * 填充验收单签署文件
+     *
+     * @param financingBasicInfoId
+     * @return
+     */
+    private List<FileStorage> getAcceptanceFile(Long financingBasicInfoId) {
+        List<FileStorage> acceptanceFiles = new ArrayList<>();
+        CFinancingBasicInfo financingBasicInfo = financingBasicInfoService.getById(financingBasicInfoId);
+        if (financingBasicInfo != null) {
+            List<CFinancingGoodsInfo> financingGoodsInfoList = financingGoodsInfoService.list(new QueryWrapper<CFinancingGoodsInfo>()
+                    .select("DISTINCT acceptance_basic_info_id AS cAcceptanceBasicInfoId")
+                    .eq("c_financing_basic_info_id", financingBasicInfo.getId()));
+            if (CollectionUtil.isNotEmpty(financingGoodsInfoList)) {
+                for (CFinancingGoodsInfo goodsInfo : financingGoodsInfoList) {
+                    if (goodsInfo.getcAcceptanceBasicInfoId() != null) {
+                        //获取已签署文件
+                        AttachmentDto attachmentDto = AttachmentDto.builder()
+                                .setEntityId(goodsInfo.getcAcceptanceBasicInfoId())
+                                .setChildEnum(FileModuleDict.ChildEnum.ACCEPTANCE_UPSTREAM_FILE_SIGN)
+                                .build();
+                        List<FileStorage> files = sysAttachmentRefService.getFiles(attachmentDto);
+                        if (CollectionUtil.isNotEmpty(files)) {
+                            acceptanceFiles.addAll(files);
+                        }
+                        //获取下游验收文件
+                        List<FileStorageDO> fileStorageDOList = fileService.findByBusinessId(goodsInfo.getcAcceptanceBasicInfoId(), FileModuleDict.ChildEnum.ACCEPTANCE_FILE.getCode());
+                        if (CollectionUtil.isNotEmpty(fileStorageDOList)) {
+                            fileStorageDOList.forEach(fileStorageDO -> {
+                                FileStorage fileStorage = new FileStorage();
+                                fileStorage.setAbsolutePath(fileStorageDO.getAbsolutePath());
+                                fileStorage.setName(fileStorageDO.getOriginalName());
+                                fileStorage.setPath(fileStorageDO.getPath());
+                                fileStorage.setId(fileStorageDO.getId());
+                                fileStorage.setOriginalName(fileStorageDO.getOriginalName());
+                                fileStorage.setFileType(fileStorageDO.getType());
+                                acceptanceFiles.add(fileStorage);
+                            });
+                        }
+                    }
+                }
+            }
+        }
+        return acceptanceFiles;
+    }
 }

+ 9 - 9
src/main/java/com/sunxung/factoring/service/financing/review/impl/ReviewQuotaDisburseServiceImpl.java

@@ -1167,12 +1167,12 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
     private void addReviewRltRepay(ReviewQuotaDisburse quotaDisburse) {
 
         if (null != quotaDisburse && null != quotaDisburse.getId()) {
-            if (quotaDisburse.getReviewFinancingInfo() == null || quotaDisburse.getReviewFinancingInfo().getFinancingAmount() == null) {
-                throw new BusinessException(CodeUtil.FAIL, "获取不到融资金额信息");
-            }
-
             List<ReviewRltRepay> list = quotaDisburse.getRltRepayList();
             if (null != list && list.size() > 0) {
+                if (quotaDisburse.getReviewFinancingInfo() == null || quotaDisburse.getReviewFinancingInfo().getFinancingAmount() == null) {
+                    throw new BusinessException(CodeUtil.FAIL, "获取不到融资金额信息");
+                }
+
                 int i = 0;
                 Dictionary arlpTypeDict = dictService.getByCode("arlpType_BZR");
                 if (arlpTypeDict == null || arlpTypeDict.getId() == null) {
@@ -1940,8 +1940,8 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
             plan.setIncomeExpenditureDate(endDate);
             plan.setIncomeExpenditureType(IncomeExpenditureTypeDict.ChildEnum.PRINCIPAL.getCode());
             plan.setFinalCashFlow(reviewFinancingInfo.getFinancingAmount());
-            //收款主体默认为债
-            plan.setReceivingSubject(ConstantUtil.CREDITOR);
+            //收款主体默认为债
+            plan.setReceivingSubject(ConstantUtil.DEBTOR);
             planList.add(plan);
         }
 
@@ -2050,8 +2050,8 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
                         plan.setIncomeExpenditureDate(repayDate);
                         plan.setIncomeExpenditureType(IncomeExpenditureTypeDict.ChildEnum.PRINCIPAL.getCode());
                         plan.setFinalCashFlow(principal);
-                        //收款主体默认为债
-                        plan.setReceivingSubject(ConstantUtil.CREDITOR);
+                        //收款主体默认为债
+                        plan.setReceivingSubject(ConstantUtil.DEBTOR);
                         planList.add(plan);
                     }
                     if (StringUtils.isNotBlank(repayPlan.getInterest()) && !"0".equals(repayPlan.getInterest())) {
@@ -2102,7 +2102,7 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
         //还款方式
         repayPlanTrial.setRepayMethod("2");
         //还款周期
-        repayPlanTrial.setRepayCycl("1MA20");
+        repayPlanTrial.setRepayCycl("1MA21");
         //查询授信完成后客户的openId
         FinancingFromInvestors financingFromInvestors = getFinancingFromInvestors(reviewFinancingInfo);
         if (financingFromInvestors == null || financingFromInvestors.getOpenId() == null) {

+ 7 - 0
src/main/java/com/sunxung/factoring/service/smb/IFinancingLoanInfoService.java

@@ -49,4 +49,11 @@ public interface IFinancingLoanInfoService extends IService<FinancingLoanInfo> {
      * @param id
      */
     void loanApplyAgain(Long id);
+
+    /**
+     * 重新发起再融资支用上报
+     *
+     * @param id
+     */
+    void refinancingReport(Long id);
 }

+ 49 - 4
src/main/java/com/sunxung/factoring/service/smb/impl/FinancingLoanInfoServiceImpl.java

@@ -1,6 +1,8 @@
 package com.sunxung.factoring.service.smb.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
@@ -13,6 +15,7 @@ import com.sunxung.factoring.component.util.ConstantConversionUtil;
 import com.sunxung.factoring.component.util.ConstantUtil;
 import com.sunxung.factoring.component.util.ThreadLocalUtil;
 import com.sunxung.factoring.entity.GridPage;
+import com.sunxung.factoring.entity.ResponseJson;
 import com.sunxung.factoring.entity.entprise.Enterprise;
 import com.sunxung.factoring.entity.financing.apply.CFinancingAccountsReceivableInfo;
 import com.sunxung.factoring.entity.financing.apply.CFinancingApplicantInfo;
@@ -20,6 +23,7 @@ import com.sunxung.factoring.entity.financing.apply.CFinancingBasicInfo;
 import com.sunxung.factoring.entity.financing.review.ReviewFinancingInfo;
 import com.sunxung.factoring.entity.financing.review.ReviewMasterContract;
 import com.sunxung.factoring.entity.financing.review.ReviewQuotaDisburse;
+import com.sunxung.factoring.entity.financing.sop.RefinancingUseCreditReport;
 import com.sunxung.factoring.entity.smb.FinancingFromInvestors;
 import com.sunxung.factoring.entity.smb.FinancingFromInvestorsHistory;
 import com.sunxung.factoring.entity.smb.FinancingFromInvestorsNotice;
@@ -49,8 +53,12 @@ import com.sunxung.factoring.service.sys.RoleService;
 import com.sunxung.factoring.service.sys.UserService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.client.RestTemplate;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -96,6 +104,12 @@ public class FinancingLoanInfoServiceImpl extends ServiceImpl<FinancingLoanInfoM
     private RoleService roleService;
     @Autowired
     private PermissionService permissionService;
+    @Autowired
+    private RestTemplate restTemplate;
+    @Value("${sop.getBusinessNoByTrade}")
+    private String getBusinessNoByTrade;
+    @Value("${sop.refinancingUseCreditReportUrl}")
+    private String refinancingUseCreditReportUrl;
 
     @Override
     public GridPage<FinancingLoanInfo> findBySearch(FinancingLoanInfoSearch search) {
@@ -198,7 +212,7 @@ public class FinancingLoanInfoServiceImpl extends ServiceImpl<FinancingLoanInfoM
                 if (loanInfo.getcFinancingBasicInfoId() != null) {
                     CFinancingBasicInfo financingBasicInfo = financingBasicInfoService.getById(loanInfo.getcFinancingBasicInfoId());
                     if (financingBasicInfo != null) {
-                        paymentApplyService.financingToSop(financingBasicInfo, ConstantUtil.JIANGSU_SUSHANG_BANK, loanInfo.getPayoutDate());
+                        paymentApplyService.financingToSop(financingBasicInfo, ConstantUtil.JIANGSU_SUSHANG_BANK, loanInfo);
                     }
                 }
             }
@@ -321,10 +335,40 @@ public class FinancingLoanInfoServiceImpl extends ServiceImpl<FinancingLoanInfoM
             String openId = financingFromInvestors.getOpenId();
             LoanApplyResp loanApplyResp = smbApiService.loanApply(loanApplyReq, loanCreditRiskMsg, openId);
             if (loanApplyResp != null) {
-                saveFinancingLoanInfo(financingBasicInfo, loanApplyResp, bizNo);
+                FinancingLoanInfo info = saveFinancingLoanInfo(financingBasicInfo, loanApplyResp, bizNo);
                 if ("02".equals(loanApplyResp.getStatus())) {
                     //成功,向sop推送融资信息
-                    paymentApplyService.financingToSop(financingBasicInfo, ConstantUtil.JIANGSU_SUSHANG_BANK, loanApplyResp.getPayoutDate());
+                    paymentApplyService.financingToSop(financingBasicInfo, ConstantUtil.JIANGSU_SUSHANG_BANK, info);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void refinancingReport(Long id) {
+        FinancingLoanInfo financingLoanInfo = getById(id);
+
+        CFinancingBasicInfo financingBasicInfo = financingBasicInfoService.getById(financingLoanInfo.getcFinancingBasicInfoId());
+        FinancingFromInvestorsNotice notice = reviewQuotaDisburseService.getFinancingFromInvestorsNotice(financingLoanInfo.getcFinancingBasicInfoId());
+        if (financingLoanInfo != null && financingLoanInfo.getDueBillNo() != null && notice != null) {
+            //查询sop对应的业务编号
+            String getBusinessNoByTradeUrl = getBusinessNoByTrade + "?businessNumber=" + financingBasicInfo.getBusinessNumber();
+            ResponseEntity<String> responseEntity = restTemplate.getForEntity(getBusinessNoByTradeUrl, String.class);
+            ResponseJson responseJson = JSONUtil.toBean(responseEntity.getBody(), ResponseJson.class);
+            if (responseEntity.getStatusCode().value() != HttpStatus.OK.value() || !responseJson.isSuccess()) {
+                throw new BusinessException(CodeUtil.FAIL, "查询sop对应的业务编号失败:" + responseJson.getMsg());
+            }
+            JSONObject jsonObject = (JSONObject) responseJson.getData();
+            String businessNo = jsonObject.getStr("businessNo");
+
+            if (financingLoanInfo != null && financingLoanInfo.getDueBillNo() != null) {
+                //构建再融资上报
+                RefinancingUseCreditReport useCreditReport = paymentApplyService.createUseCreditReport(businessNo, notice, financingLoanInfo);
+                //再融资上报
+                ResponseEntity<String> refinancingResponseEntity = restTemplate.postForEntity(refinancingUseCreditReportUrl, useCreditReport, String.class);
+                ResponseJson refinancingResponseJson = JSONUtil.toBean(refinancingResponseEntity.getBody(), ResponseJson.class);
+                if (refinancingResponseEntity.getStatusCode().value() != HttpStatus.OK.value() || !refinancingResponseJson.isSuccess()) {
+                    throw new BusinessException(CodeUtil.FAIL, "再融资支用上报失败:" + refinancingResponseJson.getMsg());
                 }
             }
         }
@@ -337,7 +381,7 @@ public class FinancingLoanInfoServiceImpl extends ServiceImpl<FinancingLoanInfoM
      * @param loanApplyResp
      * @param bizNo
      */
-    private void saveFinancingLoanInfo(CFinancingBasicInfo financingBasicInfo, LoanApplyResp loanApplyResp, String bizNo) {
+    private FinancingLoanInfo saveFinancingLoanInfo(CFinancingBasicInfo financingBasicInfo, LoanApplyResp loanApplyResp, String bizNo) {
         FinancingLoanInfo loanInfo = new FinancingLoanInfo();
         loanInfo.setcFinancingBasicInfoId(financingBasicInfo.getId());
         ReviewQuotaDisburse reviewQuotaDisburse = reviewQuotaDisburseService.getOne(new QueryWrapper<ReviewQuotaDisburse>()
@@ -388,5 +432,6 @@ public class FinancingLoanInfoServiceImpl extends ServiceImpl<FinancingLoanInfoM
         loanInfo.setRepayAcctType(financingFromInvestors.getRepaymentAccountType());
         loanInfo.setBizNo(bizNo);
         this.save(loanInfo);
+        return loanInfo;
     }
 }

+ 0 - 1
src/main/java/com/sunxung/factoring/service/smbApi/dto/CreditApplyRiskMsgDto.java

@@ -39,7 +39,6 @@ public class CreditApplyRiskMsgDto extends SMBSubParam {
     @NotBlank(message = "type308SdossId 不能为空")
     @Length(max = 50, message = "type308SdossId 最长50位")
     private String type308SdossId;
-    @NotEmpty(message = "type924SdossId 不能为空")
     private List<String> type924SdossId;
     @NotEmpty(message = "cyData 不能为空")
     private List<ContractInfo> cyData;

+ 1 - 1
src/main/java/com/sunxung/factoring/start/impl/SMBNoticeInit.java

@@ -49,7 +49,7 @@ public class SMBNoticeInit {
                             if (loanInfo.getcFinancingBasicInfoId() != null) {
                                 CFinancingBasicInfo financingBasicInfo = getFinancingBasicInfoService().getById(loanInfo.getcFinancingBasicInfoId());
                                 if (financingBasicInfo != null) {
-                                    getPaymentApplyService().financingToSop(financingBasicInfo, ConstantUtil.JIANGSU_SUSHANG_BANK, loanInfo.getPayoutDate());
+                                    getPaymentApplyService().financingToSop(financingBasicInfo, ConstantUtil.JIANGSU_SUSHANG_BANK, loanInfo);
                                 }
                             }
                         }

+ 10 - 0
src/main/java/com/sunxung/factoring/web/smb/FinancingLoanInfoController.java

@@ -63,4 +63,14 @@ public class FinancingLoanInfoController {
         return new ResponseJson<>("放款申请成功");
     }
 
+    /**
+     * 重新发起再融资支用上报
+     * @param
+     * @return
+     */
+    @GetMapping("/refinancingReport")
+    public ResponseJson refinancingReport(Long id){
+        financingLoanInfoService.refinancingReport(id);
+        return new ResponseJson<>("再融资支用上报成功");
+    }
 }

+ 12 - 0
src/main/java/com/sunxung/factoring/web/supplier/SupplierController.java

@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.List;
 
 /**
  * @author liutao
@@ -49,6 +50,17 @@ public class SupplierController {
 
     @Autowired
     private IEnterpriseService enterpriseService;
+
+
+    /**
+     * 根据关键字模糊查询企业   企查查886高级接口
+     */
+    @RequestMapping("supplierInfo/getBusinessByKeyWord")
+    public ResponseJson getBusinessByKeyWord(@RequestParam String keyword){
+        List<Enterprise> enterpriseList = enterpriseService.getBusinessByKeyWord(keyword);
+        return new ResponseJson(enterpriseList);
+    }
+
     /**
      * 开启流程
      * @param supplierInfo

+ 3 - 1
src/main/resources/data/update/smb0826.sql

@@ -79,7 +79,9 @@ VALUES ( (select t.id from t_permission t where t.ename = 'CapitalLoanMoney'), '
 INSERT INTO `t_permission`( `parentId`, `type`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
 VALUES ( (select t.id from t_permission t where t.ename = 'CapitalLoanMoney'), 'button', '重新发起 ', 'loanApplyAgain', 2, '资方融资管理', null, NULL, NULL, NULL, now(), now());
 INSERT INTO `t_permission`( `parentId`, `type`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
-VALUES ( (select t.id from t_permission t where t.ename = 'CapitalLoanMoney'), 'button', '数据全员可见 ', 'viewAllFinancingLoanInfo', 3, '资方融资管理', null, NULL, NULL, NULL, now(), now());
+VALUES ( (select t.id from t_permission t where t.ename = 'CapitalLoanMoney'), 'button', '数据全员可见 ', 'viewAllFinancingLoanInfo', 4, '资方融资管理', null, NULL, NULL, NULL, now(), now());
+INSERT INTO `t_permission`( `parentId`, `type`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
+VALUES ( (select t.id from t_permission t where t.ename = 'CapitalLoanMoney'), 'button', '重新发起再融资上报 ', 'reRefinancingReport', 3, '资方融资管理', null, NULL, NULL, NULL, now(), now());
 
 INSERT INTO `t_dictionary` ( `name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
 VALUES ('苏商银行主合同文件', 1349, 'sushangFirstContrat', NULL, 3, '2024-02-07 14:54:49', '2024-02-07 14:54:49');