浏览代码

Merge remote-tracking branch 'origin/master'

jz.kai 4 年之前
父节点
当前提交
9ef9e7824f

+ 2 - 1
common/src/main/resources/mapper/job/JobUser.xml

@@ -191,7 +191,8 @@
 			  jj.real_name name,
 			  jj.head_image_url headImage,
 			  jre.id_ id,
-			  su.id_ sysUseId
+			  su.id_ sysUseId,
+			  jub.create_time as create_time
 			FROM
 			  job_user_browse jub
 			INNER JOIN job_recruitment jr ON jub.job_recruitment_id = jr.id_

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

@@ -226,11 +226,11 @@
 				sddc.name_ AS industry
 			FROM
 				job_recruitment AS jr
-			INNER JOIN base_company AS bc ON jr.company_id = bc.id_
-			INNER JOIN sys_data_dictionary AS sdda ON bc.scale_ = sdda.id_
-			INNER JOIN sys_data_dictionary AS sddb ON jr.wage_type = sddb.id_
-			INNER JOIN sys_data_dictionary AS sddc ON bc.industry_ = sddc.id_
-			INNER JOIN base_city AS bci ON jr.area_ = bci.id_
+			LEFT JOIN base_company AS bc ON jr.company_id = bc.id_
+			LEFT JOIN sys_data_dictionary AS sdda ON bc.scale_ = sdda.id_
+			LEFT JOIN sys_data_dictionary AS sddb ON jr.wage_type = sddb.id_
+			LEFT JOIN sys_data_dictionary AS sddc ON bc.industry_ = sddc.id_
+			LEFT JOIN base_city AS bci ON jr.area_ = bci.id_
 		]]>
 		<where>
 			<if test="searchParams.title != null">

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

@@ -169,7 +169,7 @@
 			left join job_work_category w on r.position_category_id=w.id_ and w.del_flag=0
 			left join sys_data_dictionary workExpw on r.work_exp=workExpw.id_ and workExpw.del_flag=0  
 			left join sys_data_dictionary eduw on r.education_=eduw.id_ and eduw.del_flag=0 
-			left join sys_data_dictionary sexw on r.sex_=sexw.id_ and sexw.del_flag=0  
+			LEFT JOIN sys_data_dictionary sexw ON r.sex_ = sexw.value_ and sexw.parent_id = '0c3194dc-884d-4ea9-9966-dfb94f537f5c' AND sexw.del_flag = 0
 			left join sys_data_dictionary jobstaw on r.job_status=jobstaw.id_ and jobstaw.del_flag=0  
 			left join sys_data_dictionary drmoneyw on r.dream_money=drmoneyw.id_ and drmoneyw.del_flag=0  
 			) tab
@@ -238,7 +238,7 @@
 			left join job_work_category w on r.position_category_id=w.id_ and w.del_flag=0
 			left join sys_data_dictionary workExpw on r.work_exp=workExpw.id_ and workExpw.del_flag=0  
 			left join sys_data_dictionary eduw on r.education_=eduw.id_ and eduw.del_flag=0  
-			left join sys_data_dictionary sexw on r.sex_=sexw.id_ and sexw.del_flag=0  
+			LEFT JOIN sys_data_dictionary sexw ON r.sex_ = sexw.value_ and sexw.parent_id = '0c3194dc-884d-4ea9-9966-dfb94f537f5c' AND sexw.del_flag = 0
 			left join sys_data_dictionary jobstaw on r.job_status=jobstaw.id_ and jobstaw.del_flag=0
 			left join sys_data_dictionary drmoneyw on r.dream_money=drmoneyw.id_ and drmoneyw.del_flag=0 
 			left join (select count(1) browse_count,job_resume_id from job_user_browse_hr where del_flag=0 group by job_resume_id) rerd  on r.id_=rerd.job_resume_id

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

@@ -101,8 +101,8 @@
 			<if test="searchParams.name != null">
 				and b.real_name like #{searchParams.name}
 			</if>
-			<if test="searchParams.chatStatus != null">
-				and a.chat_status = #{searchParams.chatStatus}
+			<if test="searchParams.userId != null">
+				and a.job_user_id = #{searchParams.userId}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 1 - 0
common/src/main/resources/mapper/job/UserBrowse.xml

@@ -211,6 +211,7 @@
 		]]>
 		<where>
 			and job_user_id = #{searchParams.jobUserId}
+			and b.del_flag=0
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 			${sort.name} ${sort.order}

+ 1 - 0
common/src/main/resources/mapper/job/UserCollection.xml

@@ -157,6 +157,7 @@
 		]]>
 		<where>
 			and job_user_id = #{searchParams.jobUserId}
+			and b.del_flag=0
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 			${sort.name} ${sort.order}

+ 7 - 1
common/src/main/resources/mapper/sys/User.xml

@@ -15,6 +15,7 @@
         <result property="updateBy" column="update_by"/>
         <result property="openId" column="open_id"/>
         <result property="companyId" column="company_id"/>
+        <result property="companyName" column="company_name"/>
     </resultMap>
 
     <resultMap id="UserVOMap" type="com.jpsoft.employment.modules.sys.entity.UserVO" extends="UserMap">
@@ -102,8 +103,10 @@
     </select>
     <select id="search" parameterType="hashmap" resultMap="UserMap">
         <![CDATA[
-			select a.*
+			select a.*,
+			b.name_ as company_name
 			from sys_user a
+			left join base_company b on a.company_id = b.id_
 			where a.del_flag = 0
 		]]>
         <if test="searchParams.userName != null">
@@ -112,6 +115,9 @@
         <if test="searchParams.realName != null">
             and a.real_name like #{searchParams.realName}
         </if>
+        <if test="searchParams.companyId != null">
+            and a.company_id = #{searchParams.companyId}
+        </if>
         <if test="searchParams.roleId != null">
             and a.id_ in (select c.user_id from sys_user_role c where c.role_id = #{searchParams.roleId})
         </if>

+ 12 - 3
web/src/main/java/com/jpsoft/employment/modules/job/controller/RecruitmentController.java

@@ -178,9 +178,18 @@ public class RecruitmentController {
                     List<String> tagList = new ArrayList<>();
 
                     JSONObject jsonObject = JSONObject.fromObject(welfare);
-                    if(jsonObject!=null){
-                        String checkboxGroup1 = jsonObject.get("checkboxGroup1").toString();
-                        String dynamicTags = jsonObject.get("dynamicTags").toString();
+                    if(jsonObject!=null&&jsonObject.size()>0){
+
+                        String checkboxGroup1="";
+                        String dynamicTags="";
+
+                        if(jsonObject.get("checkboxGroup1")!=null){
+                            checkboxGroup1 = jsonObject.get("checkboxGroup1").toString();
+                        }
+
+                        if(jsonObject.get("dynamicTags")!=null){
+                            dynamicTags = jsonObject.get("dynamicTags").toString();
+                        }
 
                         if(StringUtils.isNotEmpty(checkboxGroup1)){
                             recruitment.setCheckboxGroup1(checkboxGroup1);

+ 1 - 4
web/src/main/java/com/jpsoft/employment/modules/job/controller/ResumeController.java

@@ -237,10 +237,7 @@ public class ResumeController {
             resume.setWorkExpName(dataDictionaryService.getName(resume.getWorkExp()));
             resume.setEducationName(dataDictionaryService.getName(resume.getEducation()));
             resume.setJobStatusName(dataDictionaryService.getName(resume.getJobStatus()));
-            if(resume.getUserIsAuthentication() == "1")
-                resume.setUserIsAuthenticationName("已实名");
-            else
-                resume.setUserIsAuthenticationName("未实名");
+            resume.setUserIsAuthenticationName(dataDictionaryService.findNameByCatalogNameAndValue("实名制状态",resume.getUserIsAuthentication()));
             resume.setStatusName(dataDictionaryService.getName(resume.getStatus()));
         }
 

+ 4 - 8
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/ResumeApiController.java

@@ -235,10 +235,7 @@ public class ResumeApiController {
             if(workCategory != null) {
                 resume.setPositionCategoryName(workCategory.getName());
             }
-            if(resume.getUserIsAuthentication() == "1")
-                resume.setUserIsAuthenticationName("已实名");
-            else
-                resume.setUserIsAuthenticationName("未实名");
+            resume.setUserIsAuthenticationName(dataDictionaryService.findNameByCatalogNameAndValue("实名制状态",resume.getUserIsAuthentication()));
             resume.setStatusName(dataDictionaryService.getName(resume.getStatus()));
 
 
@@ -313,10 +310,7 @@ public class ResumeApiController {
             if(workCategory != null) {
                 resume.setPositionCategoryName(workCategory.getName());
             }
-            if(resume.getUserIsAuthentication() == "1")
-                resume.setUserIsAuthenticationName("已实名");
-            else
-                resume.setUserIsAuthenticationName("未实名");
+            resume.setUserIsAuthenticationName(dataDictionaryService.findNameByCatalogNameAndValue("实名制状态",resume.getUserIsAuthentication()));
             resume.setStatusName(dataDictionaryService.getName(resume.getStatus()));
 
             //教育经验
@@ -386,6 +380,8 @@ public class ResumeApiController {
                 searchParams.put("chatStatus",chatStatus);
             }
 
+            searchParams.put("userId",subject);
+
             Page<ResumeDeliver> page = resumeDeliverService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
             for(ResumeDeliver rd : page.getResult()){
                 Recruitment recruitment = recruitmentService.get(rd.getJobRecruitmentId());

+ 2 - 1
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/UserBrowseApiController.java

@@ -48,7 +48,8 @@ public class UserBrowseApiController {
     public MessageResult<Map> pagedLoad( @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
                                          @RequestParam(value="pageSize",defaultValue="20") int pageSize,
                                          @RequestParam(value="type",defaultValue="0") int type,
-                                         @RequestAttribute String subject){
+                                         @RequestAttribute String subject,
+                                         String token){
         try{
             List<Sort> sortList = new ArrayList<>();
 

+ 205 - 0
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/UserBrowseHrApiController.java

@@ -0,0 +1,205 @@
+package com.jpsoft.employment.modules.mobile.controller;
+
+import cn.hutool.core.util.IdcardUtil;
+import com.github.pagehelper.Page;
+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.dto.ResumeDeliverHrDTO;
+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 io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/mobile/userBrowseApi")
+@Api(tags = "移动端接口:招聘方[浏览记录]")
+@Slf4j
+public class UserBrowseHrApiController {
+    @Autowired
+    private UserBrowseHrService userBrowseHrService;
+
+    @Autowired
+    private JobUserService jobUserService;
+
+    @Autowired
+    private ResumeService rsumeService;
+
+    @Autowired
+    private ResumeWorkExperienceService resumeWorkExperienceService;
+
+    @Autowired
+    private DataDictionaryService dataDictionaryService;
+
+    @Autowired
+    private WorkCategoryService workCategoryService;
+
+    @PostMapping("pageListHR")
+    @ApiOperation(value = "浏览记录")
+    public MessageResult<Map> pageListHR(
+            String token,String positionCategoryId,Integer age,String sex,
+            String workExp,String education,String createTimeRange,
+            @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(StringUtils.isNotEmpty(positionCategoryId)){
+            searchParams.put("positionCategoryId",positionCategoryId);
+        }
+
+        if(StringUtils.isNotEmpty(sex)){
+            if(!"100b3725-cb26-4d71-af3c-5b01c98f776b".equals(sex)) {
+                searchParams.put("sex", sex);
+            }
+        }
+
+        if(age!=null){
+            SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
+
+            Calendar cal = Calendar.getInstance();
+
+            cal.setTime(new Date());
+
+            cal.add(Calendar.YEAR,-age);
+
+            String curDate = sdf.format(cal.getTime());
+
+            searchParams.put("curDate",curDate);
+        }
+
+        if(StringUtils.isNotEmpty(workExp)){
+            searchParams.put("workExp",workExp);
+        }
+
+        if(StringUtils.isNotEmpty(education)){
+            searchParams.put("education",education);
+        }
+
+        if (StringUtils.isNotEmpty(createTimeRange)) {
+            String[] timeRangeArray = createTimeRange.split(",");
+            String beginTime = "";
+            String endTime = "";
+            beginTime+=" 00:00:00";
+            if (timeRangeArray.length == 1) {
+                beginTime = timeRangeArray[0];
+            } else if (timeRangeArray.length == 2) {
+                beginTime = timeRangeArray[0];
+                endTime = timeRangeArray[1];
+                beginTime+=" 00:00:00";
+                endTime+=" 23:59:59";
+            }
+
+            searchParams.put("beginTime", beginTime);
+            searchParams.put("endTime", endTime);
+        }
+
+
+        Page<UserBrowseHr> page = userBrowseHrService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+
+        Page<ResumeDeliverHrDTO> pageDto = new Page<>();
+
+        for (UserBrowseHr userBrowseHr:page) {
+
+            ResumeDeliverHrDTO dto = new ResumeDeliverHrDTO();
+
+            dto.setId(userBrowseHr.getId());
+            dto.setCreateTime(userBrowseHr.getCreateTime());
+
+            Resume resume = rsumeService.get(userBrowseHr.getJobResumeId());
+
+            String workExpName="";
+            String dreamMoneyName="";
+            String educationName="";
+            String positionName = "";
+
+
+            if(resume!=null){
+                DataDictionary dataDictionary = dataDictionaryService.get(resume.getWorkExp());
+
+                if(dataDictionary!=null){
+                    workExpName = dataDictionary.getName();
+                }
+
+                DataDictionary dataDictionary1 = dataDictionaryService.get(resume.getDreamMoney());
+                if(dataDictionary1!=null){
+                    dreamMoneyName = dataDictionary1.getName();
+                }
+
+                DataDictionary dataDictionary2 = dataDictionaryService.get(resume.getEducation());
+
+                if(dataDictionary2!=null){
+                    educationName = dataDictionary2.getName();
+                }
+
+
+                List<ResumeWorkExperience> resumeWorkExperienceList = resumeWorkExperienceService.findByResumeId(resume.getId());
+
+                dto.setResumeWorkExperienceList(resumeWorkExperienceList);
+
+
+
+                JobUser jobUser = jobUserService.get(resume.getJobUserId());
+
+                if(jobUser!=null){
+                    dto.setJobUserId(jobUser.getId());
+                    dto.setHeadImageUrl(jobUser.getHeadImageUrl());
+                    dto.setName(jobUser.getRealName());
+                    dto.setSexN(jobUser.getSex());
+                    dto.setUserTel(jobUser.getTel());
+
+                    if(StringUtils.isNotEmpty(jobUser.getIdCard())){
+                        int ageN = IdcardUtil.getAgeByIdCard(jobUser.getIdCard());
+                        dto.setAge(ageN);
+                    }
+                }
+
+                WorkCategory workCategory = workCategoryService.get(resume.getPositionCategoryId());
+                if(workCategory!=null){
+                    positionName = workCategory.getName();
+                }
+            }
+
+            dto.setPositionName(positionName);
+            dto.setWorkExp(workExpName);
+            dto.setEducation(educationName);
+            dto.setDreamMoney(dreamMoneyName);
+
+
+            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;
+    }
+}