Просмотр исходного кода

查询电签ids时判断ids是否为空

lvy 1 месяц назад
Родитель
Сommit
661adfcff3

+ 3 - 3
blade-service/blade-business/src/main/java/org/springblade/business/utils/PDFUtil.java

@@ -116,7 +116,7 @@ public class PDFUtil {
                             txt=txt.substring(0,i);
                         }
                     }
-                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
                         eVisaConfigList.add(txt);
                     }
                 }
@@ -127,7 +127,7 @@ public class PDFUtil {
                             txt=txt.substring(0,i);
                         }
                     }
-                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
                         eVisaConfigList.add(txt);
                     }
                 }
@@ -135,7 +135,7 @@ public class PDFUtil {
                 // 特殊处理
                 if(textStr.indexOf("1")>=0){
                     String txt = textStr.substring(textStr.indexOf("1"));
-                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
                         System.out.println(txt);
                         eVisaConfigList.add(txt);
                     }

+ 21 - 14
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVDataServiceImpl.java

@@ -101,6 +101,7 @@ public class EVDataServiceImpl implements EVDataService {
                 //添加电签策略
                 List<SealStrategyVO> strategyListByAXQ = getStrategyListByAXQ(taskApp, ids);
                 if (strategyListByAXQ == null || Func.isEmpty(strategyListByAXQ) || strategyListByAXQ.size() == 0) {
+                    ids = ids.replaceAll("✹", "");
                     List<Map<String, Object>> mapList = jdbcTemplate.queryForList("SELECT * from m_textdict_info where type=6  and is_deleted=0 and id in(" + ids + ")");
                     if (mapList != null && mapList.size() > 0) {
                         taskApp.setSigState(2);
@@ -529,14 +530,17 @@ public class EVDataServiceImpl implements EVDataService {
         }
         if(strArray!=null && strArray.length>0) {
             for (int i = 0; i < strArray.length; i++) {
-                String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + strArray[i] + "' and is_deleted=0  ) as sealId from m_textdict_info a where  a.type =2 and a.id in (" + dqIds + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + strArray[i] + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
-                if (task.getSigType() == 2) {
-                    sqlinfo = "SELECT a.id as keyWord,a.pyzbx,a.pyzby,b.certificate_number as sealId from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + dqIds + ")";
-                    System.out.println("东方中讯--签章--" + sqlinfo);
-                } else {
-                    System.out.println("东方中讯--签字--" + sqlinfo);
+                List<Map<String, Object>> maps2 = null;
+                if (dqIds.length() > 0) {
+                    String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + strArray[i] + "' and is_deleted=0  ) as sealId from m_textdict_info a where  a.type =2 and a.id in (" + dqIds + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + strArray[i] + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
+                    if (task.getSigType() == 2) {
+                        sqlinfo = "SELECT a.id as keyWord,a.pyzbx,a.pyzby,b.certificate_number as sealId from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + dqIds + ")";
+                        System.out.println("东方中讯--签章--" + sqlinfo);
+                    } else {
+                        System.out.println("东方中讯--签字--" + sqlinfo);
+                    }
+                    maps2 = jdbcTemplate.queryForList(sqlinfo);
                 }
-                List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
                 if(CollectionUtil.isNotEmpty(maps2)) {
                     Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
                             .collect(Collectors.groupingBy(hada -> (Func.toStr(hada.get("keyWord")))));
@@ -609,14 +613,17 @@ public class EVDataServiceImpl implements EVDataService {
         if(strArray!=null && strArray.length>0){
             for (int i =0 ;i < strArray.length;i++) {
                 String userId =strArray[i];
-                String sqlinfo = "SELECT * from ( SELECT DISTINCT a.id,a.pyzbx ,a.pyzby,a.project_id,(SELECT signature_file_url from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as signature_file_url, (SELECT wide from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as wide ,(SELECT high from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as high from m_textdict_info a where  a.type =2 and a.id in (" + dqIds + ") and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + userId + " and c.is_deleted=0 ) ) x where x.signature_file_url is not null ";
-                if (task.getSigType() == 2) {
-                    sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,a.project_id,b.certificate_password,b.certificate_user_name,b.certificate_number ,b.wide,b.high from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + dqIds + ") ";
-                    System.out.println("安心签--签章--=" + sqlinfo);
-                } else {
-                    System.out.println("安心签--签字--=" + sqlinfo);
+                List<Map<String, Object>> maps2 = null;
+                if (dqIds.length() > 0) {
+                    String sqlinfo = "SELECT * from ( SELECT DISTINCT a.id,a.pyzbx ,a.pyzby,a.project_id,(SELECT signature_file_url from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as signature_file_url, (SELECT wide from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as wide ,(SELECT high from m_sign_pfx_file where is_register=1 and certificate_user_id='" + userId + "' and is_deleted=0  ) as high from m_textdict_info a where  a.type =2 and a.id in (" + dqIds + ") and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + task.getContractId() + " and user_id=" + userId + " and c.is_deleted=0 ) ) x where x.signature_file_url is not null ";
+                    if (task.getSigType() == 2) {
+                        sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,a.project_id,b.certificate_password,b.certificate_user_name,b.certificate_number ,b.wide,b.high from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + task.getContractId() + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + dqIds + ") ";
+                        System.out.println("安心签--签章--=" + sqlinfo);
+                    } else {
+                        System.out.println("安心签--签字--=" + sqlinfo);
+                    }
+                    maps2 = jdbcTemplate.queryForList(sqlinfo);
                 }
-                List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
                 if (maps2 != null && maps2.size() > 0) {
                     List<Map<String, Object>> maps = new ArrayList<>();
                     Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()

+ 6 - 6
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/PDFUtils.java

@@ -42,7 +42,7 @@ public class PDFUtils {
                             txt=txt.substring(0,i);
                         }
                     }
-                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
                         eVisaConfigList.add(txt);
                     }
                 }
@@ -59,7 +59,7 @@ public class PDFUtils {
                             txt=txt.substring(0,i);
                         }
                     }
-                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
                         eVisaConfigList.add(txt);
                     }
                 }
@@ -67,7 +67,7 @@ public class PDFUtils {
                 // 特殊处理
                 if(textStr.indexOf("1")>=0){
                     String txt = textStr.substring(textStr.indexOf("1"));
-                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
                         System.out.println(txt);
                         eVisaConfigList.add(txt);
                     }
@@ -146,7 +146,7 @@ public class PDFUtils {
                             txt=txt.substring(0,i);
                         }
                     }
-                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
                         eVisaConfigList.add(txt);
                     }
                 }
@@ -157,7 +157,7 @@ public class PDFUtils {
                             txt=txt.substring(0,i);
                         }
                     }
-                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
                         eVisaConfigList.add(txt);
                     }
                 }
@@ -165,7 +165,7 @@ public class PDFUtils {
                 // 特殊处理
                 if(textStr.indexOf("1")>=0){
                     String txt = textStr.substring(textStr.indexOf("1"));
-                    if (txt.length() >= 15 && Func.isNumeric(txt)) {
+                    if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
                         System.out.println(txt);
                         eVisaConfigList.add(txt);
                     }