Преглед изворни кода

feat(合同):合同制作

liutao пре 8 месеци
родитељ
комит
a515d10c20

+ 19 - 15
src/main/java/com/sunxung/factoring/service/supplier/impl/SupplierApprovalSecondServiceImpl.java

@@ -246,11 +246,13 @@ 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());
-        //保存第二次审核信息
-        save(supplierApprovalSecond);
+        if("pass".equals(supplierApprovalSecond.getApprovalConclusion())){
+            //一键测算
+            SupplierApprovalSecond measurement = measurement(supplierApprovalSecond);
+            supplierInfo.setSupplierErrors(measurement.getSupplierErrors());
+            //保存第二次审核信息
+            save(supplierApprovalSecond);
+        }
         //保存文件
         List<Long> files = supplierApprovalSecond.getFiles();
         if (CollectionUtil.isNotEmpty(files)) {
@@ -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());
+                            }
                         }
                     }
                 }