|
|
@@ -1,15 +1,16 @@
|
|
|
package com.jpsoft.employment.modules.mobile.controller;
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
+import com.jpsoft.employment.modules.base.entity.City;
|
|
|
import com.jpsoft.employment.modules.base.entity.Company;
|
|
|
+import com.jpsoft.employment.modules.base.service.CityService;
|
|
|
import com.jpsoft.employment.modules.base.service.CompanyService;
|
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
|
-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.WorkCategoryService;
|
|
|
+import com.jpsoft.employment.modules.job.entity.*;
|
|
|
+import com.jpsoft.employment.modules.job.service.*;
|
|
|
+import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
@@ -42,6 +43,20 @@ public class RecruitmentApiController {
|
|
|
@Autowired
|
|
|
private CompanyService companyService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DataDictionaryService dataDictionaryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CityService cityService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserBrowseService userBrowseService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserCollectionService usercollectionService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ResumeDeliverService resumeDeliverService;
|
|
|
|
|
|
@PostMapping("getRecruitmentList")
|
|
|
@ApiOperation(value = "求职主页")
|
|
|
@@ -124,21 +139,92 @@ public class RecruitmentApiController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
- @PostMapping("getRecruitmentDetails/{id}")
|
|
|
+ @PostMapping("getRecruitmentDetails")
|
|
|
@ApiOperation(value = "招聘详情")
|
|
|
public MessageResult<Map> getRecruitmentDetails(
|
|
|
- @PathVariable("id") String id,
|
|
|
+ String recruitmentId,
|
|
|
String token,
|
|
|
@RequestAttribute String subject){
|
|
|
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
try {
|
|
|
- Recruitment recruitment = recruitmentService.get(id);
|
|
|
+ Recruitment recruitment = recruitmentService.get(recruitmentId);
|
|
|
+ if(recruitment == null){
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("查询错误!");
|
|
|
+ msgResult.setCode(400);
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ int readingTimes = recruitment.getReadingTimes();
|
|
|
+ if(readingTimes < 0){
|
|
|
+ readingTimes = 1;
|
|
|
+ }else{
|
|
|
+ readingTimes++;
|
|
|
+ }
|
|
|
+
|
|
|
+ recruitment.setReadingTimes(readingTimes);
|
|
|
+ //保存点击热度
|
|
|
+ recruitmentService.update(recruitment);
|
|
|
+ //保存浏览记录
|
|
|
+ UserBrowse userBrowse = new UserBrowse();
|
|
|
+ userBrowse.setId(UUID.randomUUID().toString());
|
|
|
+ userBrowse.setCreateBy(subject);
|
|
|
+ userBrowse.setCreateTime(new Date());
|
|
|
+ userBrowse.setDelFlag(false);
|
|
|
+ userBrowse.setJobUserId(subject);
|
|
|
+ userBrowse.setJobRecruitmentId(recruitment.getId());
|
|
|
+ userBrowseService.insert(userBrowse);
|
|
|
+
|
|
|
+ //查询相关信息
|
|
|
Company company = companyService.get(recruitment.getCompanyId());
|
|
|
+ recruitment.setCompanyName(company.getName());
|
|
|
+ recruitment.setCompanyLogo(company.getLogo());
|
|
|
+ recruitment.setCompanyScale(company.getScale());
|
|
|
+ String scaleN = dataDictionaryService.getName(company.getScale());
|
|
|
+ recruitment.setCompanyScaleN(scaleN);
|
|
|
+
|
|
|
+ City city = cityService.get(recruitment.getArea());
|
|
|
+ recruitment.setAreaN(city.getCityName());
|
|
|
+ //薪资要求
|
|
|
+ String wageTypeN = dataDictionaryService.getName(recruitment.getWageType());
|
|
|
+ recruitment.setWageTypeName(wageTypeN);
|
|
|
+ //性别要求
|
|
|
+ String sexN = dataDictionaryService.getName(recruitment.getPositionSex());
|
|
|
+ recruitment.setPositionSexN(sexN);
|
|
|
+ //工作年限
|
|
|
+ String workYearN = dataDictionaryService.getName(recruitment.getWorkYear());
|
|
|
+ recruitment.setWorkYearName(workYearN);
|
|
|
+ //学历要求
|
|
|
+ String educationN = dataDictionaryService.getName(recruitment.getEducation());
|
|
|
+ recruitment.setEducationName(educationN);
|
|
|
+
|
|
|
+ //热度
|
|
|
+// int heatNum = userBrowseService.findNumberByRId(recruitment.getId());
|
|
|
+// if(heatNum < 0 ){
|
|
|
+// heatNum = 0;
|
|
|
+// }
|
|
|
+
|
|
|
+ //收藏状态
|
|
|
+ UserCollection uc = usercollectionService.findByUserIdAndRId(subject,recruitment.getId());
|
|
|
+ Boolean collectionStatus = false;
|
|
|
+ if(uc != null){
|
|
|
+ collectionStatus = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ //是否投递 排除状态为和6未录取
|
|
|
+ ResumeDeliver resumeDeliver = resumeDeliverService.findByUserIdAndRecruitmentId(subject,recruitment.getId(),"6");
|
|
|
+ Boolean deliveryStatus = false;
|
|
|
+ if(resumeDeliver != null){
|
|
|
+ deliveryStatus = true;
|
|
|
+ }
|
|
|
|
|
|
map.put("recruitment",recruitment);
|
|
|
- map.put("company",company);
|
|
|
+ map.put("collectionStatus",collectionStatus);
|
|
|
+ map.put("deliveryStatus",deliveryStatus);
|
|
|
+
|
|
|
|
|
|
if (recruitment != null) {
|
|
|
msgResult.setResult(true);
|