| | |
| | | import com.ycl.system.mapper.SysRoleMapper; |
| | | import com.ycl.system.mapper.SysUserMapper; |
| | | import com.ycl.system.mapper.SysUserRoleMapper; |
| | | import com.ycl.system.model.LoginUser; |
| | | import com.ycl.system.page.PageUtil; |
| | | import com.ycl.platform.service.YwUnitService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void setUnitInfo(LoginUser loginUser) { |
| | | // 单位管理员查询 |
| | | YwUnit unit = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(YwUnit::getUnitAdminAccount, loginUser.getUsername()) |
| | | .one(); |
| | | if (Objects.nonNull(unit)) { |
| | | loginUser.setUnitAdmin(Boolean.TRUE); |
| | | loginUser.setUnitId(unit.getId()); |
| | | } else { |
| | | unit = baseMapper.getByUserId(loginUser.getUserId()); |
| | | if (Objects.nonNull(unit)) { |
| | | loginUser.setUnitAdmin(Boolean.FALSE); |
| | | loginUser.setUnitId(unit.getId()); |
| | | } |
| | | else { |
| | | loginUser.setUnitAdmin(Boolean.FALSE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<YwUnitVO> export(YwUnitQuery query) { |
| | | // 分页条件查询你 |
| | | IPage<YwUnit> page = new LambdaQueryChainWrapper<>(baseMapper) |