|
@@ -83,8 +83,6 @@ public class EVDataServiceImpl implements EVDataService {
|
|
|
|
|
|
String fileUrl = CommonUtil.replaceOssUrl(taskApp.getSignPdfUrl());
|
|
String fileUrl = CommonUtil.replaceOssUrl(taskApp.getSignPdfUrl());
|
|
List<String> eVisaConfigList = PDFUtils.getPdfSignIds(fileUrl, taskApp);
|
|
List<String> eVisaConfigList = PDFUtils.getPdfSignIds(fileUrl, taskApp);
|
|
- String ids = String.join(",", eVisaConfigList);
|
|
|
|
-
|
|
|
|
if (eVisaConfigList == null || eVisaConfigList.size() == 0) {
|
|
if (eVisaConfigList == null || eVisaConfigList.size() == 0) {
|
|
//没有电签配置,默认当前任务为不签字审批,返回成功
|
|
//没有电签配置,默认当前任务为不签字审批,返回成功
|
|
taskApp.setSigState(2);
|
|
taskApp.setSigState(2);
|
|
@@ -92,7 +90,8 @@ public class EVDataServiceImpl implements EVDataService {
|
|
SignBackPdfInfo(taskApp);
|
|
SignBackPdfInfo(taskApp);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // 获取pdf上的电签Ids
|
|
|
|
+ String ids = String.join(",", eVisaConfigList);
|
|
if (taskApp.getRemarkType().equals("1")) { //安心签
|
|
if (taskApp.getRemarkType().equals("1")) { //安心签
|
|
//添加电签策略
|
|
//添加电签策略
|
|
List<SealStrategyVO> strategyListByAXQ = getStrategyListByAXQ(taskApp, ids);
|
|
List<SealStrategyVO> strategyListByAXQ = getStrategyListByAXQ(taskApp, ids);
|
|
@@ -112,6 +111,7 @@ public class EVDataServiceImpl implements EVDataService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
SignBackPdfInfo(taskApp);
|
|
SignBackPdfInfo(taskApp);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
//调用签字逻辑
|
|
//调用签字逻辑
|
|
@@ -128,7 +128,7 @@ public class EVDataServiceImpl implements EVDataService {
|
|
//添加电签策略
|
|
//添加电签策略
|
|
List<Map<String, Object>> strategyListByDFZX = getStrategyListByDFZX(taskApp, ids);
|
|
List<Map<String, Object>> strategyListByDFZX = getStrategyListByDFZX(taskApp, ids);
|
|
//调用签字逻辑
|
|
//调用签字逻辑
|
|
- String s = signTaskBatchByDFZX(strategyListByDFZX, fileUrl);
|
|
|
|
|
|
+ String s = signTaskBatchByDFZX(strategyListByDFZX, fileUrl,taskApp.getSigType());
|
|
if (s.contains("sucess")) {
|
|
if (s.contains("sucess")) {
|
|
taskApp.setLastFilePdfUrl(s.split("@@@@")[1]);
|
|
taskApp.setLastFilePdfUrl(s.split("@@@@")[1]);
|
|
taskApp.setSigState(1);
|
|
taskApp.setSigState(1);
|
|
@@ -210,14 +210,14 @@ public class EVDataServiceImpl implements EVDataService {
|
|
String pdfTrialUrlPosition = "";
|
|
String pdfTrialUrlPosition = "";
|
|
if ("2".equals(taskApp.getPdfDataType())) {
|
|
if ("2".equals(taskApp.getPdfDataType())) {
|
|
String taskStatus = "";
|
|
String taskStatus = "";
|
|
- if (taskApp.getSigState() == 1) {
|
|
|
|
|
|
+ if (taskApp.getSigState() == 1 && taskApp.getSigType()==1) {
|
|
taskStatus = "待审批";
|
|
taskStatus = "待审批";
|
|
- } else if (taskApp.getSigState() == 2) {
|
|
|
|
|
|
+ } else if (taskApp.getSigState() == 1 && taskApp.getSigType()==2) {
|
|
taskStatus = "已审批";
|
|
taskStatus = "已审批";
|
|
} else if (taskApp.getSigState() == 3) {
|
|
} else if (taskApp.getSigState() == 3) {
|
|
taskStatus = "已废除";
|
|
taskStatus = "已废除";
|
|
}
|
|
}
|
|
- String updTrial = "update u_trial_self_inspection_record set task_status='" + taskStatus + "',pdf_url='" + taskApp.getLastFilePdfUrl() + "' where id=(select b.trial_self_inspection_record_id from u_task b,u_task_parallel c where b.process_instance_id=c.process_instance_id and b.is_deleted=0 and c.is_deleted=0 and b.status in(1,2) and parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "')";
|
|
|
|
|
|
+ String updTrial = "update u_trial_self_inspection_record set status="+taskApp.getSigType()+", task_status='" + taskStatus + "',pdf_url='" + taskApp.getLastFilePdfUrl() + "' where id=(select b.trial_self_inspection_record_id from u_task b,u_task_parallel c where b.process_instance_id=c.process_instance_id and b.is_deleted=0 and c.is_deleted=0 and b.status in(1,2) and parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "')";
|
|
jdbcTemplate.execute(updTrial);
|
|
jdbcTemplate.execute(updTrial);
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -292,11 +292,8 @@ public class EVDataServiceImpl implements EVDataService {
|
|
this.jdbcTemplate.execute(updateSql);
|
|
this.jdbcTemplate.execute(updateSql);
|
|
this.jdbcTemplate.execute("update u_task_parallel set e_visa_status=1,e_visa_content='" + taskApp.getSignSmg() + "' , status=2 , initiative=2 ,update_time=SYSDATE() where parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "'");
|
|
this.jdbcTemplate.execute("update u_task_parallel set e_visa_status=1,e_visa_content='" + taskApp.getSignSmg() + "' , status=2 , initiative=2 ,update_time=SYSDATE() where parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "'");
|
|
this.jdbcTemplate.execute("update u_task set status=" + taskApp.getSigType() + " ,update_time=SYSDATE() where id='" + taskApp.getTaskId() + "'");
|
|
this.jdbcTemplate.execute("update u_task set status=" + taskApp.getSigType() + " ,update_time=SYSDATE() where id='" + taskApp.getTaskId() + "'");
|
|
- if (taskApp.getSigType() == 2) {
|
|
|
|
- this.jdbcTemplate.execute("delete from u_task_batch where JSON_EXTRACT(json_data, '$.taskId')=" + taskApp.getTaskId());
|
|
|
|
- } else {
|
|
|
|
- this.jdbcTemplate.execute("delete from u_task_batch where id=" + taskApp.getId());
|
|
|
|
- }
|
|
|
|
|
|
+ this.jdbcTemplate.execute("delete from u_task_batch where id=" + taskApp.getId());
|
|
|
|
+
|
|
} else { //签字失败
|
|
} else { //签字失败
|
|
this.jdbcTemplate.execute("update u_task_parallel set exe_count=(exe_count+1), e_visa_status=99,e_visa_content='" + taskApp.getSignSmg() + "' ,update_time=SYSDATE() where parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "'");
|
|
this.jdbcTemplate.execute("update u_task_parallel set exe_count=(exe_count+1), e_visa_status=99,e_visa_content='" + taskApp.getSignSmg() + "' ,update_time=SYSDATE() where parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "'");
|
|
this.jdbcTemplate.execute("update u_task set status=1 ,update_time=SYSDATE() where id='" + taskApp.getTaskId() + "'");
|
|
this.jdbcTemplate.execute("update u_task set status=1 ,update_time=SYSDATE() where id='" + taskApp.getTaskId() + "'");
|
|
@@ -353,7 +350,7 @@ public class EVDataServiceImpl implements EVDataService {
|
|
} else if ("3".equals(type)) {
|
|
} else if ("3".equals(type)) {
|
|
//首件,首件的资料由三个部分组成:封面、关联资料、总结报告
|
|
//首件,首件的资料由三个部分组成:封面、关联资料、总结报告
|
|
if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
|
|
if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
|
|
- String url = StringUtils.isNotEmpty(eVisaPdfUrl) ? eVisaPdfUrl : pdfUrl;
|
|
|
|
|
|
+ String url = eVisaPdfUrl.length()>=10 ? eVisaPdfUrl : pdfUrl;
|
|
String s = getHppsToHttp(url);
|
|
String s = getHppsToHttp(url);
|
|
taskApp.setSignPdfUrl(s);
|
|
taskApp.setSignPdfUrl(s);
|
|
}
|
|
}
|
|
@@ -364,7 +361,7 @@ public class EVDataServiceImpl implements EVDataService {
|
|
String eVisaPdfUrl = map.get("pdf_file_url") + ""; //签字的PDF路径
|
|
String eVisaPdfUrl = map.get("pdf_file_url") + ""; //签字的PDF路径
|
|
String pdfUrl = map.get("file_url") + ""; //合并后的PDF路径
|
|
String pdfUrl = map.get("file_url") + ""; //合并后的PDF路径
|
|
if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
|
|
if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
|
|
- String url = StringUtils.isNotEmpty(eVisaPdfUrl) ? eVisaPdfUrl : pdfUrl;
|
|
|
|
|
|
+ String url = eVisaPdfUrl.length()>=10 ? eVisaPdfUrl : pdfUrl;
|
|
taskApp.setSignPdfUrl(url);
|
|
taskApp.setSignPdfUrl(url);
|
|
}
|
|
}
|
|
} else if (taskApp.getApprovalType() == 3) {
|
|
} else if (taskApp.getApprovalType() == 3) {
|
|
@@ -372,7 +369,7 @@ public class EVDataServiceImpl implements EVDataService {
|
|
String eVisaPdfUrl = map.get("e_visa_pdf_url") + ""; //签字的PDF路径
|
|
String eVisaPdfUrl = map.get("e_visa_pdf_url") + ""; //签字的PDF路径
|
|
String pdfUrl = map.get("pdf_url") + ""; //合并后的PDF路径
|
|
String pdfUrl = map.get("pdf_url") + ""; //合并后的PDF路径
|
|
if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
|
|
if (StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
|
|
- String url = StringUtils.isNotEmpty(eVisaPdfUrl) ? eVisaPdfUrl : pdfUrl;
|
|
|
|
|
|
+ String url = eVisaPdfUrl.length()>=10 ? eVisaPdfUrl : pdfUrl;
|
|
taskApp.setSignPdfUrl(url);
|
|
taskApp.setSignPdfUrl(url);
|
|
}
|
|
}
|
|
} else if (taskApp.getApprovalType() == 4) { //档案走自定义 搓章的问题
|
|
} else if (taskApp.getApprovalType() == 4) { //档案走自定义 搓章的问题
|
|
@@ -435,13 +432,16 @@ public class EVDataServiceImpl implements EVDataService {
|
|
|
|
|
|
String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + task.getUserId() + "' 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=" + task.getUserId() + " 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='" + task.getUserId() + "' 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=" + task.getUserId() + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
|
|
if (task.getSigType() == 2) {
|
|
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 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(" + ids + ")";
|
|
|
|
+ System.out.println("东方中讯--签章--"+sqlinfo);
|
|
|
|
+ }else{
|
|
|
|
+ System.out.println("东方中讯--签字--"+sqlinfo);
|
|
}
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
|
|
List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
|
|
List<Map<String, Object>> maps = new ArrayList<>();
|
|
List<Map<String, Object>> maps = new ArrayList<>();
|
|
Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
|
|
Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
|
|
- .collect(Collectors.groupingBy(hada -> (Func.toStr(hada.get("id")))));
|
|
|
|
|
|
+ .collect(Collectors.groupingBy(hada -> (Func.toStr(hada.get("keyWord")))));
|
|
|
|
|
|
for (String keyId : peopleByAge.keySet()) {
|
|
for (String keyId : peopleByAge.keySet()) {
|
|
int exId = 0;
|
|
int exId = 0;
|
|
@@ -470,9 +470,10 @@ public class EVDataServiceImpl implements EVDataService {
|
|
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='" + task.getUserId() + "' and is_deleted=0 ) as signature_file_url 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=" + task.getUserId() + " 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='" + task.getUserId() + "' and is_deleted=0 ) as signature_file_url 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=" + task.getUserId() + " and c.is_deleted=0 ) ) x where x.signature_file_url is not null ";
|
|
if (task.getSigType() == 2) {
|
|
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 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 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 + ")";
|
|
- System.out.println("签字Sql=" + sqlinfo);
|
|
|
|
|
|
+ System.out.println("安心签--签章--=" + sqlinfo);
|
|
|
|
+ }else{
|
|
|
|
+ System.out.println("安心签--签字--=" + sqlinfo);
|
|
}
|
|
}
|
|
-
|
|
|
|
List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
|
|
List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
|
|
if (maps2 == null && maps2.size() <= 0) {
|
|
if (maps2 == null && maps2.size() <= 0) {
|
|
return sealStrategyVOS;
|
|
return sealStrategyVOS;
|
|
@@ -542,7 +543,7 @@ public class EVDataServiceImpl implements EVDataService {
|
|
}
|
|
}
|
|
|
|
|
|
// 添加电签策略 -- 东方中讯
|
|
// 添加电签策略 -- 东方中讯
|
|
- public String signTaskBatchByDFZX(List<Map<String, Object>> maps, String pdfUrl) {
|
|
|
|
|
|
+ public String signTaskBatchByDFZX(List<Map<String, Object>> maps, String pdfUrl,int type) {
|
|
if (maps != null && maps.size() > 0) {
|
|
if (maps != null && maps.size() > 0) {
|
|
String fileUrl = pdfUrl;
|
|
String fileUrl = pdfUrl;
|
|
for (Map<String, Object> dataMap : maps) {
|
|
for (Map<String, Object> dataMap : maps) {
|
|
@@ -550,8 +551,10 @@ public class EVDataServiceImpl implements EVDataService {
|
|
daMa.put("keyWord", dataMap.get("keyWord"));
|
|
daMa.put("keyWord", dataMap.get("keyWord"));
|
|
daMa.put("sealId", dataMap.get("sealId"));
|
|
daMa.put("sealId", dataMap.get("sealId"));
|
|
// 设置图片显示大小
|
|
// 设置图片显示大小
|
|
- daMa.put("showHeight", 30);
|
|
|
|
- daMa.put("showWidth", 60);
|
|
|
|
|
|
+ if(type!=2){ //章
|
|
|
|
+ daMa.put("showHeight", 30);
|
|
|
|
+ daMa.put("showWidth", 60);
|
|
|
|
+ }
|
|
//设置显示签字体的位置
|
|
//设置显示签字体的位置
|
|
String yzx = dataMap.get("pyzby") + "";
|
|
String yzx = dataMap.get("pyzby") + "";
|
|
String xzx = dataMap.get("pyzbx") + "";
|
|
String xzx = dataMap.get("pyzbx") + "";
|
|
@@ -592,7 +595,6 @@ public class EVDataServiceImpl implements EVDataService {
|
|
BladeFile bladeFile = this.newIOSSClient.uploadFile(fileUrl.substring(fileUrl.lastIndexOf("/") + 1, fileUrl.length()), fileUrl);
|
|
BladeFile bladeFile = this.newIOSSClient.uploadFile(fileUrl.substring(fileUrl.lastIndexOf("/") + 1, fileUrl.length()), fileUrl);
|
|
if (bladeFile != null) {
|
|
if (bladeFile != null) {
|
|
System.out.println("pdf上传=" + bladeFile.getLink());
|
|
System.out.println("pdf上传=" + bladeFile.getLink());
|
|
-
|
|
|
|
return "sucess@@@@" + bladeFile.getLink();
|
|
return "sucess@@@@" + bladeFile.getLink();
|
|
} else {
|
|
} else {
|
|
return "电签成功";
|
|
return "电签成功";
|
|
@@ -692,6 +694,7 @@ public class EVDataServiceImpl implements EVDataService {
|
|
taskApp.setSigState(2);
|
|
taskApp.setSigState(2);
|
|
taskApp.setSignSmg("上传OSS失败" + fileUrl);
|
|
taskApp.setSignSmg("上传OSS失败" + fileUrl);
|
|
SignBackPdfInfo(taskApp);
|
|
SignBackPdfInfo(taskApp);
|
|
|
|
+ System.out.println("上传OSS失败");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -699,7 +702,7 @@ public class EVDataServiceImpl implements EVDataService {
|
|
|
|
|
|
public String getHppsToHttp(String url) {
|
|
public String getHppsToHttp(String url) {
|
|
String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
|
|
String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
|
|
- if (url.contains("https:") && sys_isonline.equals("20")) {
|
|
|
|
|
|
+ if (Func.isNotEmpty(sys_isonline) &&url.contains("https:") && sys_isonline.equals("20")) {
|
|
return url.replace("https:", "http:");
|
|
return url.replace("https:", "http:");
|
|
}
|
|
}
|
|
return url;
|
|
return url;
|