|
@@ -34,7 +34,7 @@ public class ScrDataServiceImpl implements ScrDataService {
|
|
|
@Override
|
|
|
public void sctTaskBatch(ScrSignInfoVO taskApp) throws Exception {
|
|
|
// 电签检查
|
|
|
- this.sctTaskBatch2(taskApp);
|
|
|
+ this.sctTaskBatch3(taskApp);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -242,8 +242,6 @@ public class ScrDataServiceImpl implements ScrDataService {
|
|
|
total = Func.toInt(map.get("total"));
|
|
|
pCount = Func.toInt(map.get("pCount"));
|
|
|
}
|
|
|
- Object o = map.get("initiative");
|
|
|
- Object o1 = map.get("status");
|
|
|
if((map.get("initiative")+"").equals("2") && (map.get("status")+"").equals("2")){
|
|
|
strArray.add(map.get("task_user").toString());
|
|
|
}
|
|
@@ -273,12 +271,7 @@ public class ScrDataServiceImpl implements ScrDataService {
|
|
|
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.get(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.get(i) + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
|
|
|
- if (total==pCount) {
|
|
|
- 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);
|
|
|
- }
|
|
|
+ System.out.println("东方中讯--签字--" + sqlinfo);
|
|
|
maps2 = jdbcTemplate.queryForList(sqlinfo);
|
|
|
}
|
|
|
if(CollectionUtil.isNotEmpty(maps2)) {
|
|
@@ -303,25 +296,34 @@ public class ScrDataServiceImpl implements ScrDataService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- /* if (signIds.length() > 0 && task.getSigType() != 2) {
|
|
|
- String sql = "SELECT * from ( SELECT a.conf_id as keyWord,0.0 as pyzbx ,0.0 as 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);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ String 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);
|
|
|
+ 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")))));
|
|
|
+ for (String keyId : peopleByAge.keySet()) {
|
|
|
+ int exId = 0;
|
|
|
+ List<Map<String, Object>> keyList = peopleByAge.get(keyId);
|
|
|
+ if (keyList != null && keyList.size() == 1) {
|
|
|
+ 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())) {
|
|
|
+ maps.add(datax);
|
|
|
+ exId = 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }*/
|
|
|
+ if (exId == 0) {
|
|
|
+ maps.add(keyList.get(0));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return maps;
|
|
@@ -583,7 +585,7 @@ public class ScrDataServiceImpl implements ScrDataService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ Map<String, String> dataUserMap = new HashMap<>(dataMap);
|
|
|
boolean isSign = true;
|
|
|
//判断章是否签完
|
|
|
List<String> companList = strategyListByDFZX.stream().filter(item -> item.get("type").equals("2")).map(map -> map.get("keyWord").toString()).collect(Collectors.toList());
|
|
@@ -601,23 +603,45 @@ public class ScrDataServiceImpl implements ScrDataService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- boolean isSign1 = true;
|
|
|
- //判断个人是否签完
|
|
|
- List<String> userList = strategyListByDFZX.stream().filter(item -> item.get("type").equals("1")).map(map -> map.get("keyWord").toString()).collect(Collectors.toList());
|
|
|
- if (!userList.isEmpty()) {
|
|
|
- Set<String> differentElements = new HashSet<>(userList);
|
|
|
- sucessUser.forEach(differentElements::remove);
|
|
|
- if (!differentElements.isEmpty()) {
|
|
|
- isSign1 = false;
|
|
|
- StringBuilder sb = new StringBuilder();
|
|
|
- sb.append("id = ").append(taskApp.getId()).append(", 人总共:").append(userList.size()).append(", 剩下:").append(differentElements.size());
|
|
|
- for (String element : differentElements) {
|
|
|
- sb.append(", ").append(element);
|
|
|
+// boolean isSign1 = true;
|
|
|
+// //判断个人是否签完
|
|
|
+// List<String> userList = strategyListByDFZX.stream().filter(item -> item.get("type").equals("1")).map(map -> map.get("keyWord").toString()).collect(Collectors.toList());
|
|
|
+// if (!userList.isEmpty()) {
|
|
|
+// Set<String> differentElements = new HashSet<>(userList);
|
|
|
+// sucessUser.forEach(differentElements::remove);
|
|
|
+// if (!differentElements.isEmpty()) {
|
|
|
+// isSign1 = false;
|
|
|
+// StringBuilder sb = new StringBuilder();
|
|
|
+// sb.append("id = ").append(taskApp.getId()).append(", 人总共:").append(userList.size()).append(", 剩下:").append(differentElements.size());
|
|
|
+// for (String element : differentElements) {
|
|
|
+// sb.append(", ").append(element);
|
|
|
+// }
|
|
|
+// System.err.println(sb);
|
|
|
+// }
|
|
|
+// }
|
|
|
+ if(!sucessUser.isEmpty() && isSign){
|
|
|
+ for(String user:sucessUser){
|
|
|
+ for(String mapkey:dataMap.keySet()){
|
|
|
+ String mapval = dataMap.get(mapkey);
|
|
|
+ if(mapval.contains(user)){
|
|
|
+ dataUserMap.remove(mapkey) ;
|
|
|
+ }
|
|
|
}
|
|
|
- System.err.println(sb);
|
|
|
}
|
|
|
+ for(String company:sucessCompan){
|
|
|
+ for(String mapkey:dataMap.keySet()){
|
|
|
+ String mapval = dataMap.get(mapkey);
|
|
|
+ if(mapval != null && (mapval.equals(company) || mapval.equals(company+"\r"))){
|
|
|
+ dataUserMap.remove(mapkey) ;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!dataUserMap.isEmpty()){
|
|
|
+ isSign = false ;
|
|
|
+ }
|
|
|
+ System.out.println(taskApp.getId() +"-"+"个人总共:" + sucessUser.size() + "-剩下-" +dataUserMap.keySet().size());
|
|
|
}
|
|
|
- if (isSign && isSign1) {
|
|
|
+ if (isSign ) {
|
|
|
String sql2 = "UPDATE u_information_query set chek_status=2 where id='" + taskApp.getId() + "'";
|
|
|
jdbcTemplate.execute(sql2);
|
|
|
} else {
|