feat: 根据部门和层级获取人员 及 区域 及 全部意见CID条件查询
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user