| | |
| | | package com.ots.project.system.user.service; |
| | | |
| | | import com.ots.common.constant.UserConstants; |
| | | import com.ots.common.exception.BusinessException; |
| | | import com.ots.common.utils.StringUtils; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | return userMapper.selectUserList(user); |
| | | } |
| | | |
| | | public List<User> selectUserList2(User user) { |
| | | |
| | | return userMapper.selectUserList(user); |
| | |
| | | } |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | | @Override |
| | | public int changeHintStatus(String userId, Integer type) { |
| | | // type 0取消授权 1授权 |
| | | if(type == 0){ |
| | | //查询事中提示语管理员 |
| | | Role role = roleMapper.selectByRoleKey("hint_common"); |
| | | if(role != null && StringUtils.isNotEmpty(userId)){ |
| | | //更新事中提示语状态 |
| | | userMapper.updateHintState(userId,type); |
| | | |
| | | UserRole userRole = new UserRole(); |
| | | userRole.setRoleId(role.getRoleId()); |
| | | userRole.setUserId(Long.valueOf(userId)); |
| | | return userRoleMapper.deleteUserRoleInfo(userRole); |
| | | } |
| | | }else if(type == 1){ |
| | | //查询事中提示语管理员 |
| | | Role role = roleMapper.selectByRoleKey("hint_common"); |
| | | List<UserRole> list = new ArrayList<UserRole>(); |
| | | if(role != null && StringUtils.isNotEmpty(userId)){ |
| | | //更新事中提示语状态 |
| | | userMapper.updateHintState(userId,type); |
| | | |
| | | UserRole ur = new UserRole(); |
| | | ur.setUserId(Long.valueOf(userId)); |
| | | ur.setRoleId(role.getRoleId()); |
| | | list.add(ur); |
| | | return userRoleMapper.batchUserRole(list); |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | } |