|
@@ -6,7 +6,6 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import com.ruoyi.ahrs.recruitPersonnel.service.IRecruitPersonnelService;
|
|
|
-import com.ruoyi.ahrs.recruitplan.domian.RecruitPlan;
|
|
|
import com.ruoyi.ahrs.recruitplan.domian.RecruitPlanChild;
|
|
|
import com.ruoyi.ahrs.recruitplan.domian.RecruitPlanMain;
|
|
|
import com.ruoyi.ahrs.recruitplan.service.impl.RecruitPlanChildServiceImpl;
|
|
@@ -59,7 +58,7 @@ public class RecruitPlanMainController extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 查询recruitplan列表
|
|
|
+ * 查询RecruitPlanMain列表
|
|
|
*/
|
|
|
@RequiresPermissions("recruitplan:recruit:list")
|
|
|
@PostMapping("/list")
|
|
@@ -111,7 +110,7 @@ public class RecruitPlanMainController extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 导出recruitplan列表
|
|
|
+ * 导出RecruitPlanMain列表
|
|
|
*/
|
|
|
@RequiresPermissions("recruitplan:recruit:export")
|
|
|
@Log(title = "recruitplan", businessType = BusinessType.EXPORT)
|
|
@@ -125,7 +124,7 @@ public class RecruitPlanMainController extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 新增recruitplan
|
|
|
+ * 新增RecruitPlanMain
|
|
|
*/
|
|
|
@GetMapping("/add")
|
|
|
public String add(ModelMap mmap)
|
|
@@ -139,26 +138,6 @@ public class RecruitPlanMainController extends BaseController
|
|
|
RecruitPlanMain recruitPlanMain1 = new RecruitPlanMain();
|
|
|
recruitPlanMain1.setDeptId(getDeptId());
|
|
|
List<RecruitPlanMain> recruitPlanMainList = recruitPlanMainService.selectRecruitPlanMainList(recruitPlanMain1);
|
|
|
- for (RecruitPlanMain recruitPlanMain :recruitPlanMainList){
|
|
|
- if (recruitPlanMain!=null){
|
|
|
- for (int i=0; i<yearsList.size();i++){
|
|
|
- Long a = yearsList.get(i).longValue();
|
|
|
- if (recruitPlanMain.getRecruitPlanYear().equals(a) && recruitPlanMain.getDeptName().equals(deptName)){
|
|
|
- yearsList.remove(i);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- if (yearsList.size()==1 && yearsList.get(0)==b){
|
|
|
- mmap.put("msg","该单位已有明年招聘计划,请修改原有计划或删除");
|
|
|
- return prefix + "/501";
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (yearsList.size()==0){
|
|
|
- mmap.put("msg","该单位已有招聘计划,请修改原有计划或删除");
|
|
|
- return prefix + "/501";
|
|
|
- }
|
|
|
-
|
|
|
//默认生成一个岗位代码
|
|
|
String deptId1 =String.valueOf(getDeptId().intValue()) ;
|
|
|
double number = Math.random()*1000000;
|
|
@@ -172,25 +151,33 @@ public class RecruitPlanMainController extends BaseController
|
|
|
return prefix + "/add";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询该单位有没有招聘计划
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/selectRecruitplanListBydeptId")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult selectRecruitplanmainidBydeptId(){
|
|
|
+ StringBuilder msg = new StringBuilder();
|
|
|
+ Long dept_id = getDeptId();
|
|
|
+ Long Recruitplanmainid =recruitPlanMainService.selectRecruitPlanMainIdByDeptid(dept_id);
|
|
|
+ msg.append(Recruitplanmainid);
|
|
|
+ return AjaxResult.success(msg.toString());
|
|
|
+ }
|
|
|
+
|
|
|
/* *
|
|
|
- * 新增保存recruitMan*/
|
|
|
+ * 新增保存RecruitPlanMain*/
|
|
|
@RequiresPermissions("recruitPlan:recruit:add")
|
|
|
@Log(title = "recruitMan", businessType = BusinessType.INSERT)
|
|
|
@PostMapping("/add")
|
|
|
@ResponseBody
|
|
|
- public AjaxResult addSave(RecruitPlan recruitPlan )
|
|
|
+ public AjaxResult addSave(RecruitPlanMain recruitPM )
|
|
|
{
|
|
|
try {
|
|
|
- RecruitPlanMain recruitPlanMain = new RecruitPlanMain();
|
|
|
- recruitPlanMain.setDeptName(recruitPlan.getDeptName());
|
|
|
- recruitPlanMain.setAttachment(recruitPlan.getAttachment());
|
|
|
- recruitPlanMain.setDeptId(getDeptId());
|
|
|
- recruitPlanMain.setDeclarationId(26L);
|
|
|
- recruitPlanMain.setRecruitPlanYear(recruitPlan.getRecruitPlanYear());
|
|
|
- recruitPlanMain.setRemark(recruitPlan.getRemark());
|
|
|
+ recruitPM.setDeptId(getDeptId());
|
|
|
//给新增计划中的子计划delFlag赋值为"0''
|
|
|
- List<RecruitPlanChild> recruitPlanChildList = recruitPlan.getColumns();
|
|
|
- List<String> postNumIdList = recruitPlanMainService.selectRecruitPlanMainListForCheckPostNumId(recruitPlanMain);
|
|
|
+ List<RecruitPlanChild> recruitPlanChildList = recruitPM.getColumns();
|
|
|
+ List<String> postNumIdList = recruitPlanMainService.selectRecruitPlanMainListForCheckPostNumId(recruitPM);
|
|
|
//再次校验子计划中的岗位代码是否与已有重复,概率为零
|
|
|
for (RecruitPlanChild recruitPlanChild : recruitPlanChildList){
|
|
|
if (postNumIdList.contains(recruitPlanChild.getPostNumId())){
|
|
@@ -198,11 +185,11 @@ public class RecruitPlanMainController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
recruitPlanChildList.forEach(recruitPlanChild -> recruitPlanChild.setDelFlag("0"));
|
|
|
- recruitPlanMain.setAhrsRecruitPlanChildList(recruitPlanChildList);
|
|
|
- recruitPlanMain.setCreateBy(ShiroUtils.getSysUser().getUserName());
|
|
|
- recruitPlanMain.setCreateTime(DateUtils.getNowDate());
|
|
|
- recruitPlanMain.setDelFlag("0");
|
|
|
- int result = recruitPlanMainService.insertRecruitPlanMain(recruitPlanMain);
|
|
|
+ recruitPM.setAhrsRecruitPlanChildList(recruitPlanChildList);
|
|
|
+ recruitPM.setCreateBy(ShiroUtils.getSysUser().getUserName());
|
|
|
+ recruitPM.setCreateTime(DateUtils.getNowDate());
|
|
|
+ recruitPM.setDelFlag("0");
|
|
|
+ int result = recruitPlanMainService.insertRecruitPlanMain(recruitPM);
|
|
|
if (result == 11){
|
|
|
return AjaxResult.error("招聘计划中的岗位代码重复");
|
|
|
}
|
|
@@ -214,12 +201,11 @@ public class RecruitPlanMainController extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 修改recruitplan
|
|
|
+ * 修改RecruitPlanMain
|
|
|
*/
|
|
|
@GetMapping("/edit/{recruitPlanMainId}")
|
|
|
public String edit(@PathVariable("recruitPlanMainId") Long recruitPlanMainId, ModelMap mmap)
|
|
|
{
|
|
|
-
|
|
|
RecruitPlanMain recruitPlanMain = recruitPlanMainService.selectRecruitPlanMainById(recruitPlanMainId);
|
|
|
//默认生成一个岗位代码
|
|
|
String deptIdStr =String.valueOf(getDeptId().intValue()) ;
|
|
@@ -228,10 +214,8 @@ public class RecruitPlanMainController extends BaseController
|
|
|
String postNumIdStr = deptIdStr+mathCode;
|
|
|
int countNum = 0;
|
|
|
|
|
|
- RecruitPlan recruitPlan = new RecruitPlan();
|
|
|
- recruitPlan.setRecruitPlanYear(recruitPlanMain.getRecruitPlanYear());
|
|
|
- recruitPlan.setRecruitPlanMainId(recruitPlanMainId);
|
|
|
- recruitPlan.setDeptName(recruitPlanMain.getDeptName());
|
|
|
+ RecruitPlanMain recruitPM = new RecruitPlanMain();
|
|
|
+
|
|
|
List<RecruitPlanChild> recruitPlanMainList = recruitPlanMain.getAhrsRecruitPlanChildList();
|
|
|
for (RecruitPlanChild recruitPlanChild : recruitPlanMainList){
|
|
|
countNum = (int)(Math.random()*10);
|
|
@@ -240,44 +224,37 @@ public class RecruitPlanMainController extends BaseController
|
|
|
recruitPlanChild.setYprs(personnelCount);
|
|
|
countNum++;
|
|
|
}
|
|
|
- recruitPlan.setRecruitPlanYear(recruitPlanMain.getRecruitPlanYear());
|
|
|
- recruitPlan.setColumns(recruitPlanMain.getAhrsRecruitPlanChildList());
|
|
|
- recruitPlan.setAttachment(recruitPlanMain.getAttachment());
|
|
|
- recruitPlan.setRecruitPlanMainId(recruitPlanMainId);
|
|
|
- recruitPlan.setRemark(recruitPlanMain.getRemark());
|
|
|
+ recruitPM.setRecruitPlanYear(recruitPlanMain.getRecruitPlanYear());
|
|
|
+ recruitPM.setRecruitPlanMainId(recruitPlanMainId);
|
|
|
+ recruitPM.setDeptName(recruitPlanMain.getDeptName());
|
|
|
+ recruitPM.setColumns(recruitPlanMain.getAhrsRecruitPlanChildList());
|
|
|
+ recruitPM.setAttachment(recruitPlanMain.getAttachment());
|
|
|
+ recruitPM.setRemark(recruitPlanMain.getRemark());
|
|
|
|
|
|
- mmap.put("recruitPlan",recruitPlan);
|
|
|
- mmap.put("recruitPlanYears",recruitPlan.getRecruitPlanYear());
|
|
|
+ mmap.put("RecruitPlanMain",recruitPM);
|
|
|
+ mmap.put("recruitPlanYears",recruitPM.getRecruitPlanYear());
|
|
|
mmap.put("postNumIdStr",postNumIdStr);
|
|
|
- mapNeed.put("recruitList",recruitPlan.getColumns());
|
|
|
+ mapNeed.put("recruitList",recruitPM.getColumns());
|
|
|
return prefix + "/edit";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 修改保存recruitplan
|
|
|
+ * 修改保存RecruitPlanMain
|
|
|
*/
|
|
|
@RequiresPermissions("recruitplan:recruit:edit")
|
|
|
- @Log(title = "recruitplan", businessType = BusinessType.UPDATE)
|
|
|
+ @Log(title = "recruitplanMain", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/edit")
|
|
|
@ResponseBody
|
|
|
- public AjaxResult editSave(RecruitPlan recruitPlan)
|
|
|
+ public AjaxResult editSave(RecruitPlanMain recruitPM)
|
|
|
{
|
|
|
try {
|
|
|
- RecruitPlanMain recruitPlanMain = new RecruitPlanMain();
|
|
|
- recruitPlanMain.setRecruitPlanMainId(recruitPlan.getRecruitPlanMainId());
|
|
|
- recruitPlanMain.setDeptName(recruitPlan.getDeptName());
|
|
|
- recruitPlanMain.setAttachment(recruitPlan.getAttachment());
|
|
|
- recruitPlanMain.setRecruitPlanYear(recruitPlan.getRecruitPlanYear());
|
|
|
- recruitPlanMain.setDeptId(getDeptId());
|
|
|
- recruitPlanMain.setRemark(recruitPlan.getRemark());
|
|
|
-
|
|
|
+ List<RecruitPlanChild> recruitPlanChildList = recruitPM.getColumns();
|
|
|
//给修改招聘计划中的子计划delFlag赋值为"0''
|
|
|
- List<RecruitPlanChild> recruitPlanChildList = recruitPlan.getColumns();
|
|
|
recruitPlanChildList.forEach(recruitPlanChild -> recruitPlanChild.setDelFlag("0"));
|
|
|
- recruitPlanMain.setAhrsRecruitPlanChildList(recruitPlanChildList);
|
|
|
- recruitPlanMain.setUpdateBy(ShiroUtils.getSysUser().getUserName());
|
|
|
- recruitPlanMain.setUpdateTime(DateUtils.getNowDate());
|
|
|
- int result = recruitPlanMainService.updateRecruitPlanMain(recruitPlanMain);
|
|
|
+ recruitPM.setAhrsRecruitPlanChildList(recruitPlanChildList);
|
|
|
+ recruitPM.setUpdateBy(ShiroUtils.getSysUser().getUserName());
|
|
|
+ recruitPM.setUpdateTime(DateUtils.getNowDate());
|
|
|
+ int result = recruitPlanMainService.updateRecruitPlanMain(recruitPM);
|
|
|
if (result == 11){
|
|
|
return AjaxResult.error("招聘计划中的岗位代码重复");
|
|
|
}
|
|
@@ -290,7 +267,7 @@ public class RecruitPlanMainController extends BaseController
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
- * 删除recruitplan
|
|
|
+ * 删除RecruitPlanMain
|
|
|
*
|
|
|
*/
|
|
|
@RequiresPermissions("recruitplan:recruit:remove")
|
|
@@ -310,7 +287,7 @@ public class RecruitPlanMainController extends BaseController
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
- * 校验recruitplan下是否有招聘人员
|
|
|
+ * 校验RecruitPlanMain下是否有招聘人员
|
|
|
*/
|
|
|
@RequiresPermissions("recruitplan:recruit:remove")
|
|
|
@Log(title = "recruitplan", businessType = BusinessType.DELETE)
|