Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

xiao547607 4 vuotta sitten
vanhempi
commit
daa3663b91

+ 3 - 2
common/src/main/resources/mapper/job/Recruitment.xml

@@ -205,7 +205,8 @@
 				job_recruitment AS jr
 			INNER JOIN base_company AS bc
 			INNER JOIN sys_data_dictionary AS sdd
-			INNER JOIN base_city AS bci ON jr.company_id = bc.id_
+			INNER JOIN base_city AS bci
+			INNER JOIN job_work_category AS jwc ON jr.company_id = bc.id_
 			AND bc.scale_ = sdd.id_
 			AND jr.area_ = bci.id_
 		]]>
@@ -226,7 +227,7 @@
 				and jr.education_ like #{searchParams.education}
 			</if>
 			<if test="searchParams.recruitmentPosition != null">
-				and jr.position_ like #{searchParams.recruitmentPosition}
+				and jwc.id_ like #{searchParams.recruitmentPosition}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 183 - 2
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/PersonalApiController.java

@@ -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;
+    }
 }

+ 14 - 5
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/RecruitmentApiController.java

@@ -44,7 +44,7 @@ public class RecruitmentApiController {
 
 
     @PostMapping("getRecruitmentList")
-    @ApiOperation(value = "职位列表")
+    @ApiOperation(value = "求职主页")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "title", value = "标题", required = false, paramType = "form"),
             @ApiImplicitParam(name = "type", value = "类型(1:最新,2:最热)", required = false, paramType = "form"),
@@ -82,10 +82,19 @@ public class RecruitmentApiController {
         if (StringUtils.isNotEmpty(title)) {
             searchParams.put("title", "%"+title+"%");
         }
-        searchParams.put("monthlySalary", monthlySalary);
-        searchParams.put("workExperience", workExperience);
-        searchParams.put("education", education);
-        searchParams.put("recruitmentPosition", recruitmentPosition);
+        if (StringUtils.isNotEmpty(monthlySalary)) {
+            searchParams.put("monthlySalary", monthlySalary);
+        }
+        if (StringUtils.isNotEmpty(workExperience)) {
+            searchParams.put("workExperience", workExperience);
+        }
+        if (StringUtils.isNotEmpty(education)) {
+            searchParams.put("education", education);
+        }
+
+        if (StringUtils.isNotEmpty(recruitmentPosition)) {
+            searchParams.put("recruitmentPosition", recruitmentPosition+"%");
+        }
 
         Page<Map> page = recruitmentService.foundPageList(searchParams,pageIndex,pageSize,true,sortList);