diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java index 89810e65..84fbdac2 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java @@ -239,7 +239,6 @@ public class AbilityCenterControllerV3 { } } - TAbilityApplicationDTO tAbilityApplicationDTO = new TAbilityApplicationDTO(); tAbilityApplicationDTO.setArea(abilityBatchApplicationDTO.getArea()); tAbilityApplicationDTO.setAttachment(abilityBatchApplicationDTO.getAttachment()); diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/dto/TaskDTO.java b/renren-admin/src/main/java/io/renren/modules/activiti/dto/TaskDTO.java index 80614c0a..e3dfa9fc 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/dto/TaskDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/dto/TaskDTO.java @@ -92,10 +92,15 @@ public class TaskDTO { @ApiModelProperty(value = "流程中是否存在拒绝?") private Boolean reject = null; - @ApiModelProperty(value = "流程直接被终止?") private Boolean termination = null; + @ApiModelProperty(value = "资源类型") + private String resourceType; + + @ApiModelProperty(value = "提供部门") + private String provideDept; + @Override public boolean equals(Object o) { diff --git a/renren-admin/src/main/java/io/renren/modules/security/controller/LoginController.java b/renren-admin/src/main/java/io/renren/modules/security/controller/LoginController.java index 50d10ad0..2683bed3 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/controller/LoginController.java +++ b/renren-admin/src/main/java/io/renren/modules/security/controller/LoginController.java @@ -114,17 +114,7 @@ public class LoginController { String password = PasswordUtils.desEncrypt(String.valueOf(params.get("password"))); login.setPassword(password); login.setUuid(String.valueOf(params.get("uuid"))); - //新增访客模式,访客模式下模拟登录,每次新增用户 - //if (String.valueOf(params.get("username")).contains("guest")) { - // SysUserDTO userDTO = new SysUserDTO(); - // userDTO.setStatus(1); - // userDTO.setPassword(String.valueOf(params.get("password"))); - // userDTO.setUsername(String.valueOf(params.get("username"))); - // userDTO.setSuperAdmin(0); - // userDTO.setDeptId(sysDeptDao.getByName("访客部门") == null ? null : sysDeptDao.getByName("访客部门").getId()); - // userDTO.setDeptName("访客部门"); - // sysUserService.save(userDTO); - //} + //用户信息 SysUserDTO user = sysUserService.getByUsername(login.getUsername()); diff --git a/renren-admin/src/main/java/io/renren/modules/security/user/SecurityUser.java b/renren-admin/src/main/java/io/renren/modules/security/user/SecurityUser.java index 89d0da09..da5b6222 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/user/SecurityUser.java +++ b/renren-admin/src/main/java/io/renren/modules/security/user/SecurityUser.java @@ -15,7 +15,7 @@ public class SecurityUser { try { return SecurityUtils.getSubject(); } catch (Exception e) { - logger.info("获取用户失败:" + e.getMessage()); + logger.info("获取用户失败:{}", e.getMessage()); return null; } } @@ -25,18 +25,20 @@ public class SecurityUser { */ public static UserDetail getUser() { - logger.debug("当前调用的方法为————————————————————————————" + getMyGrandpaStackTrace()); + logger.error("————————————————————————————当前调用的方法为————————————————————————————{}", getMyGrandpaStackTrace()); Subject subject = getSubject(); if (subject == null) { + logger.error("————————————————————————————subject为null,返回空对象————————————————————————————"); return new UserDetail(); } UserDetail user = (UserDetail) subject.getPrincipal(); if (user == null) { + logger.error("————————————————————————————user为null,返回空对象————————————————————————————"); return new UserDetail(); } - + return user; } diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java index 48fef54d..f0d2ab47 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java @@ -22,10 +22,13 @@ import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysRoleUserService; import io.renren.modules.sys.service.SysUserPostService; import io.renren.modules.sys.service.SysUserService; +import io.renren.websocket.WebSocketServer; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; 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 springfox.documentation.annotations.ApiIgnore; @@ -42,6 +45,8 @@ import java.util.Map; @RequestMapping("/sys/user") @Api(tags = "用户管理") public class SysUserController { + + private static final Logger logger = LoggerFactory.getLogger(SysUserController.class); @Autowired private SysUserService sysUserService; @Autowired @@ -140,6 +145,7 @@ public class SysUserController { @LogOperation("修改") // @RequiresPermissions("sys:user:update") public Result update(@RequestBody SysUserDTO dto) { + logger.error("有人想要修改用户信息======》{}", SecurityUser.getUserId()); //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysUserDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysUserDao.java index 5d084954..50fe7e48 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysUserDao.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysUserDao.java @@ -52,5 +52,9 @@ public interface SysUserDao extends BaseDao { List getApproverUnconfiguredDepartment(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize); - List getApproverUnconfiguredRegion(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize); + List getApproverUnconfiguredRegion(); + + Integer getApproverUnconfiguredDepartmentCount(); + + Integer getApproverUnconfiguredRegionCount(); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleUserServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleUserServiceImpl.java index 52a17c85..2af22b32 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleUserServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleUserServiceImpl.java @@ -3,9 +3,12 @@ package io.renren.modules.sys.service.impl; import cn.hutool.core.collection.CollUtil; import io.renren.common.service.impl.BaseServiceImpl; import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.sys.controller.SysUserController; import io.renren.modules.sys.dao.SysRoleUserDao; import io.renren.modules.sys.entity.SysRoleUserEntity; import io.renren.modules.sys.service.SysRoleUserService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -19,25 +22,34 @@ import java.util.List; @Service public class SysRoleUserServiceImpl extends BaseServiceImpl implements SysRoleUserService { + private static final Logger logger = LoggerFactory.getLogger(SysUserController.class); + @Override @Transactional public void saveOrUpdate(Long userId, List roleIdList) { + logger.error("------------------准备更新用户角色信息-------------------"); //先删除角色用户关系 deleteByUserIds(new Long[]{userId}); //用户没有一个角色权限的情况 - if (CollUtil.isEmpty(roleIdList)) { + if (roleIdList.isEmpty()) { + logger.error("------------------用户未配置角色-------------------"); return; } + int i = 0; //保存角色用户关系 for (Long roleId : roleIdList) { SysRoleUserEntity sysRoleUserEntity = new SysRoleUserEntity(); sysRoleUserEntity.setUserId(userId); sysRoleUserEntity.setRoleId(roleId); - //保存 insert(sysRoleUserEntity); + i++; + } + if (i != roleIdList.size()) { + logger.error("------------------用户新角色保存出错!-------------------"); + throw new RuntimeException("==========================更新用户角色错误=========================="); } } @@ -50,6 +62,8 @@ public class SysRoleUserServiceImpl extends BaseServiceImpl page(Map params) { //转换成like @@ -167,7 +173,6 @@ public class SysUserServiceImpl extends BaseServiceImpl resultList = new ArrayList<>(); resultList.addAll(sysUserDao.getApproverUnconfiguredDepartment(pageNum, pageSize)); - return resultList; + + Map resultMap = new HashMap<>(); + resultMap.put("total", sysUserDao.getApproverUnconfiguredDepartmentCount()); + resultMap.put("list", resultList); + return resultMap; } @Override public Object getApproverUnconfiguredRegion(Map params) { - int pageNum = 1; - int pageSize = 10; - if (params.get("pageNum") != null && StringUtils.isNumber(params.get("pageNum").toString())) { - pageNum = Integer.parseInt(params.get("pageNum").toString()); - } - if (params.get("pageSize") != null && StringUtils.isNumber(params.get("pageSize").toString())) { - pageSize = Integer.parseInt(params.get("pageSize").toString()); - } ArrayList resultList = new ArrayList<>(); - resultList.addAll(sysUserDao.getApproverUnconfiguredRegion(pageNum, pageSize)); + resultList.addAll(sysUserDao.getApproverUnconfiguredRegion()); return resultList; } } diff --git a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml index 18a5a439..bc1d65ef 100644 --- a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml +++ b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml @@ -748,7 +748,7 @@ t_meetingroom_book tmb LEFT JOIN ( SELECT id, NAME, district FROM sys_dept ) sd ON tmb.dept = sd.NAME WHERE - tmb.state = 0 + tmb.state = 2 GROUP BY sd.id, tmb.dept @@ -824,6 +824,7 @@ LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id WHERE tdr.del_flag = 0 + AND tdr.type = '应用资源' ORDER BY taa.price DESC LIMIT 30 @@ -836,7 +837,7 @@ FROM t_meetingroom_book tmb WHERE - tmb.state = 0 + tmb.state = 2 + + + \ No newline at end of file