调解系统修改
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
package com.ruoyi.system.domain.entity.log;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Table(name = "ms_request_log")
|
||||
public class MsRequestLog {
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 状态,0-成功,1-失败
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 请求url
|
||||
*/
|
||||
@Column(name = "request_url")
|
||||
private String requestUrl;
|
||||
|
||||
/**
|
||||
* 请求内容
|
||||
*/
|
||||
@Column(name = "content")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
@Column(name = "reason")
|
||||
private String reason;
|
||||
/**
|
||||
* 返回内容
|
||||
*/
|
||||
@Column(name = "return_content")
|
||||
private String returnContent;
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户表 数据层
|
||||
@@ -144,11 +144,11 @@ public interface SysUserMapper
|
||||
*/
|
||||
SysUser selectUserByIdCard(@Param("idCard")String identityNo);
|
||||
/**
|
||||
* 根据手机号查询用户信息
|
||||
* @param phone
|
||||
* 根据邮箱查询用户信息
|
||||
* @param email
|
||||
* @return
|
||||
*/
|
||||
SysUser selectUserByPhone(@Param("phone")String phone);
|
||||
SysUser selectUserByEmail(@Param("email")String email);
|
||||
|
||||
/**
|
||||
* 根据部门和角色查询用户
|
||||
|
||||
@@ -67,4 +67,11 @@ public interface SysUserRoleMapper
|
||||
* @param roleId
|
||||
*/
|
||||
void insertUserRole(@Param("userId")Long userId, @Param("roleId")Long roleId);
|
||||
|
||||
/**
|
||||
* 根据用户id查询关联的角色id
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public List<Long> selectRoleIdsByUserId(@Param("userId") Long userId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.ruoyi.system.mapper.log;
|
||||
|
||||
import com.ruoyi.system.domain.entity.log.MsRequestLog;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface MsRequestLogMapper extends Mapper<MsRequestLog> {
|
||||
}
|
||||
@@ -1,18 +1,15 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.casestatus.MsCaseStatus;
|
||||
import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseStatusInfo;
|
||||
import org.apache.ibatis.annotations.Case;
|
||||
import org.apache.poi.hmef.Attachment;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public interface BeiMingInterface {
|
||||
/**
|
||||
* 1.获取北明接口令牌token
|
||||
* 1.获取北明接口令牌token对象
|
||||
*
|
||||
* @param userName
|
||||
* @param password
|
||||
@@ -73,5 +70,13 @@ public interface BeiMingInterface {
|
||||
* @param caseNo 案件编号
|
||||
* @return
|
||||
*/
|
||||
JSONObject pushAttachmentInfo(String username, String password, File file, String abutmentId, String syncSource, String caseNo);
|
||||
MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo, AttachmentOperateTypeEnum operateTypeEnum);
|
||||
|
||||
/**
|
||||
* 删除附件
|
||||
* @param file
|
||||
* @param caseNo
|
||||
* @return
|
||||
*/
|
||||
public JSONObject deleteAttachmentInfo( String caseNo,String fileId,String fileName);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.system.domain.entity.log.MsRequestLog;
|
||||
|
||||
/**
|
||||
* @Classname MsRequestLogService
|
||||
* @Description TODO
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/4/2 14:18
|
||||
* @Created wangqiong
|
||||
*/
|
||||
public interface MsRequestLogService {
|
||||
void insert(MsRequestLog requestLog);
|
||||
}
|
||||
+88
-14
@@ -5,7 +5,10 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.system.domain.entity.log.MsRequestLog;
|
||||
import com.ruoyi.system.service.BeiMingInterface;
|
||||
import com.ruoyi.system.service.MsRequestLogService;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseStatusInfo;
|
||||
import com.ruoyi.wisdomarbitrate.utils.CommonInputStreamResource;
|
||||
@@ -15,6 +18,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestClientException;
|
||||
@@ -22,6 +26,8 @@ import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.ruoyi.common.utils.EncryptUtils.sm4Decrypt;
|
||||
import static com.ruoyi.common.utils.EncryptUtils.sm4Encrypt;
|
||||
@@ -34,6 +40,10 @@ import static com.ruoyi.common.utils.EncryptUtils.sm4Encrypt;
|
||||
public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
@Autowired
|
||||
RestTemplate restTemplate;
|
||||
@Autowired
|
||||
MsRequestLogService requestLogService;
|
||||
@Autowired
|
||||
BeiMingInterfaceService beiMingInterfaceService;
|
||||
/**
|
||||
* 接口地址
|
||||
*/
|
||||
@@ -46,6 +56,13 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
public String apiprefix;
|
||||
@Value("${beimingprivatekey}")
|
||||
public String privateKey;
|
||||
// 北明配置
|
||||
@Value("${BMConfig.userName}")
|
||||
private String BMUserName;
|
||||
@Value("${BMConfig.password}")
|
||||
private String BMPassword;
|
||||
@Value("${BMConfig.syncSource}")
|
||||
private String BMSyncSource;
|
||||
|
||||
/**
|
||||
* 1.获取北明接口令牌token
|
||||
@@ -54,9 +71,11 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
* @param password
|
||||
* @param times
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public String getApiToken(String userName, String password, Long times) {
|
||||
JSONObject result = new JSONObject();
|
||||
MsRequestLog requestLog = new MsRequestLog();
|
||||
try {
|
||||
//设置请求头
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
@@ -79,13 +98,25 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
System.out.println("encryptString:" + encryptString);
|
||||
fromEntity = new HttpEntity(body, httpHeaders);
|
||||
String url = apihost + apiprefix + "/getToken";
|
||||
|
||||
requestLog.setRequestUrl(url);
|
||||
requestLog.setContent(param.toString());
|
||||
requestLog.setCreateTime((new Date()));
|
||||
requestLog.setStatus(0);
|
||||
result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
|
||||
requestLog.setReturnContent(result!=null?result.toString():null);
|
||||
} catch (RestClientException e) {
|
||||
e.printStackTrace();
|
||||
requestLog.setReason(e.getMessage());
|
||||
requestLog.setStatus(1);
|
||||
requestLogService.insert(requestLog);
|
||||
throw new ServiceException("推送失败");
|
||||
}
|
||||
return result.toString();
|
||||
requestLogService.insert(requestLog);
|
||||
return analysisResultToken(Objects.requireNonNull(result).toString());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 解析加密后端token
|
||||
*
|
||||
@@ -97,9 +128,7 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
if (token != null && !token.isEmpty()) {
|
||||
JSONObject jsonObject = JSON.parseObject(token);
|
||||
String tokenString = jsonObject.getString("data");
|
||||
System.out.println("data信息:" + tokenString);
|
||||
String tokenstr = sm4Decrypt(tokenString, privateKey);
|
||||
System.out.println("解密后的字符串:" + tokenstr);
|
||||
if (tokenstr != null && !tokenstr.isEmpty()) {
|
||||
JSONObject tokenObject = JSON.parseObject(tokenstr);
|
||||
resultToken = tokenObject.getString("token");
|
||||
@@ -117,9 +146,11 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
* @param syncSource 同步来源(账户名)
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public JSONObject submitCaseStatusInfo(String token, String abutmentId, String syncSource, MsCaseStatusInfo msCaseStatusInfo) {
|
||||
JSONObject result = new JSONObject();
|
||||
MsRequestLog requestLog = new MsRequestLog();
|
||||
try {
|
||||
//设置请求头
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
@@ -146,10 +177,20 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
fromEntity = new HttpEntity(body, httpHeaders);
|
||||
|
||||
String url = apihost + apiprefix + "/caseMediation/status";
|
||||
requestLog.setRequestUrl(url);
|
||||
requestLog.setContent(param.toString());
|
||||
requestLog.setCreateTime((new Date()));
|
||||
requestLog.setStatus(0);
|
||||
result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
|
||||
requestLog.setReturnContent(result!=null?result.toString():null);
|
||||
} catch (RestClientException e) {
|
||||
e.printStackTrace();
|
||||
requestLog.setReason(e.getMessage());
|
||||
requestLog.setStatus(1);
|
||||
requestLogService.insert(requestLog);
|
||||
throw new ServiceException("推送失败");
|
||||
}
|
||||
requestLogService.insert(requestLog);
|
||||
return result;
|
||||
|
||||
}
|
||||
@@ -160,11 +201,13 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public JSONObject uploadFile(File file, String token, String syncSource) {
|
||||
System.out.println("文件:" + file.getName());
|
||||
System.out.println("文件:" + file.toString());
|
||||
JSONObject result = new JSONObject();
|
||||
MsRequestLog requestLog = new MsRequestLog();
|
||||
try {
|
||||
//设置请求头
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
@@ -184,10 +227,20 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
requestBody.add("file", commonInputStreamResource);
|
||||
HttpEntity<MultiValueMap> fromEntity = new HttpEntity<MultiValueMap>(requestBody, httpHeaders);
|
||||
String url = apihost + apiprefix + "/uploadFile";
|
||||
requestLog.setRequestUrl(url);
|
||||
requestLog.setContent(fromEntity.toString());
|
||||
requestLog.setCreateTime((new Date()));
|
||||
requestLog.setStatus(0);
|
||||
result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
|
||||
requestLog.setReturnContent(result!=null?result.toString():null);
|
||||
} catch (RestClientException e) {
|
||||
e.printStackTrace();
|
||||
requestLog.setReason(e.getMessage());
|
||||
requestLog.setStatus(1);
|
||||
requestLogService.insert(requestLog);
|
||||
throw new ServiceException("推送失败");
|
||||
}
|
||||
requestLogService.insert(requestLog);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -201,9 +254,11 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
* @param msCaseFileInfo 案件附件信息
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public JSONObject syncAttachmentInfo(String token, String syncSource, String action, String caseNo, MsCaseFileInfo msCaseFileInfo) {
|
||||
JSONObject result = new JSONObject();
|
||||
MsRequestLog requestLog = new MsRequestLog();
|
||||
try {
|
||||
//设置请求头
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
@@ -238,21 +293,31 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
body.put("encryptString", encryptString);
|
||||
fromEntity = new HttpEntity(body, httpHeaders);
|
||||
String url = apihost + apiprefix + "/caseMediation/attachment/accept";
|
||||
requestLog.setRequestUrl(url);
|
||||
requestLog.setContent(param.toString());
|
||||
requestLog.setCreateTime((new Date()));
|
||||
requestLog.setStatus(0);
|
||||
result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
|
||||
requestLog.setReturnContent(result!=null?result.toString():null);
|
||||
} catch (RestClientException e) {
|
||||
e.printStackTrace();
|
||||
requestLog.setReason(e.getMessage());
|
||||
requestLog.setStatus(1);
|
||||
requestLogService.insert(requestLog);
|
||||
throw new ServiceException("推送失败");
|
||||
}
|
||||
requestLogService.insert(requestLog);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送案件状态信息
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public JSONObject pushCaseStatusInfo(String username, String password, String caseNo, String statusCode, String caseClosureExplanation) {
|
||||
JSONObject result = new JSONObject();
|
||||
String token = getApiToken(username, password, System.currentTimeMillis());
|
||||
token = analysisResultToken(token);
|
||||
String token = beiMingInterfaceService.getApiToken(username, password, System.currentTimeMillis());
|
||||
if (token != null && !token.isEmpty()) {
|
||||
MsCaseStatusInfo info = MsCaseStatusInfo.builder().caseNo(caseNo).statusCode(statusCode).caseClosureExplanation(caseClosureExplanation).build();
|
||||
result = submitCaseStatusInfo(token, caseNo, username, info);
|
||||
@@ -265,16 +330,16 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送案件附件信息
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public JSONObject pushAttachmentInfo(String username, String password, File file, String abutmentId, String syncSource, String caseNo) {
|
||||
public MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo,AttachmentOperateTypeEnum operateTypeEnum) {
|
||||
JSONObject result = new JSONObject();
|
||||
MsCaseFileInfo fileInfo=null;
|
||||
//1.获取token
|
||||
String token = getApiToken(username, password, System.currentTimeMillis());
|
||||
token = analysisResultToken(token);
|
||||
String token = beiMingInterfaceService.getApiToken(username, password, System.currentTimeMillis());
|
||||
if (token != null && !token.isEmpty()) {
|
||||
//2.上传文件
|
||||
JSONObject fileResult = uploadFile(file, token, syncSource);
|
||||
@@ -289,16 +354,25 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
System.out.println("fileId====:" + fileId);
|
||||
if (fileId != null) {
|
||||
//3.同步附件更新信息
|
||||
MsCaseFileInfo fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(file.getName()).abutmentId(abutmentId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType("EVEDENT_METERIAL").build();
|
||||
result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.ADD.getCode(), caseNo, fileInfo);
|
||||
result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.UPD.getCode(), caseNo, fileInfo);
|
||||
result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.DEL.getCode(), caseNo, fileInfo);
|
||||
fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(file.getName()).abutmentId(fileId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType("EVEDENT_METERIAL").build();
|
||||
result = syncAttachmentInfo(token, username, operateTypeEnum.getCode(), caseNo, fileInfo);
|
||||
// 更新到附件表将fileId
|
||||
// result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.UPD.getCode(), caseNo, fileInfo);
|
||||
// result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.DEL.getCode(), caseNo, fileInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return fileInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject deleteAttachmentInfo( String caseNo,String fileId,String fileName) {
|
||||
String token = beiMingInterfaceService.getApiToken(BMUserName, BMPassword, System.currentTimeMillis());
|
||||
MsCaseFileInfo fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(fileName).abutmentId(fileId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType("EVEDENT_METERIAL").build();
|
||||
|
||||
return syncAttachmentInfo(token, BMUserName, AttachmentOperateTypeEnum.DEL.getCode(), caseNo, fileInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.ruoyi.system.domain.entity.log.MsRequestLog;
|
||||
import com.ruoyi.system.mapper.log.MsRequestLogMapper;
|
||||
import com.ruoyi.system.service.MsRequestLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Classname MsRequestLogServiceImpl
|
||||
* @Description TODO
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/4/2 14:19
|
||||
* @Created wangqiong
|
||||
*/
|
||||
@Service
|
||||
public class MsRequestLogServiceImpl implements MsRequestLogService {
|
||||
@Autowired
|
||||
private MsRequestLogMapper logMapper;
|
||||
@Override
|
||||
public void insert(MsRequestLog requestLog) {
|
||||
logMapper.insert(requestLog);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,13 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
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.core.text.Convert;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
@@ -20,6 +16,13 @@ import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 部门管理 服务实现
|
||||
@@ -34,6 +37,8 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
@@ -221,7 +226,9 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
}
|
||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||
}
|
||||
return deptMapper.insertDept(dept);
|
||||
int i = deptMapper.insertDept(dept);
|
||||
redisCache.setCacheObject(CacheConstants.DEPT_KEY+dept.getDeptName(),dept.getDeptId());
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -249,6 +256,8 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
||||
updateParentDeptStatusNormal(dept);
|
||||
}
|
||||
// 修改缓存
|
||||
redisCache.setCacheObject(CacheConstants.DEPT_KEY+dept.getDeptName(),dept.getDeptId());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -293,6 +302,11 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
@Override
|
||||
public int deleteDeptById(Long deptId)
|
||||
{
|
||||
SysDept sysDept = deptMapper.selectDeptById(deptId);
|
||||
if(sysDept!=null) {
|
||||
// 删除缓存
|
||||
redisCache.deleteObject(CacheConstants.DEPT_KEY + sysDept.getDeptName());
|
||||
}
|
||||
return deptMapper.deleteDeptById(deptId);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
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.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
@@ -24,6 +19,12 @@ import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMenuMapper;
|
||||
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 角色 业务层处理
|
||||
@@ -44,6 +45,8 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
|
||||
@Autowired
|
||||
private SysRoleDeptMapper roleDeptMapper;
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询角色数据
|
||||
@@ -233,6 +236,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
{
|
||||
// 新增角色信息
|
||||
roleMapper.insertRole(role);
|
||||
redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
|
||||
return insertRoleMenu(role);
|
||||
}
|
||||
|
||||
@@ -250,6 +254,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
roleMapper.updateRole(role);
|
||||
// 删除角色与菜单关联
|
||||
roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
|
||||
redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
|
||||
return insertRoleMenu(role);
|
||||
}
|
||||
|
||||
@@ -341,10 +346,15 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
@Transactional
|
||||
public int deleteRoleById(Long roleId)
|
||||
{
|
||||
// 根据角色id查询角色名
|
||||
SysRole role = roleMapper.selectRoleById(roleId);
|
||||
// 删除角色与菜单关联
|
||||
roleMenuMapper.deleteRoleMenuByRoleId(roleId);
|
||||
// 删除角色与部门关联
|
||||
roleDeptMapper.deleteRoleDeptByRoleId(roleId);
|
||||
if(role!=null) {
|
||||
redisCache.deleteObject(CacheConstants.ROLE_KEY + role.getRoleName());
|
||||
}
|
||||
return roleMapper.deleteRoleById(roleId);
|
||||
}
|
||||
|
||||
@@ -358,6 +368,11 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
@Transactional
|
||||
public int deleteRoleByIds(Long[] roleIds)
|
||||
{
|
||||
List<SysRole> roles = roleMapper.selectRoleList(new SysRole());
|
||||
if(CollectionUtil.isEmpty(roles)){
|
||||
return 0;
|
||||
}
|
||||
Map<Long, String> roleMap = roles.stream().collect(Collectors.toMap(SysRole::getRoleId, SysRole::getRoleName, (n1, n2) -> n2));
|
||||
for (Long roleId : roleIds)
|
||||
{
|
||||
checkRoleAllowed(new SysRole(roleId));
|
||||
@@ -367,6 +382,9 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
{
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
|
||||
}
|
||||
if(roleMap.containsKey(roleId)) {
|
||||
redisCache.deleteObject(CacheConstants.ROLE_KEY + roleMap.get(roleId));
|
||||
}
|
||||
}
|
||||
// 删除角色与菜单关联
|
||||
roleMenuMapper.deleteRoleMenu(roleIds);
|
||||
|
||||
+87
-119
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.entity.mscase;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
@@ -7,161 +8,128 @@ import lombok.ToString;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Table(name = "ms_case_affiliate")
|
||||
public class MsCaseAffiliate {
|
||||
public class MsCaseAffiliate{
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 案件主表id,案件申请表主键
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "case_appli_id")
|
||||
private Long caseAppliId;
|
||||
/**
|
||||
* 是否机构申请,0-自然人,1-申请机构,默认0
|
||||
* 用户id,用户表user_id关联
|
||||
*/
|
||||
@Column(name = "organize_flag")
|
||||
private Integer organizeFlag;
|
||||
|
||||
|
||||
@Column(name = "user_id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 申请人id
|
||||
* 申请机构id,和部门表id关联
|
||||
*/
|
||||
@Column(name = "application_id")
|
||||
private String applicationId;
|
||||
|
||||
/**
|
||||
* 申请人名称
|
||||
*/
|
||||
@Column(name = "application_name")
|
||||
private String applicationName;
|
||||
@Column(name = "applicant_dept_id")
|
||||
private Long applicantDeptId;
|
||||
|
||||
/**
|
||||
* 代码(统一社会信用代码或者身份证号)
|
||||
*/
|
||||
@Column(name = "code")
|
||||
@Transient
|
||||
private String code;
|
||||
/**
|
||||
* 申请人联系电话
|
||||
*/
|
||||
@Column(name = "application_phone")
|
||||
private String applicationPhone;
|
||||
/**
|
||||
* 申请人邮箱
|
||||
*/
|
||||
@Column(name = "application_email")
|
||||
private String applicationEmail;
|
||||
|
||||
/**
|
||||
* 法定代表人
|
||||
*/
|
||||
@Column(name = "comp_legal_person")
|
||||
@Transient
|
||||
private String compLegalPerson;
|
||||
/**
|
||||
* 角色类别,1-申请操作人/申请人,2-申请人代理人,3-被申请人操作人/被申请人,4-被申请人代理人
|
||||
*/
|
||||
@Column(name = "role_type")
|
||||
private Integer roleType=1;
|
||||
/**
|
||||
* 组别
|
||||
*/
|
||||
@Column(name = "group_order")
|
||||
private Integer groupOrder;
|
||||
/**
|
||||
* 是否操作人,0-否,1-是
|
||||
*/
|
||||
@Column(name = "operator_flag")
|
||||
private Integer operatorFlag=1;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
@Transient
|
||||
private String phone;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Transient
|
||||
private String email;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Transient
|
||||
private String name;
|
||||
/**
|
||||
* 住所
|
||||
*/
|
||||
@Transient
|
||||
private String home;
|
||||
/**
|
||||
* 联系地址
|
||||
*/
|
||||
@Transient
|
||||
private String address;
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@Transient
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 申请人住所
|
||||
* '身份类别,0-身份证,1-护照,默认0'
|
||||
*/
|
||||
@Column(name = "applicant_home")
|
||||
private String applicantHome;
|
||||
|
||||
@Transient
|
||||
private Integer idType;
|
||||
/**
|
||||
* 申请人联系地址
|
||||
* 国籍,0-境内,1-境外,默认0
|
||||
*/
|
||||
@Column(name = "applicant_address")
|
||||
private String applicantAddress;
|
||||
|
||||
@Transient
|
||||
private Integer nationality;
|
||||
/**
|
||||
* 委托代理人姓名
|
||||
* 生日
|
||||
*/
|
||||
@Column(name = "name_agent")
|
||||
private String nameAgent;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
|
||||
@Transient
|
||||
private Date birth;
|
||||
/**
|
||||
* 代理人联系电话
|
||||
* 性别,0-男,1-女
|
||||
*/
|
||||
@Column(name = "contact_telphone_agent")
|
||||
private String contactTelphoneAgent;
|
||||
|
||||
/**
|
||||
* 代理人邮箱
|
||||
*/
|
||||
@Column(name = "agent_email")
|
||||
private String agentEmail;
|
||||
|
||||
/**
|
||||
* 申请人快递单号
|
||||
*/
|
||||
@Column(name = "applicant_track_num")
|
||||
private String applicantTrackNum;
|
||||
|
||||
@Transient
|
||||
private String sex;
|
||||
/**
|
||||
* 被申请人姓名
|
||||
*/
|
||||
@Column(name = "respondent_name")
|
||||
private String respondentName;
|
||||
@Transient
|
||||
private String resName;
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@Transient
|
||||
private String roleName;
|
||||
/**
|
||||
* 申请机构名称
|
||||
*/
|
||||
@Transient
|
||||
private String applicantOrgName;
|
||||
|
||||
/**
|
||||
* 被申请人身份证号
|
||||
*/
|
||||
@Column(name = "respondent_identity_num")
|
||||
private String respondentIdentityNum;
|
||||
/**
|
||||
* 被申请人联系电话
|
||||
*/
|
||||
@Column(name = "respondent_phone")
|
||||
private String respondentPhone;
|
||||
|
||||
/**
|
||||
* 被申请人性别(0=男,女=1)
|
||||
*/
|
||||
@Column(name = "respondent_sex")
|
||||
private String respondentSex;
|
||||
|
||||
/**
|
||||
* 被申请人出生年月日
|
||||
*/
|
||||
@Column(name = "respondent_birth")
|
||||
private Date respondentBirth;
|
||||
|
||||
/**
|
||||
* 被申请人申请人住所
|
||||
*/
|
||||
@Column(name = "respondent_home")
|
||||
private String respondentHome;
|
||||
|
||||
/**
|
||||
* 被申请人邮箱
|
||||
*/
|
||||
@Column(name = "respondent_email")
|
||||
private String respondentEmail;
|
||||
|
||||
/**
|
||||
* 被申请人快递单号
|
||||
*/
|
||||
@Column(name = "respondent_track_num")
|
||||
private String respondentTrackNum;
|
||||
|
||||
/**
|
||||
* 申请人是否签收
|
||||
*/
|
||||
@Column(name = "is_sign_apply")
|
||||
private Integer isSignApply;
|
||||
/**
|
||||
* 被申请人是否签收
|
||||
*/
|
||||
@Column(name = "is_sign_respon")
|
||||
private Integer isSignRespon;
|
||||
/**
|
||||
* 身份类别,0-身份证,1-护照,默认0
|
||||
*/
|
||||
@Column(name = "id_type")
|
||||
private Integer idType;
|
||||
/**
|
||||
* 国籍,0-国内,1-国外,默认0
|
||||
*/
|
||||
@Column(name = "nationality")
|
||||
private Integer nationality;
|
||||
}
|
||||
+16
-4
@@ -6,10 +6,7 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -208,5 +205,20 @@ public class MsCaseApplication {
|
||||
*/
|
||||
@Column(name = "is_reconci")
|
||||
private Integer isReconci;
|
||||
/**
|
||||
* 是否机构申请,0-自然人,1-申请机构,默认0
|
||||
*/
|
||||
@Column(name = "organize_flag")
|
||||
private Integer organizeFlag;
|
||||
/**
|
||||
* 案件来源,YC-乙巢,空字符串-北明
|
||||
*/
|
||||
@Column(name = "case_source")
|
||||
private String caseSource;
|
||||
/**
|
||||
* 拒绝原因
|
||||
*/
|
||||
@Transient
|
||||
private String rejectReason;
|
||||
|
||||
}
|
||||
+5
@@ -77,4 +77,9 @@ public class MsCaseAttach {
|
||||
*/
|
||||
@Column(name = "only_office_file_id")
|
||||
private String onlyOfficeFileId;
|
||||
/**
|
||||
* 对接其它系统返回的附件id
|
||||
*/
|
||||
@Column(name = "other_sys_file_id")
|
||||
private String otherSysFileId;
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Classname MsCaseAffiliateList
|
||||
* @Description TODO
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/3/27 16:08
|
||||
* @Created wangqiong
|
||||
*/
|
||||
@Data
|
||||
public class MsCaseAffiliateBase {
|
||||
/**
|
||||
* 申请人/操作人
|
||||
*/
|
||||
private MsCaseAffiliate applicant;
|
||||
/**
|
||||
* 申请人代理人
|
||||
*/
|
||||
private MsCaseAffiliate applicantAgent;
|
||||
/**
|
||||
* 被申请人/操作人
|
||||
*/
|
||||
private MsCaseAffiliate res;
|
||||
/**
|
||||
* 被申请人代理人
|
||||
*/
|
||||
private MsCaseAffiliate resAgent;
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||
|
||||
/**
|
||||
* @Classname MsCaseAffiliateParent
|
||||
* @Description TODO
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/3/27 16:05
|
||||
* @Created wangqiong
|
||||
*/
|
||||
public class MsCaseAffiliateParent extends MsCaseAffiliateVO {
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname MsCaseAffiliateVO
|
||||
* @Description TODO
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/3/22 11:46
|
||||
* @Created wangqiong
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Data
|
||||
public class MsCaseAffiliateVO {
|
||||
/**
|
||||
* 申请人/操作人
|
||||
*/
|
||||
private List<MsCaseAffiliateBase> applicant;
|
||||
|
||||
/**
|
||||
* 被申请人/操作人
|
||||
*/
|
||||
private List<MsCaseAffiliateBase> res;
|
||||
|
||||
}
|
||||
+13
@@ -107,5 +107,18 @@ public class MsCaseApplicationReq {
|
||||
* 代理人电话
|
||||
*/
|
||||
private String contactTelphoneAgent;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String resEmail;
|
||||
/**
|
||||
* 申请人邮箱
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 角色类别
|
||||
*/
|
||||
private Integer roleType;
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
+13
-2
@@ -1,7 +1,6 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 lombok.AllArgsConstructor;
|
||||
@@ -34,7 +33,7 @@ public class MsCaseApplicationVO extends MsCaseApplication {
|
||||
/**
|
||||
* 案件相关人员
|
||||
*/
|
||||
private MsCaseAffiliate affiliate;
|
||||
private MsCaseAffiliateVO affiliate;
|
||||
/**
|
||||
* 是否压缩包导入,默认false
|
||||
*/
|
||||
@@ -84,5 +83,17 @@ public class MsCaseApplicationVO extends MsCaseApplication {
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 是否申请操作人,0-否,1-是
|
||||
*/
|
||||
private Integer appOperatorFlag;
|
||||
/**
|
||||
* 是否被申请操作人,0-否,1-是
|
||||
*/
|
||||
private Integer resOperatorFlag;
|
||||
/**
|
||||
* 是否财务,部门长,秘书,0-否,1-是
|
||||
*/
|
||||
private Integer otherFlag;
|
||||
|
||||
}
|
||||
|
||||
+23
@@ -1,7 +1,30 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper.mscase;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MsCaseAffiliateMapper extends Mapper<MsCaseAffiliate> {
|
||||
/**
|
||||
* 查询申请人被申请人
|
||||
* @param caseIds
|
||||
* @return
|
||||
*/
|
||||
List<MsCaseAffiliate> listGroupConcat(@Param("caseIds") List<Long> caseIds);
|
||||
|
||||
/**
|
||||
* 根据案件id查询案件人员
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<MsCaseAffiliate> selectByCaseId(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 根据案件id查询相关人员及角色
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<MsCaseAffiliate> selectUserRoleByCaseIds(@Param("caseIds") List<Long> caseIds);
|
||||
}
|
||||
+4
-156
@@ -29,125 +29,14 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
|
||||
" </script>")
|
||||
Integer selectCaseNumLike(@Param("caseNum") String caseNum, @Param("length") int length);
|
||||
|
||||
/**
|
||||
/**
|
||||
* 案件列表查询
|
||||
* @param req
|
||||
* @param caseStatusNames
|
||||
* @param caseFlowIds
|
||||
* @return
|
||||
*/
|
||||
@Select("<script> select t.* from (select c.media_result mediaResult,c.id,c.room_id roomId,c.mediation_method mediationMethod," +
|
||||
" CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
|
||||
+
|
||||
"0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
|
||||
"a.application_name applicationName,a.respondent_name respondentName,c.mediator_name mediatorName," +
|
||||
"c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_application c " +
|
||||
"join ms_case_affiliate a on c.id=a.case_appli_id <where> "
|
||||
+
|
||||
"<if test=\"req.mediatorId != null \">" +
|
||||
" AND c.mediator_id = #{req.mediatorId} " +
|
||||
"</if> "
|
||||
+
|
||||
"<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0 '> and (a.application_id in" +
|
||||
"<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
|
||||
"#{organId}" +
|
||||
"</foreach> or a.contact_telphone_agent=#{req.contactTelphoneAgent} )" +
|
||||
"</if> "
|
||||
+
|
||||
"<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c.case_status_name in" +
|
||||
"<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
|
||||
"#{caseStatus}" +
|
||||
"</foreach>" +
|
||||
"</if> " +
|
||||
"<if test=\"req.batchNumber != null and req.batchNumber != ''\">" +
|
||||
" AND c.batch_number = #{req.batchNumber} " +
|
||||
"</if> " +
|
||||
"<if test=\"req.caseFlowId != null \">" +
|
||||
" AND c.case_flow_id = #{req.caseFlowId} " +
|
||||
"</if> "
|
||||
+
|
||||
"<if test=\"req.mediationMethod != null \">" +
|
||||
" AND c.mediation_method = #{req.mediationMethod} " +
|
||||
"</if> "
|
||||
+
|
||||
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
|
||||
" AND c.case_num like concat('%', #{req.caseNum}, '%') "+
|
||||
"</if> "
|
||||
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
|
||||
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
|
||||
"</if> "
|
||||
+
|
||||
"<if test=\"req.startTime != null and req.startTime != ''\">" +
|
||||
"and c.create_time >= #{req.startTime}</if>" +
|
||||
"<if test=\"req.endTime != null and req.endTime != ''\">" +
|
||||
"and c.create_time <= #{req.endTime}</if>" +
|
||||
" </where> " +
|
||||
"union select c.media_result mediaResult,c.id id,c.room_id roomId,c.mediation_method mediationMethod,"
|
||||
+
|
||||
" CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
|
||||
+
|
||||
"1 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
|
||||
"a.application_name applicationName,a.respondent_name respondentName,c.mediator_name mediatorName," +
|
||||
"c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_log_record r " +
|
||||
"join ms_case_application c on r.case_appli_id=c.id " +
|
||||
"join ms_case_affiliate a on c.id=a.case_appli_id <where> r.create_by=#{req.userName} and c.id not in (" +
|
||||
"select c1.id from ms_case_application c1 JOIN ms_case_affiliate a1 ON a1.case_appli_id = c1.id"
|
||||
+
|
||||
"<if test=\"req.mediatorId != null \">" +
|
||||
" AND c1.mediator_id = #{req.mediatorId} " +
|
||||
"</if> "
|
||||
+
|
||||
"<if test=\"req.mediationMethod != null \">" +
|
||||
" AND c1.mediation_method = #{req.mediationMethod} " +
|
||||
"</if> "
|
||||
+
|
||||
|
||||
"<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0 '> and (a.application_id in" +
|
||||
"<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
|
||||
"#{organId}" +
|
||||
"</foreach> or a.contact_telphone_agent=#{req.contactTelphoneAgent} )" +
|
||||
"</if> "
|
||||
+
|
||||
"<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c1.case_status_name in" +
|
||||
"<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
|
||||
"#{caseStatus}" +
|
||||
"</foreach>" +
|
||||
"</if> "
|
||||
+
|
||||
"<if test=\"req.caseFlowId != null \">" +
|
||||
" AND c1.case_flow_id = #{req.caseFlowId} " +
|
||||
"</if> " +
|
||||
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
|
||||
" AND c1.case_num like concat('%', #{req.caseNum}, '%') " +
|
||||
"</if> "
|
||||
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
|
||||
" AND a1.respondent_identity_num = #{req.respondentIdentityNum} " +
|
||||
"</if> "
|
||||
+
|
||||
"<if test=\"req.startTime != null and req.startTime != ''\">" +
|
||||
"and c1.create_time >= #{req.startTime}</if>" +
|
||||
"<if test=\"req.endTime != null and req.endTime != ''\">" +
|
||||
"and c1.create_time <= #{req.endTime}</if>" +
|
||||
" </where> " +
|
||||
" ) "
|
||||
+
|
||||
"<if test=\"req.caseFlowId != null \">" +
|
||||
" AND c.case_flow_id = #{req.caseFlowId} " +
|
||||
"</if> " +
|
||||
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
|
||||
" AND c.case_num like concat('%', #{req.caseNum}, '%')" +
|
||||
"</if> "
|
||||
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
|
||||
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
|
||||
"</if> "
|
||||
+
|
||||
|
||||
"<if test=\"req.startTime != null and req.startTime != ''\">" +
|
||||
"and c.create_time >= #{req.startTime}</if>" +
|
||||
"<if test=\"req.endTime != null and req.endTime != ''\">" +
|
||||
"and c.create_time <= #{req.endTime}</if>" +
|
||||
" ) t order by t.createTime desc,t.caseNum desc" +
|
||||
" </script>")
|
||||
List<MsCaseApplicationVO> list(@Param("req")MsCaseApplicationReq req, @Param("caseStatusNames") List<String> caseStatusNames);
|
||||
List<MsCaseApplicationVO> list(@Param("req")MsCaseApplicationReq req, @Param("caseFlowIds") List<Integer> caseFlowIds , @Param("roleIds") List<Long> roleIds );
|
||||
|
||||
/**
|
||||
* 查询调解员列表
|
||||
@@ -162,46 +51,5 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
|
||||
@Select("select max(room_id) maxRoomId from ms_reserved_conference")
|
||||
Long selectMaxRoomId();
|
||||
|
||||
/**
|
||||
* 待办数量
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
@Select(" <script> SELECT c.case_flow_id caseFlowId,count(c.id) caseCount " +
|
||||
"FROM ms_case_application c " +
|
||||
"join ms_case_affiliate a on c.id=a.case_appli_id <where> " +
|
||||
"<if test=\"req.mediatorId != null \">" +
|
||||
" AND c.mediator_id = #{req.mediatorId} " +
|
||||
"</if> "
|
||||
+
|
||||
"<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0 '> and (a.application_id in" +
|
||||
"<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
|
||||
"#{organId}" +
|
||||
"</foreach> or a.contact_telphone_agent=#{req.contactTelphoneAgent} )" +
|
||||
"</if> "
|
||||
+
|
||||
"<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c.case_status_name in" +
|
||||
"<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
|
||||
"#{caseStatus}" +
|
||||
"</foreach>" +
|
||||
"</if> " +
|
||||
"<if test=\"req.batchNumber != null and req.batchNumber != ''\">" +
|
||||
" AND c.batch_number = #{req.batchNumber} " +
|
||||
"</if> " +
|
||||
"<if test=\"req.caseFlowId != null \">" +
|
||||
" AND c.case_flow_id = #{req.caseFlowId} " +
|
||||
"</if> "
|
||||
+
|
||||
"<if test=\"req.mediationMethod != null \">" +
|
||||
" AND c.mediation_method = #{req.mediationMethod} " +
|
||||
"</if> "
|
||||
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
|
||||
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
|
||||
"</if> "
|
||||
+
|
||||
" </where> " +
|
||||
"group by c.case_flow_id,c.case_status_name"+
|
||||
" </script>"
|
||||
)
|
||||
List<CaseToDoCount> todoCount(@Param("req")MsCaseApplicationReq req, @Param("caseStatusNames") List<String> caseStatusNames);
|
||||
List<CaseToDoCount> todoCount(@Param("req")MsCaseApplicationReq req, @Param("caseFlowIds") List<Integer> caseFlowIds, @Param("roleIds") List<Long> roleIds);
|
||||
}
|
||||
+81
-16
@@ -1,9 +1,13 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.mscase;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SMSNotice;
|
||||
import com.ruoyi.common.core.domain.entity.SMSNoticeDO;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.enums.PushCaseStatusEnum;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
|
||||
@@ -49,6 +53,20 @@ public interface MsCaseApplicationService {
|
||||
* @return
|
||||
*/
|
||||
String insert(MsCaseApplicationVO caseApplication);
|
||||
/**
|
||||
* 设置案件相关信息
|
||||
* @param caseApplication
|
||||
* @param affiliate
|
||||
* @param groupOrder 组别
|
||||
*/
|
||||
public void setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder);
|
||||
/**
|
||||
* 新增案件相关人员信息
|
||||
* @param affiliate 相关人员信息
|
||||
* @param roleId 角色id
|
||||
|
||||
*/
|
||||
public void insertAfficateUser(MsCaseAffiliate affiliate, List<Long> roleIdList);
|
||||
|
||||
/**
|
||||
* 新增案件
|
||||
@@ -62,13 +80,7 @@ public interface MsCaseApplicationService {
|
||||
* @return
|
||||
*/
|
||||
AjaxResult batchInsert(MsCaseBatchInsertVO vo);
|
||||
/**
|
||||
* 新增用户
|
||||
* @param affiliate
|
||||
* @param agentFlag 是否代理人,0-否,1-是
|
||||
* @param roleId
|
||||
*/
|
||||
void insertApplicantUser( MsCaseAffiliate affiliate,boolean agentFlag, Long roleId);
|
||||
|
||||
/**
|
||||
* 新增申请机构代理人
|
||||
* @param affiliate
|
||||
@@ -150,6 +162,13 @@ public interface MsCaseApplicationService {
|
||||
* @return
|
||||
*/
|
||||
AjaxResult submit(MsCaseApplication req);
|
||||
/**
|
||||
* 北明推送案件状态
|
||||
* @param caseApplication 案件
|
||||
* @param pushCaseStatusEnum 案件状态
|
||||
* @return
|
||||
*/
|
||||
public JSONObject pushStatusToBM(MsCaseApplication caseApplication, PushCaseStatusEnum pushCaseStatusEnum);
|
||||
/**
|
||||
* 删除案件
|
||||
* @param req
|
||||
@@ -204,22 +223,16 @@ public interface MsCaseApplicationService {
|
||||
|
||||
AjaxResult updateTrialPen(MsCaseAttach attach);
|
||||
|
||||
/**
|
||||
* 确认调解书
|
||||
* @param attach
|
||||
* @return
|
||||
*/
|
||||
|
||||
AjaxResult confirmMediation(MsCaseAttachVO attach) throws EsignDemoException, InterruptedException ;
|
||||
/**
|
||||
* 生成调解申请书
|
||||
* @param application 案件基本信息
|
||||
* @param affiliate 案件相关人员
|
||||
* @param affiliates 案件相关人员
|
||||
* @param templatePath 模板路径
|
||||
* @param bookmarkList 标签
|
||||
* @param dictDataList 内置字段
|
||||
*/
|
||||
void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList, Integer templateType) ;
|
||||
void createMediateApplication(MsCaseApplication application, List<MsCaseAffiliate> affiliates, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList, Integer templateType) ;
|
||||
/**
|
||||
* 调解书上传到onlyoffice服务器
|
||||
* @param annexPath
|
||||
@@ -231,8 +244,15 @@ public interface MsCaseApplicationService {
|
||||
* @param req
|
||||
* @param affiliateMap
|
||||
*/
|
||||
void accept(MsCaseApplication application, MsCaseApplicationVO req, Map<Long, MsCaseAffiliate> affiliateMap) ;
|
||||
void accept(MsCaseApplication application, MsCaseApplicationVO req, Map<Long, List<MsCaseAffiliate>> affiliateMap) ;
|
||||
/**
|
||||
* 受理分配通知
|
||||
* @param application 案件基本信息
|
||||
* @param affiliates 案件人员
|
||||
* @param applicantFlag 是否申请人
|
||||
*/
|
||||
public void isAcceptNotice(MsCaseApplication application, List<MsCaseAffiliate> affiliates, Boolean applicantFlag);
|
||||
/**
|
||||
* 判断申请人/被申请人是否预约
|
||||
* @param vo
|
||||
* @param userIds 选择的调解员ids
|
||||
@@ -268,4 +288,49 @@ public interface MsCaseApplicationService {
|
||||
*/
|
||||
|
||||
AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach);
|
||||
/**
|
||||
* 发送短信
|
||||
* @param smsFlag 短信是否发送成功
|
||||
* @param application 案件基本信息
|
||||
* @param affiliate 案件人员
|
||||
* @param sendContent 发送内容
|
||||
*/
|
||||
public void sendSMS(Boolean smsFlag ,MsCaseApplication application, MsCaseAffiliate affiliate, String sendContent);
|
||||
/**
|
||||
* 发送邮件
|
||||
* @param application 案件基本信息
|
||||
* @param affiliate 案件人员
|
||||
* @param subject 主题
|
||||
* @param sendContent 内容
|
||||
*/
|
||||
public void sendEmail(MsCaseApplication application, MsCaseAffiliate affiliate, String subject, String sendContent);
|
||||
/**
|
||||
* 发送开庭日期短信
|
||||
* @param application
|
||||
* @param affiliates
|
||||
*/
|
||||
public void sendHearDateSms(MsCaseApplication application, List<MsCaseAffiliate> affiliates);
|
||||
/**
|
||||
* 发送短信
|
||||
* @param application
|
||||
* @param affiliate
|
||||
* @param notice
|
||||
*/
|
||||
public void sendNotice(MsCaseApplication application, MsCaseAffiliate affiliate,
|
||||
SMSNoticeDO notice);
|
||||
/**
|
||||
* 申请操作人/被申操作人发送通知
|
||||
* @param application
|
||||
* @param affiliates
|
||||
* @param applicantFlag
|
||||
* @param notice
|
||||
*/
|
||||
public void sendNotice(MsCaseApplication application, List<MsCaseAffiliate> affiliates, Boolean applicantFlag,
|
||||
SMSNotice notice);
|
||||
/**
|
||||
* 根据案件id查询案件相关人员
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public List<MsCaseAffiliate> selectAffliatesByCaseId(Long id);
|
||||
}
|
||||
|
||||
+7
@@ -64,4 +64,11 @@ public interface MsCasePaymentService {
|
||||
*/
|
||||
|
||||
public void confirmPayment(MsCaseFlow currentFlow,MsCaseFlow nextFlow, MsCaseApplication application, CaseConfirmPayDTO dto);
|
||||
|
||||
/**
|
||||
* 发送受理短信
|
||||
* @param dto
|
||||
* @param caseAppllication
|
||||
*/
|
||||
public void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone );
|
||||
}
|
||||
|
||||
+1
-8
@@ -4,7 +4,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.MsSignSealDTO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -13,7 +12,7 @@ import java.util.List;
|
||||
public interface MsSignSealService {
|
||||
|
||||
|
||||
AjaxResult sureMediationSeal(MsCaseApplicationVO caseApplication) throws EsignDemoException, InterruptedException;
|
||||
|
||||
|
||||
AjaxResult sealApply(MsSignSealDTO dto);
|
||||
|
||||
@@ -30,12 +29,6 @@ public interface MsSignSealService {
|
||||
|
||||
AjaxResult msCaseSignUrlApplyPC(MsSignSealDTO dto) throws EsignDemoException;
|
||||
|
||||
AjaxResult msCaseSignUrlResPC(MsSignSealDTO dto) throws EsignDemoException;
|
||||
|
||||
AjaxResult msCaseSignUrlApplyAPP(MsSignSealDTO dto) throws EsignDemoException;
|
||||
|
||||
AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException;
|
||||
|
||||
AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException;
|
||||
|
||||
AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException;
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public interface VideoConferenceService {
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult secretaryRoleByUserId(Long userId);
|
||||
AjaxResult secretaryRoleByUserId(Long userId, Long caseId);
|
||||
|
||||
/**
|
||||
* 根据html字符串转pdf并和案件关联
|
||||
|
||||
+1738
-2207
File diff suppressed because it is too large
Load Diff
+76
-73
@@ -12,6 +12,7 @@ import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.enums.AnnexTypeEnum;
|
||||
import com.ruoyi.common.enums.PaymentStatusEnum;
|
||||
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;
|
||||
@@ -40,6 +41,7 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
||||
@@ -226,7 +228,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("totalFee", totalFee);
|
||||
jsonObject.set("applicationOrganName", affiliate.getApplicationName());
|
||||
// jsonObject.set("applicationOrganName", affiliate.getApplicationName());
|
||||
return AjaxResult.success(jsonObject);
|
||||
}
|
||||
|
||||
@@ -248,10 +250,6 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
||||
result.setCaseSubjectAmount(application.getCaseSubjectAmount());
|
||||
result.setFeePayable(application.getFeePayable());
|
||||
result.setCaseStatusName(application.getCaseStatusName());
|
||||
MsCaseAffiliate affiliate = caseAffiliateMapper.selectByPrimaryKey(application.getId());
|
||||
if(affiliate != null) {
|
||||
result.setApplicationOrganName(affiliate.getApplicationName());
|
||||
}
|
||||
// 查询缴费单
|
||||
result.setCaseAttachList(caseAttachMapper.listCaseAttachByCaseIdAndType(id, AnnexTypeEnum.PAYMENT_RECEIPT.getCode()));
|
||||
result.setResCaseAttachList(caseAttachMapper.listCaseAttachByCaseIdAndType(id, AnnexTypeEnum.RES_PAYMENT_RECEIPT.getCode()));
|
||||
@@ -369,12 +367,78 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
||||
}
|
||||
auditMapper.insert(audit);
|
||||
}
|
||||
// 查询申请人电话,如果是自然人,代理人不为空,则给代理人发短信,代理人为空,给申请人发短信
|
||||
MsCaseAffiliate affiliate = caseAffiliateMapper.selectByPrimaryKey(application.getId());
|
||||
// 发送缴费通知
|
||||
sendPaymentSms(dto,caseAppllication, affiliate,flow);
|
||||
|
||||
// 查询案件人员
|
||||
List<MsCaseAffiliate> affiliates = applicationService.selectAffliatesByCaseId(application.getId());
|
||||
if(CollectionUtil.isEmpty(affiliates)){
|
||||
throw new ServiceException("未找到案件相关人员");
|
||||
}
|
||||
List<MsCaseAffiliate> operatorList = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() != null && affiliate.getOperatorFlag().equals(1) && StrUtil.isNotEmpty(affiliate.getPhone())).collect(Collectors.toList());
|
||||
if(CollectionUtil.isEmpty(operatorList)){
|
||||
throw new ServiceException("未找到案件操作人员");
|
||||
}
|
||||
if(dto.getApplicantConfirm()) {
|
||||
// 申请人确认缴费
|
||||
for (MsCaseAffiliate affiliate : operatorList) {
|
||||
// 发送缴费通知
|
||||
if (affiliate.getRoleType() == null) {
|
||||
continue;
|
||||
}
|
||||
if (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2)) {
|
||||
Boolean smsFlag = true;
|
||||
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() + ",您的调解申请费用已缴费成功。");
|
||||
} else {
|
||||
smsFlag = 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() + ",请知晓,如非本人操作,请忽略本短信");
|
||||
}
|
||||
// 新增短信记录
|
||||
if (smsFlag) {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
// 被申请人确认缴费
|
||||
for (MsCaseAffiliate affiliate : operatorList) {
|
||||
// 发送缴费通知
|
||||
if (affiliate.getRoleType() == null) {
|
||||
continue;
|
||||
}
|
||||
if (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4)) {
|
||||
Boolean smsFlag = true;
|
||||
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() + ",您的调解申请费用已缴费成功。");
|
||||
} else {
|
||||
smsFlag = 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() + ",请知晓,如非本人操作,请忽略本短信");
|
||||
}
|
||||
// 新增短信记录
|
||||
if (smsFlag) {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
}
|
||||
// 被申请人确认缴费,发送受理通知
|
||||
if( dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
|
||||
// 申请人发送受理短信
|
||||
casePaymentService.sendAcceptSms(dto, caseAppllication, affiliate.getName(), affiliate.getPhone());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -395,76 +459,15 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送缴费短信
|
||||
* @param dto
|
||||
* @param caseAppllication
|
||||
* @param affiliate
|
||||
*/
|
||||
private void sendPaymentSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication, MsCaseAffiliate affiliate,MsCaseFlow flow) {
|
||||
if (affiliate != null) {
|
||||
// 受理通知
|
||||
String phone = "";
|
||||
String userName = "";
|
||||
// 缴费通知
|
||||
String payPhone = "";
|
||||
String payUserName = "";
|
||||
if (affiliate.getOrganizeFlag().equals(0)) {
|
||||
// 自然人
|
||||
if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
|
||||
phone = affiliate.getContactTelphoneAgent();
|
||||
userName = affiliate.getNameAgent();
|
||||
} else {
|
||||
phone = affiliate.getApplicationPhone();
|
||||
userName = affiliate.getApplicationName();
|
||||
}
|
||||
|
||||
} else {
|
||||
phone = affiliate.getContactTelphoneAgent();
|
||||
userName = affiliate.getNameAgent();
|
||||
}
|
||||
if (StrUtil.isNotEmpty(phone)) {
|
||||
payPhone=phone;
|
||||
payUserName=userName;
|
||||
if(!dto.getApplicantConfirm()) {
|
||||
// 被申请人发送通知
|
||||
payPhone=affiliate.getRespondentPhone();
|
||||
payUserName=affiliate.getRespondentName();
|
||||
}
|
||||
Boolean smsFlag =true;
|
||||
SmsSendRecord smsSendRecord=null;
|
||||
// 申请人被申请人发送缴费成功短信 2051914 调解缴费成功通知 尊敬的{1},您的调解申请费用已缴费成功。
|
||||
if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
|
||||
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", payPhone, new String[]{payUserName});
|
||||
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), payPhone, new Date(), "尊敬的" + payUserName + ",您的调解申请费用已缴费成功。");
|
||||
} else {
|
||||
smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", payPhone, new String[]{payUserName, caseAppllication.getCaseNum(), dto.getReason()});
|
||||
// 2074402 调解系统确认缴费不通过通知 尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
|
||||
smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), payPhone, new Date(), "尊敬的" + payUserName + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信");
|
||||
}
|
||||
// 新增短信记录
|
||||
if (smsFlag) {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
|
||||
} else {
|
||||
smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
|
||||
}
|
||||
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||
if(!dto.getApplicantConfirm()&& dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
|
||||
// 申请人发送受理短信
|
||||
sendAcceptSms(dto, caseAppllication, userName, phone);
|
||||
// 被申请人发送受理短信
|
||||
sendAcceptSms(dto, caseAppllication, affiliate.getRespondentName(), affiliate.getRespondentPhone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送受理短信
|
||||
* @param dto
|
||||
* @param caseAppllication
|
||||
*/
|
||||
private void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone ) {
|
||||
@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() + "案件,已成功受理,请知晓,如非本人操作,请忽略本短信。");
|
||||
|
||||
+180
-453
@@ -4,8 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
@@ -16,18 +16,20 @@ import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
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.PushCaseStatusEnum;
|
||||
import com.ruoyi.common.enums.YesOrNoEnum;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.EmailOutUtil;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
|
||||
import com.ruoyi.system.service.impl.BeiMingInterfaceService;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseLogRecord;
|
||||
@@ -40,6 +42,7 @@ import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseLogRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.dept.DeptIdentifyMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.dept.MsSealSignRecordMapper;
|
||||
@@ -54,6 +57,7 @@ import com.ruoyi.wisdomarbitrate.service.mscase.MsSignSealService;
|
||||
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
||||
import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
@@ -106,286 +110,19 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
|
||||
@Autowired
|
||||
private SendMailRecordMapper sendMailRecordMapper;
|
||||
// 北明配置
|
||||
@Value("${BMConfig.userName}")
|
||||
private String BMUserName;
|
||||
@Value("${BMConfig.password}")
|
||||
private String BMPassword;
|
||||
@Value("${BMConfig.syncSource}")
|
||||
private String BMSyncSource;
|
||||
@Autowired
|
||||
BeiMingInterfaceService beiMingInterfaceService;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult sureMediationSeal(MsCaseApplicationVO caseApplicationVO) throws EsignDemoException, InterruptedException {
|
||||
Long id = caseApplicationVO.getId();
|
||||
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
||||
// 查询案件相关人员
|
||||
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
|
||||
// 查询附件
|
||||
List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(id);
|
||||
if (caseAttachList != null && caseAttachList.size() > 0) {
|
||||
for (MsCaseAttach caseAttach : caseAttachList) {
|
||||
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
|
||||
// String annexPath = caseAttach.getAnnexPath();
|
||||
// String path = "/home/ruoyi" + annexPath;
|
||||
String prefix = "/profile";
|
||||
int startIndex = prefix.length();
|
||||
String annexPath = caseAttach.getAnnexPath();
|
||||
// String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
|
||||
String path = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\12\\f8551b0e003e4af89acae7b500dacb77调解书.docx";
|
||||
//获取文件上传地址
|
||||
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
||||
String body = response.getBody();
|
||||
if (body != null) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
String fileId = jsonObject.getJSONObject("data").getString("fileId");
|
||||
String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
|
||||
//上传文件流
|
||||
EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
|
||||
JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
|
||||
if (jsonObject1.getIntValue("errCode") == 0) {
|
||||
//查看文件上传状态
|
||||
Thread.sleep(1000);
|
||||
EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
||||
JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
|
||||
JSONObject data = jsonObject2.getJSONObject("data");
|
||||
int fileStatus = data.getIntValue("fileStatus");
|
||||
if (fileStatus == 2 || fileStatus == 5) {
|
||||
String fileName = data.getString("fileName");
|
||||
//上传成功,获取文件签名印章位置
|
||||
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||
sealSignRecord.setFileid(fileId);
|
||||
EsignHttpResponse positions = SignAward.getPositionsMediation(sealSignRecord);
|
||||
Gson gson = new Gson();
|
||||
JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
|
||||
JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
|
||||
String keywordPositions = positionsData.get("keywordPositions").toString();
|
||||
//发起签署
|
||||
sealSignRecord.setFilename(fileName);
|
||||
|
||||
Long arbitratorId = caseApplication.getMediatorId();
|
||||
if (arbitratorId!=null) {
|
||||
SysUser sysUser = sysUserMapper.selectUserById(arbitratorId);
|
||||
if (sysUser == null) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
sealSignRecord.setPensonAccountMedi(sysUser.getPhonenumber());
|
||||
sealSignRecord.setPensonNameMedi(sysUser.getNickName());
|
||||
}
|
||||
|
||||
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
||||
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
||||
sealSignRecord.setPensonAccountRes(caseAffiliate.getRespondentPhone());
|
||||
sealSignRecord.setPensonNameRes(caseAffiliate.getRespondentName());
|
||||
|
||||
DeptIdentify deptIdentify = new DeptIdentify();
|
||||
deptIdentify.setIsUse(1);
|
||||
DeptIdentify deptIdentifyselect = new DeptIdentify();
|
||||
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
|
||||
if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
|
||||
deptIdentifyselect = deptIdentifysnew.get(0);
|
||||
sealSignRecord.setOrgnizeName(deptIdentifyselect.getIdentifyName());
|
||||
sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getOperPhone());
|
||||
sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getOperName());
|
||||
} 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("甲方(签字):")) {
|
||||
//签名
|
||||
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
||||
// 遍历 positionsArray 中的每个元素
|
||||
for (int j = 0; j < positionsArray.size(); j++) {
|
||||
JSONObject positionObj = positionsArray.getJSONObject(j);
|
||||
int pageNum = positionObj.getIntValue("pageNum");
|
||||
sealSignRecord.setPositionPagepsn(String.valueOf(pageNum));
|
||||
JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
||||
JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
||||
double positionX = coordinateObj.getDoubleValue("positionX");
|
||||
double positionY = coordinateObj.getDoubleValue("positionY");
|
||||
sealSignRecord.setPositionXpsn(positionX + 90);
|
||||
sealSignRecord.setPositionYpsn(positionY + 30);
|
||||
}
|
||||
}else if (keyword.equals("乙方(签字):")) {
|
||||
//签名
|
||||
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
||||
// 遍历 positionsArray 中的每个元素
|
||||
for (int j = 0; j < positionsArray.size(); j++) {
|
||||
JSONObject positionObj = positionsArray.getJSONObject(j);
|
||||
int pageNum = positionObj.getIntValue("pageNum");
|
||||
sealSignRecord.setPositionPagepsnRes(String.valueOf(pageNum));
|
||||
JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
||||
JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
||||
double positionX = coordinateObj.getDoubleValue("positionX");
|
||||
double positionY = coordinateObj.getDoubleValue("positionY");
|
||||
sealSignRecord.setPositionXpsnRes(positionX + 90);
|
||||
sealSignRecord.setPositionYpsnRes(positionY);
|
||||
}
|
||||
}else if (keyword.equals("调解员(签字):")) {
|
||||
//签名
|
||||
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
||||
// 遍历 positionsArray 中的每个元素
|
||||
for (int j = 0; j < positionsArray.size(); j++) {
|
||||
JSONObject positionObj = positionsArray.getJSONObject(j);
|
||||
int pageNum = positionObj.getIntValue("pageNum");
|
||||
sealSignRecord.setPositionPagepsnMedi(String.valueOf(pageNum));
|
||||
JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
||||
JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
||||
double positionX = coordinateObj.getDoubleValue("positionX");
|
||||
double positionY = coordinateObj.getDoubleValue("positionY");
|
||||
sealSignRecord.setPositionXpsnMedi(positionX + 90);
|
||||
sealSignRecord.setPositionYpsnMedi(positionY);
|
||||
}
|
||||
}else {
|
||||
//用印
|
||||
JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
||||
// 遍历 positionsArray 中的每个元素
|
||||
for (int j = 0; j < positionsArray.size(); j++) {
|
||||
JSONObject positionObj = positionsArray.getJSONObject(j);
|
||||
int pageNum = positionObj.getIntValue("pageNum");
|
||||
sealSignRecord.setPositionPageorg(String.valueOf(pageNum));
|
||||
JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
||||
JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
||||
double positionX = coordinateObj.getDoubleValue("positionX");
|
||||
double positionY = coordinateObj.getDoubleValue("positionY");
|
||||
sealSignRecord.setPositionXorg(positionX + 90);
|
||||
sealSignRecord.setPositionYorg(positionY);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*DeptIdentify deptIdentify1 = new DeptIdentify();
|
||||
deptIdentify1.setSealStatus(1); // 印章状态为启用
|
||||
//根据机构名称查询部门id
|
||||
SysDept sysDept = new SysDept();
|
||||
sysDept.setDeptName(sealSignRecord.getOrgnizeName());
|
||||
List<SysDept> sysDepts = deptMapper.selectDeptList(sysDept);
|
||||
if (sysDepts != null && sysDepts.size() > 0) {
|
||||
Long deptId = sysDepts.get(0).getDeptId();
|
||||
deptIdentify1.setDeptId(deptId);
|
||||
}
|
||||
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify1);
|
||||
List<String> sealIds = new ArrayList<>();
|
||||
if (deptIdentifies != null && deptIdentifies.size() > 0) {
|
||||
for (DeptIdentify identify : deptIdentifies) {
|
||||
String sealId = identify.getSealId();
|
||||
sealIds.add(sealId);
|
||||
}
|
||||
}*/
|
||||
String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称
|
||||
String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名
|
||||
String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式
|
||||
//查询机构信息
|
||||
DeptIdentify deptIdentify1 = new DeptIdentify();
|
||||
deptIdentify1.setIdentifyName(orgnizeName);
|
||||
deptIdentify1.setOperName(orgnizeNamepsnName);
|
||||
deptIdentify1.setOperPhone(orgnizeNamePsnAccount);
|
||||
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
|
||||
if (deptIdentifies != null && deptIdentifies.size() > 0) {
|
||||
Long iddeptIdent = deptIdentifies.get(0).getId();
|
||||
SealManage sealManage = new SealManage();
|
||||
sealManage.setIdentifyId(iddeptIdent);
|
||||
List<String> sealIdList = new ArrayList<>();
|
||||
List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
|
||||
if (selectSealList != null && selectSealList.size() > 0) {
|
||||
for (SealManage manage : selectSealList) {
|
||||
Integer sealStatus = manage.getSealStatus();
|
||||
Integer isUse = manage.getIsUse();
|
||||
if (sealStatus == 1 && isUse ==1) {
|
||||
sealIdList.add(manage.getSealId());
|
||||
}
|
||||
}
|
||||
EsignHttpResponse response3 = SignAward.createByFileMediation(sealSignRecord, sealIdList);
|
||||
|
||||
JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
|
||||
if (jsonObject3 != null) {
|
||||
if (jsonObject3.getIntValue("code") == 0) {
|
||||
//获取签署流程ID
|
||||
JSONObject data1 = jsonObject3.getJSONObject("data");
|
||||
String signFlowId = data1.getString("signFlowId");
|
||||
//保存案件id,文件id,文件名称.流程id到签署用印记录表里
|
||||
sealSignRecord.setCaseAppliId(caseApplication.getId());
|
||||
sealSignRecord.setSignFlowid(signFlowId);
|
||||
sealSignRecord.setSignFlowStatus(1);//待签名
|
||||
MsSealSignRecord msSealSignRecord = new MsSealSignRecord();
|
||||
BeanUtil.copyProperties(sealSignRecord, msSealSignRecord);
|
||||
msSealSignRecord.setFileId(sealSignRecord.getFileid());
|
||||
msSealSignRecord.setFileName(sealSignRecord.getFilename());
|
||||
msSealSignRecord.setSignFlowId(sealSignRecord.getSignFlowid());
|
||||
msSealSignRecord.setOrgnNamePsnAcc(sealSignRecord.getOrgnizeNamePsnAccount());
|
||||
msSealSignRecord.setOrgnNamePsnName(sealSignRecord.getOrgnizeNamepsnName());
|
||||
sealSignRecordMapper.insert(msSealSignRecord);
|
||||
|
||||
SealSignRecord sealSignRecordapply = new SealSignRecord();
|
||||
sealSignRecordapply.setSignFlowid(signFlowId);
|
||||
sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
||||
EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
|
||||
JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
||||
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
||||
String urlapply = signUrlData.get("shortUrl").getAsString();
|
||||
String urlapplynew = urlapply.substring(urlapply.lastIndexOf("/")+1);
|
||||
|
||||
//发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
request.setTemplateId("2047719");
|
||||
request.setPhone(caseAffiliate.getContactTelphoneAgent());
|
||||
request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), caseApplication.getCaseNum(),urlapplynew});
|
||||
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||
|
||||
SealSignRecord sealSignRecordRespon = new SealSignRecord();
|
||||
sealSignRecordRespon.setSignFlowid(signFlowId);
|
||||
sealSignRecordRespon.setPensonAccount(caseAffiliate.getRespondentPhone());
|
||||
EsignHttpResponse signUrlRespon = SignAward.signUrlMediation(sealSignRecordRespon);
|
||||
JsonObject signUrlJsonObjectRespon = gson.fromJson(signUrlRespon.getBody(), JsonObject.class);
|
||||
JsonObject signUrlDataRespon = signUrlJsonObjectRespon.getAsJsonObject("data");
|
||||
String urlRespon = signUrlDataRespon.get("shortUrl").getAsString();
|
||||
String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/")+1);
|
||||
|
||||
SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
|
||||
request1.setTemplateId("2047719");
|
||||
request1.setPhone(caseAffiliate.getRespondentPhone());
|
||||
request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
|
||||
Boolean aBoolean1 = SmsUtils.sendSms(request1);
|
||||
|
||||
SealSignRecord sealSignRecordMedi = new SealSignRecord();
|
||||
sealSignRecordMedi.setSignFlowid(signFlowId);
|
||||
sealSignRecordMedi.setPensonAccount(sealSignRecord.getPensonAccountMedi());
|
||||
EsignHttpResponse signUrlResponMedi = SignAward.signUrlMediation(sealSignRecordMedi);
|
||||
JsonObject signUrlJsonObjectResponMedi = gson.fromJson(signUrlResponMedi.getBody(), JsonObject.class);
|
||||
JsonObject signUrlDataResponMedi = signUrlJsonObjectResponMedi.getAsJsonObject("data");
|
||||
String urlResponMedi = signUrlDataResponMedi.get("shortUrl").getAsString();
|
||||
String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/")+1);
|
||||
|
||||
SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
|
||||
requestMedi.setTemplateId("2047719");
|
||||
requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
|
||||
requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), caseApplication.getCaseNum(),urlResponnewMedi});
|
||||
Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
|
||||
|
||||
} else {
|
||||
throw new ServiceException(jsonObject3.getString("message"));
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -457,8 +194,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
public AjaxResult selectCaseProgress(MsSignSealDTO dto) {
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
Long id = dto.getCaseId();
|
||||
// MsCaseLogRecord caseLogRecord = new MsCaseLogRecord();
|
||||
// caseLogRecord.setCaseAppliId(id);
|
||||
List<MsCaseLogRecordVO> records = caseLogRecordMapper.selectCaseLogRecordListCaseProgress(dto.getCaseId());
|
||||
|
||||
MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(id);
|
||||
@@ -468,7 +203,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
List<MsCaseLogRecordVO> recordsNew = new ArrayList<>();
|
||||
if (records != null && records.size() > 0) {
|
||||
for (MsCaseLogRecordVO msCaseLogRecordVO : records) {
|
||||
// String content = msCaseLogRecordVO.getContent();
|
||||
String content = msCaseLogRecordVO.getCaseStatusName();
|
||||
if(StringUtils.isNotEmpty(content)){
|
||||
if(content.equals("结束")){
|
||||
@@ -594,6 +328,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult msCaseFile(List<Long> ids){
|
||||
// todo
|
||||
try {
|
||||
for (Long id : ids) {
|
||||
MsCaseApplication caseApplication1 = msCaseApplicationMapper.selectByPrimaryKey(id);
|
||||
@@ -606,10 +341,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
if (caseAttachList != null && caseAttachList.size() > 0) {
|
||||
for (MsCaseAttach caseAttach : caseAttachList) {
|
||||
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
|
||||
// String annexName = caseAttach.getAnnexName();
|
||||
// String prefix = "/profile/upload/";
|
||||
// int startIndex = prefix.length();
|
||||
// String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
|
||||
String prefix = "/profile";
|
||||
int startIndex = prefix.length();
|
||||
String annexPath = caseAttach.getAnnexPath();
|
||||
@@ -638,9 +369,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
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;
|
||||
|
||||
@@ -687,61 +415,48 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
caseApplication1.setCaseStatusName(nextFlow.getCaseStatusName());
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(caseApplication1);
|
||||
|
||||
String appEmail = "";
|
||||
String resEmail = "";
|
||||
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
|
||||
// 获取案件相关人员
|
||||
List<MsCaseAffiliate> affiliates = applicationService.selectAffliatesByCaseId(id);
|
||||
if(CollectionUtil.isEmpty(affiliates)){
|
||||
return AjaxResult.error("未找到案件相关人员");
|
||||
}
|
||||
List<MsCaseAffiliate> oprratorList = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() != null
|
||||
&& affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getEmail()))
|
||||
.collect(Collectors.toList());
|
||||
if(CollectionUtil.isEmpty(oprratorList)){
|
||||
return AjaxResult.error("未找到案件操作人员");
|
||||
}
|
||||
|
||||
Integer organizeFlag = caseAffiliate.getOrganizeFlag();
|
||||
if(organizeFlag!=null){
|
||||
if(organizeFlag.intValue()==1){
|
||||
appEmail = caseAffiliate.getAgentEmail();
|
||||
}else {
|
||||
appEmail = caseAffiliate.getApplicationEmail();
|
||||
for (MsCaseAffiliate affiliate : oprratorList) {
|
||||
if(affiliate.getRoleType()==null){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
resEmail = caseAffiliate.getRespondentEmail();
|
||||
boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList);
|
||||
boolean appEmailFlag = sendCaseEmail(caseApplication1, affiliate.getEmail(), caseAttachList);
|
||||
|
||||
SendMailRecord sendMailRecord = new SendMailRecord();
|
||||
sendMailRecord.setCaseId(id);
|
||||
sendMailRecord.setMailAddress(appEmail);
|
||||
sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
|
||||
// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
|
||||
sendMailRecord.setMailName("签署后的调解书");
|
||||
sendMailRecord.setSendTime(new Date());
|
||||
sendMailRecord.setCreateBy(SecurityUtils.getUsername());
|
||||
if (appEmailFlag) {
|
||||
sendMailRecord.setSendStatus(1);
|
||||
} else {
|
||||
sendMailRecord.setSendStatus(0);
|
||||
SendMailRecord sendMailRecord = new SendMailRecord();
|
||||
sendMailRecord.setCaseId(id);
|
||||
sendMailRecord.setMailAddress(affiliate.getEmail());
|
||||
sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
|
||||
sendMailRecord.setMailName("签署后的调解书");
|
||||
sendMailRecord.setSendTime(new Date());
|
||||
sendMailRecord.setCreateBy(SecurityUtils.getUsername());
|
||||
if (appEmailFlag) {
|
||||
sendMailRecord.setSendStatus(1);
|
||||
} else {
|
||||
sendMailRecord.setSendStatus(0);
|
||||
}
|
||||
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
|
||||
}
|
||||
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
|
||||
|
||||
boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList);
|
||||
|
||||
SendMailRecord sendMailRecord1 = new SendMailRecord();
|
||||
sendMailRecord1.setCaseId(id);
|
||||
sendMailRecord1.setMailAddress(resEmail);
|
||||
// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
|
||||
sendMailRecord1.setMailContent("您好,审核后的调解书在附件中请查阅");
|
||||
sendMailRecord1.setMailName("签署后的调解书");
|
||||
sendMailRecord1.setSendTime(new Date());
|
||||
sendMailRecord1.setCreateBy(SecurityUtils.getUsername());
|
||||
if (resEmailFlag) {
|
||||
sendMailRecord1.setSendStatus(1);
|
||||
}else {
|
||||
sendMailRecord1.setSendStatus(0);
|
||||
}
|
||||
sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
|
||||
if(!appEmailFlag&&!resEmailFlag){
|
||||
throw new ServiceException("调解书发送失败");
|
||||
}
|
||||
if(!appEmailFlag){
|
||||
throw new ServiceException("申请人调解书发送失败");
|
||||
}
|
||||
if(!resEmailFlag){
|
||||
throw new ServiceException("被申请人调解书发送失败");
|
||||
}
|
||||
// if(!appEmailFlag&&!resEmailFlag){
|
||||
// throw new ServiceException("调解书发送失败");
|
||||
// }
|
||||
// if(!appEmailFlag){
|
||||
// throw new ServiceException("申请人调解书发送失败");
|
||||
// }
|
||||
// if(!resEmailFlag){
|
||||
// throw new ServiceException("被申请人调解书发送失败");
|
||||
// }
|
||||
|
||||
CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
|
||||
|
||||
@@ -778,8 +493,10 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
// }
|
||||
// }
|
||||
if (dto.getIsSignApply() != null && dto.getIsSignApply().intValue() == 1) {
|
||||
caseAffiliate.setIsSignApply(1);
|
||||
msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
|
||||
// todo 签收不要该字段
|
||||
// caseAffiliate.setIsSignApply(1);
|
||||
// todo 签收不要该字段
|
||||
// msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
|
||||
|
||||
// 根据流程id查找下一个流程节点
|
||||
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
|
||||
@@ -802,8 +519,10 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
// }
|
||||
|
||||
if (dto.getIsSignRespon() != null && dto.getIsSignRespon().intValue() == 1) {
|
||||
caseAffiliate.setIsSignRespon(1);
|
||||
msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
|
||||
// todo 签收不要该字段
|
||||
// caseAffiliate.setIsSignRespon(1);
|
||||
// todo 签收不要该字段
|
||||
// msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
|
||||
|
||||
// 根据流程id查找下一个流程节点
|
||||
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
|
||||
@@ -811,6 +530,11 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
|
||||
CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
|
||||
CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), 17, "结束", null);
|
||||
// todo 被申请人签收结束对接北明,为调解成功状态
|
||||
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
|
||||
applicationService.pushStatusToBM(caseApplicationselect, PushCaseStatusEnum.SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.success("签收成功");
|
||||
@@ -819,12 +543,29 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
|
||||
@Override
|
||||
public AjaxResult msCaseSignUrlApplyPC(MsSignSealDTO dto) throws EsignDemoException {
|
||||
// todo
|
||||
Long caseId = dto.getCaseId();
|
||||
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
|
||||
Integer organizeFlag = caseAffiliate.getOrganizeFlag();
|
||||
//MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
|
||||
List<MsCaseAffiliate> affiliates = applicationService.selectAffliatesByCaseId(caseId);
|
||||
if(CollectionUtil.isEmpty(affiliates)){
|
||||
return AjaxResult.error("未找到案件相关人员");
|
||||
}
|
||||
List<MsCaseAffiliate> operatorList = affiliates.stream().filter(msCaseAffiliate -> msCaseAffiliate.getOperatorFlag() != null
|
||||
&& msCaseAffiliate.getOperatorFlag() == 1
|
||||
&& StrUtil.isNotEmpty(msCaseAffiliate.getPhone())).collect(Collectors.toList());
|
||||
Optional<MsCaseAffiliate> appOpt =null;
|
||||
Optional<MsCaseAffiliate> resOpt =null;
|
||||
if(CollectionUtil.isNotEmpty(operatorList)){
|
||||
appOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null
|
||||
&& (msCaseAffiliate.getRoleType() == 1 || msCaseAffiliate.getRoleType() == 2))
|
||||
.findFirst();
|
||||
resOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null
|
||||
&& (msCaseAffiliate.getRoleType() == 3 || msCaseAffiliate.getRoleType() == 4))
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(caseId);
|
||||
|
||||
Integer organizeFlag = caseApplication.getOrganizeFlag();
|
||||
SysUser user = new SysUser();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
user.setUserId(userId);
|
||||
@@ -836,6 +577,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
}
|
||||
List<String> roleNames = allSysRole.stream().map(SysRole::getRoleName).collect(Collectors.toList());
|
||||
if(roleNames.contains("申请人")){
|
||||
if(appOpt==null || !appOpt.isPresent()){
|
||||
return AjaxResult.error("未找到案件申请操作人");
|
||||
}
|
||||
SealSignRecord sealSignRecordres = new SealSignRecord();
|
||||
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
|
||||
mssealSignRecord.setCaseAppliId(caseId);
|
||||
@@ -844,19 +588,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
String signFlowid = sealSignRecords.get(0).getSignFlowId();
|
||||
if(organizeFlag!=null){
|
||||
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||
if(organizeFlag.intValue()==1){
|
||||
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
||||
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
||||
}else {
|
||||
String nameAgent = caseAffiliate.getNameAgent();
|
||||
if(StringUtils.isNotBlank(nameAgent)){
|
||||
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
||||
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
||||
}else {
|
||||
sealSignRecord.setPensonAccount(caseAffiliate.getApplicationPhone());
|
||||
sealSignRecord.setPensonName(caseAffiliate.getApplicationName());
|
||||
}
|
||||
}
|
||||
sealSignRecord.setPensonAccount(appOpt.get().getPhone());
|
||||
sealSignRecord.setPensonName(appOpt.get().getName());
|
||||
sealSignRecord.setSignFlowid(signFlowid);
|
||||
|
||||
Gson gson = new Gson();
|
||||
@@ -873,6 +606,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
|
||||
|
||||
}else if(roleNames.contains("被申请人")){
|
||||
if(resOpt==null || !resOpt.isPresent()){
|
||||
return AjaxResult.error("未找到案件申请操作人");
|
||||
}
|
||||
SealSignRecord sealSignRecordres = new SealSignRecord();
|
||||
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
|
||||
mssealSignRecord.setCaseAppliId(caseId);
|
||||
@@ -880,7 +616,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
||||
String signFlowid = sealSignRecords.get(0).getSignFlowId();
|
||||
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||
sealSignRecord.setPensonAccount(caseAffiliate.getRespondentPhone());
|
||||
sealSignRecord.setPensonAccount(resOpt.get().getPhone());
|
||||
sealSignRecord.setPensonName(resOpt.get().getName());
|
||||
sealSignRecord.setSignFlowid(signFlowid);
|
||||
|
||||
Gson gson = new Gson();
|
||||
@@ -927,95 +664,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult msCaseSignUrlResPC(MsSignSealDTO dto) throws EsignDemoException {
|
||||
Long caseId = dto.getCaseId();
|
||||
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
|
||||
SealSignRecord sealSignRecordres = new SealSignRecord();
|
||||
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
|
||||
mssealSignRecord.setCaseAppliId(caseId);
|
||||
List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
|
||||
if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
||||
String signFlowid = sealSignRecords.get(0).getSignFlowId();
|
||||
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||
sealSignRecord.setPensonAccount(caseAffiliate.getRespondentPhone());
|
||||
sealSignRecord.setSignFlowid(signFlowid);
|
||||
|
||||
Gson gson = new Gson();
|
||||
EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecord);
|
||||
JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
||||
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
||||
String urlapply = signUrlData.get("shortUrl").getAsString();
|
||||
sealSignRecordres.setSealUrl(urlapply);
|
||||
}
|
||||
|
||||
return AjaxResult.success(sealSignRecordres);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult msCaseSignUrlApplyAPP(MsSignSealDTO dto) throws EsignDemoException {
|
||||
Long caseId = dto.getCaseId();
|
||||
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
|
||||
Integer organizeFlag = caseAffiliate.getOrganizeFlag();
|
||||
SealSignRecord sealSignRecordres = new SealSignRecord();
|
||||
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
|
||||
mssealSignRecord.setCaseAppliId(caseId);
|
||||
List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
|
||||
if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
||||
String signFlowid = sealSignRecords.get(0).getSignFlowId();
|
||||
if(organizeFlag!=null){
|
||||
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||
if(organizeFlag.intValue()==1){
|
||||
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
||||
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
||||
}else {
|
||||
String nameAgent = caseAffiliate.getNameAgent();
|
||||
if(StringUtils.isNotBlank(nameAgent)){
|
||||
sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
||||
sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
||||
}else {
|
||||
sealSignRecord.setPensonAccount(caseAffiliate.getApplicationPhone());
|
||||
sealSignRecord.setPensonName(caseAffiliate.getApplicationName());
|
||||
}
|
||||
}
|
||||
sealSignRecord.setSignFlowid(signFlowid);
|
||||
|
||||
Gson gson = new Gson();
|
||||
EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecord);
|
||||
JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
||||
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
||||
String urlapply = signUrlData.get("shortUrl").getAsString();
|
||||
sealSignRecordres.setSealUrl(urlapply);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(sealSignRecordres);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException {
|
||||
Long caseId = dto.getCaseId();
|
||||
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
|
||||
SealSignRecord sealSignRecordres = new SealSignRecord();
|
||||
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
|
||||
mssealSignRecord.setCaseAppliId(caseId);
|
||||
List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
|
||||
if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
||||
String signFlowid = sealSignRecords.get(0).getSignFlowId();
|
||||
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||
sealSignRecord.setPensonAccount(caseAffiliate.getRespondentPhone());
|
||||
sealSignRecord.setSignFlowid(signFlowid);
|
||||
|
||||
Gson gson = new Gson();
|
||||
EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecord);
|
||||
JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
||||
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
||||
String urlapply = signUrlData.get("shortUrl").getAsString();
|
||||
sealSignRecordres.setSealUrl(urlapply);
|
||||
}
|
||||
|
||||
return AjaxResult.success(sealSignRecordres);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -1187,12 +835,38 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
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(7);
|
||||
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
caseAttach.setAnnexPath(savePath);
|
||||
caseAttach.setAnnexName(saveName);
|
||||
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
||||
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);
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1256,12 +930,38 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
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(7);
|
||||
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
caseAttach.setAnnexPath(savePath);
|
||||
caseAttach.setAnnexName(saveName);
|
||||
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
||||
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);
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1322,12 +1022,39 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
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(7);
|
||||
caseAttach.setAnnexPath(savePath);
|
||||
caseAttach.setAnnexName(saveName);
|
||||
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
||||
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);
|
||||
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+19
-32
@@ -31,9 +31,6 @@ import com.tencentcloudapi.trtc.v20190722.TrtcClient;
|
||||
import com.tencentcloudapi.trtc.v20190722.models.*;
|
||||
import com.tencentyun.TLSSigAPIv2;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFRun;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -42,18 +39,14 @@ import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Base64;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
||||
import static com.ruoyi.common.utils.file.FileUploadUtils.*;
|
||||
import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile;
|
||||
import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName;
|
||||
|
||||
/**
|
||||
* @author wangqiong
|
||||
@@ -373,18 +366,27 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult secretaryRoleByUserId(Long userId) {
|
||||
List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
|
||||
public AjaxResult secretaryRoleByUserId(Long userId, Long caseId) {
|
||||
// 根据案件id查询案件
|
||||
MsCaseApplication caseApplication = caseApplicationMapper.selectByPrimaryKey(caseId);
|
||||
if(caseApplication==null){
|
||||
return AjaxResult.error("案件不存在");
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
boolean isSecretaryRole=false;
|
||||
if(CollectionUtil.isNotEmpty(roles)){
|
||||
for (SysRole role : roles) {
|
||||
if("调解员".equals(role.getRoleName())){
|
||||
isSecretaryRole=true;
|
||||
break;
|
||||
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())){
|
||||
isSecretaryRole=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jsonObject.put("isSecretaryRole",isSecretaryRole);
|
||||
return success(jsonObject);
|
||||
}
|
||||
@@ -424,21 +426,6 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception{
|
||||
String htmlContent = "<h1>wangwu</h1><p>喂喂喂</p><h1>zhangsan</h1><p>hello</p><h1>zhangsan</h1><p>我能听到你说话</p><h1>wangwu</h1><p>欧克</p><h1>wangwu</h1><p>关于XXX我有几点想说的,balalalalalal</p><h1>zhangsan</h1><p>看到回复的时刻双方都是华德福额外补充你下次u饿哦是那些二的河南省而很为难啊看的法国队哈哈哈哈哈哈哈哈哈</p> "; // HTML字符串
|
||||
String outputFileName="D://output.docx";
|
||||
XWPFDocument document = new XWPFDocument();
|
||||
XWPFParagraph paragraph = document.createParagraph();
|
||||
XWPFRun run = paragraph.createRun();
|
||||
run.setText(htmlContent);
|
||||
FileOutputStream out = new FileOutputStream(new File(outputFileName));
|
||||
document.write(out);
|
||||
out.close();
|
||||
System.out.printf("生成调解笔录成功");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 将视频下载到本地
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.log.MsRequestLogMapper">
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.entity.log.MsRequestLog">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="status" jdbcType="BIGINT" property="status" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="request_url" jdbcType="LONGVARCHAR" property="requestUrl" />
|
||||
<result column="content" jdbcType="LONGVARCHAR" property="content" />
|
||||
<result column="reason" jdbcType="LONGVARCHAR" property="reason" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -21,6 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="code" column="code" />
|
||||
<result property="compLegalPerson" column="comp_legal_person" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeptVo">
|
||||
@@ -111,6 +113,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="code != null and code != ''">code,</if>
|
||||
<if test="compLegalPerson != null and compLegalPerson != ''">comp_legal_person,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||
@@ -124,6 +128,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="compLegalPerson != null and compLegalPerson != ''">#{compLegalPerson},</if>
|
||||
sysdate()
|
||||
);
|
||||
</insert>
|
||||
@@ -140,6 +146,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
email,
|
||||
status,
|
||||
create_by,
|
||||
code,
|
||||
comp_legal_person,
|
||||
create_time
|
||||
)values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
@@ -155,6 +163,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{item.email},
|
||||
#{item.status},
|
||||
#{item.createBy},
|
||||
#{item.code},
|
||||
#{item.compLegalPerson},
|
||||
sysdate()
|
||||
)
|
||||
</foreach>;
|
||||
@@ -174,6 +184,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="email != null">email = #{email},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="code != null and code != ''">code = #{code},</if>
|
||||
<if test="compLegalPerson != null and compLegalPerson != ''">comp_legal_person = #{compLegalPerson},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dept_id = #{deptId}
|
||||
|
||||
@@ -125,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_name = #{userName} and u.del_flag = '0'
|
||||
where u.user_name = #{userName} and u.del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||
@@ -155,7 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select user_id, email from ms_sys_user where email = #{email} and del_flag = '0' limit 1
|
||||
</select>
|
||||
<select id="selectUserListByIds" resultMap="SysUserResult">
|
||||
select u.user_id, u.nick_name, u.user_name,u.id_card,u.specialty, u.phonenumber, u.remark from ms_sys_user u
|
||||
select u.* from ms_sys_user u
|
||||
|
||||
<where>
|
||||
<if test="idList != null and idList.size() > 0">
|
||||
@@ -177,12 +177,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join ms_sys_role r on r.role_id = ur.role_id
|
||||
where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
|
||||
</select>
|
||||
<select id="selectUserByPhone" parameterType="String" resultMap="SysUserResult">
|
||||
<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
|
||||
select u.*,ur.role_id
|
||||
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.phonenumber = #{phone} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
|
||||
where u.eamil = #{eamil} 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
|
||||
@@ -204,6 +204,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="idCard != null and idCard != ''">id_card,</if>
|
||||
<if test="idType != null ">id_type,</if>
|
||||
<if test="nationality != null ">nationality,</if>
|
||||
<if test="birth != null ">birth,</if>
|
||||
<if test="home != null and home != '' ">home,</if>
|
||||
<if test="address != null and address != '' ">address,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||
@@ -222,6 +225,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="idCard != null and idCard != ''">#{idCard},</if>
|
||||
<if test="idType != null ">#{idType},</if>
|
||||
<if test="nationality != null ">#{nationality},</if>
|
||||
<if test="birth != null ">#{birth},</if>
|
||||
<if test="home != null and home != '' ">#{home},</if>
|
||||
<if test="address != null and address != '' ">#{address},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||
@@ -240,6 +246,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
user_name,
|
||||
nick_name,
|
||||
id_card,
|
||||
id_type,
|
||||
nationality,
|
||||
birth,
|
||||
home,
|
||||
address,
|
||||
email,
|
||||
avatar,
|
||||
phonenumber,
|
||||
@@ -257,6 +268,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{item.userName},
|
||||
#{item.nickName},
|
||||
#{item.idCard},
|
||||
#{item.idType},
|
||||
#{item.nationality},
|
||||
#{item.birth},
|
||||
#{item.home},
|
||||
#{item.address},
|
||||
#{item.email},
|
||||
#{item.avatar},
|
||||
#{item.phonenumber},
|
||||
@@ -280,6 +296,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
|
||||
<if test="idType != null">id_type = #{idType},</if>
|
||||
<if test="nationality != null">nationality = #{nationality},</if>
|
||||
<if test="birth != null ">birth = #{birth},</if>
|
||||
<if test="home != null and home != '' ">home = #{home},</if>
|
||||
<if test="address != null and address != '' ">address = #{address},</if>
|
||||
<if test="email != null ">email = #{email},</if>
|
||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
|
||||
@@ -16,7 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="countUserRoleByRoleId" resultType="Integer">
|
||||
select count(1) from ms_sys_user_role where role_id=#{roleId}
|
||||
</select>
|
||||
|
||||
<select id="selectRoleIdsByUserId" resultType="java.lang.Long">
|
||||
select role_id from ms_sys_user_role where user_id=#{userId}
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteUserRole" parameterType="Long">
|
||||
delete from ms_sys_user_role where user_id in
|
||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||
|
||||
+69
-23
@@ -1,27 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAffiliateMapper">
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="case_appli_id" jdbcType="BIGINT" property="caseAppliId" />
|
||||
<result column="application_organ_id" jdbcType="VARCHAR" property="applicationOrganId" />
|
||||
<result column="application_organ_name" jdbcType="VARCHAR" property="applicationOrganName" />
|
||||
<result column="credit_code" jdbcType="VARCHAR" property="creditCode" />
|
||||
<result column="comp_legal_person" jdbcType="VARCHAR" property="compLegalPerson" />
|
||||
<result column="applicant_home" jdbcType="VARCHAR" property="applicantHome" />
|
||||
<result column="applicant_address" jdbcType="VARCHAR" property="applicantAddress" />
|
||||
<result column="name_agent" jdbcType="VARCHAR" property="nameAgent" />
|
||||
<result column="contact_telphone_agent" jdbcType="VARCHAR" property="contactTelphoneAgent" />
|
||||
<result column="agent_email" jdbcType="VARCHAR" property="agentEmail" />
|
||||
<result column="applicant_track_num" jdbcType="VARCHAR" property="applicantTrackNum" />
|
||||
<result column="respondent_name" jdbcType="VARCHAR" property="respondentName" />
|
||||
<result column="respondent_identity_num" jdbcType="VARCHAR" property="respondentIdentityNum" />
|
||||
<result column="respondent_sex" jdbcType="VARCHAR" property="respondentSex" />
|
||||
<result column="respondent_birth" jdbcType="TIMESTAMP" property="respondentBirth" />
|
||||
<result column="respondent_home" jdbcType="VARCHAR" property="respondentHome" />
|
||||
<result column="respondent_email" jdbcType="VARCHAR" property="respondentEmail" />
|
||||
<result column="respondent_track_num" jdbcType="VARCHAR" property="respondentTrackNum" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="listGroupConcat" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
|
||||
select
|
||||
a.case_appli_id caseAppliId,
|
||||
u.nickName name,
|
||||
u.id_type idType,
|
||||
r.role_name roleName,
|
||||
GROUP_CONCAT( DISTINCT CASE WHEN c.organize_flag = 0 THEN u.nick_name ELSE d.dept_name END ) AS name,
|
||||
(select GROUP_CONCAT( DISTINCT u1.nick_name ) FROM
|
||||
|
||||
ms_case_affiliate a1
|
||||
LEFT JOIN ms_sys_user u1 ON u1.user_id = a1.user_id
|
||||
LEFT JOIN ms_sys_user_role ur1 ON u1.user_id = ur1.user_id
|
||||
LEFT JOIN ms_sys_role r1 ON r1.role_id = ur1.role_id
|
||||
where a.case_appli_id = a1.case_appli_id and (r1.role_name='被申请人' )
|
||||
|
||||
group by a1.case_appli_id) resName
|
||||
|
||||
FROM
|
||||
ms_case_application c
|
||||
JOIN ms_case_affiliate a ON c.id = a.case_appli_id
|
||||
LEFT JOIN ms_sys_user u ON u.user_id = a.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_dept d ON d.dept_id = a.applicant_dept_id
|
||||
<where>
|
||||
(r.role_name='申请人' )
|
||||
<if test="caseIds != null and caseIds.size() > 0">
|
||||
and a.case_appli_id in
|
||||
<foreach item="caseId" index="index" collection="caseIds" open="(" separator="," close=")">
|
||||
#{caseId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
group by a.case_appli_id
|
||||
</select>
|
||||
<select id="selectByCaseId" 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.nick_name name,u.id_card idCard,u.phonenumber phone,
|
||||
u.email,u.home,u.address,u.sex,u.nationality,u.id_type idType,u.birth,a.user_id userId
|
||||
FROM
|
||||
ms_case_application c
|
||||
JOIN ms_case_affiliate a ON a.case_appli_id=#{id} and c.id = a.case_appli_id
|
||||
LEFT JOIN ms_sys_user u ON u.user_id = a.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_dept d ON d.dept_id = a.applicant_dept_id
|
||||
where c.id = #{id}
|
||||
GROUP BY a.id
|
||||
</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.nick_name name,u.id_card idCard,u.phonenumber phone,
|
||||
u.email,u.home,u.address,u.sex,u.nationality,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId
|
||||
FROM
|
||||
ms_case_application c
|
||||
JOIN ms_case_affiliate a ON c.id = a.case_appli_id
|
||||
LEFT JOIN ms_sys_user u ON u.user_id = a.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_dept d ON d.dept_id = a.applicant_dept_id
|
||||
<where>
|
||||
<if test="caseIds != null and caseIds.size() > 0">
|
||||
and a.case_appli_id in
|
||||
<foreach item="caseId" index="index" collection="caseIds" open="(" separator="," close=")">
|
||||
#{caseId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
+109
@@ -34,7 +34,56 @@
|
||||
<result column="mediation_agreement" jdbcType="LONGVARCHAR" property="mediationAgreement" />
|
||||
<result column="is_reconci" jdbcType="INTEGER" property="isReconci" />
|
||||
</resultMap>
|
||||
<sql id="SELECT_LIST_QUERY">
|
||||
FROM
|
||||
ms_case_application c
|
||||
JOIN ms_case_affiliate a ON c.id = a.case_appli_id
|
||||
LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
|
||||
LEFT JOIN ms_sys_user u1 ON u1.user_id = c.mediator_id
|
||||
LEFT JOIN ms_sys_user_role ur ON u.user_id = ur.user_id or u1.user_id = ur.user_id
|
||||
LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id or r.role_id = ur.role_id
|
||||
LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
|
||||
<where>
|
||||
<!-- 调解员角色和申请人,被申,代理人-->
|
||||
<if test = 'req.mediatorId != null and req.userId!=null'>
|
||||
AND (c.mediator_id = #{req.mediatorId} or a.user_id=#{req.userId})
|
||||
</if>
|
||||
<!-- admin,财务,顾问,部门长查看所有案件,申请人,被申,代理人根据userId查-->
|
||||
<if test = 'req.mediatorId == null and req.userId != null'>
|
||||
AND (a.user_id=#{req.userId} )
|
||||
</if>
|
||||
<!-- 根据角色查询-->
|
||||
<if test='roleIds != null and roleIds.size() > 0 '>
|
||||
and r.role_id in
|
||||
<foreach item='roleId' index='index' collection='roleIds' open='(' separator=',' close=')'>
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 角色相关的状态-->
|
||||
<if test='caseFlowIds != null and caseFlowIds.size() > 0 '>
|
||||
and c.case_flow_id in
|
||||
<foreach item='flowId' index='index' collection='caseFlowIds' open='(' separator=',' close=')'>
|
||||
#{flowId}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 案件状态id条件-->
|
||||
<if test = 'req.caseFlowId != null'>
|
||||
AND c.case_flow_id = #{req.caseFlowId}
|
||||
</if>
|
||||
<!-- 案件编号-->
|
||||
<if test = 'req.caseNum != null and req.caseNum != "" '>
|
||||
AND c.case_num = #{req.caseNum}
|
||||
</if>
|
||||
<!-- 时间-->
|
||||
<if test = 'req.startTime != null and req.startTime != "" '>
|
||||
and c.create_time >= #{req.startTime}
|
||||
</if>
|
||||
<if test = 'req.endTime != null and req.endTime != "" '>
|
||||
and c.create_time <= #{req.endTime}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</sql>
|
||||
<select id="listMediator" resultMap="BaseResultMap">
|
||||
select mediator_id ,id ,case_status_name,case_flow_id from ms_case_application <where>
|
||||
<if test = 'userIds!=null and userIds.size()>0'>
|
||||
@@ -50,4 +99,64 @@
|
||||
</if> -->
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="todoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.CaseToDoCount">
|
||||
SELECT c.case_flow_id caseFlowId,count(DISTINCT c.id) caseCount
|
||||
<include refid="SELECT_LIST_QUERY"/>
|
||||
group by c.case_flow_id
|
||||
</select>
|
||||
<select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO">
|
||||
select t.* from(
|
||||
SELECT
|
||||
c.id,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
|
||||
c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
|
||||
u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
|
||||
c.mediation_method mediationMethod,
|
||||
CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName
|
||||
<include refid="SELECT_LIST_QUERY"/>
|
||||
GROUP BY
|
||||
c.id
|
||||
union
|
||||
SELECT
|
||||
c.id,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
|
||||
c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
|
||||
u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
|
||||
c.mediation_method mediationMethod,
|
||||
CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName
|
||||
FROM
|
||||
ms_case_log_record r
|
||||
join ms_case_application c on r.case_appli_id=c.id
|
||||
JOIN ms_case_affiliate a ON c.id = a.case_appli_id
|
||||
LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
|
||||
LEFT JOIN ms_sys_user u1 ON u1.user_id = c.mediator_id
|
||||
LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
|
||||
<where>
|
||||
r.create_by=#{req.userName} and c.id not in ( SELECT c.id
|
||||
<include refid="SELECT_LIST_QUERY"/>
|
||||
)
|
||||
|
||||
<!-- 案件状态id条件-->
|
||||
<if test = 'req.caseFlowId != null'>
|
||||
AND c.case_flow_id = #{req.caseFlowId}
|
||||
</if>
|
||||
<!-- 案件编号-->
|
||||
<if test = 'req.caseNum != null and req.caseNum != "" '>
|
||||
AND c.case_num = #{req.caseNum}
|
||||
</if>
|
||||
<!-- 时间-->
|
||||
<if test = 'req.startTime != null and req.startTime != "" '>
|
||||
and c.create_time >= #{req.startTime}
|
||||
</if>
|
||||
<if test = 'req.endTime != null and req.endTime != "" '>
|
||||
and c.create_time <= #{req.endTime}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
GROUP BY
|
||||
c.id
|
||||
) t ORDER BY t.createTime desc,t.caseNum desc
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -14,6 +14,7 @@
|
||||
<result property="useId" column="use_id" />
|
||||
<result property="useAccount" column="use_account" />
|
||||
<result property="onlyOfficeFileId" column="only_office_file_id" />
|
||||
<result property="otherSysFileId" column="other_sys_file_id" />
|
||||
</resultMap>
|
||||
<insert id="save" useGeneratedKeys="true" keyProperty="annexId">
|
||||
INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,only_office_file_id)
|
||||
@@ -109,7 +110,9 @@
|
||||
<update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
|
||||
update ms_case_attach
|
||||
set
|
||||
<if test="otherSysFileId != null and otherSysFileId != ''"> other_sys_file_id=#{otherSysFileId},</if>
|
||||
case_appli_id= #{caseAppliId}
|
||||
|
||||
where annex_id = #{annexId}
|
||||
</update>
|
||||
<update id="batchUpdate">
|
||||
@@ -125,6 +128,7 @@
|
||||
update ms_case_attach
|
||||
<set>
|
||||
<if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
|
||||
<if test="otherSysFileId != null and otherSysFileId != ''"> other_sys_file_id=#{otherSysFileId},</if>
|
||||
<if test="annexPath != null and annexPath != ''">annex_path = #{annexPath}</if>
|
||||
</set>
|
||||
<where>
|
||||
|
||||
Reference in New Issue
Block a user