Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-11-29 18:07:36 +08:00
commit da6e87fe44
10 changed files with 85 additions and 36 deletions

View File

@ -239,7 +239,6 @@ public class AbilityCenterControllerV3 {
} }
} }
TAbilityApplicationDTO tAbilityApplicationDTO = new TAbilityApplicationDTO(); TAbilityApplicationDTO tAbilityApplicationDTO = new TAbilityApplicationDTO();
tAbilityApplicationDTO.setArea(abilityBatchApplicationDTO.getArea()); tAbilityApplicationDTO.setArea(abilityBatchApplicationDTO.getArea());
tAbilityApplicationDTO.setAttachment(abilityBatchApplicationDTO.getAttachment()); tAbilityApplicationDTO.setAttachment(abilityBatchApplicationDTO.getAttachment());

View File

@ -92,10 +92,15 @@ public class TaskDTO {
@ApiModelProperty(value = "流程中是否存在拒绝?") @ApiModelProperty(value = "流程中是否存在拒绝?")
private Boolean reject = null; private Boolean reject = null;
@ApiModelProperty(value = "流程直接被终止?") @ApiModelProperty(value = "流程直接被终止?")
private Boolean termination = null; private Boolean termination = null;
@ApiModelProperty(value = "资源类型")
private String resourceType;
@ApiModelProperty(value = "提供部门")
private String provideDept;
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {

View File

@ -114,17 +114,7 @@ public class LoginController {
String password = PasswordUtils.desEncrypt(String.valueOf(params.get("password"))); String password = PasswordUtils.desEncrypt(String.valueOf(params.get("password")));
login.setPassword(password); login.setPassword(password);
login.setUuid(String.valueOf(params.get("uuid"))); 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()); SysUserDTO user = sysUserService.getByUsername(login.getUsername());

View File

@ -15,7 +15,7 @@ public class SecurityUser {
try { try {
return SecurityUtils.getSubject(); return SecurityUtils.getSubject();
} catch (Exception e) { } catch (Exception e) {
logger.info("获取用户失败:" + e.getMessage()); logger.info("获取用户失败:{}", e.getMessage());
return null; return null;
} }
} }
@ -25,18 +25,20 @@ public class SecurityUser {
*/ */
public static UserDetail getUser() { public static UserDetail getUser() {
logger.debug("当前调用的方法为————————————————————————————" + getMyGrandpaStackTrace()); logger.error("————————————————————————————当前调用的方法为————————————————————————————{}", getMyGrandpaStackTrace());
Subject subject = getSubject(); Subject subject = getSubject();
if (subject == null) { if (subject == null) {
logger.error("————————————————————————————subject为null,返回空对象————————————————————————————");
return new UserDetail(); return new UserDetail();
} }
UserDetail user = (UserDetail) subject.getPrincipal(); UserDetail user = (UserDetail) subject.getPrincipal();
if (user == null) { if (user == null) {
logger.error("————————————————————————————user为null,返回空对象————————————————————————————");
return new UserDetail(); return new UserDetail();
} }
return user; return user;
} }

View File

@ -22,10 +22,13 @@ import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysRoleUserService; import io.renren.modules.sys.service.SysRoleUserService;
import io.renren.modules.sys.service.SysUserPostService; import io.renren.modules.sys.service.SysUserPostService;
import io.renren.modules.sys.service.SysUserService; import io.renren.modules.sys.service.SysUserService;
import io.renren.websocket.WebSocketServer;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
@ -42,6 +45,8 @@ import java.util.Map;
@RequestMapping("/sys/user") @RequestMapping("/sys/user")
@Api(tags = "用户管理") @Api(tags = "用户管理")
public class SysUserController { public class SysUserController {
private static final Logger logger = LoggerFactory.getLogger(SysUserController.class);
@Autowired @Autowired
private SysUserService sysUserService; private SysUserService sysUserService;
@Autowired @Autowired
@ -140,6 +145,7 @@ public class SysUserController {
@LogOperation("修改") @LogOperation("修改")
// @RequiresPermissions("sys:user:update") // @RequiresPermissions("sys:user:update")
public Result update(@RequestBody SysUserDTO dto) { public Result update(@RequestBody SysUserDTO dto) {
logger.error("有人想要修改用户信息======》{}", SecurityUser.getUserId());
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);

View File

@ -52,5 +52,9 @@ public interface SysUserDao extends BaseDao<SysUserEntity> {
List<Map> getApproverUnconfiguredDepartment(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize); List<Map> getApproverUnconfiguredDepartment(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize);
List<Map> getApproverUnconfiguredRegion(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize); List<Map> getApproverUnconfiguredRegion();
Integer getApproverUnconfiguredDepartmentCount();
Integer getApproverUnconfiguredRegionCount();
} }

View File

@ -3,9 +3,12 @@ package io.renren.modules.sys.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import io.renren.common.service.impl.BaseServiceImpl; import io.renren.common.service.impl.BaseServiceImpl;
import io.renren.modules.security.user.SecurityUser; 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.dao.SysRoleUserDao;
import io.renren.modules.sys.entity.SysRoleUserEntity; import io.renren.modules.sys.entity.SysRoleUserEntity;
import io.renren.modules.sys.service.SysRoleUserService; import io.renren.modules.sys.service.SysRoleUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -19,25 +22,34 @@ import java.util.List;
@Service @Service
public class SysRoleUserServiceImpl extends BaseServiceImpl<SysRoleUserDao, SysRoleUserEntity> implements SysRoleUserService { public class SysRoleUserServiceImpl extends BaseServiceImpl<SysRoleUserDao, SysRoleUserEntity> implements SysRoleUserService {
private static final Logger logger = LoggerFactory.getLogger(SysUserController.class);
@Override @Override
@Transactional @Transactional
public void saveOrUpdate(Long userId, List<Long> roleIdList) { public void saveOrUpdate(Long userId, List<Long> roleIdList) {
logger.error("------------------准备更新用户角色信息-------------------");
//先删除角色用户关系 //先删除角色用户关系
deleteByUserIds(new Long[]{userId}); deleteByUserIds(new Long[]{userId});
//用户没有一个角色权限的情况 //用户没有一个角色权限的情况
if (CollUtil.isEmpty(roleIdList)) { if (roleIdList.isEmpty()) {
logger.error("------------------用户未配置角色-------------------");
return; return;
} }
int i = 0;
//保存角色用户关系 //保存角色用户关系
for (Long roleId : roleIdList) { for (Long roleId : roleIdList) {
SysRoleUserEntity sysRoleUserEntity = new SysRoleUserEntity(); SysRoleUserEntity sysRoleUserEntity = new SysRoleUserEntity();
sysRoleUserEntity.setUserId(userId); sysRoleUserEntity.setUserId(userId);
sysRoleUserEntity.setRoleId(roleId); sysRoleUserEntity.setRoleId(roleId);
//保存 //保存
insert(sysRoleUserEntity); insert(sysRoleUserEntity);
i++;
}
if (i != roleIdList.size()) {
logger.error("------------------用户新角色保存出错!-------------------");
throw new RuntimeException("==========================更新用户角色错误==========================");
} }
} }
@ -50,6 +62,8 @@ public class SysRoleUserServiceImpl extends BaseServiceImpl<SysRoleUserDao, SysR
public void deleteByUserIds(Long[] userIds) { public void deleteByUserIds(Long[] userIds) {
Long updater = SecurityUser.getUserId(); Long updater = SecurityUser.getUserId();
logger.error("------------------二次确认请求修改用户角色的人是:{}-------------------", SecurityUser.getUser());
baseDao.deleteByUserIds(userIds, updater); baseDao.deleteByUserIds(userIds, updater);
} }

View File

@ -14,6 +14,7 @@ import io.renren.common.utils.Result;
import io.renren.modules.security.password.PasswordUtils; import io.renren.modules.security.password.PasswordUtils;
import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail; import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sys.controller.SysUserController;
import io.renren.modules.sys.dao.SysDeptDao; import io.renren.modules.sys.dao.SysDeptDao;
import io.renren.modules.sys.dao.SysRegionDao; import io.renren.modules.sys.dao.SysRegionDao;
import io.renren.modules.sys.dao.SysUserDao; import io.renren.modules.sys.dao.SysUserDao;
@ -29,6 +30,8 @@ import io.renren.modules.sys.service.*;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -75,6 +78,9 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
@Value("${spring.datasource.druid.password}") @Value("${spring.datasource.druid.password}")
private String password; private String password;
private static final Logger logger = LoggerFactory.getLogger(SysUserController.class);
@Override @Override
public PageData<SysUserDTO> page(Map<String, Object> params) { public PageData<SysUserDTO> page(Map<String, Object> params) {
//转换成like //转换成like
@ -167,7 +173,6 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
//更新用户 //更新用户
updateById(entity); updateById(entity);
//更新角色用户关系 //更新角色用户关系
sysRoleUserService.saveOrUpdate(entity.getId(), dto.getRoleIdList()); sysRoleUserService.saveOrUpdate(entity.getId(), dto.getRoleIdList());
@ -535,21 +540,17 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
} }
ArrayList<Object> resultList = new ArrayList<>(); ArrayList<Object> resultList = new ArrayList<>();
resultList.addAll(sysUserDao.getApproverUnconfiguredDepartment(pageNum, pageSize)); resultList.addAll(sysUserDao.getApproverUnconfiguredDepartment(pageNum, pageSize));
return resultList;
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("total", sysUserDao.getApproverUnconfiguredDepartmentCount());
resultMap.put("list", resultList);
return resultMap;
} }
@Override @Override
public Object getApproverUnconfiguredRegion(Map<String, Object> params) { public Object getApproverUnconfiguredRegion(Map<String, Object> 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<Object> resultList = new ArrayList<>(); ArrayList<Object> resultList = new ArrayList<>();
resultList.addAll(sysUserDao.getApproverUnconfiguredRegion(pageNum, pageSize)); resultList.addAll(sysUserDao.getApproverUnconfiguredRegion());
return resultList; return resultList;
} }
} }

View File

@ -748,7 +748,7 @@
t_meetingroom_book tmb t_meetingroom_book tmb
LEFT JOIN ( SELECT id, NAME, district FROM sys_dept ) sd ON tmb.dept = sd.NAME LEFT JOIN ( SELECT id, NAME, district FROM sys_dept ) sd ON tmb.dept = sd.NAME
WHERE WHERE
tmb.state = 0 tmb.state = 2
GROUP BY GROUP BY
sd.id, sd.id,
tmb.dept tmb.dept
@ -824,6 +824,7 @@
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
WHERE WHERE
tdr.del_flag = 0 tdr.del_flag = 0
AND tdr.type = '应用资源'
ORDER BY taa.price DESC ORDER BY taa.price DESC
LIMIT 30 LIMIT 30
@ -836,7 +837,7 @@
FROM FROM
t_meetingroom_book tmb t_meetingroom_book tmb
WHERE WHERE
tmb.state = 0 tmb.state = 2
</select> </select>
<select id="getProvideDeptFundStatement" resultType="java.util.Map"> <select id="getProvideDeptFundStatement" resultType="java.util.Map">
@ -887,7 +888,7 @@
LEFT JOIN t_meetingroom_book tmb ON tmb.room_id = tm.id LEFT JOIN t_meetingroom_book tmb ON tmb.room_id = tm.id
WHERE WHERE
tm.del_flag = 0 tm.del_flag = 0
AND tmb.state = 0 AND tmb.state = 2
) temp ) temp
GROUP BY GROUP BY
deptId, deptId,
@ -943,7 +944,7 @@
t_meetingroom_book tmb t_meetingroom_book tmb
LEFT JOIN ( SELECT id, NAME FROM sys_dept ) sd ON tmb.dept = sd.NAME LEFT JOIN ( SELECT id, NAME FROM sys_dept ) sd ON tmb.dept = sd.NAME
WHERE WHERE
tmb.state = 0 tmb.state = 2
GROUP BY GROUP BY
sd.id, sd.id,
tmb.dept tmb.dept
@ -1029,7 +1030,7 @@
t_meetingroom_book tmb t_meetingroom_book tmb
LEFT JOIN ( SELECT id, NAME, district FROM sys_dept ) sd ON tmb.dept = sd.NAME LEFT JOIN ( SELECT id, NAME, district FROM sys_dept ) sd ON tmb.dept = sd.NAME
WHERE WHERE
tmb.state = 0 tmb.state = 2
GROUP BY GROUP BY
sd.id, sd.id,
tmb.dept tmb.dept

View File

@ -169,7 +169,34 @@
AND srg.tree_level = 3 AND srg.tree_level = 3
AND 9 >= srg.sort AND 9 >= srg.sort
ORDER BY srg.sort ORDER BY srg.sort
LIMIT ${pageNum}, ${pageSize}
</select> </select>
<select id="getApproverUnconfiguredDepartmentCount" resultType="java.lang.Integer">
SELECT COUNT(1)
FROM (
SELECT
id
FROM
sys_dept sd
WHERE
id NOT IN (
SELECT
sd.id
FROM
sys_user su,
sys_dept sd,
sys_role sr,
sys_role_user sru
WHERE
su.dept_id = sd.id
AND su.id = sru.user_id
AND sru.role_id = sr.id
AND sru.del_flag = 0
AND sr.`name` = '部门审批人'
)
AND sd.type != 4
) temp
</select>
</mapper> </mapper>