|
@@ -198,23 +198,53 @@ public class JobHuntServiceImpl implements JobHuntService {
|
|
|
if (dataList.size() <= 0)
|
|
|
throw new BaseException("", "请添加导入数据!");
|
|
|
//求职人员
|
|
|
- PcJobuserExample jobuserExample = new PcJobuserExample();
|
|
|
- jobuserExample.or().andNameIsNotNull();
|
|
|
- List<PcJobuser> jobUserList = pcJobuserMapper.selectByExample(jobuserExample);
|
|
|
+ PcSiteUserExample siteUserExp = new PcSiteUserExample();
|
|
|
+ siteUserExp.or().andUserIDEqualTo(userID);
|
|
|
+ PcSiteUser curLoginSiteUser = pcSiteUserMapper.selectByExample(siteUserExp).stream().findFirst().orElse(null);
|
|
|
+
|
|
|
+ List<PcJobuser> jobUserList = new ArrayList<>();
|
|
|
+ if(curLoginSiteUser==null){
|
|
|
+ throw new BaseException("", "未能查询到当前登录人的驿站信息!");
|
|
|
+ }else{
|
|
|
+ PcJobuserExample jobuserExample = new PcJobuserExample();
|
|
|
+ jobuserExample.or().andNameIsNotNull().andSiteIDEqualTo(curLoginSiteUser.getSiteID());
|
|
|
+ jobUserList = pcJobuserMapper.selectByExample(jobuserExample);
|
|
|
+ }
|
|
|
//岗位
|
|
|
- List<PcProfession> proList = pcProfessionMapper.selectByExample(null);
|
|
|
+ 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.setName(curItem.getProfessionName());
|
|
|
+ thirdLevelProfessionList.add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//求职类型
|
|
|
List<SysDictionaryItem> dicHuntTypeList = dictionaryService.getDictionaryItemList("JobHuntType");
|
|
|
//人才类型
|
|
|
List<SysDictionaryItem> dicUserTypeList = dictionaryService.getDictionaryItemList("JobUserType");
|
|
|
List<JobHuntVo> resultList = new ArrayList<>();
|
|
|
|
|
|
+ List<PcJobuser> finalJobUserList = jobUserList;
|
|
|
dataList.forEach(item -> {
|
|
|
String errorInfo = "";
|
|
|
+ item.setJobHuntID(UUID.randomUUID().toString());
|
|
|
if (stringUtils.IsNullOrEmpty(item.jobUserName))
|
|
|
errorInfo += "请填写姓名!";
|
|
|
else {
|
|
|
- item.jobUserID = jobUserList.stream().filter(it -> it.getName().equals(item.getJobUserName().trim()))
|
|
|
+ item.jobUserID = finalJobUserList.stream().filter(it -> it.getName().equals(item.getJobUserName().trim()))
|
|
|
.findFirst().orElse(new PcJobuser()).getJobuserID();
|
|
|
if (item.jobUserID == null)
|
|
|
errorInfo += "求职人员不存在!";
|
|
@@ -245,12 +275,12 @@ public class JobHuntServiceImpl implements JobHuntService {
|
|
|
errorInfo += "请填写最高薪酬!";
|
|
|
|
|
|
if (stringUtils.IsNullOrEmpty(item.professionName))
|
|
|
- errorInfo += "请填写岗位名称!";
|
|
|
+ errorInfo += "请填写求职岗位!";
|
|
|
else {
|
|
|
- item.professionID = proList.stream().filter(it -> it.getProfessionName().equals(item.getProfessionName().trim()))
|
|
|
- .findFirst().orElse(new PcProfession()).getProfessionID();
|
|
|
+ item.professionID = thirdLevelProfessionList.stream().filter(it -> it.getName().equals(item.getProfessionName().trim()))
|
|
|
+ .findFirst().orElse(new SysDictionaryItem()).getCode();
|
|
|
if (item.professionID == null)
|
|
|
- errorInfo += "岗位不存在!";
|
|
|
+ errorInfo += "求职岗位不存在!";
|
|
|
}
|
|
|
if (stringUtils.IsNullOrEmpty(item.areaWork))
|
|
|
errorInfo += "请填写希望工作地区!";
|