Procházet zdrojové kódy

现金流新增重推还款申请功能

liuj před 3 týdny
rodič
revize
30f15891cb

+ 20 - 0
src/main/java/com/sunxung/factoring/entity/financing/sop/EnterpriseVerifyCreditSearch.java

@@ -0,0 +1,20 @@
+package com.sunxung.factoring.entity.financing.sop;
+
+/**
+ * @Description TODO
+ * @Author Yafan Wang
+ * @Date 2022/10/31 10:17
+ */
+public class EnterpriseVerifyCreditSearch extends BaseEcommerceApiSearch {
+
+    // 统一社会信用代码
+    private String enterpriseIdentity;
+
+    public String getEnterpriseIdentity() {
+        return enterpriseIdentity;
+    }
+
+    public void setEnterpriseIdentity(String enterpriseIdentity) {
+        this.enterpriseIdentity = enterpriseIdentity;
+    }
+}

+ 7 - 0
src/main/java/com/sunxung/factoring/service/cashflowmanage/CashFlowManageBasicInfoService.java

@@ -88,4 +88,11 @@ public interface CashFlowManageBasicInfoService extends IService<CashFlowManageB
      * @param id
      */
     void delete(Long id);
+
+    /**
+     * 重新发起还款申请
+     *
+     * @param id
+     */
+    void repayApplyAgain(Long id);
 }

+ 11 - 0
src/main/java/com/sunxung/factoring/service/cashflowmanage/impl/CashFlowManageBasicInfoServiceImpl.java

@@ -765,6 +765,17 @@ public class CashFlowManageBasicInfoServiceImpl extends ServiceImpl<CashFlowMana
         }
     }
 
+    @Override
+    public void repayApplyAgain(Long id) {
+        CashFlowManageBasicInfo cashFlowManageBasicInfo = this.getById(id);
+        if (cashFlowManageBasicInfo != null) {
+            LedgerFundGoodsAssign ledgerFundGoodsAssign = ledgerFundGoodsAssignService.getById(cashFlowManageBasicInfo.getLedgerFundGoodsAssignId());
+            if (ledgerFundGoodsAssign != null) {
+                ledgerManagementService.repayApplyBySMB(ledgerFundGoodsAssign);
+            }
+        }
+    }
+
     /**
      * 向sop更新账户信息
      *

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

@@ -3,6 +3,7 @@ package com.sunxung.factoring.service.financing.review.impl;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -24,6 +25,7 @@ import com.sunxung.factoring.entity.financing.apply.CAcceptanceGoodsInfo;
 import com.sunxung.factoring.entity.financing.apply.CFinancingBasicInfo;
 import com.sunxung.factoring.entity.financing.apply.CFinancingGoodsInfo;
 import com.sunxung.factoring.entity.financing.review.*;
+import com.sunxung.factoring.entity.financing.sop.EnterpriseVerifyCreditSearch;
 import com.sunxung.factoring.entity.project.ProjectInformation;
 import com.sunxung.factoring.entity.smb.FinancingFromInvestors;
 import com.sunxung.factoring.entity.smb.FinancingFromInvestorsHistory;
@@ -58,6 +60,8 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 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;
@@ -194,6 +198,8 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
     private SMBApiService smbApiService;
     @Autowired
     private FileService fileService;
+    @Value("${config.verifyCreditEntBusiness.url}")
+    private String verifyCreditEntBusinessUrl;
 
     @Override
     public List<ReviewIncomeExpenditurePlan> generateIncomeExpenditurePlan(ReviewFinancingInfo reviewFinancingInfo) {
@@ -331,6 +337,18 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
                 checkFinancingAmount(quotaDisburse);
                 //添加三方企业工商信息
                 addBusinessInfo(quotaDisburse);
+                //调用sop校验征信上报信息
+                Enterprise enterprise = enterpriseService.getById(financingBasicInfo.getMainEnterpriseId());
+                if (enterprise != null) {
+                    EnterpriseVerifyCreditSearch verifyCreditSearch = new EnterpriseVerifyCreditSearch();
+                    verifyCreditSearch.setEnterpriseIdentity(enterprise.getSocialCreditCode());
+                    verifyCreditSearch.setCustomerId(ConstantUtil.QUOTA_DISBURSE_REPORT_CUSTOMER_ID);
+                    ResponseEntity<String> responseEntity = restTemplate.postForEntity(verifyCreditEntBusinessUrl, verifyCreditSearch, String.class);
+                    ResponseJson responseJson = JSONUtil.toBean(responseEntity.getBody(), ResponseJson.class);
+                    if (responseEntity.getStatusCode().value() != HttpStatus.OK.value() || !responseJson.isSuccess()) {
+                        throw new BusinessException(CodeUtil.FAIL, "二代征信信息完整性校验失败:" + responseJson.getMsg());
+                    }
+                }
                 Map<String, Object> procVariables = new HashMap<>();
                 Long assigneeId = assigneeService.getIdByBusiness(quotaDisburse.getFinancingBasicInfoId(), ConstantUtil.FINANCING_APPLY,
                         ConstantUtil.ASSIGNEE_RISK_MANAGER);

+ 13 - 0
src/main/java/com/sunxung/factoring/web/cashflowmanage/CashFlowManageController.java

@@ -369,4 +369,17 @@ public class CashFlowManageController {
         CashFlowDealOutInfoVo dealOut = cashFlowManageBasicInfoService.getDealOut(id);
         return dealOut;
     }
+
+    /**
+     * 重新发起还款申请
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/repayApplyAgain/{id}")
+    @ResponseBody
+    public Object repayApplyAgain(@PathVariable("id") Long id) {
+        cashFlowManageBasicInfoService.repayApplyAgain(id);
+        return new ResponseJson("重新发起还款申请成功");
+    }
 }

+ 3 - 1
src/main/resources/config.properties

@@ -53,4 +53,6 @@ config.startOaPaymentProcessUrl.url=${sop.url}/api/startOaOtherPaymentProcess
 ## \u82CF\u5546\u8FD8\u6B3E\u8BA1\u5212\u66F4\u65B0
 config.smbRefinancingPlanUpdate.url=${sop.url}/api/smb/refinancingPlanUpdate
 ## \u82CF\u5546\u4E3B\u52A8\u8FD8\u6B3E\u3001\u57AB\u4ED8\u524D\u8BA1\u5212\u66F4\u65B0
-config.smbBeforeRepayPlanUpdate.url=${sop.url}/api/smb/smbBeforeRepayPlanUpdate
+config.smbBeforeRepayPlanUpdate.url=${sop.url}/api/smb/smbBeforeRepayPlanUpdate
+## \u4E8C\u4EE3\u5F81\u4FE1\u4FE1\u606F\u662F\u5426\u5B8C\u6574
+config.verifyCreditEntBusiness.url=${sop.url}/api/enterprise/verifyCreditEntBusiness