Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev

This commit was merged in pull request #133.
This commit is contained in:
2024-04-08 14:06:25 +08:00
committed by Gitea
24 changed files with 1306 additions and 660 deletions
@@ -49,7 +49,6 @@ public class RuoYiApplication
if(CollectionUtil.isNotEmpty(sysUsers)){ if(CollectionUtil.isNotEmpty(sysUsers)){
for (SysUser sysUser : sysUsers) { for (SysUser sysUser : sysUsers) {
redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser); redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
redisCache.setCacheObject(CacheConstants.USER_EMAIL_KEY+sysUser.getEmail(),sysUser);
} }
} }
// 初始化角色redis // 初始化角色redis
@@ -1,16 +1,28 @@
package com.ruoyi.web.controller.wisdomarbitrate.mscase; package com.ruoyi.web.controller.wisdomarbitrate.mscase;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.config.ServerConfig;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.domain.vo.mscase.SendRoomNoMessageVO;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.VideoCallBackVO; import com.ruoyi.wisdomarbitrate.domain.vo.mscase.VideoCallBackVO;
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService; import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid; import javax.validation.Valid;
/** /**
@@ -24,6 +36,12 @@ import javax.validation.Valid;
public class MsVideoConferenceController extends BaseController { public class MsVideoConferenceController extends BaseController {
@Autowired @Autowired
private VideoConferenceService videoService; private VideoConferenceService videoService;
@Autowired
private ServerConfig serverConfig;
@Autowired
private MsCaseAttachMapper msCaseAttachMapper;
@Autowired
private MsCaseApplicationService caseApplicationService;
/** /**
* 根据案件ID查询视频 * 根据案件ID查询视频
* @param caseId 案件id * @param caseId 案件id
@@ -34,8 +52,82 @@ public class MsVideoConferenceController extends BaseController {
return videoService.videoList(caseId); return videoService.videoList(caseId);
} }
/**
* 通用上传请求(单个)
* param officeFlag: 是否上传到onlyoffice,0-否,1-是
*/
@PostMapping("/upload")
public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam("annexType") Integer annexType, @RequestParam(value = "officeFlag", required = false) Integer officeFlag,@RequestParam(value = "caseId") Long caseId) throws Exception
{
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
if(officeFlag != null && officeFlag == 1){
// officeFlag,fileName为annexPath
JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,caseId);
if(jsonArray!=null && jsonArray.size() > 0) {
MsCaseAttach caseAttach=null;
for (Object obj : jsonArray) {
JSONObject jsonObject = (JSONObject) obj;
caseAttach = MsCaseAttach.builder()
.caseAppliId(caseId)
.annexName(jsonObject.getString("fileName"))
.annexPath(jsonObject.getString("filePath"))
.annexType(annexType)
.onlyOfficeFileId(jsonObject.getString("fileId"))
.build();
msCaseAttachMapper.save(caseAttach);
}
if(caseAttach==null){
return AjaxResult.error("上传失败");
}
AjaxResult ajax = AjaxResult.success();
ajax.put("annexId", caseAttach.getAnnexId());
ajax.put("annexType", annexType);
// ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
}else {
return AjaxResult.error("上传失败");
}
}else {
Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId);
// 是否上传到onlyoffice
AjaxResult ajax = AjaxResult.success();
ajax.put("annexId", annexId);
ajax.put("annexType", annexType);
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
}
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
private Long saveCaseAttach(Integer annexType, String path, String originalFilename,Long caseId) {
MsCaseAttach caseAttach = MsCaseAttach.builder()
.annexName(originalFilename)
.caseAppliId(caseId)
.annexPath(path)
.annexType(annexType)
.useId(SecurityUtils.getUserId())
.useAccount(SecurityUtils.getUsername())
.build();
msCaseAttachMapper.save(caseAttach);
return caseAttach.getAnnexId();
}
/** /**
* 从腾讯云下载文件到本地 * 从腾讯云下载文件到本地
* @param * @param
@@ -49,6 +141,13 @@ public class MsVideoConferenceController extends BaseController {
} }
return success(); return success();
} }
@Anonymous
@PostMapping("/smsRollBack")
public AjaxResult smsRollBack( @RequestBody String body, HttpServletRequest request) {
logger.info("短信回调======"+body);
videoService.smsRollBack(body,request);
return success();
}
/** /**
* 根据房间号绑定案件ID * 根据房间号绑定案件ID
* @param * @param
@@ -110,6 +209,17 @@ public class MsVideoConferenceController extends BaseController {
return videoService.secretaryRoleByUserId(userId,caseId); return videoService.secretaryRoleByUserId(userId,caseId);
} }
/**
* 根据案件id查询申请人/被申请人会议上传附件按钮权限
* @param caseId
* @return
*/
@Anonymous
@GetMapping("selectRoleMenuByCaseId")
public AjaxResult selectRoleMenuByCaseId( @RequestParam(value = "caseId",required = true) Long caseId) {
return videoService.selectRoleMenuByCaseId(caseId);
}
/** /**
* 根据html字符串转pdf并和案件关联 * 根据html字符串转pdf并和案件关联
* @param reservedConferenceVO * @param reservedConferenceVO
@@ -58,7 +58,7 @@ public class CacheConstants
/** /**
* 用户邮箱 redis key * 用户邮箱 redis key
*/ */
public static final String USER_EMAIL_KEY = "user_email_key:"; // public static final String USER_EMAIL_KEY = "user_email_key:";
/** /**
* 角色 redis key * 角色 redis key
*/ */
@@ -21,6 +21,7 @@ public enum AnnexTypeEnum implements EnumsInterface {
RES_PAYMENT_RECEIPT(9, "被申请人缴费单"), RES_PAYMENT_RECEIPT(9, "被申请人缴费单"),
SEAL_PICTURE(10, "印章图片"), SEAL_PICTURE(10, "印章图片"),
FLOW_SVG(11, "流程节点SVG"), FLOW_SVG(11, "流程节点SVG"),
MEETING_FILE(12, "被申请人证据"),
; ;
@@ -0,0 +1,64 @@
package com.ruoyi.common.enums;
import com.ruoyi.common.interfaces.EnumsInterface;
/**
* @author wangqiong
* @description 短信状态枚举
* @date 2023-11-17 14:05
*/
public enum SMSStatusEnum implements EnumsInterface
{
SUCCESS(1, "成功"),
SENDING(2, "发送中"),
FAIL(3, "失败"),
;
private final Integer code;
private final String text;
SMSStatusEnum(Integer code, String text)
{
this.code = code;
this.text = text;
}
public Integer getCode()
{
return code;
}
public String getText()
{
return text;
}
/**
* 根据code获取text
* @param codeNo
* @return
*/
public static String getTextByCode(Integer codeNo){
for (SMSStatusEnum value : SMSStatusEnum.values()) {
if (value.getCode().equals(codeNo)){
return value.getText();
}
}
return codeNo.toString();
}
/**
* 根据text获取code
* @param textStr
* @return
*/
public static String getCodeByText(String textStr){
for (SMSStatusEnum value : SMSStatusEnum.values()) {
if (value.getText().equals(textStr)){
return value.getText();
}
}
return textStr;
}
}
@@ -1,5 +1,7 @@
package com.ruoyi.common.utils; package com.ruoyi.common.utils;
import cn.hutool.json.JSONObject;
import com.ruoyi.common.enums.SMSStatusEnum;
import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException; import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.sms.v20210111.SmsClient; import com.tencentcloudapi.sms.v20210111.SmsClient;
@@ -24,7 +26,8 @@ public class SmsUtils {
//签名内容 //签名内容
private static final String SIGN_NAME = "乙巢智慧仲裁网"; private static final String SIGN_NAME = "乙巢智慧仲裁网";
public static Boolean sendSms(SendSmsRequest request) { public static JSONObject sendSms(SendSmsRequest request) {
JSONObject jsonObject = new JSONObject();
Credential cred = new Credential(SECRET_ID, SECRET_KEY ); Credential cred = new Credential(SECRET_ID, SECRET_KEY );
SmsClient client = new SmsClient(cred, "ap-guangzhou"); SmsClient client = new SmsClient(cred, "ap-guangzhou");
@@ -40,18 +43,23 @@ public class SmsUtils {
res = client.SendSms(req); res = client.SendSms(req);
} catch (TencentCloudSDKException e) { } catch (TencentCloudSDKException e) {
log.error("发送短信出错:", e); log.error("发送短信出错:", e);
return Boolean.FALSE; jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
return jsonObject;
} }
SendStatus sendStatus = res.getSendStatusSet()[0]; SendStatus sendStatus = res.getSendStatusSet()[0];
log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage()); log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){ if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){
return Boolean.TRUE; jsonObject.set("status", SMSStatusEnum.SENDING.getCode());
}else {
jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
} }
return Boolean.FALSE; jsonObject.set("sid", sendStatus.getSerialNo());
return jsonObject;
} }
public static Boolean sendSms(Long caseId,String templateId,String phone,String[] templateParamSet) { public static JSONObject sendSms(Long caseId,String templateId,String phone,String[] templateParamSet) {
SendSmsRequest request = new SendSmsRequest(phone,templateId,templateParamSet,caseId); JSONObject jsonObject = new JSONObject();
SmsUtils1.SendSmsRequest request = new SmsUtils1.SendSmsRequest(phone,templateId,templateParamSet,caseId);
Credential cred = new Credential(SECRET_ID, SECRET_KEY ); Credential cred = new Credential(SECRET_ID, SECRET_KEY );
SmsClient client = new SmsClient(cred, "ap-guangzhou"); SmsClient client = new SmsClient(cred, "ap-guangzhou");
@@ -66,16 +74,19 @@ public class SmsUtils {
try { try {
res = client.SendSms(req); res = client.SendSms(req);
} catch (TencentCloudSDKException e) { } catch (TencentCloudSDKException e) {
log.error("发送短信出错:", e); jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
return Boolean.FALSE; return jsonObject;
} }
SendStatus sendStatus = res.getSendStatusSet()[0]; SendStatus sendStatus = res.getSendStatusSet()[0];
log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage()); log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
// todo 短信发送时,需要将SerialNo存到数据库,在短信回调时去更新短信发送状态,以及失败原因写到数据库,发送时状态统一为发送中
if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){ if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){
return Boolean.TRUE; jsonObject.set("status", SMSStatusEnum.SENDING.getCode());
}else {
jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
} }
return Boolean.FALSE; jsonObject.set("sid", sendStatus.getSerialNo());
return jsonObject;
} }
/** /**
* 参数对象 * 参数对象
@@ -78,6 +78,13 @@ public interface SysDeptMapper
*/ */
public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId); public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
/**
* 根据部门名称查询部门信息
* @param deptName
* @return
*/
public SysDept selectDeptByName(@Param("deptName") String deptName);
/** /**
* 新增部门信息 * 新增部门信息
* *
@@ -2,11 +2,13 @@ package com.ruoyi.system.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.entity.SysUserDept; import com.ruoyi.common.core.domain.entity.SysUserDept;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
@@ -66,6 +68,8 @@ public class SysUserServiceImpl implements ISysUserService {
@Autowired @Autowired
protected Validator validator; protected Validator validator;
@Autowired
private RedisCache redisCache;
/** /**
* 根据条件分页查询用户列表 * 根据条件分页查询用户列表
@@ -245,6 +249,8 @@ public class SysUserServiceImpl implements ISysUserService {
user.setCreateBy("admin"); user.setCreateBy("admin");
user.setCreateTime(DateUtils.getNowDate()); user.setCreateTime(DateUtils.getNowDate());
int rows = userMapper.insertUser(user); int rows = userMapper.insertUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
// 新增用户部门关联 // 新增用户部门关联
if(CollectionUtil.isNotEmpty(user.getDeptIds())) { if(CollectionUtil.isNotEmpty(user.getDeptIds())) {
// 先删除用户与部门关联 // 先删除用户与部门关联
@@ -273,7 +279,10 @@ public class SysUserServiceImpl implements ISysUserService {
*/ */
@Override @Override
public boolean registerUser(SysUser user) { public boolean registerUser(SysUser user) {
return userMapper.insertUser(user) > 0; int i = userMapper.insertUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
return i > 0;
} }
/** /**
@@ -308,6 +317,8 @@ public class SysUserServiceImpl implements ISysUserService {
// 新增用户与岗位管理 // 新增用户与岗位管理
insertUserPost(user); insertUserPost(user);
userMapper.updateUser(user); userMapper.updateUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
return AjaxResult.success("更新用户成功"); return AjaxResult.success("更新用户成功");
} }
@@ -332,7 +343,10 @@ public class SysUserServiceImpl implements ISysUserService {
*/ */
@Override @Override
public int updateUserStatus(SysUser user) { public int updateUserStatus(SysUser user) {
return userMapper.updateUser(user); int i = userMapper.updateUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
return i;
} }
/** /**
@@ -343,7 +357,10 @@ public class SysUserServiceImpl implements ISysUserService {
*/ */
@Override @Override
public int updateUserProfile(SysUser user) { public int updateUserProfile(SysUser user) {
return userMapper.updateUser(user); int i = userMapper.updateUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
return i;
} }
/** /**
@@ -366,7 +383,10 @@ public class SysUserServiceImpl implements ISysUserService {
*/ */
@Override @Override
public int resetPwd(SysUser user) { public int resetPwd(SysUser user) {
return userMapper.updateUser(user); int i = userMapper.updateUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
return i;
} }
/** /**
@@ -443,7 +463,10 @@ public class SysUserServiceImpl implements ISysUserService {
userRoleMapper.deleteUserRoleByUserId(userId); userRoleMapper.deleteUserRoleByUserId(userId);
// 删除用户与岗位表 // 删除用户与岗位表
userPostMapper.deleteUserPostByUserId(userId); userPostMapper.deleteUserPostByUserId(userId);
return userMapper.deleteUserById(userId); int i = userMapper.deleteUserById(userId);
// 删除缓存
redisCache.deleteObject(CacheConstants.USER_KEY+userId);
return i;
} }
/** /**
@@ -465,7 +488,12 @@ public class SysUserServiceImpl implements ISysUserService {
userPostMapper.deleteUserPost(userIds); userPostMapper.deleteUserPost(userIds);
// 删除用户部门关联 // 删除用户部门关联
userDeptMapper.deleteUserByIds(userIds); userDeptMapper.deleteUserByIds(userIds);
return userMapper.deleteUserByIds(userIds); int i = userMapper.deleteUserByIds(userIds);
for (Long userId : userIds) {
// 删除缓存
redisCache.deleteObject(CacheConstants.USER_KEY+userId);
}
return i;
} }
/** /**
@@ -495,6 +523,8 @@ public class SysUserServiceImpl implements ISysUserService {
user.setPassword(SecurityUtils.encryptPassword(password)); user.setPassword(SecurityUtils.encryptPassword(password));
user.setCreateBy(operName); user.setCreateBy(operName);
userMapper.insertUser(user); userMapper.insertUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
successNum++; successNum++;
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功"); successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
} else if (isUpdateSupport) { } else if (isUpdateSupport) {
@@ -504,6 +534,8 @@ public class SysUserServiceImpl implements ISysUserService {
user.setUserId(u.getUserId()); user.setUserId(u.getUserId());
user.setUpdateBy(operName); user.setUpdateBy(operName);
userMapper.updateUser(user); userMapper.updateUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
successNum++; successNum++;
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功"); successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
} else { } else {
@@ -42,12 +42,21 @@ public class SmsSendRecord extends BaseEntity {
* 发送状态 * 发送状态
*/ */
private Integer sendStatus; 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.caseId = caseId;
this.caseNum = caseNum; this.caseNum = caseNum;
this.phone = phone; this.phone = phone;
this.sendTime = sendTime; this.sendTime = sendTime;
this.sendContent = sendContent; this.sendContent = sendContent;
this.sid = sid;
} }
} }
@@ -215,6 +215,11 @@ public class MsCaseApplication {
*/ */
@Column(name = "case_source") @Column(name = "case_source")
private String caseSource; private String caseSource;
/**
* 是否需要用印,1-需要
*/
@Column(name = "seal_flag")
private Integer sealFlag;
/** /**
* 拒绝原因 * 拒绝原因
*/ */
@@ -120,5 +120,9 @@ public class MsCaseApplicationReq {
*/ */
private Integer roleType; private Integer roleType;
private Long userId; private Long userId;
/**
* 是否需要用印,0-不需要,1-需要
*/
// todo 等会放开
private Integer sealFlag=0;
} }
@@ -19,4 +19,6 @@ public interface SmsRecordMapper {
* @return * @return
*/ */
int batchSaveSmsSendRecord(@Param("list") List<SmsSendRecord> smsSendRecordList); int batchSaveSmsSendRecord(@Param("list") List<SmsSendRecord> smsSendRecordList);
SmsSendRecord selectBySId(@Param("sid") String sid);
void updateStatus (SmsSendRecord smsSendRecord);
} }
@@ -2,11 +2,13 @@ package com.ruoyi.wisdomarbitrate.service.miniprogress.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.SMSStatusEnum;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.common.utils.SmsUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
@@ -43,6 +45,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
private SysUserRoleMapper userRoleMapper; private SysUserRoleMapper userRoleMapper;
@Autowired @Autowired
private IdentityAuthenticationMapper identityAuthenticationMapper; private IdentityAuthenticationMapper identityAuthenticationMapper;
@Autowired
private RedisCache redisCache;
@Override @Override
public AjaxResult sendCode(WeChatUserVO userVO) { public AjaxResult sendCode(WeChatUserVO userVO) {
@@ -58,8 +62,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
// 1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。 // 1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。
request.setPhone(userVO.getPhone()); request.setPhone(userVO.getPhone());
request.setTemplateParamSet(new String[]{ code}); request.setTemplateParamSet(new String[]{ code});
Boolean flag = SmsUtils.sendSms(request); JSONObject resultObj = SmsUtils.sendSms(request);
if(flag){ if(resultObj.get("status")!=null && !resultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())){
setCodeCache(userVO.getPhone(),code); setCodeCache(userVO.getPhone(),code);
return AjaxResult.success("短信发送成功"); return AjaxResult.success("短信发送成功");
}else { }else {
@@ -136,6 +140,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
sysUser.setEmail(ientityAuthentication.getEmail()); sysUser.setEmail(ientityAuthentication.getEmail());
sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord())); sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
sysUserMapper.updateUser(sysUser); sysUserMapper.updateUser(sysUser);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
ientityAuthentication.setUserId(sysUser.getUserId()); ientityAuthentication.setUserId(sysUser.getUserId());
int count=0; int count=0;
if(CollectionUtil.isNotEmpty(sysUser.getRoles()) && roleIdByName!=null){ if(CollectionUtil.isNotEmpty(sysUser.getRoles()) && roleIdByName!=null){
@@ -169,6 +175,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
if(row<1) { if(row<1) {
return AjaxResult.warn("注册失败"); return AjaxResult.warn("注册失败");
} }
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
if(roleIdByName!=null) { if(roleIdByName!=null) {
// 用户关联被申请人角色 // 用户关联被申请人角色
userRoleMapper.insertUserRole(sysUser.getUserId(), roleIdByName); userRoleMapper.insertUserRole(sysUser.getUserId(), roleIdByName);
@@ -295,7 +295,7 @@ public interface MsCaseApplicationService {
* @param affiliate 案件人员 * @param affiliate 案件人员
* @param sendContent 发送内容 * @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 案件基本信息 * @param application 案件基本信息
@@ -4,6 +4,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.ReservedConference; import com.ruoyi.wisdomarbitrate.domain.dto.mscase.ReservedConference;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
/** /**
@@ -80,4 +81,13 @@ public interface VideoConferenceService {
* @throws Exception * @throws Exception
*/ */
AjaxResult reservedConference( MsReservedConferenceVO reservedConferenceVO) throws Exception; AjaxResult reservedConference( MsReservedConferenceVO reservedConferenceVO) throws Exception;
/**
* 短信回调
* @param body
* @param request
*/
void smsRollBack(String body, HttpServletRequest request);
AjaxResult selectRoleMenuByCaseId(Long caseId);
} }
@@ -11,10 +11,10 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.AnnexTypeEnum; import com.ruoyi.common.enums.AnnexTypeEnum;
import com.ruoyi.common.enums.PaymentStatusEnum; import com.ruoyi.common.enums.PaymentStatusEnum;
import com.ruoyi.common.enums.SMSStatusEnum;
import com.ruoyi.common.enums.YesOrNoEnum; import com.ruoyi.common.enums.YesOrNoEnum;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SmsUtils;
import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.dto.PayRequest; import com.ruoyi.dto.PayRequest;
import com.ruoyi.dto.PayResponse; import com.ruoyi.dto.PayResponse;
@@ -384,22 +384,24 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
continue; continue;
} }
if (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2)) { if (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2)) {
Boolean smsFlag = true; JSONObject jsonObject = new JSONObject();
SmsSendRecord smsSendRecord = null; SmsSendRecord smsSendRecord = null;
if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) { if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
// 缴费通过 // 缴费通过
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()}); // todo 短信
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 { } 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},请知晓,如非本人操作,请忽略本短信 // 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) { if (jsonObject.get("ststus")!=null && !jsonObject.get("ststus").equals(SMSStatusEnum.FAIL)) {
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode()); smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
} else { } else {
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode()); smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
} }
smsRecordMapper.saveSmsSendRecord(smsSendRecord); smsRecordMapper.saveSmsSendRecord(smsSendRecord);
} }
@@ -412,22 +414,24 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
continue; continue;
} }
if (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4)) { if (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4)) {
Boolean smsFlag = true; JSONObject jsonObject = new JSONObject();
SmsSendRecord smsSendRecord = null; SmsSendRecord smsSendRecord = null;
if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) { if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
// todo 短信
// 缴费通过 // 缴费通过
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{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() + ",您的调解申请费用已缴费成功。"); smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。",jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
} else { } 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},请知晓,如非本人操作,请忽略本短信 // 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) { if (jsonObject.get("status")!=null && !jsonObject.get("status").equals(SMSStatusEnum.FAIL)) {
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode()); smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
} else { } else {
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode()); smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
} }
smsRecordMapper.saveSmsSendRecord(smsSendRecord); smsRecordMapper.saveSmsSendRecord(smsSendRecord);
} }
@@ -469,13 +473,16 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
@Transactional @Transactional
public void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone ) { public void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone ) {
// 申请人被申请人发送受理通知书 2073601 尊敬的{1}用户,您的{2}案件,已成功受理,请知晓,如非本人操作,请忽略本短信。 // 申请人被申请人发送受理通知书 2073601 尊敬的{1}用户,您的{2}案件,已成功受理,请知晓,如非本人操作,请忽略本短信。
Boolean smsFlag = SmsUtils.sendSms(caseAppllication.getId(), "2073601", phone, new String[]{userName, caseAppllication.getCaseNum()}); // todo 短信
SmsSendRecord smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), phone, new Date(), "尊敬的" + userName + "用户,您的" + caseAppllication.getCaseNum() + "案件,已成功受理,请知晓,如非本人操作,请忽略本短信。");
// 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) { if (jsonObject.get("status")!=null && !jsonObject.get("status").equals(SMSStatusEnum.FAIL)) {
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode()); smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
} else { } else {
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode()); smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
} }
smsRecordMapper.saveSmsSendRecord(smsSendRecord); smsRecordMapper.saveSmsSendRecord(smsSendRecord);
@@ -596,9 +596,13 @@ public class MsSignSealServiceImpl implements MsSignSealService {
Gson gson = new Gson(); Gson gson = new Gson();
EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecord); EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecord);
JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class); JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); if(signUrlJsonObject.get("data")==null||signUrlJsonObject.get("data").isJsonNull()){
String urlapply = signUrlData.get("shortUrl").getAsString(); throw new ServiceException("该用户和流程无关,不能查看当前流程");
sealSignRecordres.setSealUrl(urlapply); }else {
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
String urlapply = signUrlData.get("shortUrl").getAsString();
sealSignRecordres.setSealUrl(urlapply);
}
} }
return AjaxResult.success(sealSignRecordres); return AjaxResult.success(sealSignRecordres);
}else { }else {
@@ -722,7 +726,14 @@ public class MsSignSealServiceImpl implements MsSignSealService {
if(signStatusResponse!=null&&signStatusResponse.intValue()==1&& if(signStatusResponse!=null&&signStatusResponse.intValue()==1&&
signStatusMediator!=null&&signStatusMediator.intValue()==1){ signStatusMediator!=null&&signStatusMediator.intValue()==1){
// 根据流程id查找下一个流程节点 // 根据流程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(); MsCaseApplication application = new MsCaseApplication();
application.setId(caseApplicationselect.getId()); application.setId(caseApplicationselect.getId());
application.setCaseFlowId(nextFlow.getId()); application.setCaseFlowId(nextFlow.getId());
@@ -730,8 +741,17 @@ public class MsSignSealServiceImpl implements MsSignSealService {
caseApplicationMapper.updateByPrimaryKeySelective(application); caseApplicationMapper.updateByPrimaryKeySelective(application);
//修改"签署用印记录表"的状态为待用印 //修改"签署用印记录表"的状态为待用印
sealSignRecordsel.setSignFlowStatus(2); if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); 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)){ }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){
//被申请人签名 //被申请人签名
@@ -755,8 +775,17 @@ public class MsSignSealServiceImpl implements MsSignSealService {
caseApplicationMapper.updateByPrimaryKeySelective(application); caseApplicationMapper.updateByPrimaryKeySelective(application);
//修改"签署用印记录表"的状态为待用印 //修改"签署用印记录表"的状态为待用印
sealSignRecordsel.setSignFlowStatus(2); if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); 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)){ }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountMedi)){
//调解员签名 //调解员签名
@@ -780,10 +809,16 @@ public class MsSignSealServiceImpl implements MsSignSealService {
caseApplicationMapper.updateByPrimaryKeySelective(application); caseApplicationMapper.updateByPrimaryKeySelective(application);
//修改"签署用印记录表"的状态为待用印 //修改"签署用印记录表"的状态为待用印
sealSignRecordsel.setSignFlowStatus(2); if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
sealSignRecordsel.setSignFlowStatus(2);
}else {
// 否则为已完成
sealSignRecordsel.setSignFlowStatus(3);
}
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); 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.setSealStatus(1);
sealSignRecordsel.setSignFlowStatus(3); sealSignRecordsel.setSignFlowStatus(3);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
@@ -804,73 +839,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
caseApplicationMapper.updateByPrimaryKeySelective(application); caseApplicationMapper.updateByPrimaryKeySelective(application);
//下载审核完成的调解书 //下载审核完成的调解书
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId); downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
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(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){ }else if(mediaResult.intValue()==5){
@@ -932,7 +902,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath); boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
if (downLoadFile) { if (downLoadFile) {
// 先删除已经存在的调解书 // 先删除已经存在的调解书
if(StrUtil.isEmpty(application.getCaseSource())){ if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode()); List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
if(CollectionUtil.isNotEmpty(existAttach)){ if(CollectionUtil.isNotEmpty(existAttach)){
// todo 对接北明,同步案件状态,删除 // todo 对接北明,同步案件状态,删除
@@ -940,7 +910,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){ if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
continue; 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); boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
if (downLoadFile) { if (downLoadFile) {
// 先删除已经存在的调解书 // 先删除已经存在的调解书
if(StrUtil.isEmpty(application.getCaseSource())){ if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode()); List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
if(CollectionUtil.isNotEmpty(existAttach)){ if(CollectionUtil.isNotEmpty(existAttach)){
// todo 对接北明,同步案件状态,删除 // todo 对接北明,同步案件状态,删除
@@ -1032,7 +1002,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){ if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
continue; 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"); 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 @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException { public AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException {
@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.config.RuoYiConfig; 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.AnnexTypeEnum;
import com.ruoyi.common.enums.AttachmentOperateTypeEnum; import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
import com.ruoyi.common.enums.DocumentTypeEnum; import com.ruoyi.common.enums.DocumentTypeEnum;
import com.ruoyi.common.enums.SMSStatusEnum;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.PdfUtils; import com.ruoyi.common.utils.PdfUtils;
import com.ruoyi.common.utils.SecurityUtils; 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.mapper.SysUserMapper;
import com.ruoyi.system.service.impl.BeiMingInterfaceService; import com.ruoyi.system.service.impl.BeiMingInterfaceService;
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.ReservedConference; 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.MsCaseApplication;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach; import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO; import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo; import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO; 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.MsCaseApplicationMapper;
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper; import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
import com.ruoyi.wisdomarbitrate.mapper.mscase.ReservedConferenceMapper; import com.ruoyi.wisdomarbitrate.mapper.mscase.ReservedConferenceMapper;
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService; import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService;
import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException; import com.tencentcloudapi.common.exception.TencentCloudSDKException;
@@ -45,12 +52,14 @@ import tk.mybatis.mapper.entity.Example;
import javax.crypto.Mac; import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec; import javax.crypto.spec.SecretKeySpec;
import javax.servlet.http.HttpServletRequest;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; 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.core.domain.AjaxResult.success;
import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile; import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile;
import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName; import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName;
@@ -80,6 +89,8 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
@Autowired @Autowired
private MsCaseAttachMapper caseAttachMapper; private MsCaseAttachMapper caseAttachMapper;
@Autowired @Autowired
private MsCaseAffiliateMapper caseAffiliateMapper;
@Autowired
private SysRoleMapper roleMapper; private SysRoleMapper roleMapper;
@Autowired @Autowired
private ReservedConferenceMapper reservedConferenceMapper; private ReservedConferenceMapper reservedConferenceMapper;
@@ -94,6 +105,8 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
private String BMSyncSource; private String BMSyncSource;
@Autowired @Autowired
BeiMingInterfaceService beiMingInterfaceService; BeiMingInterfaceService beiMingInterfaceService;
@Autowired
private SmsRecordMapper smsRecordMapper;
/** /**
视频回调 视频回调
@@ -139,6 +152,83 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
return success("预约会议成功"); 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查询已预约的会议 * 根据案件id查询已预约的会议
* *
@@ -388,11 +478,11 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
if(caseApplication==null){ if(caseApplication==null){
return AjaxResult.error("案件不存在"); return AjaxResult.error("案件不存在");
} }
List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
boolean isSecretaryRole=false; boolean isSecretaryRole=false;
if(caseApplication.getMediatorId()!=null&& Objects.equals(userId, caseApplication.getMediatorId())){ if(caseApplication.getMediatorId()!=null&& Objects.equals(userId, caseApplication.getMediatorId())){
// 是调解员 // 是调解员
List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
if(CollectionUtil.isNotEmpty(roles)){ if(CollectionUtil.isNotEmpty(roles)){
for (SysRole role : roles) { for (SysRole role : roles) {
if("调解员".equals(role.getRoleName())){ 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); jsonObject.put("isSecretaryRole",isSecretaryRole);
@@ -288,12 +288,12 @@ public class SignAward {
} }
/** /**
* 发起签署 * 发起带有用印签署
* *
* @return * @return
* @throws EsignDemoException * @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 apiaddr = "/v3/sign-flow/create-by-file";
String fileId = sealSignRecord.getFileid(); String fileId = sealSignRecord.getFileid();
@@ -488,6 +488,162 @@ public class SignAward {
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false); 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 apiaddr = "/v3/files/" + fileId + "/keyword-positions";
String jsonParm = "{\n" + String jsonParm = "{\n" +
" \"keywords\": [\n" + " \"keywords\": [\n" +
" \"甲方(签字):\",\n" + " \"申请人(签字):\",\n" +
" \"乙方(签字):\",\n" + " \"被申请人(签字):\",\n" +
" \"调解员(签字):\",\n" + " \"调解员(签字):\",\n" +
" \"调解机构(盖章):\"\n" + " \"调解机构(盖章):\"\n" +
" ]\n" + " ]\n" +
@@ -230,4 +230,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update ms_sys_dept set del_flag = '2' where dept_id = #{deptId} update ms_sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete> </delete>
</mapper> <select id="selectDeptByName" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where dept_name=#{deptName} and del_flag = '0' limit 1
</select>
</mapper>
@@ -182,7 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ms_sys_user u from ms_sys_user u
left join ms_sys_user_role ur on u.user_id = ur.user_id left join ms_sys_user_role ur on u.user_id = ur.user_id
left join ms_sys_role r on r.role_id = ur.role_id left join ms_sys_role r on r.role_id = ur.role_id
where u.eamil = #{eamil} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1 where u.email = #{email} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
</select> </select>
<select id="selectByDeptIdAndRole" resultMap="SysUserResult"> <select id="selectByDeptIdAndRole" resultMap="SysUserResult">
select u.* from select u.* from
@@ -54,7 +54,7 @@
LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id
LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
where c.id = #{id} where c.id = #{id}
GROUP BY a.id GROUP BY a.id order by a.id asc
</select> </select>
<select id="selectUserRoleByCaseIds" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate"> <select id="selectUserRoleByCaseIds" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone, select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,
@@ -16,6 +16,7 @@
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="sendStatus" column="send_status" /> <result property="sendStatus" column="send_status" />
<result property="sid" column="sid" />
</resultMap> </resultMap>
<insert id="saveSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" useGeneratedKeys="true" keyProperty="id"> <insert id="saveSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" useGeneratedKeys="true" keyProperty="id">
@@ -27,6 +28,8 @@
<if test="sendContent != null ">send_content,</if> <if test="sendContent != null ">send_content,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="sendStatus != null ">send_status,</if> <if test="sendStatus != null ">send_status,</if>
sid,
reason,
create_time create_time
)values( )values(
<if test="caseId != null ">#{caseId},</if> <if test="caseId != null ">#{caseId},</if>
@@ -36,6 +39,8 @@
<if test="sendContent != null ">#{sendContent},</if> <if test="sendContent != null ">#{sendContent},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="sendStatus != null ">#{sendStatus},</if> <if test="sendStatus != null ">#{sendStatus},</if>
#{sid},
#{reason},
sysdate() sysdate()
) )
</insert> </insert>
@@ -49,7 +54,8 @@
send_content, send_content,
create_by, create_by,
send_status, send_status,
create_time create_time,
sid,reason
)values )values
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
( (
@@ -60,14 +66,14 @@
#{item.sendContent}, #{item.sendContent},
#{item.createBy}, #{item.createBy},
#{item.sendStatus}, #{item.sendStatus},
sysdate() sysdate(),#{sid},#{reason}
) )
</foreach> </foreach>
</insert> </insert>
<select id="getSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" resultMap="SmsSendRecordResult"> <select id="getSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" resultMap="SmsSendRecordResult">
select id ,case_appli_id ,case_num ,phone ,send_time ,send_content,send_status select *
from ms_sms_send_record from ms_sms_send_record
<where> <where>
<if test="caseNum != null and caseNum != ''"> <if test="caseNum != null and caseNum != ''">
@@ -76,5 +82,14 @@
</where> </where>
order by send_time desc order by send_time desc
</select> </select>
<select id="selectBySId" resultMap="SmsSendRecordResult">
select * from ms_sms_send_record where sid=#{sid}
</select>
<update id="updateStatus">
update ms_sms_send_record
set send_status= #{sendStatus} ,reason=#{reason} where sid=#{sid}
</update>
</mapper> </mapper>