bug修复
This commit is contained in:
+10
-1
@@ -42,12 +42,21 @@ public class SmsSendRecord extends BaseEntity {
|
||||
* 发送状态
|
||||
*/
|
||||
private Integer sendStatus;
|
||||
/**
|
||||
* 短信sid,发送的唯一标识
|
||||
*/
|
||||
private String sid;
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
public SmsSendRecord(Long caseId, String caseNum, String phone, Date sendTime, String sendContent) {
|
||||
public SmsSendRecord(Long caseId, String caseNum, String phone, Date sendTime, String sendContent,String sid) {
|
||||
this.caseId = caseId;
|
||||
this.caseNum = caseNum;
|
||||
this.phone = phone;
|
||||
this.sendTime = sendTime;
|
||||
this.sendContent = sendContent;
|
||||
this.sid = sid;
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -215,6 +215,11 @@ public class MsCaseApplication {
|
||||
*/
|
||||
@Column(name = "case_source")
|
||||
private String caseSource;
|
||||
/**
|
||||
* 是否需要用印,1-需要
|
||||
*/
|
||||
@Column(name = "seal_flag")
|
||||
private Integer sealFlag;
|
||||
/**
|
||||
* 拒绝原因
|
||||
*/
|
||||
|
||||
+5
-1
@@ -120,5 +120,9 @@ public class MsCaseApplicationReq {
|
||||
*/
|
||||
private Integer roleType;
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 是否需要用印,0-不需要,1-需要
|
||||
*/
|
||||
// todo 等会放开
|
||||
private Integer sealFlag=0;
|
||||
}
|
||||
+2
@@ -19,4 +19,6 @@ public interface SmsRecordMapper {
|
||||
* @return
|
||||
*/
|
||||
int batchSaveSmsSendRecord(@Param("list") List<SmsSendRecord> smsSendRecordList);
|
||||
SmsSendRecord selectBySId(@Param("sid") String sid);
|
||||
void updateStatus (SmsSendRecord smsSendRecord);
|
||||
}
|
||||
|
||||
+10
-2
@@ -2,11 +2,13 @@ package com.ruoyi.wisdomarbitrate.service.miniprogress.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.enums.SMSStatusEnum;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
@@ -43,6 +45,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
private SysUserRoleMapper userRoleMapper;
|
||||
@Autowired
|
||||
private IdentityAuthenticationMapper identityAuthenticationMapper;
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Override
|
||||
public AjaxResult sendCode(WeChatUserVO userVO) {
|
||||
@@ -58,8 +62,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
// 1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。
|
||||
request.setPhone(userVO.getPhone());
|
||||
request.setTemplateParamSet(new String[]{ code});
|
||||
Boolean flag = SmsUtils.sendSms(request);
|
||||
if(flag){
|
||||
JSONObject resultObj = SmsUtils.sendSms(request);
|
||||
if(resultObj.get("status")!=null && !resultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())){
|
||||
setCodeCache(userVO.getPhone(),code);
|
||||
return AjaxResult.success("短信发送成功");
|
||||
}else {
|
||||
@@ -136,6 +140,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
sysUser.setEmail(ientityAuthentication.getEmail());
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
|
||||
sysUserMapper.updateUser(sysUser);
|
||||
// redis缓存
|
||||
redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
|
||||
ientityAuthentication.setUserId(sysUser.getUserId());
|
||||
int count=0;
|
||||
if(CollectionUtil.isNotEmpty(sysUser.getRoles()) && roleIdByName!=null){
|
||||
@@ -169,6 +175,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
if(row<1) {
|
||||
return AjaxResult.warn("注册失败");
|
||||
}
|
||||
// redis缓存
|
||||
redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
|
||||
if(roleIdByName!=null) {
|
||||
// 用户关联被申请人角色
|
||||
userRoleMapper.insertUserRole(sysUser.getUserId(), roleIdByName);
|
||||
|
||||
+1
-1
@@ -295,7 +295,7 @@ public interface MsCaseApplicationService {
|
||||
* @param affiliate 案件人员
|
||||
* @param sendContent 发送内容
|
||||
*/
|
||||
public void sendSMS(Boolean smsFlag ,MsCaseApplication application, MsCaseAffiliate affiliate, String sendContent);
|
||||
public void sendSMS(cn.hutool.json.JSONObject jsonObject ,MsCaseApplication application, MsCaseAffiliate affiliate, String sendContent);
|
||||
/**
|
||||
* 发送邮件
|
||||
* @param application 案件基本信息
|
||||
|
||||
+10
@@ -4,6 +4,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.ReservedConference;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -80,4 +81,13 @@ public interface VideoConferenceService {
|
||||
* @throws Exception
|
||||
*/
|
||||
AjaxResult reservedConference( MsReservedConferenceVO reservedConferenceVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 短信回调
|
||||
* @param body
|
||||
* @param request
|
||||
*/
|
||||
void smsRollBack(String body, HttpServletRequest request);
|
||||
|
||||
AjaxResult selectRoleMenuByCaseId(Long caseId);
|
||||
}
|
||||
|
||||
+584
-523
File diff suppressed because it is too large
Load Diff
+29
-22
@@ -11,10 +11,10 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.enums.AnnexTypeEnum;
|
||||
import com.ruoyi.common.enums.PaymentStatusEnum;
|
||||
import com.ruoyi.common.enums.SMSStatusEnum;
|
||||
import com.ruoyi.common.enums.YesOrNoEnum;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.dto.PayRequest;
|
||||
import com.ruoyi.dto.PayResponse;
|
||||
@@ -384,22 +384,24 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
||||
continue;
|
||||
}
|
||||
if (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2)) {
|
||||
Boolean smsFlag = true;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
SmsSendRecord smsSendRecord = null;
|
||||
if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
|
||||
// 缴费通过
|
||||
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
|
||||
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。");
|
||||
// todo 短信
|
||||
// jsonObject = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
|
||||
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。",jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
|
||||
} else {
|
||||
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
|
||||
// todo 短信
|
||||
// jsonObject = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
|
||||
// 2074402 调解系统确认缴费不通过通知 尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
|
||||
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信");
|
||||
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信",jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
|
||||
}
|
||||
// 新增短信记录
|
||||
if (smsFlag) {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
|
||||
if (jsonObject.get("ststus")!=null && !jsonObject.get("ststus").equals(SMSStatusEnum.FAIL)) {
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
}
|
||||
@@ -412,22 +414,24 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
||||
continue;
|
||||
}
|
||||
if (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4)) {
|
||||
Boolean smsFlag = true;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
SmsSendRecord smsSendRecord = null;
|
||||
if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
|
||||
// todo 短信
|
||||
// 缴费通过
|
||||
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
|
||||
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。");
|
||||
// jsonObject = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
|
||||
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。",jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
|
||||
} else {
|
||||
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
|
||||
// todo 短信
|
||||
// jsonObject = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
|
||||
// 2074402 调解系统确认缴费不通过通知 尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
|
||||
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信");
|
||||
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信",jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
|
||||
}
|
||||
// 新增短信记录
|
||||
if (smsFlag) {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
|
||||
if (jsonObject.get("status")!=null && !jsonObject.get("status").equals(SMSStatusEnum.FAIL)) {
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
}
|
||||
@@ -469,13 +473,16 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
||||
@Transactional
|
||||
public void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone ) {
|
||||
// 申请人被申请人发送受理通知书 2073601 尊敬的{1}用户,您的{2}案件,已成功受理,请知晓,如非本人操作,请忽略本短信。
|
||||
Boolean smsFlag = SmsUtils.sendSms(caseAppllication.getId(), "2073601", phone, new String[]{userName, caseAppllication.getCaseNum()});
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), phone, new Date(), "尊敬的" + userName + "用户,您的" + caseAppllication.getCaseNum() + "案件,已成功受理,请知晓,如非本人操作,请忽略本短信。");
|
||||
// todo 短信
|
||||
|
||||
// JSONObject jsonObject = SmsUtils.sendSms(caseAppllication.getId(), "2073601", phone, new String[]{userName, caseAppllication.getCaseNum()});
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), phone, new Date(), "尊敬的" + userName + "用户,您的" + caseAppllication.getCaseNum() + "案件,已成功受理,请知晓,如非本人操作,请忽略本短信。",jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
|
||||
// 新增短信记录
|
||||
if (smsFlag) {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
|
||||
if (jsonObject.get("status")!=null && !jsonObject.get("status").equals(SMSStatusEnum.FAIL)) {
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
|
||||
|
||||
+121
-80
@@ -596,9 +596,13 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
Gson gson = new Gson();
|
||||
EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecord);
|
||||
JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
||||
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
||||
String urlapply = signUrlData.get("shortUrl").getAsString();
|
||||
sealSignRecordres.setSealUrl(urlapply);
|
||||
if(signUrlJsonObject.get("data")==null||signUrlJsonObject.get("data").isJsonNull()){
|
||||
throw new ServiceException("该用户和流程无关,不能查看当前流程");
|
||||
}else {
|
||||
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
||||
String urlapply = signUrlData.get("shortUrl").getAsString();
|
||||
sealSignRecordres.setSealUrl(urlapply);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(sealSignRecordres);
|
||||
}else {
|
||||
@@ -722,7 +726,14 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
if(signStatusResponse!=null&&signStatusResponse.intValue()==1&&
|
||||
signStatusMediator!=null&&signStatusMediator.intValue()==1){
|
||||
// 根据流程id查找下一个流程节点
|
||||
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
|
||||
MsCaseFlow nextFlow=null;
|
||||
if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
|
||||
// 需要用印
|
||||
nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
|
||||
}else {
|
||||
// 不需要用印
|
||||
nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
|
||||
}
|
||||
MsCaseApplication application = new MsCaseApplication();
|
||||
application.setId(caseApplicationselect.getId());
|
||||
application.setCaseFlowId(nextFlow.getId());
|
||||
@@ -730,8 +741,17 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
|
||||
//修改"签署用印记录表"的状态为待用印
|
||||
sealSignRecordsel.setSignFlowStatus(2);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
|
||||
sealSignRecordsel.setSignFlowStatus(2);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
}else {
|
||||
// 否则为已完成
|
||||
sealSignRecordsel.setSignFlowStatus(3);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
// 下载调解书
|
||||
downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
|
||||
}
|
||||
|
||||
}
|
||||
}else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){
|
||||
//被申请人签名
|
||||
@@ -755,8 +775,17 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
|
||||
//修改"签署用印记录表"的状态为待用印
|
||||
sealSignRecordsel.setSignFlowStatus(2);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
|
||||
sealSignRecordsel.setSignFlowStatus(2);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
}else {
|
||||
// 否则为已完成
|
||||
sealSignRecordsel.setSignFlowStatus(3);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
// 下载调解书
|
||||
downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
|
||||
}
|
||||
|
||||
}
|
||||
}else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountMedi)){
|
||||
//调解员签名
|
||||
@@ -780,10 +809,16 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
|
||||
//修改"签署用印记录表"的状态为待用印
|
||||
sealSignRecordsel.setSignFlowStatus(2);
|
||||
if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
|
||||
sealSignRecordsel.setSignFlowStatus(2);
|
||||
}else {
|
||||
// 否则为已完成
|
||||
sealSignRecordsel.setSignFlowStatus(3);
|
||||
}
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
}
|
||||
}else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(orgnNamePsnAcc)){
|
||||
}else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(orgnNamePsnAcc) && caseApplicationselect.getSealFlag()!=null && caseApplicationselect.getSealFlag()==1 ){
|
||||
//需要用印
|
||||
sealSignRecordsel.setSealStatus(1);
|
||||
sealSignRecordsel.setSignFlowStatus(3);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
@@ -804,73 +839,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
|
||||
//下载审核完成的调解书
|
||||
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();
|
||||
LocalDate now = LocalDate.now();
|
||||
String year = Integer.toString(now.getYear());
|
||||
String month = String.format("%02d", now.getMonthValue());
|
||||
String day = String.format("%02d", now.getDayOfMonth());
|
||||
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
||||
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
||||
// String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
||||
// String savePath = "/home/ruoyi/uploadPath/upload/";
|
||||
String saveName = fileName;
|
||||
String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
||||
downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
|
||||
|
||||
// 创建日期目录
|
||||
File saveFolder = new File(saveFolderPath);
|
||||
if (!saveFolder.exists()) {
|
||||
saveFolder.mkdirs();
|
||||
}
|
||||
String resultFilePath = saveFolderPath + "/" + fileName;
|
||||
File resultFilePathFile = new File(resultFilePath);
|
||||
if (!resultFilePathFile.exists()) {
|
||||
resultFilePathFile.createNewFile();
|
||||
}
|
||||
|
||||
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
||||
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
||||
if (downLoadFile) {
|
||||
// 先删除已经存在的调解书
|
||||
if(StrUtil.isEmpty(application.getCaseSource())){
|
||||
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
if(CollectionUtil.isNotEmpty(existAttach)){
|
||||
// todo 对接北明,同步案件状态,删除
|
||||
for (MsCaseAttach msCaseAttach : existAttach) {
|
||||
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
|
||||
continue;
|
||||
}
|
||||
beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
MsCaseAttach caseAttach = new MsCaseAttach();
|
||||
caseAttach.setCaseAppliId(caseAppliId);
|
||||
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
caseAttach.setAnnexPath(savePath);
|
||||
caseAttach.setAnnexName(saveName);
|
||||
caseAttachMapper.save(caseAttach);
|
||||
// todo 对接北明,调用上传附件接口
|
||||
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
|
||||
String templatePath = "/home/ruoyi" + savePath;
|
||||
File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}else if(mediaResult.intValue()==5){
|
||||
@@ -932,7 +902,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
||||
if (downLoadFile) {
|
||||
// 先删除已经存在的调解书
|
||||
if(StrUtil.isEmpty(application.getCaseSource())){
|
||||
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
|
||||
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
if(CollectionUtil.isNotEmpty(existAttach)){
|
||||
// todo 对接北明,同步案件状态,删除
|
||||
@@ -940,7 +910,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
|
||||
continue;
|
||||
}
|
||||
beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
||||
beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1024,7 +994,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
||||
if (downLoadFile) {
|
||||
// 先删除已经存在的调解书
|
||||
if(StrUtil.isEmpty(application.getCaseSource())){
|
||||
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
|
||||
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
if(CollectionUtil.isNotEmpty(existAttach)){
|
||||
// todo 对接北明,同步案件状态,删除
|
||||
@@ -1032,7 +1002,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
|
||||
continue;
|
||||
}
|
||||
beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
||||
beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1069,6 +1039,77 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
return AjaxResult.success("success");
|
||||
}
|
||||
|
||||
private void downloadMediationBook(MsCaseApplication caseApplicationselect, String signFlowId, Gson gson, Long caseAppliId) throws EsignDemoException, IOException {
|
||||
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();
|
||||
LocalDate now = LocalDate.now();
|
||||
String year = Integer.toString(now.getYear());
|
||||
String month = String.format("%02d", now.getMonthValue());
|
||||
String day = String.format("%02d", now.getDayOfMonth());
|
||||
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
||||
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
||||
// String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
||||
// String savePath = "/home/ruoyi/uploadPath/upload/";
|
||||
String saveName = fileName;
|
||||
String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
||||
|
||||
// 创建日期目录
|
||||
File saveFolder = new File(saveFolderPath);
|
||||
if (!saveFolder.exists()) {
|
||||
saveFolder.mkdirs();
|
||||
}
|
||||
String resultFilePath = saveFolderPath + "/" + fileName;
|
||||
File resultFilePathFile = new File(resultFilePath);
|
||||
if (!resultFilePathFile.exists()) {
|
||||
resultFilePathFile.createNewFile();
|
||||
}
|
||||
|
||||
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
||||
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
||||
if (downLoadFile) {
|
||||
// 先删除已经存在的调解书
|
||||
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
|
||||
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
if(CollectionUtil.isNotEmpty(existAttach)){
|
||||
// todo 对接北明,同步案件状态,删除
|
||||
for (MsCaseAttach msCaseAttach : existAttach) {
|
||||
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
|
||||
continue;
|
||||
}
|
||||
beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
MsCaseAttach caseAttach = new MsCaseAttach();
|
||||
caseAttach.setCaseAppliId(caseAppliId);
|
||||
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
caseAttach.setAnnexPath(savePath);
|
||||
caseAttach.setAnnexName(saveName);
|
||||
caseAttachMapper.save(caseAttach);
|
||||
// todo 对接北明,调用上传附件接口
|
||||
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
|
||||
String templatePath = "/home/ruoyi" + savePath;
|
||||
File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException {
|
||||
|
||||
+101
-1
@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
@@ -13,6 +15,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.enums.AnnexTypeEnum;
|
||||
import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
|
||||
import com.ruoyi.common.enums.DocumentTypeEnum;
|
||||
import com.ruoyi.common.enums.SMSStatusEnum;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.PdfUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
@@ -20,14 +23,18 @@ import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.service.impl.BeiMingInterfaceService;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.ReservedConference;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAffiliateMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.ReservedConferenceMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService;
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||
@@ -45,12 +52,14 @@ import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ruoyi.common.core.domain.AjaxResult.error;
|
||||
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
||||
import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile;
|
||||
import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName;
|
||||
@@ -80,6 +89,8 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
@Autowired
|
||||
private MsCaseAttachMapper caseAttachMapper;
|
||||
@Autowired
|
||||
private MsCaseAffiliateMapper caseAffiliateMapper;
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
@Autowired
|
||||
private ReservedConferenceMapper reservedConferenceMapper;
|
||||
@@ -94,6 +105,8 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
private String BMSyncSource;
|
||||
@Autowired
|
||||
BeiMingInterfaceService beiMingInterfaceService;
|
||||
@Autowired
|
||||
private SmsRecordMapper smsRecordMapper;
|
||||
|
||||
/**
|
||||
视频回调
|
||||
@@ -139,6 +152,83 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
return success("预约会议成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void smsRollBack(String body, HttpServletRequest request) {
|
||||
// 解析body
|
||||
JSONArray jsonArray = JSONUtil.parseArray(body);
|
||||
if (jsonArray != null && jsonArray.size() > 0) {
|
||||
for (Object o : jsonArray) {
|
||||
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(o);
|
||||
if (jsonObject.get("sid") != null) {
|
||||
Object description = jsonObject.get("description");
|
||||
System.out.println(description);
|
||||
// 查询sid对应的短信,更新短信状态
|
||||
SmsSendRecord smsSendRecord = smsRecordMapper.selectBySId(jsonObject.getStr("sid"));
|
||||
if (smsSendRecord != null) {
|
||||
if (jsonObject.get("report_status") != null && jsonObject.getStr("report_status").equals("SUCCESS")) {
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.SUCCESS.getCode());
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
|
||||
smsSendRecord.setReason(description != null ? description.toString() : null);
|
||||
}
|
||||
smsRecordMapper.updateStatus(smsSendRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectRoleMenuByCaseId(Long caseId) {
|
||||
AjaxResult result = success();
|
||||
// 根据案件id查询相关人员
|
||||
List<MsCaseAffiliate> msCaseAffiliates = caseAffiliateMapper.selectByCaseId(caseId);
|
||||
if(CollectionUtil.isEmpty(msCaseAffiliates)){
|
||||
return error("未找到案件相关人员");
|
||||
}
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if(userId==null){
|
||||
return error("未找到当前登录用户");
|
||||
}
|
||||
for (MsCaseAffiliate affiliate : msCaseAffiliates) {
|
||||
if(affiliate.getOperatorFlag()!=null && affiliate.getOperatorFlag()==1 && affiliate.getUserId()!=null&&affiliate.getUserId().equals(userId)&&affiliate.getRoleType()!=null){
|
||||
if(affiliate.getRoleType().equals(1)||affiliate.getRoleType().equals(2)){
|
||||
// 申请人操作人
|
||||
result.put("appFlag","1");
|
||||
}
|
||||
if(affiliate.getRoleType().equals(3)||affiliate.getRoleType().equals(4)){
|
||||
// 被申请人操作人
|
||||
result.put("resFlag","1");
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String body="[{\"mobile\":\"18792927508\",\"report_status\":\"FAIL\",\"description\":\"\\u8FD0\\u8425\\u5546\\u5173\\u952E\\u5B57\\u62E6\\u622A\",\"errmsg\":\"GB:0010\",\"user_receive_time\":\"2024-04-07 14:28:57\",\"sid\":\"9318:147045628317124713319032750\",\"nationcode\":\"86\"}]";
|
||||
JSONArray jsonArray = JSONUtil.parseArray(body);
|
||||
if(jsonArray!=null && jsonArray.size()>0){
|
||||
for (Object o : jsonArray) {
|
||||
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(o);
|
||||
if(jsonObject.get("sid")!=null){
|
||||
String reportStatus = jsonObject.getStr("report_status");
|
||||
String description = jsonObject.getStr("description");
|
||||
System.out.println(description);
|
||||
// 查询sid对应的短信,更新短信状态
|
||||
// SmsSendRecord smsSendRecord= smsRecordMapper.selectBySId(jsonObject.getStr("sid"));
|
||||
// if(smsSendRecord!=null){
|
||||
// if(jsonObject.get("report_status")!=null && jsonObject.getStr("report_status").equals("SUCCESS")){
|
||||
// smsSendRecord.setSendStatus(SMSStatusEnum.SUCCESS.getCode());
|
||||
// }else {
|
||||
// smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据案件id查询已预约的会议
|
||||
*
|
||||
@@ -388,11 +478,11 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
if(caseApplication==null){
|
||||
return AjaxResult.error("案件不存在");
|
||||
}
|
||||
List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
boolean isSecretaryRole=false;
|
||||
if(caseApplication.getMediatorId()!=null&& Objects.equals(userId, caseApplication.getMediatorId())){
|
||||
// 是调解员
|
||||
List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
|
||||
if(CollectionUtil.isNotEmpty(roles)){
|
||||
for (SysRole role : roles) {
|
||||
if("调解员".equals(role.getRoleName())){
|
||||
@@ -401,6 +491,16 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
// 是调解员
|
||||
if(CollectionUtil.isNotEmpty(roles)){
|
||||
for (SysRole role : roles) {
|
||||
if("法律顾问".equals(role.getRoleName())){
|
||||
isSecretaryRole=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jsonObject.put("isSecretaryRole",isSecretaryRole);
|
||||
|
||||
@@ -288,12 +288,12 @@ public class SignAward {
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起签署
|
||||
* 发起带有用印签署
|
||||
*
|
||||
* @return
|
||||
* @throws EsignDemoException
|
||||
*/
|
||||
public static EsignHttpResponse createByFileMediation(SealSignRecord sealSignRecord ,List<String> sealIdList) throws EsignDemoException {
|
||||
public static EsignHttpResponse createByFileSeal(SealSignRecord sealSignRecord ,List<String> sealIdList) throws EsignDemoException {
|
||||
String apiaddr = "/v3/sign-flow/create-by-file";
|
||||
|
||||
String fileId = sealSignRecord.getFileid();
|
||||
@@ -488,6 +488,162 @@ public class SignAward {
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
|
||||
}
|
||||
/**
|
||||
* 发起不带用印签署
|
||||
*
|
||||
* @return
|
||||
* @throws EsignDemoException
|
||||
*/
|
||||
public static EsignHttpResponse createByFileMediation(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 psnAccountRes = sealSignRecord.getPensonAccountRes();
|
||||
String psnNameRes = sealSignRecord.getPensonNameRes();
|
||||
|
||||
String psnAccountMedi = sealSignRecord.getPensonAccountMedi();
|
||||
String psnNameMedi = sealSignRecord.getPensonNameMedi();
|
||||
|
||||
|
||||
String positionPagepsn = sealSignRecord.getPositionPagepsn();
|
||||
double positionXpsn = sealSignRecord.getPositionXpsn();
|
||||
double positionYpsn = sealSignRecord.getPositionYpsn();
|
||||
|
||||
String positionPagepsnRes = sealSignRecord.getPositionPagepsnRes();
|
||||
double positionXpsnRes = sealSignRecord.getPositionXpsnRes();
|
||||
double positionYpsnRes = sealSignRecord.getPositionYpsnRes();
|
||||
|
||||
String positionPagepsnMedi = sealSignRecord.getPositionPagepsnMedi();
|
||||
double positionXpsnMedi = sealSignRecord.getPositionXpsnMedi();
|
||||
double positionYpsnMedi = sealSignRecord.getPositionYpsnMedi();
|
||||
|
||||
|
||||
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" +
|
||||
|
||||
" \"signConfig\": {\n" +
|
||||
" \"availableSignClientTypes\": \"1\"\n" +
|
||||
" },\n" +
|
||||
// " \"notifyUrl\": \"" + signSealCallbackUrl + "\",\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" +
|
||||
" \"psnSignerInfo\": {\n" +
|
||||
" \"psnAccount\": \"" + psnAccountRes + "\",\n" +
|
||||
" \"psnInfo\": {\n" +
|
||||
" \"psnName\": \"" + psnNameRes + "\"\n" +
|
||||
" }\n" +
|
||||
" },\n" +
|
||||
" \"signFields\": [\n" +
|
||||
" {\n" +
|
||||
" \"fileId\": \"" + fileId + "\",\n" +
|
||||
" \"normalSignFieldConfig\": {\n" +
|
||||
" \"autoSign\": false,\n" +
|
||||
" \"freeMode\": false,\n" +
|
||||
" \"movableSignField\": false,\n" +
|
||||
" \"signFieldPosition\": {\n" +
|
||||
" \"positionPage\": \"" + positionPagepsnRes + "\",\n" +
|
||||
" \"positionX\": " + positionXpsnRes + ",\n" +
|
||||
" \"positionY\": " + positionYpsnRes + "\n" +
|
||||
" },\n" +
|
||||
" \"signFieldStyle\": 1\n" +
|
||||
" },\n" +
|
||||
" \"signFieldType\": 0\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"signerType\": 0\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" +
|
||||
"}";
|
||||
|
||||
//请求方法
|
||||
EsignRequestType requestType = EsignRequestType.POST;
|
||||
//生成请求签名鉴权方式的Header
|
||||
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
|
||||
//发起接口请求
|
||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起签署
|
||||
@@ -850,8 +1006,8 @@ public class SignAward {
|
||||
String apiaddr = "/v3/files/" + fileId + "/keyword-positions";
|
||||
String jsonParm = "{\n" +
|
||||
" \"keywords\": [\n" +
|
||||
" \"甲方(签字):\",\n" +
|
||||
" \"乙方(签字):\",\n" +
|
||||
" \"申请人(签字):\",\n" +
|
||||
" \"被申请人(签字):\",\n" +
|
||||
" \"调解员(签字):\",\n" +
|
||||
" \"调解机构(盖章):\"\n" +
|
||||
" ]\n" +
|
||||
|
||||
Reference in New Issue
Block a user