合并 #78
@@ -178,6 +178,16 @@ public class SealSignRecord extends BaseEntity {
|
||||
private double positionXorg;
|
||||
/** 印章位置y坐标 */
|
||||
private double positionYorg;
|
||||
/** 案件申请id */
|
||||
private Long caseAppliId;
|
||||
|
||||
public Long getCaseAppliId() {
|
||||
return caseAppliId;
|
||||
}
|
||||
|
||||
public void setCaseAppliId(Long caseAppliId) {
|
||||
this.caseAppliId = caseAppliId;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
|
||||
@@ -64,20 +64,37 @@ public class SaaSAPIFileUtils {
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
|
||||
}
|
||||
|
||||
// public static void main(String[] args) throws EsignDemoException {
|
||||
// String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx";
|
||||
// EsignHttpResponse uploadUrl = getUploadUrl(filePath);
|
||||
// String body = uploadUrl.getBody();
|
||||
// JSONObject jsonObject = new JSONObject(body);
|
||||
// JSONObject dataObj = jsonObject.getJSONObject("data");
|
||||
// String fileUploadUrl = dataObj.get("fileUploadUrl").toString();
|
||||
// System.out.println("这是fileUploadUrl:"+fileUploadUrl);
|
||||
// String fileId = dataObj.get("fileId").toString();
|
||||
// System.out.println("这是fileId:"+fileId);
|
||||
// EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath);
|
||||
// System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody());
|
||||
/**
|
||||
* 下载已签署文件及附属材料
|
||||
*/
|
||||
public static EsignHttpResponse fileDownloadUrl(String signFlowId) throws EsignDemoException {
|
||||
String apiaddr = "/v3/sign-flow/"+ signFlowId +"/file-download-url";
|
||||
//请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null
|
||||
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);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws EsignDemoException {
|
||||
String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\23893bfd3f2249ffa5c82850c11c482e.docx";
|
||||
EsignHttpResponse uploadUrl = getUploadUrl(filePath);
|
||||
String body = uploadUrl.getBody();
|
||||
JSONObject jsonObject = new JSONObject(body);
|
||||
JSONObject dataObj = jsonObject.getJSONObject("data");
|
||||
String fileUploadUrl = dataObj.get("fileUploadUrl").toString();
|
||||
System.out.println("这是fileUploadUrl:"+fileUploadUrl);
|
||||
String fileId = dataObj.get("fileId").toString();
|
||||
System.out.println("这是fileId:"+fileId);
|
||||
//String fileUploadUrl = "https://esignoss.esign.cn/1111564182/ccf6db5a-92da-4523-89ba-385a30423596/23893bfd3f2249ffa5c82850c11c482e.docx?Expires=1697021257&OSSAccessKeyId=STS.NTmgvSC8n5Zg1y7EciQftF23N&Signature=CxVZmpwFksWmLYkxPjVz9K4mVyA%3D&callback-var=eyJ4OmZpbGVfa2V5IjoiJDAyODhjOTg3LWNlNzgtNDM1OC04NWYwLTdlNmUyM2NjOTJmNiQzNDk1NzQ3MjE5In0%3D%0A&callback=eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9zbWx0YXBpLnRzaWduLmNuL2FueWRvb3IvZmlsZS1zeXN0ZW0vY2FsbGJhY2svYWxpb3NzIiwiY2FsbGJhY2tCb2R5IjogIntcIm1pbWVUeXBlXCI6JHttaW1lVHlwZX0sXCJzaXplXCI6ICR7c2l6ZX0sXCJidWNrZXRcIjogJHtidWNrZXR9LFwib2JqZWN0XCI6ICR7b2JqZWN0fSxcImV0YWdcIjogJHtldGFnfSxcImZpbGVfa2V5XCI6JHt4OmZpbGVfa2V5fX0iLCJjYWxsYmFja0JvZHlUeXBlIjogImFwcGxpY2F0aW9uL2pzb24ifQ%3D%3D%0A&security-token=CAIS%2BAF1q6Ft5B2yfSjIr5fYLMznrudPgpiMM1%2BGoWM8XelYqfeYrDz2IHtKdXRvBu8Xs%2F4wnmxX7f4YlqB6T55OSAmcNZEofT7katr4MeT7oMWQweEurv%2FMQBqyaXPS2MvVfJ%2BOLrf0ceusbFbpjzJ6xaCAGxypQ12iN%2B%2Fm6%2FNgdc9FHHPPD1x8CcxROxFppeIDKHLVLozNCBPxhXfKB0ca0WgVy0EHsPnvm5DNs0uH1AKjkbRM9r6ceMb0M5NeW75kSMqw0eBMca7M7TVd8RAi9t0t1%2FIVpGiY4YDAWQYLv0rda7DOltFiMkpla7MmXqlft%2BhzcgeQY0pc%2FRqAAaxcPCSY0Du8wgErfR1llD8t2zeFG%2B1mktU4Rsl7AgxsSFxrwILBUk2x7imVsFVA0kkS8rNBMDKGIsIZTCl5M7S2L%2BD8364htwcZgIZYHK2fCN6gCuy%2Bfk9C%2FfQaTc00IWBMw8OubuJ%2Fq2mdMh32yoi7dLuJyhwt1z%2F%2BWf5vIFHdIAA%3D";
|
||||
EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath);
|
||||
System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody());
|
||||
// EsignHttpResponse fileStatus = getFileStatus(fileId);
|
||||
// System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody());
|
||||
// getFileStatus("a0c2ad21065f48ff8b872412c39d5d3a");
|
||||
// }
|
||||
// getFileStatus("a808f1f39a744357a2f018e4ab34c55d");
|
||||
// fileDownloadUrl("");
|
||||
}
|
||||
}
|
||||
|
||||
+6
-2
@@ -1,6 +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);
|
||||
}
|
||||
|
||||
-14
@@ -118,20 +118,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
|
||||
}
|
||||
datas.put("legalProvisions", "仲裁法");
|
||||
if (arbitratorName == null) {
|
||||
datas.put("arbitratorName1", null);
|
||||
datas.put("arbitratorName2", null);
|
||||
} else if (arbitratorName.contains(",")) {
|
||||
String[] nameArray = arbitratorName.split(",");
|
||||
String firstName = nameArray[0];
|
||||
String secondName = nameArray[1];
|
||||
datas.put("arbitratorName1", firstName);
|
||||
datas.put("arbitratorName2", secondName);
|
||||
} else {
|
||||
String secondName = "";
|
||||
datas.put("arbitratorName1", arbitratorName);
|
||||
datas.put("arbitratorName2", secondName);
|
||||
}
|
||||
LocalDate now = LocalDate.now();
|
||||
String year = Integer.toString(now.getYear());
|
||||
String month = String.format("%02d", now.getMonthValue());
|
||||
|
||||
+132
-1
@@ -4,6 +4,9 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -11,10 +14,16 @@ import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||
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.ServiceException;
|
||||
import com.ruoyi.common.utils.SignAward;
|
||||
import com.ruoyi.common.utils.bean.SealSignRecord;
|
||||
|
||||
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
@@ -28,6 +37,8 @@ import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
@@ -54,6 +65,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
private CaseAttachMapper caseAttachMapper;
|
||||
@Autowired
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
@Autowired
|
||||
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}$");
|
||||
|
||||
@@ -697,10 +715,123 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
|
||||
Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck();
|
||||
if(agreeOrNotCheck.intValue()==1){//同意审核
|
||||
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,"");
|
||||
|
||||
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
}else if(agreeOrNotCheck.intValue()==2){//拒绝审核
|
||||
caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
|
||||
|
||||
@@ -3,15 +3,14 @@
|
||||
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