|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.web.controller.system.count;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
@ -17,6 +18,7 @@ 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.domain.count.UserCountDTO;
|
|
|
|
|
import com.ruoyi.system.service.*;
|
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -25,8 +27,10 @@ import org.springframework.ui.ModelMap;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -52,21 +56,20 @@ public class SysUsernumController extends BaseController {
|
|
|
|
|
|
|
|
|
|
@RequiresPermissions("system:usernum:view")
|
|
|
|
|
@GetMapping()
|
|
|
|
|
public String user()
|
|
|
|
|
{
|
|
|
|
|
public String user() {
|
|
|
|
|
return prefix + "/usernum";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 用户列表
|
|
|
|
|
*
|
|
|
|
|
* @param user
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("system:usernum:list")
|
|
|
|
|
@PostMapping("/list")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public TableDataInfo list(SysUser user,SysDept dept)
|
|
|
|
|
{
|
|
|
|
|
public TableDataInfo list(SysUser user, SysDept dept) {
|
|
|
|
|
startPage();
|
|
|
|
|
List<SysUser> sysuser = new ArrayList<>();
|
|
|
|
|
List<SysUser> list = userService.selectUserGroupBydept(user);
|
|
|
|
@ -83,6 +86,7 @@ public class SysUsernumController extends BaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出用户
|
|
|
|
|
*
|
|
|
|
|
* @param user
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
@ -90,8 +94,7 @@ public class SysUsernumController extends BaseController {
|
|
|
|
|
@RequiresPermissions("system:usernum:export")
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult export(SysUser user)
|
|
|
|
|
{
|
|
|
|
|
public AjaxResult export(SysUser user) {
|
|
|
|
|
List<SysUser> list = userService.selectUserList(user);
|
|
|
|
|
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
|
|
|
|
return util.exportExcel(list, "用户统计数据");
|
|
|
|
@ -102,9 +105,7 @@ public class SysUsernumController extends BaseController {
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("system:usernum:detail")
|
|
|
|
|
@GetMapping("/print/{deptId}")
|
|
|
|
|
public String print(@PathVariable("deptId")Long deptId, SysUser user,ModelMap mmap)
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
public String print(@PathVariable("deptId") Long deptId, SysUser user, ModelMap mmap) {
|
|
|
|
|
List<SysUser> list = userService.lambdaQuery().eq(SysUser::getDeptId, deptId)
|
|
|
|
|
.eq(SysUser::getDelFlag, 0)
|
|
|
|
|
.ne(SysUser::getUserId, 1)
|
|
|
|
@ -123,4 +124,40 @@ public class SysUsernumController extends BaseController {
|
|
|
|
|
mmap.put("sysuser", getSysUser());
|
|
|
|
|
return prefix + "/print";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<String> sharType = Arrays.asList("已登记", "已申报", "已审核", "已离职");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* 统计人员已登记、已申报、已审核、已离职
|
|
|
|
|
* @return com.ruoyi.common.core.domain.AjaxResult
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/countUser")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult countUser() {
|
|
|
|
|
UserCountDTO userCountDTO = userService.selectCountUser();
|
|
|
|
|
List<JSONObject> datas = sharType.stream()
|
|
|
|
|
.map(name -> {
|
|
|
|
|
AtomicReference<Object> value = new AtomicReference<>(0L);
|
|
|
|
|
if("已登记".equals(name)){
|
|
|
|
|
value.set(userCountDTO.getYdj());
|
|
|
|
|
}else if("已申报".equals(name)){
|
|
|
|
|
value.set(userCountDTO.getYsb());
|
|
|
|
|
}else if("已审核".equals(name)){
|
|
|
|
|
value.set(userCountDTO.getYsh());
|
|
|
|
|
}else{
|
|
|
|
|
value.set(userCountDTO.getYlz());
|
|
|
|
|
}
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
jsonObject.put("name", name);
|
|
|
|
|
jsonObject.put("value", value.get());
|
|
|
|
|
return jsonObject;
|
|
|
|
|
})
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
return AjaxResult.success(datas);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|