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)){
for (SysUser sysUser : sysUsers) {
redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
redisCache.setCacheObject(CacheConstants.USER_EMAIL_KEY+sysUser.getEmail(),sysUser);
}
}
// 初始化角色redis
@@ -1,16 +1,28 @@
package com.ruoyi.web.controller.wisdomarbitrate.mscase;
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.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController;
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.SendRoomNoMessageVO;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
/**
@@ -24,6 +36,12 @@ import javax.validation.Valid;
public class MsVideoConferenceController extends BaseController {
@Autowired
private VideoConferenceService videoService;
@Autowired
private ServerConfig serverConfig;
@Autowired
private MsCaseAttachMapper msCaseAttachMapper;
@Autowired
private MsCaseApplicationService caseApplicationService;
/**
* 根据案件ID查询视频
* @param caseId 案件id
@@ -34,8 +52,82 @@ public class MsVideoConferenceController extends BaseController {
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
@@ -49,6 +141,13 @@ public class MsVideoConferenceController extends BaseController {
}
return success();
}
@Anonymous
@PostMapping("/smsRollBack")
public AjaxResult smsRollBack( @RequestBody String body, HttpServletRequest request) {
logger.info("短信回调======"+body);
videoService.smsRollBack(body,request);
return success();
}
/**
* 根据房间号绑定案件ID
* @param
@@ -110,6 +209,17 @@ public class MsVideoConferenceController extends BaseController {
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并和案件关联
* @param reservedConferenceVO
@@ -58,7 +58,7 @@ public class CacheConstants
/**
* 用户邮箱 redis key
*/
public static final String USER_EMAIL_KEY = "user_email_key:";
// public static final String USER_EMAIL_KEY = "user_email_key:";
/**
* 角色 redis key
*/
@@ -21,6 +21,7 @@ public enum AnnexTypeEnum implements EnumsInterface {
RES_PAYMENT_RECEIPT(9, "被申请人缴费单"),
SEAL_PICTURE(10, "印章图片"),
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;
import cn.hutool.json.JSONObject;
import com.ruoyi.common.enums.SMSStatusEnum;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.sms.v20210111.SmsClient;
@@ -24,7 +26,8 @@ public class SmsUtils {
//签名内容
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 );
SmsClient client = new SmsClient(cred, "ap-guangzhou");
@@ -40,18 +43,23 @@ public class SmsUtils {
res = client.SendSms(req);
} catch (TencentCloudSDKException e) {
log.error("发送短信出错:", e);
return Boolean.FALSE;
jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
return jsonObject;
}
SendStatus sendStatus = res.getSendStatusSet()[0];
log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
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) {
SendSmsRequest request = new SendSmsRequest(phone,templateId,templateParamSet,caseId);
public static JSONObject sendSms(Long caseId,String templateId,String phone,String[] templateParamSet) {
JSONObject jsonObject = new JSONObject();
SmsUtils1.SendSmsRequest request = new SmsUtils1.SendSmsRequest(phone,templateId,templateParamSet,caseId);
Credential cred = new Credential(SECRET_ID, SECRET_KEY );
SmsClient client = new SmsClient(cred, "ap-guangzhou");
@@ -66,16 +74,19 @@ public class SmsUtils {
try {
res = client.SendSms(req);
} catch (TencentCloudSDKException e) {
log.error("发送短信出错:", e);
return Boolean.FALSE;
jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
return jsonObject;
}
SendStatus sendStatus = res.getSendStatusSet()[0];
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())){
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);
/**
* 根据部门名称查询部门信息
* @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 com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.UserConstants;
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.domain.entity.SysUserDept;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
@@ -66,6 +68,8 @@ public class SysUserServiceImpl implements ISysUserService {
@Autowired
protected Validator validator;
@Autowired
private RedisCache redisCache;
/**
* 根据条件分页查询用户列表
@@ -245,6 +249,8 @@ public class SysUserServiceImpl implements ISysUserService {
user.setCreateBy("admin");
user.setCreateTime(DateUtils.getNowDate());
int rows = userMapper.insertUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
// 新增用户部门关联
if(CollectionUtil.isNotEmpty(user.getDeptIds())) {
// 先删除用户与部门关联
@@ -273,7 +279,10 @@ public class SysUserServiceImpl implements ISysUserService {
*/
@Override
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);
userMapper.updateUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
return AjaxResult.success("更新用户成功");
}
@@ -332,7 +343,10 @@ public class SysUserServiceImpl implements ISysUserService {
*/
@Override
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
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
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);
// 删除用户与岗位表
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);
// 删除用户部门关联
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.setCreateBy(operName);
userMapper.insertUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
successNum++;
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
} else if (isUpdateSupport) {
@@ -504,6 +534,8 @@ public class SysUserServiceImpl implements ISysUserService {
user.setUserId(u.getUserId());
user.setUpdateBy(operName);
userMapper.updateUser(user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
successNum++;
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
} else {
@@ -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;
}
}
@@ -215,6 +215,11 @@ public class MsCaseApplication {
*/
@Column(name = "case_source")
private String caseSource;
/**
* 是否需要用印,1-需要
*/
@Column(name = "seal_flag")
private Integer sealFlag;
/**
* 拒绝原因
*/
@@ -120,5 +120,9 @@ public class MsCaseApplicationReq {
*/
private Integer roleType;
private Long userId;
/**
* 是否需要用印,0-不需要,1-需要
*/
// todo 等会放开
private Integer sealFlag=0;
}
@@ -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);
}
@@ -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);
@@ -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 案件基本信息
@@ -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);
}
@@ -3,7 +3,6 @@ package com.ruoyi.wisdomarbitrate.service.mscase.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
@@ -297,19 +296,34 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
if(vo.getOrganizeFlag()==null || vo.getOrganizeFlag()!=1) {
if (StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("申请人")
&& affiliate.getRoleType() != null && affiliate.getRoleType() == 1&&StrUtil.isNotEmpty(affiliate.getName())) {
&& affiliate.getRoleType() != null && affiliate.getRoleType() == 1&&StrUtil.isNotEmpty(affiliate.getName())
&& !applicantName.toString().contains(affiliate.getName())) {
applicantName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
}
}else {
// 组织机构
if ( affiliate.getRoleType() != null && affiliate.getRoleType() == 1&&StrUtil.isNotEmpty(affiliate.getApplicantOrgName())) {
if ( affiliate.getRoleType() != null && affiliate.getRoleType() == 1&&StrUtil.isNotEmpty(affiliate.getApplicantOrgName())
&& !applicantName.toString().contains(affiliate.getApplicantOrgName())) {
applicantName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA);
}
}
if(StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("被申请人")
&& affiliate.getRoleType()!=null && affiliate.getRoleType()==3&&StrUtil.isNotEmpty(affiliate.getName())){
if(vo.getOrganizeFlag()==null || vo.getOrganizeFlag()!=1) {
if (StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("被申请人")
&& affiliate.getRoleType() != null && affiliate.getRoleType() == 3&&StrUtil.isNotEmpty(affiliate.getName())
&& !respondentName.toString().contains(affiliate.getName())) {
respondentName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
}
}else {
// 组织机构
if ( affiliate.getRoleType() != null && affiliate.getRoleType() == 3&&StrUtil.isNotEmpty(affiliate.getApplicantOrgName())&& !respondentName.toString().contains(affiliate.getApplicantOrgName())) {
respondentName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA);
}
}
// if(StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("被申请人")
// && affiliate.getRoleType()!=null && affiliate.getRoleType()==3&&StrUtil.isNotEmpty(affiliate.getName())){
// respondentName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
// }
}
vo.setApplicationName(removeLastComma(applicantName.toString(),Constants.CN_SPLIT_COMMA));
@@ -694,7 +708,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
*/
@Transactional
public void setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder) {
boolean b = caseApplication.getOrganizeFlag() != 1 && affiliate.getRoleType() == 1 && StrUtil.isEmpty(affiliate.getEmail());
boolean b = caseApplication.getOrganizeFlag() != 1 && (affiliate.getRoleType() == 1||affiliate.getRoleType() == 3) && StrUtil.isEmpty(affiliate.getEmail());
if(affiliate==null ||b|| StrUtil.isEmpty(affiliate.getName())){
return;
}
@@ -753,13 +767,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
caseApplicationService.insertAfficateUser(affiliate, roleIdList);
} else {
// 申请机构
if (affiliate.getRoleType() == 1) {
if (affiliate.getRoleType() == 1 || affiliate.getRoleType()==3) {
affiliate.setOperatorFlag(0);
// 申请人,从缓存中判断部门是否存在
Object deptCache = redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName());
if (ObjectUtil.isEmpty(deptCache)) {
// Object deptCache = redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName());
SysDept dept = sysDeptMapper.selectDeptByName(affiliate.getName());
if (dept==null) {
// 不存在该部门,新增
SysDept dept = new SysDept();
dept = new SysDept();
dept.setParentId(0L);
dept.setDeptName(affiliate.getName());
dept.setAncestors("0");
@@ -775,11 +790,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
dept.setNationality(affiliate.getNationality());
sysDeptMapper.insertDept(dept);
// 更新缓存
redisCache.setCacheObject(CacheConstants.DEPT_KEY + dept.getDeptName(), dept.getDeptId());
// redisCache.setCacheObject(CacheConstants.DEPT_KEY + dept.getDeptName(), dept.getDeptId());
}else {
// 更新部门
SysDept dept = new SysDept();
dept.setDeptId((Long) deptCache);
dept.setCode(affiliate.getCode());
dept.setCompLegalPerson(affiliate.getCompLegalPerson());
dept.setUpdateBy(getUsername());
@@ -789,7 +802,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
dept.setAddress(affiliate.getAddress());
sysDeptMapper.updateDept(dept);
}
affiliate.setApplicantDeptId(redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName()));
affiliate.setApplicantDeptId(dept.getDeptId());
} else {
caseApplicationService.insertAfficateUser(affiliate, roleIdList);
}
@@ -813,7 +826,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// Object userEmailCache = redisCache.getCacheObject(CacheConstants.USER_EMAIL_KEY + affiliate.getEmail());
SysUser user=null;
// if(ObjectUtil.isEmpty(userEmailCache)){
user = sysUserMapper.selectUserByUserName(affiliate.getEmail());
user = sysUserMapper.selectUserByEmail(affiliate.getEmail());
// }else {
// user=(SysUser)userEmailCache;
// }
@@ -838,7 +851,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
userMapper.insertUser(user);
affiliate.setUserId(user.getUserId());
// 更新缓存
redisCache.setCacheObject(CacheConstants.USER_EMAIL_KEY + affiliate.getEmail(),user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
// redisCache.setCacheObject(CacheConstants.USER_EMAIL_KEY + affiliate.getEmail(),user);
// 查询该角色是否存在申请人角色
List<Long> roleIds = userRoleMapper.selectRoleIdsByUserId(user.getUserId());
for (Long roleId : roleIdList) {
@@ -863,8 +878,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
user.setEmail(affiliate.getEmail());
userMapper.updateUser(user);
affiliate.setUserId(user.getUserId());
// 更新缓存
redisCache.setCacheObject(CacheConstants.USER_EMAIL_KEY + affiliate.getEmail(),user);
// redis缓存
redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
// redisCache.setCacheObject(CacheConstants.USER_EMAIL_KEY + affiliate.getEmail(),user);
// 查询该角色是否存在申请人角色
List<Long> roleIds = userRoleMapper.selectRoleIdsByUserId(user.getUserId());
for (Long roleId : roleIdList) {
@@ -1663,8 +1679,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (StrUtil.isNotEmpty(affiliate.getPhone())) {
// 发送短信
// 给被申请人发送案件受理短信 2074247 待缴费通知 尊敬的用户,您编号为{1}的案件已成功提交,请登录调解系统进行缴费处理。请知晓,如非本人操作,请忽略本短信
Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2074247", affiliate.getPhone(), new String[]{application.getCaseNum()});
sendSMS(smsFlag,application, affiliate, sendContent);
// todo 短信
// cn.hutool.json.JSONObject jsonObject = SmsUtils.sendSms(application.getId(), "2074247", affiliate.getPhone(), new String[]{application.getCaseNum()});
cn.hutool.json.JSONObject jsonObject = new cn.hutool.json.JSONObject();
sendSMS(jsonObject,application, affiliate, sendContent);
} else {
// 发送邮件
@@ -1681,10 +1699,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
String sendContent = "尊敬的用户,您编号为" + application.getCaseNum() + "的案件由于"+rejectReason+"所以不予受理,请知晓,如非本人操作,请忽略本短信。";
// 电话号不为空,发送短信,否则发邮箱
if (StrUtil.isNotEmpty(affiliate.getPhone())) {
Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2065809", affiliate.getPhone(),
new String[]{application.getCaseNum(), rejectReason});
// todo 短信
// cn.hutool.json.JSONObject jsonObject = SmsUtils.sendSms(application.getId(), "2065809", affiliate.getPhone(),
// new String[]{application.getCaseNum(), rejectReason});
cn.hutool.json.JSONObject jsonObject = new cn.hutool.json.JSONObject();
// 发送短信
sendSMS(smsFlag,application, affiliate, sendContent);
sendSMS(jsonObject,application, affiliate, sendContent);
} else {
// 发送邮件
@@ -1732,13 +1752,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
*/
@Override
@Transactional
public void sendSMS(Boolean smsFlag ,MsCaseApplication application, MsCaseAffiliate affiliate, String sendContent) {
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), affiliate.getPhone(), new Date(), sendContent);
if (smsFlag) {
public void sendSMS(cn.hutool.json.JSONObject jsonObject ,MsCaseApplication application, MsCaseAffiliate affiliate, String sendContent) {
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), affiliate.getPhone(), new Date(), sendContent,jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
if (jsonObject.get("status")!=null && !jsonObject.get("status").equals(SMSStatusEnum.FAIL.getCode())) {
// 发送成功
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
} else {
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
}
@@ -2245,14 +2265,16 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
// 电话号不为空,发送短信,否则发邮箱
if (StrUtil.isNotEmpty(sysUser.getPhonenumber())) {
Boolean smsFlag = SmsUtils.sendSms(application.getId(), templateId, sysUser.getPhonenumber(),
new String[]{caseApplication.getCaseNum(),application.getHearDate()});
// todo 短信
// cn.hutool.json.JSONObject jsonObject = SmsUtils.sendSms(application.getId(), templateId, sysUser.getPhonenumber(),
// new String[]{caseApplication.getCaseNum(), application.getHearDate()});
cn.hutool.json.JSONObject jsonObject = new cn.hutool.json.JSONObject();
// 发送短信
caseApplicationService.sendSMS(smsFlag, application, meditorAffliate, content);
caseApplicationService.sendSMS(jsonObject, caseApplication, meditorAffliate, content);
} else {
// 发送邮件
caseApplicationService.sendEmail(application, meditorAffliate, subject, content);
caseApplicationService.sendEmail(caseApplication, meditorAffliate, subject, content);
}
}
@@ -2338,10 +2360,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (notice != null) {
// 电话号不为空,发送短信,否则发邮箱
if (StrUtil.isNotEmpty(affiliate.getPhone())) {
Boolean smsFlag = SmsUtils.sendSms(application.getId(), notice.getTemplateId(), affiliate.getPhone(),
notice.getTemplateParamSet());
// todo 短信
// cn.hutool.json.JSONObject jsonObject = SmsUtils.sendSms(application.getId(), notice.getTemplateId(), affiliate.getPhone(),
// notice.getTemplateParamSet());
cn.hutool.json.JSONObject jsonObject = new cn.hutool.json.JSONObject();
// 发送短信
caseApplicationService.sendSMS(smsFlag, application, affiliate, notice.getContent());
caseApplicationService.sendSMS(jsonObject, application, affiliate, notice.getContent());
} else {
// 发送邮件
@@ -2519,6 +2543,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// int startIndex = prefix.length();
String annexPath = caseAttach.getAnnexPath();
// String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
if (annexPath.contains("/profile/upload")) {
annexPath = annexPath.replace("/profile/upload", "/home/ruoyi/uploadPath/upload");
}
String path = annexPath;
//获取文件上传地址
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
@@ -2567,6 +2594,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
sealSignRecord.setPensonAccountRes(resAffiliateOpt.get().getPhone());
sealSignRecord.setPensonNameRes(resAffiliateOpt.get().getName());
// 设置用印账号
if (req.getSealFlag().equals(1)) {
DeptIdentify deptIdentify = new DeptIdentify();
deptIdentify.setIsUse(1);
DeptIdentify deptIdentifyselect = new DeptIdentify();
@@ -2579,13 +2607,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
} else {
return AjaxResult.error("没有用印时的机构名称及经办人信息");
}
}
//解析文件签名印章位置
JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject3 = jsonArray.getJSONObject(i);
String keyword = jsonObject3.getString("keyword");
if (keyword.equals("甲方(签字):")) {
if (keyword.equals("申请人(签字):")) {
//签名
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
// 遍历 positionsArray 中的每个元素
@@ -2598,9 +2627,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
double positionX = coordinateObj.getDoubleValue("positionX");
double positionY = coordinateObj.getDoubleValue("positionY");
sealSignRecord.setPositionXpsn(positionX + 120);
sealSignRecord.setPositionYpsn(positionY);
sealSignRecord.setPositionYpsn(positionY+40);
}
} else if (keyword.equals("乙方(签字):")) {
} else if (keyword.equals("被申请人(签字):")) {
//签名
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
// 遍历 positionsArray 中的每个元素
@@ -2613,7 +2642,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
double positionX = coordinateObj.getDoubleValue("positionX");
double positionY = coordinateObj.getDoubleValue("positionY");
sealSignRecord.setPositionXpsnRes(positionX + 120);
sealSignRecord.setPositionYpsnRes(positionY + 10);
sealSignRecord.setPositionYpsnRes(positionY+10 );
}
} else if (keyword.equals("调解员(签字):")) {
//签名
@@ -2628,9 +2657,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
double positionX = coordinateObj.getDoubleValue("positionX");
double positionY = coordinateObj.getDoubleValue("positionY");
sealSignRecord.setPositionXpsnMedi(positionX + 120);
sealSignRecord.setPositionYpsnMedi(positionY + 10);
sealSignRecord.setPositionYpsnMedi(positionY+10 );
}
} else {
// 设置用印位置
if (req.getSealFlag().equals(1)) {
//用印
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
// 遍历 positionsArray 中的每个元素
@@ -2647,7 +2678,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
}
}
}
EsignHttpResponse response3 = new EsignHttpResponse();
// 设置用印位置
if (req.getSealFlag().equals(1)) {
String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称
String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名
String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式
@@ -2671,8 +2705,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
sealIdList.add(manage.getSealId());
}
}
EsignHttpResponse response3 = SignAward.createByFileMediation(sealSignRecord, sealIdList);
response3 = SignAward.createByFileSeal(sealSignRecord, sealIdList);
}
}
} else {
// 不带用印
response3 = SignAward.createByFileMediation(sealSignRecord);
}
JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
if (jsonObject3 != null) {
if (jsonObject3.getIntValue("code") == 0) {
@@ -2692,6 +2732,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
msSealSignRecord.setOrgnNamePsnName(sealSignRecord.getOrgnizeNamepsnName());
sealSignRecordMapper.insert(msSealSignRecord);
SealSignRecord sealSignRecordapply = new SealSignRecord();
sealSignRecordapply.setSignFlowid(signFlowId);
// todo
@@ -2706,18 +2747,21 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
//发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("2116857");
// todo
// 申请人发送短信
request.setPhone(applicantAffiliateOpt.get().getPhone());
request.setTemplateParamSet(new String[]{applicantAffiliateOpt.get().getName(), application.getCaseNum(), urlapplynew});
Boolean aBoolean = SmsUtils.sendSms(request);
// todo 发送短信先注释掉
// cn.hutool.json.JSONObject resultObj = SmsUtils.sendSms(request);
// todo
cn.hutool.json.JSONObject resultObj = new cn.hutool.json.JSONObject();
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(),
applicantAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + applicantAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件,签名链接https://smlt.esign.cn/" + urlapplynew + ",请点击链接签名,如非本人操作,请忽略本短信");
applicantAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + applicantAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件,签名链接https://smlt.esign.cn/" + urlapplynew + ",请点击链接签名,如非本人操作,请忽略本短信", resultObj.get("sid") != null ? resultObj.get("sid").toString() : null);
// 新增短信记录
if (aBoolean) {
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
if (resultObj.get("status") != null && !resultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())) {
smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
} else {
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
@@ -2735,14 +2779,16 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
request1.setTemplateId("2116857");
request1.setPhone(resAffiliateOpt.get().getPhone());
request1.setTemplateParamSet(new String[]{resAffiliateOpt.get().getName(), application.getCaseNum(), urlResponnew});
Boolean aBoolean1 = SmsUtils.sendSms(request1);
// todo 短信记录
// cn.hutool.json.JSONObject resultObjRes = SmsUtils.sendSms(request1);
cn.hutool.json.JSONObject resultObjRes = new cn.hutool.json.JSONObject();
SmsSendRecord resSmsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), resAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + resAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件,签名链接https://smlt.esign.cn/" + urlResponnew + ",请点击链接签名,如非本人操作,请忽略本短信");
SmsSendRecord resSmsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), resAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + resAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件,签名链接https://smlt.esign.cn/" + urlResponnew + ",请点击链接签名,如非本人操作,请忽略本短信", resultObjRes.get("sid") != null ? resultObjRes.get("sid").toString() : null);
// 新增短信记录
if (aBoolean1) {
resSmsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
if (resultObjRes.get("status") != null && !resultObjRes.get("status").equals(SMSStatusEnum.FAIL.getCode())) {
resSmsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
} else {
resSmsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
resSmsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
}
smsRecordMapper.saveSmsSendRecord(resSmsSendRecord);
// 调解员账户
@@ -2759,14 +2805,16 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
requestMedi.setTemplateId("2116857");
requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), application.getCaseNum(), urlResponnewMedi});
Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
// todo 短信注释
// cn.hutool.json.JSONObject mediaResultObj = SmsUtils.sendSms(requestMedi);
cn.hutool.json.JSONObject mediaResultObj = new cn.hutool.json.JSONObject();
SmsSendRecord smsSendRecord1 = new SmsSendRecord(application.getId(), application.getCaseNum(), sealSignRecord.getPensonAccountMedi(), new Date(), "尊敬的" + sealSignRecord.getPensonNameMedi() + "用户,您的" + application.getCaseNum() + "调解案件,签名链接https://smlt.esign.cn/" + urlResponnewMedi + ",请点击链接签名,如非本人操作,请忽略本短信");
SmsSendRecord smsSendRecord1 = new SmsSendRecord(application.getId(), application.getCaseNum(), sealSignRecord.getPensonAccountMedi(), new Date(), "尊敬的" + sealSignRecord.getPensonNameMedi() + "用户,您的" + application.getCaseNum() + "调解案件,签名链接https://smlt.esign.cn/" + urlResponnewMedi + ",请点击链接签名,如非本人操作,请忽略本短信", mediaResultObj.get("sid") != null ? mediaResultObj.get("sid").toString() : null);
// 新增短信记录
if (aBooleanMedi) {
smsSendRecord1.setSendStatus(YesOrNoEnum.YES.getCode());
if (mediaResultObj.get("status") != null && !mediaResultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())) {
smsSendRecord1.setSendStatus(SMSStatusEnum.SENDING.getCode());
} else {
smsSendRecord1.setSendStatus(YesOrNoEnum.NO.getCode());
smsSendRecord1.setSendStatus(SMSStatusEnum.FAIL.getCode());
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord1);
@@ -2776,7 +2824,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
} else {
return AjaxResult.error();
}
}
} else {
return AjaxResult.error();
}
@@ -2801,8 +2849,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
} else {
return AjaxResult.error();
}
}
break;
}
}
}
@@ -2817,13 +2866,15 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
request.setTemplateId("2066725");
request.setPhone(applicantAffiliateOpt.get().getPhone());
request.setTemplateParamSet(new String[]{applicantAffiliateOpt.get().getName(), application.getCaseNum()});
Boolean aBoolean = SmsUtils.sendSms(request);
// todo 短信
// cn.hutool.json.JSONObject jsonObject = SmsUtils.sendSms(request);
cn.hutool.json.JSONObject jsonObject = new cn.hutool.json.JSONObject();
// 新增短信记录
SmsSendRecord appSmsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), applicantAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + applicantAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件已终止调解,如非本人操作,请忽略本短信");
if (aBoolean) {
appSmsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
SmsSendRecord appSmsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), applicantAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + applicantAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件已终止调解,如非本人操作,请忽略本短信", jsonObject.get("sid") != null ? jsonObject.get("sid").toString() : null);
if (jsonObject.get("status") != null && !jsonObject.get("status").equals(SMSStatusEnum.FAIL.getCode())) {
appSmsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
} else {
appSmsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
appSmsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
}
smsRecordMapper.saveSmsSendRecord(appSmsSendRecord);
// 被申请人短信
@@ -2831,13 +2882,15 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
request1.setTemplateId("2066725");
request1.setPhone(resAffiliateOpt.get().getPhone());
request1.setTemplateParamSet(new String[]{resAffiliateOpt.get().getName(), application.getCaseNum()});
Boolean aBoolean1 = SmsUtils.sendSms(request1);
// todo 短信注释
// cn.hutool.json.JSONObject resJsonObject = SmsUtils.sendSms(request1);
cn.hutool.json.JSONObject resJsonObject = new cn.hutool.json.JSONObject();
// 新增短信记录
SmsSendRecord resSmsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), resAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + resAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件已终止调解,如非本人操作,请忽略本短信");
if (aBoolean1) {
resSmsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
SmsSendRecord resSmsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), resAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + resAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件已终止调解,如非本人操作,请忽略本短信", resJsonObject.get("sid") != null ? resJsonObject.get("sid").toString() : null);
if (resJsonObject.get("status") != null && !resJsonObject.get("status").equals(SMSStatusEnum.FAIL.getCode())) {
resSmsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
} else {
resSmsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
resSmsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
}
smsRecordMapper.saveSmsSendRecord(resSmsSendRecord);
// 修改案件状态为结束
@@ -2921,6 +2974,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// int startIndex = prefix.length();
String annexPath = caseAttach.getAnnexPath();
// String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
if (annexPath.contains("/profile/upload")) {
annexPath = annexPath.replace("/profile/upload", "/home/ruoyi/uploadPath/upload");
}
String path = annexPath;
//获取文件上传地址
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
@@ -2972,7 +3028,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject3 = jsonArray.getJSONObject(i);
String keyword = jsonObject3.getString("keyword");
if (keyword.equals("甲方(签字):")) {
if (keyword.equals("申请人(签字):")) {
//签名
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
// 遍历 positionsArray 中的每个元素
@@ -2987,7 +3043,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
sealSignRecord.setPositionXpsn(positionX + 120);
sealSignRecord.setPositionYpsn(positionY);
}
} else if (keyword.equals("乙方(签字):")) {
} else if (keyword.equals("被申请人(签字):")) {
//签名
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
// 遍历 positionsArray 中的每个元素
@@ -3039,13 +3095,15 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
request.setTemplateId("2047719");
request.setPhone(applicantAffiliateOpt.get().getPhone());
request.setTemplateParamSet(new String[]{applicantAffiliateOpt.get().getName(), application.getCaseNum(), urlapplynew});
Boolean aBoolean = SmsUtils.sendSms(request);
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), applicantAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + applicantAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件,签名链接https://smlt.esign.cn/" + urlapplynew + ",请点击链接签名,如非本人操作,请忽略本短信");
// todo 短信
// cn.hutool.json.JSONObject smsObj = SmsUtils.sendSms(request);
cn.hutool.json.JSONObject smsObj = new cn.hutool.json.JSONObject();
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), applicantAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + applicantAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件,签名链接https://smlt.esign.cn/" + urlapplynew + ",请点击链接签名,如非本人操作,请忽略本短信", smsObj.get("sid") != null ? smsObj.get("sid").toString() : null);
// 新增短信记录
if (aBoolean) {
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
if (smsObj.get("status") != null && !smsObj.get("status").equals(SMSStatusEnum.FAIL.getCode())) {
smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
} else {
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
// 被申签名记录
@@ -3062,14 +3120,16 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
request1.setTemplateId("2047719");
request1.setPhone(resAffiliateOpt.get().getPhone());
request1.setTemplateParamSet(new String[]{resAffiliateOpt.get().getName(), application.getCaseNum(), urlResponnew});
Boolean aBoolean1 = SmsUtils.sendSms(request1);
// todo 短信
// cn.hutool.json.JSONObject resObj = SmsUtils.sendSms(request1);
cn.hutool.json.JSONObject resObj = new cn.hutool.json.JSONObject();
SmsSendRecord resSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), resAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + resAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件,签名链接https://smlt.esign.cn/" + urlResponnew + ",请点击链接签名,如非本人操作,请忽略本短信");
SmsSendRecord resSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), resAffiliateOpt.get().getPhone(), new Date(), "尊敬的" + resAffiliateOpt.get().getName() + "用户,您的" + application.getCaseNum() + "调解案件,签名链接https://smlt.esign.cn/" + urlResponnew + ",请点击链接签名,如非本人操作,请忽略本短信", resObj.get("sid") != null ? resObj.get("sid").toString() : null);
// 新增短信记录
if (aBoolean1) {
resSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
if (resObj.get("status") != null && !resObj.get("status").equals(SMSStatusEnum.FAIL.getCode())) {
resSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
} else {
resSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
resSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
}
smsRecordMapper.saveSmsSendRecord(resSendRecord);
@@ -3107,20 +3167,21 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
}
else
} else {
{
// 线下调解
List<MsCaseAttach> attachList = req.getAttachList();
if (CollectionUtil.isEmpty(attachList)) {
return AjaxResult.error("请上传调解资料");
}
// 先删除已经存在的调解书
if(StrUtil.isEmpty(application.getCaseSource())){
if (StrUtil.isEmpty(application.getCaseSource())) {
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
if(CollectionUtil.isNotEmpty(existAttach)){
if (CollectionUtil.isNotEmpty(existAttach)) {
// todo 对接北明,同步案件状态,删除
for (MsCaseAttach msCaseAttach : existAttach) {
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
if (StrUtil.isEmpty(msCaseAttach.getOtherSysFileId()) || StrUtil.isEmpty(msCaseAttach.getAnnexPath())) {
continue;
}
beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
@@ -3134,13 +3195,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
// todo 对接北明,调用上传附件接口
List<MsCaseAttach> msCaseAttaches = msCaseAttachMapper.listCaseAttachByCaseIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
if(StrUtil.isEmpty(application.getCaseSource()) && CollectionUtil.isNotEmpty(msCaseAttaches)) {
if (StrUtil.isEmpty(application.getCaseSource()) && CollectionUtil.isNotEmpty(msCaseAttaches)) {
for (MsCaseAttach msCaseAttach : msCaseAttaches) {
String templatePath = "/home/ruoyi" + msCaseAttach.getAnnexPath();
File file = new File(templatePath.replace("/profile", "/uploadPath"));
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(),AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
// 更新附件表
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
msCaseAttach.setOtherSysFileId(caseFileInfo.getFileId());
msCaseAttachMapper.updateCaseAttach(msCaseAttach);
}
@@ -3190,7 +3251,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (mediaResult == 2 || mediaResult == 3 || mediaResult == 4) {
CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), null);
// todo 结束对接北明,为调解失败状态
caseApplicationService. pushStatusToBM(application, PushCaseStatusEnum.FAIL);
caseApplicationService.pushStatusToBM(application, PushCaseStatusEnum.FAIL);
}
}
return AjaxResult.success();
@@ -3198,7 +3259,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
return AjaxResult.success();
}
}
/**
* 确定会议结果
@@ -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);
@@ -596,10 +596,14 @@ public class MsSignSealServiceImpl implements MsSignSealService {
Gson gson = new Gson();
EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecord);
JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
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 {
return AjaxResult.error();
@@ -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);
//修改"签署用印记录表"的状态为待用印
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);
//修改"签署用印记录表"的状态为待用印
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);
//修改"签署用印记录表"的状态为待用印
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 {
@@ -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" +
@@ -230,4 +230,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update ms_sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete>
<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
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
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 id="selectByDeptIdAndRole" resultMap="SysUserResult">
select u.* from
@@ -54,7 +54,7 @@
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
where c.id = #{id}
GROUP BY a.id
GROUP BY a.id order by a.id asc
</select>
<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,
@@ -16,6 +16,7 @@
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="sendStatus" column="send_status" />
<result property="sid" column="sid" />
</resultMap>
<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="createBy != null and createBy != ''">create_by,</if>
<if test="sendStatus != null ">send_status,</if>
sid,
reason,
create_time
)values(
<if test="caseId != null ">#{caseId},</if>
@@ -36,6 +39,8 @@
<if test="sendContent != null ">#{sendContent},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="sendStatus != null ">#{sendStatus},</if>
#{sid},
#{reason},
sysdate()
)
</insert>
@@ -49,7 +54,8 @@
send_content,
create_by,
send_status,
create_time
create_time,
sid,reason
)values
<foreach item="item" index="index" collection="list" separator=",">
(
@@ -60,14 +66,14 @@
#{item.sendContent},
#{item.createBy},
#{item.sendStatus},
sysdate()
sysdate(),#{sid},#{reason}
)
</foreach>
</insert>
<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
<where>
<if test="caseNum != null and caseNum != ''">
@@ -76,5 +82,14 @@
</where>
order by send_time desc
</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>