Procházet zdrojové kódy

feat(企业):供应商 项目录入时 校验统一社会信用代码和注册资本

liutao před 7 měsíci
rodič
revize
25ab32ecba

+ 7 - 0
src/main/java/com/inkasso/factoring/creditmanagement/service/impl/ProjectInformationServiceImpl.java

@@ -29,6 +29,7 @@ import com.inkasso.factoring.purchManagement.entity.vo.PurchContractCompletedVo;
 import com.inkasso.factoring.purchManagement.service.ICPurchContractManagementService;
 import com.inkasso.factoring.system.user.entity.UserDO;
 import com.inkasso.factoring.system.user.service.UserService;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.xpath.operations.Bool;
@@ -511,6 +512,9 @@ public class ProjectInformationServiceImpl extends ServiceImpl<ProjectInformatio
      * @param projectCore        核心企业信息
      */
     private List<String> qichacha(ProjectInformation projectInformation, Enterprise enterprise, ProjectCoreEnterprise projectCore) {
+        if(StringUtils.isEmpty(enterprise.getSocialCreditCode())){
+            throw new ServiceException(CodeUtil.FAIL,enterprise.getCorporateName() + "不存在统一社会信用代码,无法进行后续授信操作!");
+        }
         List<String> error = new ArrayList<>();
         //2006综合风险排查
         String comprehensiveRiskInvestigationUrl = comprehensiveRiskInvestigation + "?socialCreditCode=" + enterprise.getSocialCreditCode();
@@ -535,6 +539,9 @@ public class ProjectInformationServiceImpl extends ServiceImpl<ProjectInformatio
         BigDecimal zhixingAmount = comprehensiveRiskJsonObject.getBigDecimal("zhixingAmount");
         enterprise.setBusinessAddress(annualAddress);
         enterprise.setRegisteredCapital(registCapi);
+        if(StringUtils.isEmpty(registCapi)){
+            throw new ServiceException(CodeUtil.FAIL,enterprise.getCorporateName() + "不存在注册资本,无法进行后续授信操作!");
+        }
         registCapi = registCapi.replace("万元人民币", "");
         Double registCapiInt = Double.valueOf(registCapi);
         long betweenYear = 0L;

+ 6 - 1
src/main/java/com/inkasso/factoring/creditmanagement/service/impl/SupplierInfoServiceImpl.java

@@ -230,7 +230,9 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
      */
     private String qichacha(Enterprise existEnterprise, SupplierInfo supplierInfo, boolean guaranteeEnterprise) {
         List<String> errors = new ArrayList<>();
-
+        if(StringUtils.isEmpty(existEnterprise.getSocialCreditCode())){
+            throw new ServiceException(CodeUtil.FAIL,existEnterprise.getCorporateName() + "不存在统一社会信用代码,无法进行后续授信操作!");
+        }
         //2006综合风险排查
         String comprehensiveRiskInvestigationUrl = comprehensiveRiskInvestigation + "?socialCreditCode=" + existEnterprise.getSocialCreditCode();
         ResponseJson comprehensiveRiskInvestigationRj;
@@ -255,6 +257,9 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
         if (CollectionUtil.isEmpty(partnerList)) {
             throw new ServiceException(CodeUtil.FAIL, "综合风险排查未获取到股东信息!");
         }
+        if(StringUtils.isEmpty(registCapi)){
+            throw new ServiceException(CodeUtil.FAIL,existEnterprise.getCorporateName() + "不存在注册资本,无法进行后续授信操作!");
+        }
         registCapi = registCapi.replace("万元人民币", "");
         Double registCapiInt = Double.valueOf(registCapi);
         long betweenYear = DateUtil.betweenYear(startDate, new Date(), false);