|
@@ -238,7 +238,7 @@ public class EVisaServiceImpl implements EVisaService {
|
|
String ids = String.join(",", eVisaConfigList);
|
|
String ids = String.join(",", eVisaConfigList);
|
|
String sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,b.certificate_password,b.certificate_user_name from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + contractId + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
|
|
String sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,b.certificate_password,b.certificate_user_name from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + contractId + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
|
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList(sqlinfo);
|
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList(sqlinfo);
|
|
- System.out.println("合同-"+contractId+"--"+sqlinfo);
|
|
|
|
|
|
+ System.out.println("合同-" + contractId + "--" + sqlinfo);
|
|
|
|
|
|
//准备签章策略
|
|
//准备签章策略
|
|
List<SealStrategyVO> sealStrategyVOS = new ArrayList<>();
|
|
List<SealStrategyVO> sealStrategyVOS = new ArrayList<>();
|
|
@@ -246,15 +246,15 @@ public class EVisaServiceImpl implements EVisaService {
|
|
//设置签章策略
|
|
//设置签章策略
|
|
SealStrategyVO vo = new SealStrategyVO();
|
|
SealStrategyVO vo = new SealStrategyVO();
|
|
vo.setSealCode(EVisaConstant.SIGN_SEAL_CODE + eVisaConfig.get("sfId"));
|
|
vo.setSealCode(EVisaConstant.SIGN_SEAL_CODE + eVisaConfig.get("sfId"));
|
|
- vo.setSealPassword(eVisaConfig.get("certificate_password")+"");
|
|
|
|
- vo.setSealPerson(eVisaConfig.get("certificate_user_name")+"" + System.currentTimeMillis());
|
|
|
|
|
|
+ vo.setSealPassword(eVisaConfig.get("certificate_password") + "");
|
|
|
|
+ vo.setSealPerson(eVisaConfig.get("certificate_user_name") + "" + System.currentTimeMillis());
|
|
//设置签字文件
|
|
//设置签字文件
|
|
- vo.setImageUrl(eVisaConfig.get("signature_file_url")+"");
|
|
|
|
|
|
+ vo.setImageUrl(eVisaConfig.get("signature_file_url") + "");
|
|
vo.setSealType("3");
|
|
vo.setSealType("3");
|
|
vo.setCompanySeal(true);
|
|
vo.setCompanySeal(true);
|
|
- vo.setKeyword(eVisaConfig.get("id")+"");
|
|
|
|
- vo.setOffSetX(eVisaConfig.get("pyzbx")+"");
|
|
|
|
- vo.setOffSetY(eVisaConfig.get("pyzby")+"");
|
|
|
|
|
|
+ vo.setKeyword(eVisaConfig.get("id") + "");
|
|
|
|
+ vo.setOffSetX(eVisaConfig.get("pyzbx") + "");
|
|
|
|
+ vo.setOffSetY(eVisaConfig.get("pyzby") + "");
|
|
sealStrategyVOS.add(vo);
|
|
sealStrategyVOS.add(vo);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -425,7 +425,7 @@ public class EVisaServiceImpl implements EVisaService {
|
|
String ids = String.join(",", eVisaConfigList);
|
|
String ids = String.join(",", eVisaConfigList);
|
|
String sqlinfo = " SELECT a.id,a.pyzbx ,a.pyzby,(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=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 )";
|
|
String sqlinfo = " SELECT a.id,a.pyzbx ,a.pyzby,(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=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 )";
|
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList(sqlinfo);
|
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList(sqlinfo);
|
|
- System.out.println("个人-user-id"+task.getUserId()+"--SQL="+sqlinfo);
|
|
|
|
|
|
+ System.out.println("个人-user-id" + task.getUserId() + "--SQL=" + sqlinfo);
|
|
if (maps == null || maps.size() <= 0) {
|
|
if (maps == null || maps.size() <= 0) {
|
|
//没有签章,不执行电签
|
|
//没有签章,不执行电签
|
|
RedisTemplate.delete("sign-" + task.getFormDataId());
|
|
RedisTemplate.delete("sign-" + task.getFormDataId());
|
|
@@ -539,13 +539,13 @@ public class EVisaServiceImpl implements EVisaService {
|
|
//返回结果集
|
|
//返回结果集
|
|
if (result != null) {
|
|
if (result != null) {
|
|
if (result[0] != null) {
|
|
if (result[0] != null) {
|
|
- byte[] byteArray = IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0]));
|
|
|
|
-
|
|
|
|
|
|
+ //byte[] byteArray = IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0]));
|
|
/*String dataUrl = "C:\\pdfFiles\\" + SnowFlakeUtil.getId() + ".pdf";
|
|
/*String dataUrl = "C:\\pdfFiles\\" + SnowFlakeUtil.getId() + ".pdf";
|
|
File file1 = new File(dataUrl);
|
|
File file1 = new File(dataUrl);
|
|
FileUtils.writeByteArrayToFile(file1, byteArray);*/
|
|
FileUtils.writeByteArrayToFile(file1, byteArray);*/
|
|
|
|
|
|
- BladeFile bladeFile = this.newIOSSClient.updateFile(byteArray, SnowFlakeUtil.getId() + ".pdf");
|
|
|
|
|
|
+ MultipartFile newFiles = new MockMultipartFile("file", SnowFlakeUtil.getId() + ".pdf", "text/plain", IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0])));
|
|
|
|
+ BladeFile bladeFile = this.newIOSSClient.uploadFileByInputStream(newFiles);
|
|
if (bladeFile != null) {
|
|
if (bladeFile != null) {
|
|
//更新最新的电签pdfUrl
|
|
//更新最新的电签pdfUrl
|
|
jdbcTemplate.execute("update u_archive_file set e_visa_file = '" + bladeFile.getLink() + "' where id = " + task.getFormDataId());
|
|
jdbcTemplate.execute("update u_archive_file set e_visa_file = '" + bladeFile.getLink() + "' where id = " + task.getFormDataId());
|
|
@@ -608,13 +608,13 @@ public class EVisaServiceImpl implements EVisaService {
|
|
//返回结果集
|
|
//返回结果集
|
|
if (result != null) {
|
|
if (result != null) {
|
|
if (result[0] != null) {
|
|
if (result[0] != null) {
|
|
- byte[] byteArray = IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0]));
|
|
|
|
-
|
|
|
|
|
|
+ //byte[] byteArray = IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0]));
|
|
/*String dataUrl = "C:\\pdfFiles\\" + SnowFlakeUtil.getId() + ".pdf";
|
|
/*String dataUrl = "C:\\pdfFiles\\" + SnowFlakeUtil.getId() + ".pdf";
|
|
File file1 = new File(dataUrl);
|
|
File file1 = new File(dataUrl);
|
|
FileUtils.writeByteArrayToFile(file1, byteArray);*/
|
|
FileUtils.writeByteArrayToFile(file1, byteArray);*/
|
|
|
|
|
|
- BladeFile bladeFile = this.newIOSSClient.updateFile(byteArray, SnowFlakeUtil.getId() + ".pdf");
|
|
|
|
|
|
+ MultipartFile newFiles = new MockMultipartFile("file", SnowFlakeUtil.getId() + ".pdf", "text/plain", IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0])));
|
|
|
|
+ BladeFile bladeFile = this.newIOSSClient.uploadFileByInputStream(newFiles);
|
|
if (bladeFile != null) {
|
|
if (bladeFile != null) {
|
|
//更新最新的认证电签pdfUrl
|
|
//更新最新的认证电签pdfUrl
|
|
jdbcTemplate.execute("update u_archive_file set is_certification = 1,e_visa_file = '" + bladeFile.getLink() + "',certification_time = '" + DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss") + "' where id = " + taskArchiveDTO.getTaskId());
|
|
jdbcTemplate.execute("update u_archive_file set is_certification = 1,e_visa_file = '" + bladeFile.getLink() + "',certification_time = '" + DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss") + "' where id = " + taskArchiveDTO.getTaskId());
|