Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev
This commit was merged in pull request #54.
This commit is contained in:
@@ -1,19 +1,7 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.ruoyi.common.annotation.Anonymous;
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
|
||||||
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 org.springframework.web.multipart.MultipartFile;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
@@ -25,10 +13,23 @@ import com.ruoyi.common.enums.BusinessType;
|
|||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||||
import com.ruoyi.system.service.ISysDeptService;
|
import com.ruoyi.system.service.ISysDeptService;
|
||||||
import com.ruoyi.system.service.ISysPostService;
|
import com.ruoyi.system.service.ISysPostService;
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
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 org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户信息
|
* 用户信息
|
||||||
@@ -51,6 +52,8 @@ public class SysUserController extends BaseController
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysPostService postService;
|
private ISysPostService postService;
|
||||||
|
@Autowired
|
||||||
|
private SysDeptMapper deptMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户列表
|
* 获取用户列表
|
||||||
@@ -106,12 +109,18 @@ public class SysUserController extends BaseController
|
|||||||
List<SysRole> roles = roleService.selectRoleAll();
|
List<SysRole> roles = roleService.selectRoleAll();
|
||||||
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||||
ajax.put("posts", postService.selectPostAll());
|
ajax.put("posts", postService.selectPostAll());
|
||||||
|
|
||||||
if (StringUtils.isNotNull(userId))
|
if (StringUtils.isNotNull(userId))
|
||||||
{
|
{
|
||||||
SysUser sysUser = userService.selectUserById(userId);
|
SysUser sysUser = userService.selectUserById(userId);
|
||||||
ajax.put(AjaxResult.DATA_TAG, sysUser);
|
ajax.put(AjaxResult.DATA_TAG, sysUser);
|
||||||
ajax.put("postIds", postService.selectPostListByUserId(userId));
|
ajax.put("postIds", postService.selectPostListByUserId(userId));
|
||||||
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
||||||
|
List<SysDept> sysUserDepts = deptMapper.selectDeptByUserId(userId);
|
||||||
|
if(CollectionUtil.isNotEmpty(sysUserDepts)) {
|
||||||
|
ajax.put("deptId", sysUserDepts.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
|
|||||||
+39
-3
@@ -2,12 +2,14 @@ package com.ruoyi.web.controller.wisdomarbitrate.mscase;
|
|||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.IdcardUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.ruoyi.common.annotation.Anonymous;
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.exception.EsignDemoException;
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
|
import com.ruoyi.common.utils.IdCardUtils;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.*;
|
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.*;
|
||||||
@@ -20,7 +22,11 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 案件列表控制层
|
* 案件列表控制层
|
||||||
* @Author wangqiong
|
* @Author wangqiong
|
||||||
@@ -57,6 +63,36 @@ public class MsCaseApplicationController extends BaseController {
|
|||||||
|
|
||||||
return success(caseApplicationService.insert(caseApplication));
|
return success(caseApplicationService.insert(caseApplication));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 根据身份证号获取性别和出生日期
|
||||||
|
*/
|
||||||
|
@GetMapping("/getInfoByIdCard")
|
||||||
|
public AjaxResult getInfoByIdCard(@RequestParam("idCard") String idCard)
|
||||||
|
{
|
||||||
|
if(StrUtil.isEmpty(idCard)){
|
||||||
|
error("参数校验失败");
|
||||||
|
}
|
||||||
|
if(!IdcardUtil.isValidCard(idCard)){
|
||||||
|
error("身份证不合法,请输入正确的身份证号");
|
||||||
|
}
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
Map<String, String> identityNumMap = IdCardUtils.getBirAgeSex(idCard);
|
||||||
|
String birthday = identityNumMap.get("birthday");
|
||||||
|
if (StrUtil.isNotEmpty(birthday)) {
|
||||||
|
SimpleDateFormat yyyymmddFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
|
Date birthdayDate = null;
|
||||||
|
try {
|
||||||
|
birthdayDate = yyyymmddFormat.parse(birthday);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
ajax.put("respondentBirth",birthdayDate);
|
||||||
|
}
|
||||||
|
//从身份证抓取性别
|
||||||
|
ajax.put("respondentSex",identityNumMap.get("sexCode"));
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改案件
|
* 修改案件
|
||||||
@@ -67,7 +103,7 @@ public class MsCaseApplicationController extends BaseController {
|
|||||||
if(caseApplication.getId()==null){
|
if(caseApplication.getId()==null){
|
||||||
error("id不能为空");
|
error("id不能为空");
|
||||||
}
|
}
|
||||||
return caseApplicationService.update(caseApplication);
|
return success(caseApplicationService.update(caseApplication));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 根据id查询案件
|
* 根据id查询案件
|
||||||
@@ -168,7 +204,7 @@ public class MsCaseApplicationController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/updateBooking")
|
@PostMapping("/updateBooking")
|
||||||
public AjaxResult updateBooking(@RequestBody BookingVO vo ) {
|
public AjaxResult updateBooking(@RequestBody BookingVO vo ) {
|
||||||
if(vo.getId()==null || CollectionUtil.isEmpty(vo.getUserList())){
|
if(vo.getId()==null || CollectionUtil.isEmpty(vo.getMediatorList())){
|
||||||
return error("参数校验失败");
|
return error("参数校验失败");
|
||||||
}
|
}
|
||||||
return caseApplicationService.updateBooking(vo);
|
return caseApplicationService.updateBooking(vo);
|
||||||
@@ -218,7 +254,7 @@ public class MsCaseApplicationController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/mediation")
|
@PostMapping("/mediation")
|
||||||
public AjaxResult mediation(@RequestBody MsCaseApplicationReq req) {
|
public AjaxResult mediation(@RequestBody MsCaseApplicationReq req) {
|
||||||
if (req.getCaseFlowId() == null || (req.getId() == null && StrUtil.isEmpty(req.getBatchNumber()))) {
|
if (req.getCaseFlowId() == null || req.getId() == null) {
|
||||||
return error("参数校验失败");
|
return error("参数校验失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
package com.ruoyi.common.core.controller;
|
package com.ruoyi.common.core.controller;
|
||||||
|
|
||||||
import java.beans.PropertyEditorSupport;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
|
||||||
import org.springframework.web.bind.annotation.InitBinder;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.ruoyi.common.constant.HttpStatus;
|
import com.ruoyi.common.constant.HttpStatus;
|
||||||
@@ -20,6 +13,14 @@ import com.ruoyi.common.utils.PageUtils;
|
|||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.sql.SqlUtil;
|
import com.ruoyi.common.utils.sql.SqlUtil;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
|
import org.springframework.web.bind.annotation.InitBinder;
|
||||||
|
|
||||||
|
import java.beans.PropertyEditorSupport;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web层通用数据处理
|
* web层通用数据处理
|
||||||
@@ -184,13 +185,7 @@ public class BaseController
|
|||||||
return getLoginUser().getUserId();
|
return getLoginUser().getUserId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取登录部门id
|
|
||||||
*/
|
|
||||||
public Long getDeptId()
|
|
||||||
{
|
|
||||||
return getLoginUser().getDeptId();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取登录用户名
|
* 获取登录用户名
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
package com.ruoyi.common.core.domain.entity;
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.DictConvert;
|
import com.ruoyi.common.annotation.DictConvert;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||||
import com.ruoyi.common.annotation.Excel.Type;
|
import com.ruoyi.common.annotation.Excel.Type;
|
||||||
import com.ruoyi.common.annotation.Excels;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import com.ruoyi.common.xss.Xss;
|
import com.ruoyi.common.xss.Xss;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Email;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户对象 sys_user
|
* 用户对象 sys_user
|
||||||
@@ -27,9 +28,9 @@ public class SysUser extends BaseEntity
|
|||||||
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/** 部门ID */
|
/** 部门IDs */
|
||||||
@Excel(name = "部门编号", type = Type.IMPORT)
|
// @Excel(name = "部门编号", type = Type.IMPORT)
|
||||||
private Long deptId;
|
private List<Long> deptIds;
|
||||||
|
|
||||||
/** 用户账号 */
|
/** 用户账号 */
|
||||||
@Excel(name = "登录名称")
|
@Excel(name = "登录名称")
|
||||||
@@ -52,6 +53,15 @@ public class SysUser extends BaseEntity
|
|||||||
this.nickNameAndNum = nickNameAndNum;
|
this.nickNameAndNum = nickNameAndNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Long> getDeptIds() {
|
||||||
|
return deptIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeptIds(List<Long> deptIds) {
|
||||||
|
this.deptIds = deptIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** 用户身份证号 */
|
/** 用户身份证号 */
|
||||||
@Excel(name = "身份证号")
|
@Excel(name = "身份证号")
|
||||||
private String idCard;
|
private String idCard;
|
||||||
@@ -96,11 +106,11 @@ public class SysUser extends BaseEntity
|
|||||||
private Date loginDate;
|
private Date loginDate;
|
||||||
|
|
||||||
/** 部门对象 */
|
/** 部门对象 */
|
||||||
@Excels({
|
// @Excels({
|
||||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
// @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
// @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
||||||
})
|
// })
|
||||||
private SysDept dept;
|
private List<SysDept> depts;
|
||||||
|
|
||||||
/** 角色对象 */
|
/** 角色对象 */
|
||||||
private List<SysRole> roles;
|
private List<SysRole> roles;
|
||||||
@@ -119,6 +129,8 @@ public class SysUser extends BaseEntity
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public SysUser(Long userId)
|
public SysUser(Long userId)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
@@ -144,11 +156,6 @@ public class SysUser extends BaseEntity
|
|||||||
return userId != null && 1L == userId;
|
return userId != null && 1L == userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getDeptId()
|
|
||||||
{
|
|
||||||
return deptId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSexName() {
|
public String getSexName() {
|
||||||
return sexName;
|
return sexName;
|
||||||
}
|
}
|
||||||
@@ -165,9 +172,9 @@ public class SysUser extends BaseEntity
|
|||||||
this.specialty = specialty;
|
this.specialty = specialty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDeptId(Long deptId)
|
public void setDeptId(List<Long> deptId)
|
||||||
{
|
{
|
||||||
this.deptId = deptId;
|
this.deptIds = deptId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Xss(message = "用户昵称不能包含脚本字符")
|
@Xss(message = "用户昵称不能包含脚本字符")
|
||||||
@@ -288,14 +295,14 @@ public class SysUser extends BaseEntity
|
|||||||
this.loginDate = loginDate;
|
this.loginDate = loginDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SysDept getDept()
|
public List<SysDept> getDept()
|
||||||
{
|
{
|
||||||
return dept;
|
return depts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDept(SysDept dept)
|
public void setDept(List<SysDept> depts)
|
||||||
{
|
{
|
||||||
this.dept = dept;
|
this.depts = depts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SysRole> getRoles()
|
public List<SysRole> getRoles()
|
||||||
@@ -346,11 +353,12 @@ public class SysUser extends BaseEntity
|
|||||||
this.idCard = idCard;
|
this.idCard = idCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
.append("userId", getUserId())
|
.append("userId", getUserId())
|
||||||
.append("deptId", getDeptId())
|
.append("deptIds", getDeptIds())
|
||||||
.append("userName", getUserName())
|
.append("userName", getUserName())
|
||||||
.append("idCard", getIdCard())
|
.append("idCard", getIdCard())
|
||||||
.append("nickName", getNickName())
|
.append("nickName", getNickName())
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ public class LoginUser implements UserDetails
|
|||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 部门ID
|
|
||||||
*/
|
|
||||||
private Long deptId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户唯一标识
|
* 用户唯一标识
|
||||||
@@ -81,10 +78,9 @@ public class LoginUser implements UserDetails
|
|||||||
this.permissions = permissions;
|
this.permissions = permissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions)
|
public LoginUser(Long userId, SysUser user, Set<String> permissions)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.deptId = deptId;
|
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.permissions = permissions;
|
this.permissions = permissions;
|
||||||
}
|
}
|
||||||
@@ -99,15 +95,7 @@ public class LoginUser implements UserDetails
|
|||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getDeptId()
|
|
||||||
{
|
|
||||||
return deptId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeptId(Long deptId)
|
|
||||||
{
|
|
||||||
this.deptId = deptId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getToken()
|
public String getToken()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ public enum AnnexTypeEnum implements EnumsInterface {
|
|||||||
MEETING_VIDEO(5, "会议视频"),
|
MEETING_VIDEO(5, "会议视频"),
|
||||||
MEDIATE(6, "庭审笔录"),
|
MEDIATE(6, "庭审笔录"),
|
||||||
MEDIATE_BOOK(7, "调解书"),
|
MEDIATE_BOOK(7, "调解书"),
|
||||||
|
MEDIATION_FILES(8, "调解资料"),
|
||||||
|
|
||||||
|
SEAL_PICTURE(10, "印章图片"),
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
|
import com.ruoyi.common.interfaces.EnumsInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Classname AnnexTypeEnum
|
||||||
|
* @Description 调解方式枚举
|
||||||
|
* @Version 1.0.0
|
||||||
|
* @Date 2024/1/12 17:50
|
||||||
|
* @Created wangqiong
|
||||||
|
*/
|
||||||
|
public enum MediationMethodEnum implements EnumsInterface {
|
||||||
|
ON_LINE("1", "线上调解"),
|
||||||
|
OFF_LINE("2", "线下调解"),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String text;
|
||||||
|
|
||||||
|
MediationMethodEnum(String code, String text)
|
||||||
|
{
|
||||||
|
this.code = code;
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText()
|
||||||
|
{
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code获取text
|
||||||
|
* @param codeNo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getTextByCode(String codeNo){
|
||||||
|
for (MediationMethodEnum value : MediationMethodEnum.values()) {
|
||||||
|
if (value.getCode().equals(codeNo)){
|
||||||
|
return value.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return codeNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据text获取code
|
||||||
|
* @param textStr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getCodeByText(String textStr){
|
||||||
|
for (MediationMethodEnum value : MediationMethodEnum.values()) {
|
||||||
|
if (value.getText().equals(textStr)){
|
||||||
|
return value.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return textStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,20 +29,7 @@ public class SecurityUtils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取部门ID
|
|
||||||
**/
|
|
||||||
public static Long getDeptId()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return getLoginUser().getDeptId();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户账户
|
* 获取用户账户
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
package com.ruoyi.framework.aspectj;
|
package com.ruoyi.framework.aspectj;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import org.aspectj.lang.JoinPoint;
|
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
|
||||||
import org.aspectj.lang.annotation.Before;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import com.ruoyi.common.annotation.DataScope;
|
import com.ruoyi.common.annotation.DataScope;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
@@ -15,6 +9,13 @@ import com.ruoyi.common.core.text.Convert;
|
|||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.framework.security.context.PermissionContextHolder;
|
import com.ruoyi.framework.security.context.PermissionContextHolder;
|
||||||
|
import org.aspectj.lang.JoinPoint;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
import org.aspectj.lang.annotation.Before;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据过滤处理
|
* 数据过滤处理
|
||||||
@@ -119,13 +120,13 @@ public class DataScopeAspect
|
|||||||
}
|
}
|
||||||
else if (DATA_SCOPE_DEPT.equals(dataScope))
|
else if (DATA_SCOPE_DEPT.equals(dataScope))
|
||||||
{
|
{
|
||||||
sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId()));
|
sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDept()));
|
||||||
}
|
}
|
||||||
else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
|
else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
|
||||||
{
|
{
|
||||||
sqlString.append(StringUtils.format(
|
sqlString.append(StringUtils.format(
|
||||||
" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
|
" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
|
||||||
deptAlias, user.getDeptId(), user.getDeptId()));
|
deptAlias, user.getDept(), user.getDept()));
|
||||||
}
|
}
|
||||||
else if (DATA_SCOPE_SELF.equals(dataScope))
|
else if (DATA_SCOPE_SELF.equals(dataScope))
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -61,6 +61,6 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
|||||||
|
|
||||||
public UserDetails createLoginUser(SysUser user)
|
public UserDetails createLoginUser(SysUser user)
|
||||||
{
|
{
|
||||||
return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
return new LoginUser(user.getUserId(), user, permissionService.getMenuPermission(user));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前在线会话
|
* 当前在线会话
|
||||||
*
|
*
|
||||||
@@ -10,8 +12,6 @@ public class SysUserOnline
|
|||||||
/** 会话编号 */
|
/** 会话编号 */
|
||||||
private String tokenId;
|
private String tokenId;
|
||||||
|
|
||||||
/** 部门名称 */
|
|
||||||
private String deptName;
|
|
||||||
|
|
||||||
/** 用户名称 */
|
/** 用户名称 */
|
||||||
private String userName;
|
private String userName;
|
||||||
@@ -41,15 +41,7 @@ public class SysUserOnline
|
|||||||
this.tokenId = tokenId;
|
this.tokenId = tokenId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDeptName()
|
|
||||||
{
|
|
||||||
return deptName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeptName(String deptName)
|
|
||||||
{
|
|
||||||
this.deptName = deptName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserName()
|
public String getUserName()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package com.ruoyi.system.mapper;
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门管理 数据层
|
* 部门管理 数据层
|
||||||
@@ -124,4 +125,12 @@ public interface SysDeptMapper
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int batchSave(@Param("list")List<SysDept> sysDepts);
|
int batchSave(@Param("list")List<SysDept> sysDepts);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户id查询部门信息
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
List<SysDept> selectDeptByUserId(Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public interface SysUserDeptMapper
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
public List<SysUserDept> selectUserById(Long userId);
|
public List<SysUserDept> selectUserDeptById(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
@@ -41,7 +41,7 @@ public interface SysUserDeptMapper
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteUserById(@Param("userId)") Long userId);
|
public int deleteUserById(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
@@ -50,5 +50,4 @@ public interface SysUserDeptMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteUserByIds(@Param("ids") Long[] userIds);
|
public int deleteUserByIds(@Param("ids") Long[] userIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,10 +87,6 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService
|
|||||||
sysUserOnline.setBrowser(user.getBrowser());
|
sysUserOnline.setBrowser(user.getBrowser());
|
||||||
sysUserOnline.setOs(user.getOs());
|
sysUserOnline.setOs(user.getOs());
|
||||||
sysUserOnline.setLoginTime(user.getLoginTime());
|
sysUserOnline.setLoginTime(user.getLoginTime());
|
||||||
if (StringUtils.isNotNull(user.getUser().getDept()))
|
|
||||||
{
|
|
||||||
sysUserOnline.setDeptName(user.getUser().getDept().getDeptName());
|
|
||||||
}
|
|
||||||
return sysUserOnline;
|
return sysUserOnline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.ruoyi.common.annotation.DataScope;
|
import com.ruoyi.common.annotation.DataScope;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUserDept;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
@@ -26,7 +27,6 @@ import org.springframework.util.CollectionUtils;
|
|||||||
|
|
||||||
import javax.validation.Validator;
|
import javax.validation.Validator;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -53,6 +53,8 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserRoleMapper userRoleMapper;
|
private SysUserRoleMapper userRoleMapper;
|
||||||
|
@Autowired
|
||||||
|
private SysUserDeptMapper userDeptMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserPostMapper userPostMapper;
|
private SysUserPostMapper userPostMapper;
|
||||||
@@ -238,28 +240,21 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public AjaxResult insertUser(SysUser user) {
|
public AjaxResult insertUser(SysUser user) {
|
||||||
Long deptId = user.getDeptId();
|
|
||||||
Long[] postIds = user.getPostIds();
|
|
||||||
if (deptId != null) {
|
|
||||||
SysDept dept = sysDeptMapper.selectDeptById(deptId);
|
|
||||||
Integer deptType = dept.getDeptType();
|
|
||||||
if (deptType!=null && deptType.intValue() == 1) {
|
|
||||||
SysPost sysPost = postMapper.selectPostByPostCode("jbr");
|
|
||||||
Long postId = sysPost.getPostId();
|
|
||||||
if (postIds.length > 0) {
|
|
||||||
boolean isContain = Arrays.asList(postIds).contains(postId);
|
|
||||||
if (isContain) {
|
|
||||||
List<SysUser> sysUsers = userMapper.selectUserByDeptId(deptId);
|
|
||||||
if (sysUsers != null && sysUsers.size() > 0) {
|
|
||||||
return AjaxResult.error("部门类型为仲裁机构的部门的岗位为经办人的用户只能有一个!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增用户信息
|
// 新增用户信息
|
||||||
int rows = userMapper.insertUser(user);
|
int rows = userMapper.insertUser(user);
|
||||||
|
// 新增用户部门关联
|
||||||
|
if(CollectionUtil.isNotEmpty(user.getDeptIds())) {
|
||||||
|
// 先删除用户与部门关联
|
||||||
|
userDeptMapper.deleteUserById(user.getUserId());
|
||||||
|
List<SysUserDept> userDepts = new ArrayList<>();
|
||||||
|
for (Long userDeptId : user.getDeptIds()) {
|
||||||
|
SysUserDept userDept = new SysUserDept();
|
||||||
|
userDept.setUserId(user.getUserId());
|
||||||
|
userDept.setDeptId(userDeptId);
|
||||||
|
userDepts.add(userDept);
|
||||||
|
}
|
||||||
|
userDeptMapper.batchSave(userDepts);
|
||||||
|
}
|
||||||
// 新增用户岗位关联
|
// 新增用户岗位关联
|
||||||
insertUserPost(user);
|
insertUserPost(user);
|
||||||
// 新增用户与角色管理
|
// 新增用户与角色管理
|
||||||
@@ -287,29 +282,20 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public AjaxResult updateUser(SysUser user) {
|
public AjaxResult updateUser(SysUser user) {
|
||||||
Long deptId = user.getDeptId();
|
|
||||||
Long[] postIds = user.getPostIds();
|
|
||||||
if (deptId != null) {
|
|
||||||
SysDept dept = sysDeptMapper.selectDeptById(deptId);
|
|
||||||
Integer deptType = dept.getDeptType();
|
|
||||||
if (deptType != null && deptType.intValue() == 1) {
|
|
||||||
SysPost sysPost = postMapper.selectPostByPostCode("jbr");
|
|
||||||
if(sysPost!=null) {
|
|
||||||
Long postId = sysPost.getPostId();
|
|
||||||
if (postId!=null&&postIds.length > 0) {
|
|
||||||
boolean isContain = Arrays.asList(postIds).contains(postId);
|
|
||||||
if (isContain) {
|
|
||||||
List<SysUser> sysUsers = userMapper.selectUserByDeptId(deptId);
|
|
||||||
if (sysUsers != null && sysUsers.size() > 0) {
|
|
||||||
return AjaxResult.error("部门类型为仲裁机构的部门的岗位为经办人的用户只能有一个!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Long userId = user.getUserId();
|
Long userId = user.getUserId();
|
||||||
|
// 新增用户部门关联
|
||||||
|
if(CollectionUtil.isNotEmpty(user.getDeptIds())) {
|
||||||
|
// 先删除用户与部门关联
|
||||||
|
userDeptMapper.deleteUserById(user.getUserId());
|
||||||
|
List<SysUserDept> userDepts = new ArrayList<>();
|
||||||
|
for (Long userDeptId : user.getDeptIds()) {
|
||||||
|
SysUserDept userDept = new SysUserDept();
|
||||||
|
userDept.setUserId(user.getUserId());
|
||||||
|
userDept.setDeptId(userDeptId);
|
||||||
|
userDepts.add(userDept);
|
||||||
|
}
|
||||||
|
userDeptMapper.batchSave(userDepts);
|
||||||
|
}
|
||||||
// 删除用户与角色关联
|
// 删除用户与角色关联
|
||||||
userRoleMapper.deleteUserRoleByUserId(userId);
|
userRoleMapper.deleteUserRoleByUserId(userId);
|
||||||
// 新增用户与角色管理
|
// 新增用户与角色管理
|
||||||
@@ -474,6 +460,8 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||||||
userRoleMapper.deleteUserRole(userIds);
|
userRoleMapper.deleteUserRole(userIds);
|
||||||
// 删除用户与岗位关联
|
// 删除用户与岗位关联
|
||||||
userPostMapper.deleteUserPost(userIds);
|
userPostMapper.deleteUserPost(userIds);
|
||||||
|
// 删除用户部门关联
|
||||||
|
userDeptMapper.deleteUserByIds(userIds);
|
||||||
return userMapper.deleteUserByIds(userIds);
|
return userMapper.deleteUserByIds(userIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
@@ -44,6 +44,16 @@ public class MsCaseAffiliate {
|
|||||||
*/
|
*/
|
||||||
@Column(name = "code")
|
@Column(name = "code")
|
||||||
private String code;
|
private String code;
|
||||||
|
/**
|
||||||
|
* 申请人联系电话
|
||||||
|
*/
|
||||||
|
@Column(name = "application_phone")
|
||||||
|
private String applicationPhone;
|
||||||
|
/**
|
||||||
|
* 申请人邮箱
|
||||||
|
*/
|
||||||
|
@Column(name = "application_email")
|
||||||
|
private String applicationEmail;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 法定代表人
|
* 法定代表人
|
||||||
|
|||||||
+3
-1
@@ -8,6 +8,7 @@ import javax.persistence.Column;
|
|||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 案件预约表
|
* 案件预约表
|
||||||
@@ -16,7 +17,8 @@ import javax.persistence.Table;
|
|||||||
@Setter
|
@Setter
|
||||||
@ToString
|
@ToString
|
||||||
@Table(name = "ms_case_mediator")
|
@Table(name = "ms_case_mediator")
|
||||||
public class MsCaseMediator {
|
public class MsCaseMediator implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(generator = "JDBC")
|
@GeneratedValue(generator = "JDBC")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
||||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseMediator;
|
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseMediator;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -15,10 +14,6 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class BookingVO {
|
public class BookingVO {
|
||||||
/**
|
|
||||||
* 申请人调解员列表
|
|
||||||
*/
|
|
||||||
private List<SysUser> userList;
|
|
||||||
/**
|
/**
|
||||||
* 申请人调解员列表
|
* 申请人调解员列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
+7
@@ -1,9 +1,12 @@
|
|||||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||||
|
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
@@ -80,5 +83,9 @@ public class MsCaseApplicationReq {
|
|||||||
* 是否小程序,1-是
|
* 是否小程序,1-是
|
||||||
*/
|
*/
|
||||||
private Integer miniProgressFlag ;
|
private Integer miniProgressFlag ;
|
||||||
|
/**
|
||||||
|
* 附件
|
||||||
|
*/
|
||||||
|
private List<MsCaseAttach> attachList;
|
||||||
|
|
||||||
}
|
}
|
||||||
-10
@@ -51,10 +51,6 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
|
|||||||
"</if> " +
|
"</if> " +
|
||||||
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
|
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
|
||||||
" AND c.case_num = #{req.caseNum} " +
|
" AND c.case_num = #{req.caseNum} " +
|
||||||
"</if> " +
|
|
||||||
|
|
||||||
"<if test=\"req.applicantFlag != null \">" +
|
|
||||||
" AND a.application_id = #{req.applicationId} " +
|
|
||||||
"</if> "
|
"</if> "
|
||||||
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
|
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
|
||||||
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
|
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
|
||||||
@@ -90,9 +86,6 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
|
|||||||
"</if> " +
|
"</if> " +
|
||||||
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
|
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
|
||||||
" AND c1.case_num = #{req.caseNum} " +
|
" AND c1.case_num = #{req.caseNum} " +
|
||||||
"</if> " +
|
|
||||||
"<if test=\"req.applicantFlag != null \">" +
|
|
||||||
" AND a1.application_id = #{req.applicationId} " +
|
|
||||||
"</if> "
|
"</if> "
|
||||||
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
|
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
|
||||||
" AND a1.respondent_identity_num = #{req.respondentIdentityNum} " +
|
" AND a1.respondent_identity_num = #{req.respondentIdentityNum} " +
|
||||||
@@ -124,9 +117,6 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
|
|||||||
"</if> " +
|
"</if> " +
|
||||||
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
|
"<if test=\"req.caseNum != null and req.caseNum != ''\">" +
|
||||||
" AND c.case_num = #{req.caseNum} " +
|
" AND c.case_num = #{req.caseNum} " +
|
||||||
"</if> " +
|
|
||||||
"<if test=\"req.applicantFlag != null \">" +
|
|
||||||
" AND a.application_id = #{req.applicationId} " +
|
|
||||||
"</if> "
|
"</if> "
|
||||||
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
|
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
|
||||||
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
|
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
|
||||||
|
|||||||
+2
-1
@@ -12,6 +12,7 @@ import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
|||||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
import com.ruoyi.common.enums.AnnexTypeEnum;
|
||||||
import com.ruoyi.common.exception.EsignDemoException;
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.utils.SealUtil;
|
import com.ruoyi.common.utils.SealUtil;
|
||||||
@@ -248,7 +249,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
|
|||||||
boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
|
boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
|
||||||
if (downLoadFile) {
|
if (downLoadFile) {
|
||||||
MsCaseAttach caseAttach = new MsCaseAttach();
|
MsCaseAttach caseAttach = new MsCaseAttach();
|
||||||
caseAttach.setAnnexType(10); //10代表印章图片
|
caseAttach.setAnnexType(AnnexTypeEnum.SEAL_PICTURE.getCode()); //10代表印章图片
|
||||||
caseAttach.setAnnexPath(savePath);
|
caseAttach.setAnnexPath(savePath);
|
||||||
caseAttach.setAnnexName(saveName);
|
caseAttach.setAnnexName(saveName);
|
||||||
int i1 = msCaseAttachMapper.save(caseAttach);
|
int i1 = msCaseAttachMapper.save(caseAttach);
|
||||||
|
|||||||
+37
@@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.wisdomarbitrate.service.mscase;
|
package com.ruoyi.wisdomarbitrate.service.mscase;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||||
import com.ruoyi.common.exception.EsignDemoException;
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
|
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
|
||||||
@@ -13,6 +14,7 @@ import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseAttachVO;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Classname MsCaseApplicationService
|
* @Classname MsCaseApplicationService
|
||||||
@@ -42,6 +44,13 @@ public interface MsCaseApplicationService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int insert(MsCaseApplicationVO caseApplication);
|
int insert(MsCaseApplicationVO caseApplication);
|
||||||
|
/**
|
||||||
|
* 新增用户
|
||||||
|
* @param affiliate
|
||||||
|
* @param agentFlag 是否代理人,0-否,1-是
|
||||||
|
* @param roleId
|
||||||
|
*/
|
||||||
|
void insertApplicantUser( MsCaseAffiliate affiliate,boolean agentFlag, Long roleId);
|
||||||
/**
|
/**
|
||||||
* 新增申请机构代理人
|
* 新增申请机构代理人
|
||||||
* @param affiliate
|
* @param affiliate
|
||||||
@@ -165,4 +174,32 @@ public interface MsCaseApplicationService {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
AjaxResult confirmMediation(MsCaseAttachVO attach) throws EsignDemoException, InterruptedException ;
|
AjaxResult confirmMediation(MsCaseAttachVO attach) throws EsignDemoException, InterruptedException ;
|
||||||
|
/**
|
||||||
|
* 生成调解申请书
|
||||||
|
* @param application 案件基本信息
|
||||||
|
* @param affiliate 案件相关人员
|
||||||
|
* @param templatePath 模板路径
|
||||||
|
* @param bookmarkList 标签
|
||||||
|
* @param dictDataList 内置字段
|
||||||
|
*/
|
||||||
|
void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList, Integer templateType) ;
|
||||||
|
/**
|
||||||
|
* 案件受理
|
||||||
|
* @param application
|
||||||
|
* @param req
|
||||||
|
* @param affiliateMap
|
||||||
|
*/
|
||||||
|
void accept(MsCaseApplication application, MsCaseApplication req, Map<Long, MsCaseAffiliate> affiliateMap) ;
|
||||||
|
/**
|
||||||
|
* 判断申请人/被申请人是否预约
|
||||||
|
* @param vo
|
||||||
|
* @param userIds 选择的调解员ids
|
||||||
|
*/
|
||||||
|
void isReservation( BookingVO vo, List<Long> userIds );
|
||||||
|
/**
|
||||||
|
* 核实调解员
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void verifyMediator(MsCaseApplication application,BookingVO vo);
|
||||||
}
|
}
|
||||||
|
|||||||
+268
-205
@@ -83,6 +83,8 @@ import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||||
|
@Autowired
|
||||||
|
MsCaseApplicationService caseApplicationService;
|
||||||
@Autowired
|
@Autowired
|
||||||
MsCaseApplicationMapper msCaseApplicationMapper;
|
MsCaseApplicationMapper msCaseApplicationMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -110,6 +112,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
SysUserMapper userMapper;
|
SysUserMapper userMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
SysUserDeptMapper userDeptMapper;
|
||||||
|
@Autowired
|
||||||
SysUserRoleMapper userRoleMapper;
|
SysUserRoleMapper userRoleMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
FatchRuleMapper fatchRuleMapper;
|
FatchRuleMapper fatchRuleMapper;
|
||||||
@@ -181,9 +185,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
List<String> caseStatusNames = caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList());
|
List<String> caseStatusNames = caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList());
|
||||||
for (SysRole role : roles) {
|
for (SysRole role : roles) {
|
||||||
if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"申请人")){
|
if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"申请人")){
|
||||||
if(sysUser.getDeptId()!=null) {
|
|
||||||
req.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
|
||||||
}
|
|
||||||
req.setApplicantFlag(1);
|
req.setApplicantFlag(1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -244,6 +245,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
if (caseApplication.getId() == null) {
|
if (caseApplication.getId() == null) {
|
||||||
caseApplication.setId(IdWorkerUtil.getId());
|
caseApplication.setId(IdWorkerUtil.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据角色获取案件流程
|
// 根据角色获取案件流程
|
||||||
List<MsCaseFlow> caseFlows= selectCaseFlows();
|
List<MsCaseFlow> caseFlows= selectCaseFlows();
|
||||||
if (CollectionUtil.isEmpty(caseFlows)) {
|
if (CollectionUtil.isEmpty(caseFlows)) {
|
||||||
@@ -265,20 +267,25 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
caseApplication.setUpdateBy(SecurityUtils.getUsername());
|
caseApplication.setUpdateBy(SecurityUtils.getUsername());
|
||||||
caseApplication.setVersion(1);
|
caseApplication.setVersion(1);
|
||||||
MsCaseAffiliate affiliate = caseApplication.getAffiliate();
|
MsCaseAffiliate affiliate = caseApplication.getAffiliate();
|
||||||
|
affiliate.setCaseAppliId(caseApplication.getId());
|
||||||
// 保存案件基本信息
|
// 保存案件基本信息
|
||||||
if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) {
|
if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) {
|
||||||
List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
|
List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
|
||||||
// 保存案件相关人员
|
// 保存案件相关人员
|
||||||
if (affiliate != null) {
|
|
||||||
// 设置申请机构
|
// 设置申请机构
|
||||||
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
|
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
|
||||||
// 组装申请机构
|
// 组装申请机构
|
||||||
insertDept(affiliate);
|
// insertDept(affiliate);
|
||||||
// 新增申请机构代理人
|
// 新增申请机构和代理人
|
||||||
insertAgentUser(affiliate);
|
caseApplicationService.insertAgentUser(affiliate);
|
||||||
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
|
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
|
||||||
// 申请人为自然人
|
// todo 申请人为自然人,如果系统不存在申请人和代理人用户,分别新增用户,新增完用户需要发送短信
|
||||||
//
|
// 查询申请人角色id
|
||||||
|
Long roleId = roleMapper.selectRoleIdByName("申请人");
|
||||||
|
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
|
||||||
|
caseApplicationService.insertApplicantUser(affiliate,true,roleId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// 压缩包导入,则根据身份证号获取性别和出生日期
|
// 压缩包导入,则根据身份证号获取性别和出生日期
|
||||||
String identityNum = affiliate.getRespondentIdentityNum();
|
String identityNum = affiliate.getRespondentIdentityNum();
|
||||||
@@ -286,18 +293,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
|
|
||||||
identityNum = identityNum.replace("\n", "");
|
identityNum = identityNum.replace("\n", "");
|
||||||
Map<String, String> identityNumMap = IdCardUtils.getBirAgeSex(identityNum);
|
Map<String, String> identityNumMap = IdCardUtils.getBirAgeSex(identityNum);
|
||||||
String birthday = identityNumMap.get("birthday");
|
if (identityNumMap != null) {
|
||||||
if (StrUtil.isNotEmpty(birthday)) {
|
String birthday = identityNumMap.get("birthday");
|
||||||
Date birthdayDate = null;
|
if (StrUtil.isNotEmpty(birthday)) {
|
||||||
try {
|
Date birthdayDate = null;
|
||||||
birthdayDate = yyyymmddFormat.parse(birthday);
|
try {
|
||||||
} catch (Exception e) {
|
birthdayDate = yyyymmddFormat.parse(birthday);
|
||||||
e.printStackTrace();
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
affiliate.setRespondentBirth(birthdayDate);
|
||||||
}
|
}
|
||||||
affiliate.setRespondentBirth(birthdayDate);
|
//从身份证抓取性别
|
||||||
|
affiliate.setRespondentSex(identityNumMap.get("sexCode"));
|
||||||
}
|
}
|
||||||
//从身份证抓取性别
|
|
||||||
affiliate.setRespondentSex(identityNumMap.get("sexCode"));
|
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
|
if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
|
||||||
affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
|
affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
|
||||||
@@ -305,7 +314,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
|
if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
|
||||||
affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
|
affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
|
||||||
}
|
}
|
||||||
affiliate.setCaseAppliId(caseApplication.getId());
|
|
||||||
msCaseAffiliateMapper.insert(affiliate);
|
msCaseAffiliateMapper.insert(affiliate);
|
||||||
// 查询调解申请书模板id
|
// 查询调解申请书模板id
|
||||||
TemplateManage templateManage=templateManageMapper.selectByType(2);
|
TemplateManage templateManage=templateManageMapper.selectByType(2);
|
||||||
@@ -321,10 +330,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
}
|
}
|
||||||
// 生成调解申请书
|
// 生成调解申请书
|
||||||
req.setTemplateId(String.valueOf(templateManage.getId()));
|
req.setTemplateId(String.valueOf(templateManage.getId()));
|
||||||
generateApplication(req);
|
// todo 部署放开
|
||||||
|
// caseApplicationService.generateApplication(req);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// 保存案件附件
|
// 保存案件附件
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
||||||
@@ -354,6 +364,65 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户
|
||||||
|
* @param affiliate
|
||||||
|
* @param agentFlag 是否代理人,0-否,1-是
|
||||||
|
* @param roleId
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public void insertApplicantUser( MsCaseAffiliate affiliate,boolean agentFlag, Long roleId) {
|
||||||
|
String phone="";
|
||||||
|
String name="";
|
||||||
|
if(agentFlag){
|
||||||
|
// 代理人
|
||||||
|
phone=affiliate.getContactTelphoneAgent();
|
||||||
|
name=affiliate.getNameAgent();
|
||||||
|
|
||||||
|
}else {
|
||||||
|
// 申请人
|
||||||
|
phone=affiliate.getApplicationPhone();
|
||||||
|
name=affiliate.getApplicationName();
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotEmpty(phone) && StrUtil.isNotEmpty(name)){
|
||||||
|
// 查询用户是否存在
|
||||||
|
SysUser sysUser = sysUserMapper.selectUserByUserName(name);
|
||||||
|
if(sysUser==null){
|
||||||
|
// 新增用户
|
||||||
|
sysUser = new SysUser();
|
||||||
|
sysUser.setUserName(phone);
|
||||||
|
sysUser.setNickName(name);
|
||||||
|
sysUser.setPhonenumber(phone);
|
||||||
|
sysUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
||||||
|
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
userMapper.insertUser(sysUser);
|
||||||
|
userRoleMapper.insertUserRole(sysUser.getUserId(), roleId);
|
||||||
|
// 发送短信 2064355 调解系统自动创建用户短信通知 尊敬的用户,您的案件已经创建,请使用账号为{1},密码为{2}登录调解系统,请知晓,如非本人操作,请忽略本短信。
|
||||||
|
Boolean smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2064355", phone, new String[]{phone, "abc123456"});
|
||||||
|
|
||||||
|
}else {
|
||||||
|
// 用户不为空,查询角色是否为申请人
|
||||||
|
if (CollectionUtil.isNotEmpty(sysUser.getRoles())) {
|
||||||
|
List<Long> longList = sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
|
||||||
|
if (!longList.contains(roleId)) {
|
||||||
|
userRoleMapper.insertUserRole(sysUser.getUserId(), roleId);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
userRoleMapper.insertUserRole(sysUser.getUserId(), roleId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(!agentFlag){
|
||||||
|
// 自然人,将用户id设为申请人id
|
||||||
|
affiliate.setApplicationId(String.valueOf(sysUser.getUserId()));
|
||||||
|
affiliate.setApplicationName(sysUser.getNickName());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询案件流程
|
* 查询案件流程
|
||||||
* @return
|
* @return
|
||||||
@@ -415,9 +484,19 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
// 设置申请人
|
// 设置申请人
|
||||||
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
|
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
|
||||||
// 组装申请机构
|
// 组装申请机构
|
||||||
insertDept(affiliate);
|
// insertDept(affiliate);
|
||||||
// 新增申请机构代理人
|
// 新增申请机构代理人
|
||||||
insertAgentUser(affiliate);
|
caseApplicationService.insertAgentUser(affiliate);
|
||||||
|
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
|
||||||
|
// todo 申请人为自然人,如果系统不存在申请人和代理人用户,分别新增用户,新增完用户需要发送短信
|
||||||
|
// 查询申请人角色id
|
||||||
|
Long roleId = roleMapper.selectRoleIdByName("申请人");
|
||||||
|
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
|
||||||
|
caseApplicationService.insertApplicantUser(affiliate,true,roleId);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
|
||||||
|
affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
|
||||||
}
|
}
|
||||||
msCaseAffiliateMapper.updateByPrimaryKeySelective(affiliate);
|
msCaseAffiliateMapper.updateByPrimaryKeySelective(affiliate);
|
||||||
}
|
}
|
||||||
@@ -558,7 +637,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
caseApplicationVO.setCaseAttachList(attachList);
|
caseApplicationVO.setCaseAttachList(attachList);
|
||||||
caseApplicationVO.setColumnValueList(columnValueList);
|
caseApplicationVO.setColumnValueList(columnValueList);
|
||||||
caseApplicationVO.setImportFlag(true);
|
caseApplicationVO.setImportFlag(true);
|
||||||
insert(caseApplicationVO);
|
caseApplicationService.insert(caseApplicationVO);
|
||||||
caseCount++;
|
caseCount++;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -567,21 +646,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if(caseCount>0) {
|
if(caseCount>0) {
|
||||||
|
|
||||||
// // 查询调解申请书模板id
|
|
||||||
// TemplateManage templateManage=templateManageMapper.selectByType(2);
|
|
||||||
// if(templateManage!=null) {
|
|
||||||
// List<MsCaseFlow> caseFlows = selectCaseFlows();
|
|
||||||
// // 批量生成调解申请书
|
|
||||||
// MsCaseApplicationReq req = new MsCaseApplicationReq();
|
|
||||||
// if (CollectionUtil.isNotEmpty(caseFlows)) {
|
|
||||||
// MsCaseFlow caseFlow = caseFlows.get(0);
|
|
||||||
// req.setCaseFlowId(caseFlow.getId());
|
|
||||||
// req.setBatchNumber(batchNumber);
|
|
||||||
// req.setTemplateId(String.valueOf(templateManage.getId()));
|
|
||||||
// generateApplication(req);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}else {
|
}else {
|
||||||
return AjaxResult.error("请检查压缩包!");
|
return AjaxResult.error("请检查压缩包!");
|
||||||
@@ -647,7 +711,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
if(affiliate==null){
|
if(affiliate==null){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
createMediateApplication(application, affiliate, templatePath, bookmarkList,dictDataList,req.getTemplateType());
|
caseApplicationService.createMediateApplication(application, affiliate, templatePath, bookmarkList,dictDataList,req.getTemplateType());
|
||||||
|
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
@@ -660,7 +724,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
throw new ServiceException("该案件不存在");
|
throw new ServiceException("该案件不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
createMediateApplication(application, caseAffiliate, templatePath, bookmarkList,dictDataList,req.getTemplateType());
|
caseApplicationService.createMediateApplication(application, caseAffiliate, templatePath, bookmarkList,dictDataList,req.getTemplateType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -690,6 +754,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
* @param req
|
* @param req
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult batchUpdateAttach(MsCaseApplicationVO req) {
|
public AjaxResult batchUpdateAttach(MsCaseApplicationVO req) {
|
||||||
for (MsCaseAttach attach : req.getCaseAttachList()) {
|
for (MsCaseAttach attach : req.getCaseAttachList()) {
|
||||||
@@ -706,6 +771,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id) {
|
public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id) {
|
||||||
List<MsCaseAttach> successList = new ArrayList<>();
|
List<MsCaseAttach> successList = new ArrayList<>();
|
||||||
@@ -745,6 +811,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
* @param req
|
* @param req
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult accept(MsCaseApplication req) {
|
public AjaxResult accept(MsCaseApplication req) {
|
||||||
if (StrUtil.isNotEmpty(req.getBatchNumber())) {
|
if (StrUtil.isNotEmpty(req.getBatchNumber())) {
|
||||||
@@ -762,7 +829,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
}
|
}
|
||||||
Map<Long, MsCaseAffiliate> affiliateMap = affiliateList.stream().collect(Collectors.toMap(MsCaseAffiliate::getCaseAppliId, Function.identity()));
|
Map<Long, MsCaseAffiliate> affiliateMap = affiliateList.stream().collect(Collectors.toMap(MsCaseAffiliate::getCaseAppliId, Function.identity()));
|
||||||
for (MsCaseApplication application : applicationList) {
|
for (MsCaseApplication application : applicationList) {
|
||||||
accept(application,req,affiliateMap);
|
caseApplicationService.accept(application,req,affiliateMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -777,7 +844,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
application.setLockStatus(YesOrNoEnum.YES.getCode());
|
application.setLockStatus(YesOrNoEnum.YES.getCode());
|
||||||
Map<Long, MsCaseAffiliate> affiliateMap=new HashMap<>();
|
Map<Long, MsCaseAffiliate> affiliateMap=new HashMap<>();
|
||||||
affiliateMap.put(req.getId(),caseAffiliate);
|
affiliateMap.put(req.getId(),caseAffiliate);
|
||||||
accept(application,req,affiliateMap);
|
caseApplicationService.accept(application,req,affiliateMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
return AjaxResult.success("受理成功");
|
return AjaxResult.success("受理成功");
|
||||||
@@ -788,7 +855,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
* @param req
|
* @param req
|
||||||
* @param affiliateMap
|
* @param affiliateMap
|
||||||
*/
|
*/
|
||||||
private void accept(MsCaseApplication application, MsCaseApplication req, Map<Long, MsCaseAffiliate> affiliateMap) {
|
@Transactional
|
||||||
|
public void accept(MsCaseApplication application, MsCaseApplication req, Map<Long, MsCaseAffiliate> affiliateMap) {
|
||||||
application.setPaperFlag(req.getPaperFlag());
|
application.setPaperFlag(req.getPaperFlag());
|
||||||
application.setArbitrateConfirm(req.getArbitrateConfirm());
|
application.setArbitrateConfirm(req.getArbitrateConfirm());
|
||||||
application.setMediationMethod(req.getMediationMethod());
|
application.setMediationMethod(req.getMediationMethod());
|
||||||
@@ -796,7 +864,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
application.setUpdateTime(new Date());
|
application.setUpdateTime(new Date());
|
||||||
application.setBatchNumber(null);
|
application.setBatchNumber(null);
|
||||||
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||||
MsCaseFlow caseFlow = nextFlow(application.getId(), req.getCaseFlowId(),req.getLockStatus());
|
MsCaseFlow caseFlow = caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(),req.getLockStatus());
|
||||||
// 给申请人被申请人发送短信
|
// 给申请人被申请人发送短信
|
||||||
if (affiliateMap.containsKey(application.getId())) {
|
if (affiliateMap.containsKey(application.getId())) {
|
||||||
MsCaseAffiliate affiliate = affiliateMap.get(application.getId());
|
MsCaseAffiliate affiliate = affiliateMap.get(application.getId());
|
||||||
@@ -846,12 +914,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
return AjaxResult.error("该批次号下未找到案件");
|
return AjaxResult.error("该批次号下未找到案件");
|
||||||
}
|
}
|
||||||
for (MsCaseApplication application : list) {
|
for (MsCaseApplication application : list) {
|
||||||
MsCaseFlow caseFlow = nextFlow(application.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
|
MsCaseFlow caseFlow = caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
|
||||||
// todo 发送短信
|
// todo 发送短信
|
||||||
// CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
|
// CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
MsCaseFlow caseFlow = nextFlow(req.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
|
MsCaseFlow caseFlow = caseApplicationService.nextFlow(req.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
|
||||||
// todo 发送短信
|
// todo 发送短信
|
||||||
// CaseLogUtils.insertCaseLog(req.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
|
// CaseLogUtils.insertCaseLog(req.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
|
||||||
|
|
||||||
@@ -927,13 +995,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
msCaseMediatorMapper.deleteByExample(mediatorExample);
|
msCaseMediatorMapper.deleteByExample(mediatorExample);
|
||||||
|
|
||||||
// 获取选择的调解员id
|
// 获取选择的调解员id
|
||||||
List<Long> userIds = vo.getUserList().stream().map(SysUser::getUserId).collect(Collectors.toList());
|
List<Long> userIds = vo.getMediatorList().stream().map(MsCaseMediator::getMediatorId).collect(Collectors.toList());
|
||||||
// 新增案件预约表
|
// 新增案件预约表
|
||||||
for (SysUser sysUser : vo.getUserList()) {
|
for (MsCaseMediator sysUser : vo.getMediatorList()) {
|
||||||
MsCaseMediator mediator = new MsCaseMediator();
|
MsCaseMediator mediator = new MsCaseMediator();
|
||||||
mediator.setCaseAppliId(vo.getId());
|
mediator.setCaseAppliId(vo.getId());
|
||||||
mediator.setMediatorId(sysUser.getUserId());
|
mediator.setMediatorId(sysUser.getMediatorId());
|
||||||
mediator.setMediatorName(sysUser.getNickName());
|
mediator.setMediatorName(sysUser.getMediatorName());
|
||||||
mediator.setType(miniProgressFlag);
|
mediator.setType(miniProgressFlag);
|
||||||
msCaseMediatorMapper.insert(mediator);
|
msCaseMediatorMapper.insert(mediator);
|
||||||
}
|
}
|
||||||
@@ -946,13 +1014,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
if (StrUtil.isEmpty(msCaseAffiliate.getRespondentIdentityNum())) {
|
if (StrUtil.isEmpty(msCaseAffiliate.getRespondentIdentityNum())) {
|
||||||
return AjaxResult.error("被申请人身份证为空");
|
return AjaxResult.error("被申请人身份证为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
// SysUser user = userMapper.selectUserByIdCard(msCaseAffiliate.getRespondentIdentityNum());
|
|
||||||
// 被申请人存在
|
|
||||||
// if (user != null) {
|
|
||||||
// 判断被申请人信息查询案件预约表
|
// 判断被申请人信息查询案件预约表
|
||||||
isReservation( vo,userIds);
|
isReservation( vo,userIds);
|
||||||
// }
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 被申请人预约
|
// 被申请人预约
|
||||||
@@ -961,12 +1024,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
if (StrUtil.isEmpty(msCaseAffiliate.getContactTelphoneAgent())) {
|
if (StrUtil.isEmpty(msCaseAffiliate.getContactTelphoneAgent())) {
|
||||||
return AjaxResult.error("申请代理人手机号为空");
|
return AjaxResult.error("申请代理人手机号为空");
|
||||||
}
|
}
|
||||||
|
// 判断申请人是否预约
|
||||||
// SysUser user = userMapper.selectUserByPhone(msCaseAffiliate.getContactTelphoneAgent());
|
caseApplicationService. isReservation( vo,userIds);
|
||||||
// if(user!=null){
|
|
||||||
// 判断申请人是否预约
|
|
||||||
isReservation( vo,userIds);
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
@@ -977,7 +1036,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
* @param vo
|
* @param vo
|
||||||
* @param userIds 选择的调解员ids
|
* @param userIds 选择的调解员ids
|
||||||
*/
|
*/
|
||||||
private void isReservation( BookingVO vo, List<Long> userIds ) {
|
@Transactional
|
||||||
|
public void isReservation( BookingVO vo, List<Long> userIds ) {
|
||||||
// 查询所有调解员
|
// 查询所有调解员
|
||||||
List<SysUser> mediatorUsers = sysUserMapper.selectUserByRole("调解员");
|
List<SysUser> mediatorUsers = sysUserMapper.selectUserByRole("调解员");
|
||||||
if (CollectionUtil.isEmpty(mediatorUsers)) {
|
if (CollectionUtil.isEmpty(mediatorUsers)) {
|
||||||
@@ -1055,32 +1115,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置调解员调解时间
|
|
||||||
* @param application
|
|
||||||
* @param vo
|
|
||||||
*/
|
|
||||||
// private void setMediatorAndDate(MsCaseApplication application, BookingVO vo) {
|
|
||||||
// if(CollectionUtil.isNotEmpty(vo.getUserList())) {
|
|
||||||
// List<SysUser> userList = vo.getUserList();
|
|
||||||
// List<Long> userIds = userList.stream().map(SysUser::getUserId).collect(Collectors.toList());
|
|
||||||
// List<String> userNames = userList.stream().map(SysUser::getUserName).collect(Collectors.toList());
|
|
||||||
// String mediatorIds = StrUtil.join(",", userIds);
|
|
||||||
// String mediatorNames = StrUtil.join(",", userNames);
|
|
||||||
// application.setMediatorId(mediatorIds);
|
|
||||||
// application.setMediatorName(mediatorNames);
|
|
||||||
// }
|
|
||||||
// if(CollectionUtil.isNotEmpty( vo.getHerDates())) {
|
|
||||||
// String herDates = StrUtil.join(",", vo.getHerDates());
|
|
||||||
// application.setHearDate(herDates);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 核实调解员
|
* 核实调解员
|
||||||
* @param vo
|
* @param vo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult verifyMediator(BookingVO vo) {
|
public AjaxResult verifyMediator(BookingVO vo) {
|
||||||
if(StrUtil.isNotEmpty(vo.getBatchNumber())){
|
if(StrUtil.isNotEmpty(vo.getBatchNumber())){
|
||||||
@@ -1099,12 +1140,39 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
}
|
}
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 核实调解员
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public void verifyMediator(MsCaseApplication application,BookingVO vo) {
|
||||||
|
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(vo.getCaseFlowId());
|
||||||
|
if (nextFlow == null) {
|
||||||
|
throw new ServiceException("未找到下一个流程节点");
|
||||||
|
}
|
||||||
|
if(vo.getMediatorId()!=null) {
|
||||||
|
// setMediatorAndDate(application,vo);
|
||||||
|
application.setMediatorId(vo.getMediatorId());
|
||||||
|
application.setMediatorName(vo.getMediatorName());
|
||||||
|
}
|
||||||
|
if(CollectionUtil.isNotEmpty(vo.getHerDates())){
|
||||||
|
application.setHearDate(vo.getHerDates().get(0));
|
||||||
|
}
|
||||||
|
application.setCaseFlowId(nextFlow.getNodeId());
|
||||||
|
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
||||||
|
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||||
|
// todo 发送短信
|
||||||
|
// 新增日志
|
||||||
|
CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "");
|
||||||
|
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 查询预约信息
|
* 查询预约信息
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult selectReservation(Long id) {
|
public AjaxResult selectReservation(Long id) {
|
||||||
// 查询案件主表
|
// 查询案件主表
|
||||||
@@ -1122,43 +1190,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
Map<Integer, List<MsCaseMediator>> mediatorMap = msCaseMediators.stream().collect(Collectors.groupingBy(MsCaseMediator::getType));
|
Map<Integer, List<MsCaseMediator>> mediatorMap = msCaseMediators.stream().collect(Collectors.groupingBy(MsCaseMediator::getType));
|
||||||
// 申请人
|
// todo 申请人
|
||||||
result.setMediatorList(mediatorMap.get(MediatorTypeEnum.PC.getCode()));
|
result.setMediatorList(mediatorMap.get(MediatorTypeEnum.PC.getCode()));
|
||||||
result.setResMediatorList(mediatorMap.get(MediatorTypeEnum.MI_NI_PROGRESS.getCode()));
|
result.setResMediatorList(mediatorMap.get(MediatorTypeEnum.MI_NI_PROGRESS.getCode()));
|
||||||
|
|
||||||
// 查询用户
|
|
||||||
// SysUser user = userMapper.selectUserById(Long.valueOf(msCaseMediator.getMediatorId()));
|
|
||||||
// if(user==null){
|
|
||||||
// return AjaxResult.error("调解员已被删除");
|
|
||||||
// }
|
|
||||||
// // 查询待办数量
|
|
||||||
// List<Long> mediatorIds = new ArrayList<>();
|
|
||||||
// mediatorIds.add(user.getUserId());
|
|
||||||
// Map<Long, List<MsCaseApplication>> caseMap=null;
|
|
||||||
// List<MsCaseApplication> caseApplicationList = msCaseApplicationMapper.listMediator(mediatorIds);
|
|
||||||
// if (CollectionUtil.isNotEmpty(caseApplicationList)) {
|
|
||||||
// caseMap = caseApplicationList.stream().collect(Collectors.groupingBy(MsCaseApplication::getMediatorId, Collectors.toList()));
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// MediatorVO mediatorVO = new MediatorVO();
|
|
||||||
// mediatorVO.setMediatorId(user.getUserId());
|
|
||||||
// mediatorVO.setMediatorName(user.getNickName());
|
|
||||||
// mediatorVO.setSpecialty(user.getSpecialty());
|
|
||||||
// if(caseMap==null){
|
|
||||||
// mediatorVO.setTodoAmount(0L);
|
|
||||||
// mediatorVO.setCompleteAmount(0L);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// else if(caseMap.containsKey(String.valueOf(user.getUserId()))) {
|
|
||||||
// List<MsCaseApplication> applications = caseMap.get(String.valueOf(user.getUserId()));
|
|
||||||
// // 已办案件
|
|
||||||
// long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count();
|
|
||||||
// mediatorVO.setTodoAmount(applications.size()-count);
|
|
||||||
// mediatorVO.setCompleteAmount(count);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1170,36 +1204,50 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult mediation(MsCaseApplicationReq req) {
|
public AjaxResult mediation(MsCaseApplicationReq req) {
|
||||||
String templateId=null;
|
// 查询案件是否存在
|
||||||
// 批量
|
MsCaseApplication application = msCaseApplicationMapper.selectByPrimaryKey(req.getId());
|
||||||
if(StrUtil.isNotEmpty(req.getBatchNumber())){
|
if (application == null) {
|
||||||
// 查询调解书模板是否存在
|
return AjaxResult.error("未找到案件");
|
||||||
Example example = new Example(MsCaseApplication.class);
|
}
|
||||||
Example.Criteria criteria = example.createCriteria();
|
if (StrUtil.isEmpty(application.getMediationMethod())) {
|
||||||
criteria.andEqualTo("batchNumber", req.getBatchNumber());
|
return AjaxResult.error("未选择调解方式");
|
||||||
criteria.andIsNotNull("templateId");
|
}
|
||||||
MsCaseApplication caseApplication = msCaseApplicationMapper.selectOneByExample(example);
|
if (application.getMediationMethod().equals("1")) {
|
||||||
if(caseApplication==null||caseApplication.getTemplateId()==null){
|
// 线上调解
|
||||||
|
if (application.getTemplateId() == null) {
|
||||||
return AjaxResult.error("未找到模板");
|
return AjaxResult.error("未找到模板");
|
||||||
}
|
}
|
||||||
templateId= String.valueOf(caseApplication.getTemplateId());
|
String templateId = String.valueOf(application.getTemplateId());
|
||||||
|
req.setTemplateId(templateId);
|
||||||
|
req.setTemplateType(1);
|
||||||
|
AjaxResult result = generateApplication(req);
|
||||||
|
if (result != null && result.isSuccess()) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 线下调解
|
||||||
|
List<MsCaseAttach> attachList = req.getAttachList();
|
||||||
|
if(CollectionUtil.isEmpty(attachList)){
|
||||||
|
return AjaxResult.error("请上传调解资料");
|
||||||
|
}
|
||||||
|
for (MsCaseAttach attach : attachList) {
|
||||||
|
attach.setCaseAppliId(req.getId());
|
||||||
|
}
|
||||||
|
msCaseAttachMapper.batchSave(attachList);
|
||||||
|
// 修改案件状态为待送达
|
||||||
|
Example flowExample = new Example(MsCaseFlow.class);
|
||||||
|
flowExample.createCriteria().andEqualTo("caseStatusName", "待送达");
|
||||||
|
MsCaseFlow caseFlow = caseFlowMapper.selectOneByExample(flowExample);
|
||||||
|
if(caseFlow != null){
|
||||||
|
application.setCaseFlowId(caseFlow.getId());
|
||||||
|
application.setCaseStatusName(caseFlow.getCaseStatusName());
|
||||||
|
msCaseApplicationMapper.updateByPrimaryKey(application);
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
}else {
|
|
||||||
// 单独生成
|
return AjaxResult.error();
|
||||||
// 查询调解书模板是否存在
|
|
||||||
MsCaseApplication application = msCaseApplicationMapper.selectByPrimaryKey(req.getId());
|
|
||||||
if(application==null||application.getTemplateId()==null){
|
|
||||||
return AjaxResult.error("未找到模板");
|
|
||||||
}
|
|
||||||
templateId= String.valueOf(application.getTemplateId());
|
|
||||||
}
|
|
||||||
req.setTemplateId(templateId);
|
|
||||||
req.setTemplateType(1);
|
|
||||||
AjaxResult result = generateApplication(req);
|
|
||||||
if(result!=null && result.isSuccess()){
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
return AjaxResult.error("生成失败");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1232,7 +1280,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
}
|
}
|
||||||
// todo 发送短信
|
// todo 发送短信
|
||||||
// 更新流程节点
|
// 更新流程节点
|
||||||
nextFlow(attach.getCaseAppliId(),attach.getCaseFlowId(),YesOrNoEnum.YES.getCode());
|
caseApplicationService.nextFlow(attach.getCaseAppliId(),attach.getCaseFlowId(),YesOrNoEnum.YES.getCode());
|
||||||
|
|
||||||
Long id = attach.getCaseAppliId();
|
Long id = attach.getCaseAppliId();
|
||||||
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
||||||
@@ -1901,29 +1949,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 核实调解员
|
|
||||||
* @param
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private void verifyMediator(MsCaseApplication application,BookingVO vo) {
|
|
||||||
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(vo.getCaseFlowId());
|
|
||||||
if (nextFlow == null) {
|
|
||||||
throw new ServiceException("未找到下一个流程节点");
|
|
||||||
}
|
|
||||||
// setMediatorAndDate(application,vo);
|
|
||||||
application.setMediatorId(vo.getMediatorId());
|
|
||||||
application.setMediatorName(vo.getMediatorName());
|
|
||||||
application.setCaseFlowId(nextFlow.getNodeId());
|
|
||||||
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
||||||
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
||||||
// todo 发送短信
|
|
||||||
// 新增日志
|
|
||||||
CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流向下一个流程节点
|
* 流向下一个流程节点
|
||||||
@@ -1932,6 +1957,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
* @param lockStatus '是否锁定,0-否,1-是',单独操作案件时需要锁定
|
* @param lockStatus '是否锁定,0-否,1-是',单独操作案件时需要锁定
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public MsCaseFlow nextFlow(Long caseId,Integer caseFlowId,Integer lockStatus) {
|
public MsCaseFlow nextFlow(Long caseId,Integer caseFlowId,Integer lockStatus) {
|
||||||
// 查询当前流程节点
|
// 查询当前流程节点
|
||||||
@@ -1964,7 +1990,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
* @param bookmarkList 标签
|
* @param bookmarkList 标签
|
||||||
* @param dictDataList 内置字段
|
* @param dictDataList 内置字段
|
||||||
*/
|
*/
|
||||||
private void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList,Integer templateType) {
|
@Transactional
|
||||||
|
public void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList,Integer templateType) {
|
||||||
// 申请书需要的字段和内容,valueMap<占位符,替换的值>
|
// 申请书需要的字段和内容,valueMap<占位符,替换的值>
|
||||||
Map<String, String> valueMap = new HashMap<>();
|
Map<String, String> valueMap = new HashMap<>();
|
||||||
for (SysDictData dictData : dictDataList) {
|
for (SysDictData dictData : dictDataList) {
|
||||||
@@ -2018,7 +2045,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
msCaseAttachMapper.save(caseAttach);
|
msCaseAttachMapper.save(caseAttach);
|
||||||
// 生成调解书成功,需要更新流程节点
|
// 生成调解书成功,需要更新流程节点
|
||||||
if (templateType!=null&&templateType==1) {
|
if (templateType!=null&&templateType==1) {
|
||||||
nextFlow(application.getId(), application.getCaseFlowId(), application.getLockStatus());
|
caseApplicationService.nextFlow(application.getId(), application.getCaseFlowId(), application.getLockStatus());
|
||||||
// todo 发送短信
|
// todo 发送短信
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2086,16 +2113,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 上传
|
// 上传
|
||||||
// String filePath = RuoYiConfig.getUploadPath();
|
|
||||||
MsCaseAttach caseAttach = new MsCaseAttach();
|
MsCaseAttach caseAttach = new MsCaseAttach();
|
||||||
caseAttach.setCaseAppliId(caseApplication.getId());
|
caseAttach.setCaseAppliId(caseApplication.getId());
|
||||||
caseAttach.setAnnexPath(fileUrl.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX));
|
caseAttach.setAnnexPath(fileUrl.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX));
|
||||||
caseAttach.setAnnexName(entry.getKey());
|
caseAttach.setAnnexName(entry.getKey());
|
||||||
// todo
|
|
||||||
// if (StrUtil.isNotEmpty(fileUrl)) {
|
|
||||||
// String fileName = fileUrl.replace(filePath, "/profile/upload");
|
|
||||||
// caseAttach.setAnnexName(entry.getKey());
|
|
||||||
// }
|
|
||||||
// 申请人提供的证据材料
|
// 申请人提供的证据材料
|
||||||
caseAttach.setAnnexType(AnnexTypeEnum.APPLICATION_EVIDENCE.getCode());
|
caseAttach.setAnnexType(AnnexTypeEnum.APPLICATION_EVIDENCE.getCode());
|
||||||
attachList.add(caseAttach);
|
attachList.add(caseAttach);
|
||||||
@@ -2263,37 +2284,79 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
agentUser.setNickName(affiliate.getNameAgent());
|
agentUser.setNickName(affiliate.getNameAgent());
|
||||||
agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
|
agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
|
||||||
agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
||||||
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
|
// agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
|
||||||
userMapper.insertUser(agentUser);
|
userMapper.insertUser(agentUser);
|
||||||
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
|
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
|
||||||
// 新增部门用户关联表
|
// 新增部门用户关联表
|
||||||
// sysUserMapper.insertUser()
|
SysUserDept sysUserDept = new SysUserDept();
|
||||||
} else if (null == agentUser.getDeptId() ) {
|
sysUserDept.setUserId(agentUser.getUserId());
|
||||||
// todo 未关联部门,关联部门
|
sysUserDept.setDeptId(Long.valueOf(affiliate.getApplicationId()));
|
||||||
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
|
userDeptMapper.insert(sysUserDept);
|
||||||
userMapper.updateUser(agentUser);
|
// 发送短信 2064355 调解系统自动创建用户短信通知 尊敬的用户,您的案件已经创建,请使用账号为{1},密码为{2}登录调解系统,请知晓,如非本人操作,请忽略本短信。
|
||||||
}else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationId())) {
|
Boolean smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2064355", affiliate.getContactTelphoneAgent(), new String[]{affiliate.getContactTelphoneAgent(), "abc123456"});
|
||||||
if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) {
|
} else {
|
||||||
throw new ServiceException("该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确");
|
// 查询所有部门
|
||||||
} else {
|
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
||||||
throw new ServiceException("该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确");
|
Map<String, List<SysDept>> deptMap=new HashMap<>();
|
||||||
}
|
if(CollectionUtil.isNotEmpty(sysDepts)){
|
||||||
} else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationId())) {
|
deptMap = sysDepts.stream().collect(Collectors.groupingBy(SysDept::getDeptName));
|
||||||
// 同步用户表和案件关联人表的手机号和名称
|
|
||||||
affiliate.setContactTelphoneAgent(StrUtil.isNotEmpty(agentUser.getPhonenumber()) ? agentUser.getPhonenumber() : affiliate.getContactTelphoneAgent());
|
|
||||||
affiliate.setNameAgent(agentUser.getNickName());
|
|
||||||
affiliate.setAgentEmail(StrUtil.isNotEmpty(agentUser.getEmail()) ? agentUser.getEmail() : affiliate.getAgentEmail());
|
|
||||||
List<Long> longList = new ArrayList<>();
|
|
||||||
// 新增角色为申请人
|
|
||||||
if (CollectionUtil.isNotEmpty(agentUser.getRoles())) {
|
|
||||||
longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
|
|
||||||
if (!longList.contains(roleId)) {
|
|
||||||
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!deptMap.containsKey(affiliate.getApplicationName())){
|
||||||
|
// 如果不存在则新增
|
||||||
|
SysDept dept = new SysDept();
|
||||||
|
dept.setParentId(0L);
|
||||||
|
dept.setDeptName(affiliate.getApplicationName());
|
||||||
|
dept.setAncestors("0");
|
||||||
|
dept.setOrderNum(1);
|
||||||
|
dept.setStatus("0");
|
||||||
|
dept.setDelFlag("0");
|
||||||
|
dept.setCreateBy(getUsername());
|
||||||
|
dept.setUpdateBy(getUsername());
|
||||||
|
sysDeptMapper.insertDept(dept);
|
||||||
|
List<SysDept> depts = new ArrayList<>();
|
||||||
|
depts.add(dept);
|
||||||
|
deptMap.put(dept.getDeptName(), depts);
|
||||||
|
affiliate.setApplicationId(String.valueOf(dept.getDeptId()));
|
||||||
|
affiliate.setApplicationName(affiliate.getApplicationName());
|
||||||
|
}else {
|
||||||
|
// 将组织机构id设为申请人名称
|
||||||
|
affiliate.setApplicationId(deptMap.get(affiliate.getApplicationName()).get(0).getDeptId().toString());
|
||||||
|
affiliate.setApplicationName(affiliate.getApplicationName());
|
||||||
|
}
|
||||||
|
// 根据userId查询部门
|
||||||
|
List<SysUserDept> userDeptList = userDeptMapper.selectUserDeptById(agentUser.getUserId());
|
||||||
|
if(CollectionUtil.isEmpty(userDeptList)){
|
||||||
|
// 未关联部门,关联部门,新增部门用户关联表
|
||||||
|
SysUserDept sysUserDept = new SysUserDept();
|
||||||
|
sysUserDept.setUserId(agentUser.getUserId());
|
||||||
|
sysUserDept.setDeptId(Long.valueOf(affiliate.getApplicationId()));
|
||||||
|
userDeptMapper.insert(sysUserDept);
|
||||||
|
}else {
|
||||||
|
List<Long> deptIdList = userDeptList.stream().map(SysUserDept::getDeptId).collect(Collectors.toList());
|
||||||
|
if(!deptIdList.contains(Long.valueOf(affiliate.getApplicationId()))){
|
||||||
|
// 未关联该部门,关联部门,新增部门用户关联表
|
||||||
|
SysUserDept sysUserDept = new SysUserDept();
|
||||||
|
sysUserDept.setUserId(agentUser.getUserId());
|
||||||
|
sysUserDept.setDeptId(Long.valueOf(affiliate.getApplicationId()));
|
||||||
|
userDeptMapper.insert(sysUserDept);
|
||||||
|
// 同步用户表和案件关联人表的手机号和名称
|
||||||
|
affiliate.setContactTelphoneAgent(StrUtil.isNotEmpty(agentUser.getPhonenumber()) ? agentUser.getPhonenumber() : affiliate.getContactTelphoneAgent());
|
||||||
|
affiliate.setNameAgent(agentUser.getNickName());
|
||||||
|
affiliate.setAgentEmail(StrUtil.isNotEmpty(agentUser.getEmail()) ? agentUser.getEmail() : affiliate.getAgentEmail());
|
||||||
|
List<Long> longList = new ArrayList<>();
|
||||||
|
// 新增角色为申请人
|
||||||
|
if (CollectionUtil.isNotEmpty(agentUser.getRoles())) {
|
||||||
|
longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
|
||||||
|
if (!longList.contains(roleId)) {
|
||||||
|
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2303,7 +2366,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|||||||
* @param affiliate
|
* @param affiliate
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
void insertDept(MsCaseAffiliate affiliate) {
|
public void insertDept(MsCaseAffiliate affiliate) {
|
||||||
// 查询所有的组织机构,组装成map
|
// 查询所有的组织机构,组装成map
|
||||||
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
||||||
if (CollectionUtil.isEmpty(deptList)) {
|
if (CollectionUtil.isEmpty(deptList)) {
|
||||||
|
|||||||
+3
-4
@@ -5,9 +5,9 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
||||||
import com.ruoyi.common.constant.FileTransformation;
|
import com.ruoyi.common.constant.FileTransformation;
|
||||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||||
|
import com.ruoyi.common.enums.AnnexTypeEnum;
|
||||||
import com.ruoyi.common.exception.EsignDemoException;
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||||
@@ -27,7 +27,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import tk.mybatis.mapper.entity.Example;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -119,7 +118,7 @@ public class FixSelectFlowDetailUtils {
|
|||||||
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
||||||
if (downLoadFile) {
|
if (downLoadFile) {
|
||||||
MsCaseAttach caseAttach = new MsCaseAttach();
|
MsCaseAttach caseAttach = new MsCaseAttach();
|
||||||
caseAttach.setAnnexType(10); //10代表印章图片
|
caseAttach.setAnnexType(AnnexTypeEnum.SEAL_PICTURE.getCode()); //10代表印章图片
|
||||||
caseAttach.setAnnexPath(savePath);
|
caseAttach.setAnnexPath(savePath);
|
||||||
caseAttach.setAnnexName(saveName);
|
caseAttach.setAnnexName(saveName);
|
||||||
int i1 = caseAttachMapper.save(caseAttach);
|
int i1 = caseAttachMapper.save(caseAttach);
|
||||||
@@ -214,7 +213,7 @@ public class FixSelectFlowDetailUtils {
|
|||||||
boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
|
boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
|
||||||
if (downLoadFile) {
|
if (downLoadFile) {
|
||||||
MsCaseAttach caseAttach = new MsCaseAttach();
|
MsCaseAttach caseAttach = new MsCaseAttach();
|
||||||
caseAttach.setAnnexType(10); //10代表印章图片
|
caseAttach.setAnnexType(AnnexTypeEnum.SEAL_PICTURE.getCode()); //10代表印章图片
|
||||||
caseAttach.setAnnexPath(savePath);
|
caseAttach.setAnnexPath(savePath);
|
||||||
caseAttach.setAnnexName(saveName);
|
caseAttach.setAnnexName(saveName);
|
||||||
int i1 = caseAttachMapper.save(caseAttach);
|
int i1 = caseAttachMapper.save(caseAttach);
|
||||||
|
|||||||
@@ -91,6 +91,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
select u.dept_id from ms_sys_user_role r
|
select u.dept_id from ms_sys_user_role r
|
||||||
join ms_sys_user u on r.role_id=#{roleId} and r.user_id=u.user_id
|
join ms_sys_user u on r.role_id=#{roleId} and r.user_id=u.user_id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectDeptByUserId" resultMap="SysDeptResult">
|
||||||
|
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_type,d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
|
||||||
|
from ms_sys_dept d join ms_sys_user_dept ud on ud.dept_id=d.dept_id
|
||||||
|
where ud.user_id=#{userId} and d.del_flag = '0'
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertDept" parameterType="com.ruoyi.common.core.domain.entity.SysDept" useGeneratedKeys="true" keyColumn="dept_id" keyProperty="deptId">
|
<insert id="insertDept" parameterType="com.ruoyi.common.core.domain.entity.SysDept" useGeneratedKeys="true" keyColumn="dept_id" keyProperty="deptId">
|
||||||
insert into ms_sys_dept(
|
insert into ms_sys_dept(
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectUserById" parameterType="Long" resultMap="resultMap">
|
<select id="selectUserDeptById" resultMap="resultMap">
|
||||||
select * from ms_sys_user_dept
|
select * from ms_sys_user_dept
|
||||||
where user_id = #{userId}
|
where user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<insert id="insert" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept">
|
<insert id="insert" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept">
|
||||||
insert into ms_sys_user_dept(
|
insert into ms_sys_user_dept(
|
||||||
user_id,
|
user_id,
|
||||||
dept_id
|
dept_id
|
||||||
@@ -43,11 +43,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
<delete id="deleteUserById" parameterType="Long">
|
<delete id="deleteUserById" >
|
||||||
delete from ms_sys_user_dept where user_id = #{userId}
|
delete from ms_sys_user_dept where user_id = #{userId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteUserByIds" parameterType="Long">
|
<delete id="deleteUserByIds">
|
||||||
delete from ms_sys_user_dept where user_id in
|
delete from ms_sys_user_dept where user_id in
|
||||||
<foreach collection="ids" item="userId" open="(" separator="," close=")">
|
<foreach collection="ids" item="userId" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<resultMap type="com.ruoyi.common.core.domain.entity.SysUser" id="SysUserResult">
|
<resultMap type="com.ruoyi.common.core.domain.entity.SysUser" id="SysUserResult">
|
||||||
<id property="userId" column="user_id" />
|
<id property="userId" column="user_id" />
|
||||||
<result property="deptId" column="dept_id" />
|
|
||||||
<result property="userName" column="user_name" />
|
<result property="userName" column="user_name" />
|
||||||
<result property="nickName" column="nick_name" />
|
<result property="nickName" column="nick_name" />
|
||||||
<result property="idCard" column="id_card" />
|
<result property="idCard" column="id_card" />
|
||||||
@@ -25,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
<result property="specialty" column="specialty" />
|
<result property="specialty" column="specialty" />
|
||||||
<association property="dept" javaType="com.ruoyi.common.core.domain.entity.SysDept" resultMap="deptResult" />
|
<collection property="dept" javaType="com.ruoyi.common.core.domain.entity.SysDept" resultMap="deptResult" />
|
||||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
@@ -50,20 +49,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectUserVo">
|
<sql id="selectUserVo">
|
||||||
select u.user_id, u.dept_id, u.user_name, u.nick_name,u.specialty, 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,
|
select u.user_id, u.user_name, u.nick_name,u.specialty, 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,
|
||||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
|
||||||
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
|
||||||
from ms_sys_user u
|
from ms_sys_user u
|
||||||
left join ms_sys_dept d on u.dept_id = d.dept_id
|
|
||||||
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
||||||
left join ms_sys_role r on r.role_id = ur.role_id
|
left join ms_sys_role r on r.role_id = ur.role_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
|
<select id="selectUserList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
|
||||||
select u.user_id, u.dept_id, u.nick_name, u.user_name,u.specialty,u.id_card, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name,
|
select u.user_id, u.nick_name, u.user_name,u.specialty,u.id_card, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||||
d.leader , r.role_id, r.role_name, d.dept_id
|
r.role_id, r.role_name
|
||||||
from ms_sys_user u
|
from ms_sys_user u
|
||||||
left join ms_sys_dept d on u.dept_id = d.dept_id
|
|
||||||
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
||||||
left join ms_sys_role r on r.role_id = ur.role_id
|
left join ms_sys_role r on r.role_id = ur.role_id
|
||||||
where u.del_flag = '0'
|
where u.del_flag = '0'
|
||||||
@@ -85,17 +82,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId != null and deptId != 0">
|
|
||||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM ms_sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
|
||||||
</if>
|
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
${params.dataScope}
|
${params.dataScope}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAllocatedList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
|
<select id="selectAllocatedList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
|
||||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name,u.specialty,u.id_card, u.email, u.phonenumber, u.status, u.create_time
|
select distinct u.user_id, u.user_name, u.nick_name,u.specialty,u.id_card, u.email, u.phonenumber, u.status, u.create_time
|
||||||
from ms_sys_user u
|
from ms_sys_user u
|
||||||
left join ms_sys_dept d on u.dept_id = d.dept_id
|
|
||||||
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
||||||
left join ms_sys_role r on r.role_id = ur.role_id
|
left join ms_sys_role r on r.role_id = ur.role_id
|
||||||
where u.del_flag = '0' and r.role_id = #{roleId}
|
where u.del_flag = '0' and r.role_id = #{roleId}
|
||||||
@@ -110,9 +105,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUnallocatedList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
|
<select id="selectUnallocatedList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
|
||||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name,u.specialty,u.id_card, u.email, u.phonenumber, u.status, u.create_time
|
select distinct u.user_id, u.user_name, u.nick_name,u.specialty,u.id_card, u.email, u.phonenumber, u.status, u.create_time
|
||||||
from ms_sys_user u
|
from ms_sys_user u
|
||||||
left join ms_sys_dept d on u.dept_id = d.dept_id
|
|
||||||
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
||||||
left join ms_sys_role r on r.role_id = ur.role_id
|
left join ms_sys_role r on r.role_id = ur.role_id
|
||||||
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
|
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
|
||||||
@@ -139,10 +133,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectUserByDeptId" parameterType="Long" resultMap="SysUserResult">
|
<select id="selectUserByDeptId" parameterType="Long" resultMap="SysUserResult">
|
||||||
SELECT ud.user_id , ud.nick_name ,u.specialty,ud.phonenumber ,ud.dept_id ,d.dept_name
|
SELECT ud.user_id , ud.nick_name ,u.specialty,ud.phonenumber ,ud.dept_id ,d.dept_name
|
||||||
FROM (SELECT u.user_id , u.nick_name ,u.phonenumber ,u.dept_id
|
FROM (SELECT u.user_id , u.nick_name ,u.phonenumber ,ud.dept_id
|
||||||
FROM ms_sys_user_post up left join ms_sys_user u on u.user_id = up.user_id
|
FROM ms_sys_user_post up left join ms_sys_user u on u.user_id = up.user_id
|
||||||
|
left join ms_sys_user_dept ud on ud.user_id = u.user_id
|
||||||
left join ms_sys_post sp on up.post_id = sp.post_id
|
left join ms_sys_post sp on up.post_id = sp.post_id
|
||||||
where sp.post_code = 'jbr') ud left join ms_sys_dept d on ud.dept_id = d.dept_id
|
where sp.post_code = 'jbr' and u.del_flag = '0') ud left join ms_sys_dept d on ud.dept_id = d.dept_id
|
||||||
where d.dept_id = #{deptId}
|
where d.dept_id = #{deptId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -173,9 +168,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUserByIdCard" parameterType="String" resultMap="SysUserResult">
|
<select id="selectUserByIdCard" parameterType="String" resultMap="SysUserResult">
|
||||||
select u.*,d.dept_name,ur.role_id
|
select u.*,ur.role_id
|
||||||
from ms_sys_user u
|
from ms_sys_user u
|
||||||
left join ms_sys_dept d on u.dept_id = d.dept_id
|
|
||||||
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
||||||
left join ms_sys_role r on r.role_id = ur.role_id
|
left join ms_sys_role r on r.role_id = ur.role_id
|
||||||
where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
|
where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
|
||||||
@@ -183,7 +178,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectUserByPhone" parameterType="String" resultMap="SysUserResult">
|
<select id="selectUserByPhone" parameterType="String" resultMap="SysUserResult">
|
||||||
select u.*,d.dept_name,ur.role_id
|
select u.*,d.dept_name,ur.role_id
|
||||||
from ms_sys_user u
|
from ms_sys_user u
|
||||||
left join ms_sys_dept d on u.dept_id = d.dept_id
|
|
||||||
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
||||||
left join ms_sys_role r on r.role_id = ur.role_id
|
left join ms_sys_role r on r.role_id = ur.role_id
|
||||||
where u.phonenumber = #{phone} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
|
where u.phonenumber = #{phone} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
|
||||||
@@ -191,16 +185,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectByDeptIdAndRole" resultMap="SysUserResult">
|
<select id="selectByDeptIdAndRole" resultMap="SysUserResult">
|
||||||
select u.* from
|
select u.* from
|
||||||
ms_sys_user u
|
ms_sys_user u
|
||||||
|
join ms_sys_user_dept ud on ud.user_id = u.user_id
|
||||||
join ms_sys_user_role ur on u.user_id = ur.user_id
|
join ms_sys_user_role ur on u.user_id = ur.user_id
|
||||||
|
|
||||||
join ms_sys_role r on ur.role_id = r.role_id
|
join ms_sys_role r on ur.role_id = r.role_id
|
||||||
where u.dept_id = #{deptId} and r.role_name = #{roleName} and u.del_flag = '0' and r.del_flag='0'
|
where ud.dept_id = #{deptId} and r.role_name = #{roleName} and u.del_flag = '0' and r.del_flag='0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<insert id="insertUser" parameterType="com.ruoyi.common.core.domain.entity.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
<insert id="insertUser" parameterType="com.ruoyi.common.core.domain.entity.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||||
insert into ms_sys_user(
|
insert into ms_sys_user(
|
||||||
<if test="userId != null and userId != 0">user_id,</if>
|
<if test="userId != null and userId != 0">user_id,</if>
|
||||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
<!-- <if test="deptId != null and deptId != 0">dept_id,</if> -->
|
||||||
<if test="userName != null and userName != ''">user_name,</if>
|
<if test="userName != null and userName != ''">user_name,</if>
|
||||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||||
<if test="idCard != null and idCard != ''">id_card,</if>
|
<if test="idCard != null and idCard != ''">id_card,</if>
|
||||||
@@ -216,113 +212,112 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
<if test="userId != null and userId != ''">#{userId},</if>
|
<if test="userId != null and userId != ''">#{userId},</if>
|
||||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
<!-- <if test="deptId != null and deptId != ''">#{deptId},</if> -->
|
||||||
<if test="userName != null and userName != ''">#{userName},</if>
|
<if test="userName != null and userName != ''">#{userName},</if>
|
||||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||||
<if test="idCard != null and idCard != ''">#{idCard},</if>
|
<if test="idCard != null and idCard != ''">#{idCard},</if>
|
||||||
<if test="email != null and email != ''">#{email},</if>
|
<if test="email != null and email != ''">#{email},</if>
|
||||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||||
<if test="sex != null and sex != ''">#{sex},</if>
|
<if test="sex != null and sex != ''">#{sex},</if>
|
||||||
<if test="password != null and password != ''">#{password},</if>
|
<if test="password != null and password != ''">#{password},</if>
|
||||||
<if test="status != null and status != ''">#{status},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
||||||
<if test="specialty != null and specialty != ''">#{specialty},</if>
|
<if test="specialty != null and specialty != ''">#{specialty},</if>
|
||||||
sysdate()
|
sysdate()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="batchSave">
|
<insert id="batchSave">
|
||||||
insert into ms_sys_user(
|
insert into ms_sys_user(
|
||||||
user_id,
|
user_id,
|
||||||
dept_id,
|
user_name,
|
||||||
user_name,
|
nick_name,
|
||||||
nick_name,
|
id_card,
|
||||||
id_card,
|
email,
|
||||||
email,
|
avatar,
|
||||||
avatar,
|
phonenumber,
|
||||||
phonenumber,
|
sex,
|
||||||
sex,
|
password,
|
||||||
password,
|
status,
|
||||||
status,
|
create_by,
|
||||||
create_by,
|
remark,
|
||||||
remark,
|
specialty,
|
||||||
specialty,
|
create_time
|
||||||
create_time
|
)values
|
||||||
)values
|
<foreach item="item" index="index" collection="list" separator=",">
|
||||||
<foreach item="item" index="index" collection="list" separator=",">
|
(
|
||||||
(
|
#{item.userId},
|
||||||
#{item.userId},
|
#{item.userName},
|
||||||
#{item.deptId},
|
#{item.nickName},
|
||||||
#{item.userName},
|
#{item.idCard},
|
||||||
#{item.nickName},
|
#{item.email},
|
||||||
#{item.idCard},
|
#{item.avatar},
|
||||||
#{item.email},
|
#{item.phonenumber},
|
||||||
#{item.avatar},
|
#{item.sex},
|
||||||
#{item.phonenumber},
|
#{item.password},
|
||||||
#{item.sex},
|
#{item.status},
|
||||||
#{item.password},
|
#{item.createBy},
|
||||||
#{item.status},
|
#{item.remark},
|
||||||
#{item.createBy},
|
#{item.specialty},
|
||||||
#{item.remark},
|
sysdate()
|
||||||
#{item.specialty},
|
)
|
||||||
sysdate()
|
</foreach>;
|
||||||
)
|
</insert>
|
||||||
</foreach>;
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="updateUser" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
|
<update id="updateUser" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
|
||||||
update ms_sys_user
|
update ms_sys_user
|
||||||
<set>
|
<set>
|
||||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
|
||||||
<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="email != null ">email = #{email},</if>
|
|
||||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
|
||||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
|
||||||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
|
||||||
<if test="password != null and password != ''">password = #{password},</if>
|
|
||||||
<if test="status != null and status != ''">status = #{status},</if>
|
|
||||||
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
|
||||||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
|
||||||
<if test="specialty != null">specialty = #{specialty},</if>
|
|
||||||
update_time = sysdate()
|
|
||||||
</set>
|
|
||||||
where user_id = #{userId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<update id="updateUserAvatar" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
|
|
||||||
update ms_sys_user set avatar = #{avatar} where user_name = #{userName}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<update id="resetUserPwd" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
|
|
||||||
update ms_sys_user set password = #{password} where user_name = #{userName}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="deleteUserById" parameterType="Long">
|
|
||||||
update ms_sys_user set del_flag = '2' where user_id = #{userId}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="deleteUserByIds" parameterType="Long">
|
|
||||||
update ms_sys_user set del_flag = '2' where user_id in
|
|
||||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
|
||||||
#{userId}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
<select id="selectRoleUserByDeptId" parameterType="long" resultMap="SysUserResult">
|
|
||||||
SELECT u.* FROM ms_sys_user u
|
|
||||||
INNER JOIN ms_sys_user_role ur ON u.user_id = ur.user_id
|
|
||||||
INNER JOIN ms_sys_dept d ON u.dept_id = d.dept_id
|
|
||||||
WHERE ur.role_id = #{roleId} AND d.dept_id = #{deptId};
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectUserByRole" resultType="com.ruoyi.common.core.domain.entity.SysUser">
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||||
select u.user_id userId,u.user_name userName,u.nick_name nickName,u.specialty from ms_sys_user u
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||||
join ms_sys_user_role ur on ur.user_id =u.user_id
|
<if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
|
||||||
join ms_sys_role r on ur.role_id = r.role_id and r.role_name='调解员'
|
<if test="email != null ">email = #{email},</if>
|
||||||
where r.del_flag = '0' and r.status='0' and u.del_flag = '0' and u.status='0'
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||||
</select>
|
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||||
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
||||||
|
<if test="password != null and password != ''">password = #{password},</if>
|
||||||
|
<if test="status != null and status != ''">status = #{status},</if>
|
||||||
|
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
||||||
|
<if test="loginDate != null">login_date = #{loginDate},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="specialty != null">specialty = #{specialty},</if>
|
||||||
|
update_time = sysdate()
|
||||||
|
</set>
|
||||||
|
where user_id = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateUserAvatar" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
|
||||||
|
update ms_sys_user set avatar = #{avatar} where user_name = #{userName}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="resetUserPwd" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
|
||||||
|
update ms_sys_user set password = #{password} where user_name = #{userName}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteUserById" parameterType="Long">
|
||||||
|
update ms_sys_user set del_flag = '2' where user_id = #{userId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteUserByIds" parameterType="Long">
|
||||||
|
update ms_sys_user set del_flag = '2' where user_id in
|
||||||
|
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||||
|
#{userId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
<select id="selectRoleUserByDeptId" parameterType="long" resultMap="SysUserResult">
|
||||||
|
SELECT u.* FROM ms_sys_user u
|
||||||
|
INNER JOIN ms_sys_user_role ur ON u.user_id = ur.user_id
|
||||||
|
INNER JOIN ms_sys_user_dept ud on ud.user_id = u.user_id
|
||||||
|
INNER join ms_sys_dept d on ud.dept_id = d.dept_id
|
||||||
|
WHERE ur.role_id = #{roleId} AND d.dept_id = #{deptId};
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectUserByRole" resultType="com.ruoyi.common.core.domain.entity.SysUser">
|
||||||
|
select u.user_id userId,u.user_name userName,u.nick_name nickName,u.specialty from ms_sys_user u
|
||||||
|
join ms_sys_user_role ur on ur.user_id =u.user_id
|
||||||
|
join ms_sys_role r on ur.role_id = r.role_id and r.role_name='调解员'
|
||||||
|
where r.del_flag = '0' and r.status='0' and u.del_flag = '0' and u.status='0'
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user