10.12开发
This commit is contained in:
@@ -158,6 +158,16 @@ public class SealSignRecord extends BaseEntity {
|
|||||||
private double positionXorg;
|
private double positionXorg;
|
||||||
/** 印章位置y坐标 */
|
/** 印章位置y坐标 */
|
||||||
private double positionYorg;
|
private double positionYorg;
|
||||||
|
/** 案件申请id */
|
||||||
|
private Long caseAppliId;
|
||||||
|
|
||||||
|
public Long getCaseAppliId() {
|
||||||
|
return caseAppliId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseAppliId(Long caseAppliId) {
|
||||||
|
this.caseAppliId = caseAppliId;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ public class SaaSAPIFileUtils {
|
|||||||
/**
|
/**
|
||||||
* 下载已签署文件及附属材料
|
* 下载已签署文件及附属材料
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static EsignHttpResponse fileDownloadUrl(String signFlowId) throws EsignDemoException {
|
public static EsignHttpResponse fileDownloadUrl(String signFlowId) throws EsignDemoException {
|
||||||
String apiaddr = "/v3/sign-flow/"+ signFlowId +"/file-download-url";
|
String apiaddr = "/v3/sign-flow/"+ signFlowId +"/file-download-url";
|
||||||
//请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null
|
//请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.ruoyi.wisdomarbitrate.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.bean.SealSignRecord;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SealSignRecordMapper {
|
||||||
|
int insertSealSignRecord(SealSignRecord SealSignRecord);
|
||||||
|
}
|
||||||
+90
-3
@@ -4,14 +4,22 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
import com.ruoyi.common.annotation.DataScope;
|
import com.ruoyi.common.annotation.DataScope;
|
||||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.exception.EsignDemoException;
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
|
import com.ruoyi.common.utils.SignAward;
|
||||||
|
import com.ruoyi.common.utils.bean.SealSignRecord;
|
||||||
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||||
|
import com.ruoyi.system.mapper.SysUserMapper;
|
||||||
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.SmsUtils;
|
import com.ruoyi.common.utils.SmsUtils;
|
||||||
@@ -55,6 +63,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
private SysDeptMapper sysDeptMapper;
|
private SysDeptMapper sysDeptMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ICaseApplicationService caseApplicationService;
|
private ICaseApplicationService caseApplicationService;
|
||||||
|
@Autowired
|
||||||
|
private SysUserMapper sysUserMapper;
|
||||||
|
@Autowired
|
||||||
|
private SealSignRecordMapper sealSignRecordMapper;
|
||||||
|
|
||||||
// 手机号正则
|
// 手机号正则
|
||||||
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
||||||
@@ -707,7 +719,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
for (CaseAttach caseAttach : caseAttachList) {
|
for (CaseAttach caseAttach : caseAttachList) {
|
||||||
if (caseAttach.getAnnexType() == 3) {
|
if (caseAttach.getAnnexType() == 3) {
|
||||||
String annexPath = caseAttach.getAnnexPath();
|
String annexPath = caseAttach.getAnnexPath();
|
||||||
String path = "/home/ruoyi/" + annexPath;
|
//String path = "/home/ruoyi/" + annexPath;
|
||||||
|
String path ="D:\\home\\仲裁裁决书模板.docx";
|
||||||
//获取文件上传地址
|
//获取文件上传地址
|
||||||
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
||||||
String body = response.getBody();
|
String body = response.getBody();
|
||||||
@@ -723,14 +736,88 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
||||||
JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
|
JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
|
||||||
int fileStatus = jsonObject2.getJSONObject("data").getIntValue("fileStatus");
|
JSONObject data = jsonObject2.getJSONObject("data");
|
||||||
|
int fileStatus =data.getIntValue("fileStatus");
|
||||||
if (fileStatus == 2 || fileStatus == 5){
|
if (fileStatus == 2 || fileStatus == 5){
|
||||||
//上传成功,发起签署流程
|
String fileName = data.getString("fileName");
|
||||||
|
//上传成功,获取文件签名印章位置
|
||||||
|
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||||
|
sealSignRecord.setFileid(fileId);
|
||||||
|
EsignHttpResponse positions = SignAward.getPositions(sealSignRecord);
|
||||||
|
Gson gson = new Gson();
|
||||||
|
JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
|
||||||
|
JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
|
||||||
|
String keywordPositions = positionsData.get("keywordPositions").getAsString();
|
||||||
|
//发起签署
|
||||||
|
sealSignRecord.setFilename(fileName);
|
||||||
|
String arbitratorId = caseApplication2.getArbitratorId();
|
||||||
|
if (arbitratorId!=null){
|
||||||
|
SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId));
|
||||||
|
if (sysUser == null){
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
sealSignRecord.setPensonAccount(sysUser.getPhonenumber());
|
||||||
|
sealSignRecord.setPensonName(sysUser.getNickName());
|
||||||
|
}
|
||||||
|
sealSignRecord.setOrgnizeName("西安云美电子科技有限公司");
|
||||||
|
sealSignRecord.setOrgnizeNamePsnAccount("秦桃则");
|
||||||
|
sealSignRecord.setOrgnizeName("西安云美电子科技有限公司");
|
||||||
|
sealSignRecord.setOrgnizeNamePsnAccount("17691338406");
|
||||||
|
sealSignRecord.setOrgnizeNamepsnName("韩超勃");
|
||||||
|
//解析文件签名印章位置
|
||||||
|
JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
|
||||||
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
|
JSONObject jsonObject3 = jsonArray.getJSONObject(i);
|
||||||
|
String keyword = jsonObject3.getString("keyword");
|
||||||
|
if (keyword.equals("仲裁员")){
|
||||||
|
//签名
|
||||||
|
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
||||||
|
// 遍历 positionsArray 中的每个元素
|
||||||
|
for (int j = 0; j < positionsArray.size(); j++){
|
||||||
|
JSONObject positionObj = positionsArray.getJSONObject(j);
|
||||||
|
int pageNum = positionObj.getIntValue("pageNum");
|
||||||
|
sealSignRecord.setPositionPagepsn(String.valueOf(pageNum));
|
||||||
|
JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
||||||
|
JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
||||||
|
double positionX = coordinateObj.getDoubleValue("positionX");
|
||||||
|
double positionY = coordinateObj.getDoubleValue("positionY");
|
||||||
|
sealSignRecord.setPositionXpsn(positionX);
|
||||||
|
sealSignRecord.setPositionYpsn(positionY);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
//用印
|
||||||
|
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
||||||
|
// 遍历 positionsArray 中的每个元素
|
||||||
|
for (int j = 0; j < positionsArray.size(); j++) {
|
||||||
|
JSONObject positionObj = positionsArray.getJSONObject(j);
|
||||||
|
int pageNum = positionObj.getIntValue("pageNum");
|
||||||
|
sealSignRecord.setPositionPageorg(String.valueOf(pageNum));
|
||||||
|
JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
||||||
|
JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
||||||
|
double positionX = coordinateObj.getDoubleValue("positionX");
|
||||||
|
double positionY = coordinateObj.getDoubleValue("positionY");
|
||||||
|
sealSignRecord.setPositionXorg(positionX);
|
||||||
|
sealSignRecord.setPositionYorg(positionY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord);
|
||||||
|
JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
|
||||||
|
if (jsonObject1.getIntValue("code")==0){
|
||||||
|
//获取签署流程ID
|
||||||
|
JSONObject data1 = jsonObject3.getJSONObject("data");
|
||||||
|
String signFlowId = data1.getString("signFlowId");
|
||||||
//保存案件id,文件id,文件名称.流程id到签署用印记录表里
|
//保存案件id,文件id,文件名称.流程id到签署用印记录表里
|
||||||
|
sealSignRecord.setCaseAppliId(caseApplication.getId());
|
||||||
|
sealSignRecord.setSignFlowid(signFlowId);
|
||||||
|
sealSignRecord.setSignFlowStatus(1);//待签名
|
||||||
|
sealSignRecordMapper.insertSealSignRecord(sealSignRecord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (EsignDemoException e) {
|
} catch (EsignDemoException e) {
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper">
|
||||||
|
<insert id="insertSealSignRecord" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
INSERT INTO seal_sign_record (file_id, file_name, sign_flow_id , penson_account
|
||||||
|
,penson_name,orgnize_name,org_name_psn_acc,org_name_psn_name,position_page_psn
|
||||||
|
,position_xpsn,position_ypsn,position_pageorg,position_xorg,position_yorg,case_appli_id
|
||||||
|
,sign_flow_status)
|
||||||
|
VALUES (#{fileid}, #{filename}, #{signFlowid},#{pensonAccount},#{pensonName},#{orgnizeName}
|
||||||
|
,#{orgnizeNamePsnAccount},#{orgnizeNamepsnName},#{positionPagepsn},#{positionXpsn},#{positionYpsn}
|
||||||
|
,#{positionPageorg},#{positionXorg},#{positionYorg},#{caseAppliId},#{signFlowStatus})
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user