10.12开发
This commit is contained in:
@@ -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);
|
||||
}
|
||||
+91
-4
@@ -4,14 +4,22 @@ 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;
|
||||
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;
|
||||
@@ -55,6 +63,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
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}$");
|
||||
@@ -707,7 +719,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
for (CaseAttach caseAttach : caseAttachList) {
|
||||
if (caseAttach.getAnnexType() == 3) {
|
||||
String annexPath = caseAttach.getAnnexPath();
|
||||
String path = "/home/ruoyi/" + annexPath;
|
||||
//String path = "/home/ruoyi/" + annexPath;
|
||||
String path ="D:\\home\\仲裁裁决书模板.docx";
|
||||
//获取文件上传地址
|
||||
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
||||
String body = response.getBody();
|
||||
@@ -723,13 +736,87 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
Thread.sleep(5000);
|
||||
EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
||||
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){
|
||||
//上传成功,发起签署流程
|
||||
//保存案件id,文件id,文件名称.流程id到签署用印记录表里
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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