| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | |
| | | @Autowired |
| | | private GroupMapper groupMapper; |
| | | |
| | | @Autowired |
| | | private OperationLogUtils operationLogUtils; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void allotGroups(Map<String, Object> parameters) { |
| | |
| | | deleteWrapper.eq("user_id", userId); |
| | | userGroupMapper.delete(deleteWrapper); |
| | | List<String> groups = new ArrayList<>(); |
| | | if (groupIds != null && !groupIds.isEmpty()) { |
| | | if (!ObjectUtils.isEmpty(groupIds)) { |
| | | groupIds.forEach(groupId -> { |
| | | groups.add(groupMapper.selectById(groupId).getGroupName()); |
| | | UserGroup userGroup = new UserGroup(); |
| | |
| | | |
| | | //日志 |
| | | String account = userMapper.selectById((Integer) parameters.get("userId")).getAccount(); |
| | | String content = "给用户:" + account + "分配了组:" + groups.toString(); |
| | | OperationLogUtils.insertLog(request, content, Constants.UPDATE_OPERATE_TYPE); |
| | | String content = "给用户:" + account + "分配了组:" + groups; |
| | | operationLogUtils.insertLog(request, content, Constants.UPDATE_OPERATE_TYPE); |
| | | } |
| | | |
| | | @Override |