Jelajahi Sumber

企业认证资方修改

cuixq 4 tahun lalu
induk
melakukan
56e452bb72

+ 47 - 5
tianhu-system/src/main/java/com/tianhu/system/companyAuth/controller/OwnAuthController.java

@@ -208,6 +208,9 @@ public class OwnAuthController extends BaseController {
         if(CommonUtil.isEmpty(scySocialCode)){
             return R.fail("社会信用代码不能为空");
         }
+        if(!RegularUtil.social(scySocialCode)){
+            throw new Exception("社会信用代码格式错误!");
+        }
         //获取企业信息
         LambdaQueryWrapper<SysCompany> queryWrapper = new LambdaQueryWrapper<>();
         //企业名称
@@ -255,7 +258,7 @@ public class OwnAuthController extends BaseController {
         //法人证件号码
         String scyLegalId = CommonUtil.objToString(map.get("scyLegalId"));
         if(CommonUtil.isEmpty(scyLegalId)){
-            return R.fail("法人证件号码不能为空");
+            return R.fail("法人证件号码不能 为空");
         }
         if(!RegularUtil.cardId(scyLegalId)){
             throw new Exception("法人证件号码格式错误!");
@@ -297,6 +300,9 @@ public class OwnAuthController extends BaseController {
         String zbiRemark = CommonUtil.objToString(map.get("zbiRemark"));
         //营业执照
         String scyLicenseFile =CommonUtil.objToString(map.get("scyLicenseFile"));
+        if(CommonUtil.isEmpty(scyLicenseFile)){
+            return R.fail("营业执照不能为空");
+        }
         //法人身份证人像面
         String fsfzzList =CommonUtil.objToString(map.get("fsfzzList"));
         if(CommonUtil.isEmpty(fsfzzList)){
@@ -329,6 +335,8 @@ public class OwnAuthController extends BaseController {
         List<Map<String,String>> szzssqList = (List<Map<String, String>>) map.get("szzssqList");
         //其他附件
         List<Map<String,String>> qtfjList = (List<Map<String, String>>) map.get("qtfjList");
+        //四要素跳过(00:下一步,01:跳过)
+        String skip =CommonUtil.objToString(map.get("skip"));
         String  scyId  =  null;
         SysCompany SysCompany = new SysCompany();
         if (use.getCompanyId() == null){
@@ -348,8 +356,10 @@ public class OwnAuthController extends BaseController {
         SysCompany.setScyLegalId(scyLegalId);
         SysCompany.setScyLicenseFile(scyLicenseFile);
         SysCompany.setScyLegalFile(fsfzzList);
+        //对公户认证
+        SysCompany.setScyStatus("03");
         if(fsfzfList.size()>0){
-            SysCompany.setScyLegalBackFile(fsfzfList.get(0).get("uid"));
+            SysCompany.setScyLegalBackFile(String.valueOf(fsfzfList.get(0).get("uid")));
         }
         if(frsqsList.size()>0){
             SysCompany.setScyAuthorizationFile(frsqsList.get(0).get("uid"));
@@ -360,6 +370,23 @@ public class OwnAuthController extends BaseController {
         if(qtfjList.size()>0){
             SysCompany.setScyAppendixFile(qtfjList.get(0).get("uid"));
         }
+        //增加营业执照文件企业
+        FileInf fileInf =new FileInf();
+        fileInf.setPfiFileId(scyLicenseFile);
+        fileInf.setPfiCompanyId(scyId);
+        pubFileInfService.updateFileInf(fileInf);
+        //增加法人身份证人像面文件企业
+        FileInf fileInff =new FileInf();
+        fileInff.setPfiFileId(fsfzzList);
+        fileInff.setPfiCompanyId(scyId);
+        pubFileInfService.updateFileInf(fileInff);
+        if(CommonUtil.isNotEmpty(jsfzzList)){
+            //增加经办人身份证人像面文件企业
+            FileInf fileInfj =new FileInf();
+            fileInfj.setPfiFileId(jsfzzList);
+            fileInfj.setPfiCompanyId(scyId);
+            pubFileInfService.updateFileInf(fileInfj);
+        }
         //运营商三要素
         JSONObject operatorAuth = null;
         /*JSONObject operatorAuth = new JSONObject();
@@ -388,16 +415,21 @@ public class OwnAuthController extends BaseController {
         companyAuth.put("Verification", "20");*/
         System.out.print("工商四要素结果==========>" + companyAuth);
         //状态(00:正常, 01:停用, 02:待四要素认证(认证中), 03:待对公户认证(认证中), 04:待实名审核(认证中), 99:删除)
-        SysCompany.setScyStatus("03");
         //四要素认证状态(00:未认证, 01:认证通过, 02:认证未通过, 03:人工审批通过, 04:人工审批不通过)
         if("SUCCESS".equals(companyAuth.getString("Message"))){
             if(!"20".equals(companyAuth.getString("Verification"))){
                 SysCompany.setScyAuthStatus("02");
+                if(!"00".equals(skip)){
+                    return R.ok("skip");
+                }
             }else{
                 SysCompany.setScyAuthStatus("01");
             };
         }else{
             SysCompany.setScyAuthStatus("02");
+            if(!"00".equals(skip)){
+                return R.ok("skip");
+            }
         }
         }else{
             //企查查
@@ -412,6 +444,9 @@ public class OwnAuthController extends BaseController {
                 SysCompany.setScyAuthStatus("01");
             }else{
                 SysCompany.setScyAuthStatus("02");
+                if(!"00".equals(skip)){
+                    return R.ok("skip");
+                }
             }
         }
 
@@ -557,8 +592,9 @@ public class OwnAuthController extends BaseController {
                 }
                 userService.updateUser(sysUser);
                 // 新增角色
+                handlerUser.setCompanyId(scyId);
                 handlerUser.setRoleIds(roleIds);
-                userService.insertUserRole(handlerUser);
+                userService.updateUser(handlerUser);
 
                 //创建经办人与企业关系
                 SysUserCompanyRel sysUserCompanyRel = new SysUserCompanyRel();
@@ -627,6 +663,7 @@ public class OwnAuthController extends BaseController {
                 sysUserCompanyRelService.createSysUserCompanyRel(sysUserCompanyRel);
             }
         }
+
         //返回企业信息
         SysCompany company = sysCompanyService.getById(scyId);
         // 审批增加分组
@@ -811,7 +848,7 @@ public class OwnAuthController extends BaseController {
             }
             }else{
             //企业打款申请
-            JSONObject operatorAuth = CfcaUtil.paymentApply(ISPRO, INSTITUTIONID, pbaiAccountName, pbaiBankaccountId,pbaiBankName,zbiRemark);
+            JSONObject operatorAuth = CfcaUtil.paymentApply(ISPRO, INSTITUTIONID, pbaiAccountName, pbaiBankaccountId,list.get(0).getZcbiBankNo(),zbiRemark);
             /*JSONObject operatorAuth = new JSONObject();
             operatorAuth.put("Message", "SUCCESS");
             operatorAuth.put("Status", "20");
@@ -838,6 +875,11 @@ public class OwnAuthController extends BaseController {
             Date currentTime = DateUtils.getNowDate();
             payBankAccInf.setPbaiCfcaDate(currentTime);
             payBankAccInfService.createPayBankAccInf(payBankAccInf);
+            SysCompany sysCompany =new SysCompany();
+            sysCompany.setScyId(scyId);
+            //打款认证
+            sysCompany.setScyStatus("05");
+            sysCompanyService.updateSysCompany(sysCompany);
         }
         return R.ok();
     }

+ 19 - 0
tianhu-system/src/main/java/com/tianhu/system/controller/OwnManagementInfController.java

@@ -17,6 +17,7 @@ import com.tianhu.system.api.model.LoginUser;
 import com.tianhu.system.common.IMessageUtilsService;
 import com.tianhu.system.domain.*;
 import com.tianhu.system.service.*;
+import com.tianhu.system.utils.RegularUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -191,6 +192,9 @@ public class OwnManagementInfController extends BaseController
         if(CommonUtil.isEmpty(scyName)){
             return R.fail("资金方名称不可为空");
         }
+        if(!RegularUtil.special(scyName)){
+            return R.fail("资金方名称不能含有特殊字符");
+        }
         String smiType = CommonUtil.objToString(map.get("smiType"));
         if(CommonUtil.isEmpty(smiType)){
             return R.fail("资金方类型不可为空");
@@ -211,10 +215,16 @@ public class OwnManagementInfController extends BaseController
         if(CommonUtil.isEmpty(smiManager)){
             return R.fail("客户经理不可为空");
         }
+        if(!RegularUtil.special(smiManager)){
+            return R.fail("客户经理不能含有特殊字符");
+        }
         String smiContract = CommonUtil.objToString(map.get("smiContract"));
         if(CommonUtil.isEmpty(smiContract)){
             return R.fail("联系人姓名不可为空");
         }
+        if(!RegularUtil.special(smiContract)){
+            return R.fail("联系人姓名不能含有特殊字符");
+        }
         String smiContractPhone = CommonUtil.objToString(map.get("smiContractPhone"));
         if(CommonUtil.isEmpty(smiContractPhone)){
             return R.fail("联系人电话不可为空");
@@ -349,6 +359,9 @@ public class OwnManagementInfController extends BaseController
         if(CommonUtil.isEmpty(scyName)){
             return R.fail("资金方名称不可为空");
         }
+        if(!RegularUtil.special(scyName)){
+            return R.fail("资金方名称不能含有特殊字符");
+        }
         String smiType = CommonUtil.objToString(map.get("smiType"));
         if(CommonUtil.isEmpty(smiType)){
             return R.fail("资金方类型不可为空");
@@ -369,10 +382,16 @@ public class OwnManagementInfController extends BaseController
         if(CommonUtil.isEmpty(smiManager)){
             return R.fail("客户经理不可为空");
         }
+        if(!RegularUtil.special(smiManager)){
+            return R.fail("客户经理不能含有特殊字符");
+        }
         String smiContract = CommonUtil.objToString(map.get("smiContract"));
         if(CommonUtil.isEmpty(smiContract)){
             return R.fail("联系人姓名不可为空");
         }
+        if(!RegularUtil.special(smiContract)){
+            return R.fail("联系人姓名不能含有特殊字符");
+        }
         String smiContractPhone = CommonUtil.objToString(map.get("smiContractPhone"));
         if(CommonUtil.isEmpty(smiContractPhone)){
             return R.fail("联系人电话不可为空");

+ 28 - 1
tianhu-system/src/main/java/com/tianhu/system/utils/RegularUtil.java

@@ -1,6 +1,7 @@
 package com.tianhu.system.utils;
 
 import lombok.experimental.var;
+import org.checkerframework.checker.units.qual.A;
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -15,7 +16,13 @@ public class RegularUtil {
     //手机号
     private static final String REGMOBILE= "^1[3|4|5|6|7|8|9][0-9]\\d{8}$";
     //座机号
-    private static final String LANDLINE= "^[0-9\\-()()]{7,18}$";
+    private static final String LANDLINE= "\\d{3}-\\d{8}|\\d{4}-\\d{7}";
+    //社会统一信用代码
+    private static final String SOCIAL = "^([0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\\d{14})$";
+    //特殊字符
+    private static final String SPECIAL  ="^([\\u4e00-\\u9fa5]+|[a-zA-Z0-9]+)$";
+
+
     /**
      *正则表达式验证金额 正数 正整数
      * @param str
@@ -69,4 +76,24 @@ public class RegularUtil {
         Matcher match = pattern.matcher(str);
         return match.matches();
     }
+    /**
+     *正则表达式验证是否是社会统一信用代码
+     * @param str
+     * @return
+     */
+    public static boolean social(String str) {
+        Pattern pattern = Pattern.compile(SOCIAL);
+        Matcher match = pattern.matcher(str);
+        return match.matches();
+    }
+    /**
+     *正则表达式验证是否是特殊字符
+     * @param str
+     * @return
+     */
+    public static boolean special(String str) {
+        Pattern pattern = Pattern.compile(SPECIAL);
+        Matcher match = pattern.matcher(str);
+        return match.matches();
+    }
 }

+ 2 - 2
tianhu-system/src/main/resources/mapper/system/OwnManagementInfMapper.xml

@@ -29,9 +29,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="scyId != null  and scyId != ''"> and c.scy_id = #{scyId}</if>
 		<if test="scyName != null  and scyName != ''"> and c.scy_name like concat('%', #{scyName}, '%')</if>
 		<if test="smiType != null  and smiType != ''"> and s.smi_type = #{smiType}</if>
-		<if test="smiManager != null  and smiManager != ''"> and s.smi_manager= #{smiManager}</if>
+		<if test="smiManager != null  and smiManager != ''"> and s.smi_managelike concat('%', #{smiManager}, '%')</if>
 		<if test="smiContract != null  and smiContract != ''"> and u.nick_name like concat('%', #{smiContract}, '%')</if>
-		<if test="smiContractPhone != null  and smiContractPhone != ''"> and u.user_name = #{smiContractPhone}</if>
+		<if test="smiContractPhone != null  and smiContractPhone != ''"> and u.user_name like concat('%', #{smiContractPhone}, '%')</if>
 		 order by  c.create_time desc
 	</select>