|
@@ -17,6 +17,7 @@ import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.UUID;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service("JobHuntService")
|
|
@@ -116,6 +117,40 @@ public class JobHuntServiceImpl implements JobHuntService {
|
|
|
JobHuntVo record = get(data.jobHuntID);
|
|
|
PcJobhunt dbData = record == null ? null : pcJobhuntMapper.selectByPrimaryKey(record.jobHuntID);
|
|
|
Boolean isExist = dbData != null;
|
|
|
+
|
|
|
+ //判断岗位id是否为空
|
|
|
+ if (stringUtils.IsNullOrEmpty(data.getProfessionID())) {
|
|
|
+ PcProfessionExample proEmp = new PcProfessionExample();
|
|
|
+ PcProfessionExample.Criteria proCia = proEmp.or();
|
|
|
+ proCia.andParentProfessionIDNotEqualTo("");
|
|
|
+ proCia.andProfessionNameEqualTo("其他");
|
|
|
+ //获取二级其他信息
|
|
|
+ PcProfession proOther = pcProfessionMapper.selectByExample(proEmp).stream().findFirst().orElse(null);
|
|
|
+ if (proOther != null) {
|
|
|
+ proEmp = new PcProfessionExample();
|
|
|
+ proEmp.or().andParentProfessionIDEqualTo(proOther.getProfessionID());
|
|
|
+// proCia.andProfessionNameEqualTo(data.getProfessionName());
|
|
|
+
|
|
|
+ //查询其他岗位
|
|
|
+ List<PcProfession> proOtherSonList = pcProfessionMapper.selectByExample(proEmp);
|
|
|
+ PcProfession proOtherSon = proOtherSonList.stream()
|
|
|
+ .filter(x -> x.getProfessionName().equals(data.getProfessionName())).findFirst().orElse(null);
|
|
|
+ if (proOtherSon != null) {
|
|
|
+ data.setProfessionID(proOtherSon.getProfessionID());
|
|
|
+ } else {
|
|
|
+ data.setProfessionID(UUID.randomUUID().toString());
|
|
|
+ PcProfession proModel = new PcProfession();
|
|
|
+ proModel.setProfessionID(data.getProfessionID());
|
|
|
+ proModel.setParentProfessionID(proOther.getProfessionID());
|
|
|
+ proModel.setProfessionName(data.getProfessionName());
|
|
|
+ proModel.setStatus(Integer.parseInt("1"));
|
|
|
+ proModel.setOrderNo(proOtherSonList.size() + 1);
|
|
|
+
|
|
|
+ pcProfessionMapper.insert(proModel);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (!isExist) {
|
|
|
//添加
|
|
|
dbData = new PcJobhunt();
|