涉密人员统计

master
20918 11 months ago
parent 814bff070e
commit d044226c45

@ -29,6 +29,7 @@
<commons.io.version>2.11.0</commons.io.version>
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
<hutool.version>5.6.5</hutool.version>
</properties>
<!-- 依赖声明 -->
@ -183,7 +184,11 @@
<version>${ruoyi.version}</version>
</dependency>
<!-- mybatisplus-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>${hutool.version}</version>
</dependency>
</dependencies>

@ -70,6 +70,7 @@ public class SysTrainnumController extends BaseController {
@ResponseBody
public String print(@PathVariable("trainId") Long trainId, ModelMap mmap){
TdTrain tdTrain = tdTrainService.selectTdTrainByID(trainId);
List<TdTrain> tdTrains = tdTrainService.selectTdTrainList(tdTrain);
mmap.put("train", tdTrain);
return prefix + "/print";
}

@ -1,21 +1,22 @@
package com.ruoyi.web.controller.system.count;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysPostVO;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.domain.SysUserPost;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -23,7 +24,9 @@ import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
*
@ -43,6 +46,9 @@ public class SysUsernumController extends BaseController {
@Autowired
private ISysDeptService deptService;
@Autowired
private SysUserPostService sysUserPostService;
@RequiresPermissions("system:usernum:view")
@GetMapping()
public String user()
@ -96,22 +102,20 @@ public class SysUsernumController extends BaseController {
@RequiresPermissions("system:usernum:detail")
@GetMapping("/print/{deptId}")
public String print(@PathVariable("deptId")Long deptId, SysUser user,ModelMap mmap)
{
List<SysUser> sysUsers = userService.selectUserList(user);
List<SysUser> list = new ArrayList<>();
List<SysRole> sysRoles = new ArrayList<>();
for (SysUser User : sysUsers){
List<SysUserRole> sysUserRoles = userService.selectUserRoleByUserId(User.getUserId());
for (SysUserRole UserRole : sysUserRoles){
SysRole sysRole = roleService.selectRoleById(UserRole.getRoleId());
sysRoles.add(sysRole);
}
User.setRoles(sysRoles);
if (User.getDeptId().equals(deptId)){
list.add(User);
{
List<SysUser> list = userService.lambdaQuery().eq(SysUser::getDeptId, deptId)
.eq(SysUser::getDelFlag,0)
.list();
list.forEach(sysuser -> {
List<SysUserPost> postList = sysUserPostService.lambdaQuery().
eq(SysUserPost::getUserId, sysuser.getUserId()).list();
List<Long> postIds = postList.stream().map(SysUserPost::getPostId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(postIds)){
List<SysPost> sysPostList = postService.lambdaQuery().in(SysPost::getPostId, postIds).list();
sysuser.setPosts( Convert.toList(SysPostVO.class, sysPostList));
}
}
});
mmap.put("list", list);
mmap.put("dept",deptService.selectDeptById(deptId));
mmap.put("sysuser",getSysUser());

@ -106,6 +106,11 @@
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
</dependencies>

@ -0,0 +1,126 @@
package com.ruoyi.common.core.domain.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* sys_post
*
* @author ruoyi
*/
public class SysPostVO extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 岗位序号 */
@Excel(name = "岗位序号", cellType = ColumnType.NUMERIC)
private Long postId;
/** 岗位编码 */
@Excel(name = "岗位编码")
private String postCode;
/** 岗位名称 */
@Excel(name = "岗位名称")
private String postName;
/** 岗位排序 */
@Excel(name = "岗位排序", cellType = ColumnType.NUMERIC)
private String postSort;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 用户是否存在此岗位标识 默认不存在 */
@TableField(exist=false)
private boolean flag = false;
public Long getPostId()
{
return postId;
}
public void setPostId(Long postId)
{
this.postId = postId;
}
@NotBlank(message = "岗位编码不能为空")
@Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
public String getPostCode()
{
return postCode;
}
public void setPostCode(String postCode)
{
this.postCode = postCode;
}
@NotBlank(message = "岗位名称不能为空")
@Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
public String getPostName()
{
return postName;
}
public void setPostName(String postName)
{
this.postName = postName;
}
@NotBlank(message = "显示顺序不能为空")
public String getPostSort()
{
return postSort;
}
public void setPostSort(String postSort)
{
this.postSort = postSort;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
public boolean isFlag()
{
return flag;
}
public void setFlag(boolean flag)
{
this.flag = flag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("postId", getPostId())
.append("postCode", getPostCode())
.append("postName", getPostName())
.append("postSort", getPostSort())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import javax.validation.constraints.*;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.annotation.DataSource;
@ -39,9 +40,11 @@ public class SysUser extends BaseEntity
private Long deptId;
/** 部门父ID */
@TableField(exist=false)
private Long parentId;
/** 角色ID */
@TableField(exist=false)
private Long roleId;
/** 登录名称 */
@ -248,16 +251,24 @@ public class SysUser extends BaseEntity
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
})
@TableField(exist=false)
private SysDept dept;
@TableField(exist=false)
private List<SysRole> roles;
/** 角色组 */
@TableField(exist=false)
private Long[] roleIds;
/** 岗位组 */
@TableField(exist=false)
private Long[] postIds;
@TableField(exist=false)
private List<SysPostVO> posts;
public SysUser()
{
@ -528,6 +539,14 @@ public class SysUser extends BaseEntity
this.enddate = enddate;
}
public List<SysPostVO> getPosts() {
return posts;
}
public void setPosts(List<SysPostVO> posts) {
this.posts = posts;
}
@Override
public String toString() {
return "SysUser{" +

@ -1,6 +1,8 @@
package com.ruoyi.system.domain;
import javax.validation.constraints.*;
import com.baomidou.mybatisplus.annotation.TableField;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -37,6 +39,7 @@ public class SysPost extends BaseEntity
private String status;
/** 用户是否存在此岗位标识 默认不存在 */
@TableField(exist=false)
private boolean flag = false;
public Long getPostId()

@ -1,14 +1,17 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.domain.SysUserPost;
/**
*
*
* @author ruoyi
*/
public interface SysPostMapper
public interface SysPostMapper extends BaseMapper<SysPost>
{
/**
*

@ -1,6 +1,9 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.domain.SysUserPost;
/**
@ -8,7 +11,7 @@ import com.ruoyi.system.domain.SysUserPost;
*
* @author ruoyi
*/
public interface SysUserPostMapper
public interface SysUserPostMapper extends BaseMapper<SysUserPost>
{
/**
* ID

@ -1,14 +1,17 @@
package com.ruoyi.system.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.domain.TdLeave;
/**
*
*
* @author ruoyi
*/
public interface ISysPostService
public interface ISysPostService extends IService<SysPost>
{
/**
*

@ -0,0 +1,14 @@
package com.ruoyi.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.SysUserPost;
/**
* @author 20918
* @description sys_user_post()Service
* @createDate 2024-05-21 14:59:25
*/
public interface SysUserPostService extends IService<SysUserPost> {
}

@ -1,6 +1,9 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.SysUserPost;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.constant.UserConstants;
@ -18,7 +21,7 @@ import com.ruoyi.system.service.ISysPostService;
* @author ruoyi
*/
@Service
public class SysPostServiceImpl implements ISysPostService
public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> implements ISysPostService
{
@Autowired
private SysPostMapper postMapper;

@ -0,0 +1,23 @@
package com.ruoyi.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.SysUserPost;
import com.ruoyi.system.service.SysUserPostService;
import com.ruoyi.system.mapper.SysUserPostMapper;
import org.springframework.stereotype.Service;
/**
* @author 20918
* @description sys_user_post()Service
* @createDate 2024-05-21 14:59:25
*/
@Service
public class SysUserPostServiceImpl extends ServiceImpl<SysUserPostMapper, SysUserPost>
implements SysUserPostService{
}
Loading…
Cancel
Save