|
@@ -511,11 +511,27 @@ public class EVDataServiceImpl implements EVDataService {
|
|
|
String[] strArray = Func.toStrArray(task.getUserId());
|
|
|
String[] userNames = Func.toStrArray(task.getNickName());
|
|
|
List<Map<String, Object>> maps = new ArrayList<>();
|
|
|
+ String[] split = ids.split(",");
|
|
|
+ StringBuilder dqIds = new StringBuilder();
|
|
|
+ StringBuilder signIds = new StringBuilder();
|
|
|
+ for (String id : split) {
|
|
|
+ if (id != null && id.contains("✹")) {
|
|
|
+ signIds.append(id.substring(1)).append( ",");
|
|
|
+ } else {
|
|
|
+ dqIds.append(id).append( ",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (dqIds.length()>0) {
|
|
|
+ dqIds.deleteCharAt(dqIds.length()-1);
|
|
|
+ }
|
|
|
+ if (signIds.length()>0) {
|
|
|
+ signIds.deleteCharAt(signIds.length()-1);
|
|
|
+ }
|
|
|
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 (" + ids + ") 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 ";
|
|
|
+ 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(" + ids + ")";
|
|
|
+ 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);
|
|
@@ -543,6 +559,25 @@ public class EVDataServiceImpl implements EVDataService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if (signIds.length() > 0 && task.getSigType() != 2) {
|
|
|
+ String sql = "SELECT * from ( SELECT a.conf_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_sign_config_relation a where a.type = 1 and a.is_deleted = 0 and a.conf_id in (" + signIds + ") " +
|
|
|
+ "and a.relation_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 ";
|
|
|
+ List<Map<String, Object>> maps3 = jdbcTemplate.queryForList(sql);
|
|
|
+ System.out.println("东方中讯--签字--key =" + sql);
|
|
|
+ if (!maps3.isEmpty()) {
|
|
|
+ Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
|
|
|
+ .collect(Collectors.groupingBy(hada -> (Func.toStr(hada.get("keyWord")))));
|
|
|
+ for (String keyId : peopleByAge.keySet()) {
|
|
|
+ List<Map<String, Object>> keyList = peopleByAge.get(keyId);
|
|
|
+ if (keyList != null && !keyList.isEmpty()) {
|
|
|
+ Map<String, Object> map = keyList.get(0);
|
|
|
+ map.put("keyWord", "✹" + map.get("keyWord"));
|
|
|
+ maps.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return maps;
|
|
@@ -555,19 +590,33 @@ public class EVDataServiceImpl implements EVDataService {
|
|
|
String[] userNames = Func.toStrArray(task.getNickName());
|
|
|
List<SealStrategyVO> sealStrategyVOS = new ArrayList<>();
|
|
|
|
|
|
-
|
|
|
+ String[] split = ids.split(",");
|
|
|
+ StringBuilder dqIds = new StringBuilder();
|
|
|
+ StringBuilder signIds = new StringBuilder();
|
|
|
+ for (String id : split) {
|
|
|
+ if (id != null && id.contains("✹")) {
|
|
|
+ signIds.append(id.substring(1)).append( ",");
|
|
|
+ } else {
|
|
|
+ dqIds.append(id).append( ",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (dqIds.length()>0) {
|
|
|
+ dqIds.deleteCharAt(dqIds.length()-1);
|
|
|
+ }
|
|
|
+ if (signIds.length()>0) {
|
|
|
+ signIds.deleteCharAt(signIds.length()-1);
|
|
|
+ }
|
|
|
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 (" + ids + ") 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 ";
|
|
|
+ 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(" + ids + ") ";
|
|
|
+ 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 = 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()
|
|
@@ -576,22 +625,42 @@ public class EVDataServiceImpl implements EVDataService {
|
|
|
for (String keyId : peopleByAge.keySet()) {
|
|
|
int exId = 0;
|
|
|
List<Map<String, Object>> keyList = peopleByAge.get(keyId);
|
|
|
- if (keyList != null && keyList.size() == 1) {
|
|
|
+ if (keyList != null && keyList.size() == 1 && keyList.get(0).get("signature_file_url") != null) {
|
|
|
maps.addAll(keyList);
|
|
|
exId = 1;
|
|
|
} else if (keyList != null && keyList.size() >= 2) {
|
|
|
for (Map<String, Object> datax : keyList) {
|
|
|
- if ((datax.get("project_id") + "").equals(task.getProjectId())) {
|
|
|
+ if ((datax.get("project_id") + "").equals(task.getProjectId()) && datax.get("signature_file_url") != null) {
|
|
|
maps.add(datax);
|
|
|
exId = 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (exId == 0) {
|
|
|
+ if (exId == 0 && keyList != null) {
|
|
|
maps.add(keyList.get(0));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if (signIds.length() > 0 && task.getSigType() != 2) {
|
|
|
+ String sql = "SELECT * from ( SELECT DISTINCT a.conf_id as id,0.0 as pyzbx ,0.0 as pyzby,(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_sign_config_relation a where a.type = 1 and a.is_deleted = 0 and a.conf_id in (" + signIds + ") and a.relation_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 ";
|
|
|
+ List<Map<String, Object>> maps3 = jdbcTemplate.queryForList(sql);
|
|
|
+ System.out.println("安心签--签章--key =" + sql);
|
|
|
+ if (!maps3.isEmpty()) {
|
|
|
+ Map<String, List<Map<String, Object>>> peopleByAges = maps3.stream()
|
|
|
+ .collect(Collectors.groupingBy(hada -> (Func.toStr(hada.get("id")))));
|
|
|
+ for (String keyId : peopleByAges.keySet()) {
|
|
|
+ List<Map<String, Object>> keyList = peopleByAges.get(keyId);
|
|
|
+ if (keyList != null && !keyList.isEmpty()) {
|
|
|
+ Map<String, Object> map = keyList.get(0);
|
|
|
+ map.put("id", "✹" + map.get("id"));
|
|
|
+ maps.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (maps == null || maps.size() <= 0) {
|
|
|
break;
|
|
|
}
|