|
|
@@ -1,11 +1,15 @@
|
|
|
package com.jpsoft.enterprise.modules.base.controller;
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
+import com.jpsoft.enterprise.modules.base.dto.RecruitInfoListDTO;
|
|
|
+import com.jpsoft.enterprise.modules.base.entity.CompanyInfo;
|
|
|
+import com.jpsoft.enterprise.modules.base.service.CompanyInfoService;
|
|
|
import com.jpsoft.enterprise.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.enterprise.modules.common.dto.Sort;
|
|
|
import com.jpsoft.enterprise.modules.base.entity.RecruitInfo;
|
|
|
import com.jpsoft.enterprise.modules.base.service.RecruitInfoService;
|
|
|
import com.jpsoft.enterprise.modules.common.utils.PojoUtils;
|
|
|
+import com.jpsoft.enterprise.modules.sys.service.DataDictionaryService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -31,6 +35,12 @@ public class RecruitInfoController {
|
|
|
@Autowired
|
|
|
private RecruitInfoService recruitInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DataDictionaryService dataDictionaryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CompanyInfoService companyInfoService;
|
|
|
+
|
|
|
@ApiOperation(value="创建空记录")
|
|
|
@GetMapping("create")
|
|
|
public MessageResult<RecruitInfo> create(){
|
|
|
@@ -54,6 +64,10 @@ public class RecruitInfoController {
|
|
|
recruitInfo.setDelFlag(false);
|
|
|
recruitInfo.setCreateBy(subject);
|
|
|
recruitInfo.setCreateTime(new Date());
|
|
|
+ CompanyInfo companyInfo = companyInfoService.get(recruitInfo.getCompanyId());
|
|
|
+ if(companyInfo != null) {
|
|
|
+ recruitInfo.setKey(companyInfo.getCompanyName() + "+" + recruitInfo.getPositionName());
|
|
|
+ }
|
|
|
|
|
|
int affectCount = recruitInfoService.insert(recruitInfo);
|
|
|
|
|
|
@@ -109,6 +123,10 @@ public class RecruitInfoController {
|
|
|
try {
|
|
|
recruitInfo.setUpdateBy(subject);
|
|
|
recruitInfo.setUpdateTime(new Date());
|
|
|
+ CompanyInfo companyInfo = companyInfoService.get(recruitInfo.getCompanyId());
|
|
|
+ if(companyInfo != null) {
|
|
|
+ recruitInfo.setKey(companyInfo.getCompanyName() + "+" + recruitInfo.getPositionName());
|
|
|
+ }
|
|
|
|
|
|
int affectCount = recruitInfoService.update(recruitInfo);
|
|
|
|
|
|
@@ -201,6 +219,8 @@ public class RecruitInfoController {
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageList(
|
|
|
String id,
|
|
|
+ @RequestParam(value="companyId",defaultValue="") String companyId,
|
|
|
+ @RequestParam(value="positionName",defaultValue="") String positionName,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
|
@@ -213,16 +233,31 @@ public class RecruitInfoController {
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("create_time","desc"));
|
|
|
+ sortList.add(new Sort("a.create_time","desc"));
|
|
|
|
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
|
searchParams.put("id","%" + id + "%");
|
|
|
}
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(companyId)) {
|
|
|
+ searchParams.put("companyId",companyId);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(positionName)) {
|
|
|
+ searchParams.put("positionName","%" + positionName + "%");
|
|
|
+ }
|
|
|
+
|
|
|
Page<RecruitInfo> page = recruitInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+ Page<RecruitInfoListDTO> pageDTO = PojoUtils.convertPage(page, RecruitInfoListDTO.class);
|
|
|
+ for(RecruitInfoListDTO dto : pageDTO.getResult()){
|
|
|
+ dto.setWorkRegionName(dataDictionaryService.findNameByCatalogNameAndValue("区域",dto.getWorkRegion()));
|
|
|
+ dto.setWorkYearName(dataDictionaryService.findNameByCatalogNameAndValue("工作年限",dto.getWorkYear()));
|
|
|
+ dto.setEducationName(dataDictionaryService.findNameByCatalogNameAndValue("学历",dto.getEducation()));
|
|
|
+ dto.setSalaryLevelName(dataDictionaryService.findNameByCatalogNameAndValue("薪资水平",dto.getSalaryLevel()));
|
|
|
+ }
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
- msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(pageDTO));
|
|
|
|
|
|
return msgResult;
|
|
|
}
|