|
@@ -3,16 +3,12 @@ package com.hz.employmentsite.services.impl.companyService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.hz.employmentsite.filter.exception.BaseException;
|
|
|
-import com.hz.employmentsite.mapper.PcCompanyMapper;
|
|
|
-import com.hz.employmentsite.mapper.PcPostMapper;
|
|
|
-import com.hz.employmentsite.mapper.PcRecommendMapper;
|
|
|
-import com.hz.employmentsite.mapper.PcRecommendMgtMapper;
|
|
|
+import com.hz.employmentsite.mapper.*;
|
|
|
import com.hz.employmentsite.mapper.cquery.PostCQuery;
|
|
|
import com.hz.employmentsite.model.*;
|
|
|
import com.hz.employmentsite.services.service.companyService.PostService;
|
|
|
import com.hz.employmentsite.services.service.system.DictionaryService;
|
|
|
import com.hz.employmentsite.util.StringUtils;
|
|
|
-import com.hz.employmentsite.vo.jobUserManager.RecommendCompanyPostVo;
|
|
|
import com.hz.employmentsite.vo.companyService.RecommendPostVo;
|
|
|
import com.hz.employmentsite.vo.companyService.PostVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -42,6 +38,9 @@ public class PostServiceImpl implements PostService {
|
|
|
@Autowired
|
|
|
private PcRecommendMgtMapper pcRecommendMgtMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PcProfessionMapper pcProfessionMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
private PcCompanyMapper companyMapper;
|
|
|
|
|
@@ -49,9 +48,9 @@ public class PostServiceImpl implements PostService {
|
|
|
private DictionaryService dictionaryService;
|
|
|
|
|
|
@Override
|
|
|
- public PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList, String professionName, Integer minCount, Integer maxCount, String companyName, String recordStatus, String WorkName,String companyID) {
|
|
|
+ public PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList, String professionName, Integer minCount, Integer maxCount, String companyName, String recordStatus,String companyID) {
|
|
|
PageHelper.startPage(page, rows);
|
|
|
- List<PostVo> list = postCQuery.selectPostList(stringUtils.ListToInSql(postIDList), professionName, minCount, maxCount, companyName, recordStatus, WorkName,companyID);
|
|
|
+ List<PostVo> list = postCQuery.selectPostList(stringUtils.ListToInSql(postIDList), professionName, minCount, maxCount, companyName, recordStatus,companyID);
|
|
|
PageInfo<PostVo> result = new PageInfo(list);
|
|
|
return result;
|
|
|
|
|
@@ -214,14 +213,30 @@ public class PostServiceImpl implements PostService {
|
|
|
}else{
|
|
|
ids.add(id);
|
|
|
}
|
|
|
- return postCQuery.selectPostList(stringUtils.ListToInSql(ids), null, null, null, null, null, null,null).stream().findFirst().orElse(null);
|
|
|
+ return postCQuery.selectPostList(stringUtils.ListToInSql(ids), null, null, null, null, null,null).stream().findFirst().orElse(null);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<PcPost> getDataListByCompanyId(String companyId) {
|
|
|
+ public List<PostVo> getDataListByCompanyID(String companyId) {
|
|
|
+ List<PostVo> resultList = new ArrayList<>();
|
|
|
PcPostExample postExp = new PcPostExample();
|
|
|
postExp.or().andCompanyIDEqualTo(companyId);
|
|
|
- return pcPostMapper.selectByExample(postExp);
|
|
|
+ var postList = pcPostMapper.selectByExample(postExp);
|
|
|
+ for(PcPost curPost : postList){
|
|
|
+ PostVo item= new PostVo();
|
|
|
+ item.setPostID(curPost.getPostID());
|
|
|
+ item.setProfessionID(curPost.getProfessionID());
|
|
|
+ PcProfessionExample professionExp = new PcProfessionExample();
|
|
|
+ professionExp.or().andProfessionIDEqualTo(curPost.getProfessionID());
|
|
|
+ var curProfession = pcProfessionMapper.selectByExample(professionExp).get(0);
|
|
|
+ item.setProfessionName(curProfession.getProfessionName());
|
|
|
+ item.setCompanyID(curPost.getCompanyID());
|
|
|
+ item.setRecruitCount(curPost.getRecruitCount());
|
|
|
+ item.setStartTime(curPost.getStartTime());
|
|
|
+ item.setEndTime(curPost.getEndTime());
|
|
|
+ resultList.add(item);
|
|
|
+ }
|
|
|
+ return resultList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -232,8 +247,31 @@ public class PostServiceImpl implements PostService {
|
|
|
PcCompanyExample companyExp = new PcCompanyExample();
|
|
|
companyExp.or().andRecordStatusEqualTo(1);
|
|
|
List<PcCompany> companyList = companyMapper.selectByExample(companyExp);
|
|
|
+ //岗位信息
|
|
|
+ List<SysDictionaryItem> thirdLevelProfessionList = new ArrayList<>();
|
|
|
+ PcProfessionExample professionExp = new PcProfessionExample();
|
|
|
+ professionExp.or().andParentProfessionIDEqualTo("").andStatusEqualTo(1);
|
|
|
+ var firstLevelData = pcProfessionMapper.selectByExample(professionExp);
|
|
|
+ for(PcProfession curProfession : firstLevelData){
|
|
|
+ professionExp = new PcProfessionExample();
|
|
|
+ professionExp.or().andParentProfessionIDEqualTo(curProfession.getProfessionID()).andStatusEqualTo(1);
|
|
|
+ var secondLevelData = pcProfessionMapper.selectByExample(professionExp);
|
|
|
+ for(PcProfession curParentProfession: secondLevelData){
|
|
|
+ professionExp = new PcProfessionExample();
|
|
|
+ professionExp.or().andParentProfessionIDEqualTo(curParentProfession.getProfessionID()).andStatusEqualTo(1);
|
|
|
+ var thirdLevelData = pcProfessionMapper.selectByExample(professionExp);
|
|
|
+ for(PcProfession curItem : thirdLevelData){
|
|
|
+ SysDictionaryItem item = new SysDictionaryItem();
|
|
|
+ item.setCode(curItem.getProfessionID());
|
|
|
+ item.setCode(curItem.getProfessionName());
|
|
|
+ thirdLevelProfessionList.add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//文化程度
|
|
|
- List<SysDictionaryItem> dicDataList = dictionaryService.getDictionaryItemList("CultureLevel");
|
|
|
+ List<SysDictionaryItem> dicCultureDataList = dictionaryService.getDictionaryItemList("CultureLevel");
|
|
|
+ List<SysDictionaryItem> dicWorkYearDataList = dictionaryService.getDictionaryItemList("WorkYearType");
|
|
|
List<PostVo> resultList = new ArrayList<>();
|
|
|
|
|
|
dataList.forEach(item -> {
|
|
@@ -246,10 +284,18 @@ public class PostServiceImpl implements PostService {
|
|
|
if (item.companyID == null)
|
|
|
errorInfo += "企业不存在!";
|
|
|
}
|
|
|
- if (stringUtils.IsNullOrEmpty(item.postName))
|
|
|
+ if (stringUtils.IsNullOrEmpty(item.professionName))
|
|
|
errorInfo += "请填写岗位名称!";
|
|
|
+ else {
|
|
|
+ item.professionID = thirdLevelProfessionList.stream().filter(it -> it.getName().equals(item.getProfessionName().trim()))
|
|
|
+ .findFirst().orElse(new SysDictionaryItem()).getCode();
|
|
|
+ if (item.professionID == null||item.professionID=="")
|
|
|
+ errorInfo += "岗位不存在!";
|
|
|
+ }
|
|
|
+
|
|
|
if (stringUtils.IsNullOrEmpty(String.valueOf(item.recruitCount)) || item.recruitCount == null)
|
|
|
errorInfo += "请填写招聘人数!";
|
|
|
+
|
|
|
if (stringUtils.IsNullOrEmpty(String.valueOf(item.startTime)) || item.startTime == null)
|
|
|
errorInfo += "请填写开始日期!";
|
|
|
if (stringUtils.IsNullOrEmpty(String.valueOf(item.startTime)) || item.startTime == null)
|
|
@@ -257,11 +303,18 @@ public class PostServiceImpl implements PostService {
|
|
|
if (stringUtils.IsNullOrEmpty(item.jobPlace))
|
|
|
errorInfo += "请填写招聘地点!";
|
|
|
|
|
|
+ if (stringUtils.IsNullOrEmpty(item.workYearStr)){
|
|
|
+ item.workYear = dicWorkYearDataList.stream().filter(it -> it.getName().equals(item.workYearStr.trim()))
|
|
|
+ .findFirst().orElse(new SysDictionaryItem()).getValue();
|
|
|
+ if (item.workYear == null || item.workYear == 0)
|
|
|
+ errorInfo += "输入的工作年限不存在!";
|
|
|
+ }
|
|
|
+
|
|
|
if (item.isTrailName.trim().equals("是")) item.isTrail = true;
|
|
|
else if (item.isTrailName.trim().equals("否"))item.isTrail = false;
|
|
|
|
|
|
if (!stringUtils.IsNullOrEmpty(item.cultureLevelName)){
|
|
|
- item.cultureRank = dicDataList.stream().filter(it -> it.getName().equals(item.cultureLevelName.trim()))
|
|
|
+ item.cultureRank = dicCultureDataList.stream().filter(it -> it.getName().equals(item.cultureLevelName.trim()))
|
|
|
.findFirst().orElse(new SysDictionaryItem()).getValue();
|
|
|
if (item.cultureRank == null || item.cultureRank == 0)
|
|
|
errorInfo += "输入的学历要求不存在!";
|