ソースを参照

融资管理优化

liuj 7 ヶ月 前
コミット
5a1b8e8e92

+ 65 - 37
src/main/java/com/sunxung/factoring/dict/impl/FileModuleDict.java

@@ -51,49 +51,49 @@ public class FileModuleDict extends Dict {
         /**
          * 项目
          */
-        PROJECT_BIDDING_FILE("projectBiddingFile","项目招投标文件、合同模板等"),
-        PROJECT_BIDDING_FILE_HISTORY("projectBiddingFileHistory","项目招投标文件、合同模板等历史"),
-        PROJECT_DEPARTMENT_FILE("projectDepartmentFile","项目开工情况图片、项目部铭牌图片"),
-        PROJECT_DEPARTMENT_FILE_HISTORY("projectDepartmentFileHistory","项目开工情况图片、项目部铭牌图片历史"),
-        PROJECT_CORE_ENTERPRISE_FILE("projectCoreEnterpriseFile","项目核心企业历史合作资料"),
-        PROJECT_CORE_ENTERPRISE_FILE_HISTORY("projectCoreEnterpriseFileHistory","项目核心企业历史合作资料历史"),
+        PROJECT_BIDDING_FILE("projectBiddingFile", "项目招投标文件、合同模板等"),
+        PROJECT_BIDDING_FILE_HISTORY("projectBiddingFileHistory", "项目招投标文件、合同模板等历史"),
+        PROJECT_DEPARTMENT_FILE("projectDepartmentFile", "项目开工情况图片、项目部铭牌图片"),
+        PROJECT_DEPARTMENT_FILE_HISTORY("projectDepartmentFileHistory", "项目开工情况图片、项目部铭牌图片历史"),
+        PROJECT_CORE_ENTERPRISE_FILE("projectCoreEnterpriseFile", "项目核心企业历史合作资料"),
+        PROJECT_CORE_ENTERPRISE_FILE_HISTORY("projectCoreEnterpriseFileHistory", "项目核心企业历史合作资料历史"),
 
-        ENTERPRISE_CREDIT_AUTHORIZATION_LETTER_HISTORY("enterpriseCreditAuthorizationLetterHistory","企业征信授权书历史"),
+        ENTERPRISE_CREDIT_AUTHORIZATION_LETTER_HISTORY("enterpriseCreditAuthorizationLetterHistory", "企业征信授权书历史"),
 
-        RECONSIDER_ADJUST_FILE("reconsiderAdjustFile","授信决议,福已调整文件"),
+        RECONSIDER_ADJUST_FILE("reconsiderAdjustFile", "授信决议,福已调整文件"),
         /**
          * 招投标管理-招标文件
          */
-        TENDERS_HIS_FILE("tendersHisFile","招投标管理-招标文件历史"),
+        TENDERS_HIS_FILE("tendersHisFile", "招投标管理-招标文件历史"),
 
         /**
          * 招投标管理-投标文件
          */
-        BIDDING_HIS_FILE("biddingHisFile","招投标管理-投标文件历史"),
+        BIDDING_HIS_FILE("biddingHisFile", "招投标管理-投标文件历史"),
 
         /**
          * 招投标管理-保函文件
          */
-        BIDDING_GUARANTEE_LETTER_FILE("biddingGuaranteeLetterFile","招投标管理-保函文件"),
+        BIDDING_GUARANTEE_LETTER_FILE("biddingGuaranteeLetterFile", "招投标管理-保函文件"),
 
         /**
          * 招投标管理-支付凭证
          */
-        BIDDING_PAYMENT_VOUCHER_FILE("biddingPaymentVoucherFile","招投标管理-支付凭证"),
+        BIDDING_PAYMENT_VOUCHER_FILE("biddingPaymentVoucherFile", "招投标管理-支付凭证"),
 
         /**
          * 招投标管理-投标说明
          */
-        BIDING_DESCRIPTION_FILE("bidingDescriptionFile","招投标管理-投标说明"),
+        BIDING_DESCRIPTION_FILE("bidingDescriptionFile", "招投标管理-投标说明"),
 
         /**
          * 招投标管理-中标确认-中标通知书
          */
-        BIDDING_AWARD_NOTIFICATION_FILE("biddingAwardNotificationFiles","招投标管理-中标确认-中标通知书"),
+        BIDDING_AWARD_NOTIFICATION_FILE("biddingAwardNotificationFiles", "招投标管理-中标确认-中标通知书"),
         /**
          * 招投标管理-保证金退款确认-退款凭证
          */
-        BIDDING_REFUND_FILE("biddingRefundFile","招投标管理-保证金退款确认-退款凭证"),
+        BIDDING_REFUND_FILE("biddingRefundFile", "招投标管理-保证金退款确认-退款凭证"),
 
         SALES_CONTRACT_FILE("salesContractFile", "销售合同管理-销售合同文件"),
         /**
@@ -124,13 +124,12 @@ public class FileModuleDict extends Dict {
         /**
          * 销售合同变更创建-合同模板
          */
-        SALES_SUPPLEMENT_CONTRACT_TEMPLATE_FILE("salesSupplementContractTemplateFile","销售合同变更创建-合同模板"),
+        SALES_SUPPLEMENT_CONTRACT_TEMPLATE_FILE("salesSupplementContractTemplateFile", "销售合同变更创建-合同模板"),
         /**
-         *
          * 销售合同变更创建历史-合同模板
          */
-        SALES_SUPPLEMENT_CONTRACT_TEMPLATE_HIS_FILE("salesSupplementContractTemplateHisFile","销售合同变更创建历史-合同模板"),
-        SALES_CONTRACT_SUPPLEMENT_CONTRACT_FILE("salesContractSupplementContractFile","销售合同变更录入-合同文件"),
+        SALES_SUPPLEMENT_CONTRACT_TEMPLATE_HIS_FILE("salesSupplementContractTemplateHisFile", "销售合同变更创建历史-合同模板"),
+        SALES_CONTRACT_SUPPLEMENT_CONTRACT_FILE("salesContractSupplementContractFile", "销售合同变更录入-合同文件"),
         SALES_CONTRACT_SUPPLEMENT_HIS_FILE("salesContractSupplementHistoryFile", "销售合同变更录入-合同历史文件"),
         /**
          * 销售合同管理-保证金退还文件
@@ -255,7 +254,7 @@ public class FileModuleDict extends Dict {
         /**
          * 验收单管理-验收货物调价说明文件历史
          */
-        ACCEPTANCE_ADJUST_HIS_FILE("acceptanceAdjustHisFile","验收货物调价说明——历史文件"),
+        ACCEPTANCE_ADJUST_HIS_FILE("acceptanceAdjustHisFile", "验收货物调价说明——历史文件"),
 
         /**
          * 销售合同管理-销售合同审批,签署确认文件
@@ -589,51 +588,80 @@ public class FileModuleDict extends Dict {
          */
         ACCEPTANCE_SIGN_CONFIRM_REPORT_FILE("acceptanceSignConfirmationReportFile", "验收单签署确认-出证文件"),
 
-        /** 额度支用 保证信息证件 **/
-        REVIEW_GUARANTOR_INFORMATION_FILE("reviewGuarantorInformation","额度支用保证信息"),
+        /**
+         * 额度支用 保证信息证件
+         **/
+        REVIEW_GUARANTOR_INFORMATION_FILE("reviewGuarantorInformation", "额度支用保证信息"),
 
-        /** 额度支用附件 **/
+        /**
+         * 额度支用附件
+         **/
         REVIEW_QUOTA_DISBURSE("reviewQuotaDisburse", "额度支用"),
 
-        /** 合同附件存储位置 **/
+        /**
+         * 合同附件存储位置
+         **/
         CONTRACT_FILE_PREVIEW("contractFilePreview", "合同附件存储目录"),
 
-        /** 中登网附件 **/
-        RECEIVABLES_ZHONGDENG_FILE("receivablesZhongDengFile","中登网附件"),
+        /**
+         * 中登网附件
+         **/
+        RECEIVABLES_ZHONGDENG_FILE("receivablesZhongDengFile", "中登网附件"),
 
-        /** 电子签文件 **/
-        ELECTRONIC_FILE("electronicFile","电子签文件"),
+        /**
+         * 电子签文件
+         **/
+        ELECTRONIC_FILE("electronicFile", "电子签文件"),
 
         PROJECT_CREDIT_REPORT("projectCreditReport", "项目授信报告"),
 
         SUPPLIER_REPORT("supplierReport", "供应商授信报告"),
 
-        /** 征信查询授权书 **/
+        /**
+         * 征信查询授权书
+         **/
         CREDIT_AUTH("creditAuth", "征信查询授权书"),
 
-        /** 征信报告 **/
+        /**
+         * 征信报告
+         **/
         CREDIT_REPORT("creditReport", "征信报告"),
 
-        /** 身份证正面 **/
+        /**
+         * 身份证正面
+         **/
         CREDIT_CARD_PHOTO("creditCardPhoto", "身份证正面"),
 
-        /** 身份证反面 **/
+        /**
+         * 身份证反面
+         **/
         CREDIT_CARD_REV_PHOTO("creditCardRevPhoto", "身份证反面"),
 
         PROJECT_CORE_ENTERPRISE_CREDIT_REPORT("projectCoreEnterpriseCreditReport", "项目核心企业授信报告"),
 
-        /** 电子签身份证正面 **/
+        /**
+         * 电子签身份证正面
+         **/
         ENTERPRISE_CARD_PHOTO("enterpriseCardPhoto", "身份证正面"),
 
-        /** 电子签身份证反面 **/
+        /**
+         * 电子签身份证反面
+         **/
         ENTERPRISE_CARD_REV_PHOTO("enterpriseCardRevPhoto", "身份证反面"),
 
-        /** 豁免事项跟进文件 **/
+        /**
+         * 豁免事项跟进文件
+         **/
         EXEMPTION_MATTERS_FILE("exemption", "豁免事项跟进文件"),
 
-        CONTRACT_TEMPLATE_FILE("contractTemplateFile","合同模板文件" ),
+        CONTRACT_TEMPLATE_FILE("contractTemplateFile", "合同模板文件"),
 
-        OTHER("other","其他");
+        OTHER("other", "其他"),
+
+        /**
+         * 融资管理-支用压缩文件
+         */
+        FINANCING_DISBURSE_ZIP_FILE("financingDisburseZipFile", "融资管理-支用压缩文件");
 
         /**
          * 编码

+ 27 - 0
src/main/java/com/sunxung/factoring/entity/financing/sop/QuotaDisburseReport.java

@@ -1,5 +1,7 @@
 package com.sunxung.factoring.entity.financing.sop;
 
+import com.sunxung.factoring.entity.financing.review.ReviewBasicContract;
+
 import java.util.List;
 
 /**
@@ -84,6 +86,15 @@ public class QuotaDisburseReport extends BaseEcommerceApiSearch {
      */
     private Long sopAccountsReceivableId;
 
+    /**
+     * 应收账款转让信息
+     */
+    private ReviewTransferReceivableApi reviewTransferReceivableApi;
+
+    /**
+     * 三方协议信息
+     */
+    private List<ReviewBasicContract> reviewBasicContractList;
 
     public String getBusinessNo() {
         return businessNo;
@@ -196,4 +207,20 @@ public class QuotaDisburseReport extends BaseEcommerceApiSearch {
     public void setReportMethod(Integer reportMethod) {
         this.reportMethod = reportMethod;
     }
+
+    public ReviewTransferReceivableApi getReviewTransferReceivableApi() {
+        return reviewTransferReceivableApi;
+    }
+
+    public void setReviewTransferReceivableApi(ReviewTransferReceivableApi reviewTransferReceivableApi) {
+        this.reviewTransferReceivableApi = reviewTransferReceivableApi;
+    }
+
+    public List<ReviewBasicContract> getReviewBasicContractList() {
+        return reviewBasicContractList;
+    }
+
+    public void setReviewBasicContractList(List<ReviewBasicContract> reviewBasicContractList) {
+        this.reviewBasicContractList = reviewBasicContractList;
+    }
 }

+ 113 - 0
src/main/java/com/sunxung/factoring/entity/financing/sop/ReviewTransferReceivableApi.java

@@ -0,0 +1,113 @@
+package com.sunxung.factoring.entity.financing.sop;
+
+/**
+ * @Description : 应收账款转让对外实体类
+ * @Author : L.Jia
+ * @Date: 2022-10-26 09:10
+ */
+public class ReviewTransferReceivableApi {
+
+    /**
+     * 确认书编号
+     */
+    private String confirmationNo;
+
+    /**
+     * 通知书编号
+     */
+    private String noticeNo;
+
+    /**
+     * 转让方
+     */
+    private String transferor;
+
+    /**
+     * 受让方
+     */
+    private String transferee;
+
+    /**
+     * 是否确权
+     **/
+    private boolean confirm;
+
+    /**
+     * 确权方式:回执确认,0 表示否,1表示是
+     **/
+    private boolean receiptConfirm;
+
+    /**
+     * 确权方式:三方协议确认,0 表示否,1表示是
+     **/
+    private boolean tripartiteAgreementConfirm;
+
+    /**
+     * 确权方式:其他,0 表示否,1表示是
+     **/
+    private boolean otherConfirm;
+
+    public String getConfirmationNo() {
+        return confirmationNo;
+    }
+
+    public void setConfirmationNo(String confirmationNo) {
+        this.confirmationNo = confirmationNo;
+    }
+
+    public String getNoticeNo() {
+        return noticeNo;
+    }
+
+    public void setNoticeNo(String noticeNo) {
+        this.noticeNo = noticeNo;
+    }
+
+    public String getTransferor() {
+        return transferor;
+    }
+
+    public void setTransferor(String transferor) {
+        this.transferor = transferor;
+    }
+
+    public String getTransferee() {
+        return transferee;
+    }
+
+    public void setTransferee(String transferee) {
+        this.transferee = transferee;
+    }
+
+    public boolean isConfirm() {
+        return confirm;
+    }
+
+    public void setConfirm(boolean confirm) {
+        this.confirm = confirm;
+    }
+
+    public boolean isReceiptConfirm() {
+        return receiptConfirm;
+    }
+
+    public void setReceiptConfirm(boolean receiptConfirm) {
+        this.receiptConfirm = receiptConfirm;
+    }
+
+    public boolean isTripartiteAgreementConfirm() {
+        return tripartiteAgreementConfirm;
+    }
+
+    public void setTripartiteAgreementConfirm(boolean tripartiteAgreementConfirm) {
+        this.tripartiteAgreementConfirm = tripartiteAgreementConfirm;
+    }
+
+    public boolean isOtherConfirm() {
+        return otherConfirm;
+    }
+
+    public void setOtherConfirm(boolean otherConfirm) {
+        this.otherConfirm = otherConfirm;
+    }
+}

+ 152 - 20
src/main/java/com/sunxung/factoring/entity/financing/sop/RltRepay.java

@@ -1,5 +1,9 @@
 package com.sunxung.factoring.entity.financing.sop;
 
+import com.sunxung.factoring.entity.financing.review.*;
+
+import java.util.List;
+
 public class RltRepay {
 
     /**
@@ -14,10 +18,9 @@ public class RltRepay {
     private String arlpName;
 
     /**
-     * 责任人身份标识类型
-     * 0:户口簿,1:护照,2:港澳居民来往内地通行证 ,3:台湾同胞来往内地通行证
+     * 责任人身份标识类型(贸理通)
      */
-    private Integer arlpCertType;
+    private String arlpCertTypeTrade;
 
     /**
      * 身份标识号码
@@ -98,6 +101,30 @@ public class RltRepay {
      */
     private String guaranteeCardReverseFileSuffix;
 
+    /**
+     * 担保人配偶
+     */
+    private String spouseName;
+    /**
+     * 配偶证件类型
+     */
+    private String spouseCardType;
+
+    /**
+     * 配偶身份证号码
+     */
+    private String spouseIdCard;
+
+    /**
+     * 配偶联系方式
+     */
+    private String spouseContactNumber;
+
+    /**
+     * 法定代表人
+     */
+    private String legalRepresentative;
+
     /**
      * 邮箱
      */
@@ -125,6 +152,46 @@ public class RltRepay {
      */
     private Integer guaranteeClassify;
 
+    /**
+     * 相关还款责任人不动产房产
+     */
+    private List<ReviewRltRepayEstate> reviewRltRepayEstates;
+    /**
+     * 相关还款责任人:不动产(土地)
+     */
+    private List<ReviewRltRepayLand> reviewRltRepayLands;
+    /**
+     * 相关还款责任人:动产(车辆信息)
+     */
+    private List<ReviewRltRepayVehicle> reviewRltRepayVehicles;
+    /**
+     * 相关还款责任人:股权资产
+     */
+    private List<ReviewRltRepayEquityAssets> reviewRltRepayEquityAssets;
+    /**
+     * 相关还款责任人:其他资产
+     */
+    private List<ReviewRltRepayOtherAssets> reviewRltRepayOtherAssets;
+
+    public RltRepay(ReviewRltRepay reviewRltRepay) {
+        this.arlpName = reviewRltRepay.getArlpName();
+        this.arlpCertTypeTrade = reviewRltRepay.getArlpCertType();
+        this.arlpCertNum = reviewRltRepay.getArlpCertNum();
+        this.responsiblePhone = reviewRltRepay.getResponsiblePhone();
+        this.responsibleEmail = reviewRltRepay.getResponsibleEmail();
+        this.responsibleReportMethod = reviewRltRepay.getResponsibleReportMethod();
+        this.spouseName = reviewRltRepay.getSpouseName();
+        this.spouseCardType = reviewRltRepay.getSpouseCardType();
+        this.spouseIdCard = reviewRltRepay.getSpouseIdCard();
+        this.spouseContactNumber = reviewRltRepay.getSpouseContactNumber();
+        this.guarantorEmail = reviewRltRepay.getResponsibleEmail();
+        this.address = reviewRltRepay.getAddress();
+        this.actualAddress = reviewRltRepay.getActualAddress();
+        this.propertyList = reviewRltRepay.getPropertyList();
+        this.guaranteeClassify = reviewRltRepay.getGuaranteeClassify();
+        this.legalRepresentative = reviewRltRepay.getLegalRepresentative();
+    }
+
     public String getGuaranteeType() {
         return guaranteeType;
     }
@@ -253,12 +320,12 @@ public class RltRepay {
         this.arlpName = arlpName;
     }
 
-    public Integer getArlpCertType() {
-        return arlpCertType;
+    public String getArlpCertTypeTrade() {
+        return arlpCertTypeTrade;
     }
 
-    public void setArlpCertType(Integer arlpCertType) {
-        this.arlpCertType = arlpCertType;
+    public void setArlpCertTypeTrade(String arlpCertTypeTrade) {
+        this.arlpCertTypeTrade = arlpCertTypeTrade;
     }
 
     public String getArlpCertNum() {
@@ -309,18 +376,83 @@ public class RltRepay {
         this.arlpAmt = arlpAmt;
     }
 
-    @Override
-    public String toString() {
-        return "RltRepay{" +
-                "arlpIdType=" + arlpIdType +
-                ", arlpName='" + arlpName + '\'' +
-                ", arlpCertType=" + arlpCertType +
-                ", arlpCertNum='" + arlpCertNum + '\'' +
-                ", responsiblePhone='" + responsiblePhone + '\'' +
-                ", responsibleEmail='" + responsibleEmail + '\'' +
-                ", responsibleReportMethod=" + responsibleReportMethod +
-                ", arlpType=" + arlpType +
-                ", arlpAmt='" + arlpAmt + '\'' +
-                '}';
+    public String getSpouseName() {
+        return spouseName;
+    }
+
+    public void setSpouseName(String spouseName) {
+        this.spouseName = spouseName;
+    }
+
+    public String getSpouseCardType() {
+        return spouseCardType;
+    }
+
+    public void setSpouseCardType(String spouseCardType) {
+        this.spouseCardType = spouseCardType;
+    }
+
+    public String getSpouseIdCard() {
+        return spouseIdCard;
+    }
+
+    public void setSpouseIdCard(String spouseIdCard) {
+        this.spouseIdCard = spouseIdCard;
+    }
+
+    public String getSpouseContactNumber() {
+        return spouseContactNumber;
+    }
+
+    public void setSpouseContactNumber(String spouseContactNumber) {
+        this.spouseContactNumber = spouseContactNumber;
+    }
+
+    public String getLegalRepresentative() {
+        return legalRepresentative;
+    }
+
+    public void setLegalRepresentative(String legalRepresentative) {
+        this.legalRepresentative = legalRepresentative;
+    }
+
+    public List<ReviewRltRepayEstate> getReviewRltRepayEstates() {
+        return reviewRltRepayEstates;
+    }
+
+    public void setReviewRltRepayEstates(List<ReviewRltRepayEstate> reviewRltRepayEstates) {
+        this.reviewRltRepayEstates = reviewRltRepayEstates;
+    }
+
+    public List<ReviewRltRepayLand> getReviewRltRepayLands() {
+        return reviewRltRepayLands;
+    }
+
+    public void setReviewRltRepayLands(List<ReviewRltRepayLand> reviewRltRepayLands) {
+        this.reviewRltRepayLands = reviewRltRepayLands;
+    }
+
+    public List<ReviewRltRepayVehicle> getReviewRltRepayVehicles() {
+        return reviewRltRepayVehicles;
+    }
+
+    public void setReviewRltRepayVehicles(List<ReviewRltRepayVehicle> reviewRltRepayVehicles) {
+        this.reviewRltRepayVehicles = reviewRltRepayVehicles;
+    }
+
+    public List<ReviewRltRepayEquityAssets> getReviewRltRepayEquityAssets() {
+        return reviewRltRepayEquityAssets;
+    }
+
+    public void setReviewRltRepayEquityAssets(List<ReviewRltRepayEquityAssets> reviewRltRepayEquityAssets) {
+        this.reviewRltRepayEquityAssets = reviewRltRepayEquityAssets;
+    }
+
+    public List<ReviewRltRepayOtherAssets> getReviewRltRepayOtherAssets() {
+        return reviewRltRepayOtherAssets;
+    }
+
+    public void setReviewRltRepayOtherAssets(List<ReviewRltRepayOtherAssets> reviewRltRepayOtherAssets) {
+        this.reviewRltRepayOtherAssets = reviewRltRepayOtherAssets;
     }
 }

+ 10 - 0
src/main/java/com/sunxung/factoring/service/financing/apply/FinancingApplyService.java

@@ -5,6 +5,8 @@ import com.sunxung.factoring.entity.financing.apply.vo.FinancingApplyVo;
 import com.sunxung.factoring.entity.financing.review.ReviewQuotaDisburse;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * @Description : 融资申请service
  * @Author : L.Jia
@@ -35,4 +37,12 @@ public interface FinancingApplyService {
      * @return
      */
     FinancingApplyVo getView(Long id);
+
+    /**
+     * 打包下载支用文件
+     *
+     * @param id
+     * @param response
+     */
+    void downloadDisburseFileZip(Long id, HttpServletResponse response);
 }

+ 91 - 5
src/main/java/com/sunxung/factoring/service/financing/apply/impl/FinancingApplyServiceImpl.java

@@ -6,6 +6,7 @@ import com.sunxung.factoring.component.enums.FinancingStatusEnum;
 import com.sunxung.factoring.component.exception.BusinessException;
 import com.sunxung.factoring.component.exception.ValidatorException;
 import com.sunxung.factoring.component.util.*;
+import com.sunxung.factoring.dict.impl.FileModuleDict;
 import com.sunxung.factoring.entity.creditresolution.CreditResolution;
 import com.sunxung.factoring.entity.entprise.Enterprise;
 import com.sunxung.factoring.entity.financing.apply.*;
@@ -41,11 +42,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -250,6 +249,92 @@ public class FinancingApplyServiceImpl implements FinancingApplyService {
         return financingApplyVo;
     }
 
+    @Override
+    public void downloadDisburseFileZip(Long id, HttpServletResponse response) {
+        ReviewQuotaDisburse reviewQuotaDisburse = reviewQuotaDisburseService.getOne(new QueryWrapper<ReviewQuotaDisburse>()
+                .eq("c_financing_basic_info_id", id)
+                .eq("approval_conclusion", ConstantConversionUtil.APPROVAL_RESULT_PASS));
+
+        List<FileStorage> fileStorageList = new ArrayList<>();
+        if (reviewQuotaDisburse != null) {
+            //查询相关还款责任人
+            List<ReviewRltRepay> rltRepayList = reviewRltRepayService.list(new QueryWrapper<ReviewRltRepay>()
+                    .eq("review_quota_disburse_id", reviewQuotaDisburse.getId()));
+            if (CollectionUtil.isNotEmpty(rltRepayList)) {
+                rltRepayList.stream().forEach(reviewRltRepay -> {
+                    //填充证件照
+                    if (reviewRltRepay.getGuaranteeCardFrontFileStorageId() != null) {
+                        FileStorage fileStorage = fileStorageService.get(reviewRltRepay.getGuaranteeCardFrontFileStorageId());
+                        fileStorageList.add(fileStorage);
+                    }
+                    if (reviewRltRepay.getGuaranteeCardReverseFileStorageId() != null) {
+                        FileStorage fileStorage = fileStorageService.get(reviewRltRepay.getGuaranteeCardReverseFileStorageId());
+                        fileStorageList.add(fileStorage);
+                    }
+                    if (reviewRltRepay.getSpouseCardFrontFileStorageId() != null) {
+                        FileStorage fileStorage = fileStorageService.get(reviewRltRepay.getSpouseCardFrontFileStorageId());
+                        fileStorageList.add(fileStorage);
+                    }
+                    if (reviewRltRepay.getSpouseCardReverseFileStorageId() != null) {
+                        FileStorage fileStorage = fileStorageService.get(reviewRltRepay.getSpouseCardReverseFileStorageId());
+                        fileStorageList.add(fileStorage);
+                    }
+                    //填充附件
+                    List<ReviewGuaranteeFile> reviewGuaranteeFiles = reviewGuaranteeFileService.lambdaQuery().eq(ReviewGuaranteeFile::getGuaranteeId, reviewRltRepay.getId())
+                            .eq(ReviewGuaranteeFile::getGuaranteeFileType, ConstantConversionUtil.GUARANTEEINFO_FILE).list();
+                    if (CollectionUtil.isNotEmpty(reviewGuaranteeFiles)) {
+                        List<FileStorage> fileStorages = reviewGuaranteeFiles.stream().map(reviewGuaranteeSecondFile -> fileStorageService.get(reviewGuaranteeSecondFile.getFileId())).collect(Collectors.toList());
+                        fileStorageList.addAll(fileStorages);
+                    }
+                });
+            }
+
+            //查询抵质押信息
+            List<ReviewMortgageBasicInfo> list = reviewMortgageBasicInfoService.findByQuotaDisburseId(reviewQuotaDisburse.getId());
+            if (null != list && list.size() > 0) {
+                list.forEach(reviewMortgageBasicInfo -> {
+                    //附件
+                    if (CollectionUtil.isNotEmpty(reviewMortgageBasicInfo.getFileStorageList())) {
+                        fileStorageList.addAll(reviewMortgageBasicInfo.getFileStorageList());
+                    }
+                    //证件文件
+                    if (reviewMortgageBasicInfo.getCardFrontFileStorage() != null) {
+                        fileStorageList.add(reviewMortgageBasicInfo.getCardFrontFileStorage());
+                    }
+                    if (reviewMortgageBasicInfo.getCardReverseFileStorage() != null) {
+                        fileStorageList.add(reviewMortgageBasicInfo.getCardReverseFileStorage());
+                    }
+                    //抵质押信息附件
+                    if (CollectionUtil.isNotEmpty(reviewMortgageBasicInfo.getMortgageCollateralInfoList())) {
+                        List<ReviewMortgageCollateralInfo> mortgageCollateralInfoList = reviewMortgageBasicInfo.getMortgageCollateralInfoList();
+                        for (ReviewMortgageCollateralInfo reviewMortgageCollateralInfo : mortgageCollateralInfoList) {
+                            if (CollectionUtil.isNotEmpty(reviewMortgageCollateralInfo.getFileStorageList())) {
+                                fileStorageList.addAll(reviewMortgageCollateralInfo.getFileStorageList());
+                            }
+                        }
+                    }
+                    if (CollectionUtil.isNotEmpty(reviewMortgageBasicInfo.getMortgagePledgeInfoList())) {
+                        List<ReviewMortgagePledgeInfo> mortgagePledgeInfoList = reviewMortgageBasicInfo.getMortgagePledgeInfoList();
+                        for (ReviewMortgagePledgeInfo reviewMortgagePledgeInfo : mortgagePledgeInfoList) {
+                            if (CollectionUtil.isNotEmpty(reviewMortgagePledgeInfo.getFileStorageList())) {
+                                fileStorageList.addAll(reviewMortgagePledgeInfo.getFileStorageList());
+                            }
+                        }
+                    }
+                });
+            }
+
+            if (CollectionUtil.isNotEmpty(fileStorageList)) {
+                ReviewMasterContract reviewMasterContract = reviewMasterContractService.getOne(new QueryWrapper<ReviewMasterContract>()
+                        .eq("review_quota_disburse_id", reviewQuotaDisburse.getId()));
+                String fileName = reviewQuotaDisburse.getBusinessNumber() + "-" + reviewMasterContract.getContractNo()
+                        + "-" + reviewQuotaDisburse.getQuotaDisburseBatch() + "-" + "支用文件";
+                //文件打包下载
+                fileStorageService.downloadZipFile(fileStorageList, fileName, FileModuleDict.ChildEnum.FINANCIAL_ZIP_FILE, response);
+            }
+        }
+    }
+
     /**
      * 新增融资申请流程办理人
      *
@@ -357,7 +442,8 @@ public class FinancingApplyServiceImpl implements FinancingApplyService {
         return reviewQuotaDisburse;
     }
 
-    private void initQuotaDisburse(CFinancingBasicInfo financingBasicInfo, BigDecimal netAccountsReceivableAmountTotal, ReviewQuotaDisburse reviewQuotaDisburse) {
+    private void initQuotaDisburse(CFinancingBasicInfo financingBasicInfo, BigDecimal
+            netAccountsReceivableAmountTotal, ReviewQuotaDisburse reviewQuotaDisburse) {
         reviewQuotaDisburse.setFinancingBasicInfoId(financingBasicInfo.getId());
         //计算业务占用的授信金额
         BigDecimal businessOccupyAmount = getBusinessOccupyAmount(financingBasicInfo);

+ 169 - 18
src/main/java/com/sunxung/factoring/service/financing/payment/impl/PaymentApplyServiceImpl.java

@@ -98,6 +98,22 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
     @Autowired
     private ReviewRltRepayService reviewRltRepayService;
     @Autowired
+    private IReviewRltRepayLandService reviewRltRepayLandService;
+    @Autowired
+    private IReviewRltRepayEstateService reviewRltRepayEstateService;
+    @Autowired
+    private IReviewRltRepayVehicleService reviewRltRepayVehicleService;
+    @Autowired
+    private IReviewRltRepayEquityAssetsService reviewRltRepayEquityAssetsService;
+    @Autowired
+    private IReviewRltRepayOtherAssetsService reviewRltRepayOtherAssetsService;
+    @Autowired
+    private ReviewTransferReceivableService reviewTransferReceivableService;
+    @Autowired
+    private ReviewBasicContractService reviewBasicContractService;
+    @Autowired
+    private ReviewBasicContractChangeContentService reviewBasicContractChangeContentService;
+    @Autowired
     private IContractInfoService contractInfoService;
     @Autowired
     private IContractMasterContractService contractMasterContractService;
@@ -487,24 +503,20 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
         //保证信息(此字段其实已作废默认给1就行)
         quotaDisburseReport.setGuaranteeInformation(1);
         //相关还款责任人
-        Boolean respRepay = reviewQuotaDisburse.getRespRepay();
-        if (respRepay != null && respRepay) {
-            //有相关还款责任人
-            quotaDisburseReport.setRespRepay(1);
-            List<ReviewRltRepay> rltRepayList = reviewRltRepayService.list(new QueryWrapper<ReviewRltRepay>()
-                    .eq("review_quota_disburse_id", reviewQuotaDisburse.getId()));
-            if (CollectionUtil.isNotEmpty(rltRepayList)) {
-                List<RltRepay> rltRepayApiList = new ArrayList<>();
-                rltRepayList.stream().forEach(reviewRltRepay -> {
-                    RltRepay rltRepay = new RltRepay();
-                    BeanUtils.copyProperties(reviewRltRepay, rltRepay);
-                    rltRepayApiList.add(rltRepay);
-                });
-                quotaDisburseReport.setRltRepayList(rltRepayApiList);
-            }
-        } else {
-            //无相关还款责任人
-            quotaDisburseReport.setRespRepay(0);
+        List<ReviewRltRepay> rltRepayList = reviewRltRepayService.list(new QueryWrapper<ReviewRltRepay>()
+                .eq("review_quota_disburse_id", reviewQuotaDisburse.getId()));
+        autoRltRepay(rltRepayList, quotaDisburseReport);
+        //应收账款转让
+        ReviewTransferReceivable transferReceivable = reviewTransferReceivableService
+                .getOne(new QueryWrapper<ReviewTransferReceivable>().eq("review_quota_disburse_id", reviewQuotaDisburse.getId()));
+        if (transferReceivable != null) {
+            autoTransferReceivable(transferReceivable, quotaDisburseReport);
+        }
+        //三方协议
+        List<ReviewBasicContract> reviewBasicContractList = reviewBasicContractService.list(new QueryWrapper<ReviewBasicContract>()
+                .eq("review_quota_disburse_id", reviewQuotaDisburse.getId()));
+        if (CollectionUtil.isNotEmpty(reviewBasicContractList)) {
+            autoBasicContract(reviewBasicContractList, quotaDisburseReport);
         }
         //sop支用上报
         ResponseEntity<String> postResponseEntity = restTemplate.postForEntity(quotaDisburseReportUrl, quotaDisburseReport, String.class);
@@ -514,6 +526,145 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
         }
     }
 
+    /**
+     * 填充相关还款责任人
+     *
+     * @param rltRepayList
+     * @param quotaDisburseReport
+     */
+    private void autoRltRepay(List<ReviewRltRepay> rltRepayList, QuotaDisburseReport quotaDisburseReport) {
+        if (CollectionUtil.isNotEmpty(rltRepayList)) {
+            //有相关还款责任人
+            quotaDisburseReport.setRespRepay(1);
+            List<RltRepay> rltRepayApiList = new ArrayList<>();
+            rltRepayList.stream().forEach(reviewRltRepay -> {
+                RltRepay rltRepay = new RltRepay(reviewRltRepay);
+                //身份类别
+                if ("idType_1".equals(reviewRltRepay.getArlpIdType())) {
+                    rltRepay.setArlpIdType(0);
+                } else if ("idType_2".equals(reviewRltRepay.getArlpIdType())) {
+                    rltRepay.setArlpIdType(1);
+                }
+                //还款责任人类型
+                if (reviewRltRepay.getArlpType() != null) {
+                    Integer arlpType = judgmentArlpType(reviewRltRepay.getArlpType());
+                    rltRepay.setArlpType(arlpType);
+                }
+                //填充房产信息
+                List<ReviewRltRepayEstate> reviewRltRepayEstates = reviewRltRepayEstateService.lambdaQuery().eq(ReviewRltRepayEstate::getReviewRltRepayId, reviewRltRepay.getId()).list();
+                if (CollectionUtil.isNotEmpty(reviewRltRepayEstates)) {
+                    rltRepay.setReviewRltRepayEstates(reviewRltRepayEstates);
+                }
+                //填充土地信息
+                List<ReviewRltRepayLand> reviewRltRepayLands = reviewRltRepayLandService.lambdaQuery().eq(ReviewRltRepayLand::getReviewRltRepayId, reviewRltRepay.getId()).list();
+                if (CollectionUtil.isNotEmpty(reviewRltRepayLands)) {
+                    rltRepay.setReviewRltRepayLands(reviewRltRepayLands);
+                }
+                //填充车辆信息
+                List<ReviewRltRepayVehicle> reviewRltRepayVehicles = reviewRltRepayVehicleService.lambdaQuery().eq(ReviewRltRepayVehicle::getReviewRltRepayId, reviewRltRepay.getId()).list();
+                if (CollectionUtil.isNotEmpty(reviewRltRepayVehicles)) {
+                    rltRepay.setReviewRltRepayVehicles(reviewRltRepayVehicles);
+                }
+                //填充股权资产信息
+                List<ReviewRltRepayEquityAssets> reviewRltRepayEquityAssets = reviewRltRepayEquityAssetsService.lambdaQuery().eq(ReviewRltRepayEquityAssets::getReviewRltRepayId, reviewRltRepay.getId()).list();
+                if (CollectionUtil.isNotEmpty(reviewRltRepayEquityAssets)) {
+                    rltRepay.setReviewRltRepayEquityAssets(reviewRltRepayEquityAssets);
+                }
+                //填充其他资产信息
+                List<ReviewRltRepayOtherAssets> reviewRltRepayOtherAssets = reviewRltRepayOtherAssetsService.lambdaQuery().eq(ReviewRltRepayOtherAssets::getReviewRltRepayId, reviewRltRepay.getId()).list();
+                if (CollectionUtil.isNotEmpty(reviewRltRepayOtherAssets)) {
+                    rltRepay.setReviewRltRepayOtherAssets(reviewRltRepayOtherAssets);
+                }
+                reviewRltRepay.setReviewRltRepayOtherAssets(reviewRltRepayOtherAssets);
+                rltRepayApiList.add(rltRepay);
+            });
+            quotaDisburseReport.setRltRepayList(rltRepayApiList);
+        } else {
+            //无相关还款责任人
+            quotaDisburseReport.setRespRepay(0);
+        }
+    }
+
+    /**
+     * 判断还款责任人类型
+     *
+     * @param arlpType
+     */
+    private Integer judgmentArlpType(String arlpType) {
+        Integer i;
+        switch (arlpType) {
+            case "arlpType_GTJKR":
+                i = 0;
+                break;
+            case "arlpType_BZR":
+                i = 1;
+                break;
+            case "arlpType_PJCDR":
+                i = 2;
+                break;
+            case "arlpType_YSZKZWR":
+                i = 3;
+                break;
+            case "arlpType_GYLZHXQY":
+                i = 4;
+                break;
+            case "arlpType_QT":
+                i = 5;
+                break;
+            default:
+                i = null;
+        }
+        return i;
+    }
+
+    /**
+     * 填充应收账款转让信息
+     *
+     * @param transferReceivable
+     * @param quotaDisburseReport
+     */
+    private void autoTransferReceivable(ReviewTransferReceivable transferReceivable, QuotaDisburseReport quotaDisburseReport) {
+        ReviewTransferReceivableApi reviewTransferReceivableApi = new ReviewTransferReceivableApi();
+        BeanUtils.copyProperties(transferReceivable, reviewTransferReceivableApi);
+
+        Boolean receiptConfirm = false;
+        Boolean tripartiteAgreementConfirm = false;
+        Boolean otherConfirm = false;
+        if (StringUtils.isNotBlank(transferReceivable.getConfirmMethod())) {
+            List<String> confirmMethodList = StringUtil.separatorCharacter(transferReceivable.getConfirmMethod());
+            for (String confirmMethod : confirmMethodList) {
+                if ("receiptConfirm".equals(confirmMethod)) {
+                    receiptConfirm = true;
+                }
+                if ("tripartiteAgreementConfirm".equals(confirmMethod)) {
+                    tripartiteAgreementConfirm = true;
+                }
+                if ("otherConfirm".equals(confirmMethod)) {
+                    otherConfirm = true;
+                }
+            }
+        }
+        reviewTransferReceivableApi.setReceiptConfirm(receiptConfirm);
+        reviewTransferReceivableApi.setTripartiteAgreementConfirm(tripartiteAgreementConfirm);
+        reviewTransferReceivableApi.setOtherConfirm(otherConfirm);
+        quotaDisburseReport.setReviewTransferReceivableApi(reviewTransferReceivableApi);
+    }
+
+    /**
+     * 填充三方协议信息
+     *
+     * @param reviewBasicContractList
+     * @param quotaDisburseReport
+     */
+    private void autoBasicContract(List<ReviewBasicContract> reviewBasicContractList, QuotaDisburseReport quotaDisburseReport) {
+        for (ReviewBasicContract reviewBasicContract : reviewBasicContractList) {
+            List<ReviewBasicContractChangeContent> changeContentList = reviewBasicContractChangeContentService.list(new QueryWrapper<ReviewBasicContractChangeContent>()
+                    .eq("review_basic_contract_id", reviewBasicContract.getId()));
+            reviewBasicContract.setContractContentList(changeContentList);
+        }
+        quotaDisburseReport.setReviewBasicContractList(reviewBasicContractList);
+    }
+
     /**
      * 填充主合同信息
      *

+ 10 - 0
src/main/java/com/sunxung/factoring/service/financing/review/impl/ReviewMortgageBasicInfoServiceImpl.java

@@ -99,6 +99,16 @@ public class ReviewMortgageBasicInfoServiceImpl extends ServiceImpl<ReviewMortga
                         List<FileStorage> fileStorages = reviewGuaranteeFiles.stream().map(reviewGuaranteeSecondFile -> fileStorageService.get(reviewGuaranteeSecondFile.getFileId())).collect(Collectors.toList());
                         mortgageBasicInfo.setFileStorageList(fileStorages);
                     }
+                    //填充证件照正反面
+                    if (mortgageBasicInfo.getCardFrontFileStorageId() != null) {
+                        FileStorage cardFrontFileStorage = fileStorageService.get(mortgageBasicInfo.getCardFrontFileStorageId());
+                        mortgageBasicInfo.setCardFrontFileStorage(cardFrontFileStorage);
+                    }
+                    if (mortgageBasicInfo.getCardReverseFileStorageId() != null) {
+                        FileStorage cardReverseFileStorage = fileStorageService.get(mortgageBasicInfo.getCardReverseFileStorageId());
+                        mortgageBasicInfo.setCardFrontFileStorage(cardReverseFileStorage);
+                    }
+
                     mortgageBasicInfoList.add(mortgageBasicInfo);
                 }
             }

+ 14 - 0
src/main/java/com/sunxung/factoring/web/financing/FinancingApplyController.java

@@ -7,6 +7,8 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * @Description : 融资申请Controller
  * @Author : L.Jia
@@ -28,4 +30,16 @@ public class FinancingApplyController {
     public ResponseJson apply(Long id) {
         return new ResponseJson(financingApplyService.apply(id));
     }
+
+    /**
+     * 支用文件下载
+     *
+     * @param id
+     * @param response
+     */
+    @GetMapping("/downloadDisburseFileZip")
+    public ResponseJson downloadDisburseFileZip(Long id, HttpServletResponse response) {
+        financingApplyService.downloadDisburseFileZip(id, response);
+        return new ResponseJson("下载成功!");
+    }
 }