| | |
| | | import com.vci.ubcs.system.user.vo.UserVO; |
| | | import com.vci.ubcs.system.user.wrapper.UserWrapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springblade.core.log.annotation.GrantLog; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @GrantLog("grantUser") |
| | | public boolean updateUser(User user) { |
| | | String tenantId = user.getTenantId(); |
| | | Long userCount = baseMapper.selectCount( |
| | |
| | | .eq(User::getAccount, user.getAccount()) |
| | | .notIn(User::getId, user.getId()) |
| | | ); |
| | | // 判断是否被修改为已存在的用户名 |
| | | if (userCount > 0L) { |
| | | throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount())); |
| | | } |
| | |
| | | |
| | | private boolean submitUserDept(User user) { |
| | | List<Long> deptIdList = Func.toLongList(user.getDeptId()); |
| | | if(deptIdList.isEmpty()){ |
| | | return true; |
| | | } |
| | | List<UserDept> userDeptList = new ArrayList<>(); |
| | | deptIdList.forEach(deptId -> { |
| | | UserDept userDept = new UserDept(); |
| | |
| | | return this.update(user, Wrappers.<User>update().lambda().in(User::getId, Func.toLongList(userIds))); |
| | | } |
| | | |
| | | /** |
| | | * 授权日志插入操作 |
| | | * @param res |
| | | */ |
| | | @Override |
| | | @GrantLog("grantUser") |
| | | public boolean grantLog(String res, boolean isException){ |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean resetPassword(String userIds) { |
| | | User user = new User(); |