diff --git a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java index 750a650..33cb114 100644 --- a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java @@ -16,6 +16,7 @@ import com.subsidy.mapper.CompanyFieldMappingMapper; import com.subsidy.mapper.DepartmentDictMapper; import com.subsidy.mapper.FieldDictMapper; import com.subsidy.mapper.JobDictMapper; +import com.subsidy.mapper.RankDictMapper; import com.subsidy.mapper.RoleAdministerMappingMapper; import com.subsidy.model.AdministerDO; import com.subsidy.model.ClassHourDictDO; @@ -25,6 +26,7 @@ import com.subsidy.model.CompanyFieldMappingDO; import com.subsidy.model.DepartmentDictDO; import com.subsidy.model.FieldDictDO; import com.subsidy.model.JobDictDO; +import com.subsidy.model.RankDictDO; import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.service.CompanyDictService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -79,21 +81,25 @@ public class CompanyDictServiceImpl extends ServiceImpl operators(OperatorsDTO operatorsDTO) { Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); - //判断该用户的角色 - //Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() - // .lambda() - // .eq(RoleAdministerMappingDO::getAdministerId,operatorsDTO.getId()) - // .eq(RoleAdministerMappingDO::getRoleId,1)); - // - //if (count > 0){ - // operatorsDTO.setId(null); - //} + AdministerDO administerDO = administerMapper.selectById(operatorsDTO.getId()); + //判断该用户的角色 + Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,operatorsDTO.getId()) + .eq(RoleAdministerMappingDO::getRoleId,1)); + + if (count > 0){ + administerDO.setCompanyId(null); + } IPage page = this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(),administerDO.getCompanyId()); List operatorsVOS = page.getRecords(); for (OperatorsVO operatorsVO : operatorsVOS) { @@ -179,9 +185,19 @@ public class CompanyDictServiceImpl extends ServiceImpl rankDictDOS = rankDictMapper.selectList(new QueryWrapper() + .lambda() + .isNull(RankDictDO::getCompanyId)); + for (RankDictDO rankDictDO : rankDictDOS){ + rankDictDO.setCompanyId(companyDictDO.getId()); + rankDictMapper.insert(rankDictDO); + } + //班级类型 ClassTypeDictDO classTypeDictDO = new ClassTypeDictDO(); classTypeDictDO.setClassType("企业内训"); + classTypeDictDO.setCompanyId(companyDictDO.getId()); classTypeDictMapper.insert(classTypeDictDO); return ConstantUtils.ADD_SUCCESS;