| | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import javax.validation.Validator; |
| | | |
| | | import com.ruoyi.common.utils.UserUtil; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | protected Validator validator; |
| | | @Autowired |
| | | private ISysDeptService sysDeptService; |
| | | |
| | | /** |
| | | * 根据条件分页查询用户列表 |
| | |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Long getBranchCompanyIdByUserId(Long userId) { |
| | | Long branchId=UserUtil.getBranchIdByUserId(userId); |
| | | if(branchId!=null)return branchId; |
| | | |
| | | SysUser u=userMapper.selectUserById(userId); |
| | | if(u!=null){ |
| | | Long deptId= u.getDeptId(); |
| | | branchId= sysDeptService.getBranchCompany(deptId); |
| | | if(branchId!=null){ |
| | | UserUtil.addUserIdBranch(userId,branchId); |
| | | return branchId; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 重置用户密码 |
| | | * |