Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev
This commit was merged in pull request #113.
This commit is contained in:
@@ -5,10 +5,7 @@ import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
|
||||
import com.ruoyi.system.service.flow.CaseFlowService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
||||
|
||||
@@ -28,6 +25,13 @@ public class CaseFlowController {
|
||||
public Object queryCaseFlowInfo(@RequestBody MsCaseFlowSearchVO caseFlowSearchVO) {
|
||||
return caseFlowService.queryCaseFlowInfo(caseFlowSearchVO);
|
||||
}
|
||||
/**
|
||||
* 查询案件流程信息
|
||||
*/
|
||||
@GetMapping("/selectCaseFlow")
|
||||
public AjaxResult selectCaseFlow() {
|
||||
return caseFlowService.selectCaseFlow();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或编辑案件流程节点信息
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.digest.MD5;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginBody;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.framework.web.service.SysLoginService;
|
||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import com.ruoyi.system.service.flow.CaseFlowService;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
|
||||
@@ -12,15 +21,9 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginBody;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.framework.web.service.SysLoginService;
|
||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
@@ -43,6 +46,8 @@ public class SysLoginController {
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private CaseFlowService caseFlowService;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
/**
|
||||
* 登录方法
|
||||
*
|
||||
@@ -102,4 +107,19 @@ public class SysLoginController {
|
||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
||||
return AjaxResult.success(menuService.buildMenus(menus));
|
||||
}
|
||||
/**sso登录接口*/
|
||||
@PostMapping("login/sso")
|
||||
public AjaxResult loginSSO( @RequestBody LoginBody loginBody){
|
||||
if(StrUtil.isEmpty(loginBody.getUsername()) || StrUtil.isEmpty(loginBody.getTicket())
|
||||
|| StrUtil.isEmpty(loginBody.getRoleName()) ){
|
||||
return AjaxResult.error("参数错误");
|
||||
}
|
||||
return loginService.loginSSO(loginBody);
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println( MD5.create().digestHex("BMceshi" ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+17
-7
@@ -79,8 +79,18 @@ public class MsCaseApplicationController extends BaseController {
|
||||
if(caseApplication.getAffiliate()==null||caseApplication.getAffiliate().getOrganizeFlag()==null){
|
||||
error("参数校验失败");
|
||||
}
|
||||
AjaxResult ajaxResult = AjaxResult.success();
|
||||
ajaxResult.put("caseNum",caseApplicationService.insert(caseApplication));
|
||||
return ajaxResult;
|
||||
}
|
||||
/**
|
||||
* 批量新增案件
|
||||
*/
|
||||
@PostMapping("/batchInsert")
|
||||
public AjaxResult batchInsert(@RequestBody MsCaseBatchInsertVO list )
|
||||
{
|
||||
|
||||
return success(caseApplicationService.insert(caseApplication));
|
||||
return caseApplicationService.batchInsert(list);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,10 +100,10 @@ public class MsCaseApplicationController extends BaseController {
|
||||
public AjaxResult getInfoByIdCard(@RequestParam(value = "idCard" ,required = false) String idCard)
|
||||
{
|
||||
if(StrUtil.isEmpty(idCard)){
|
||||
error("身份证号不能为空");
|
||||
return error("身份证号不能为空");
|
||||
}
|
||||
if(!IdcardUtil.isValidCard(idCard)){
|
||||
error("身份证不合法,请输入正确的身份证号");
|
||||
return error("身份证不合法,请输入正确的身份证号");
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
Map<String, String> identityNumMap = IdCardUtils.getBirAgeSex(idCard);
|
||||
@@ -140,12 +150,12 @@ public class MsCaseApplicationController extends BaseController {
|
||||
* 根据id查询案件
|
||||
*/
|
||||
@GetMapping("/selectById")
|
||||
public AjaxResult selectById(@RequestParam Long id )
|
||||
public AjaxResult selectById(@RequestParam(required = false) Long id ,@RequestParam(required = false) String caseNum )
|
||||
{
|
||||
if(id==null){
|
||||
error("id不能为空");
|
||||
if(id==null && caseNum==null ){
|
||||
error("参数校验失败");
|
||||
}
|
||||
return success(caseApplicationService.selectById(id));
|
||||
return success(caseApplicationService.selectById(id,caseNum));
|
||||
}
|
||||
/**
|
||||
* 案件压缩包导入
|
||||
|
||||
@@ -63,8 +63,12 @@ public class SysUser extends BaseEntity
|
||||
|
||||
|
||||
/** 用户身份证号 */
|
||||
@Excel(name = "身份证号")
|
||||
private String idCard;
|
||||
/** 身份类别,0-身份证,1-护照,默认0 */
|
||||
private Integer idType;
|
||||
/** 国籍,0-国内,1-国外,默认0 */
|
||||
|
||||
private Integer nationality;
|
||||
|
||||
/** 用户邮箱 */
|
||||
@Excel(name = "用户邮箱")
|
||||
@@ -136,6 +140,22 @@ public class SysUser extends BaseEntity
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Integer getIdType() {
|
||||
return idType;
|
||||
}
|
||||
|
||||
public void setIdType(Integer idType) {
|
||||
this.idType = idType;
|
||||
}
|
||||
|
||||
public Integer getNationality() {
|
||||
return nationality;
|
||||
}
|
||||
|
||||
public void setNationality(Integer nationality) {
|
||||
this.nationality = nationality;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
@@ -361,6 +381,8 @@ public class SysUser extends BaseEntity
|
||||
.append("deptIds", getDeptIds())
|
||||
.append("userName", getUserName())
|
||||
.append("idCard", getIdCard())
|
||||
.append("idType", getIdType())
|
||||
.append("nationality", getNationality())
|
||||
.append("nickName", getNickName())
|
||||
.append("email", getEmail())
|
||||
.append("phonenumber", getPhonenumber())
|
||||
|
||||
@@ -26,12 +26,36 @@ public class LoginBody
|
||||
* 唯一标识
|
||||
*/
|
||||
private String uuid;
|
||||
/**
|
||||
* 密文:BM+用户名用MD5加密
|
||||
*/
|
||||
private String ticket;
|
||||
/**
|
||||
* 角色名,申请人,被申请人,委托代理人
|
||||
*/
|
||||
private String roleName;
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
public String getUsername()
|
||||
{
|
||||
return username;
|
||||
}
|
||||
|
||||
public String getTicket() {
|
||||
return ticket;
|
||||
}
|
||||
|
||||
public void setTicket(String ticket) {
|
||||
this.ticket = ticket;
|
||||
}
|
||||
|
||||
public void setUsername(String username)
|
||||
{
|
||||
this.username = username;
|
||||
|
||||
@@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
// 过滤请求
|
||||
.authorizeRequests()
|
||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||
.antMatchers("/login", "/register", "/captchaImage","/uploadPath/**","/websocket/**").permitAll()
|
||||
.antMatchers("/login","/login/sso", "/register", "/captchaImage","/uploadPath/**","/websocket/**").permitAll()
|
||||
// 静态资源,可匿名访问
|
||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||
|
||||
+103
-23
@@ -1,33 +1,35 @@
|
||||
package com.ruoyi.framework.web.service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import cn.hutool.crypto.digest.MD5;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginBody;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.exception.user.*;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.ip.IpUtils;
|
||||
import com.ruoyi.framework.manager.AsyncManager;
|
||||
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
||||
import com.ruoyi.framework.security.context.AuthenticationContextHolder;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.exception.user.BlackListException;
|
||||
import com.ruoyi.common.exception.user.CaptchaException;
|
||||
import com.ruoyi.common.exception.user.CaptchaExpireException;
|
||||
import com.ruoyi.common.exception.user.UserNotExistsException;
|
||||
import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.ip.IpUtils;
|
||||
import com.ruoyi.framework.manager.AsyncManager;
|
||||
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
||||
import com.ruoyi.framework.security.context.AuthenticationContextHolder;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 登录校验方法
|
||||
@@ -51,6 +53,8 @@ public class SysLoginService
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
@@ -63,7 +67,6 @@ public class SysLoginService
|
||||
*/
|
||||
public String login(String username, String password, String code, String uuid)
|
||||
{
|
||||
// 验证码校验
|
||||
validateCaptcha(username, code, uuid);
|
||||
// 登录前置校验
|
||||
loginPreCheck(username, password);
|
||||
@@ -99,6 +102,45 @@ public class SysLoginService
|
||||
// 生成token
|
||||
return tokenService.createToken(loginUser);
|
||||
}
|
||||
/**
|
||||
* 无需验证码登录
|
||||
* 重写login方法将验证码模块去掉
|
||||
* @param username
|
||||
* @param password
|
||||
* @param uuid
|
||||
* @return
|
||||
*/
|
||||
public String loginNoCaptcha(String username, String password, String uuid)
|
||||
{
|
||||
// 用户验证
|
||||
Authentication authentication = null;
|
||||
try
|
||||
{
|
||||
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
|
||||
AuthenticationContextHolder.setContext(authenticationToken);
|
||||
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
|
||||
authentication = authenticationManager.authenticate(authenticationToken);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (e instanceof BadCredentialsException)
|
||||
{
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
|
||||
throw new UserPasswordNotMatchException();
|
||||
}
|
||||
else
|
||||
{
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
||||
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
||||
recordLoginInfo(loginUser.getUserId());
|
||||
// 生成token
|
||||
return tokenService.createToken(loginUser);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验验证码
|
||||
@@ -178,4 +220,42 @@ public class SysLoginService
|
||||
sysUser.setLoginDate(DateUtils.getNowDate());
|
||||
userService.updateUserProfile(sysUser);
|
||||
}
|
||||
|
||||
public AjaxResult loginSSO(LoginBody loginBody) {
|
||||
// MD5加密并和Ticket比对
|
||||
String currentTicket = MD5.create().digestHex("BM" + loginBody.getUsername());
|
||||
if(!currentTicket.equals(loginBody.getTicket())){
|
||||
return AjaxResult.error("ticket校验失败");
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
String username = loginBody.getUsername();
|
||||
// 根据用户名获取用户信息,如果用户不存在则新增用户
|
||||
SysUser user = userService.selectUserByUserName(username);
|
||||
if(user==null){
|
||||
// 新增用户
|
||||
user = new SysUser();
|
||||
user.setUserName(username);
|
||||
user.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
||||
user.setNickName(username);
|
||||
// 代理人角色相当于申请人角色
|
||||
if(loginBody.getRoleName().contains("代理人")){
|
||||
loginBody.setRoleName("申请人");
|
||||
}
|
||||
// 根据角色名查询角色id
|
||||
Long roleIdByName = roleMapper.selectRoleIdByName(loginBody.getRoleName());
|
||||
if(roleIdByName==null){
|
||||
return AjaxResult.error("角色不存在");
|
||||
}
|
||||
user.setRoleIds( new Long[]{roleIdByName});
|
||||
userService.insertUser(user);
|
||||
|
||||
}// 生成token
|
||||
LoginUser loginUser = new LoginUser();
|
||||
loginUser.setUser(user);
|
||||
loginUser.setUserId(user.getUserId());
|
||||
String token = tokenService.createToken(loginUser);
|
||||
ajax.put("userName", user.getUserName());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
package com.ruoyi.framework.web.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
@@ -22,6 +13,16 @@ import eu.bitwalker.useragentutils.UserAgent;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* token验证处理
|
||||
@@ -119,6 +120,8 @@ public class TokenService
|
||||
refreshToken(loginUser);
|
||||
|
||||
Map<String, Object> claims = new HashMap<>();
|
||||
claims.put("userName",loginUser.getUsername());
|
||||
claims.put("userId",loginUser.getUserId());
|
||||
claims.put(Constants.LOGIN_USER_KEY, token);
|
||||
return createToken(claims);
|
||||
}
|
||||
@@ -207,14 +210,24 @@ public class TokenService
|
||||
Claims claims = parseToken(token);
|
||||
return claims.getSubject();
|
||||
}
|
||||
|
||||
/**
|
||||
* 从令牌中获取用户名
|
||||
*
|
||||
* @param token 令牌
|
||||
* @return 用户名
|
||||
*/
|
||||
public String getUserNameFromToken(String token)
|
||||
{
|
||||
Claims claims = parseToken(token);
|
||||
return claims.get("userName").toString();
|
||||
}
|
||||
/**
|
||||
* 获取请求token
|
||||
*
|
||||
* @param request
|
||||
* @return token
|
||||
*/
|
||||
private String getToken(HttpServletRequest request)
|
||||
public String getToken(HttpServletRequest request)
|
||||
{
|
||||
String token = request.getHeader(header);
|
||||
if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX))
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.system.domain.vo.flow;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Data
|
||||
public class MsBaseCaseFlow {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 案件状态名称
|
||||
*/
|
||||
private String caseStatusName;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.system.mapper.flow;
|
||||
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||
import com.ruoyi.system.domain.vo.flow.MsBaseCaseFlow;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
@@ -25,4 +26,7 @@ public interface MsCaseFlowMapper extends Mapper<MsCaseFlow> {
|
||||
|
||||
@Select("SELECT r.role_name as roleName ,f.node_name as nodeName ,f.case_status_name as caseStatusName FROM ms_case_flow f left join ms_case_flow_role_related fr on f.id = fr.flow_id left join ms_sys_role r on fr.roleid = r.role_id WHERE f.id = #{caseFlowId} ")
|
||||
List<MsCaseFlowVO> selectFlowRole(Integer caseFlowId);
|
||||
@Select("select f1.id,f1.case_status_name caseStatusName,f1.sort from ms_case_flow f1 order by f1.sort")
|
||||
|
||||
List<MsBaseCaseFlow> selectCaseFlow();
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.system.service.flow;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
|
||||
|
||||
@@ -12,6 +13,11 @@ public interface CaseFlowService {
|
||||
* @return
|
||||
*/
|
||||
Object queryCaseFlowInfo(MsCaseFlowSearchVO caseFlowSearchVO);
|
||||
/**
|
||||
* 查询案件流程信息
|
||||
* @return
|
||||
*/
|
||||
AjaxResult selectCaseFlow();
|
||||
|
||||
/**
|
||||
* 新增或编辑案件流程节点信息
|
||||
@@ -40,4 +46,6 @@ public interface CaseFlowService {
|
||||
* @return
|
||||
*/
|
||||
Set<Integer> getCaseStatusIdByRoleKey(Set<String> roles);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,10 +2,12 @@ package com.ruoyi.system.service.flow;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleRelated;
|
||||
import com.ruoyi.system.domain.vo.flow.MsBaseCaseFlow;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
@@ -95,6 +97,12 @@ public class CaseFlowServiceImpl implements CaseFlowService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectCaseFlow() {
|
||||
List<MsBaseCaseFlow> caseFlows = msCaseFlowMapper.selectCaseFlow();
|
||||
return AjaxResult.success(caseFlows);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程信息相关的角色信息
|
||||
*
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.entity.SysUserDept;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanValidators;
|
||||
@@ -241,6 +242,8 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||
@Transactional
|
||||
public AjaxResult insertUser(SysUser user) {
|
||||
// 新增用户信息
|
||||
user.setCreateBy("admin");
|
||||
user.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = userMapper.insertUser(user);
|
||||
// 新增用户部门关联
|
||||
if(CollectionUtil.isNotEmpty(user.getDeptIds())) {
|
||||
|
||||
+24
-1
@@ -1,7 +1,6 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.dto.miniprogress;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -20,6 +19,14 @@ public class IdentityAuthentication extends BaseEntity {
|
||||
private String name;
|
||||
/** 身份证号 */
|
||||
private String identityNo;
|
||||
/**
|
||||
* 身份类别,0-身份证,1-护照,默认0
|
||||
*/
|
||||
private Integer idType;
|
||||
/**
|
||||
* 国籍,0-国内,1-国外,默认0
|
||||
*/
|
||||
private Integer nationality;
|
||||
/**
|
||||
* 短信验证码
|
||||
*/
|
||||
@@ -104,6 +111,22 @@ public class IdentityAuthentication extends BaseEntity {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public Integer getIdType() {
|
||||
return idType;
|
||||
}
|
||||
|
||||
public void setIdType(Integer idType) {
|
||||
this.idType = idType;
|
||||
}
|
||||
|
||||
public Integer getNationality() {
|
||||
return nationality;
|
||||
}
|
||||
|
||||
public void setNationality(Integer nationality) {
|
||||
this.nationality = nationality;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
+10
@@ -154,4 +154,14 @@ public class MsCaseAffiliate {
|
||||
*/
|
||||
@Column(name = "is_sign_respon")
|
||||
private Integer isSignRespon;
|
||||
/**
|
||||
* 身份类别,0-身份证,1-护照,默认0
|
||||
*/
|
||||
@Column(name = "id_type")
|
||||
private Integer idType;
|
||||
/**
|
||||
* 国籍,0-国内,1-国外,默认0
|
||||
*/
|
||||
@Column(name = "nationality")
|
||||
private Integer nationality;
|
||||
}
|
||||
+7
-1
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
||||
@@ -7,6 +8,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -77,6 +79,10 @@ public class MsCaseApplicationVO extends MsCaseApplication {
|
||||
* 签名按钮显示,0-显示,1-不显示
|
||||
*/
|
||||
private Integer signButtonFlag;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private Date endTime;
|
||||
|
||||
}
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname MsCaseBatchInsertVO
|
||||
* @Description 批量新增案件
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/3/11 10:04
|
||||
* @Created wangqiong
|
||||
*/
|
||||
@Data
|
||||
public class MsCaseBatchInsertVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private List<MsCaseApplicationVO> list;
|
||||
}
|
||||
+10
@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface MsCaseLogRecordMapper extends Mapper<MsCaseLogRecord> {
|
||||
@@ -33,4 +34,13 @@ public interface MsCaseLogRecordMapper extends Mapper<MsCaseLogRecord> {
|
||||
|
||||
@Select("SELECT group_concat( DISTINCT t.createNickName) createNickName,t.nodeName content,t.nodeId,t.sort ,t.caseStatusName FROM (SELECT l.create_nick_name createNickName ,f.node_name nodeName,f.node_id nodeId, f.sort, f.case_status_name caseStatusName FROM ms_case_log_record l left join ms_case_flow f on l.case_node = f.node_id WHERE l.case_appli_id = #{caseAppliId} and f.node_name is not null ) t group by t.nodeName,t.nodeId,t.sort ,t.caseStatusName order by t.sort ")
|
||||
List<MsCaseLogRecordVO> selectCaseLogRecordListCaseProgress(Long caseAppliId);
|
||||
|
||||
/**
|
||||
* 根据案件id查询结束时间
|
||||
* @param caseAppliId
|
||||
* @param caseStatusName
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT create_time endTime FROM ms_case_log_record where case_appli_id=#{caseAppliId} and case_status_name=#{caseStatusName} order by create_time desc limit 1")
|
||||
Date selectEndTimeByCaseId(@Param("caseAppliId") Long caseAppliId, @Param("caseStatusName") String caseStatusName);
|
||||
}
|
||||
+2
@@ -161,6 +161,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
sysUser.setPhonenumber(ientityAuthentication.getPhone());
|
||||
sysUser.setEmail(ientityAuthentication.getEmail());
|
||||
sysUser.setCreateBy(ientityAuthentication.getUserName());
|
||||
sysUser.setIdType(ientityAuthentication.getIdType());
|
||||
sysUser.setNationality(ientityAuthentication.getNationality());
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
|
||||
int row = sysUserMapper.insertUser(sysUser);
|
||||
if(row<1) {
|
||||
|
||||
+16
-2
@@ -40,14 +40,27 @@ public interface MsCaseApplicationService {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
MsCaseApplicationVO selectById(Long id);
|
||||
MsCaseApplicationVO selectById(Long id ,String caseNum );
|
||||
|
||||
/**
|
||||
* 新增案件
|
||||
* @param caseApplication
|
||||
* @return
|
||||
*/
|
||||
int insert(MsCaseApplicationVO caseApplication);
|
||||
String insert(MsCaseApplicationVO caseApplication);
|
||||
|
||||
/**
|
||||
* 新增案件
|
||||
* @param caseApplication
|
||||
* @param caseFlow
|
||||
*/
|
||||
String insert(MsCaseApplicationVO caseApplication, MsCaseFlow caseFlow);
|
||||
/**
|
||||
* 批量新增案件
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult batchInsert(MsCaseBatchInsertVO vo);
|
||||
/**
|
||||
* 新增用户
|
||||
* @param affiliate
|
||||
@@ -243,4 +256,5 @@ public interface MsCaseApplicationService {
|
||||
*/
|
||||
List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+161
-72
@@ -158,22 +158,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
*/
|
||||
@Override
|
||||
public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
|
||||
// admin查询所有案件
|
||||
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
|
||||
startPage();
|
||||
List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null);
|
||||
for (MsCaseApplicationVO vo : list) {
|
||||
vo.setSignButtonFlag(0);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
// 根据用户查询角色
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// 根据id查询用户
|
||||
SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId());
|
||||
List<SysRole> roles = loginUser.getUser().getRoles();
|
||||
if (CollectionUtil.isEmpty(roles)) {
|
||||
throw new ServiceException("该用户未指定角色");
|
||||
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")||CollectionUtil.isEmpty(roles)) {
|
||||
// 如果角色为空,按admin处理,查所有案件
|
||||
startPage();
|
||||
List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null);
|
||||
for (MsCaseApplicationVO vo : list) {
|
||||
vo.setSignButtonFlag(0);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
req.setUserName(SecurityUtils.getUsername());
|
||||
req.setContactTelphoneAgent(sysUser.getPhonenumber());
|
||||
@@ -353,10 +351,29 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据案件id或者案件编号查询详情
|
||||
* @param id
|
||||
* @param caseNum
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public MsCaseApplicationVO selectById(Long id) {
|
||||
public MsCaseApplicationVO selectById(Long id,String caseNum ) {
|
||||
// 根据案件id或者案件编号查询详情
|
||||
MsCaseApplicationVO vo = new MsCaseApplicationVO();
|
||||
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
||||
MsCaseApplication caseApplication = null;
|
||||
if(id!=null) {
|
||||
caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
||||
}else {
|
||||
// 根据案件编号查
|
||||
Example example = new Example(MsCaseApplication.class);
|
||||
example.createCriteria().andEqualTo("caseNum", caseNum);
|
||||
caseApplication = msCaseApplicationMapper.selectOneByExample(example);
|
||||
}
|
||||
if(caseApplication==null){
|
||||
return vo;
|
||||
}
|
||||
BeanUtil.copyProperties(caseApplication, vo);
|
||||
// 查询案件相关人员
|
||||
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
|
||||
@@ -369,6 +386,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
vo.setColumnValueList(columnValueVOS);
|
||||
// 查询拒绝原因
|
||||
vo.setReason(auditMapper.selectByCaseId(id,caseApplication.getCaseFlowId()));
|
||||
// todo 在日志表查詢结束时间返回
|
||||
vo.setEndTime(caseLogRecordMapper.selectEndTimeByCaseId(caseApplication.getId(),"结束"));
|
||||
return vo;
|
||||
}
|
||||
|
||||
@@ -380,21 +399,36 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insert(MsCaseApplicationVO caseApplication) {
|
||||
public String insert(MsCaseApplicationVO caseApplication) {
|
||||
|
||||
|
||||
// todo 第三方调用该接口,未绑定角色,暂时不根据角色查询流程,根据角色获取案件流程
|
||||
/** List<MsCaseFlow> caseFlows= selectCaseFlows();
|
||||
if (CollectionUtil.isEmpty(caseFlows)) {
|
||||
throw new ServiceException("该角色未绑定案件流程");
|
||||
}
|
||||
*/
|
||||
// 设置模板id,根据机构代码查询模板
|
||||
Long templateId = getTemplate();
|
||||
caseApplication.setTemplateId(templateId);
|
||||
// 获取第一个流程节点
|
||||
MsCaseFlow caseFlow = getCaseFlow();
|
||||
return insert(caseApplication,caseFlow);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增案件
|
||||
* @param caseApplication
|
||||
* @param caseFlow
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public String insert(MsCaseApplicationVO caseApplication, MsCaseFlow caseFlow) {
|
||||
if (caseApplication.getId() == null) {
|
||||
caseApplication.setId(IdWorkerUtil.getId());
|
||||
}
|
||||
|
||||
// 根据角色获取案件流程
|
||||
List<MsCaseFlow> caseFlows= selectCaseFlows();
|
||||
if (CollectionUtil.isEmpty(caseFlows)) {
|
||||
throw new ServiceException("该角色为绑定案件流程");
|
||||
}
|
||||
// 设置模板id,根据机构代码查询模板
|
||||
Long templateId = templateManageMapper.selectByCreditCode(creditCode);
|
||||
caseApplication.setTemplateId(templateId);
|
||||
|
||||
MsCaseFlow caseFlow = caseFlows.get(0);
|
||||
caseApplication.setCaseStatusName(caseFlow.getCaseStatusName());
|
||||
caseApplication.setCaseFlowId(caseFlow.getId());
|
||||
caseApplication.setCreateTime(new Date());
|
||||
@@ -416,51 +450,51 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) {
|
||||
List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
|
||||
// 保存案件相关人员
|
||||
// 设置申请机构
|
||||
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
|
||||
// 组装申请机构
|
||||
// insertDept(affiliate);
|
||||
// 新增申请机构和代理人
|
||||
caseApplicationService.insertAgentUser(affiliate);
|
||||
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
|
||||
// 查询申请人角色id
|
||||
Long roleId = roleMapper.selectRoleIdByName("申请人");
|
||||
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
|
||||
caseApplicationService.insertApplicantUser(affiliate,true,roleId);
|
||||
// 设置申请机构
|
||||
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
|
||||
// 组装申请机构
|
||||
// insertDept(affiliate);
|
||||
// 新增申请机构和代理人
|
||||
caseApplicationService.insertAgentUser(affiliate);
|
||||
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
|
||||
// 查询申请人角色id
|
||||
Long roleId = roleMapper.selectRoleIdByName("申请人");
|
||||
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
|
||||
caseApplicationService.insertApplicantUser(affiliate,true,roleId);
|
||||
|
||||
|
||||
}
|
||||
// 压缩包导入,则根据身份证号获取性别和出生日期
|
||||
if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) {
|
||||
setBirthByIdentityNum(affiliate);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
|
||||
affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
|
||||
}
|
||||
if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
|
||||
affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
|
||||
}
|
||||
msCaseAffiliateMapper.insert(affiliate);
|
||||
// 批量生成调解申请书
|
||||
MsCaseApplicationReq req = new MsCaseApplicationReq();
|
||||
req.setCaseFlowId(caseFlow.getId());
|
||||
if(!caseApplication.isImportFlag()) {
|
||||
req.setId(caseApplication.getId());
|
||||
}else {
|
||||
// 压缩包导入
|
||||
req.setBatchNumber(caseApplication.getBatchNumber());
|
||||
}
|
||||
// 生成调解申请书
|
||||
if(affiliate.getOrganizeFlag()==0){
|
||||
// 自然人
|
||||
req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
|
||||
}else {
|
||||
// 机构
|
||||
req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
|
||||
}
|
||||
req.setTemplateId(String.valueOf(templateId));
|
||||
|
||||
caseApplicationService.generateApplication(req);
|
||||
}
|
||||
// 压缩包导入,则根据身份证号获取性别和出生日期
|
||||
if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) {
|
||||
setBirthByIdentityNum(affiliate);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
|
||||
affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
|
||||
}
|
||||
if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
|
||||
affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
|
||||
}
|
||||
msCaseAffiliateMapper.insert(affiliate);
|
||||
// 批量生成调解申请书
|
||||
MsCaseApplicationReq req = new MsCaseApplicationReq();
|
||||
req.setCaseFlowId(caseFlow.getId());
|
||||
if(!caseApplication.isImportFlag()) {
|
||||
req.setId(caseApplication.getId());
|
||||
}else {
|
||||
// 压缩包导入
|
||||
req.setBatchNumber(caseApplication.getBatchNumber());
|
||||
}
|
||||
// 生成调解申请书
|
||||
if(affiliate.getOrganizeFlag()==0){
|
||||
// 自然人
|
||||
req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
|
||||
}else {
|
||||
// 机构
|
||||
req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
|
||||
}
|
||||
req.setTemplateId(String.valueOf(caseApplication.getTemplateId()));
|
||||
// todo 部署放开
|
||||
caseApplicationService.generateApplication(req);
|
||||
// 保存案件附件
|
||||
if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
||||
for (MsCaseAttach caseAttach : caseAttachList) {
|
||||
@@ -482,10 +516,61 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
columnValueMapper.batchSave(columnValueList);
|
||||
}
|
||||
CaseLogUtils.insertCaseLog(caseApplication.getId(), 0, "新增案件", "");
|
||||
return 1;
|
||||
return caseApplication.getCaseNum();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取第一个流程节点
|
||||
* @return
|
||||
*/
|
||||
private MsCaseFlow getCaseFlow() {
|
||||
|
||||
// 查询所有流程节点
|
||||
Example flowExample = new Example(MsCaseFlow.class);
|
||||
flowExample.setOrderByClause("sort asc");
|
||||
List<MsCaseFlow> caseFlows = caseFlowMapper.selectByExample(flowExample);
|
||||
if (CollectionUtil.isEmpty(caseFlows)) {
|
||||
throw new ServiceException("请先配置流程");
|
||||
}
|
||||
return caseFlows.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板id
|
||||
* @return
|
||||
*/
|
||||
private Long getTemplate() {
|
||||
|
||||
return templateManageMapper.selectByCreditCode(creditCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public AjaxResult batchInsert(MsCaseBatchInsertVO vo) {
|
||||
if(CollectionUtil.isEmpty(vo.getList())){
|
||||
return AjaxResult.error("案件不能为空");
|
||||
}
|
||||
// 设置模板id,根据机构代码查询模板
|
||||
Long templateId = getTemplate();
|
||||
// 获取第一个流程节点
|
||||
MsCaseFlow caseFlow = getCaseFlow();
|
||||
List<String> caseNumList = new ArrayList<>();
|
||||
for (MsCaseApplicationVO caseApplicationVO : vo.getList()) {
|
||||
caseApplicationVO.setTemplateId(templateId);
|
||||
String caseNum = caseApplicationService.insert(caseApplicationVO, caseFlow);
|
||||
caseNumList.add(caseNum);
|
||||
}
|
||||
AjaxResult success = AjaxResult.success();
|
||||
success.put("caseNumList",caseNumList);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -518,6 +603,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
sysUser.setNickName(name);
|
||||
sysUser.setPhonenumber(phone);
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
||||
sysUser.setIdType(affiliate.getIdType());
|
||||
sysUser.setNationality(affiliate.getNationality());
|
||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||
userMapper.insertUser(sysUser);
|
||||
userRoleMapper.insertUserRole(sysUser.getUserId(), roleId);
|
||||
@@ -565,7 +652,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
example.createCriteria().andIn("roleid", roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
||||
List<MsCaseFlowRoleRelated> caseFlowRoleRelatedList = caseFlowRoleRelatedMapper.selectByExample(example);
|
||||
if (CollectionUtil.isEmpty(caseFlowRoleRelatedList)) {
|
||||
throw new ServiceException("该角色为绑定案件流程");
|
||||
throw new ServiceException("该角色未绑定案件流程");
|
||||
}
|
||||
Example flowExample = new Example(MsCaseFlow.class);
|
||||
flowExample.setOrderByClause("sort asc");
|
||||
@@ -1672,7 +1759,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
if (CollectionUtil.isEmpty(users)) {
|
||||
return AjaxResult.error("暂无调解员");
|
||||
}
|
||||
// todo 根据角色查询是否已经选择了调解员进行回显
|
||||
// 根据角色查询是否已经选择了调解员进行回显
|
||||
List<Long> userIds = users.stream().map(SysUser::getUserId).collect(Collectors.toList());
|
||||
// 状态为未结束的是待办数量,结束的是已办数量
|
||||
Map<Long, List<MsCaseApplication>> caseMap=null;
|
||||
@@ -3887,6 +3974,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
agentUser.setNickName(affiliate.getNameAgent());
|
||||
agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
|
||||
agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
||||
agentUser.setNationality(affiliate.getNationality());
|
||||
agentUser.setIdType(affiliate.getIdType());
|
||||
// agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
|
||||
userMapper.insertUser(agentUser);
|
||||
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
|
||||
|
||||
@@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="idCard" column="id_card" />
|
||||
<result property="idType" column="id_type" />
|
||||
<result property="nationality" column="nationality" />
|
||||
<result property="email" column="email" />
|
||||
<result property="phonenumber" column="phonenumber" />
|
||||
<result property="sex" column="sex" />
|
||||
@@ -50,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.user_name, u.nick_name,u.specialty, u.id_card,u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card,u.id_type,u.nationality
|
||||
from ms_sys_user u
|
||||
left join ms_sys_user_role ur on u.user_id = ur.user_id
|
||||
left join ms_sys_role r on r.role_id = ur.role_id
|
||||
@@ -200,6 +202,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="idCard != null and idCard != ''">id_card,</if>
|
||||
<if test="idType != null ">id_type,</if>
|
||||
<if test="nationality != null ">nationality,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||
@@ -216,6 +220,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="idCard != null and idCard != ''">#{idCard},</if>
|
||||
<if test="idType != null ">#{idType},</if>
|
||||
<if test="nationality != null ">#{nationality},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||
@@ -272,6 +278,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
|
||||
<if test="idType != null">id_type = #{idType},</if>
|
||||
<if test="nationality != null">nationality = #{nationality},</if>
|
||||
<if test="email != null ">email = #{email},</if>
|
||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
|
||||
Reference in New Issue
Block a user