|
|
@@ -1,12 +1,20 @@
|
|
|
package com.jpsoft.employment.modules.mobile.controller;
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
+import com.jpsoft.employment.config.OSSConfig;
|
|
|
+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.UserBrowse;
|
|
|
-import com.jpsoft.employment.modules.job.service.UserBrowseService;
|
|
|
+import com.jpsoft.employment.modules.job.dto.ResumeDeliverDTO;
|
|
|
+import com.jpsoft.employment.modules.job.entity.*;
|
|
|
+import com.jpsoft.employment.modules.job.service.*;
|
|
|
+import com.jpsoft.employment.modules.sys.entity.DataDictionary;
|
|
|
+import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
+import com.jpsoft.employment.modules.sys.service.UserService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -24,4 +32,177 @@ import java.util.*;
|
|
|
@RequestMapping("/mobile/personalApi")
|
|
|
@Api(description = "移动端求职者个人中心接口")
|
|
|
public class PersonalApiController {
|
|
|
+ private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ResumeDeliverService resumeDeliverService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private JobUserService jobUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RecruitmentService recruitmentService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ResumeService RsumeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WorkCategoryService workCategoryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DataDictionaryService dataDictionaryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CompanyService companyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ResumeDeliverRecordService resumeDeliverRecordService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private OSSConfig ossConfig;
|
|
|
+
|
|
|
+ @PostMapping("getDeliveryList")
|
|
|
+ @ApiOperation(value = "投递列表")
|
|
|
+ public MessageResult<Map> getDeliveryList(
|
|
|
+ String chatStatus,String name,String token,
|
|
|
+ @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
+ HttpServletRequest request){
|
|
|
+ String subject = (String)request.getAttribute("subject");
|
|
|
+
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("a.create_time","desc"));
|
|
|
+
|
|
|
+ if (!"0".equals(chatStatus)) {
|
|
|
+ searchParams.put("chatStatus",chatStatus);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(name)) {
|
|
|
+ searchParams.put("name","%" + name + "%");
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<ResumeDeliver> page = resumeDeliverService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+
|
|
|
+ Page<ResumeDeliverDTO> pageDto = new Page<>();
|
|
|
+
|
|
|
+ for (ResumeDeliver resumeDeliver:page) {
|
|
|
+ ResumeDeliverDTO dto = new ResumeDeliverDTO();
|
|
|
+
|
|
|
+ dto.setId(resumeDeliver.getId());
|
|
|
+
|
|
|
+ JobUser jobUser = jobUserService.get(resumeDeliver.getJobUserId());
|
|
|
+
|
|
|
+ if(jobUser!=null){
|
|
|
+ dto.setName(jobUser.getRealName());
|
|
|
+ dto.setJobStatus(jobUser.getJobStatus());
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(jobUser.getJobStatus())) {
|
|
|
+ String jobStatusN = dataDictionaryService.findNameByCatalogNameAndValue("工作在职状态", jobUser.getJobStatus());
|
|
|
+ dto.setJobStatusN(jobStatusN);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Recruitment recruitment = recruitmentService.get(resumeDeliver.getJobRecruitmentId());
|
|
|
+
|
|
|
+ if(recruitment!=null){
|
|
|
+
|
|
|
+ dto.setPositionNumber(recruitment.getPositionNumber());
|
|
|
+
|
|
|
+ WorkCategory workCategory = workCategoryService.get(recruitment.getPosition());
|
|
|
+
|
|
|
+ if(workCategory != null) {
|
|
|
+ dto.setPosition(workCategory.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Resume resume = RsumeService.get(resumeDeliver.getJobResumeId());
|
|
|
+
|
|
|
+ if(resume!=null){
|
|
|
+ dto.setDreamMoney(resume.getDreamMoney());
|
|
|
+ dto.setWorkExp(resume.getWorkExp());
|
|
|
+ dto.setEducation(resume.getEducation());
|
|
|
+ dto.setBirthday(resume.getBirthday());
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setChatStatus(resumeDeliver.getChatStatus());
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(resumeDeliver.getChatStatus())) {
|
|
|
+ String chatStatusN = dataDictionaryService.findNameByCatalogNameAndValue("沟通状态", resumeDeliver.getChatStatus());
|
|
|
+ dto.setChatStatusN(chatStatusN);
|
|
|
+
|
|
|
+ String curChatStatus = resumeDeliver.getChatStatus();
|
|
|
+
|
|
|
+ List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("沟通状态");
|
|
|
+
|
|
|
+ List<DataDictionary> newDataDictionaryList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (DataDictionary dataDictionary:dataDictionaryList) {
|
|
|
+ if(Integer.parseInt(dataDictionary.getValue())>Integer.parseInt(curChatStatus)&&!dataDictionary.getName().equals("接受入职")){
|
|
|
+ newDataDictionaryList.add(dataDictionary);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setChatStatusList(newDataDictionaryList);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ pageDto.add(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ pageDto.setPages(page.getPages());
|
|
|
+ pageDto.setTotal(page.getTotal());
|
|
|
+ pageDto.setPageNum(page.getPageNum());
|
|
|
+
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(pageDto));
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("getBrowseRecords")
|
|
|
+ @ApiOperation(value = "浏览记录")
|
|
|
+ public MessageResult<Map> getBrowseRecords(
|
|
|
+ String token,
|
|
|
+ HttpServletRequest request){
|
|
|
+ String subject = (String)request.getAttribute("subject");
|
|
|
+
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("a.create_time","desc"));
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("getCollectionRecord")
|
|
|
+ @ApiOperation(value = "收藏记录")
|
|
|
+ public MessageResult<Map> getCollectionRecord(
|
|
|
+ String token,
|
|
|
+ HttpServletRequest request){
|
|
|
+ String subject = (String)request.getAttribute("subject");
|
|
|
+
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("a.create_time","desc"));
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
}
|