Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into bgy
This commit is contained in:
@@ -0,0 +1,235 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
public class SealSignRecord extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
/** 文件id */
|
||||
private String fileid;
|
||||
/** 文件名称 */
|
||||
private String filename;
|
||||
/** 流程id */
|
||||
private String signFlowid;
|
||||
/** 签名人账户 */
|
||||
private String pensonAccount;
|
||||
/** 签名人姓名 */
|
||||
private String pensonName;
|
||||
/** 机构名称 */
|
||||
private String orgnizeName;
|
||||
/** 机构经办人 */
|
||||
private String orgnizeNamePsnAccount;
|
||||
/** 机构经办人名称 */
|
||||
private String orgnizeNamepsnName;
|
||||
|
||||
String fileDownloadUrl;
|
||||
|
||||
public String getFileDownloadUrl() {
|
||||
return fileDownloadUrl;
|
||||
}
|
||||
|
||||
public void setFileDownloadUrl(String fileDownloadUrl) {
|
||||
this.fileDownloadUrl = fileDownloadUrl;
|
||||
}
|
||||
|
||||
/** 流程状态 */
|
||||
private Integer signFlowStatus;
|
||||
/** 签名状态 */
|
||||
private Integer psnsignStatus;
|
||||
/** 用印状态 */
|
||||
private Integer orgsignStatus;
|
||||
|
||||
/** 签名链接 */
|
||||
private String signUrl;
|
||||
|
||||
public String getSignUrl() {
|
||||
return signUrl;
|
||||
}
|
||||
|
||||
public void setSignUrl(String signUrl) {
|
||||
this.signUrl = signUrl;
|
||||
}
|
||||
|
||||
public String getSealUrl() {
|
||||
return sealUrl;
|
||||
}
|
||||
|
||||
public void setSealUrl(String sealUrl) {
|
||||
this.sealUrl = sealUrl;
|
||||
}
|
||||
|
||||
/** 用印链接 */
|
||||
private String sealUrl;
|
||||
|
||||
private Long caseAppliId;
|
||||
|
||||
public Long getCaseAppliId() {
|
||||
return caseAppliId;
|
||||
}
|
||||
|
||||
public void setCaseAppliId(Long caseAppliId) {
|
||||
this.caseAppliId = caseAppliId;
|
||||
}
|
||||
|
||||
public Integer getPsnsignStatus() {
|
||||
return psnsignStatus;
|
||||
}
|
||||
|
||||
public void setPsnsignStatus(Integer psnsignStatus) {
|
||||
this.psnsignStatus = psnsignStatus;
|
||||
}
|
||||
|
||||
public Integer getOrgsignStatus() {
|
||||
return orgsignStatus;
|
||||
}
|
||||
|
||||
public void setOrgsignStatus(Integer orgsignStatus) {
|
||||
this.orgsignStatus = orgsignStatus;
|
||||
}
|
||||
|
||||
public Integer getSignFlowStatus() {
|
||||
return signFlowStatus;
|
||||
}
|
||||
|
||||
public void setSignFlowStatus(Integer signFlowStatus) {
|
||||
this.signFlowStatus = signFlowStatus;
|
||||
}
|
||||
|
||||
public String getFileid() {
|
||||
return fileid;
|
||||
}
|
||||
|
||||
public void setFileid(String fileid) {
|
||||
this.fileid = fileid;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
public void setFilename(String filename) {
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
public String getSignFlowid() {
|
||||
return signFlowid;
|
||||
}
|
||||
|
||||
public void setSignFlowid(String signFlowid) {
|
||||
this.signFlowid = signFlowid;
|
||||
}
|
||||
|
||||
public String getPensonAccount() {
|
||||
return pensonAccount;
|
||||
}
|
||||
|
||||
public void setPensonAccount(String pensonAccount) {
|
||||
this.pensonAccount = pensonAccount;
|
||||
}
|
||||
|
||||
public String getPensonName() {
|
||||
return pensonName;
|
||||
}
|
||||
|
||||
public void setPensonName(String pensonName) {
|
||||
this.pensonName = pensonName;
|
||||
}
|
||||
|
||||
public String getOrgnizeName() {
|
||||
return orgnizeName;
|
||||
}
|
||||
|
||||
public void setOrgnizeName(String orgnizeName) {
|
||||
this.orgnizeName = orgnizeName;
|
||||
}
|
||||
|
||||
public String getOrgnizeNamePsnAccount() {
|
||||
return orgnizeNamePsnAccount;
|
||||
}
|
||||
|
||||
public void setOrgnizeNamePsnAccount(String orgnizeNamePsnAccount) {
|
||||
this.orgnizeNamePsnAccount = orgnizeNamePsnAccount;
|
||||
}
|
||||
|
||||
public String getOrgnizeNamepsnName() {
|
||||
return orgnizeNamepsnName;
|
||||
}
|
||||
|
||||
public void setOrgnizeNamepsnName(String orgnizeNamepsnName) {
|
||||
this.orgnizeNamepsnName = orgnizeNamepsnName;
|
||||
}
|
||||
|
||||
public String getPositionPagepsn() {
|
||||
return positionPagepsn;
|
||||
}
|
||||
|
||||
public void setPositionPagepsn(String positionPagepsn) {
|
||||
this.positionPagepsn = positionPagepsn;
|
||||
}
|
||||
|
||||
public double getPositionXpsn() {
|
||||
return positionXpsn;
|
||||
}
|
||||
|
||||
public void setPositionXpsn(double positionXpsn) {
|
||||
this.positionXpsn = positionXpsn;
|
||||
}
|
||||
|
||||
public double getPositionYpsn() {
|
||||
return positionYpsn;
|
||||
}
|
||||
|
||||
public void setPositionYpsn(double positionYpsn) {
|
||||
this.positionYpsn = positionYpsn;
|
||||
}
|
||||
|
||||
public String getPositionPageorg() {
|
||||
return positionPageorg;
|
||||
}
|
||||
|
||||
public void setPositionPageorg(String positionPageorg) {
|
||||
this.positionPageorg = positionPageorg;
|
||||
}
|
||||
|
||||
public double getPositionXorg() {
|
||||
return positionXorg;
|
||||
}
|
||||
|
||||
public void setPositionXorg(double positionXorg) {
|
||||
this.positionXorg = positionXorg;
|
||||
}
|
||||
|
||||
public double getPositionYorg() {
|
||||
return positionYorg;
|
||||
}
|
||||
|
||||
public void setPositionYorg(double positionYorg) {
|
||||
this.positionYorg = positionYorg;
|
||||
}
|
||||
|
||||
/** 签名位置页数 */
|
||||
private String positionPagepsn;
|
||||
/** 签名位置x坐标 */
|
||||
private double positionXpsn;
|
||||
/** 签名位置y坐标 */
|
||||
private double positionYpsn;
|
||||
/** 印章位置页数 */
|
||||
private String positionPageorg;
|
||||
/** 印章位置x坐标 */
|
||||
private double positionXorg;
|
||||
/** 印章位置y坐标 */
|
||||
private double positionYorg;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+13
-5
@@ -1,10 +1,18 @@
|
||||
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
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SealSignRecordMapper {
|
||||
int insertSealSignRecord(SealSignRecord SealSignRecord);
|
||||
List<SealSignRecord> selectSealSignRecord(SealSignRecord sealSignRecord);
|
||||
|
||||
List<SealSignRecord> selectSealSignRecordbyStat(SealSignRecord sealSignRecord);
|
||||
|
||||
int updataSealSignRecord(SealSignRecord sealSignRecord);
|
||||
|
||||
|
||||
void insertSealSignRecord(SealSignRecord sealSignRecord);
|
||||
}
|
||||
|
||||
+6
@@ -1,6 +1,8 @@
|
||||
package com.ruoyi.wisdomarbitrate.service;
|
||||
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -40,4 +42,8 @@ public interface ICaseApplicationService {
|
||||
CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication);
|
||||
|
||||
String sendRoomNoMessage(SendRoomNoMessageVO messageVO);
|
||||
|
||||
SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException;
|
||||
|
||||
SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException;
|
||||
}
|
||||
|
||||
+17
-14
@@ -188,9 +188,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
if (caseAttach.getAnnexType() == 3) {
|
||||
String annexPath = caseAttach.getAnnexPath();
|
||||
//File file = new File("/home/ruoyi/" + annexPath);
|
||||
String path = "/home/ruoyi/" + annexPath;
|
||||
File file = new File(path);
|
||||
System.out.println("文件是:" + file);
|
||||
String path = "/home/ruoyi" + annexPath;
|
||||
System.out.println("原文件路径是:" + path);
|
||||
String newpath = path.replace("/", "\\");
|
||||
System.out.println("新文件路径是:" + newpath);
|
||||
File file = new File(newpath);
|
||||
System.out.println("新文件是:" + file);
|
||||
fileList.add(file);
|
||||
}
|
||||
}
|
||||
@@ -424,21 +427,21 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
return AjaxResult.success(archivesDetailVO);
|
||||
}
|
||||
|
||||
/*public static void main(String[] args) {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
List<File> fileList = new ArrayList<>();
|
||||
fileList.add(new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx"));
|
||||
File file = fileList.get(0);
|
||||
// List<File> fileList = new ArrayList<>();
|
||||
// fileList.add(new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx"));
|
||||
// File file = fileList.get(0);//System.out.println("这是文件"+file);
|
||||
//电子邮件送达
|
||||
EmailOutUtil emailOutUtil = new EmailOutUtil();
|
||||
JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender();
|
||||
if (javaMailSender != null) {
|
||||
emailOutUtil.sendMessageCarryFile("1154956315@qq.com", "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
|
||||
, "hjbjava@163.com", javaMailSender);
|
||||
}
|
||||
// EmailOutUtil emailOutUtil = new EmailOutUtil();
|
||||
// JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender();
|
||||
// if (javaMailSender != null) {
|
||||
// emailOutUtil.sendMessageCarryFile("1154956315@qq.com", "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
|
||||
// , "hjbjava@163.com", javaMailSender);
|
||||
// }
|
||||
} catch (MailSendException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
+114
-115
@@ -716,121 +716,120 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
|
||||
Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck();
|
||||
if(agreeOrNotCheck.intValue()==1){//同意审核
|
||||
//TODO 取消一下注释
|
||||
// try {
|
||||
// //获取当前案件的裁决书
|
||||
// CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication);
|
||||
// List<CaseAttach> caseAttachList = caseApplication2.getCaseAttachList();
|
||||
// if (caseAttachList != null && caseAttachList.size() > 0) {
|
||||
// for (CaseAttach caseAttach : caseAttachList) {
|
||||
// if (caseAttach.getAnnexType() == 3) {
|
||||
// String annexPath = caseAttach.getAnnexPath();
|
||||
// String path = "/home/ruoyi/" + annexPath;
|
||||
//// String path ="D:\\home\\仲裁裁决书模板.docx";
|
||||
// //获取文件上传地址
|
||||
// EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
||||
// String body = response.getBody();
|
||||
// if (body != null){
|
||||
// JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
// String fileId = jsonObject.getJSONObject("data").getString("fileId");
|
||||
// String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
|
||||
// //上传文件流
|
||||
// EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
|
||||
// JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
|
||||
// if (jsonObject1.getIntValue("errCode")==0){
|
||||
// //查看文件上传状态
|
||||
// Thread.sleep(5000);
|
||||
// EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
||||
// JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
|
||||
// JSONObject data = jsonObject2.getJSONObject("data");
|
||||
// int fileStatus =data.getIntValue("fileStatus");
|
||||
// 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到签署用印记录表里
|
||||
// sealSignRecord.setCaseAppliId(caseApplication.getId());
|
||||
// sealSignRecord.setSignFlowid(signFlowId);
|
||||
// sealSignRecord.setSignFlowStatus(1);//待签名
|
||||
// sealSignRecordMapper.insertSealSignRecord(sealSignRecord);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } catch (EsignDemoException e) {
|
||||
// e.printStackTrace();
|
||||
// } catch (InterruptedException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
try {
|
||||
//获取当前案件的裁决书
|
||||
CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication);
|
||||
List<CaseAttach> caseAttachList = caseApplication2.getCaseAttachList();
|
||||
if (caseAttachList != null && caseAttachList.size() > 0) {
|
||||
for (CaseAttach caseAttach : caseAttachList) {
|
||||
if (caseAttach.getAnnexType() == 3) {
|
||||
String annexPath = caseAttach.getAnnexPath();
|
||||
String path = "/home/ruoyi/" + annexPath;
|
||||
// String path ="D:\\home\\仲裁裁决书模板.docx";
|
||||
//获取文件上传地址
|
||||
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
||||
String body = response.getBody();
|
||||
if (body != null){
|
||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
String fileId = jsonObject.getJSONObject("data").getString("fileId");
|
||||
String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
|
||||
//上传文件流
|
||||
EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
|
||||
JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
|
||||
if (jsonObject1.getIntValue("errCode")==0){
|
||||
//查看文件上传状态
|
||||
Thread.sleep(5000);
|
||||
EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
||||
JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
|
||||
JSONObject data = jsonObject2.getJSONObject("data");
|
||||
int fileStatus =data.getIntValue("fileStatus");
|
||||
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到签署用印记录表里
|
||||
sealSignRecord.setCaseAppliId(caseApplication.getId());
|
||||
sealSignRecord.setSignFlowid(signFlowId);
|
||||
sealSignRecord.setSignFlowStatus(1);//待签名
|
||||
sealSignRecordMapper.insertSealSignRecord(sealSignRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (EsignDemoException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION);
|
||||
// 新增日志
|
||||
CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.SIGN_ARBITRATION,"");
|
||||
|
||||
+75
-32
@@ -6,65 +6,108 @@ import com.google.gson.JsonObject;
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.common.utils.SignAward;
|
||||
import com.ruoyi.common.utils.bean.SealSignRecord;
|
||||
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class FixSelectFlowDetailUtils {
|
||||
|
||||
@Autowired
|
||||
private CaseApplicationMapper caseApplicationMapper;
|
||||
@Autowired
|
||||
private SealSignRecordMapper sealSignRecordMapper;
|
||||
|
||||
|
||||
@Scheduled(cron = "0/3 * * * * ?")
|
||||
public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException {
|
||||
|
||||
Gson gson = new Gson();
|
||||
|
||||
SealSignRecord sealSignRecordselect = new SealSignRecord();
|
||||
// sealSignRecordselect.setSignFlowStatus(1);
|
||||
List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat(sealSignRecordselect);
|
||||
if(sealSignRecords!=null&&sealSignRecords.size()>0){
|
||||
for (int i = 0; i < sealSignRecords.size(); i++) {
|
||||
SealSignRecord sealSignRecord = sealSignRecords.get(i);
|
||||
EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
|
||||
JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
|
||||
JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
||||
JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
||||
Integer psnsignStatus = null;
|
||||
Integer orgsignStatus = null;
|
||||
for (int j = 0; j < signersArray.size(); j++) {
|
||||
JsonObject signerObject = (JsonObject)signersArray.get(j);
|
||||
|
||||
if(!(signerObject.get("psnSigner").toString()).equals("null")){
|
||||
JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
|
||||
if(psnSignerData!=null){
|
||||
psnsignStatus = signerObject.get("signStatus").getAsInt();
|
||||
}
|
||||
}
|
||||
if(!(signerObject.get("orgSigner").toString()).equals("null")){
|
||||
JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
||||
if(orgSignerData!=null){
|
||||
orgsignStatus = signerObject.get("signStatus").getAsInt();
|
||||
}
|
||||
}
|
||||
|
||||
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||
sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d");
|
||||
EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
|
||||
JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
|
||||
JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
||||
JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
||||
for (int i = 0; i < signersArray.size(); i++) {
|
||||
JsonObject signerObject = (JsonObject)signersArray.get(i);
|
||||
Integer psnsignStatus ;
|
||||
Integer orgsignStatus ;
|
||||
if(!(signerObject.get("psnSigner").toString()).equals("null")){
|
||||
JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
|
||||
if(psnSignerData!=null){
|
||||
psnsignStatus = signerObject.get("signStatus").getAsInt();
|
||||
sealSignRecord.setPsnsignStatus(psnsignStatus);
|
||||
}
|
||||
if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==1)){
|
||||
//更新立案申请状态为待用印
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(sealSignRecord.getCaseAppliId());
|
||||
|
||||
if(psnsignStatus.intValue()==2){
|
||||
//更新立案申请状态为待用印
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
if(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.SIGN_ARBITRATION){
|
||||
caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
|
||||
caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
|
||||
|
||||
|
||||
//修改"签署用印记录表"的状态为待用印
|
||||
sealSignRecord.setSignFlowStatus(2);
|
||||
sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if(!(signerObject.get("orgSigner").toString()).equals("null")){
|
||||
JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
||||
if(orgSignerData!=null){
|
||||
orgsignStatus = signerObject.get("signStatus").getAsInt();
|
||||
sealSignRecord.setOrgsignStatus(orgsignStatus);
|
||||
}
|
||||
if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==2)){
|
||||
//更新立案申请状态为待送达
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(sealSignRecord.getCaseAppliId());
|
||||
|
||||
CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
if(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.ARBITRATED_SEAL){
|
||||
caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
|
||||
caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
|
||||
//下载审核完成的裁决书,
|
||||
String signFlowId = sealSignRecord.getSignFlowid();
|
||||
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
||||
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class);
|
||||
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
||||
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
||||
if(filesArray!=null&&filesArray.size()>0){
|
||||
JsonObject fileObject = (JsonObject)filesArray.get(0);
|
||||
String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
||||
//修改"签署用印记录表"的状态为签署完成
|
||||
sealSignRecord.setSignFlowStatus(3);
|
||||
sealSignRecord.setFileDownloadUrl(fileDownloadUrl);
|
||||
sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,326 @@
|
||||
package com.ruoyi.wisdomarbitrate.utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||
import com.ruoyi.common.enums.EsignRequestType;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.common.utils.EsignApplicaConfig;
|
||||
import com.ruoyi.common.utils.EsignHttpHelper;
|
||||
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class SignAward {
|
||||
|
||||
private static String eSignHost= EsignApplicaConfig.EsignHost;
|
||||
private static String eSignAppId= EsignApplicaConfig.EsignAppId;
|
||||
private static String eSignAppSecret= EsignApplicaConfig.EsignAppSecret;
|
||||
// public static String fileId = "95d0c307d91e4985bdb8874f6f84daa5";
|
||||
public static String fileId = "a0c2ad21065f48ff8b872412c39d5d3a";
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) throws EsignDemoException {
|
||||
Gson gson = new Gson();
|
||||
|
||||
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||
|
||||
|
||||
/* 发起签署*/
|
||||
// EsignHttpResponse createByFile = createByFile(sealSignRecord);
|
||||
// JsonObject createByFileJsonObject = gson.fromJson(createByFile.getBody(), JsonObject.class);
|
||||
// JsonObject createByFileData = createByFileJsonObject.getAsJsonObject("data");
|
||||
// String signFlowId = createByFileData.get("signFlowId").getAsString();
|
||||
// System.err.println("流程id:"+signFlowId);
|
||||
|
||||
/* 获取文件签名印章位置*/
|
||||
// EsignHttpResponse positions = getPositions(sealSignRecord);
|
||||
// JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
|
||||
// JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
|
||||
// JsonArray keywordPositions = positionsData.get("keywordPositions").getAsJsonArray();
|
||||
// System.out.println("获取文件签名印章位置:" +keywordPositions.toString());
|
||||
|
||||
// String signFlowId = "c9955453716344f9971d308abdc13464";
|
||||
//获取合同文件签名链接
|
||||
// EsignHttpResponse signUrl = signUrl(sealSignRecord);
|
||||
// JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
||||
// JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
||||
// String shortUrl = signUrlData.get("shortUrl").getAsString();
|
||||
// String url = signUrlData.get("url").getAsString();
|
||||
// System.out.println("签署短链接:" +shortUrl);
|
||||
// System.out.println("签署长链接:"+url);
|
||||
|
||||
//获取合同文件用印链接
|
||||
// EsignHttpResponse usesealUrl = usesealUrl(sealSignRecord);
|
||||
// JsonObject usesealUrlJsonObject = gson.fromJson(usesealUrl.getBody(), JsonObject.class);
|
||||
// JsonObject usesealUrlData = usesealUrlJsonObject.getAsJsonObject("data");
|
||||
// String shortusesealUrl = usesealUrlData.get("shortUrl").getAsString();
|
||||
// String sealUrl = usesealUrlData.get("url").getAsString();
|
||||
// System.out.println("签署长链接:" +shortusesealUrl);
|
||||
// System.out.println("签署短链接:"+sealUrl);
|
||||
|
||||
//查询签署流程详情
|
||||
EsignHttpResponse signFlowDetail = signFlowDetail(sealSignRecord);
|
||||
JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
|
||||
JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
||||
JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
||||
for (int i = 0; i < signersArray.size(); i++) {
|
||||
JsonObject signerObject = (JsonObject)signersArray.get(i);
|
||||
Integer psnsignStatus ;
|
||||
Integer orgsignStatus ;
|
||||
if(!(signerObject.get("psnSigner").toString()).equals("null")){
|
||||
JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
|
||||
if(psnSignerData!=null){
|
||||
psnsignStatus = signerObject.get("signStatus").getAsInt();
|
||||
sealSignRecord.setPsnsignStatus(psnsignStatus);
|
||||
}
|
||||
}
|
||||
if(!(signerObject.get("orgSigner").toString()).equals("null")){
|
||||
JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
||||
if(orgSignerData!=null){
|
||||
orgsignStatus = signerObject.get("signStatus").getAsInt();
|
||||
sealSignRecord.setOrgsignStatus(orgsignStatus);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println(signFlowDetailJsonObject);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询签署流程详情
|
||||
* @return
|
||||
*/
|
||||
public static EsignHttpResponse signFlowDetail(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||
String signFlowId = sealSignRecord.getSignFlowid();
|
||||
String apiaddr= "/v3/sign-flow/"+ signFlowId + "/detail";
|
||||
String jsonParm = null;
|
||||
//请求方法
|
||||
EsignRequestType requestType = EsignRequestType.GET;
|
||||
//生成签名鉴权方式的的header
|
||||
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发起签署
|
||||
* @return
|
||||
* @throws EsignDemoException
|
||||
*/
|
||||
public static EsignHttpResponse createByFile(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||
String apiaddr = "/v3/sign-flow/create-by-file";
|
||||
|
||||
String fileId = sealSignRecord.getFileid();
|
||||
String fileName = sealSignRecord.getFilename();
|
||||
|
||||
String psnAccount = sealSignRecord.getPensonAccount();
|
||||
String psnName = sealSignRecord.getPensonName();
|
||||
|
||||
String orgName = sealSignRecord.getOrgnizeName();
|
||||
String orgNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount();
|
||||
String orgNamepsnName = sealSignRecord.getOrgnizeNamepsnName();
|
||||
|
||||
String positionPagepsn = sealSignRecord.getPositionPagepsn();
|
||||
double positionXpsn = sealSignRecord.getPositionXpsn();
|
||||
double positionYpsn = sealSignRecord.getPositionYpsn();
|
||||
|
||||
String positionPageorg = sealSignRecord.getPositionPageorg();
|
||||
double positionXorg = sealSignRecord.getPositionXorg();
|
||||
double positionYorg = sealSignRecord.getPositionYorg();
|
||||
|
||||
String jsonParm = "{\n" +
|
||||
" \"docs\": [\n" +
|
||||
" {\n" +
|
||||
" \"fileId\": \"" + fileId + "\",\n" +
|
||||
" \"fileName\": \"" + fileName + "\"\n" +
|
||||
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"signFlowConfig\": {\n" +
|
||||
" \"signFlowTitle\": \"测试合同\",\n" +
|
||||
" \"autoStart\": true,\n" +
|
||||
" \"authConfig\": {\n" +
|
||||
" \"willingnessAuthModes\": [\n" +
|
||||
" \"CODE_SMS\"\n" +
|
||||
" ],\n" +
|
||||
" \"psnAvailableAuthModes\": [\n" +
|
||||
" \"PSN_MOBILE3\"\n" +
|
||||
" ],\n" +
|
||||
" \"orgAvailableAuthModes\": [\n" +
|
||||
" \"ORG_LEGALREP\"\n" +
|
||||
" ]\n" +
|
||||
" },\n" +
|
||||
" \"autoFinish\": true\n" +
|
||||
" },\n" +
|
||||
|
||||
" \"signers\": [\n" +
|
||||
|
||||
" {\n" +
|
||||
|
||||
" \"psnSignerInfo\": {\n" +
|
||||
" \"psnAccount\": \"" + psnAccount + "\",\n" +
|
||||
|
||||
" \"psnInfo\": {\n" +
|
||||
" \"psnName\": \"" + psnName + "\"\n" +
|
||||
" }\n" +
|
||||
|
||||
" },\n" +
|
||||
" \"signFields\": [\n" +
|
||||
" {\n" +
|
||||
|
||||
" \"fileId\": \"" + fileId + "\",\n" +
|
||||
|
||||
" \"normalSignFieldConfig\": {\n" +
|
||||
" \"autoSign\": false,\n" +
|
||||
" \"freeMode\": false,\n" +
|
||||
" \"movableSignField\": false,\n" +
|
||||
" \"signFieldPosition\": {\n" +
|
||||
" \"positionPage\": \"" + positionPagepsn + "\",\n" +
|
||||
" \"positionX\": " + positionXpsn + ",\n" +
|
||||
" \"positionY\": " + positionYpsn + "\n" +
|
||||
" },\n" +
|
||||
" \"signFieldStyle\": 1\n" +
|
||||
" },\n" +
|
||||
" \"signFieldType\": 0\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"signerType\": 0\n" +
|
||||
" },\n" +
|
||||
|
||||
|
||||
" {\n" +
|
||||
" \"orgSignerInfo\": {\n" +
|
||||
" \"orgName\": \"" + orgName + "\",\n" +
|
||||
" \"transactorInfo\": {\n" +
|
||||
" \"psnAccount\": \"" + orgNamePsnAccount + "\",\n" +
|
||||
|
||||
" \"psnInfo\": {\n" +
|
||||
|
||||
" \"psnName\": \"" + orgNamepsnName + "\"\n" +
|
||||
" }\n" +
|
||||
|
||||
" }\n" +
|
||||
" },\n" +
|
||||
|
||||
" \"signFields\": [\n" +
|
||||
" {\n" +
|
||||
" \"fileId\": \"" + fileId + "\",\n" +
|
||||
|
||||
" \"normalSignFieldConfig\": {\n" +
|
||||
" \"autoSign\": false,\n" +
|
||||
" \"freeMode\": false,\n" +
|
||||
|
||||
" \"signFieldPosition\": {\n" +
|
||||
|
||||
" \"positionPage\": \"" + positionPageorg + "\",\n" +
|
||||
" \"positionX\": " + positionXorg + ",\n" +
|
||||
" \"positionY\": " + positionYorg + "\n" +
|
||||
" },\n" +
|
||||
" \"signFieldStyle\": 1\n" +
|
||||
" },\n" +
|
||||
" \"signFieldType\": 0\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"signerType\": 1\n" +
|
||||
" }\n" +
|
||||
|
||||
" ]\n" +
|
||||
"}";
|
||||
|
||||
//请求方法
|
||||
EsignRequestType requestType = EsignRequestType.POST;
|
||||
//生成请求签名鉴权方式的Header
|
||||
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取合同文件签名链接
|
||||
* @return
|
||||
* @throws EsignDemoException
|
||||
*/
|
||||
public static EsignHttpResponse signUrl(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||
|
||||
String signFlowId = sealSignRecord.getSignFlowid();
|
||||
String psnAccount = sealSignRecord.getPensonAccount();
|
||||
|
||||
String apiaddr = "/v3/sign-flow/" + signFlowId + "/sign-url";
|
||||
String jsonParm = "{\n" +
|
||||
" \"operator\": {\n" +
|
||||
" \"psnAccount\": \"" + psnAccount + "\"\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
//请求方法
|
||||
EsignRequestType requestType = EsignRequestType.POST;
|
||||
//生成请求签名鉴权方式的Header
|
||||
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取合同文件用印链接
|
||||
* @return
|
||||
* @throws EsignDemoException
|
||||
*/
|
||||
public static EsignHttpResponse usesealUrl(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||
String signFlowId = sealSignRecord.getSignFlowid();
|
||||
String apiaddr = "/v3/sign-flow/" + signFlowId + "/sign-url";
|
||||
|
||||
String psnAccount = sealSignRecord.getOrgnizeNamePsnAccount();
|
||||
String orgName = sealSignRecord.getOrgnizeName();
|
||||
|
||||
String jsonParm = "{\n" +
|
||||
" \"operator\": {\n" +
|
||||
|
||||
" \"psnAccount\": \"" + psnAccount + "\"\n" +
|
||||
" },\n" +
|
||||
" \"organization\": {\n" +
|
||||
" \"orgName\": \"" + orgName + "\"\n" +
|
||||
|
||||
" }\n" +
|
||||
"}";
|
||||
//请求方法
|
||||
EsignRequestType requestType = EsignRequestType.POST;
|
||||
//生成请求签名鉴权方式的Header
|
||||
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件签名印章位置
|
||||
* @return
|
||||
* @throws EsignDemoException
|
||||
*/
|
||||
public static EsignHttpResponse getPositions(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||
String fileId = sealSignRecord.getFileid();
|
||||
String apiaddr = "/v3/files/" + fileId + "/keyword-positions";
|
||||
String jsonParm = "{\n" +
|
||||
" \"keywords\": [\n" +
|
||||
" \"仲裁员:\",\n" +
|
||||
" \"(仲裁委员会盖章)\"\n" +
|
||||
" ]\n" +
|
||||
"}";
|
||||
//请求方法
|
||||
EsignRequestType requestType = EsignRequestType.POST;
|
||||
//生成请求签名鉴权方式的Header
|
||||
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -3,9 +3,10 @@
|
||||
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
|
||||
,penson_name,orgnize_name,orgn_name_psn_acc,orgn_name_psn_name,position_pagepsn
|
||||
,position_xpsn,position_ypsn,position_pageorg,position_xorg,position_yorg,case_appli_id
|
||||
,sign_flow_status)
|
||||
VALUES (#{fileid}, #{filename}, #{signFlowid},#{pensonAccount},#{pensonName},#{orgnizeName}
|
||||
@@ -13,4 +14,47 @@
|
||||
,#{positionPageorg},#{positionXorg},#{positionYorg},#{caseAppliId},#{signFlowStatus})
|
||||
</insert>
|
||||
|
||||
|
||||
<resultMap type="SealSignRecord" id="SealSignRecordResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="caseAppliId" column="case_appli_id" />
|
||||
<result property="fileid" column="file_id" />
|
||||
<result property="signFlowid" column="sign_flow_id" />
|
||||
<result property="signFlowStatus" column="sign_flow_status" />
|
||||
|
||||
<result property="pensonAccount" column="penson_account" />
|
||||
<result property="orgnizeName" column="orgnize_name" />
|
||||
<result property="orgnizeNamePsnAccount" column="orgn_name_psn_acc" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<select id="selectSealSignRecord" parameterType="SealSignRecord" resultMap="SealSignRecordResult">
|
||||
SELECT s.id ,s.case_appli_id ,s.file_id ,s.sign_flow_id,s.penson_account ,s.orgnize_name ,s.orgn_name_psn_acc
|
||||
from seal_sign_record s
|
||||
<where>
|
||||
<if test="signFlowStatus != null ">
|
||||
AND s.sign_flow_status = #{signFlowStatus}
|
||||
</if>
|
||||
<if test="caseAppliId != null ">
|
||||
AND s.case_appli_id = #{caseAppliId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSealSignRecordbyStat" parameterType="SealSignRecord" resultMap="SealSignRecordResult">
|
||||
SELECT s.id ,s.case_appli_id ,s.file_id ,s.sign_flow_id
|
||||
from seal_sign_record s
|
||||
where s.sign_flow_status in (1,2)
|
||||
</select>
|
||||
|
||||
<update id="updataSealSignRecord" parameterType="SealSignRecord">
|
||||
update seal_sign_record
|
||||
<set>
|
||||
<if test="signFlowStatus != null">sign_flow_status = #{signFlowStatus},</if>
|
||||
<if test="fileDownloadUrl != null and fileDownloadUrl != ''">file_download_url = #{fileDownloadUrl}</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user