| package doumeemes.service.ext.impl; | 
|   | 
| import doumeemes.core.constants.ResponseStatus; | 
| import doumeemes.core.exception.BusinessException; | 
| import doumeemes.core.model.LoginUserInfo; | 
| import doumeemes.core.model.PageData; | 
| import doumeemes.core.model.PageWrap; | 
| import doumeemes.core.utils.Constants; | 
| import doumeemes.dao.ext.dto.QueryCompanyPositionExtDTO; | 
| import doumeemes.dao.ext.vo.CompanyPositionExtListVO; | 
| import doumeemes.service.ext.CompanyPositionExtService; | 
| import doumeemes.dao.ext.CompanyPositionExtMapper; | 
| import com.github.pagehelper.PageHelper; | 
| import com.github.pagehelper.PageInfo; | 
| import org.apache.shiro.SecurityUtils; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.stereotype.Service; | 
|   | 
| import java.util.List; | 
|   | 
| /** | 
|  * 企业岗位信息Service实现 | 
|  * @author 江蹄蹄 | 
|  * @date 2022/05/06 14:51 | 
|  */ | 
| @Service | 
| public class CompanyPositionExtServiceImpl implements CompanyPositionExtService { | 
|   | 
|     @Autowired | 
|     private CompanyPositionExtMapper companyPositionExtMapper; | 
|   | 
|     @Override | 
|     public PageData<CompanyPositionExtListVO> findPage(PageWrap<QueryCompanyPositionExtDTO> pageWrap) { | 
|         LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|         if(!Constants.equalsInteger(user.getType(),Constants.USERTYPE.COM)){ | 
|             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), ResponseStatus.NOT_ALLOWED.getMessage()); | 
|         } | 
|         pageWrap.getModel().setDeleted(Constants.ZERO); | 
|         pageWrap.getModel().setCompanyId(user.getCompany().getId()); | 
|         PageHelper.startPage(pageWrap.getPage(), pageWrap.getCapacity()); | 
|         List<CompanyPositionExtListVO> result = companyPositionExtMapper.selectList(pageWrap.getModel()); | 
|         return PageData.from(new PageInfo<>(result)); | 
|     } | 
|     @Override | 
|     public    List<CompanyPositionExtListVO> allList(QueryCompanyPositionExtDTO pageWrap) { | 
|         LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|         if(!Constants.equalsInteger(user.getType(),Constants.USERTYPE.COM)){ | 
|             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), ResponseStatus.NOT_ALLOWED.getMessage()); | 
|         } | 
|         pageWrap.setDeleted(Constants.ZERO); | 
|         pageWrap.setCompanyId(user.getCompany().getId()); | 
|         List<CompanyPositionExtListVO> result = companyPositionExtMapper.selectList(pageWrap); | 
|         return result; | 
|     } | 
| } |