|
@@ -115,7 +115,7 @@ public class RecruitmentController {
|
|
|
recruitment.setWelfare(jsonObject.toString());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
int affectCount = recruitmentService.insert(recruitment);
|
|
|
|
|
|
if (affectCount > 0) {
|
|
@@ -156,6 +156,16 @@ public class RecruitmentController {
|
|
|
|
|
|
Recruitment recruitment = recruitmentService.get(id);
|
|
|
|
|
|
+ Company company = companyService.get(recruitment.getCompanyId());
|
|
|
+ recruitment.setCompanyName(company.getName());
|
|
|
+ recruitment.setCompanyLogo(company.getLogo());
|
|
|
+
|
|
|
+ recruitment.setCompanyIndustryN(dataDictionaryService.getName(company.getIndustry()));
|
|
|
+ recruitment.setCompanyScaleN(dataDictionaryService.getName(company.getScale()));
|
|
|
+ recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
|
|
|
+ recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
|
|
|
+ recruitment.setWageTypeName(dataDictionaryService.getName(recruitment.getWageType()));
|
|
|
+
|
|
|
if (recruitment != null) {
|
|
|
if(StringUtils.isNotEmpty(recruitment.getWelfare())) {
|
|
|
String welfare = recruitment.getWelfare();
|
|
@@ -396,7 +406,7 @@ public class RecruitmentController {
|
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageList(
|
|
|
- String id,
|
|
|
+ String companyId, String area, String position, String status, String approveStatus,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
@@ -411,8 +421,20 @@ public class RecruitmentController {
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("id_","asc"));
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(id)) {
|
|
|
- searchParams.put("id","%" + id + "%");
|
|
|
+ if (StringUtils.isNotEmpty(companyId)) {
|
|
|
+ searchParams.put("companyId",companyId);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(area)) {
|
|
|
+ searchParams.put("area",area);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(position)) {
|
|
|
+ searchParams.put("position",position);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(status)) {
|
|
|
+ searchParams.put("status",status);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(approveStatus)) {
|
|
|
+ searchParams.put("approveStatus",approveStatus);
|
|
|
}
|
|
|
|
|
|
Page<Recruitment> page = recruitmentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
@@ -435,7 +457,6 @@ public class RecruitmentController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value="HR招聘岗位列表")
|
|
|
@RequestMapping(value = "pageListHR",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageListHR(
|
|
@@ -488,4 +509,71 @@ public class RecruitmentController {
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value="下架")
|
|
|
+ @PostMapping("offShelf/{id}")
|
|
|
+ public MessageResult<Integer> offShelf(@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="批量下架")
|
|
|
+ @PostMapping("batchOffShelf")
|
|
|
+ public MessageResult<Integer> batchOffShelf(@RequestBody List<String> idList,@RequestAttribute String subject){
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ int affectCount = 0;
|
|
|
+
|
|
|
+ for (String id : idList) {
|
|
|
+ Recruitment recruitment = recruitmentService.get(id);
|
|
|
+ recruitment.setStatus("0");
|
|
|
+ recruitment.setUpdateBy(subject);
|
|
|
+ recruitment.setUpdateTime(new Date());
|
|
|
+
|
|
|
+ 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;
|
|
|
+ }
|
|
|
}
|