|
@@ -7,13 +7,16 @@ import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
import com.jpsoft.employment.modules.job.entity.Recruitment;
|
|
import com.jpsoft.employment.modules.job.entity.Recruitment;
|
|
|
|
+import com.jpsoft.employment.modules.job.entity.WorkCategory;
|
|
import com.jpsoft.employment.modules.job.service.RecruitmentService;
|
|
import com.jpsoft.employment.modules.job.service.RecruitmentService;
|
|
|
|
+import com.jpsoft.employment.modules.job.service.WorkCategoryService;
|
|
import com.jpsoft.employment.modules.sys.entity.DataDictionary;
|
|
import com.jpsoft.employment.modules.sys.entity.DataDictionary;
|
|
import com.jpsoft.employment.modules.sys.entity.User;
|
|
import com.jpsoft.employment.modules.sys.entity.User;
|
|
import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
import com.jpsoft.employment.modules.sys.service.UserService;
|
|
import com.jpsoft.employment.modules.sys.service.UserService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
+import net.sf.json.JSONObject;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -38,6 +41,8 @@ public class RecruitmentController {
|
|
private DataDictionaryService dataDictionaryService;
|
|
private DataDictionaryService dataDictionaryService;
|
|
@Autowired
|
|
@Autowired
|
|
private UserService userService;
|
|
private UserService userService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private WorkCategoryService workCategoryService;
|
|
|
|
|
|
@ApiOperation(value="创建空记录")
|
|
@ApiOperation(value="创建空记录")
|
|
@GetMapping("create")
|
|
@GetMapping("create")
|
|
@@ -67,12 +72,48 @@ public class RecruitmentController {
|
|
throw new Exception("用户未登录,请先登录!");
|
|
throw new Exception("用户未登录,请先登录!");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Company company = companyService.get(user.getCompanyId());
|
|
|
|
+
|
|
|
|
+ if(company==null){
|
|
|
|
+ throw new Exception("未查询到登录人员所在公司!");
|
|
|
|
+ }
|
|
|
|
+
|
|
recruitment.setId(UUID.randomUUID().toString());
|
|
recruitment.setId(UUID.randomUUID().toString());
|
|
recruitment.setDelFlag(false);
|
|
recruitment.setDelFlag(false);
|
|
recruitment.setCreateBy(subject);
|
|
recruitment.setCreateBy(subject);
|
|
recruitment.setCreateTime(new Date());
|
|
recruitment.setCreateTime(new Date());
|
|
recruitment.setCompanyId(user.getCompanyId());
|
|
recruitment.setCompanyId(user.getCompanyId());
|
|
|
|
+ recruitment.setStatus("1");
|
|
|
|
+ recruitment.setApproveStatus("2");
|
|
|
|
+ recruitment.setReadingTimes(0);
|
|
|
|
+ recruitment.setCollectionTimes(0);
|
|
|
|
+ recruitment.setDeliveryTimes(0);
|
|
|
|
+ if(company!=null){
|
|
|
|
+ recruitment.setArea(company.getArea());
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ //是否面议
|
|
|
|
+ if("0".equals(recruitment.getWelfare())){
|
|
|
|
+ recruitment.setIsDiscussPersonally(true);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ recruitment.setIsDiscussPersonally(false);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //福利待遇相关数据保存
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotEmpty(recruitment.getCheckboxGroup1())){
|
|
|
|
+ jsonObject.put("checkboxGroup1",recruitment.getCheckboxGroup1());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotEmpty(recruitment.getDynamicTags())){
|
|
|
|
+ jsonObject.put("dynamicTags",recruitment.getDynamicTags());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(jsonObject!=null){
|
|
|
|
+ recruitment.setWelfare(jsonObject.toString());
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
int affectCount = recruitmentService.insert(recruitment);
|
|
int affectCount = recruitmentService.insert(recruitment);
|
|
@@ -97,13 +138,82 @@ public class RecruitmentController {
|
|
|
|
|
|
@ApiOperation(value="获取信息")
|
|
@ApiOperation(value="获取信息")
|
|
@GetMapping("edit/{id}")
|
|
@GetMapping("edit/{id}")
|
|
- public MessageResult<Recruitment> edit(@PathVariable("id") String id){
|
|
|
|
|
|
+ public MessageResult<Recruitment> edit(@PathVariable("id") String id,@RequestAttribute String subject){
|
|
MessageResult<Recruitment> msgResult = new MessageResult<>();
|
|
MessageResult<Recruitment> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
try {
|
|
|
|
+ User user = userService.get(subject);
|
|
|
|
+
|
|
|
|
+ if(user==null){
|
|
|
|
+ throw new Exception("用户未登录,请先登录!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Company company = companyService.get(user.getCompanyId());
|
|
|
|
+
|
|
|
|
+ if(company==null){
|
|
|
|
+ throw new Exception("未查询到登录人员所在公司!");
|
|
|
|
+ }
|
|
|
|
+
|
|
Recruitment recruitment = recruitmentService.get(id);
|
|
Recruitment recruitment = recruitmentService.get(id);
|
|
|
|
|
|
if (recruitment != null) {
|
|
if (recruitment != null) {
|
|
|
|
+ if(StringUtils.isNotEmpty(recruitment.getWelfare())) {
|
|
|
|
+ String welfare = recruitment.getWelfare();
|
|
|
|
+
|
|
|
|
+ List<String> tagList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(welfare);
|
|
|
|
+ if(jsonObject!=null){
|
|
|
|
+ String checkboxGroup1 = jsonObject.get("checkboxGroup1").toString();
|
|
|
|
+ String dynamicTags = jsonObject.get("dynamicTags").toString();
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotEmpty(checkboxGroup1)){
|
|
|
|
+ recruitment.setCheckboxGroup1(checkboxGroup1);
|
|
|
|
+
|
|
|
|
+ String[] checkboxGroupArray = checkboxGroup1.split(",");
|
|
|
|
+ for (String dicId:checkboxGroupArray) {
|
|
|
|
+ DataDictionary dataDictionary = dataDictionaryService.get(dicId);
|
|
|
|
+ if(dataDictionary!=null){
|
|
|
|
+ tagList.add(dataDictionary.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotEmpty(dynamicTags)){
|
|
|
|
+ recruitment.setDynamicTags(dynamicTags);
|
|
|
|
+ String[] dynamicTagArray = dynamicTags.split(",");
|
|
|
|
+ for (String name:dynamicTagArray) {
|
|
|
|
+ tagList.add(name);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ recruitment.setTagList(tagList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ recruitment.setCompanyName(company.getName());
|
|
|
|
+ recruitment.setCompanyLogo(company.getLogo());
|
|
|
|
+ recruitment.setIsCertification(company.getIsCertification());
|
|
|
|
+ recruitment.setCompanyScaleN(dataDictionaryService.getName(company.getScale()));
|
|
|
|
+ recruitment.setCompanyIndustryN(dataDictionaryService.getName(company.getIndustry()));
|
|
|
|
+
|
|
|
|
+ recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
|
|
|
|
+ recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
|
|
|
|
+ recruitment.setWageTypeName(dataDictionaryService.getName(recruitment.getWageType()));
|
|
|
|
+
|
|
|
|
+ WorkCategory workCategory = workCategoryService.get(recruitment.getPosition());
|
|
|
|
+ if(workCategory!=null){
|
|
|
|
+ recruitment.setPositionName(workCategory.getName());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotEmpty(recruitment.getPositionSex())){
|
|
|
|
+ recruitment.setPositionSexN(dataDictionaryService.getName(recruitment.getPositionSex()));
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ recruitment.setPositionSexN("男女不限");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
msgResult.setData(recruitment);
|
|
msgResult.setData(recruitment);
|
|
} else {
|
|
} else {
|
|
@@ -129,6 +239,38 @@ public class RecruitmentController {
|
|
try {
|
|
try {
|
|
recruitment.setUpdateBy(subject);
|
|
recruitment.setUpdateBy(subject);
|
|
recruitment.setUpdateTime(new Date());
|
|
recruitment.setUpdateTime(new Date());
|
|
|
|
+
|
|
|
|
+ //是否面议
|
|
|
|
+ if("0".equals(recruitment.getWelfare())){
|
|
|
|
+ recruitment.setIsDiscussPersonally(true);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ recruitment.setIsDiscussPersonally(false);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //福利待遇相关数据保存
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotEmpty(recruitment.getCheckboxGroup1())){
|
|
|
|
+ jsonObject.put("checkboxGroup1",recruitment.getCheckboxGroup1());
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ jsonObject.put("checkboxGroup1","");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotEmpty(recruitment.getDynamicTags())){
|
|
|
|
+ jsonObject.put("dynamicTags",recruitment.getDynamicTags());
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ jsonObject.put("dynamicTags","");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(jsonObject!=null){
|
|
|
|
+ recruitment.setWelfare(jsonObject.toString());
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ recruitment.setWelfare("");
|
|
|
|
+ }
|
|
|
|
|
|
int affectCount = recruitmentService.update(recruitment);
|
|
int affectCount = recruitmentService.update(recruitment);
|
|
|
|
|
|
@@ -182,6 +324,40 @@ public class RecruitmentController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ @ApiOperation(value="下架")
|
|
|
|
+ @PostMapping("down/{id}")
|
|
|
|
+ public MessageResult<Integer> down(@PathVariable("id") String id,@RequestAttribute String subject){
|
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ Recruitment recruitment = recruitmentService.get(id);
|
|
|
|
+ recruitment.setStatus("0");
|
|
|
|
+ recruitment.setUpdateBy(subject);
|
|
|
|
+ recruitment.setUpdateTime(new Date());
|
|
|
|
+
|
|
|
|
+ int affectCount = recruitmentService.update(recruitment);
|
|
|
|
+
|
|
|
|
+ if (affectCount > 0) {
|
|
|
|
+ msgResult.setResult(true);
|
|
|
|
+ msgResult.setData(affectCount);
|
|
|
|
+ } else {
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
+ msgResult.setMessage("下架失败");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch(Exception ex){
|
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
|
+
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return msgResult;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
@ApiOperation(value="批量删除")
|
|
@ApiOperation(value="批量删除")
|
|
@PostMapping("batchDelete")
|
|
@PostMapping("batchDelete")
|
|
public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
|
|
public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
|
|
@@ -247,6 +423,10 @@ public class RecruitmentController {
|
|
recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
|
|
recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
|
|
recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
|
|
recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
|
|
recruitment.setWageTypeName(dataDictionaryService.getName(recruitment.getWageType()));
|
|
recruitment.setWageTypeName(dataDictionaryService.getName(recruitment.getWageType()));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
@@ -259,7 +439,7 @@ public class RecruitmentController {
|
|
@ApiOperation(value="HR招聘岗位列表")
|
|
@ApiOperation(value="HR招聘岗位列表")
|
|
@RequestMapping(value = "pageListHR",method = RequestMethod.POST)
|
|
@RequestMapping(value = "pageListHR",method = RequestMethod.POST)
|
|
public MessageResult<Map> pageListHR(
|
|
public MessageResult<Map> pageListHR(
|
|
- String status,String approveStatus,
|
|
|
|
|
|
+ String status,String approveStatus,String position,
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
@RequestAttribute String subject){
|
|
@RequestAttribute String subject){
|
|
@@ -282,6 +462,10 @@ public class RecruitmentController {
|
|
searchParams.put("approveStatus",approveStatus);
|
|
searchParams.put("approveStatus",approveStatus);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(position)) {
|
|
|
|
+ searchParams.put("position",position);
|
|
|
|
+ }
|
|
|
|
+
|
|
Page<Recruitment> page = recruitmentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
Page<Recruitment> page = recruitmentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
|
|
for(Recruitment recruitment : page.getResult()){
|
|
for(Recruitment recruitment : page.getResult()){
|
|
@@ -291,6 +475,11 @@ public class RecruitmentController {
|
|
recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
|
|
recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
|
|
recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
|
|
recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
|
|
recruitment.setWageTypeName(dataDictionaryService.getName(recruitment.getWageType()));
|
|
recruitment.setWageTypeName(dataDictionaryService.getName(recruitment.getWageType()));
|
|
|
|
+
|
|
|
|
+ WorkCategory workCategory = workCategoryService.get(recruitment.getPosition());
|
|
|
|
+ if(workCategory!=null){
|
|
|
|
+ recruitment.setPositionName(workCategory.getName());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|