优化调解书签名功能 #26
+7
-1
@@ -75,7 +75,13 @@ public class MsSignSealController extends BaseController {
|
|||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test
|
||||||
|
*/
|
||||||
|
@PostMapping("/testSeal")
|
||||||
|
public AjaxResult testSeal(@Validated @RequestBody MsSignSealDTO dto) throws EsignDemoException {
|
||||||
|
return msSignSealService.testSeal(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+14
@@ -29,6 +29,13 @@ public class SealSignRecord extends BaseEntity {
|
|||||||
/** 被申请人姓名 */
|
/** 被申请人姓名 */
|
||||||
private String pensonNameRes;
|
private String pensonNameRes;
|
||||||
|
|
||||||
|
/** 调解员账户 */
|
||||||
|
private String pensonAccountMedi;
|
||||||
|
/** 调解员姓名 */
|
||||||
|
private String pensonNameMedi;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 机构名称 */
|
/** 机构名称 */
|
||||||
private String orgnizeName;
|
private String orgnizeName;
|
||||||
/** 机构经办人 */
|
/** 机构经办人 */
|
||||||
@@ -66,6 +73,13 @@ public class SealSignRecord extends BaseEntity {
|
|||||||
/** 被申请人签名位置y坐标 */
|
/** 被申请人签名位置y坐标 */
|
||||||
private double positionYpsnRes;
|
private double positionYpsnRes;
|
||||||
|
|
||||||
|
/** 调解员签名位置页数 */
|
||||||
|
private String positionPagepsnMedi;
|
||||||
|
/** 调解员签名位置x坐标 */
|
||||||
|
private double positionXpsnMedi;
|
||||||
|
/** 调解员签名位置y坐标 */
|
||||||
|
private double positionYpsnMedi;
|
||||||
|
|
||||||
/** 印章位置页数 */
|
/** 印章位置页数 */
|
||||||
private String positionPageorg;
|
private String positionPageorg;
|
||||||
/** 印章位置x坐标 */
|
/** 印章位置x坐标 */
|
||||||
|
|||||||
+17
@@ -127,6 +127,23 @@ public class MsSealSignRecord {
|
|||||||
@Column(name = "position_ypsn_res")
|
@Column(name = "position_ypsn_res")
|
||||||
private double positionYpsnRes;
|
private double positionYpsnRes;
|
||||||
|
|
||||||
|
/** 调解员账户 */
|
||||||
|
@Column(name = "penson_account_medi")
|
||||||
|
private String pensonAccountMedi;
|
||||||
|
/** 调解员姓名 */
|
||||||
|
@Column(name = "penson_name_medi")
|
||||||
|
private String pensonNameMedi;
|
||||||
|
|
||||||
|
/** 调解员签名位置页数 */
|
||||||
|
@Column(name = "position_pagepsn_medi")
|
||||||
|
private String positionPagepsnMedi;
|
||||||
|
/** 调解员签名位置x坐标 */
|
||||||
|
@Column(name = "position_xpsn_medi")
|
||||||
|
private double positionXpsnMedi;
|
||||||
|
/** 调解员签名位置y坐标 */
|
||||||
|
@Column(name = "position_ypsn_medi")
|
||||||
|
private double positionYpsnMedi;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
+1
@@ -23,4 +23,5 @@ public interface MsSignSealService {
|
|||||||
|
|
||||||
List<MsCaseLogRecordVO> selectCaseLogRecordList(MsSignSealDTO dto);
|
List<MsCaseLogRecordVO> selectCaseLogRecordList(MsSignSealDTO dto);
|
||||||
|
|
||||||
|
AjaxResult testSeal(MsSignSealDTO dto);
|
||||||
}
|
}
|
||||||
|
|||||||
+140
-1
@@ -20,6 +20,7 @@ import com.ruoyi.common.utils.SmsUtils;
|
|||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||||
|
import com.ruoyi.system.mapper.SysUserMapper;
|
||||||
import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
|
import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
|
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
|
import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
|
||||||
@@ -68,6 +69,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
MsCaseFlowMapper caseFlowMapper;
|
MsCaseFlowMapper caseFlowMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MsSealSignRecordMapper sealSignRecordMapper;
|
private MsSealSignRecordMapper sealSignRecordMapper;
|
||||||
|
|
||||||
@@ -125,6 +129,16 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|||||||
//发起签署
|
//发起签署
|
||||||
sealSignRecord.setFilename(fileName);
|
sealSignRecord.setFilename(fileName);
|
||||||
|
|
||||||
|
Long arbitratorId = caseApplication.getMediatorId();
|
||||||
|
if (arbitratorId != null) {
|
||||||
|
SysUser sysUser = sysUserMapper.selectUserById(arbitratorId);
|
||||||
|
if (sysUser == null) {
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
sealSignRecord.setPensonAccountMedi(sysUser.getPhonenumber());
|
||||||
|
sealSignRecord.setPensonNameMedi(sysUser.getNickName());
|
||||||
|
}
|
||||||
|
|
||||||
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
||||||
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
||||||
sealSignRecord.setPensonAccountRes(caseAffiliate.getRespondentPhone());
|
sealSignRecord.setPensonAccountRes(caseAffiliate.getRespondentPhone());
|
||||||
@@ -161,7 +175,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|||||||
double positionX = coordinateObj.getDoubleValue("positionX");
|
double positionX = coordinateObj.getDoubleValue("positionX");
|
||||||
double positionY = coordinateObj.getDoubleValue("positionY");
|
double positionY = coordinateObj.getDoubleValue("positionY");
|
||||||
sealSignRecord.setPositionXpsn(positionX + 90);
|
sealSignRecord.setPositionXpsn(positionX + 90);
|
||||||
sealSignRecord.setPositionYpsn(positionY);
|
sealSignRecord.setPositionYpsn(positionY + 30);
|
||||||
}
|
}
|
||||||
}else if (keyword.equals("被申请人:")) {
|
}else if (keyword.equals("被申请人:")) {
|
||||||
//签名
|
//签名
|
||||||
@@ -178,6 +192,21 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|||||||
sealSignRecord.setPositionXpsnRes(positionX + 90);
|
sealSignRecord.setPositionXpsnRes(positionX + 90);
|
||||||
sealSignRecord.setPositionYpsnRes(positionY);
|
sealSignRecord.setPositionYpsnRes(positionY);
|
||||||
}
|
}
|
||||||
|
}else 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.setPositionPagepsnMedi(String.valueOf(pageNum));
|
||||||
|
JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
||||||
|
JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
||||||
|
double positionX = coordinateObj.getDoubleValue("positionX");
|
||||||
|
double positionY = coordinateObj.getDoubleValue("positionY");
|
||||||
|
sealSignRecord.setPositionXpsnMedi(positionX + 90);
|
||||||
|
sealSignRecord.setPositionYpsnMedi(positionY);
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
//用印
|
//用印
|
||||||
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
||||||
@@ -288,6 +317,20 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|||||||
request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
|
request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
|
||||||
Boolean aBoolean1 = SmsUtils.sendSms(request1);
|
Boolean aBoolean1 = SmsUtils.sendSms(request1);
|
||||||
|
|
||||||
|
SealSignRecord sealSignRecordMedi = new SealSignRecord();
|
||||||
|
sealSignRecordMedi.setSignFlowid(signFlowId);
|
||||||
|
sealSignRecordMedi.setPensonAccount(sealSignRecord.getPensonAccountMedi());
|
||||||
|
EsignHttpResponse signUrlResponMedi = SignAward.signUrlMediation(sealSignRecordMedi);
|
||||||
|
JsonObject signUrlJsonObjectResponMedi = gson.fromJson(signUrlResponMedi.getBody(), JsonObject.class);
|
||||||
|
JsonObject signUrlDataResponMedi = signUrlJsonObjectResponMedi.getAsJsonObject("data");
|
||||||
|
String urlResponMedi = signUrlDataResponMedi.get("shortUrl").getAsString();
|
||||||
|
String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/")+1);
|
||||||
|
|
||||||
|
SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
|
||||||
|
requestMedi.setTemplateId("2047719");
|
||||||
|
requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
|
||||||
|
requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), caseApplication.getCaseNum(),urlResponnewMedi});
|
||||||
|
Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new ServiceException(jsonObject3.getString("message"));
|
throw new ServiceException(jsonObject3.getString("message"));
|
||||||
@@ -646,7 +689,103 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public AjaxResult testSeal(MsSignSealDTO dto) {
|
||||||
|
|
||||||
|
Gson gson = new Gson();
|
||||||
|
|
||||||
|
List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
||||||
|
for (int i = 0; i < sealSignRecords.size(); i++) {
|
||||||
|
MsSealSignRecord mssealSignRecord = sealSignRecords.get(i);
|
||||||
|
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||||
|
BeanUtil.copyProperties(mssealSignRecord, sealSignRecord);
|
||||||
|
|
||||||
|
String signFlowId = mssealSignRecord.getSignFlowId();
|
||||||
|
if(StringUtils.isNotEmpty(signFlowId) && "819e60824fe241e9b862bd787403fa5e".equals(signFlowId)){
|
||||||
|
sealSignRecord.setSignFlowid(mssealSignRecord.getSignFlowId());
|
||||||
|
EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
|
||||||
|
JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class);
|
||||||
|
JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
||||||
|
JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
||||||
|
List<Integer> psnsignStatusList = new ArrayList<>();
|
||||||
|
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();
|
||||||
|
psnsignStatusList.add(psnsignStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!(signerObject.get("orgSigner").toString()).equals("null")) {
|
||||||
|
JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
||||||
|
if (orgSignerData != null) {
|
||||||
|
orgsignStatus = signerObject.get("signStatus").getAsInt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Integer> psnsignStatusListnew = psnsignStatusList.stream().distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 1)) {
|
||||||
|
//更新立案申请状态为待用印
|
||||||
|
MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
||||||
|
if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 1)) {
|
||||||
|
// 根据流程id查找下一个流程节点
|
||||||
|
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
|
||||||
|
MsCaseApplication application = new MsCaseApplication();
|
||||||
|
application.setId(caseApplicationselect.getId());
|
||||||
|
application.setCaseFlowId(nextFlow.getId());
|
||||||
|
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
||||||
|
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||||
|
|
||||||
|
//修改"签署用印记录表"的状态为待用印
|
||||||
|
mssealSignRecord.setSignFlowStatus(2);
|
||||||
|
sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 2)) {
|
||||||
|
//更新立案申请状态为待送达
|
||||||
|
MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
||||||
|
|
||||||
|
if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 2)) {
|
||||||
|
//修改"签署用印记录表"的状态为签署完成
|
||||||
|
mssealSignRecord.setSignFlowStatus(3);
|
||||||
|
sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
|
||||||
|
|
||||||
|
// 根据流程id查找下一个流程节点
|
||||||
|
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
|
||||||
|
MsCaseApplication application = new MsCaseApplication();
|
||||||
|
application.setId(caseApplicationselect.getId());
|
||||||
|
application.setCaseFlowId(nextFlow.getId());
|
||||||
|
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
||||||
|
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (EsignDemoException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -244,7 +244,7 @@ public class FixSelectFlowDetailUtils {
|
|||||||
/*
|
/*
|
||||||
定时查询签署流程详情
|
定时查询签署流程详情
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0/10 * * * * ?")
|
// @Scheduled(cron = "0/10 * * * * ?")
|
||||||
@Transactional
|
@Transactional
|
||||||
public void fixExecuteSelectFlowDetailUtils() {
|
public void fixExecuteSelectFlowDetailUtils() {
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
|
|||||||
@@ -304,6 +304,9 @@ public class SignAward {
|
|||||||
String psnAccountRes = sealSignRecord.getPensonAccountRes();
|
String psnAccountRes = sealSignRecord.getPensonAccountRes();
|
||||||
String psnNameRes = sealSignRecord.getPensonNameRes();
|
String psnNameRes = sealSignRecord.getPensonNameRes();
|
||||||
|
|
||||||
|
String psnAccountMedi = sealSignRecord.getPensonAccountMedi();
|
||||||
|
String psnNameMedi = sealSignRecord.getPensonNameMedi();
|
||||||
|
|
||||||
String orgName = sealSignRecord.getOrgnizeName();
|
String orgName = sealSignRecord.getOrgnizeName();
|
||||||
String orgNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount();
|
String orgNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount();
|
||||||
String orgNamepsnName = sealSignRecord.getOrgnizeNamepsnName();
|
String orgNamepsnName = sealSignRecord.getOrgnizeNamepsnName();
|
||||||
@@ -316,6 +319,10 @@ public class SignAward {
|
|||||||
double positionXpsnRes = sealSignRecord.getPositionXpsnRes();
|
double positionXpsnRes = sealSignRecord.getPositionXpsnRes();
|
||||||
double positionYpsnRes = sealSignRecord.getPositionYpsnRes();
|
double positionYpsnRes = sealSignRecord.getPositionYpsnRes();
|
||||||
|
|
||||||
|
String positionPagepsnMedi = sealSignRecord.getPositionPagepsnMedi();
|
||||||
|
double positionXpsnMedi = sealSignRecord.getPositionXpsnMedi();
|
||||||
|
double positionYpsnMedi = sealSignRecord.getPositionYpsnMedi();
|
||||||
|
|
||||||
String positionPageorg = sealSignRecord.getPositionPageorg();
|
String positionPageorg = sealSignRecord.getPositionPageorg();
|
||||||
double positionXorg = sealSignRecord.getPositionXorg();
|
double positionXorg = sealSignRecord.getPositionXorg();
|
||||||
double positionYorg = sealSignRecord.getPositionYorg();
|
double positionYorg = sealSignRecord.getPositionYorg();
|
||||||
@@ -406,6 +413,34 @@ public class SignAward {
|
|||||||
" \"signerType\": 0\n" +
|
" \"signerType\": 0\n" +
|
||||||
" },\n" +
|
" },\n" +
|
||||||
|
|
||||||
|
|
||||||
|
" {\n" +
|
||||||
|
" \"psnSignerInfo\": {\n" +
|
||||||
|
" \"psnAccount\": \"" + psnAccountMedi + "\",\n" +
|
||||||
|
" \"psnInfo\": {\n" +
|
||||||
|
" \"psnName\": \"" + psnNameMedi + "\"\n" +
|
||||||
|
" }\n" +
|
||||||
|
" },\n" +
|
||||||
|
" \"signFields\": [\n" +
|
||||||
|
" {\n" +
|
||||||
|
" \"fileId\": \"" + fileId + "\",\n" +
|
||||||
|
" \"normalSignFieldConfig\": {\n" +
|
||||||
|
" \"autoSign\": false,\n" +
|
||||||
|
" \"freeMode\": false,\n" +
|
||||||
|
" \"movableSignField\": false,\n" +
|
||||||
|
" \"signFieldPosition\": {\n" +
|
||||||
|
" \"positionPage\": \"" + positionPagepsnMedi + "\",\n" +
|
||||||
|
" \"positionX\": " + positionXpsnMedi + ",\n" +
|
||||||
|
" \"positionY\": " + positionYpsnMedi + "\n" +
|
||||||
|
" },\n" +
|
||||||
|
" \"signFieldStyle\": 1\n" +
|
||||||
|
" },\n" +
|
||||||
|
" \"signFieldType\": 0\n" +
|
||||||
|
" }\n" +
|
||||||
|
" ],\n" +
|
||||||
|
" \"signerType\": 0\n" +
|
||||||
|
" },\n" +
|
||||||
|
|
||||||
" {\n" +
|
" {\n" +
|
||||||
" \"orgSignerInfo\": {\n" +
|
" \"orgSignerInfo\": {\n" +
|
||||||
" \"orgName\": \"" + orgName + "\",\n" +
|
" \"orgName\": \"" + orgName + "\",\n" +
|
||||||
@@ -695,6 +730,7 @@ public class SignAward {
|
|||||||
" \"keywords\": [\n" +
|
" \"keywords\": [\n" +
|
||||||
" \"申请人:\",\n" +
|
" \"申请人:\",\n" +
|
||||||
" \"被申请人:\",\n" +
|
" \"被申请人:\",\n" +
|
||||||
|
" \"调解员:\",\n" +
|
||||||
" \"(盖章)\"\n" +
|
" \"(盖章)\"\n" +
|
||||||
" ]\n" +
|
" ]\n" +
|
||||||
"}";
|
"}";
|
||||||
|
|||||||
Reference in New Issue
Block a user