feat: 根据部门和层级获取人员 及 区域 及 全部意见CID条件查询
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package com.adc.da.slrs.utArea.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.utArea.page.UtAreaEOPage;
|
||||
import com.adc.da.slrs.utArea.service.IUtAreaService;
|
||||
import com.adc.da.sys.common.SelectionResult;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.utArea.entity.UtArea;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawssBase/utArea")
|
||||
@Api(tags = "福田标准法规--标准法规库--区域")
|
||||
public class UtAreaController extends BaseController<UtArea> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UtAreaController.class);
|
||||
|
||||
@Autowired
|
||||
private IUtAreaService utAreaEOService;
|
||||
|
||||
@ApiOperation(value = "|UtAreaEO|下拉框选项格式查询")
|
||||
@GetMapping("/getAreaList")
|
||||
// @RequiresPermissions("lawssBase:utArea:list")
|
||||
public ResponseMessage<List<SelectionResult>> getAreaList(UtArea utAreaEO) throws Exception {
|
||||
return Result.success(utAreaEOService.getAreaSelList(utAreaEO));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.adc.da.slrs.utArea.dao;
|
||||
|
||||
import com.adc.da.slrs.utArea.entity.UtArea;
|
||||
import com.adc.da.sys.common.SelectionResult;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-04
|
||||
*/
|
||||
public interface UtAreaDao extends BaseMapper<UtArea> {
|
||||
|
||||
List<SelectionResult> getAreaSelList(UtArea utAreaEO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.adc.da.slrs.utArea.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="UtArea对象", description="")
|
||||
public class UtArea extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "展示区域名称")
|
||||
@TableField("AREA_NAME")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty(value = "展示顺序")
|
||||
@TableField("SHOW_INDEX")
|
||||
private Integer showIndex;
|
||||
|
||||
@ApiModelProperty(value = "资源类型")
|
||||
@TableField("SAR_TYPE")
|
||||
private String sarType;
|
||||
|
||||
@TableField("CREATION_USER")
|
||||
private String creationUser;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private Integer validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.adc.da.slrs.utArea.page;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>UT_AREA UtAreaEOPage<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2020-10-16 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UtAreaEOPage extends BasePage {
|
||||
|
||||
private String id;
|
||||
private String idOperator = "=";
|
||||
private String areaName;
|
||||
private String areaNameOperator = "=";
|
||||
private String showIndex;
|
||||
private String showIndexOperator = "=";
|
||||
private String sarType;
|
||||
private String sarTypeOperator = "=";
|
||||
private String creationUser;
|
||||
private String creationUserOperator = "=";
|
||||
private String validFlag;
|
||||
private String validFlagOperator = "=";
|
||||
private String creationTime;
|
||||
private String creationTime1;
|
||||
private String creationTime2;
|
||||
private String creationTimeOperator = "=";
|
||||
private String modifyTime;
|
||||
private String modifyTime1;
|
||||
private String modifyTime2;
|
||||
private String modifyTimeOperator = "=";
|
||||
private String notId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.utArea.service;
|
||||
|
||||
import com.adc.da.slrs.utArea.entity.UtArea;
|
||||
import com.adc.da.sys.common.SelectionResult;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-04
|
||||
*/
|
||||
public interface IUtAreaService extends IService<UtArea> {
|
||||
|
||||
List<SelectionResult> getAreaSelList(UtArea utAreaEO);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.adc.da.slrs.utArea.service.impl;
|
||||
|
||||
import com.adc.da.slrs.utArea.entity.UtArea;
|
||||
import com.adc.da.slrs.utArea.dao.UtAreaDao;
|
||||
import com.adc.da.slrs.utArea.service.IUtAreaService;
|
||||
import com.adc.da.sys.common.SelectionResult;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-04
|
||||
*/
|
||||
@Service
|
||||
public class UtAreaServiceImpl extends ServiceImpl<UtAreaDao, UtArea> implements IUtAreaService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UtAreaServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private UtAreaDao dao;
|
||||
|
||||
public UtAreaDao getDao() {
|
||||
return dao;
|
||||
}
|
||||
|
||||
public List<SelectionResult> getAreaSelList(UtArea utAreaEO){
|
||||
return dao.getAreaSelList(utAreaEO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.utArea.dao.UtAreaDao">
|
||||
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.utArea.entity.UtArea" >
|
||||
<id column="id" property="id" />
|
||||
<result column="area_name" property="areaName" />
|
||||
<result column="show_index" property="showIndex" />
|
||||
<result column="sar_type" property="sarType" />
|
||||
<result column="creation_user" property="creationUser" />
|
||||
<result column="valid_flag" property="validFlag" />
|
||||
<result column="creation_time" property="creationTime" />
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- UT_AREA table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
id, area_name, show_index, sar_type, creation_user, valid_flag, creation_time, modify_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
<if test="areaName != null" >
|
||||
and area_name ${areaNameOperator} #{areaName}
|
||||
</if>
|
||||
<if test="showIndex != null" >
|
||||
and show_index ${showIndexOperator} #{showIndex}
|
||||
</if>
|
||||
<if test="sarType != null" >
|
||||
and sar_type like concat(concat('%',#{sarType}),'%')
|
||||
</if>
|
||||
<if test="creationUser != null" >
|
||||
and creation_user ${creationUserOperator} #{creationUser}
|
||||
</if>
|
||||
<if test="validFlag != null" >
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</if>
|
||||
<if test="creationTime != null" >
|
||||
and creation_time ${creationTimeOperator} #{creationTime}
|
||||
</if>
|
||||
<if test="creationTime1 != null" >
|
||||
and creation_time >= #{creationTime1}
|
||||
</if>
|
||||
<if test="creationTime2 != null" >
|
||||
and creation_time <= #{creationTime2}
|
||||
</if>
|
||||
<if test="modifyTime != null" >
|
||||
and modify_time ${modifyTimeOperator} #{modifyTime}
|
||||
</if>
|
||||
<if test="modifyTime1 != null" >
|
||||
and modify_time >= #{modifyTime1}
|
||||
</if>
|
||||
<if test="modifyTime2 != null" >
|
||||
and modify_time <= #{modifyTime2}
|
||||
</if>
|
||||
<if test="notId != null" >
|
||||
and id != #{notId}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<select id="getAreaSelList" parameterType="com.adc.da.slrs.utArea.entity.UtArea" resultType="com.adc.da.sys.common.SelectionResult">
|
||||
select id as value,area_name as label
|
||||
from UT_AREA
|
||||
where 1=1
|
||||
<if test="id != null" >
|
||||
and id != #{id}
|
||||
</if>
|
||||
<if test="sarType != null" >
|
||||
and sar_type like concat(concat('%',#{sarType}),'%')
|
||||
</if>
|
||||
order by show_index,id
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.sys.constant;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/11/8 15:47
|
||||
*/
|
||||
public enum DeleteFlagEnum {
|
||||
|
||||
NORMAL(0, "正常"),
|
||||
DELETE(1, "已删除");
|
||||
|
||||
private int value;
|
||||
private String label;
|
||||
|
||||
private DeleteFlagEnum(int value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return this.label;
|
||||
}
|
||||
}
|
||||
@@ -6,14 +6,18 @@ import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.sys.constant.DeleteFlagEnum;
|
||||
import com.adc.da.sys.constant.IsBelongEnum;
|
||||
import com.adc.da.sys.constant.ValidFlagEnum;
|
||||
import com.adc.da.sys.entity.RoleEO;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.entity.UserRoleEO;
|
||||
import com.adc.da.sys.page.RoleEOPage;
|
||||
import com.adc.da.sys.page.RoleUserEOPage;
|
||||
import com.adc.da.sys.service.IRoleEOService;
|
||||
import com.adc.da.sys.service.IUserEOService;
|
||||
import com.adc.da.sys.util.RoleGroupUtil;
|
||||
import com.adc.da.sys.vo.RoleUserVO;
|
||||
import com.adc.da.sys.vo.RoleVO;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -85,6 +89,46 @@ public class RoleEOController extends BaseController<RoleEO> {
|
||||
return Result.success(getPageInfo(page.getPager(), rows));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|RoleUserVO|根据部门和层级获取人员")
|
||||
@GetMapping("/getRoleAndUserByOrgIdPage")
|
||||
public ResponseMessage<PageInfo<RoleUserVO>> getRoleAndUserByOrgIdPage(Integer pageNo, Integer pageSize, String orgId, String roleHierarchyName, String roleName, String roleId, String userName){
|
||||
RoleUserEOPage page = new RoleUserEOPage();
|
||||
if (pageNo != null) {
|
||||
page.setPage(pageNo);
|
||||
}
|
||||
if (pageSize != null) {
|
||||
page.setPageSize(pageSize);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(userName)) {
|
||||
page.setUserName("%"+roleName+"%");
|
||||
page.setUserNameOperator("LIKE");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(roleName)) {
|
||||
page.setRoleName("%"+roleName+"%");
|
||||
page.setRoleNameOperator("LIKE");
|
||||
}
|
||||
page.setOrgId(roleId);
|
||||
page.setRoleName(roleName);
|
||||
page.setUserName(userName);
|
||||
page.setRoleHierarchyName(String.valueOf(roleHierarchyName != null ? RoleGroupUtil.getId(roleHierarchyName): null));
|
||||
page.setOrgId(orgId);
|
||||
page.setValidFlag(DeleteFlagEnum.NORMAL.getValue()+"");
|
||||
page.setPager(new Pager());
|
||||
page.setOrderBy("modify_time desc");
|
||||
List<RoleUserVO> list = userService.getUserByRolePage(page);
|
||||
return Result.success(getPageInfoNew(page.getPager(), list));
|
||||
}
|
||||
|
||||
public PageInfo<RoleUserVO> getPageInfoNew(Pager pager, List<RoleUserVO> rows) {
|
||||
PageInfo<RoleUserVO> pageInfo = new PageInfo();
|
||||
pageInfo.setList(rows);
|
||||
pageInfo.setCount((long)pager.getRowCount());
|
||||
pageInfo.setPageSize(pager.getPageSize());
|
||||
pageInfo.setPageCount((long)pager.getPageCount());
|
||||
pageInfo.setPageNo(pager.getPageId());
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|RoleEO|详情")
|
||||
@GetMapping("/{id}")
|
||||
// @RequiresPermissions("sys:role:get")
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.adc.da.sys.controller;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.sys.service.ISarPublicIdeaAllService;
|
||||
import com.adc.da.sys.service.impl.SarPublicIdeaAllServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -32,20 +33,20 @@ import java.util.List;
|
||||
public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll> {
|
||||
|
||||
@Autowired
|
||||
private SarPublicIdeaAllServiceImpl sarPublicIdeaAllimpl;
|
||||
private ISarPublicIdeaAllService iSarPublicIdeaAllService;
|
||||
|
||||
|
||||
@ApiOperation(value = "查询全部意见")
|
||||
@GetMapping("/getallStand")
|
||||
public ResponseMessage getAllStand( @RequestParam(defaultValue="1")Integer page, @RequestParam(defaultValue="10")Integer size){
|
||||
IPage<SarPublicIdeaAll> Publiclist =sarPublicIdeaAllimpl.SelectAll(page,size);
|
||||
public ResponseMessage getAllStand( @RequestParam(defaultValue="1")Integer page, @RequestParam(defaultValue="10")Integer size,String cid){
|
||||
IPage<SarPublicIdeaAll> Publiclist =iSarPublicIdeaAllService.SelectAll(page,size,cid);
|
||||
return Result.success(Publiclist);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "增加意见")
|
||||
@GetMapping("/inserdallStand")
|
||||
public ResponseMessage addAllStand(SarPublicIdeaAll sar){
|
||||
String src=sarPublicIdeaAllimpl.add(sar);
|
||||
String src=iSarPublicIdeaAllService.add(sar);
|
||||
return Result.success("200",src);
|
||||
|
||||
}
|
||||
@@ -53,7 +54,7 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
@ApiOperation(value = "删除意见")
|
||||
@GetMapping("/deleteStand")
|
||||
public ResponseMessage deleteStand(String id){
|
||||
String src=sarPublicIdeaAllimpl.delete(id);
|
||||
String src=iSarPublicIdeaAllService.delete(id);
|
||||
return Result.success("200",src);
|
||||
}
|
||||
|
||||
@@ -61,7 +62,7 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
@ApiOperation(value = "修改意见")
|
||||
@GetMapping("/updateStand")
|
||||
public ResponseMessage updateStand(SarPublicIdeaAll sarPublicIdeaAll){
|
||||
String src=sarPublicIdeaAllimpl.updaetById(sarPublicIdeaAll);
|
||||
String src=iSarPublicIdeaAllService.updaetById(sarPublicIdeaAll);
|
||||
return Result.success("200",src);
|
||||
}
|
||||
|
||||
@@ -71,7 +72,7 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
@ApiOperation(value = "导出全部意见")
|
||||
@GetMapping("/tuallStand")
|
||||
public ResponseMessage getAllStand(HttpServletResponse response){
|
||||
String src=sarPublicIdeaAllimpl.stuListExcel(response);
|
||||
String src=iSarPublicIdeaAllService.stuListExcel(response);
|
||||
return Result.success("200",src);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.adc.da.sys.dao;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.page.RoleUserEOPage;
|
||||
import com.adc.da.sys.page.UserEOPage;
|
||||
import com.adc.da.sys.vo.RoleUserVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -29,6 +31,10 @@ public interface UserEODao extends BaseMapper<UserEO> {
|
||||
|
||||
public List<Integer> getRoleIdListByUserId(Integer usid);
|
||||
|
||||
List<RoleUserVO> getUserByRolePage(RoleUserEOPage page);
|
||||
|
||||
int getUserByRolePageCount(RoleUserEOPage page);
|
||||
|
||||
public void saveUserRole(@Param("usid") String usid, @Param("roleId") String roleId);
|
||||
|
||||
public void saveUserOrg(@Param("usid") String usid, @Param("orgId") String orgId);
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.adc.da.sys.page;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class RoleUserEOPage extends BasePage {
|
||||
|
||||
private String userId;
|
||||
private String userName;
|
||||
private String userNameOperator = "=";
|
||||
private String roleId;
|
||||
private String roleName;
|
||||
private String roleNameOperator = "=";
|
||||
private String orgId;
|
||||
private String orgType;
|
||||
private String orgName;
|
||||
private String orgNameOperator = "=";
|
||||
private String pOrgId;
|
||||
private String pOrgName;
|
||||
private String email;
|
||||
|
||||
private String departName;
|
||||
|
||||
private String departId;
|
||||
|
||||
private String validFlag;
|
||||
private String validFlagOperator = "=";
|
||||
|
||||
private String roleHierarchyName;
|
||||
|
||||
private List<String> orgIdList;
|
||||
private List<String> roleHierarchy;
|
||||
private List<String> roleNameList;
|
||||
private List<String> roleIdList;
|
||||
private List<String> userNameList;
|
||||
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
public interface ISarPublicIdeaAllService extends IService<SarPublicIdeaAll> {
|
||||
|
||||
|
||||
IPage<SarPublicIdeaAll> SelectAll(Integer page,Integer size);
|
||||
IPage<SarPublicIdeaAll> SelectAll(Integer page,Integer size,String cid);
|
||||
String add(SarPublicIdeaAll sarPublicIdeaAll);
|
||||
String delete(String id);
|
||||
String updaetById(SarPublicIdeaAll sarPublicIdeaAll);
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.adc.da.sys.service;
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.page.RoleUserEOPage;
|
||||
import com.adc.da.sys.page.UserEOPage;
|
||||
import com.adc.da.sys.vo.RoleUserVO;
|
||||
import com.adc.da.sys.vo.UserVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -23,6 +25,8 @@ public interface IUserEOService extends IService<UserEO> {
|
||||
|
||||
public int delete(List<String> ids);
|
||||
|
||||
List<RoleUserVO> getUserByRolePage(RoleUserEOPage page);
|
||||
|
||||
public UserEO getUserWithRoles(String id);
|
||||
|
||||
public UserEO getUserWithRolesAll(String id);
|
||||
|
||||
+2
-1
@@ -37,8 +37,9 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<SarPublicIdeaAll> SelectAll(Integer p,Integer size){
|
||||
public IPage<SarPublicIdeaAll> SelectAll(Integer p,Integer size,String cid){
|
||||
QueryWrapper<SarPublicIdeaAll> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("CID",cid);
|
||||
Page<SarPublicIdeaAll> page = new Page<>(p, size);
|
||||
IPage<SarPublicIdeaAll> userIPage = sarPublicIdeaAllDao.selectPage(page, wrapper);
|
||||
System.out.println("总条数"+userIPage.getTotal());
|
||||
|
||||
@@ -12,10 +12,12 @@ import com.adc.da.sys.entity.OrgEO;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.entity.UserInfoEO;
|
||||
import com.adc.da.sys.entity.UserOrgEO;
|
||||
import com.adc.da.sys.page.RoleUserEOPage;
|
||||
import com.adc.da.sys.page.UserEOPage;
|
||||
import com.adc.da.sys.service.IOrgEOService;
|
||||
import com.adc.da.sys.service.IRoleEOService;
|
||||
import com.adc.da.sys.service.IUserEOService;
|
||||
import com.adc.da.sys.vo.RoleUserVO;
|
||||
import com.adc.da.sys.vo.UserVO;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.adc.da.util.PasswordUtils;
|
||||
@@ -109,6 +111,58 @@ public class UserEOServiceImpl extends ServiceImpl<UserEODao, UserEO> implements
|
||||
return this.baseMapper.getUserEOByAccount(userName,usid);
|
||||
}
|
||||
|
||||
public List<RoleUserVO> getUserByRolePage(RoleUserEOPage page){
|
||||
List<String> orgIdList = null;
|
||||
if (page.getOrgId() != null){
|
||||
orgIdList = Arrays.asList(page.getOrgId().split(","));
|
||||
page.setOrgIdList(orgIdList);
|
||||
}
|
||||
List<String> roleNameList = null;
|
||||
if (page.getRoleName() != null){
|
||||
roleNameList = Arrays.asList(page.getRoleName().split(","));
|
||||
page.setRoleNameList(roleNameList);
|
||||
}
|
||||
List<String> roleIdList = null;
|
||||
if (page.getRoleId() != null){
|
||||
roleIdList = Arrays.asList(page.getRoleId().split(","));
|
||||
page.setRoleIdList(roleIdList);
|
||||
}
|
||||
List<RoleUserVO> list = this.baseMapper.getUserByRolePage(page);
|
||||
int rowCount = this.baseMapper.getUserByRolePageCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
//2021年4月19日 此处分页查询的时候直接查询,没有全局查询的BUG
|
||||
for (RoleUserVO data:list) {
|
||||
OrgEO departData = getDepartOrgData(data.getOrgId());
|
||||
if(departData!=null){
|
||||
data.setPOrgId(departData.getId());
|
||||
data.setPOrgName(departData.getOrgName());
|
||||
data.setDepartId(departData.getId());
|
||||
data.setDepartName(departData.getOrgName());
|
||||
}else{
|
||||
data.setDepartId(null);
|
||||
data.setDepartName(null);
|
||||
data.setPOrgId(null);
|
||||
data.setPOrgName(null);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private OrgEO getDepartOrgData(String orgId){
|
||||
if(StringUtils.isNotBlank(orgId)){
|
||||
OrgEO orgData = orgEOService.getOrgEOById(orgId);
|
||||
if(orgData!=null && StringUtils.equals(orgData.getOrgType(),"DEPART")){
|
||||
return orgData;
|
||||
}else if(orgData != null){
|
||||
return getDepartOrgData(orgData.getpId());
|
||||
}
|
||||
return null;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void updatePassword(String usid, String oldPassword, String newPassword) {
|
||||
this.baseMapper.updatePassword(usid, oldPassword, newPassword);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.adc.da.sys.util;
|
||||
|
||||
public class RoleGroupUtil {
|
||||
|
||||
public static String getName(Integer id){
|
||||
String name = null;
|
||||
switch (id){
|
||||
case 1:
|
||||
name = "总监";
|
||||
break;
|
||||
case 2:
|
||||
name = "助理";
|
||||
break;
|
||||
case 3:
|
||||
name = "高级经理";
|
||||
break;
|
||||
case 4:
|
||||
name = "系统经理";
|
||||
break;
|
||||
case 5:
|
||||
name = "工程师";
|
||||
break;
|
||||
case 6:
|
||||
name = "FO";
|
||||
break;
|
||||
case 7:
|
||||
name = "LO";
|
||||
break;
|
||||
case 8:
|
||||
name = "L1";
|
||||
break;
|
||||
case 9:
|
||||
name = "技师";
|
||||
break;
|
||||
case 10:
|
||||
name = "供应商";
|
||||
break;
|
||||
case 11:
|
||||
name = "VSE";
|
||||
break;
|
||||
case 12:
|
||||
name = "其他";
|
||||
break;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
public static Integer getId(String name){
|
||||
Integer id = null;
|
||||
switch (name){
|
||||
case "总监":
|
||||
id = 1;
|
||||
break;
|
||||
case "助理":
|
||||
id = 2;
|
||||
break;
|
||||
case "高级经理":
|
||||
id = 3;
|
||||
break;
|
||||
case "系统经理":
|
||||
id = 4;
|
||||
break;
|
||||
case "工程师":
|
||||
id = 5;
|
||||
break;
|
||||
case "FO":
|
||||
id = 6;
|
||||
break;
|
||||
case "LO":
|
||||
id = 7;
|
||||
break;
|
||||
case "L1":
|
||||
id = 8;
|
||||
break;
|
||||
case "技师":
|
||||
id = 9;
|
||||
break;
|
||||
case "供应商":
|
||||
id = 10;
|
||||
break;
|
||||
case "VSE":
|
||||
id = 11;
|
||||
break;
|
||||
case "其他":
|
||||
id = 12;
|
||||
break;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.sys.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoleUserVO {
|
||||
|
||||
private String userId;
|
||||
private String userName;
|
||||
private String roleId;
|
||||
private String roleName;
|
||||
private String orgId;
|
||||
private String orgType;
|
||||
private String orgName;
|
||||
private String pOrgId;
|
||||
private String pOrgName;
|
||||
private String email;
|
||||
|
||||
private String departName;
|
||||
|
||||
private String departId;
|
||||
|
||||
}
|
||||
@@ -199,6 +199,139 @@
|
||||
</set>
|
||||
where usid = #{usid}
|
||||
</update>
|
||||
|
||||
<select id="getUserByRolePage" resultType="com.adc.da.sys.vo.RoleUserVO" parameterType="com.adc.da.base.page.BasePage">
|
||||
SELECT userIdAndRoleId,
|
||||
userId,
|
||||
userName,
|
||||
email,
|
||||
roleId,
|
||||
roleName,
|
||||
orgId,
|
||||
orgType,
|
||||
orgName,
|
||||
pOrgId,
|
||||
pOrgName
|
||||
FROM (
|
||||
select distinct
|
||||
concat(TS_USER.usid,TS_ROLE.ID) as userIdAndRoleId,
|
||||
TS_USER.usid as userId,
|
||||
TS_USER.uname as userName,
|
||||
TS_USER.email as email,
|
||||
TS_ROLE.ID as roleId,
|
||||
TS_ROLE.NAME as roleName,
|
||||
tog.ID as orgId,
|
||||
tog.ORG_TYPE as orgType,
|
||||
tog.ORG_NAME as orgName,
|
||||
tog.PARENT_ID as pOrgId,
|
||||
(select ORG_NAME from TS_ORG where TS_ORG.ID=tog.PARENT_ID) as pOrgName
|
||||
from TS_USER
|
||||
left join TS_USER_ROLE on TS_USER_ROLE.USER_ID = TS_USER.USID
|
||||
left join TS_ROLE on TS_ROLE.ID = TS_USER_ROLE.ROLE_ID
|
||||
left join TS_USER_ORG on TS_USER_ORG.USER_ID = TS_USER.USID
|
||||
left join TS_ORG tog on tog.ID = TS_USER_ORG.ORG_ID
|
||||
<where>
|
||||
TS_USER.VALID_FLAG = '0'
|
||||
and TS_ROLE.VALID_FLAG = '0'
|
||||
and TS_ROLE.USE_FLAG = 0
|
||||
<if test="orgIdList != null ">
|
||||
and (
|
||||
tog.ID in
|
||||
<foreach collection="orgIdList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<foreach collection="orgIdList" index="index" item="item" open="" separator="" close="">
|
||||
or tog.PARENT_IDS like concat('%',#{item},'%')
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="roleHierarchy != null">
|
||||
and TS_ROLE.role_hierarchy = #{roleHierarchy}
|
||||
</if>
|
||||
<if test="roleIdList != null">
|
||||
and TS_ROLE.ID in
|
||||
<foreach collection="roleIdList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="roleNameList != null">
|
||||
and TS_ROLE.NAME in
|
||||
<foreach collection="roleNameList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
and (
|
||||
TS_USER.UNAME ${userNameOperator} concat('%',#{userName},'%')
|
||||
) or (
|
||||
TS_USER.email ${userNameOperator} concat('%',#{userName},'%')
|
||||
)
|
||||
</if>
|
||||
) tmp_user
|
||||
limit ${pager.startIndex-1},${pageSize}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getUserByRolePageCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from (
|
||||
select distinct
|
||||
concat(TS_USER.usid,TS_ROLE.ID) as userIdAndRoleId,
|
||||
TS_USER.usid as userId,
|
||||
TS_USER.uname as userName,
|
||||
TS_USER.email as email,
|
||||
TS_ROLE.ID as roleId,
|
||||
TS_ROLE.NAME as roleName,
|
||||
tog.ID as orgId,
|
||||
tog.ORG_TYPE as orgType,
|
||||
tog.ORG_NAME as orgName,
|
||||
tog.PARENT_ID as pOrgId,
|
||||
(select ORG_NAME from TS_ORG where TS_ORG.ID=tog.PARENT_ID) as pOrgName
|
||||
from TS_USER
|
||||
left join TS_USER_ROLE on TS_USER_ROLE.USER_ID = TS_USER.USID
|
||||
left join TS_ROLE on TS_ROLE.ID = TS_USER_ROLE.ROLE_ID
|
||||
left join TS_USER_ORG on TS_USER_ORG.USER_ID = TS_USER.USID
|
||||
left join TS_ORG tog on tog.ID = TS_USER_ORG.ORG_ID
|
||||
<where>
|
||||
TS_USER.VALID_FLAG = '0'
|
||||
and TS_ROLE.VALID_FLAG = '0'
|
||||
and TS_ROLE.USE_FLAG = 0
|
||||
<if test="orgIdList != null ">
|
||||
and (
|
||||
tog.ID in
|
||||
<foreach collection="orgIdList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<foreach collection="orgIdList" index="index" item="item" open="" separator="" close="">
|
||||
or tog.PARENT_IDS like concat('%',#{item},'%')
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="roleHierarchy != null">
|
||||
and TS_ROLE.role_hierarchy = #{roleHierarchy}
|
||||
</if>
|
||||
<if test="roleIdList != null">
|
||||
and TS_ROLE.ID in
|
||||
<foreach collection="roleIdList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="roleNameList != null">
|
||||
and TS_ROLE.NAME in
|
||||
<foreach collection="roleNameList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
and (
|
||||
TS_USER.UNAME ${userNameOperator} concat('%',#{userName},'%')
|
||||
) or (
|
||||
TS_USER.email ${userNameOperator} concat('%',#{userName},'%')
|
||||
)
|
||||
</if>
|
||||
) tmp_user
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 根据用户ID获取角色ID列表 -->
|
||||
<select id="getRoleIdListByUserId" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
select role_id
|
||||
|
||||
Reference in New Issue
Block a user