浏览代码

Merge remote-tracking branch 'origin/master'

xiao547607 3 年之前
父节点
当前提交
921f0b1ab3

+ 52 - 0
common/src/main/java/com/jpsoft/employment/modules/job/dto/TalentPoolDTO.java

@@ -0,0 +1,52 @@
+package com.jpsoft.employment.modules.job.dto;
+
+import com.jpsoft.employment.modules.job.entity.ResumeWorkExperience;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class TalentPoolDTO {
+
+    @ApiModelProperty(value = "ID")
+    private String Id;
+
+    @ApiModelProperty(value = "头像")
+    private String headImageUrl;
+
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+    @ApiModelProperty(value = "性别")
+    private String sex;
+
+    @ApiModelProperty(value = "年龄")
+    private Integer age;
+
+    @ApiModelProperty(value = "学历")
+    private String educationName;
+
+    @ApiModelProperty(value = "工作经验")
+    private String workExpName;
+
+    @ApiModelProperty(value = "期望职位")
+    private String positionCategoryName;
+
+    @ApiModelProperty(value = "期望薪资")
+    private String dreamMoneyName;
+
+    @ApiModelProperty(value = "工作状态")
+    private String jobStatus;
+
+    @ApiModelProperty(value = "期望工作地点")
+    private String dreamAdd;
+
+    @ApiModelProperty(value = "个人介绍")
+    private String introduction;
+
+    @ApiModelProperty(value = "工作经历")
+    private List<ResumeWorkExperience> resumeWorkExperienceList;
+
+
+}

+ 3 - 0
common/src/main/java/com/jpsoft/employment/modules/job/entity/JobUser.java

@@ -79,4 +79,7 @@ public class JobUser {
 	@ApiModelProperty(value = "身份证照片")
 	private String idCardUrl;
 
+	@ApiModelProperty(value = "工作状态")
+	private String jobStatus;
+
 }

+ 14 - 0
common/src/main/java/com/jpsoft/employment/modules/job/entity/Recruitment.java

@@ -4,6 +4,9 @@ import java.io.Serializable;
 import java.util.Date;
 import java.text.SimpleDateFormat;
 import java.math.BigDecimal;
+import java.util.List;
+
+import com.jpsoft.employment.modules.sys.entity.DataDictionary;
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
@@ -26,6 +29,7 @@ public class Recruitment {
     private String companyScaleN;
     private String companyIndustry;
     private String companyIndustryN;
+    private Boolean isCertification;//是否认证企业
         @ApiModelProperty(value = "标题")
     private String title;
         @ApiModelProperty(value = "招聘所属地区")
@@ -36,6 +40,7 @@ public class Recruitment {
     private String address;
         @ApiModelProperty(value = "职位")
     private String position;
+    private String positionName;
         @ApiModelProperty(value = "职位描述")
     private String positionMessage;
         @ApiModelProperty(value = "任职要求")
@@ -88,4 +93,13 @@ public class Recruitment {
     private Boolean delFlag;
     @ApiModelProperty(value = "岗位分类ID")
     private String workCategoryId;
+    @ApiModelProperty(value = "福利待遇")
+    private String welfare;
+
+
+    @ApiModelProperty(value = "福利待遇(不保存数据库作显示用)")
+    private String dynamicTags;
+    private String checkboxGroup1;
+
+    private List<String> tagList;
 }

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

@@ -23,6 +23,7 @@
 			<result property="isAuthentication" column="is_authentication" />
 			<result property="idCard" column="id_card" />
 			<result property="idCardUrl" column="id_card_url" />
+			<result property="jobStatus" column="job_status" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.job.entity.JobUser">
 	<!--
@@ -32,7 +33,7 @@
 	-->
 	<![CDATA[
 		insert into job_jobuser
-	    (id_,create_by,create_time,update_by,update_time,del_flag,user_name,password_,real_name,open_id,tel_,sex_,birthday_,address_,first_job_time,head_image_url,is_authentication,id_card,id_card_url)
+	    (id_,create_by,create_time,update_by,update_time,del_flag,user_name,password_,real_name,open_id,tel_,sex_,birthday_,address_,first_job_time,head_image_url,is_authentication,id_card,id_card_url,job_status)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -53,7 +54,8 @@
 ,#{headImageUrl,jdbcType=VARCHAR}
 ,#{isAuthentication,jdbcType= VARCHAR }
 ,#{idCard,jdbcType=VARCHAR}
-,#{idCardUrl,jdbcType= NUMERIC }
+,#{idCardUrl,jdbcType= VARCHAR }
+,#{jobStatus,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -115,7 +117,10 @@
 		id_card=#{idCard,jdbcType=VARCHAR},
 		</if>
 				<if test="idCardUrl!=null">
-		id_card_url=#{idCardUrl,jdbcType= NUMERIC },
+		id_card_url=#{idCardUrl,jdbcType= VARCHAR },
+		</if>
+		<if test="jobStatus!=null">
+			job_status=#{jobStatus,jdbcType= VARCHAR },
 		</if>
 		</set>
 	where id_=#{id}
@@ -143,8 +148,11 @@
 			select * from job_jobuser
 		]]>
 		<where>
-			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+			del_flag=false
+			<if test="searchParams.not_jobStatus != null">
+				<![CDATA[
+					and job_status <> #{searchParams.not_jobStatus}
+				]]>
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

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

@@ -32,6 +32,7 @@
 		<result property="updateTime" column="update_time" />
 		<result property="delFlag" column="del_flag" />
 		<result property="workCategoryId" column="work_category_id" />
+		<result property="welfare" column="welfare_" />
 	</resultMap>
 	<resultMap id="RecruitmentVOMap" type="com.jpsoft.employment.modules.job.entity.RecruitmentVO" extends="RecruitmentMap">
 		<result property="positionName" column="position_name" />
@@ -44,7 +45,7 @@
 	-->
 	<![CDATA[
 		insert into job_recruitment
-	    (id_,company_id,title_,area_,address_,position_,position_message,requirements_,position_number,work_year,education_,position_sex,read_times,wage_type,is_discuss_personally,contact_person,tel_,status_,approve_status,reading_times,collection_times,delivery_times,create_by,create_time,update_by,update_time,del_flag,work_category_id)
+	    (id_,company_id,title_,area_,address_,position_,position_message,requirements_,position_number,work_year,education_,position_sex,read_times,wage_type,is_discuss_personally,contact_person,tel_,status_,approve_status,reading_times,collection_times,delivery_times,create_by,create_time,update_by,update_time,del_flag,work_category_id,welfare_)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -75,6 +76,7 @@
 ,#{updateTime,jdbcType= TIMESTAMP }
 ,#{delFlag,jdbcType= NUMERIC }
 ,#{workCategoryId,jdbcType= VARCHAR }
+,#{welfare,jdbcType= VARCHAR }
 		)
 	]]>
 	</insert>
@@ -165,6 +167,9 @@
 			<if test="workCategoryId!=null">
 				work_category_id=#{workCategoryId,jdbcType= VARCHAR },
 			</if>
+			<if test="welfare!=null">
+				welfare_=#{welfare,jdbcType= VARCHAR },
+			</if>
 		</set>
 	where id_=#{id}
 	</update>
@@ -182,8 +187,24 @@
 			select * from job_recruitment
 		]]>
 		<where>
-			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+			del_flag = false
+			<if test="searchParams.companyId != null">
+				and company_id = #{searchParams.companyId}
+			</if>
+			<if test="searchParams.area != null">
+				and area_ = #{searchParams.area}
+			</if>
+			<if test="searchParams.position != null">
+				and position_ = #{searchParams.position}
+			</if>
+			<if test="searchParams.status != null">
+				and status_ = #{searchParams.status}
+			</if>
+			<if test="searchParams.approveStatus != null">
+				and approve_status = #{searchParams.approveStatus}
+			</if>
+			<if test="searchParams.position != null">
+				and position_ = #{searchParams.position}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 268 - 3
web/src/main/java/com/jpsoft/employment/modules/job/controller/JobUserController.java

@@ -1,9 +1,274 @@
 package com.jpsoft.employment.modules.job.controller;
 
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+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.TalentPoolDTO;
+import com.jpsoft.employment.modules.job.entity.JobUser;
+import com.jpsoft.employment.modules.job.entity.Resume;
+import com.jpsoft.employment.modules.job.entity.ResumeWorkExperience;
+import com.jpsoft.employment.modules.job.entity.WorkCategory;
+import com.jpsoft.employment.modules.job.service.JobUserService;
+import com.jpsoft.employment.modules.job.service.ResumeService;
+import com.jpsoft.employment.modules.job.service.ResumeWorkExperienceService;
+import com.jpsoft.employment.modules.job.service.WorkCategoryService;
+import com.jpsoft.employment.modules.sys.entity.DataDictionary;
+import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
+import io.swagger.annotations.ApiOperation;
+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.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @RestController
-@RequestMapping("/job/jobser")
+@RequestMapping("/job/jobUser")
 public class JobUserController {
+
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private JobUserService jobUserService;
+
+    @Autowired
+    private ResumeService resumeService;
+
+    @Autowired
+    private WorkCategoryService workCategoryService;
+
+    @Autowired
+    private DataDictionaryService dataDictionaryService;
+
+    @Autowired
+    private ResumeWorkExperienceService resumeWorkExperienceService;
+
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            @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("create_time","desc"));
+
+        searchParams.put("not_jobStatus","1");
+
+
+        Page<JobUser> page = jobUserService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+        Page<TalentPoolDTO> pageDto = new Page<>();
+
+        for (JobUser jobUser:page) {
+            TalentPoolDTO dto = new TalentPoolDTO();
+
+            dto.setId(jobUser.getId());
+
+            String realName = jobUser.getRealName();
+            if(StringUtils.isNotEmpty(realName)){
+                String familyName = realName.substring(0,1);
+                int num = realName.length();
+                if(num==2){
+                    dto.setRealName(familyName+"*");
+                }
+                else{
+                    dto.setRealName(familyName+"**");
+                }
+            }
+
+            dto.setHeadImageUrl(jobUser.getHeadImageUrl());
+            dto.setSex(jobUser.getSex());
+
+            if(StringUtils.isNotEmpty(jobUser.getIdCard())){
+                int age = IdcardUtil.getAgeByIdCard(jobUser.getIdCard());
+                dto.setAge(age);
+            }
+
+            Resume resume = resumeService.findByUserId(jobUser.getId());
+
+            String workExpName="";
+            String positionCategoryName="";
+            String dreamMoneyName="";
+            String dreamAdd="";
+            String introduction="";
+            String educationName="";
+
+            if(resume!=null){
+                DataDictionary dataDictionary = dataDictionaryService.get(resume.getWorkExp());
+
+                if(dataDictionary!=null){
+                    workExpName = dataDictionary.getName();
+                }
+
+
+                WorkCategory workCategory = workCategoryService.get(resume.getPositionCategoryId());
+                if(workCategory!=null){
+                    positionCategoryName = workCategory.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();
+                }
+
+
+                dreamAdd = resume.getDreamAdd();
+                introduction = resume.getIntroduction();
+            }
+
+            dto.setWorkExpName(workExpName);
+            dto.setEducationName(educationName);
+            dto.setPositionCategoryName(positionCategoryName);
+            dto.setDreamMoneyName(dreamMoneyName);
+            dto.setJobStatus(jobUser.getJobStatus());
+            dto.setDreamAdd(dreamAdd);
+            dto.setIntroduction(introduction);
+
+            pageDto.add(dto);
+        }
+
+        pageDto.setPageSize(page.getPageSize());
+        pageDto.setTotal(page.getTotal());
+        pageDto.setPageNum(page.getPageNum());
+
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(pageDto));
+
+        return msgResult;
+    }
+
+
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("edit/{id}")
+    public MessageResult<TalentPoolDTO> edit(@PathVariable("id") String id){
+        MessageResult<TalentPoolDTO> msgResult = new MessageResult<>();
+
+        try {
+            JobUser jobUser = jobUserService.get(id);
+
+            if (jobUser != null) {
+                TalentPoolDTO dto = new TalentPoolDTO();
+
+                dto.setId(jobUser.getId());
+
+                String realName = jobUser.getRealName();
+                if(StringUtils.isNotEmpty(realName)){
+                    String familyName = realName.substring(0,1);
+                    int num = realName.length();
+                    if(num==2){
+                        dto.setRealName(familyName+"*");
+                    }
+                    else{
+                        dto.setRealName(familyName+"**");
+                    }
+                }
+
+                dto.setHeadImageUrl(jobUser.getHeadImageUrl());
+                dto.setSex(jobUser.getSex());
+
+                if(StringUtils.isNotEmpty(jobUser.getIdCard())){
+                    int age = IdcardUtil.getAgeByIdCard(jobUser.getIdCard());
+                    dto.setAge(age);
+                }
+
+                Resume resume = resumeService.findByUserId(jobUser.getId());
+
+                String workExpName="";
+                String positionCategoryName="";
+                String dreamMoneyName="";
+                String dreamAdd="";
+                String introduction="";
+                String educationName="";
+
+                List<ResumeWorkExperience> resumeWorkExperienceList = new ArrayList<>();
+
+                if(resume!=null){
+                    DataDictionary dataDictionary = dataDictionaryService.get(resume.getWorkExp());
+
+                    if(dataDictionary!=null){
+                        workExpName = dataDictionary.getName();
+                    }
+
+
+                    WorkCategory workCategory = workCategoryService.get(resume.getPositionCategoryId());
+                    if(workCategory!=null){
+                        positionCategoryName = workCategory.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();
+                    }
+
+
+                    dreamAdd = resume.getDreamAdd();
+                    introduction = resume.getIntroduction();
+
+
+                    resumeWorkExperienceList = resumeWorkExperienceService.findByResumeId(resume.getId());
+
+
+                }
+
+                dto.setWorkExpName(workExpName);
+                dto.setEducationName(educationName);
+                dto.setPositionCategoryName(positionCategoryName);
+                dto.setDreamMoneyName(dreamMoneyName);
+                dto.setJobStatus(jobUser.getJobStatus());
+                dto.setDreamAdd(dreamAdd);
+                dto.setIntroduction(introduction);
+                dto.setResumeWorkExperienceList(resumeWorkExperienceList);
+
+
+
+                msgResult.setResult(true);
+                msgResult.setData(dto);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
 }

+ 342 - 5
web/src/main/java/com/jpsoft/employment/modules/job/controller/RecruitmentController.java

@@ -7,11 +7,16 @@ import com.jpsoft.employment.modules.common.utils.PojoUtils;
 import com.jpsoft.employment.modules.common.dto.Sort;
 import com.jpsoft.employment.modules.common.dto.MessageResult;
 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.sys.entity.DataDictionary;
+import com.jpsoft.employment.modules.sys.entity.User;
 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.ApiOperation;
+import net.sf.json.JSONObject;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -34,6 +39,10 @@ public class RecruitmentController {
     private CompanyService companyService;
     @Autowired
     private DataDictionaryService dataDictionaryService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private WorkCategoryService workCategoryService;
 
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
@@ -41,6 +50,9 @@ public class RecruitmentController {
         MessageResult<Recruitment> msgResult = new MessageResult<>();
 
         Recruitment recruitment = new Recruitment();
+        recruitment.setEducation("-1");
+        recruitment.setWorkYear("-1");
+
 
         msgResult.setData(recruitment);
         msgResult.setResult(true);
@@ -54,11 +66,56 @@ public class RecruitmentController {
         MessageResult<Recruitment> msgResult = new MessageResult<>();
 
         try {
+            User user = userService.get(subject);
+
+            if(user==null){
+                throw new Exception("用户未登录,请先登录!");
+            }
+
+            Company company = companyService.get(user.getCompanyId());
+
+            if(company==null){
+                throw new Exception("未查询到登录人员所在公司!");
+            }
+
             recruitment.setId(UUID.randomUUID().toString());
             recruitment.setDelFlag(false);
             recruitment.setCreateBy(subject);
             recruitment.setCreateTime(new Date());
-            
+            recruitment.setCompanyId(user.getCompanyId());
+            recruitment.setStatus("1");
+            recruitment.setApproveStatus("2");
+            recruitment.setReadingTimes(0);
+            recruitment.setCollectionTimes(0);
+            recruitment.setDeliveryTimes(0);
+            if(company!=null){
+                recruitment.setArea(company.getArea());
+            }
+
+            //是否面议
+            if("0".equals(recruitment.getWelfare())){
+                recruitment.setIsDiscussPersonally(true);
+            }
+            else{
+                recruitment.setIsDiscussPersonally(false);
+            }
+
+            //福利待遇相关数据保存
+            JSONObject jsonObject = new JSONObject();
+
+            if(StringUtils.isNotEmpty(recruitment.getCheckboxGroup1())){
+                jsonObject.put("checkboxGroup1",recruitment.getCheckboxGroup1());
+            }
+
+            if(StringUtils.isNotEmpty(recruitment.getDynamicTags())){
+                jsonObject.put("dynamicTags",recruitment.getDynamicTags());
+            }
+
+            if(jsonObject!=null){
+                recruitment.setWelfare(jsonObject.toString());
+            }
+
+
             int affectCount = recruitmentService.insert(recruitment);
 
             if (affectCount > 0) {
@@ -81,13 +138,91 @@ public class RecruitmentController {
 
     @ApiOperation(value="获取信息")
     @GetMapping("edit/{id}")
-    public MessageResult<Recruitment> edit(@PathVariable("id") String id){
+    public MessageResult<Recruitment> edit(@PathVariable("id") String id,@RequestAttribute String subject){
         MessageResult<Recruitment> msgResult = new MessageResult<>();
 
         try {
+            User user = userService.get(subject);
+
+            if(user==null){
+                throw new Exception("用户未登录,请先登录!");
+            }
+
+            Company company = companyService.get(user.getCompanyId());
+
+            if(company==null){
+                throw new Exception("未查询到登录人员所在公司!");
+            }
+
             Recruitment recruitment = recruitmentService.get(id);
 
+            recruitment.setCompanyName(company.getName());
+            recruitment.setCompanyLogo(company.getLogo());
+
+            recruitment.setCompanyIndustryN(dataDictionaryService.getName(company.getIndustry()));
+            recruitment.setCompanyScaleN(dataDictionaryService.getName(company.getScale()));
+            recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
+            recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
+            recruitment.setWageTypeName(dataDictionaryService.getName(recruitment.getWageType()));
+
             if (recruitment != null) {
+                if(StringUtils.isNotEmpty(recruitment.getWelfare())) {
+                    String welfare = recruitment.getWelfare();
+
+                    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(StringUtils.isNotEmpty(checkboxGroup1)){
+                            recruitment.setCheckboxGroup1(checkboxGroup1);
+
+                            String[] checkboxGroupArray = checkboxGroup1.split(",");
+                            for (String dicId:checkboxGroupArray) {
+                                DataDictionary dataDictionary = dataDictionaryService.get(dicId);
+                                if(dataDictionary!=null){
+                                    tagList.add(dataDictionary.getName());
+                                }
+                            }
+                        }
+
+                        if(StringUtils.isNotEmpty(dynamicTags)){
+                            recruitment.setDynamicTags(dynamicTags);
+                            String[] dynamicTagArray = dynamicTags.split(",");
+                            for (String name:dynamicTagArray) {
+                                tagList.add(name);
+                            }
+                        }
+
+                        recruitment.setTagList(tagList);
+                    }
+                }
+
+                recruitment.setCompanyName(company.getName());
+                recruitment.setCompanyLogo(company.getLogo());
+                recruitment.setIsCertification(company.getIsCertification());
+                recruitment.setCompanyScaleN(dataDictionaryService.getName(company.getScale()));
+                recruitment.setCompanyIndustryN(dataDictionaryService.getName(company.getIndustry()));
+
+                recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
+                recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
+                recruitment.setWageTypeName(dataDictionaryService.getName(recruitment.getWageType()));
+
+                WorkCategory workCategory = workCategoryService.get(recruitment.getPosition());
+                if(workCategory!=null){
+                    recruitment.setPositionName(workCategory.getName());
+                }
+
+                if(StringUtils.isNotEmpty(recruitment.getPositionSex())){
+                    recruitment.setPositionSexN(dataDictionaryService.getName(recruitment.getPositionSex()));
+                }
+                else{
+                    recruitment.setPositionSexN("男女不限");
+                }
+
+
                 msgResult.setResult(true);
                 msgResult.setData(recruitment);
             } else {
@@ -113,6 +248,38 @@ public class RecruitmentController {
         try {
             recruitment.setUpdateBy(subject);
             recruitment.setUpdateTime(new Date());
+
+            //是否面议
+            if("0".equals(recruitment.getWelfare())){
+                recruitment.setIsDiscussPersonally(true);
+            }
+            else{
+                recruitment.setIsDiscussPersonally(false);
+            }
+
+            //福利待遇相关数据保存
+            JSONObject jsonObject = new JSONObject();
+
+            if(StringUtils.isNotEmpty(recruitment.getCheckboxGroup1())){
+                jsonObject.put("checkboxGroup1",recruitment.getCheckboxGroup1());
+            }
+            else{
+                jsonObject.put("checkboxGroup1","");
+            }
+
+            if(StringUtils.isNotEmpty(recruitment.getDynamicTags())){
+                jsonObject.put("dynamicTags",recruitment.getDynamicTags());
+            }
+            else{
+                jsonObject.put("dynamicTags","");
+            }
+
+            if(jsonObject!=null){
+                recruitment.setWelfare(jsonObject.toString());
+            }
+            else{
+                recruitment.setWelfare("");
+            }
             
             int affectCount = recruitmentService.update(recruitment);
 
@@ -166,6 +333,40 @@ public class RecruitmentController {
     }
 
 
+    @ApiOperation(value="下架")
+    @PostMapping("down/{id}")
+    public MessageResult<Integer> down(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            Recruitment recruitment = recruitmentService.get(id);
+            recruitment.setStatus("0");
+            recruitment.setUpdateBy(subject);
+            recruitment.setUpdateTime(new Date());
+
+            int affectCount = recruitmentService.update(recruitment);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("下架失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+
+
     @ApiOperation(value="批量删除")
     @PostMapping("batchDelete")
     public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
@@ -204,7 +405,7 @@ public class RecruitmentController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            String companyId, String area, String position, String status, String approveStatus,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -219,8 +420,20 @@ public class RecruitmentController {
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("id_","asc"));
 
-        if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
+        if (StringUtils.isNotEmpty(companyId)) {
+            searchParams.put("companyId",companyId);
+        }
+        if (StringUtils.isNotEmpty(area)) {
+            searchParams.put("area",area);
+        }
+        if (StringUtils.isNotEmpty(position)) {
+            searchParams.put("position",position);
+        }
+        if (StringUtils.isNotEmpty(status)) {
+            searchParams.put("status",status);
+        }
+        if (StringUtils.isNotEmpty(approveStatus)) {
+            searchParams.put("approveStatus",approveStatus);
         }
 
         Page<Recruitment> page = recruitmentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
@@ -231,6 +444,10 @@ public class RecruitmentController {
             recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
             recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
             recruitment.setWageTypeName(dataDictionaryService.getName(recruitment.getWageType()));
+
+
+
+
         }
 
         msgResult.setResult(true);
@@ -238,4 +455,124 @@ public class RecruitmentController {
 
         return msgResult;
     }
+
+    @ApiOperation(value="HR招聘岗位列表")
+    @RequestMapping(value = "pageListHR",method = RequestMethod.POST)
+    public MessageResult<Map> pageListHR(
+            String status,String approveStatus,String position,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            @RequestAttribute String 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("create_time","desc"));
+
+        if (StringUtils.isNotEmpty(status)) {
+            searchParams.put("status",status);
+        }
+
+        if (StringUtils.isNotEmpty(approveStatus)) {
+            searchParams.put("approveStatus",approveStatus);
+        }
+
+        if (StringUtils.isNotEmpty(position)) {
+            searchParams.put("position",position);
+        }
+
+        Page<Recruitment> page = recruitmentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+        for(Recruitment recruitment : page.getResult()){
+            Company company = companyService.get(recruitment.getCompanyId());
+            recruitment.setCompanyName(company.getName());
+
+            recruitment.setWorkYearName(dataDictionaryService.getName(recruitment.getWorkYear()));
+            recruitment.setEducationName(dataDictionaryService.getName(recruitment.getEducation()));
+            recruitment.setWageTypeName(dataDictionaryService.getName(recruitment.getWageType()));
+
+            WorkCategory workCategory = workCategoryService.get(recruitment.getPosition());
+            if(workCategory!=null){
+                recruitment.setPositionName(workCategory.getName());
+            }
+        }
+
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="下架")
+    @PostMapping("offShelf/{id}")
+    public MessageResult<Integer> offShelf(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            Recruitment recruitment = recruitmentService.get(id);
+            recruitment.setStatus("0");
+            recruitment.setUpdateBy(subject);
+            recruitment.setUpdateTime(new Date());
+
+            int affectCount = recruitmentService.update(recruitment);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("下架失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量下架")
+    @PostMapping("batchOffShelf")
+    public MessageResult<Integer> batchOffShelf(@RequestBody List<String> idList,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            for (String id : idList) {
+                Recruitment recruitment = recruitmentService.get(id);
+                recruitment.setStatus("0");
+                recruitment.setUpdateBy(subject);
+                recruitment.setUpdateTime(new Date());
+
+                affectCount += recruitmentService.update(recruitment);
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("下架失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
 }

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

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