|
@@ -504,11 +504,11 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
pdfVO.setStrategyVoList(sealStrategyVOS);
|
|
|
|
|
|
//获取字节
|
|
|
- URL url =new URL(pdfUrl);
|
|
|
+ URL url = new URL(pdfUrl);
|
|
|
byte[] fileByte;
|
|
|
try {
|
|
|
fileByte = IOUtils.toByteArray(url);
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -541,7 +541,7 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
//释放锁
|
|
|
// DistributedRedisLock.release(task.getUserId().toString());
|
|
|
|
|
|
- System.out.println("bladeFile---eVisa"+task.getFormDataId()+"--"+resultMessage);
|
|
|
+ System.out.println("bladeFile---eVisa" + task.getFormDataId() + "--" + resultMessage);
|
|
|
return resultMessage;
|
|
|
}
|
|
|
|
|
@@ -552,7 +552,7 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
*/
|
|
|
public String eVisaCustom(org.springblade.evisa.vo.TaskArchiveDTO taskArchiveDTO) {
|
|
|
//type=1表示任务审批自定义签章,type=2表示认证电签签章(不涉及审批任务)
|
|
|
- if (taskArchiveDTO.getSealStrategy()!=null && taskArchiveDTO.getSealStrategy().size() > 0 && taskArchiveDTO.getType() == 1) {
|
|
|
+ if (taskArchiveDTO.getSealStrategy() != null && taskArchiveDTO.getSealStrategy().size() > 0 && taskArchiveDTO.getType() == 1) {
|
|
|
//获取档案任务
|
|
|
Task task = jdbcTemplate.queryForObject("select form_data_id from u_task where id = " + taskArchiveDTO.getTaskId(), new BeanPropertyRowMapper<>(Task.class));
|
|
|
if (task != null) {
|
|
@@ -621,7 +621,7 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
}
|
|
|
}
|
|
|
return "";
|
|
|
- } else if (taskArchiveDTO.getSealStrategy()!=null && taskArchiveDTO.getSealStrategy().size() > 0 && taskArchiveDTO.getType() == 2) {
|
|
|
+ } else if (taskArchiveDTO.getSealStrategy() != null && taskArchiveDTO.getSealStrategy().size() > 0 && taskArchiveDTO.getType() == 2) {
|
|
|
//此时的taskArchiveDTO.taskId=档案数据业务id(档案认证不涉及审批流任务)
|
|
|
//获取档案任务的文件信息(这里根据id再查询一次,入参的时候不想重新构造入参的dto了)
|
|
|
ArchiveFile archiveFile = jdbcTemplate.queryForObject("select pdf_file_url,e_visa_file from u_archive_file where id = " + taskArchiveDTO.getTaskId(), new BeanPropertyRowMapper<>(ArchiveFile.class));
|
|
@@ -784,7 +784,7 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
*/
|
|
|
private Object[] signPdfByAXQZ(SealPdfVO pdfVO, byte[] fileByte) {
|
|
|
Object[] result = new Object[3];
|
|
|
- try {
|
|
|
+ try {
|
|
|
PaperlessClient paperlessClient = new PaperlessClient(SIGN_HOST, SIGN_PORT, 300000, 1800000);
|
|
|
paperlessClient.setSSL(false);
|
|
|
//*****************************************************************************
|
|
@@ -834,11 +834,11 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
|
|
|
compoundSealPdfListDetachedRequest.setBody(requestBody);
|
|
|
//****************************** 请求服务端进行签章 *********************************************
|
|
|
- System.out.println("-----------------------"+new Date().toString()+"开始"+transactionNo +"----------------------------");
|
|
|
+ System.out.println("-----------------------" + new Date().toString() + "开始" + transactionNo + "----------------------------");
|
|
|
|
|
|
ResponseDto responseDto = paperlessClient.execute(compoundSealPdfListDetachedRequest);
|
|
|
|
|
|
- System.out.println("-----------------------"+new Date().toString()+"结束"+transactionNo +"----------------------------");
|
|
|
+ System.out.println("-----------------------" + new Date().toString() + "结束" + transactionNo + "----------------------------");
|
|
|
//******************************解析响应结果 *********************************************
|
|
|
CompoundSealPdfListDetachedResponse compoundSealPdfListDetachedResponse = (CompoundSealPdfListDetachedResponse) responseDto;
|
|
|
ResponseHead responseHead = compoundSealPdfListDetachedResponse.getHead();
|
|
@@ -856,9 +856,9 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
result[1] = compoundSealPdfListDetachedResponse.toString();
|
|
|
result[2] = responseHead.getMessage();
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -1142,8 +1142,18 @@ public class EVisaServiceImpl implements EVisaService {
|
|
|
Rectangle page = reader.getPageSize(Integer.parseInt(vo.getPage()));
|
|
|
float x1 = page.getWidth() / 100 * Float.parseFloat(vo.getLx()) + 3;
|
|
|
float y1 = page.getHeight() / 100 * Float.parseFloat(vo.getLy());
|
|
|
- String x2 = String.valueOf(x1).substring(0, String.valueOf(x1).indexOf("."));
|
|
|
- String y2 = String.valueOf(y1).substring(0, String.valueOf(y1).indexOf("."));
|
|
|
+ String x2;
|
|
|
+ if (String.valueOf(x1).contains(".")) {
|
|
|
+ x2 = String.valueOf(x1).substring(0, String.valueOf(x1).indexOf("."));
|
|
|
+ } else {
|
|
|
+ x2 = String.valueOf(x1);
|
|
|
+ }
|
|
|
+ String y2;
|
|
|
+ if (String.valueOf(x1).contains(".")) {
|
|
|
+ y2 = String.valueOf(y1).substring(0, String.valueOf(y1).indexOf("."));
|
|
|
+ } else {
|
|
|
+ y2 = String.valueOf(y1);
|
|
|
+ }
|
|
|
sealStrategy.setSignWithCoordinate(vo.getPage(), x2, y2);
|
|
|
}
|
|
|
}
|