|
@@ -75,6 +75,11 @@ public class RecruitPlanMainServiceImpl implements IRecruitPlanMainService {
|
|
|
return recruitPlanMain;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<RecruitPlanMain> selectRecruitPlanByYear(String year) {
|
|
|
+ return recruitPlanMainMapper.selectRecruitPlanByYear(year);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询招聘计划列表
|
|
|
*
|
|
@@ -185,6 +190,51 @@ public class RecruitPlanMainServiceImpl implements IRecruitPlanMainService {
|
|
|
return rows;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 新增recruitplan 定制 CJ
|
|
|
+ *
|
|
|
+ * @param recruitPlanMain recruitCJ
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @Transactional
|
|
|
+ public int insertRecruitPlanMainToCJ(RecruitPlanMain recruitCJ)
|
|
|
+ {
|
|
|
+ List<RecruitPlanChild> recruitPlanChildList = recruitCJ.getColumns();
|
|
|
+ List<String> postNumIdList = recruitPlanMainMapper.selectRecruitPlanMainListForCheckPostNumId(recruitCJ);
|
|
|
+ //再次校验子计划中的岗位代码是否与已有重复,概率为零
|
|
|
+ for (RecruitPlanChild recruitPlanChild : recruitPlanChildList){
|
|
|
+ if (postNumIdList.contains(recruitPlanChild.getPostNumId())){
|
|
|
+ return 11;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //给新增计划中的子计划delFlag赋值为"0''
|
|
|
+ recruitPlanChildList.forEach(recruitPlanChild -> recruitPlanChild.setDelFlag("0"));
|
|
|
+ recruitCJ.setAhrsRecruitPlanChildList(recruitPlanChildList);
|
|
|
+ recruitCJ.setCreateBy(ShiroUtils.getSysUser().getUserName());
|
|
|
+ recruitCJ.setCreateTime(DateUtils.getNowDate());
|
|
|
+ recruitCJ.setDelFlag("0");
|
|
|
+ //查看本单位本年是否有申报历史
|
|
|
+ RecruitPlanMain recruitPlanMainMemory = recruitPlanMainMapper.selectRecruitPlanMainByDeptIdAndYear(recruitCJ.getRecruitPlanYear(),recruitCJ.getDeptId());
|
|
|
+ if (recruitPlanMainMemory!=null){
|
|
|
+ recruitCJ.setVersion(recruitPlanMainMemory.getVersion()+1);
|
|
|
+ }
|
|
|
+ //给所有子计划版本赋值
|
|
|
+ for (int i=0;i<recruitPlanChildList.size();i++){
|
|
|
+ recruitPlanChildList.get(i).setVersion(1L);
|
|
|
+ recruitPlanChildList.get(i).setCreateBy(ShiroUtils.getSysUser().getUserName());
|
|
|
+ recruitPlanChildList.get(i).setCreateTime(DateUtils.getNowDate());
|
|
|
+ }
|
|
|
+
|
|
|
+ List<String> collect1 = recruitPlanChildList.stream().map(RecruitPlanChild::getPostNumId).distinct().collect(Collectors.toList());
|
|
|
+ int check = collect1.size()!=recruitPlanChildList.size()?11:22;
|
|
|
+ if (check == 11){
|
|
|
+ return 11;
|
|
|
+ }
|
|
|
+ recruitCJ.setCreateTime(DateUtils.getNowDate());
|
|
|
+ int rows = recruitPlanMainMapper.insertRecruitPlanMain(recruitCJ);
|
|
|
+ insertAhrsRecruitPlanChild(recruitCJ);
|
|
|
+ return rows;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/*修改recruit
|
|
@@ -223,7 +273,6 @@ public class RecruitPlanMainServiceImpl implements IRecruitPlanMainService {
|
|
|
List<Long> idsOld = recruitPlanChildListTwo.stream().map(recruitPlanChild -> recruitPlanChild.getRecruitPlanChildId()).collect(Collectors.toList());
|
|
|
List<Long> idsNew = recruitPM.getRecruitPlanChildIds();
|
|
|
|
|
|
-
|
|
|
//第一步,将传过来的的子计划全部赋值vesion为1
|
|
|
for (int i=0; i<recruitPlanChildList.size();i++){
|
|
|
recruitPlanChildList.get(i).setVersion(1L);
|
|
@@ -437,7 +486,6 @@ public class RecruitPlanMainServiceImpl implements IRecruitPlanMainService {
|
|
|
|
|
|
@Override
|
|
|
public RecruitPlanChild splicingMajor(RecruitPlanChild recruitPlanChildToMajor) {
|
|
|
-
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put(UserEnums.majorType.tree.getStatus(),recruitPlanChildToMajor.getMajor());
|
|
|
jsonObject.put(UserEnums.majorType.dz.getStatus(),recruitPlanChildToMajor.getSpecialtyMajor());
|