调解员签名按钮权限返回修复 #129

Merged
wangqiong123 merged 3 commits from wq1 into dev 2024-03-20 06:00:29 +00:00
38 changed files with 1316 additions and 203 deletions
Showing only changes of commit c596c5654f - Show all commits
@@ -1,11 +1,19 @@
package com.ruoyi;
import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.system.mapper.SysUserMapper;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.List;
/**
* 启动程序
*
@@ -30,5 +38,14 @@ public class RuoYiApplication
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
// 启动成功后,查询用户表,将用户信息存到redis
RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
SysUserMapper userMapper = SpringUtils.getBean(SysUserMapper.class);
List<SysUser> sysUsers = userMapper.selectUserListByIds(null);
if(CollectionUtil.isNotEmpty(sysUsers)){
for (SysUser sysUser : sysUsers) {
redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
}
}
}
}
@@ -5,10 +5,7 @@ import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
import com.ruoyi.system.service.flow.CaseFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import static com.ruoyi.common.core.domain.AjaxResult.success;
@@ -28,6 +25,13 @@ public class CaseFlowController {
public Object queryCaseFlowInfo(@RequestBody MsCaseFlowSearchVO caseFlowSearchVO) {
return caseFlowService.queryCaseFlowInfo(caseFlowSearchVO);
}
/**
* 查询案件流程信息
*/
@GetMapping("/selectCaseFlow")
public AjaxResult selectCaseFlow() {
return caseFlowService.selectCaseFlow();
}
/**
* 新增或编辑案件流程节点信息
@@ -1,19 +1,6 @@
package com.ruoyi.web.controller.system;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@@ -24,6 +11,14 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* 数据字典信息
@@ -82,6 +77,20 @@ public class SysDictDataController extends BaseController
}
return success(data);
}
/**
* 根据字典类型查询字典数据信息,跳过token
*/
@Anonymous
@GetMapping(value = "/type/skipToken/{dictType}")
public AjaxResult skipToken(@PathVariable String dictType)
{
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
if (StringUtils.isNull(data))
{
data = new ArrayList<SysDictData>();
}
return success(data);
}
/**
* 新增字典类型
@@ -1,8 +1,17 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.Set;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.digest.MD5;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysMenuService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.flow.CaseFlowService;
import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
@@ -12,15 +21,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.system.service.ISysMenuService;
import java.util.List;
import java.util.Set;
/**
* 登录验证
@@ -43,6 +46,8 @@ public class SysLoginController {
private ISysUserService sysUserService;
@Autowired
private CaseFlowService caseFlowService;
@Autowired
private TokenService tokenService;
/**
* 登录方法
*
@@ -102,4 +107,19 @@ public class SysLoginController {
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
return AjaxResult.success(menuService.buildMenus(menus));
}
/**sso登录接口*/
@PostMapping("login/sso")
public AjaxResult loginSSO( @RequestBody LoginBody loginBody){
if(StrUtil.isEmpty(loginBody.getUsername()) || StrUtil.isEmpty(loginBody.getTicket())
|| StrUtil.isEmpty(loginBody.getRoleName()) ){
return AjaxResult.error("参数错误");
}
return loginService.loginSSO(loginBody);
}
public static void main(String[] args) {
System.out.println( MD5.create().digestHex("BMceshi" ));
}
}
@@ -73,14 +73,25 @@ public class MsCaseApplicationController extends BaseController {
/**
* 新增案件
*/
// todo 重复提交校验
@PostMapping("/insert")
public AjaxResult insert(@RequestBody MsCaseApplicationVO caseApplication )
{
if(caseApplication.getAffiliate()==null||caseApplication.getAffiliate().getOrganizeFlag()==null){
error("参数校验失败");
}
AjaxResult ajaxResult = AjaxResult.success();
ajaxResult.put("caseNum",caseApplicationService.insert(caseApplication));
return ajaxResult;
}
/**
* 批量新增案件
*/
@PostMapping("/batchInsert")
public AjaxResult batchInsert(@RequestBody MsCaseBatchInsertVO list )
{
return success(caseApplicationService.insert(caseApplication));
return caseApplicationService.batchInsert(list);
}
/**
@@ -90,10 +101,10 @@ public class MsCaseApplicationController extends BaseController {
public AjaxResult getInfoByIdCard(@RequestParam(value = "idCard" ,required = false) String idCard)
{
if(StrUtil.isEmpty(idCard)){
error("身份证号不能为空");
return error("身份证号不能为空");
}
if(!IdcardUtil.isValidCard(idCard)){
error("身份证不合法,请输入正确的身份证号");
return error("身份证不合法,请输入正确的身份证号");
}
AjaxResult ajax = AjaxResult.success();
Map<String, String> identityNumMap = IdCardUtils.getBirAgeSex(idCard);
@@ -140,12 +151,12 @@ public class MsCaseApplicationController extends BaseController {
* 根据id查询案件
*/
@GetMapping("/selectById")
public AjaxResult selectById(@RequestParam Long id )
public AjaxResult selectById(@RequestParam(required = false) Long id ,@RequestParam(required = false) String caseNum )
{
if(id==null){
error("id不能为空");
if(id==null && caseNum==null ){
error("参数校验失败");
}
return success(caseApplicationService.selectById(id));
return success(caseApplicationService.selectById(id,caseNum));
}
/**
* 案件压缩包导入
@@ -402,4 +413,17 @@ public class MsCaseApplicationController extends BaseController {
List<SmsSendRecord> list = caseApplicationService.getSmsSendRecord(smsSendRecord);
return getDataTable(list);
}
/**
* 保存onlyOffice在线编辑的文件
* @param
* @return
*/
@PostMapping("/saveOnlyOfficeFile")
public AjaxResult saveOnlyOfficeFile( @RequestBody MsCaseAttach caseAttach) {
if(caseAttach.getCaseAppliId()==null||StrUtil.isEmpty(caseAttach.getOnlyOfficeFileId())||StrUtil.isEmpty(caseAttach.getAnnexPath())){
return error("参数校验失败");
}
return caseApplicationService.saveOnlyOfficeFile(caseAttach);
}
}
@@ -2,6 +2,8 @@ package com.ruoyi.web.controller.wisdomarbitrate.mscase;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.EsignDemoException;
@@ -10,6 +12,8 @@ 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 com.ruoyi.wisdomarbitrate.service.mscase.MsSignSealService;
import com.ruoyi.wisdomarbitrate.utils.SignVerifyUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
@@ -57,6 +61,22 @@ public class MsSignSealController extends BaseController {
return success(sealUrlRecordselect);
}
/**
* 签名用印回调
*/
@Anonymous
@PostMapping("/signSeaalCaseApplicaCallback")
public AjaxResult signSeaalCaseApplicaCallback() throws Exception {
boolean checkResult= SignVerifyUtils.checkSignuter();
if(checkResult){
String reqbodystr =SignVerifyUtils.getRequestBody();
return msSignSealService.signSeaalCaseApplicaCallback(reqbodystr);
}else {
return AjaxResult.error("error");
}
}
/**
* 查询案件进度
*/
@@ -191,6 +191,13 @@ organizeConfig:
# 引入仲裁系统url配置
arbitrateConfig:
url: http://121.40.189.20:9001/callArbitrateCaseApplication/generateCaseApplication
# 回调通知
signSealCallbackConfig:
url: http://121.40.189.20:7001/mssignSeal/signSeaalCaseApplicaCallback
# onlyOffice系统url配置
onlyOfficeConfig:
# url: http://172.16.0.254:9090/files/upload
url: http://121.40.189.20:9090/files/upload
#jodconverter:
# local:
# host: 121.40.189.20
@@ -46,4 +46,8 @@ public class CacheConstants
* 案件 redis key
*/
public static final String CASE_KEY = "case_codes:";
/**
* 所有用户 redis key
*/
public static final String USER_KEY = "user_key:";
}
@@ -63,8 +63,12 @@ public class SysUser extends BaseEntity
/** 用户身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 身份类别,0-身份证,1-护照,默认0 */
private Integer idType;
/** 国籍,0-国内,1-国外,默认0 */
private Integer nationality;
/** 用户邮箱 */
@Excel(name = "用户邮箱")
@@ -136,6 +140,22 @@ public class SysUser extends BaseEntity
this.userId = userId;
}
public Integer getIdType() {
return idType;
}
public void setIdType(Integer idType) {
this.idType = idType;
}
public Integer getNationality() {
return nationality;
}
public void setNationality(Integer nationality) {
this.nationality = nationality;
}
public Long getUserId()
{
return userId;
@@ -361,6 +381,8 @@ public class SysUser extends BaseEntity
.append("deptIds", getDeptIds())
.append("userName", getUserName())
.append("idCard", getIdCard())
.append("idType", getIdType())
.append("nationality", getNationality())
.append("nickName", getNickName())
.append("email", getEmail())
.append("phonenumber", getPhonenumber())
@@ -26,12 +26,36 @@ public class LoginBody
* 唯一标识
*/
private String uuid;
/**
* 密文:BM+用户名用MD5加密
*/
private String ticket;
/**
* 角色名,申请人,被申请人,委托代理人
*/
private String roleName;
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public String getUsername()
{
return username;
}
public String getTicket() {
return ticket;
}
public void setTicket(String ticket) {
this.ticket = ticket;
}
public void setUsername(String username)
{
this.username = username;
@@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage","/uploadPath/**","/websocket/**").permitAll()
.antMatchers("/login","/login/sso", "/register", "/captchaImage","/uploadPath/**","/websocket/**").permitAll()
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
@@ -1,33 +1,35 @@
package com.ruoyi.framework.web.service;
import javax.annotation.Resource;
import cn.hutool.crypto.digest.MD5;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.exception.user.*;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.framework.security.context.AuthenticationContextHolder;
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.exception.user.BlackListException;
import com.ruoyi.common.exception.user.CaptchaException;
import com.ruoyi.common.exception.user.CaptchaExpireException;
import com.ruoyi.common.exception.user.UserNotExistsException;
import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.framework.security.context.AuthenticationContextHolder;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService;
import javax.annotation.Resource;
/**
* 登录校验方法
@@ -51,6 +53,8 @@ public class SysLoginService
@Autowired
private ISysConfigService configService;
@Autowired
private SysRoleMapper roleMapper;
/**
* 登录验证
@@ -63,7 +67,6 @@ public class SysLoginService
*/
public String login(String username, String password, String code, String uuid)
{
// 验证码校验
validateCaptcha(username, code, uuid);
// 登录前置校验
loginPreCheck(username, password);
@@ -99,6 +102,45 @@ public class SysLoginService
// 生成token
return tokenService.createToken(loginUser);
}
/**
* 无需验证码登录
* 重写login方法将验证码模块去掉
* @param username
* @param password
* @param uuid
* @return
*/
public String loginNoCaptcha(String username, String password, String uuid)
{
// 用户验证
Authentication authentication = null;
try
{
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
AuthenticationContextHolder.setContext(authenticationToken);
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
authentication = authenticationManager.authenticate(authenticationToken);
}
catch (Exception e)
{
if (e instanceof BadCredentialsException)
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
throw new UserPasswordNotMatchException();
}
else
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
throw new ServiceException(e.getMessage());
}
}
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
recordLoginInfo(loginUser.getUserId());
// 生成token
return tokenService.createToken(loginUser);
}
/**
* 校验验证码
@@ -178,4 +220,42 @@ public class SysLoginService
sysUser.setLoginDate(DateUtils.getNowDate());
userService.updateUserProfile(sysUser);
}
public AjaxResult loginSSO(LoginBody loginBody) {
// MD5加密并和Ticket比对
String currentTicket = MD5.create().digestHex("BM" + loginBody.getUsername());
if(!currentTicket.equals(loginBody.getTicket())){
return AjaxResult.error("ticket校验失败");
}
AjaxResult ajax = AjaxResult.success();
String username = loginBody.getUsername();
// 根据用户名获取用户信息,如果用户不存在则新增用户
SysUser user = userService.selectUserByUserName(username);
if(user==null){
// 新增用户
user = new SysUser();
user.setUserName(username);
user.setPassword(SecurityUtils.encryptPassword("abc123456"));
user.setNickName(username);
// 代理人角色相当于申请人角色
if(loginBody.getRoleName().contains("代理人")){
loginBody.setRoleName("申请人");
}
// 根据角色名查询角色id
Long roleIdByName = roleMapper.selectRoleIdByName(loginBody.getRoleName());
if(roleIdByName==null){
return AjaxResult.error("角色不存在");
}
user.setRoleIds( new Long[]{roleIdByName});
userService.insertUser(user);
}// 生成token
LoginUser loginUser = new LoginUser();
loginUser.setUser(user);
loginUser.setUserId(user.getUserId());
String token = tokenService.createToken(loginUser);
ajax.put("userName", user.getUserName());
ajax.put(Constants.TOKEN, token);
return ajax;
}
}
@@ -1,14 +1,5 @@
package com.ruoyi.framework.web.service;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.model.LoginUser;
@@ -22,6 +13,16 @@ import eu.bitwalker.useragentutils.UserAgent;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* token验证处理
@@ -119,6 +120,8 @@ public class TokenService
refreshToken(loginUser);
Map<String, Object> claims = new HashMap<>();
claims.put("userName",loginUser.getUsername());
claims.put("userId",loginUser.getUserId());
claims.put(Constants.LOGIN_USER_KEY, token);
return createToken(claims);
}
@@ -207,14 +210,24 @@ public class TokenService
Claims claims = parseToken(token);
return claims.getSubject();
}
/**
* 从令牌中获取用户名
*
* @param token 令牌
* @return 用户名
*/
public String getUserNameFromToken(String token)
{
Claims claims = parseToken(token);
return claims.get("userName").toString();
}
/**
* 获取请求token
*
* @param request
* @return token
*/
private String getToken(HttpServletRequest request)
public String getToken(HttpServletRequest request)
{
String token = request.getHeader(header);
if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX))
@@ -0,0 +1,28 @@
package com.ruoyi.system.domain.vo.flow;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
public class MsBaseCaseFlow {
/**
* 主键id
*/
private Integer id;
/**
* 顺序
*/
private Integer sort;
/**
* 案件状态名称
*/
private String caseStatusName;
}
@@ -1,6 +1,7 @@
package com.ruoyi.system.mapper.flow;
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
import com.ruoyi.system.domain.vo.flow.MsBaseCaseFlow;
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;
@@ -25,4 +26,7 @@ public interface MsCaseFlowMapper extends Mapper<MsCaseFlow> {
@Select("SELECT r.role_name as roleName ,f.node_name as nodeName ,f.case_status_name as caseStatusName FROM ms_case_flow f left join ms_case_flow_role_related fr on f.id = fr.flow_id left join ms_sys_role r on fr.roleid = r.role_id WHERE f.id = #{caseFlowId} ")
List<MsCaseFlowVO> selectFlowRole(Integer caseFlowId);
@Select("select f1.id,f1.case_status_name caseStatusName,f1.sort from ms_case_flow f1 order by f1.sort")
List<MsBaseCaseFlow> selectCaseFlow();
}
@@ -1,5 +1,6 @@
package com.ruoyi.system.service.flow;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
@@ -12,6 +13,11 @@ public interface CaseFlowService {
* @return
*/
Object queryCaseFlowInfo(MsCaseFlowSearchVO caseFlowSearchVO);
/**
* 查询案件流程信息
* @return
*/
AjaxResult selectCaseFlow();
/**
* 新增或编辑案件流程节点信息
@@ -40,4 +46,6 @@ public interface CaseFlowService {
* @return
*/
Set<Integer> getCaseStatusIdByRoleKey(Set<String> roles);
}
@@ -2,10 +2,12 @@ package com.ruoyi.system.service.flow;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleRelated;
import com.ruoyi.system.domain.vo.flow.MsBaseCaseFlow;
import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
import com.ruoyi.system.mapper.SysRoleMapper;
@@ -95,6 +97,12 @@ public class CaseFlowServiceImpl implements CaseFlowService {
}
}
@Override
public AjaxResult selectCaseFlow() {
List<MsBaseCaseFlow> caseFlows = msCaseFlowMapper.selectCaseFlow();
return AjaxResult.success(caseFlows);
}
/**
* 查询流程信息相关的角色信息
*
@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.entity.SysUserDept;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanValidators;
@@ -241,6 +242,8 @@ public class SysUserServiceImpl implements ISysUserService {
@Transactional
public AjaxResult insertUser(SysUser user) {
// 新增用户信息
user.setCreateBy("admin");
user.setCreateTime(DateUtils.getNowDate());
int rows = userMapper.insertUser(user);
// 新增用户部门关联
if(CollectionUtil.isNotEmpty(user.getDeptIds())) {
@@ -1,7 +1,6 @@
package com.ruoyi.wisdomarbitrate.domain.dto.miniprogress;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
@@ -20,6 +19,14 @@ public class IdentityAuthentication extends BaseEntity {
private String name;
/** 身份证号 */
private String identityNo;
/**
* 身份类别,0-身份证,1-护照,默认0
*/
private Integer idType;
/**
* 国籍,0-国内,1-国外,默认0
*/
private Integer nationality;
/**
* 短信验证码
*/
@@ -104,6 +111,22 @@ public class IdentityAuthentication extends BaseEntity {
return userId;
}
public Integer getIdType() {
return idType;
}
public void setIdType(Integer idType) {
this.idType = idType;
}
public Integer getNationality() {
return nationality;
}
public void setNationality(Integer nationality) {
this.nationality = nationality;
}
public void setUserId(Long userId) {
this.userId = userId;
}
@@ -144,6 +144,27 @@ public class MsSealSignRecord {
@Column(name = "position_ypsn_medi")
private double positionYpsnMedi;
/**
* 申请人签名状态
*/
@Column(name = "sign_status_apply")
private Integer signStatusApply;
/**
* 被申请人签名状态
*/
@Column(name = "sign_status_response")
private Integer signStatusResponse;
/**
* 调解员签名状态
*/
@Column(name = "sign_status_mediator")
private Integer signStatusMediator;
/**
* 用印状态
*/
@Column(name = "seal_status")
private Integer sealStatus;
}
@@ -154,4 +154,14 @@ public class MsCaseAffiliate {
*/
@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;
}
@@ -73,8 +73,8 @@ public class MsCaseAttach {
private Long sealStatus;
/**
* 是否是证据上传,0-否,1-是
* onlyOffice附件id
*/
@Column(name = "is_batch_upload")
private Long isBatchUpload;
@Column(name = "only_office_file_id")
private String onlyOfficeFileId;
}
@@ -1,5 +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;
@@ -7,6 +8,7 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
@@ -77,6 +79,10 @@ public class MsCaseApplicationVO extends MsCaseApplication {
* 签名按钮显示,0-显示,1-不显示
*/
private Integer signButtonFlag;
/**
* 结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
private Date endTime;
}
@@ -0,0 +1,19 @@
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Classname MsCaseBatchInsertVO
* @Description 批量新增案件
* @Version 1.0.0
* @Date 2024/3/11 10:04
* @Created wangqiong
*/
@Data
public class MsCaseBatchInsertVO implements Serializable {
private static final long serialVersionUID = 1L;
private List<MsCaseApplicationVO> list;
}
@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;
import java.util.Date;
import java.util.List;
public interface MsCaseLogRecordMapper extends Mapper<MsCaseLogRecord> {
@@ -33,4 +34,13 @@ public interface MsCaseLogRecordMapper extends Mapper<MsCaseLogRecord> {
@Select("SELECT group_concat( DISTINCT t.createNickName) createNickName,t.nodeName content,t.nodeId,t.sort ,t.caseStatusName FROM (SELECT l.create_nick_name createNickName ,f.node_name nodeName,f.node_id nodeId, f.sort, f.case_status_name caseStatusName FROM ms_case_log_record l left join ms_case_flow f on l.case_node = f.node_id WHERE l.case_appli_id = #{caseAppliId} and f.node_name is not null ) t group by t.nodeName,t.nodeId,t.sort ,t.caseStatusName order by t.sort ")
List<MsCaseLogRecordVO> selectCaseLogRecordListCaseProgress(Long caseAppliId);
/**
* 根据案件id查询结束时间
* @param caseAppliId
* @param caseStatusName
* @return
*/
@Select("SELECT create_time endTime FROM ms_case_log_record where case_appli_id=#{caseAppliId} and case_status_name=#{caseStatusName} order by create_time desc limit 1")
Date selectEndTimeByCaseId(@Param("caseAppliId") Long caseAppliId, @Param("caseStatusName") String caseStatusName);
}
@@ -161,6 +161,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
sysUser.setPhonenumber(ientityAuthentication.getPhone());
sysUser.setEmail(ientityAuthentication.getEmail());
sysUser.setCreateBy(ientityAuthentication.getUserName());
sysUser.setIdType(ientityAuthentication.getIdType());
sysUser.setNationality(ientityAuthentication.getNationality());
sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
int row = sysUserMapper.insertUser(sysUser);
if(row<1) {
@@ -1,5 +1,6 @@
package com.ruoyi.wisdomarbitrate.service.mscase;
import com.alibaba.fastjson.JSONArray;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.entity.SysUser;
@@ -40,14 +41,27 @@ public interface MsCaseApplicationService {
* @param id
* @return
*/
MsCaseApplicationVO selectById(Long id);
MsCaseApplicationVO selectById(Long id ,String caseNum );
/**
* 新增案件
* @param caseApplication
* @return
*/
int insert(MsCaseApplicationVO caseApplication);
String insert(MsCaseApplicationVO caseApplication);
/**
* 新增案件
* @param caseApplication
* @param caseFlow
*/
String insert(MsCaseApplicationVO caseApplication, MsCaseFlow caseFlow);
/**
* 批量新增案件
* @param vo
* @return
*/
AjaxResult batchInsert(MsCaseBatchInsertVO vo);
/**
* 新增用户
* @param affiliate
@@ -206,6 +220,11 @@ public interface MsCaseApplicationService {
* @param dictDataList 内置字段
*/
void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList, Integer templateType) ;
/**
* 调解书上传到onlyoffice服务器
* @param annexPath
*/
JSONArray uploadOnlyOffice(String annexPath,Long id);
/**
* 案件受理
* @param application
@@ -242,5 +261,11 @@ public interface MsCaseApplicationService {
* @return
*/
List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord);
/**
* 保存onlyOffice在线编辑的文件
* @param
* @return
*/
AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach);
}
@@ -7,6 +7,7 @@ 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;
import java.util.List;
public interface MsSignSealService {
@@ -34,4 +35,6 @@ public interface MsSignSealService {
AjaxResult msCaseSignUrlApplyAPP(MsSignSealDTO dto) throws EsignDemoException;
AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException;
AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException;
}
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -47,7 +48,6 @@ import com.ruoyi.wisdomarbitrate.mapper.template.FatchRuleMapper;
import com.ruoyi.wisdomarbitrate.mapper.template.TemplateManageMapper;
import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
import com.ruoyi.wisdomarbitrate.utils.*;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springframework.beans.BeanUtils;
@@ -92,6 +92,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
@Value("${arbitrateConfig.url}")
private String arbitrateUrl;
@Value("${onlyOfficeConfig.url}")
private String onlyOfficeUrl;
@Autowired
MsCaseApplicationService caseApplicationService;
@Autowired
@@ -158,22 +160,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
*/
@Override
public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
// admin查询所有案件
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
startPage();
List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null);
for (MsCaseApplicationVO vo : list) {
vo.setSignButtonFlag(0);
}
return list;
}
// 根据用户查询角色
LoginUser loginUser = SecurityUtils.getLoginUser();
// 根据id查询用户
SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId());
List<SysRole> roles = loginUser.getUser().getRoles();
if (CollectionUtil.isEmpty(roles)) {
throw new ServiceException("该用户未指定角色");
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")||CollectionUtil.isEmpty(roles)) {
// 如果角色为空,按admin处理,查所有案件
startPage();
List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null);
for (MsCaseApplicationVO vo : list) {
vo.setSignButtonFlag(0);
}
return list;
}
req.setUserName(SecurityUtils.getUsername());
req.setContactTelphoneAgent(sysUser.getPhonenumber());
@@ -353,10 +353,29 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
return vo;
}
/**
* 根据案件id或者案件编号查询详情
* @param id
* @param caseNum
* @param
* @return
*/
@Override
public MsCaseApplicationVO selectById(Long id) {
public MsCaseApplicationVO selectById(Long id,String caseNum ) {
// 根据案件id或者案件编号查询详情
MsCaseApplicationVO vo = new MsCaseApplicationVO();
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
MsCaseApplication caseApplication = null;
if(id!=null) {
caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
}else {
// 根据案件编号查
Example example = new Example(MsCaseApplication.class);
example.createCriteria().andEqualTo("caseNum", caseNum);
caseApplication = msCaseApplicationMapper.selectOneByExample(example);
}
if(caseApplication==null){
return vo;
}
BeanUtil.copyProperties(caseApplication, vo);
// 查询案件相关人员
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
@@ -369,6 +388,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
vo.setColumnValueList(columnValueVOS);
// 查询拒绝原因
vo.setReason(auditMapper.selectByCaseId(id,caseApplication.getCaseFlowId()));
// todo 在日志表查詢结束时间返回
vo.setEndTime(caseLogRecordMapper.selectEndTimeByCaseId(caseApplication.getId(),"结束"));
return vo;
}
@@ -380,21 +401,36 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
*/
@Transactional
@Override
public int insert(MsCaseApplicationVO caseApplication) {
public String insert(MsCaseApplicationVO caseApplication) {
// todo 第三方调用该接口,未绑定角色,暂时不根据角色查询流程,根据角色获取案件流程
/** List<MsCaseFlow> caseFlows= selectCaseFlows();
if (CollectionUtil.isEmpty(caseFlows)) {
throw new ServiceException("该角色未绑定案件流程");
}
*/
// 设置模板id,根据机构代码查询模板
Long templateId = getTemplate();
caseApplication.setTemplateId(templateId);
// 获取第一个流程节点
MsCaseFlow caseFlow = getCaseFlow();
return insert(caseApplication,caseFlow);
}
/**
* 新增案件
* @param caseApplication
* @param caseFlow
* @return
*/
@Transactional
@Override
public String insert(MsCaseApplicationVO caseApplication, MsCaseFlow caseFlow) {
if (caseApplication.getId() == null) {
caseApplication.setId(IdWorkerUtil.getId());
}
// 根据角色获取案件流程
List<MsCaseFlow> caseFlows= selectCaseFlows();
if (CollectionUtil.isEmpty(caseFlows)) {
throw new ServiceException("该角色为绑定案件流程");
}
// 设置模板id,根据机构代码查询模板
Long templateId = templateManageMapper.selectByCreditCode(creditCode);
caseApplication.setTemplateId(templateId);
MsCaseFlow caseFlow = caseFlows.get(0);
caseApplication.setCaseStatusName(caseFlow.getCaseStatusName());
caseApplication.setCaseFlowId(caseFlow.getId());
caseApplication.setCreateTime(new Date());
@@ -416,51 +452,51 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) {
List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
// 保存案件相关人员
// 设置申请机构
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
// 组装申请机构
// insertDept(affiliate);
// 新增申请机构和代理人
caseApplicationService.insertAgentUser(affiliate);
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
// 查询申请人角色id
Long roleId = roleMapper.selectRoleIdByName("申请人");
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
caseApplicationService.insertApplicantUser(affiliate,true,roleId);
// 设置申请机构
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
// 组装申请机构
// insertDept(affiliate);
// 新增申请机构和代理人
caseApplicationService.insertAgentUser(affiliate);
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
// 查询申请人角色id
Long roleId = roleMapper.selectRoleIdByName("申请人");
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
caseApplicationService.insertApplicantUser(affiliate,true,roleId);
}
// 压缩包导入,则根据身份证号获取性别和出生日期
if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) {
setBirthByIdentityNum(affiliate);
}
if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
}
if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
}
msCaseAffiliateMapper.insert(affiliate);
// 批量生成调解申请书
MsCaseApplicationReq req = new MsCaseApplicationReq();
req.setCaseFlowId(caseFlow.getId());
if(!caseApplication.isImportFlag()) {
req.setId(caseApplication.getId());
}else {
// 压缩包导入
req.setBatchNumber(caseApplication.getBatchNumber());
}
// 生成调解申请书
if(affiliate.getOrganizeFlag()==0){
// 自然人
req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
}else {
// 机构
req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
}
req.setTemplateId(String.valueOf(templateId));
caseApplicationService.generateApplication(req);
}
// 压缩包导入,则根据身份证号获取性别和出生日期
if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) {
setBirthByIdentityNum(affiliate);
}
if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
}
if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
}
msCaseAffiliateMapper.insert(affiliate);
// 批量生成调解申请书
MsCaseApplicationReq req = new MsCaseApplicationReq();
req.setCaseFlowId(caseFlow.getId());
if(!caseApplication.isImportFlag()) {
req.setId(caseApplication.getId());
}else {
// 压缩包导入
req.setBatchNumber(caseApplication.getBatchNumber());
}
// 生成调解申请书
if(affiliate.getOrganizeFlag()==0){
// 自然人
req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
}else {
// 机构
req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
}
req.setTemplateId(String.valueOf(caseApplication.getTemplateId()));
// todo 部署放开
caseApplicationService.generateApplication(req);
// 保存案件附件
if (CollectionUtil.isNotEmpty(caseAttachList)) {
for (MsCaseAttach caseAttach : caseAttachList) {
@@ -482,10 +518,61 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
columnValueMapper.batchSave(columnValueList);
}
CaseLogUtils.insertCaseLog(caseApplication.getId(), 0, "新增案件", "");
return 1;
return caseApplication.getCaseNum();
}
return 0;
return "";
}
/**
* 获取第一个流程节点
* @return
*/
private MsCaseFlow getCaseFlow() {
// 查询所有流程节点
Example flowExample = new Example(MsCaseFlow.class);
flowExample.setOrderByClause("sort asc");
List<MsCaseFlow> caseFlows = caseFlowMapper.selectByExample(flowExample);
if (CollectionUtil.isEmpty(caseFlows)) {
throw new ServiceException("请先配置流程");
}
return caseFlows.get(0);
}
/**
* 获取模板id
* @return
*/
private Long getTemplate() {
return templateManageMapper.selectByCreditCode(creditCode);
}
/**
* 批量新增
* @param vo
* @return
*/
@Transactional
@Override
public AjaxResult batchInsert(MsCaseBatchInsertVO vo) {
if(CollectionUtil.isEmpty(vo.getList())){
return AjaxResult.error("案件不能为空");
}
// 设置模板id,根据机构代码查询模板
Long templateId = getTemplate();
// 获取第一个流程节点
MsCaseFlow caseFlow = getCaseFlow();
List<String> caseNumList = new ArrayList<>();
for (MsCaseApplicationVO caseApplicationVO : vo.getList()) {
caseApplicationVO.setTemplateId(templateId);
String caseNum = caseApplicationService.insert(caseApplicationVO, caseFlow);
caseNumList.add(caseNum);
}
AjaxResult success = AjaxResult.success();
success.put("caseNumList",caseNumList);
return success;
}
/**
@@ -518,6 +605,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
sysUser.setNickName(name);
sysUser.setPhonenumber(phone);
sysUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
sysUser.setIdType(affiliate.getIdType());
sysUser.setNationality(affiliate.getNationality());
sysUser.setCreateBy(SecurityUtils.getUsername());
userMapper.insertUser(sysUser);
userRoleMapper.insertUserRole(sysUser.getUserId(), roleId);
@@ -565,7 +654,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
example.createCriteria().andIn("roleid", roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()));
List<MsCaseFlowRoleRelated> caseFlowRoleRelatedList = caseFlowRoleRelatedMapper.selectByExample(example);
if (CollectionUtil.isEmpty(caseFlowRoleRelatedList)) {
throw new ServiceException("该角色为绑定案件流程");
throw new ServiceException("该角色未绑定案件流程");
}
Example flowExample = new Example(MsCaseFlow.class);
flowExample.setOrderByClause("sort asc");
@@ -1461,7 +1550,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
.annexType(annexType)
.useId(SecurityUtils.getUserId())
.useAccount(SecurityUtils.getUsername())
.isBatchUpload(1L)
.build();
int count = msCaseAttachMapper.save(caseAttach);
if (count > 0 ) {
@@ -1672,7 +1760,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (CollectionUtil.isEmpty(users)) {
return AjaxResult.error("暂无调解员");
}
// todo 根据角色查询是否已经选择了调解员进行回显
// 根据角色查询是否已经选择了调解员进行回显
List<Long> userIds = users.stream().map(SysUser::getUserId).collect(Collectors.toList());
// 状态为未结束的是待办数量,结束的是已办数量
Map<Long, List<MsCaseApplication>> caseMap=null;
@@ -1777,7 +1865,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 申请人预约
if (vo.getMiniProgressFlag() == null || vo.getMiniProgressFlag().equals( YesOrNoEnum.NO.getCode())) {
// 新增日志
CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "申请人选择调解员");
CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
if (StrUtil.isEmpty(msCaseAffiliate.getRespondentIdentityNum())) {
return AjaxResult.error("被申请人身份证为空");
@@ -1788,7 +1876,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
} else {
// 被申请人预约
// 新增日志
CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "被申请人选择调解员");
CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
// 判断申请人是否预约
caseApplicationService. isReservation( vo,userIds);
@@ -2067,6 +2155,26 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
public List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord) {
return smsRecordMapper.getSmsSendRecord(smsSendRecord);
}
/**
* 保存onlyOffice在线编辑的文件
* @param
* @return
*/
@Transactional
@Override
public AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach) {
if(StrUtil.isEmpty(caseAttach.getAnnexName())) {
caseAttach.setAnnexName("调解书");
}
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
caseAttach.setUseId(getUserInfo().getUserId());
caseAttach.setUseAccount(getUserInfo().getUserName());
// 先删除之前的在新增
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), caseAttach.getAnnexType());
msCaseAttachMapper.save(caseAttach);
return AjaxResult.success();
}
/**
* 查询预约信息
@@ -2117,6 +2225,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (currentFlow == null) {
throw new ServiceException("未找到当前流程节点");
}
Integer mediaResult = req.getMediaResult();
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
if (application.getMediationMethod().equals("1")) {
// 线上调解
@@ -2129,18 +2238,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
msCaseAttachMapper.updateCaseAttach(attach);
}
}
Integer mediaResult = req.getMediaResult();
if(mediaResult!=null){
if(mediaResult.intValue()==1){
if(mediaResult ==1){
//达成调解
List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
if (caseAttachList != null && caseAttachList.size() > 0) {
for (MsCaseAttach caseAttach : caseAttachList) {
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
String prefix = "/profile";
int startIndex = prefix.length();
// String prefix = "/profile";
// int startIndex = prefix.length();
String annexPath = caseAttach.getAnnexPath();
String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
// String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
String path = annexPath;
//获取文件上传地址
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
String body = response.getBody();
@@ -2485,11 +2593,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
application.setCaseFlowId(caseFlow.getId());
application.setCaseStatusName(caseFlow.getCaseStatusName());
application.setMediaResult(mediaResult);
msCaseApplicationMapper.updateByPrimaryKey(application);
}
application.setMediaResult(mediaResult);
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
return AjaxResult.success();
}else if(mediaResult.intValue()==3){
//未达成调解但不再争议
@@ -2500,14 +2606,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if(caseFlow != null){
application.setCaseFlowId(caseFlow.getId());
application.setCaseStatusName(caseFlow.getCaseStatusName());
application.setMediaResult(mediaResult);
msCaseApplicationMapper.updateByPrimaryKey(application);
// 新增日志
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
}
application.setMediaResult(mediaResult);
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
return AjaxResult.success();
}else if(mediaResult.intValue()==4){
//未达成调解但同意引入仲裁
@@ -2532,6 +2636,19 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
.header("signstr", signStr)
.body(paramsbody)
.execute();
// 修改案件状态为结束
Example flowExample = new Example(MsCaseFlow.class);
flowExample.createCriteria().andEqualTo("caseStatusName", "结束");
MsCaseFlow caseFlow = caseFlowMapper.selectOneByExample(flowExample);
if(caseFlow != null){
// 新增日志
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
application.setCaseFlowId(caseFlow.getId());
application.setCaseStatusName(caseFlow.getCaseStatusName());
application.setMediaResult(mediaResult);
msCaseApplicationMapper.updateByPrimaryKey(application);
}
return AjaxResult.success();
}else if(mediaResult.intValue()==5){
// 达成和解
@@ -2539,10 +2656,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (caseAttachList != null && caseAttachList.size() > 0) {
for (MsCaseAttach caseAttach : caseAttachList) {
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
String prefix = "/profile";
int startIndex = prefix.length();
// String prefix = "/profile";
// int startIndex = prefix.length();
String annexPath = caseAttach.getAnnexPath();
String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
// String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
String path = annexPath;
//获取文件上传地址
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
String body = response.getBody();
@@ -2779,7 +2897,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
}
}
} else {
// 线下调解
List<MsCaseAttach> attachList = req.getAttachList();
@@ -2792,14 +2910,45 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
attach.setCaseAppliId(req.getId());
msCaseAttachMapper.updateCaseAttach(attach);
}
// msCaseAttachMapper.batchSave(attachList);
// 修改案件状态为待送达
Example flowExample = new Example(MsCaseFlow.class);
flowExample.createCriteria().andEqualTo("caseStatusName", "待送达");
if(mediaResult ==1 || mediaResult == 5){
// 达成调解,达成和解,案件状态改为待送达
flowExample.createCriteria().andEqualTo("caseStatusName", "待送达");
} else if(mediaResult == 2 || mediaResult == 3){
// 未达成调解,未达成调解但不在争议改为结束状态
flowExample.createCriteria().andEqualTo("caseStatusName", "结束");
}
else if(mediaResult == 4){
// 未达成调解但同意引入仲裁系统,改为结束状态,并调仲裁新增接口
flowExample.createCriteria().andEqualTo("caseStatusName", "结束");
String accessSec = "mCFMA6ffe938v79m";
MsCaseApplicationVO applicationVO = new MsCaseApplicationVO();
BeanUtils.copyProperties(application,applicationVO);
CaseApplicationVO caseApplicationVO = new CaseApplicationVO();
BeanUtils.copyProperties(applicationVO,caseApplicationVO);
boolean importFlag = applicationVO.isImportFlag();
if(importFlag==true){
caseApplicationVO.setImportFlag(1);
}else {
caseApplicationVO.setImportFlag(0);
}
String paramsbody = JSONUtil.toJsonStr(caseApplicationVO);
long timestamp = System.currentTimeMillis();
String signStr = SignCheckUtils.getSign(paramsbody, accessSec, timestamp);
String urlstr = arbitrateUrl;
HttpResponse httpResponse = HttpRequest.post(urlstr)
.header("timestampstr", String.valueOf(timestamp))
.header("signstr", signStr)
.body(paramsbody)
.execute();
}
MsCaseFlow caseFlow = caseFlowMapper.selectOneByExample(flowExample);
if(caseFlow != null){
application.setCaseFlowId(caseFlow.getId());
application.setCaseStatusName(caseFlow.getCaseStatusName());
application.setMediaResult(mediaResult);
msCaseApplicationMapper.updateByPrimaryKey(application);
// 新增日志
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
@@ -2808,7 +2957,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
return AjaxResult.error();
return AjaxResult.success();
}
/**
@@ -3633,15 +3782,68 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 将word中的标签替换掉,生成新的word
wordChangeText(templatePath, bookmarkValueMap,saveFolderPath,resultFilePath);
MsCaseAttach caseAttach = MsCaseAttach.builder()
.caseAppliId(application.getId())
.annexName(orgFileName+".docx")
.annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX))
.annexType(annexType)
.build();
MsCaseAttach caseAttach = null;
String annexPath=resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX);
// 如果是调解书或者调解协议上传到onlyoffice服务器
if(annexType != null && annexType.equals(AnnexTypeEnum.MEDIATE_BOOK.getCode())){
JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath,application.getId());
if(jsonArray!=null && jsonArray.size() > 0){
for (Object obj : jsonArray) {
JSONObject jsonObject = (JSONObject) obj;
caseAttach= MsCaseAttach.builder()
.caseAppliId(application.getId())
.annexName(jsonObject.getString("fileName"))
.annexPath(jsonObject.getString("filePath"))
.annexType(annexType)
.onlyOfficeFileId(jsonObject.getString("fileId"))
.build();
}
}
}else {
caseAttach = MsCaseAttach.builder()
.caseAppliId(application.getId())
.annexName(orgFileName+".docx")
.annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX))
.annexType(annexType)
.build();
}
//保存到附件表里,先删除之前的在保存
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
msCaseAttachMapper.save(caseAttach);
if(caseAttach != null) {
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
msCaseAttachMapper.save(caseAttach);
}
}
/**
* 调解书上传到onlyoffice服务器
* @param annexPath
*/
@Override
@Transactional
public JSONArray uploadOnlyOffice(String annexPath,Long caseId) {
annexPath=annexPath.replace("/profile","/home/ruoyi/uploadPath");
File file = new File(annexPath);
if (file.exists()) {
// 调用onlyoffice
try {
Map<String, Object> params = new HashMap<>();
params.put("file", file);
String postResult = HttpUtil.post(onlyOfficeUrl+ "/"+String.valueOf(caseId), params);
if(StrUtil.isNotEmpty(postResult)){
// 转为jsonArray
JSONArray jsonArray = JSONArray.parseArray(postResult);
return jsonArray;
}
} catch (Exception e) {
throw new ServiceException("上传OnlyOffice服务器失败");
}
}else {
throw new ServiceException("文件不存在");
}
return null;
}
/**
@@ -3878,6 +4080,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
agentUser.setNickName(affiliate.getNameAgent());
agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
agentUser.setNationality(affiliate.getNationality());
agentUser.setIdType(affiliate.getIdType());
// agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
userMapper.insertUser(agentUser);
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
@@ -350,7 +350,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
}
// 新增日志
if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "确认已缴费");
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
}else {
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "拒绝确认缴费,拒绝原因为:"+dto.getReason());
}
@@ -509,7 +509,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"确认缴费");
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
}
@@ -60,6 +60,7 @@ import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
@@ -83,6 +84,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
MsCaseFlowMapper caseFlowMapper;
@Autowired
private SysUserMapper userMapper;
@Autowired
private MsCaseAttachMapper caseAttachMapper;
@Autowired
private SysUserMapper sysUserMapper;
@@ -408,7 +411,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"用印申请");
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
}
} else {
// 单独
@@ -418,7 +421,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"用印申请");
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
}
return AjaxResult.success("用印申请成功");
@@ -566,7 +569,13 @@ public class MsSignSealServiceImpl implements MsSignSealService {
caseNodeTime= DateUtil.format(record.getCreateTime(), DatePattern.NORM_DATETIME_FORMATTER);
}
Integer caseNode = record.getCaseNode();
contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime);
String createBy = record.getCreateBy();
if(StrUtil.isNotEmpty(createBy)){
contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime);
}else{
contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("于").append(caseNodeTime);
}
if(StrUtil.isNotEmpty(record.getContent())){
contentBuilder.append(record.getContent());
}else if(caseNode.intValue() == 0){
@@ -777,7 +786,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
caseApplicationselect.setCaseFlowId(nextFlow.getId());
caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"签收");
CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
}
// if (dto.getIsSignRespon() != null && dto.getIsSignRespon().intValue() == 1) {
// caseAffiliate.setIsSignRespon(1);
@@ -801,7 +810,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
caseApplicationselect.setCaseFlowId(nextFlow.getId());
caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"签收");
CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
}
return AjaxResult.success("签收成功");
@@ -1008,6 +1017,333 @@ public class MsSignSealServiceImpl implements MsSignSealService {
return AjaxResult.success(sealSignRecordres);
}
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException {
JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr);
Gson gson = new Gson();
if (jsonObjectCallback != null) {
int signResult = jsonObjectCallback.getIntValue("signResult");
String action = jsonObjectCallback.getString("action");
String signFlowId = jsonObjectCallback.getString("signFlowId");
Long operateTime = jsonObjectCallback.getLongValue("operateTime");
JSONObject operator = jsonObjectCallback.getJSONObject("operator");
JSONObject psnAccount = operator.getJSONObject("psnAccount");
String accountMobile = psnAccount.getString("accountMobile");
Example msSealSignRecordExample = new Example(MsSealSignRecord.class);
msSealSignRecordExample.createCriteria().andEqualTo("signFlowId", signFlowId);
MsSealSignRecord sealSignRecordsel = sealSignRecordMapper.selectOneByExample(msSealSignRecordExample);
String pensonAccountApply = sealSignRecordsel.getPensonAccount();
String orgnNamePsnAcc = sealSignRecordsel.getOrgnNamePsnAcc();
String pensonAccountRes = sealSignRecordsel.getPensonAccountRes();
String pensonAccountMedi = sealSignRecordsel.getPensonAccountMedi();
String pensonName = sealSignRecordsel.getPensonName();
String orgnNamePsnName = sealSignRecordsel.getOrgnNamePsnName();
String pensonNameRes = sealSignRecordsel.getPensonNameRes();
String pensonNameMedi = sealSignRecordsel.getPensonNameMedi();
Date dateOperate = new Date(operateTime);
Integer signStatusApply = sealSignRecordsel.getSignStatusApply();
Integer signStatusResponse = sealSignRecordsel.getSignStatusResponse();
Integer signStatusMediator = sealSignRecordsel.getSignStatusMediator();
Integer sealStatus = sealSignRecordsel.getSealStatus();
Long caseAppliId = sealSignRecordsel.getCaseAppliId();
MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(caseAppliId);
Integer mediaResult = caseApplicationselect.getMediaResult();
MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseApplicationselect.getCaseFlowId());
Integer caseNode = currentFlow.getNodeId();
String caseStatusName = currentFlow.getCaseStatusName();
if("SIGN_MISSON_COMPLETE".equals(action) && signResult==2){
if(mediaResult.intValue()==1){
//调解
if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountApply)){
//申请人签名
sealSignRecordsel.setSignStatusApply(1);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
MsCaseLogRecord operLog = new MsCaseLogRecord();
operLog.setCreateNickName(pensonName);
operLog.setCaseStatusName(caseStatusName);
operLog.setCaseAppliId(caseAppliId);
operLog.setCaseNode(caseNode);
operLog.setCreateTime(dateOperate);
caseLogRecordMapper.insert(operLog);
if(signStatusResponse!=null&&signStatusResponse.intValue()==1&&
signStatusMediator!=null&&signStatusMediator.intValue()==1){
// 根据流程id查找下一个流程节点
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
MsCaseApplication application = new MsCaseApplication();
application.setId(caseApplicationselect.getId());
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
//修改"签署用印记录表"的状态为待用印
sealSignRecordsel.setSignFlowStatus(2);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
}
}else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){
//被申请人签名
sealSignRecordsel.setSignStatusResponse(1);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
MsCaseLogRecord operLog = new MsCaseLogRecord();
operLog.setCreateNickName(pensonNameRes);
operLog.setCaseStatusName(caseStatusName);
operLog.setCaseAppliId(caseAppliId);
operLog.setCaseNode(caseNode);
operLog.setCreateTime(dateOperate);
caseLogRecordMapper.insert(operLog);
if(signStatusApply!=null&&signStatusApply.intValue()==1&&
signStatusMediator!=null&&signStatusMediator.intValue()==1){
// 根据流程id查找下一个流程节点
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
MsCaseApplication application = new MsCaseApplication();
application.setId(caseApplicationselect.getId());
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
//修改"签署用印记录表"的状态为待用印
sealSignRecordsel.setSignFlowStatus(2);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
}
}else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountMedi)){
//调解员签名
sealSignRecordsel.setSignStatusMediator(1);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
MsCaseLogRecord operLog = new MsCaseLogRecord();
operLog.setCreateNickName(pensonNameMedi);
operLog.setCaseStatusName(caseStatusName);
operLog.setCaseAppliId(caseAppliId);
operLog.setCaseNode(caseNode);
operLog.setCreateTime(dateOperate);
caseLogRecordMapper.insert(operLog);
if(signStatusApply!=null&&signStatusApply.intValue()==1&&
signStatusResponse!=null&&signStatusResponse.intValue()==1){
// 根据流程id查找下一个流程节点
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
MsCaseApplication application = new MsCaseApplication();
application.setId(caseApplicationselect.getId());
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
//修改"签署用印记录表"的状态为待用印
sealSignRecordsel.setSignFlowStatus(2);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
}
}else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(orgnNamePsnAcc)){
sealSignRecordsel.setSealStatus(1);
sealSignRecordsel.setSignFlowStatus(3);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
MsCaseLogRecord operLog = new MsCaseLogRecord();
operLog.setCreateNickName(orgnNamePsnName);
operLog.setCaseStatusName(caseStatusName);
operLog.setCaseAppliId(caseAppliId);
operLog.setCaseNode(caseNode);
operLog.setCreateTime(dateOperate);
caseLogRecordMapper.insert(operLog);
// 根据流程id查找下一个流程节点
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
MsCaseApplication application = new MsCaseApplication();
application.setId(caseApplicationselect.getId());
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
//下载审核完成的调解书
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
if (filesArray != null && filesArray.size() > 0) {
JsonObject fileObject = (JsonObject) filesArray.get(0);
String fileDownloadUrl = fileObject.get("downloadUrl").toString();
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
// String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// String savePath = "/home/ruoyi/uploadPath/upload/";
String saveName = fileName;
String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// 创建日期目录
File saveFolder = new File(saveFolderPath);
if (!saveFolder.exists()) {
saveFolder.mkdirs();
}
String resultFilePath = saveFolderPath + "/" + fileName;
File resultFilePathFile = new File(resultFilePath);
if (!resultFilePathFile.exists()) {
resultFilePathFile.createNewFile();
}
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
if (downLoadFile) {
MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexType(7);
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
}
}
}
}else if(mediaResult.intValue()==5){
//和解
if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountApply)){
//申请人签名
sealSignRecordsel.setSignStatusApply(1);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
MsCaseLogRecord operLog = new MsCaseLogRecord();
operLog.setCreateNickName(pensonName);
operLog.setCaseStatusName(caseStatusName);
operLog.setCaseAppliId(caseAppliId);
operLog.setCaseNode(caseNode);
operLog.setCreateTime(dateOperate);
caseLogRecordMapper.insert(operLog);
if(signStatusResponse!=null&&signStatusResponse.intValue()==1){
MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
MsCaseApplication application = new MsCaseApplication();
application.setId(caseApplicationselect.getId());
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
//修改"签署用印记录表"的状态为完成
sealSignRecordsel.setSignFlowStatus(3);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
//下载审核完成的调解书
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
if (filesArray != null && filesArray.size() > 0) {
JsonObject fileObject = (JsonObject) filesArray.get(0);
String fileDownloadUrl = fileObject.get("downloadUrl").toString();
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
// String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// String savePath = "/home/ruoyi/uploadPath/upload/";
String saveName = fileName;
String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// 创建日期目录
File saveFolder = new File(saveFolderPath);
if (!saveFolder.exists()) {
saveFolder.mkdirs();
}
String resultFilePath = saveFolderPath + "/" + fileName;
File resultFilePathFile = new File(resultFilePath);
if (!resultFilePathFile.exists()) {
resultFilePathFile.createNewFile();
}
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
if (downLoadFile) {
MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexType(7);
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
}
}
}
}else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){
//被申请人签名
sealSignRecordsel.setSignStatusResponse(1);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
MsCaseLogRecord operLog = new MsCaseLogRecord();
operLog.setCreateNickName(pensonNameRes);
operLog.setCaseStatusName(caseStatusName);
operLog.setCaseAppliId(caseAppliId);
operLog.setCaseNode(caseNode);
operLog.setCreateTime(dateOperate);
caseLogRecordMapper.insert(operLog);
if(signStatusApply!=null&&signStatusApply.intValue()==1){
MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
MsCaseApplication application = new MsCaseApplication();
application.setId(caseApplicationselect.getId());
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
//修改"签署用印记录表"的状态为完成
sealSignRecordsel.setSignFlowStatus(3);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
//下载审核完成的调解书
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
if (filesArray != null && filesArray.size() > 0) {
JsonObject fileObject = (JsonObject) filesArray.get(0);
String fileDownloadUrl = fileObject.get("downloadUrl").toString();
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
// String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// String savePath = "/home/ruoyi/uploadPath/upload/";
String saveName = fileName;
String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// 创建日期目录
File saveFolder = new File(saveFolderPath);
if (!saveFolder.exists()) {
saveFolder.mkdirs();
}
String resultFilePath = saveFolderPath + "/" + fileName;
File resultFilePathFile = new File(resultFilePath);
if (!resultFilePathFile.exists()) {
resultFilePathFile.createNewFile();
}
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
if (downLoadFile) {
MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexType(7);
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
}
}
}
}
}
}
}else{
return AjaxResult.error("error");
}
return AjaxResult.success("success");
}
/**
* 通过邮件发送裁决书文件
*
@@ -0,0 +1,46 @@
package com.ruoyi.wisdomarbitrate.utils;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
public class DigesdateUtils {
public static String getSignStr(String paramsStr, String accessSec ) {
Mac macDiges = null;
try {
macDiges = Mac.getInstance("HmacSHA256");
SecretKeySpec accessSecKey = new SecretKeySpec(accessSec.getBytes("UTF-8"), "HmacSHA256");
macDiges.init(accessSecKey);
macDiges.update(paramsStr.getBytes("UTF-8"));
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
} catch (InvalidKeyException e) {
e.printStackTrace();
return null;
}
return byteTrasferhex(macDiges.doFinal());
}
public static String byteTrasferhex(byte[] byteArrayData) {
StringBuilder hashBuilder = new StringBuilder();
String stmpHex;
for (int n = 0; byteArrayData != null && n < byteArrayData.length; n++) {
stmpHex = Integer.toHexString(byteArrayData[n] & 0XFF);
if (stmpHex.length() == 1)
hashBuilder.append('0');
hashBuilder.append(stmpHex);
}
return hashBuilder.toString();
}
}
@@ -243,7 +243,7 @@ public class FixSelectFlowDetailUtils {
/*
定时查询签署流程详情
*/
@Scheduled(cron = "0/10 * * * * ?")
// @Scheduled(cron = "0/10 * * * * ?")
@Transactional
public void fixExecuteSelectFlowDetailUtils() {
Gson gson = new Gson();
@@ -12,6 +12,7 @@ import com.ruoyi.common.utils.SealUtil;
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
import com.ruoyi.wisdomarbitrate.domain.vo.base.StringIdsReq;
import org.springframework.beans.factory.annotation.Value;
import java.util.List;
import java.util.Map;
@@ -22,6 +23,9 @@ public class SignAward {
private static String eSignAppId = EsignApplicaConfig.EsignAppId;
private static String eSignAppSecret = EsignApplicaConfig.EsignAppSecret;
@Value("${signSealCallbackConfig.url}")
private static String signSealCallbackUrl;
public static void main(String[] args) throws EsignDemoException {
Gson gson = new Gson();
@@ -351,7 +355,7 @@ public class SignAward {
" \"signConfig\": {\n" +
" \"availableSignClientTypes\": \"1\"\n" +
" },\n" +
// " \"notifyUrl\": \"" + signSealCallbackUrl + "\",\n" +
" \"autoFinish\": true\n" +
" },\n" +
@@ -0,0 +1,99 @@
package com.ruoyi.wisdomarbitrate.utils;
import com.ruoyi.common.utils.EsignApplicaConfig;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.wisdomarbitrate.service.miniprogress.impl.IdentityAuthenticationServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
public class SignVerifyUtils {
private static String eSignAppSecret = EsignApplicaConfig.EsignAppSecret;
public static boolean checkSignuter() throws Exception {
HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
String orialsignature = httprequest.getHeader("X-Tsign-Open-SIGNATURE");
String timestampreq = httprequest.getHeader("X-Tsign-Open-TIMESTAMP");
String reqQuerystr =getHttpreqQuery();
//获取请求参数
String reqbodystr =getRequestBody();
String signOriaData = timestampreq + reqQuerystr + reqbodystr;
String newDisgSignuter= DigesdateUtils.getSignStr(signOriaData, eSignAppSecret);
if (StringUtils.equals(orialsignature, newDisgSignuter)) {
return true;
}else {
return false;
}
}
public static String getHttpreqQuery() {
HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
List<String> reqNames= new ArrayList();
Enumeration<String> httpreqEle =httprequest.getParameterNames();
while (httpreqEle.hasMoreElements()){
reqNames.add(httpreqEle.nextElement());
}
Collections.sort(reqNames);
String httpreqQuery = "";
for (String reqName : reqNames) {
String reqvalue = httprequest.getParameter(reqName);
httpreqQuery += reqvalue == null ? "" : reqvalue;
}
return httpreqQuery;
}
public static String getRequestBody() {
HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
String requestBody = "";
int reqContentLen = httprequest.getContentLength();
if (reqContentLen < 0) {
return null;
}
byte bufByteArray[] = new byte[reqContentLen];
try {
for (int i = 0; i < reqContentLen;) {
int lengthReadInputStream = httprequest.getInputStream().read(bufByteArray, i, reqContentLen - i);
if (lengthReadInputStream == -1) {
break;
}
i += lengthReadInputStream;
}
} catch (IOException e) {
e.printStackTrace();
}
try {
requestBody = new String(bufByteArray, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return requestBody;
}
}
@@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="idCard" column="id_card" />
<result property="idType" column="id_type" />
<result property="nationality" column="nationality" />
<result property="email" column="email" />
<result property="phonenumber" column="phonenumber" />
<result property="sex" column="sex" />
@@ -50,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectUserVo">
select u.user_id, u.user_name, u.nick_name,u.specialty, u.id_card,u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card,u.id_type,u.nationality
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
@@ -200,6 +202,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userName != null and userName != ''">user_name,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="idCard != null and idCard != ''">id_card,</if>
<if test="idType != null ">id_type,</if>
<if test="nationality != null ">nationality,</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>
@@ -216,6 +220,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userName != null and userName != ''">#{userName},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="idCard != null and idCard != ''">#{idCard},</if>
<if test="idType != null ">#{idType},</if>
<if test="nationality != null ">#{nationality},</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>
@@ -272,6 +278,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<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="email != null ">email = #{email},</if>
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if>
@@ -23,6 +23,10 @@
<result column="position_xorg" jdbcType="DOUBLE" property="positionXorg" />
<result column="position_yorg" jdbcType="DOUBLE" property="positionYorg" />
<result column="file_download_url" jdbcType="LONGVARCHAR" property="fileDownloadUrl" />
<result column="sign_status_apply" jdbcType="INTEGER" property="signStatusApply" />
<result column="sign_status_response" jdbcType="INTEGER" property="signStatusResponse" />
<result column="sign_status_mediator" jdbcType="INTEGER" property="signStatusMediator" />
<result column="seal_status" jdbcType="INTEGER" property="sealStatus" />
</resultMap>
@@ -13,18 +13,19 @@
<result property="sealStatus" column="seal_status" />
<result property="useId" column="use_id" />
<result property="useAccount" column="use_account" />
<result property="onlyOfficeFileId" column="only_office_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,is_batch_upload)
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{useId},#{useAccount},#{sealStatus},#{isBatchUpload})
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)
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{useId},#{useAccount},#{sealStatus},#{onlyOfficeFileId})
</insert>
<insert id="batchSave" 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,is_batch_upload)
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)
VALUES
<foreach item="item" index="index" collection="list" separator=",">
(#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus},#{item.isBatchUpload})
(#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus},#{item.onlyOfficeFileId})
</foreach>
</insert>
<delete id="deleteByFileIds">
@@ -38,19 +39,16 @@
delete from ms_case_attach
where case_appli_id = #{caseAppliId}
and annex_type = #{annexType}
<if test="isBatchUpload != null ">
AND is_batch_upload = #{isBatchUpload}
</if>
</delete>
<select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
select *
from ms_case_attach
where case_appli_id =#{id}
</select>
<select id="listCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
select *
from ms_case_attach
<where>
<if test="caseAppliId != null ">
@@ -78,7 +76,7 @@
</delete>
<select id="queryCaseAttachList" resultMap="CaseAttachResult">
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
select *
from ms_case_attach
<where>
<if test="id != null ">