Quellcode durchsuchen

Merge remote-tracking branch 'origin/dev1.0' into dev1.0

zhangc vor 5 Monaten
Ursprung
Commit
45438b9574
18 geänderte Dateien mit 285 neuen und 247 gelöschten Zeilen
  1. 1 1
      src/main/java/com/sunxung/factoring/component/util/ElectronicSignatureUtil.java
  2. 1 15
      src/main/java/com/sunxung/factoring/entity/ledger/LedgerFundGoodsAssign.java
  3. 2 0
      src/main/java/com/sunxung/factoring/service/acceptancesheet/impl/AcceptanceBasicInfoServiceImpl.java
  4. 6 0
      src/main/java/com/sunxung/factoring/service/financing/payment/impl/ExemptionApprovalBusinessServiceImpl.java
  5. 6 0
      src/main/java/com/sunxung/factoring/service/financing/payment/impl/ExemptionApprovalRiskServiceImpl.java
  6. 6 2
      src/main/java/com/sunxung/factoring/service/financing/payment/impl/PaymentApplyServiceImpl.java
  7. 103 112
      src/main/java/com/sunxung/factoring/service/ledger/impl/LedgerManagementServiceImpl.java
  8. 18 0
      src/main/java/com/sunxung/factoring/service/project/impl/BusinessProcessingTaskServiceImpl.java
  9. 4 4
      src/main/java/com/sunxung/factoring/service/project/impl/ProjectAuditServiceImpl.java
  10. 15 21
      src/main/java/com/sunxung/factoring/service/project/impl/ProjectCoreEnterpriseAuditServiceImpl.java
  11. 17 13
      src/main/java/com/sunxung/factoring/service/supplier/impl/SupplierApprovalSecondServiceImpl.java
  12. 28 26
      src/main/java/com/sunxung/factoring/service/tradingPlatform/Impl/PlatformServiceImpl.java
  13. 2 2
      src/main/resources/application-dev.yml
  14. 50 50
      src/main/resources/application-prod.yml
  15. 1 1
      src/main/resources/application.yml
  16. 21 0
      src/main/resources/data/update/v1.0/20231117liutao.sql
  17. 3 0
      src/main/resources/ftl/purchcontract/export/pruchContract.docx
  18. 1 0
      src/main/resources/mapper/project/BusinessProcessingLogMapper.xml

+ 1 - 1
src/main/java/com/sunxung/factoring/component/util/ElectronicSignatureUtil.java

@@ -20,7 +20,7 @@ public class ElectronicSignatureUtil {
 
     private static HttpClientUtil INSTANCE = HttpClientUtil.getInstance();
 
-    private static final String SOURCE = "factoringTrade";
+    private static final String SOURCE = "factoringTradeOnline";
 
     private static final String PREFIX = "trade";
 

+ 1 - 15
src/main/java/com/sunxung/factoring/entity/ledger/LedgerFundGoodsAssign.java

@@ -133,7 +133,7 @@ public class LedgerFundGoodsAssign extends BaseEntity {
     private BigDecimal financingPrincipal;
 
     /**
-     * 是否分配融资利息
+     * 是否分配融资利息和管理费
      */
     @TableField("has_assign_interest")
     private Boolean hasAssignInterest;
@@ -144,12 +144,6 @@ public class LedgerFundGoodsAssign extends BaseEntity {
     @TableField("financing_interest")
     private BigDecimal financingInterest;
 
-    /**
-     * 是否分配管理费
-     */
-    @TableField("has_assign_management_fee")
-    private Boolean hasAssignManagementFee;
-
     /**
      * 融资管理费(2023.3.21新增)
      */
@@ -619,14 +613,6 @@ public class LedgerFundGoodsAssign extends BaseEntity {
         this.hasAssignInterest = hasAssignInterest;
     }
 
-    public Boolean getHasAssignManagementFee() {
-        return hasAssignManagementFee;
-    }
-
-    public void setHasAssignManagementFee(Boolean hasAssignManagementFee) {
-        this.hasAssignManagementFee = hasAssignManagementFee;
-    }
-
     public Boolean getHasAssignOverdueInterest() {
         return hasAssignOverdueInterest;
     }

+ 2 - 0
src/main/java/com/sunxung/factoring/service/acceptancesheet/impl/AcceptanceBasicInfoServiceImpl.java

@@ -1085,8 +1085,10 @@ public class AcceptanceBasicInfoServiceImpl extends ServiceImpl<AcceptanceBasicI
         List<String> sellBillNumber = oldAcceptanceBasicInfo.getSellBillNumber();
         Long oldId = oldAcceptanceBasicInfo.getId();
         //保存基础信息
+        AcceptanceBasicInfo basicInfo = get(oldAcceptanceBasicInfo.getId());
         AcceptanceHisInfo acceptanceHisInfo = new AcceptanceHisInfo();
         BeanUtils.copyProperties(oldAcceptanceBasicInfo, acceptanceHisInfo, "id");
+        acceptanceHisInfo.setAcceptanceNumber(basicInfo.getAcceptanceNumber());
         //保存历史基础信息
         acceptanceHisInfoService.save(acceptanceHisInfo);
         //保存相关货物信息

+ 6 - 0
src/main/java/com/sunxung/factoring/service/financing/payment/impl/ExemptionApprovalBusinessServiceImpl.java

@@ -2,6 +2,7 @@ package com.sunxung.factoring.service.financing.payment.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sunxung.factoring.component.enums.FinancingCurrentStageEnum;
 import com.sunxung.factoring.component.exception.BusinessException;
 import com.sunxung.factoring.component.exception.ValidatorException;
 import com.sunxung.factoring.component.util.CodeUtil;
@@ -94,6 +95,11 @@ public class ExemptionApprovalBusinessServiceImpl extends ServiceImpl<ExemptionA
         if (result == null || !result) {
             throw new ValidatorException(CodeUtil.FAIL, "豁免业务负责人审批提交出错啦!");
         }
+        if (ConstantConversionUtil.APPROVAL_RESULT_BACK.equals(exemptionApprovalBusiness.getApprovalConclusion())) {
+            //修改融资申请当前阶段
+            financingBasicInfo.setCurrentStage(FinancingCurrentStageEnum.PAYMENT_APPLY.getCode());
+            financingBasicInfoService.updateById(financingBasicInfo);
+        }
     }
 
     @Override

+ 6 - 0
src/main/java/com/sunxung/factoring/service/financing/payment/impl/ExemptionApprovalRiskServiceImpl.java

@@ -2,6 +2,7 @@ package com.sunxung.factoring.service.financing.payment.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sunxung.factoring.component.enums.FinancingCurrentStageEnum;
 import com.sunxung.factoring.component.exception.BusinessException;
 import com.sunxung.factoring.component.exception.ValidatorException;
 import com.sunxung.factoring.component.util.CodeUtil;
@@ -94,6 +95,11 @@ public class ExemptionApprovalRiskServiceImpl extends ServiceImpl<ExemptionAppro
         if (result == null || !result) {
             throw new ValidatorException(CodeUtil.FAIL, "豁免风控负责人审批提交出错啦!");
         }
+        if (ConstantConversionUtil.APPROVAL_RESULT_BACK.equals(exemptionApprovalRisk.getApprovalConclusion())) {
+            //修改融资申请当前阶段
+            financingBasicInfo.setCurrentStage(FinancingCurrentStageEnum.PAYMENT_APPLY.getCode());
+            financingBasicInfoService.updateById(financingBasicInfo);
+        }
     }
 
     @Override

+ 6 - 2
src/main/java/com/sunxung/factoring/service/financing/payment/impl/PaymentApplyServiceImpl.java

@@ -272,6 +272,10 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
                 result = flowableService.completeMyTask(paymentApply.getTaskId(), financingBasicInfo, procVariables,
                         "无豁免", paymentApplyHis.getId(), msgVariables, key, legalSpecialists);
             }
+            //修改融资申请当前阶段
+            financingBasicInfo.setCurrentStage(FinancingCurrentStageEnum.PAYMENT_APPROVAL.getCode());
+            financingBasicInfoService.updateById(financingBasicInfo);
+
             if (result == null || !result) {
                 throw new ValidatorException(CodeUtil.FAIL, "法务终审提交时出错啦!");
             }
@@ -409,7 +413,7 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
             }
             if (paymentApproval.getApprovalConclusion().equals(ConstantConversionUtil.APPROVAL_RESULT_PASS)) {
                 //修改融资申请当前阶段
-                financingBasicInfo.setCurrentStage(FinancingCurrentStageEnum.PAYMENT_APPROVAL.getCode());
+                financingBasicInfo.setCurrentStage("");
                 //修改融资申请状态
                 financingBasicInfo.setFinancingStatus(ProjectInitiationStatusDict.ChildEnum.COMPLETED.getCode());
                 financingBasicInfoService.updateById(financingBasicInfo);
@@ -427,7 +431,7 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
 
     @Override
     public List<PaymentCondition> findConditions(Long applyId) {
-        return paymentConditionService.lambdaQuery().eq(PaymentCondition::getPaymentApplyId,applyId).list();
+        return paymentConditionService.lambdaQuery().eq(PaymentCondition::getPaymentApplyId, applyId).list();
     }
 
     /**

+ 103 - 112
src/main/java/com/sunxung/factoring/service/ledger/impl/LedgerManagementServiceImpl.java

@@ -1131,7 +1131,7 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
                             //1.查看计划是否有逾期利息未分完的,存在先分逾期利息
                             if (goodsAssignVo.getHasAssignOverdueInterest()) {
                                 List<PaymentCollectionPlanFactoring> overdueInterestList = planFactoringList.stream()
-                                        .filter(f -> f.getAmountType().getCode().equals("overdue_interest") && f.getPlanDate().before(ledgerDate))
+                                        .filter(f -> f.getAmountType().getCode().equals("overdue_interest"))
                                         .sorted(Comparator.comparing(PaymentCollectionPlanFactoring::getPlanDate)).collect(Collectors.toList());
                                 if (overdueInterestList != null && overdueInterestList.size() > 0) {
                                     for (PaymentCollectionPlanFactoring factoring : overdueInterestList) {
@@ -1167,8 +1167,16 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
                             BigDecimal actualManagementTotal = getActualAmountTotal(allPlanFactoringList, managementFeeDict);
                             //4.获取所有的已经收款的利息之和
                             BigDecimal actualInterestTotal = getActualAmountTotal(allPlanFactoringList, interestDict);
+
+                            Boolean assignOverdueInterest = hasAssignOverdueInterest(allPlanFactoringList, goodsAssignVo.getHasAssignOverdueInterest());
                             //5.获取截至到分账日期的新的本金计划
-                            List<PaymentCollectionPlanFactoring> newPrincipalFactoringList = getPrincipalFactoringByLedgerDate(principalFactoringList, ledgerDate, returnedAmount);
+                            List<PaymentCollectionPlanFactoring> newPrincipalFactoringList = new ArrayList<>();
+                            if (assignOverdueInterest) {
+                                //判断是否存在逾期利息不豁免且需要分逾期利息的场景,如果存在分账日期取系统当前日期
+                                newPrincipalFactoringList = getPrincipalFactoringByLedgerDate(principalFactoringList, new Date(), returnedAmount);
+                            } else {
+                                newPrincipalFactoringList = getPrincipalFactoringByLedgerDate(principalFactoringList, ledgerDate, returnedAmount);
+                            }
                             //6.计算截至到分账日期计划应收管理费总和
                             BigDecimal planManagementTotal = getAllocatedAmountByPlanFactoring(newPrincipalFactoringList, managementFeeDict,
                                     goodsAssignVo, paymentCalculateVo);
@@ -1180,87 +1188,12 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
                             //剩余未分配利息
                             BigDecimal unAssignInterest = BigDecimal.ZERO;
 
-                            //用已收利息之和减去计划应收、判断需不需要退还
-                            refundInterest = actualInterestTotal.subtract(planInterestTotal);
-                            //获取所有的利息收款计划
-                            List<PaymentCollectionPlanFactoring> interestFactoringList = getFactoringByAmountType(allPlanFactoringList, interestDict);
-                            if (refundInterest.compareTo(BigDecimal.ZERO) > 0) {
-                                //说明利息分多了,需要将多的退掉
-//                                ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, refundInterest.negate(), refundInterest.negate(),
-//                                        IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
-                                unAssignInterest = refundInterest.negate();
-                                //删除未分配的利息
-                                deleteUnAssignList(interestFactoringList, ledgerPlanFactoringAssignList, goodsAssignVo);
-                                //将部分分配的利息计划金额改为实收金额
-                                updatePartAssignList(interestFactoringList, ledgerPlanFactoringAssignList, goodsAssignVo);
-                            } else if (refundInterest.compareTo(BigDecimal.ZERO) == 0) {
-                                //删除未分配的利息
-                                deleteUnAssignList(interestFactoringList, ledgerPlanFactoringAssignList, goodsAssignVo);
-                                //将部分分配的利息计划金额改为实收金额
-                                updatePartAssignList(interestFactoringList, ledgerPlanFactoringAssignList, goodsAssignVo);
-                            } else if (refundInterest.compareTo(BigDecimal.ZERO) < 0) {
-                                //说明利息还需要补
-                                BigDecimal toAssignInterest = refundInterest.negate();
-                                if (assignAmount.compareTo(BigDecimal.ZERO) > 0) {
-                                    if (assignAmount.compareTo(toAssignInterest) >= 0) {
-                                        //说明本次分的钱可以把管理费分完,增加一条利息分配记录(应分=实分)
-                                        if (goodsAssignVo.getHasAssignInterest()) {
-                                            ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, toAssignInterest, toAssignInterest,
-                                                    IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
-                                            financeInterest = financeInterest.add(toAssignInterest);
-                                            assignAmount = assignAmount.subtract(toAssignInterest);
-                                        } else {
-                                            ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, toAssignInterest, BigDecimal.ZERO,
-                                                    IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
-                                        }
-                                    } else if (assignAmount.compareTo(toAssignInterest) < 0) {
-                                        //说明本次分的钱把管理费分不完,增加一条利息分配记录(应分>实分)
-                                        if (goodsAssignVo.getHasAssignInterest()) {
-                                            //如果本次选择分利息
-                                            ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, assignAmount, assignAmount,
-                                                    IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
-                                            financeInterest = financeInterest.add(assignAmount);
-                                            assignAmount = BigDecimal.ZERO;
-                                        } else {
-                                            //如果选择不分利息
-                                            ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, assignAmount, BigDecimal.ZERO,
-                                                    IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
-                                        }
-                                        //剩余未分配利息
-                                        unAssignInterest = toAssignInterest.subtract(assignAmount);
-
-                                        // 获取最后一期利息收款计划
-//                                        PaymentCollectionPlanFactoring interestFactoring = getLastPrincipalFactoring(planFactoringList, interestDict);
-//                                        if (interestFactoring != null) {
-//                                            List<PayCollPlanFactoringAmountAllocation> allocationList = interestFactoring.getAmountAllocationList();
-//                                            BigDecimal allocationAmount = BigDecimal.ZERO;
-//                                            if (CollectionUtil.isNotEmpty(allocationList)) {
-//                                                allocationAmount = allocationList.stream().filter(a -> a.getActualAmount() != null)
-//                                                        .map(PayCollPlanFactoringAmountAllocation::getActualAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-//                                            }
-//                                            if (interestFactoring.getAmount().compareTo(allocationAmount) > 0) {
-//                                                //说明是未完成的计划
-//                                                interestFactoring.setAmount(unAssignInterest.add(interestFactoring.getAmount()));
-//                                                ledgerPlanFactoringAssignList.add(addPlanFactoringUpdateAssign(interestFactoring.getPlanDate(), BigDecimal.ZERO,
-//                                                        interestFactoring, goodsAssignVo, 0));
-//                                            }
-//                                        } else {
-//                                            ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, unAssignInterest, BigDecimal.ZERO,
-//                                                    IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
-//                                        }
-                                    }
-
-                                }
-                            }
-
                             //用已收管理费之和减去计划应收、判断需不需要退还
                             refundManagement = actualManagementTotal.subtract(planManagementTotal);
                             //获取所有的管理费收款计划
                             List<PaymentCollectionPlanFactoring> managementFeeFactoringList = getFactoringByAmountType(allPlanFactoringList, managementFeeDict);
                             if (refundManagement.compareTo(BigDecimal.ZERO) > 0) {
                                 //说明管理费分多了,需要将多的退掉
-//                                ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, refundManagement.negate(), refundManagement.negate(),
-//                                        IncomeExpenditureTypeDict.ChildEnum.MANAGEMENT_FEE.getCode(), goodsAssignVo, 0));
                                 unAssignManagement = refundManagement.negate();
                                 //删除未分配的管理费
                                 deleteUnAssignList(managementFeeFactoringList, ledgerPlanFactoringAssignList, goodsAssignVo);
@@ -1278,7 +1211,7 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
                                 if (assignAmount.compareTo(BigDecimal.ZERO) > 0) {
                                     if (assignAmount.compareTo(toAssignManagement) >= 0) {
                                         //说明本次分的钱可以把管理费分完,增加一条管理费分配记录
-                                        if (goodsAssignVo.getHasAssignManagementFee()) {
+                                        if (goodsAssignVo.getHasAssignInterest()) {
                                             //如果本次选择分管理费
                                             ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, toAssignManagement, toAssignManagement,
                                                     IncomeExpenditureTypeDict.ChildEnum.MANAGEMENT_FEE.getCode(), goodsAssignVo, 0));
@@ -1291,7 +1224,7 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
                                         }
                                     } else if (assignAmount.compareTo(toAssignManagement) < 0) {
                                         //说明本次分的钱把管理费分不完,增加一条管理费分配记录
-                                        if (goodsAssignVo.getHasAssignManagementFee()) {
+                                        if (goodsAssignVo.getHasAssignInterest()) {
                                             //如果本次选择分管理费
                                             ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, assignAmount, assignAmount,
                                                     IncomeExpenditureTypeDict.ChildEnum.MANAGEMENT_FEE.getCode(), goodsAssignVo, 0));
@@ -1304,28 +1237,60 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
                                         }
                                         //剩余未分配管理费
                                         unAssignManagement = toAssignManagement.subtract(assignAmount);
-                                        // 获取最后一期管理费收款计划
-//                                        PaymentCollectionPlanFactoring managementFactoring = getLastPrincipalFactoring(planFactoringList, managementFeeDict);
-//                                        if (managementFactoring != null) {
-//                                            List<PayCollPlanFactoringAmountAllocation> allocationList = managementFactoring.getAmountAllocationList();
-//                                            BigDecimal allocationAmount = BigDecimal.ZERO;
-//                                            if (CollectionUtil.isNotEmpty(allocationList)) {
-//                                                allocationAmount = allocationList.stream().filter(a -> a.getActualAmount() != null)
-//                                                        .map(PayCollPlanFactoringAmountAllocation::getActualAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-//                                            }
-//                                            if (managementFactoring.getAmount().compareTo(allocationAmount) > 0) {
-//                                                //说明是未完成的计划
-//                                                managementFactoring.setAmount(unAssignManagement.add(managementFactoring.getAmount()));
-//                                                ledgerPlanFactoringAssignList.add(addPlanFactoringUpdateAssign(managementFactoring.getPlanDate(), BigDecimal.ZERO,
-//                                                        managementFactoring, goodsAssignVo, 0));
-//                                            }
-//                                        } else {
-//                                            ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, unAssignManagement, BigDecimal.ZERO,
-//                                                    IncomeExpenditureTypeDict.ChildEnum.MANAGEMENT_FEE.getCode(), goodsAssignVo, 0));
-//                                        }
                                     }
                                 }
                             }
+
+                            //用已收利息之和减去计划应收、判断需不需要退还
+                            refundInterest = actualInterestTotal.subtract(planInterestTotal);
+                            //获取所有的利息收款计划
+                            List<PaymentCollectionPlanFactoring> interestFactoringList = getFactoringByAmountType(allPlanFactoringList, interestDict);
+                            if (refundInterest.compareTo(BigDecimal.ZERO) > 0) {
+                                //说明利息分多了,需要将多的退掉
+                                unAssignInterest = refundInterest.negate();
+                                //删除未分配的利息
+                                deleteUnAssignList(interestFactoringList, ledgerPlanFactoringAssignList, goodsAssignVo);
+                                //将部分分配的利息计划金额改为实收金额
+                                updatePartAssignList(interestFactoringList, ledgerPlanFactoringAssignList, goodsAssignVo);
+                            } else if (refundInterest.compareTo(BigDecimal.ZERO) == 0) {
+                                //删除未分配的利息
+                                deleteUnAssignList(interestFactoringList, ledgerPlanFactoringAssignList, goodsAssignVo);
+                                //将部分分配的利息计划金额改为实收金额
+                                updatePartAssignList(interestFactoringList, ledgerPlanFactoringAssignList, goodsAssignVo);
+                            } else if (refundInterest.compareTo(BigDecimal.ZERO) < 0) {
+                                //说明利息还需要补
+                                BigDecimal toAssignInterest = refundInterest.negate();
+                                if (assignAmount.compareTo(BigDecimal.ZERO) > 0) {
+                                    if (assignAmount.compareTo(toAssignInterest) >= 0) {
+                                        //说明本次分的钱可以把管理费分完,增加一条利息分配记录(应分=实分)
+                                        if (goodsAssignVo.getHasAssignInterest()) {
+                                            ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, toAssignInterest, toAssignInterest,
+                                                    IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
+                                            financeInterest = financeInterest.add(toAssignInterest);
+                                            assignAmount = assignAmount.subtract(toAssignInterest);
+                                        } else {
+                                            ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, toAssignInterest, BigDecimal.ZERO,
+                                                    IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
+                                        }
+                                    } else if (assignAmount.compareTo(toAssignInterest) < 0) {
+                                        //说明本次分的钱把管理费分不完,增加一条利息分配记录(应分>实分)
+                                        if (goodsAssignVo.getHasAssignInterest()) {
+                                            //如果本次选择分利息
+                                            ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, assignAmount, assignAmount,
+                                                    IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
+                                            financeInterest = financeInterest.add(assignAmount);
+                                            assignAmount = BigDecimal.ZERO;
+                                        } else {
+                                            //如果选择不分利息
+                                            ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, assignAmount, BigDecimal.ZERO,
+                                                    IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
+                                        }
+                                        //剩余未分配利息
+                                        unAssignInterest = toAssignInterest.subtract(assignAmount);
+                                    }
+
+                                }
+                            }
                             if (assignAmount.compareTo(BigDecimal.ZERO) > 0) {
                                 //分配完还有钱去分配本金
                                 if (CollectionUtil.isNotEmpty(principalFactoringList)) {
@@ -1354,23 +1319,30 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
                                                 financePrincipal = financePrincipal.add(planFactoring.getAmount());
                                             } else {
                                                 //说明本金不够分了
-                                                if (ledgerDate.before(planFactoring.getPlanDate())) {
-                                                    //分账日期早于计划日期
-                                                    planFactoring.setPlanDate(ledgerDate);
+                                                //判断本金状态是否逾期,如果逾期,本金不能拆分
+                                                if (PaymentCollectionPlanStatusDict.ChildEnum.OVERDUE.getCode().equals(planFactoring.getStatus().getCode())) {
+                                                    //计划已逾期
+                                                    ledgerPlanFactoringAssignList.add(addPlanFactoringUpdateAssign(ledgerDate, assignAmount,
+                                                            planFactoring, goodsAssignVo, 1));
+                                                } else {
+                                                    if (ledgerDate.before(planFactoring.getPlanDate())) {
+                                                        //分账日期早于计划日期
+                                                        planFactoring.setPlanDate(ledgerDate);
+                                                    }
+                                                    planFactoring.setAmount(assignAmount);
+                                                    planFactoring.setActualCashFlow(assignAmount);
+                                                    //修改一笔本金收款记录
+                                                    ledgerPlanFactoringAssignList.add(addPlanFactoringUpdateAssign(ledgerDate, assignAmount,
+                                                            planFactoring, goodsAssignVo, 1));
+                                                    financePrincipal = financePrincipal.add(assignAmount);
+                                                    Date lastPlanDate = goodsAssignVo.getLastPlanDate();
+                                                    //增加一笔剩余本金收款记录
+                                                    ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(lastPlanDate, returnedAmount.subtract(assignAmount), BigDecimal.ZERO,
+                                                            IncomeExpenditureTypeDict.ChildEnum.PRINCIPAL.getCode(), goodsAssignVo, 1));
                                                 }
-                                                planFactoring.setAmount(assignAmount);
-                                                planFactoring.setActualCashFlow(assignAmount);
-
-                                                //修改一笔本金收款记录
-                                                ledgerPlanFactoringAssignList.add(addPlanFactoringUpdateAssign(ledgerDate, assignAmount,
-                                                        planFactoring, goodsAssignVo, 1));
-                                                financePrincipal = financePrincipal.add(assignAmount);
-                                                Date lastPlanDate = goodsAssignVo.getLastPlanDate();
-                                                //增加一笔剩余本金收款记录
-                                                ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(lastPlanDate, returnedAmount.subtract(assignAmount), BigDecimal.ZERO,
-                                                        IncomeExpenditureTypeDict.ChildEnum.PRINCIPAL.getCode(), goodsAssignVo, 1));
                                                 returnedAmount = returnedAmount.subtract(assignAmount);
                                                 assignAmount = BigDecimal.ZERO;
+                                                flag = true;
                                             }
                                         }
                                     }
@@ -1720,6 +1692,25 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
         return ledgerAccountInfoVo;
     }
 
+    /**
+     * 判断是否需要分配逾期利息
+     *
+     * @param allPlanFactoringList
+     * @param hasAssignOverdueInterest
+     */
+    private Boolean hasAssignOverdueInterest(List<PaymentCollectionPlanFactoring> allPlanFactoringList, Boolean hasAssignOverdueInterest) {
+        Boolean flag = false;
+        if (CollectionUtil.isNotEmpty(allPlanFactoringList)) {
+            boolean exist = allPlanFactoringList.stream().anyMatch(planFactoring ->
+                    IncomeExpenditureTypeDict.ChildEnum.OVERDUE_INTEREST.getCode().equals(planFactoring.getAmountType().getCode())
+                            && !PaymentCollectionPlanStatusDict.ChildEnum.NOTNEED.getCode().equals(planFactoring.getStatus().getCode()));
+            if (exist && hasAssignOverdueInterest) {
+                flag = true;
+            }
+        }
+        return flag;
+    }
+
     /**
      * 收放款计划校验
      *

+ 18 - 0
src/main/java/com/sunxung/factoring/service/project/impl/BusinessProcessingTaskServiceImpl.java

@@ -340,6 +340,24 @@ public class BusinessProcessingTaskServiceImpl implements BusinessProcessingTask
                 taskVo.setPlatformName(((SettlementBasicInfo) project).getTradingPlatformName());
                 taskVo.setProjectName(((SettlementBasicInfo) project).getBusinessName());
                 taskVo.setBusinessName(project.getBusinessName());
+                if (!((SettlementBasicInfo) project).getSettlementStatus().equals(ProjectInitiationStatusDict.ChildEnum.COMPLETED.getCode())) {
+                    BusinessProcessingLog processingLog = processingLogService.getByBusinessTypeBusinessKey(ConstantUtil.BILL_BASIC_INFORMATION, project.getId());
+                    BusinessProcessingLog processingLog1 = processingLogService.getByBusinessTypeBusinessKey(ConstantUtil.BILL_UNIT_PRICE_ADJUST, project.getId());
+                    processingLog = processingLog1 == null ?processingLog:processingLog1;
+                    taskVo.setTaskName(processingLog.getTaskName());
+                    if (processingLog.getTaskName().equals("法务审核")) {
+                        taskVo.setAssigneeName("法务专员");
+                    }else if (processingLog.getTaskName().equals("财务审核")) {
+                        taskVo.setAssigneeName("财务人员");
+                    }else {
+                        if (taskVo.getAssignee() != null) {
+                            taskVo.setAssigneeName(taskVo.getAssignee().getName());
+                        } else {
+                            Long userId = assigneeService.getIdByBusiness(processingLog.getBusnessKey(), ConstantUtil.BILL_BASIC_INFORMATION, ConstantUtil.ASSIGNEE_PROJECT_MANAGER);
+                            taskVo.setAssigneeName(userService.get(userId).getName());
+                        }
+                    }
+                }
             }
 
             if (project instanceof UnderlyingBasicInfo) {

+ 4 - 4
src/main/java/com/sunxung/factoring/service/project/impl/ProjectAuditServiceImpl.java

@@ -453,7 +453,7 @@ public class ProjectAuditServiceImpl extends ServiceImpl<ProjectAuditMapper, Pro
             //注册地址
             BigDecimal registeredAddressScore = BigDecimal.ZERO;
             String address = enterprise.getAddress();
-            if (address.contains("黑龙江") || address.contains("辽宁") || address.contains("吉林") || address.contains("县") || address.contains("镇") || address.contains("乡") || address.contains("村")) {
+            if (address.contains("黑龙江") || address.contains("辽宁") || address.contains("吉林") ) {
                 admitted = ProjectScoringModel.NOT_ADMITTED;
                 errors.add("注册(登记)地址不准入!");
             }else {
@@ -463,7 +463,7 @@ public class ProjectAuditServiceImpl extends ServiceImpl<ProjectAuditMapper, Pro
             //经营地址得分
             String businessAddress = enterprise.getBusinessAddress();
             BigDecimal businessAddressScore = BigDecimal.ZERO;
-            if (businessAddress.contains("黑龙江") || businessAddress.contains("辽宁") || businessAddress.contains("吉林") || businessAddress.contains("县") || businessAddress.contains("镇") || businessAddress.contains("乡") || businessAddress.contains("村")) {
+            if (businessAddress.contains("黑龙江") || businessAddress.contains("辽宁") || businessAddress.contains("吉林") ) {
                 admitted = ProjectScoringModel.NOT_ADMITTED;
                 errors.add("经营地址不准入!");
             }else {
@@ -639,9 +639,9 @@ public class ProjectAuditServiceImpl extends ServiceImpl<ProjectAuditMapper, Pro
                 BigDecimal zhixingAmount = jsonObject.getBigDecimal("zhixingAmount");
                 projectOwnerScore.setZhiXingAmount(zhixingAmount);
                 BigDecimal zhiXingAmountScore = BigDecimal.ZERO;
-                if(zhixingAmount.compareTo(new BigDecimal(enterprise.getRegisteredCapital().replace("万元人民币","")).multiply(new BigDecimal("10000")).multiply(new BigDecimal("0.02"))) < 1){
+                if(zhixingAmount.compareTo(new BigDecimal(enterprise.getRegisteredCapital().replace("万元人民币","")).multiply(new BigDecimal("0.02"))) < 1){
                     zhiXingAmountScore = ProjectScoringModel.ENTERPRISE_RATIO.multiply(ProjectScoringModel.ZHI_XING_STANDARD_ONE);
-                }else if(zhixingAmount.compareTo(new BigDecimal(enterprise.getRegisteredCapital().replace("万元人民币","")).multiply(new BigDecimal("10000")).multiply(new BigDecimal("0.02"))) == 1){
+                }else if(zhixingAmount.compareTo(new BigDecimal(enterprise.getRegisteredCapital().replace("万元人民币","")).multiply(new BigDecimal("0.02"))) == 1){
                     admitted = ProjectScoringModel.NOT_ADMITTED;
                     errors.add("当前被执行金额不准入!");
                 }

+ 15 - 21
src/main/java/com/sunxung/factoring/service/project/impl/ProjectCoreEnterpriseAuditServiceImpl.java

@@ -535,9 +535,9 @@ public class ProjectCoreEnterpriseAuditServiceImpl extends ServiceImpl<ProjectCo
             BigDecimal zhixingAmount = jsonObject.getBigDecimal("zhixingAmount");
             projectCoreEnterpriseScore.setZhiXingAmount(zhixingAmount);
             BigDecimal zhiXingAmountScore = BigDecimal.ZERO;
-            if (zhixingAmount.compareTo(new BigDecimal(enterprise.getRegisteredCapital().replace("万元人民币", "")).multiply(new BigDecimal("10000")).multiply(new BigDecimal("0.02"))) < 1) {
+            if (zhixingAmount.compareTo(new BigDecimal(enterprise.getRegisteredCapital().replace("万元人民币", "")).multiply(new BigDecimal("0.02"))) < 1) {
                 zhiXingAmountScore = ProjectCoreEnterpriseScoringModel.ENTERPRISE_RATIO.multiply(ProjectCoreEnterpriseScoringModel.ZHI_XING_STANDARD_ONE);
-            }else if(zhixingAmount.compareTo(new BigDecimal(enterprise.getRegisteredCapital().replace("万元人民币", "")).multiply(new BigDecimal("10000")).multiply(new BigDecimal("0.02"))) == 1){
+            }else if(zhixingAmount.compareTo(new BigDecimal(enterprise.getRegisteredCapital().replace("万元人民币", "")).multiply(new BigDecimal("0.02"))) == 1){
                 admitted = ProjectCoreEnterpriseScoringModel.NOT_ADMITTED;
                 errors.add("当前被执行金额不准入!");
             }
@@ -823,9 +823,6 @@ public class ProjectCoreEnterpriseAuditServiceImpl extends ServiceImpl<ProjectCo
             if (projectCoreEnterpriseScore.getEnterpriseNatureScore().compareTo(BigDecimal.ZERO) == 0) {
                 errors.add("企业性质不准入!");
             }
-            if (projectCoreEnterpriseScore.getHoldingRatioScore().compareTo(BigDecimal.ZERO) == 0) {
-                errors.add("控股比例不准入!");
-            }
             if (projectCoreEnterpriseScore.getEquityHierarchyScore().compareTo(BigDecimal.ZERO) == 0) {
                 errors.add("股权层级不准入!");
             }
@@ -844,12 +841,9 @@ public class ProjectCoreEnterpriseAuditServiceImpl extends ServiceImpl<ProjectCo
             if (projectCoreEnterpriseScore.getStCountPersonScore().compareTo(BigDecimal.ZERO) == 0) {
                 errors.add("限高消费情况(法人)不准入");
             }
-            if (projectCoreEnterpriseScore.getZhiXingAmountScore().compareTo(BigDecimal.ZERO) == 0) {
-                errors.add("当前被执行金额不准入");
-            }
-            if (projectCoreEnterpriseAuditInfo.getInvolvingLitigationAccess() == 0) {
-                errors.add("历史涉诉数量(近一年)不准入");
-            }
+//            if (projectCoreEnterpriseAuditInfo.getInvolvingLitigationAccess() == 0) {
+//                errors.add("历史涉诉数量(近一年)不准入");
+//            }
             if (projectCoreEnterpriseScore.getPrivateLendingScore().compareTo(BigDecimal.ZERO) == 0) {
                 errors.add("民间借贷被告记录不准入");
             }
@@ -857,7 +851,7 @@ public class ProjectCoreEnterpriseAuditServiceImpl extends ServiceImpl<ProjectCo
                 errors.add("金融机构被告案件不准入");
             }
             if (projectCoreEnterpriseScore.getEquityFreezeScore().compareTo(BigDecimal.ZERO) == 0) {
-                errors.add(" 股权冻结不准入");
+                errors.add("股权冻结不准入");
             }
             if (projectCoreEnterpriseScore.getMajorAbnormalLitigationScore().compareTo(BigDecimal.ZERO) == 0) {
                 errors.add("重大异常诉讼不准入");
@@ -877,15 +871,15 @@ public class ProjectCoreEnterpriseAuditServiceImpl extends ServiceImpl<ProjectCo
             if (projectCoreEnterpriseScore.getExceptionScore().compareTo(BigDecimal.ZERO) == 0) {
                 errors.add("其他经营异常不准入");
             }
-            if (projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAccess() == 0) {
-                errors.add("行政处罚数量不准入");
-            }
-            if (projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAmountAccess() == 0) {
-                errors.add("行政处罚金额不准入");
-            }
-            if (projectCoreEnterpriseAuditInfo.getEnvironmentalPenaltyAmountAccess() == 0) {
-                errors.add("环保处罚金额不准入");
-            }
+//            if (projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAccess() == 0) {
+//                errors.add("行政处罚数量不准入");
+//            }
+//            if (projectCoreEnterpriseAuditInfo.getAdministrativePenaltyAmountAccess() == 0) {
+//                errors.add("行政处罚金额不准入");
+//            }
+//            if (projectCoreEnterpriseAuditInfo.getEnvironmentalPenaltyAmountAccess() == 0) {
+//                errors.add("环保处罚金额不准入");
+//            }
             admitted = ProjectCoreEnterpriseScoringModel.NOT_ADMITTED;
         } else {
             //固定额度  固定打分

+ 17 - 13
src/main/java/com/sunxung/factoring/service/supplier/impl/SupplierApprovalSecondServiceImpl.java

@@ -246,9 +246,11 @@ public class SupplierApprovalSecondServiceImpl extends ServiceImpl<SupplierAppro
         String taskId = supplierApprovalSecond.getTaskId();
         SupplierInfo supplierInfo = supplierInfoService.get(supplierApprovalSecond.getcSupplierInfoId());
         Enterprise enterprise = enterpriseService.getById(supplierInfo.getcEnterpriseId());
-        //一键测算
-        SupplierApprovalSecond measurement = measurement(supplierApprovalSecond);
-        supplierInfo.setSupplierErrors(measurement.getSupplierErrors());
+        if("pass".equals(supplierApprovalSecond.getApprovalConclusion())){
+            //一键测算
+            SupplierApprovalSecond measurement = measurement(supplierApprovalSecond);
+            supplierInfo.setSupplierErrors(measurement.getSupplierErrors());
+        }
         //保存第二次审核信息
         save(supplierApprovalSecond);
         //保存文件
@@ -322,16 +324,18 @@ public class SupplierApprovalSecondServiceImpl extends ServiceImpl<SupplierAppro
         }
         flowableService.completeMyTask(taskId, supplierInfo, procVariables, null, supplierApprovalSecond.getId(), msgVariables, ConstantUtil.SUPPLIER_INFO);
 
-        //判断是否开启授信决议
-        List<ProjectInformation> projectInformations = projectInformationService.lambdaQuery().eq(ProjectInformation::getcSupplierInfoId, supplierInfo.getId()).list();
-        if (CollectionUtil.isNotEmpty(projectInformations)) {
-            for (ProjectInformation projectInformation : projectInformations) {
-                if (projectInformation.getStatusStr().equals(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode())) {
-                    ProjectCoreEnterprise projectCoreEnterprise = projectCoreEnterpriseService.lambdaQuery().eq(ProjectCoreEnterprise::getcProjectInformationId, projectInformation.getId()).one();
-                    if (projectCoreEnterprise.getStatusStr().equals(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode())) {
-                        if (supplierInfo.getStatusStr().equals(SupplierStatusEnums.CREDIT_SUCCESS.getCode())) {
-                            //开启流程
-                            creditResolutionService.startProcess(projectInformation.getId());
+        if("pass".equals(supplierApprovalSecond.getApprovalConclusion())){
+            //判断是否开启授信决议
+            List<ProjectInformation> projectInformations = projectInformationService.lambdaQuery().eq(ProjectInformation::getcSupplierInfoId, supplierInfo.getId()).list();
+            if (CollectionUtil.isNotEmpty(projectInformations)) {
+                for (ProjectInformation projectInformation : projectInformations) {
+                    if (projectInformation.getStatusStr().equals(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode())) {
+                        ProjectCoreEnterprise projectCoreEnterprise = projectCoreEnterpriseService.lambdaQuery().eq(ProjectCoreEnterprise::getcProjectInformationId, projectInformation.getId()).one();
+                        if (projectCoreEnterprise.getStatusStr().equals(ProjectAndEnterpriseStatusEnums.CREDIT_SUCCESS.getCode())) {
+                            if (supplierInfo.getStatusStr().equals(SupplierStatusEnums.CREDIT_SUCCESS.getCode())) {
+                                //开启流程
+                                creditResolutionService.startProcess(projectInformation.getId());
+                            }
                         }
                     }
                 }

+ 28 - 26
src/main/java/com/sunxung/factoring/service/tradingPlatform/Impl/PlatformServiceImpl.java

@@ -18,6 +18,7 @@ import com.sunxung.factoring.service.sys.UserService;
 import com.sunxung.factoring.service.tradingPlatform.PlatformService;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.apache.xpath.operations.Bool;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -32,7 +33,7 @@ import java.util.Map;
  * @author liutao yaFan
  */
 @Service
-public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> implements PlatformService {
+public class PlatformServiceImpl extends ServiceImpl<PlatformMapper, Platform> implements PlatformService {
 
 
     @Autowired
@@ -51,26 +52,27 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public ResponseJson add(Platform platform){
+    public ResponseJson add(Platform platform) {
 //       对比统一社会信用代码
-        List<Platform> list = list(new QueryWrapper<Platform>().eq("socialCreditCode",platform.getSocialCreditCode()));
-        if(!list.isEmpty()){
-            return new ResponseJson("500","企业已添加,勿重复操作");
+        List<Platform> list = list(new QueryWrapper<Platform>().eq("socialCreditCode", platform.getSocialCreditCode()));
+        if (!list.isEmpty()) {
+            return new ResponseJson("500", "企业已添加,勿重复操作");
         }
 
-        ResponseJson forObject = restTemplate.getForObject(enterpriseInfoUrl+"?code="+platform.getSocialCreditCode(), ResponseJson.class);
-        Map<String,Object> data = (Map) forObject.getData();
+        ResponseJson forObject = restTemplate.getForObject(enterpriseInfoUrl + "?code=" + platform.getSocialCreditCode(), ResponseJson.class);
+        Map<String, Object> data = (Map) forObject.getData();
 
 
-        platform.setAuthUrl(data.get("authUrl").toString());
-        platform.setShortAuthUrl(data.get("shortAuthUrl").toString());
-        platform.setAuthStatus(0);
-        platform.setFddCustomerId(data.get("fddCustomerId").toString());
-        platform.setAutoSignUrl(data.get("autoSignUrl").toString());
-        platform.setShortAutoSignUrl(data.get("shortAutoSignUrl").toString());
+        platform.setAuthUrl(data.get("authUrl") == null ? "" : data.get("authUrl").toString());
+        platform.setShortAuthUrl(data.get("shortAuthUrl") == null ? "" : data.get("shortAuthUrl").toString());
+        Boolean authStatus = (Boolean)data.get("authStatus");
+        platform.setAuthStatus(authStatus ? 1 : 0);
+        platform.setFddCustomerId(data.get("fddCustomerId") == null ? "" : data.get("fddCustomerId").toString());
+        platform.setAutoSignUrl(data.get("autoSignUrl") == null ? "" : data.get("autoSignUrl").toString());
+        platform.setShortAutoSignUrl(data.get("shortAutoSignUrl") == null ? "" : data.get("shortAutoSignUrl").toString());
         platform.setShortAutoSignUrlCreate(new Date());
         Integer autoSignStatus = (Integer) data.get("autoSignStatus");
-        platform.setAutoSignStatus(autoSignStatus == 1?true:false);
+        platform.setAutoSignStatus(autoSignStatus == 1 ? true : false);
         save(platform);
 
         //电子签章获取认证地址
@@ -106,31 +108,31 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
     public GridPage findPage(ConditionVo conditionVo) {
         Page<Platform> page = PageHelper.startPage(conditionVo.getPage(), conditionVo.getRows());
         list(new QueryWrapper<Platform>().orderByDesc("gmt_create"));
-        return new GridPage(conditionVo.getRows(),conditionVo.getPage(),page.getTotal(),page.getResult());
+        return new GridPage(conditionVo.getRows(), conditionVo.getPage(), page.getTotal(), page.getResult());
     }
 
     @Override
-    public Platform getPlateformByBusiness(String  businessNumber) {
+    public Platform getPlateformByBusiness(String businessNumber) {
         return null;
     }
 
     @Override
     public void updateShortUrl(Date date) {
         List<Platform> list = list();
-        if(list!=null && list.size()>0){
+        if (list != null && list.size() > 0) {
             for (Platform platform : list) {
-                if(platform.getAuthStatus().equals(0)){
+                if (platform.getAuthStatus().equals(0)) {
                     Date shortAuthUrlCreate = platform.getShortAuthUrlCreate();
                     long between = cn.hutool.core.date.DateUtil.between(shortAuthUrlCreate, date, DateUnit.DAY);
-                    if(between>=6){
+                    if (between >= 6) {
                         //注册链接
                         String newShortUrl = ElectronicSignatureUtil.shortUrl(null, platform.getAuthUrl());
                         platform.setShortAuthUrl(newShortUrl);
                         platform.setShortAuthUrlCreate(date);
                         //自动签署链接
                         String autoSignUrl = platform.getAutoSignUrl();
-                        if(autoSignUrl!=null){
-                            String newShortAutoSignUrl = ElectronicSignatureUtil.shortUrl(null,autoSignUrl);
+                        if (autoSignUrl != null) {
+                            String newShortAutoSignUrl = ElectronicSignatureUtil.shortUrl(null, autoSignUrl);
                             platform.setShortAutoSignUrl(newShortAutoSignUrl);
                             platform.setShortAutoSignUrlCreate(date);
                         }
@@ -145,8 +147,8 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
     public void flushUrl(Long id) {
         Platform platform = getById(id);
 
-        ResponseJson forObject = restTemplate.getForObject(flushUrl+"?code="+platform.getSocialCreditCode(), ResponseJson.class);
-        Map<String,String> data = (Map) forObject.getData();
+        ResponseJson forObject = restTemplate.getForObject(flushUrl + "?code=" + platform.getSocialCreditCode(), ResponseJson.class);
+        Map<String, String> data = (Map) forObject.getData();
         platform.setAuthUrl(data.get("authUrl"));
         platform.setShortAuthUrl(data.get("shortAuthUrl"));
         platform.setAuthStatus(0);
@@ -185,8 +187,8 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
         Platform platform = getById(id);
 
         //先从sop更新信息
-        ResponseJson forObject = restTemplate.getForObject(synchronizeInformation+"?socialCreditCode="+platform.getSocialCreditCode(), ResponseJson.class);
-        Map<String,String> data = (Map) forObject.getData();
+        ResponseJson forObject = restTemplate.getForObject(synchronizeInformation + "?socialCreditCode=" + platform.getSocialCreditCode(), ResponseJson.class);
+        Map<String, String> data = (Map) forObject.getData();
         platform.setAuthUrl(data.get("authUrl"));
         platform.setShortAuthUrl(data.get("shortAuthUrl"));
         platform.setFddCustomerId(data.get("fddCustomerId"));
@@ -197,7 +199,7 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
 
         //获取认证状态
         String result = ElectronicSignatureUtil.getAuthInfo(platform.getSocialCreditCode(), "2");
-        if ("1".equals(result)){
+        if ("1".equals(result)) {
             platform.setAuthStatus(1);
             updateById(platform);
         }

+ 2 - 2
src/main/resources/application-dev.yml

@@ -21,7 +21,7 @@ spring:
     master:
       continueOnError: true
       type: com.alibaba.druid.pool.DruidDataSource
-      url: jdbc:mysql://192.168.3.6:3106/factoring_trade_v4?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
+      url: jdbc:mysql://192.168.3.6:3106/factoring_trade_v4_online_new?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
       username: root
       password: root
       driver-class-name: com.mysql.jdbc.Driver
@@ -70,7 +70,7 @@ pagehelper:
   supportMethodsArguments: true
   params: count=countSql
 
-localhost: 192.168.2.34
+localhost: 192.168.3.6
 
 #Redis缓存服务配置
 redis:

+ 50 - 50
src/main/resources/application-prod.yml

@@ -119,58 +119,58 @@ flowable:
   async-executor-activate: false
 # sop接口调用地址
 sop:
-  url: http://222.90.211.174:18868
-  findCorporateGoodwillUrl: http://222.90.211.174:18868/api/trade/corporateGoodwill
-  getScopeUrl: http://222.90.211.174:18868/api/trade/getScope
-  getChangesUrl: http://222.90.211.174:18868/api/trade/getChanges
-  dongjiangaoRisksUrl: http://222.90.211.174:18868/api/trade/dongjiangaoRiskById
-  getBusinesssScoreUrl: http://222.90.211.174:18868/api/trade/getBusinesssScore
-  pubStockUrl: http://222.90.211.174:18868/api/trade/pubStock
-  getIndustryUrl: http://222.90.211.174:18868/api/trade/getIndustry
-  getProjectReviewInfoUrl: http://222.90.211.174:18868/api/trade/getProjectReviewInfo
-  getProjectCoreEnterpriseScoreUrl: http://222.90.211.174:18868/api/trade/getProjectCoreEnterpriseScore
-  reviewResolutionReportUrl: http://222.90.211.174:18868/api/trade/reviewResolution/report
-  getEnterpriseAreaUrl: http://222.90.211.174:18868/api/trade/getEnterpriseArea
-  getBusinessByKeyWordUrl: http://222.90.211.174:18868/api/trade/findBusinessName
-  getFlushUrl: http://222.90.211.174:18868/sys/customer/flushByTrade/url
-  getEnterpriseInfoUrl: http://222.90.211.174:18868/sys/customer/getEnterpriseInfoByTrade
-  synchronizeDownloadFile: http://222.90.211.174:8868/synchronize/factoringContractTemplate/fileStorage/downloadFile
-  synchronizeInformation: http://222.90.211.174:18868/sys/customer/synchronize/information
-  getPaymentCollBasicStatus: http://222.90.211.174:18868/api/trade/findStatusListByContractNoAndBatch
-  getBusinessNoByTrade: http://222.90.211.174:18868/api/trade/quotaDisburseReport/getBusinessNoByTrade
-  judgeOverdueBySocialCreditCode: http://222.90.211.174:18868/api/trade/judgeOverdueBySocialCreditCode
-  getPaymentCollBasicOneStatus: http://222.90.211.174:18868/api/trade/findStatusByContractNoAndBatch
-  underlyingAssetsBasicId: http://222.90.211.174:18868/api/underlyingAssetsBasic/findBySocialCreditCode
-  underlyingAssetsDomesticAdd: http://222.90.211.174:18868/api/underlyingAssetsDomestic/add
-  domesticAccountsReceivableAdd: http://222.90.211.174:18868/api/domesticAccountsReceivable/add
-  quotaDisburseReportUrl: http://222.90.211.174:18868/api/quotaDisburse/report
-  addBusinessUrl: http://222.90.211.174:18868/api/trade/addBusiness
-  getAllOACompanyEntityUrl: http://222.90.211.174:18868/api/trade/getAllOACompanyEntity
-  applyOtherOAUrl: http://222.90.211.174:18868/api/trade/applyOtherOA
+  url: http://222.90.211.174:10526
+  findCorporateGoodwillUrl: http://222.90.211.174:10526/api/trade/corporateGoodwill
+  getScopeUrl: http://222.90.211.174:10526/api/trade/getScope
+  getChangesUrl: http://222.90.211.174:10526/api/trade/getChanges
+  dongjiangaoRisksUrl: http://222.90.211.174:10526/api/trade/dongjiangaoRiskById
+  getBusinesssScoreUrl: http://222.90.211.174:10526/api/trade/getBusinesssScore
+  pubStockUrl: http://222.90.211.174:10526/api/trade/pubStock
+  getIndustryUrl: http://222.90.211.174:10526/api/trade/getIndustry
+  getProjectReviewInfoUrl: http://222.90.211.174:10526/api/trade/getProjectReviewInfo
+  getProjectCoreEnterpriseScoreUrl: http://222.90.211.174:10526/api/trade/getProjectCoreEnterpriseScore
+  reviewResolutionReportUrl: http://222.90.211.174:10526/api/trade/reviewResolution/report
+  getEnterpriseAreaUrl: http://222.90.211.174:10526/api/trade/getEnterpriseArea
+  getBusinessByKeyWordUrl: http://222.90.211.174:10526/api/trade/findBusinessName
+  getFlushUrl: http://222.90.211.174:10526/sys/customer/flushByTrade/url
+  getEnterpriseInfoUrl: http://222.90.211.174:10526/sys/customer/getEnterpriseInfoByTrade
+  synchronizeDownloadFile: http://222.90.211.174:10526/synchronize/factoringContractTemplate/fileStorage/downloadFile
+  synchronizeInformation: http://222.90.211.174:10526/sys/customer/synchronize/information
+  getPaymentCollBasicStatus: http://222.90.211.174:10526/api/trade/findStatusListByContractNoAndBatch
+  getBusinessNoByTrade: http://222.90.211.174:10526/api/trade/quotaDisburseReport/getBusinessNoByTrade
+  judgeOverdueBySocialCreditCode: http://222.90.211.174:10526/api/trade/judgeOverdueBySocialCreditCode
+  getPaymentCollBasicOneStatus: http://222.90.211.174:10526/api/trade/findStatusByContractNoAndBatch
+  underlyingAssetsBasicId: http://222.90.211.174:10526/api/underlyingAssetsBasic/findBySocialCreditCode
+  underlyingAssetsDomesticAdd: http://222.90.211.174:10526/api/underlyingAssetsDomestic/add
+  domesticAccountsReceivableAdd: http://222.90.211.174:10526/api/domesticAccountsReceivable/add
+  quotaDisburseReportUrl: http://222.90.211.174:10526/api/quotaDisburse/report
+  addBusinessUrl: http://222.90.211.174:10526/api/trade/addBusiness
+  getAllOACompanyEntityUrl: http://222.90.211.174:10526/api/trade/getAllOACompanyEntity
+  applyOtherOAUrl: http://222.90.211.174:10526/api/trade/applyOtherOA
 fdd:
-  contractUrl: "http://192.168.125.194:8888/#/register"
-  caykCustomId: "8210513B14FE854DF1061E2D54665AF9"
-  yhrzzpCustomId: "2291B7F84D6340530A5469FB6FC15BF3"
-  registerUrl: "http://222.90.211.174:18870/fdd/accountRegister"
-  authUrl: "http://222.90.211.174:18870/fdd/getAuthAddress/sop"
-  removeAuthInfoUrl: "http://222.90.211.174:18870/fdd/removeAuthInfoUrl"
-  authUrlV3: "http://222.90.211.174:18870/fdd/v3/getAuthAddress"
-  authUrlV3PersonalFaceRecognition: "http://222.90.211.174:18870/fdd/v3/getAuthAddress/face/recognition"
-  uploadContractUrl: "http://222.90.211.174:18870/fdd/uploadContract"
-  batchSignUrl: "http://222.90.211.174:18870/fdd/manualBatchSign"
-  batchSignUrlSearchLocation: "http://222.90.211.174:18870/fdd/manualBatchSign/searchLocation"
-  authSignUrl: "http://222.90.211.174:18870/fdd/autoSign"
-  downloadContractUrl: "http://222.90.211.174:18870/fdd/downloadContract"
-  filedContractUrl: "http://222.90.211.174:18870/fdd/contractFiled"
-  beforeAutoSignUrl: "http://222.90.211.174:18870/fdd/before_autoSign"
-  shortUrl: "http://222.90.211.174:18870/fdd/short_url"
-  reportUrl: "http://222.90.211.174:18870/fdd/compliance_contract_report"
-  authInfoUrl: "http://222.90.211.174:18870/fdd/getAuthInfo"
-  getAuthInfoDetail: "http://222.90.211.174:18870/fdd/getAuthInfoDetail"
-  signInfoUrl: "http://222.90.211.174:18870/fdd/getSignInfo"
-  viewContractUrl: "http://222.90.211.174:18870/fdd/getViewContractUrl"
+  contractUrl: "https://hdts.changan-inkasso.com/#/register"
+  caykCustomId: "49AE3DAA91DA87A92C9371CE41D2A642"
+  yhrzzpCustomId: "E5E5D7FD1424DE57C4672B566BF517E2"
+  registerUrl: "http://47.114.148.98:8868/fdd/accountRegister"
+  authUrl: "http://47.114.148.98:8868/fdd/getAuthAddress/sop"
+  removeAuthInfoUrl: "http://47.114.148.98:8868/fdd/removeAuthInfoUrl"
+  authUrlV3: "http://47.114.148.98:8868/fdd/v3/getAuthAddress"
+  authUrlV3PersonalFaceRecognition: "http://47.114.148.98:8868/fdd/v3/getAuthAddress/face/recognition"
+  uploadContractUrl: "http://47.114.148.98:8868/fdd/uploadContract"
+  batchSignUrl: "http://47.114.148.98:8868/fdd/manualBatchSign"
+  batchSignUrlSearchLocation: "http://47.114.148.98:8868/fdd/manualBatchSign/searchLocation"
+  authSignUrl: "http://47.114.148.98:8868/fdd/autoSign"
+  downloadContractUrl: "http://47.114.148.98:8868/fdd/downloadContract"
+  filedContractUrl: "http://47.114.148.98:8868/fdd/contractFiled"
+  beforeAutoSignUrl: "http://47.114.148.98:8868/fdd/before_autoSign"
+  shortUrl: "http://47.114.148.98:8868/fdd/short_url"
+  reportUrl: "http://47.114.148.98:8868/fdd/compliance_contract_report"
+  authInfoUrl: "http://47.114.148.98:8868/fdd/getAuthInfo"
+  getAuthInfoDetail: "http://47.114.148.98:8868/fdd/getAuthInfoDetail"
+  signInfoUrl: "http://47.114.148.98:8868/fdd/getSignInfo"
+  viewContractUrl: "http://47.114.148.98:8868/fdd/getViewContractUrl"
 
-  localhost: http://localhost:8888
+  localhost: http://localhost:8868
 
 auth:
   not-login:

+ 1 - 1
src/main/resources/application.yml

@@ -1,4 +1,4 @@
 #环境配置
 spring:
   profiles:
-    active: dev
+    active: prod

+ 21 - 0
src/main/resources/data/update/v1.0/20231117liutao.sql

@@ -1422,3 +1422,24 @@ INSERT INTO `t_permission`( `parentId`, `type`, `cname`, `ename`, `gradation`, `
 VALUES ( null, 'menu', '联系我们', 'ContactUSHome', 3, NULL, '', '1', 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 = 'ContactUSHome'), 'button', '查看', 'viewContactUSHome', 0, '联系我们', '/ContactUSHome/viewContactUSHome', NULL, NULL, NULL, now(), now());
+
+
+alter table supplier_approval_second modify `revenue_rating` varchar(50) default NULL COMMENT '收入评级';
+alter table supplier_approval_second modify `admitted` varchar(50) default NULL COMMENT '是否准入';
+alter table supplier_approval_second modify `score` decimal(17,4) default NULL COMMENT '得分';
+alter table supplier_approval_second modify `credit_limit` decimal(17,4) default NULL COMMENT '授信额度';
+alter table supplier_approval_second modify `approval_conclusion` varchar(50) default NULL COMMENT '审批结论';
+alter table supplier_approval_second modify `shareholder_score` decimal(17,4) default NULL COMMENT '股东得分';
+alter table supplier_approval_second modify `establishment_period_score` decimal(17,4) default NULL COMMENT '成立年限得分';
+alter table supplier_approval_second modify `registered_capital_score` decimal(17,4) default NULL COMMENT '注册资本得分';
+alter table supplier_approval_second modify `registered_address_score` decimal(17,4) default NULL COMMENT '注册地址得分';
+alter table supplier_approval_second modify `business_address_score` decimal(17,4) default NULL COMMENT '经营地址得分';
+alter table supplier_approval_second modify `industry_score` decimal(17,4) default NULL COMMENT '所属行业得分';
+alter table supplier_approval_second modify `business_scope_score` decimal(17,4) default NULL COMMENT '经营范围得分';
+alter table supplier_approval_second modify `basic_change_score` decimal(17,4) default NULL COMMENT '基本变动信息得分';
+alter table supplier_approval_second modify `main_business_income` decimal(17,4) default NULL COMMENT '主营业务收入';
+alter table supplier_approval_second modify `main_business_income_score` decimal(17,4) default NULL COMMENT '主营业务收入得分';
+alter table supplier_approval_second modify `main_business_cost` decimal(17,4) default NULL COMMENT '主营业务成本';
+alter table supplier_approval_second modify `main_business_profit` decimal(17,4) default NULL COMMENT '毛利率';
+alter table supplier_approval_second modify `main_business_profit_score` decimal(17,4) default NULL COMMENT '毛利率得分';
+alter table supplier_approval_second modify `business_address` varchar(500) default NULL COMMENT '经营地址';

+ 3 - 0
src/main/resources/ftl/purchcontract/export/pruchContract.docx

@@ -95,6 +95,9 @@ C:本合同价款采用可变单价方式确定,最终结算单价以合同
   甲方:(盖章)            xf                    
   
   
+  
+  
+  
 
   乙方:(盖章)gys  
                                                        

+ 1 - 0
src/main/resources/mapper/project/BusinessProcessingLogMapper.xml

@@ -325,6 +325,7 @@
                  WHERE a.busness_key = #{businessKey}
                    AND a.business_type LIKE CONCAT(#{businessType},'%')
                    AND a.assignee_id = 1
+                   AND a.end_time is not null
                  ORDER BY gmt_create DESC limit 99999
              ) p
         GROUP BY p.task_def_key