Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

yanliming 4 éve
szülő
commit
6b98609dfb

+ 21 - 0
common/src/main/java/com/jpsoft/enterprise/modules/base/dto/RecruitInfoListDTO.java

@@ -1,6 +1,11 @@
 package com.jpsoft.enterprise.modules.base.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
 
 /**
  * @author 墨鱼_mo
@@ -38,4 +43,20 @@ public class RecruitInfoListDTO {
     private String contactPhone;
 
     private Boolean status;
+
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "关键字")
+    private String key;
 }

+ 2 - 0
common/src/main/java/com/jpsoft/enterprise/modules/base/entity/RecruitInfo.java

@@ -21,6 +21,8 @@ public class RecruitInfo {
     private String id;
     @ApiModelProperty(value = "公司id")
     private String companyId;
+    @ApiModelProperty(value = "公司名称")
+    private String companyName;
     @ApiModelProperty(value = "职务名称")
     private String positionName;
     @ApiModelProperty(value = "公司区域(数据字典:区域)")

+ 7 - 3
common/src/main/resources/mapper/base/ActivityInfo.xml

@@ -101,12 +101,16 @@
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="ActivityInfoMap">
 		<![CDATA[
-			select * from base_activity_info
+			select a.* from
+			base_activity_info a
 		]]>
 		<where>
-			del_flag = 0
+			a.del_flag = 0
 			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+				and a.ID_ like #{searchParams.id}
+			</if>
+			<if test="searchParams.title != null">
+				and a.title_ like #{searchParams.title}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 18 - 10
common/src/main/resources/mapper/base/RecruitInfo.xml

@@ -116,33 +116,41 @@
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="RecruitInfoMap">
 		<![CDATA[
-			select * from base_recruit_info
+			SELECT
+				a.*,
+				b.company_name AS companyName
+			FROM
+				base_recruit_info a
+				LEFT JOIN base_company_info b ON a.company_id = b.id_
 		]]>
 		<where>
-			del_flag = 0
+			a.del_flag = 0
 			<if test="searchParams.id != null">
-				and ID_ = #{searchParams.id}
+				and a.ID_ = #{searchParams.id}
+			</if>
+			<if test="searchParams.positionName != null">
+				and a.position_name like #{searchParams.positionName}
 			</if>
 			<if test="searchParams.region != null">
-				and work_region = #{searchParams.region}
+				and a.work_region = #{searchParams.region}
 			</if>
 			<if test="searchParams.salaryLevel != null">
-				and salary_level = #{searchParams.salaryLevel}
+				and a.salary_level = #{searchParams.salaryLevel}
 			</if>
 			<if test="searchParams.workYear != null">
-				and work_year = #{searchParams.workYear}
+				and a.work_year = #{searchParams.workYear}
 			</if>
 			<if test="searchParams.education != null">
-				and education_ = #{searchParams.education}
+				and a.education_ = #{searchParams.education}
 			</if>
 			<if test="searchParams.companyId != null">
-				and company_id = #{searchParams.companyId}
+				and a.company_id = #{searchParams.companyId}
 			</if>
 			<if test="searchParams.key != null">
-				and key_ like #{searchParams.key}
+				and a.key_ like #{searchParams.key}
 			</if>
 			<if test="searchParams.status != null">
-				and status_ = #{searchParams.status}
+				and a.status_ = #{searchParams.status}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 8 - 1
web/src/main/java/com/jpsoft/enterprise/modules/base/controller/ActivityInfoController.java

@@ -202,6 +202,7 @@ public class ActivityInfoController {
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
             String id,
+            @RequestParam(value="title",defaultValue="") String title,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -214,12 +215,18 @@ public class ActivityInfoController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("a.sort_no","asc"));
+        sortList.add(new Sort("a.create_time","desc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
         }
 
+        if (StringUtils.isNotEmpty(title)) {
+            searchParams.put("title","%" + title + "%");
+        }
+
+
         Page<ActivityInfo> page = activityInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
 
         msgResult.setResult(true);

+ 37 - 2
web/src/main/java/com/jpsoft/enterprise/modules/base/controller/RecruitInfoController.java

@@ -1,11 +1,15 @@
 package com.jpsoft.enterprise.modules.base.controller;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.enterprise.modules.base.dto.RecruitInfoListDTO;
+import com.jpsoft.enterprise.modules.base.entity.CompanyInfo;
+import com.jpsoft.enterprise.modules.base.service.CompanyInfoService;
 import com.jpsoft.enterprise.modules.common.dto.MessageResult;
 import com.jpsoft.enterprise.modules.common.dto.Sort;
 import com.jpsoft.enterprise.modules.base.entity.RecruitInfo;
 import com.jpsoft.enterprise.modules.base.service.RecruitInfoService;
 import com.jpsoft.enterprise.modules.common.utils.PojoUtils;
+import com.jpsoft.enterprise.modules.sys.service.DataDictionaryService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
@@ -31,6 +35,12 @@ public class RecruitInfoController {
     @Autowired
     private RecruitInfoService recruitInfoService;
 
+    @Autowired
+    private DataDictionaryService dataDictionaryService;
+
+    @Autowired
+    private CompanyInfoService companyInfoService;
+
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
     public MessageResult<RecruitInfo> create(){
@@ -54,6 +64,10 @@ public class RecruitInfoController {
             recruitInfo.setDelFlag(false);
             recruitInfo.setCreateBy(subject);
             recruitInfo.setCreateTime(new Date());
+            CompanyInfo companyInfo = companyInfoService.get(recruitInfo.getCompanyId());
+            if(companyInfo != null) {
+                recruitInfo.setKey(companyInfo.getCompanyName() + "+" + recruitInfo.getPositionName());
+            }
             
             int affectCount = recruitInfoService.insert(recruitInfo);
 
@@ -109,6 +123,10 @@ public class RecruitInfoController {
         try {
             recruitInfo.setUpdateBy(subject);
             recruitInfo.setUpdateTime(new Date());
+            CompanyInfo companyInfo = companyInfoService.get(recruitInfo.getCompanyId());
+            if(companyInfo != null) {
+                recruitInfo.setKey(companyInfo.getCompanyName() + "+" + recruitInfo.getPositionName());
+            }
             
             int affectCount = recruitInfoService.update(recruitInfo);
 
@@ -201,6 +219,8 @@ public class RecruitInfoController {
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
             String id,
+            @RequestParam(value="companyId",defaultValue="") String companyId,
+            @RequestParam(value="positionName",defaultValue="") String positionName,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -213,16 +233,31 @@ public class RecruitInfoController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("create_time","desc"));
+        sortList.add(new Sort("a.create_time","desc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
         }
 
+        if (StringUtils.isNotEmpty(companyId)) {
+            searchParams.put("companyId",companyId);
+        }
+
+        if (StringUtils.isNotEmpty(positionName)) {
+            searchParams.put("positionName","%" + positionName + "%");
+        }
+
         Page<RecruitInfo> page = recruitInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+        Page<RecruitInfoListDTO> pageDTO = PojoUtils.convertPage(page, RecruitInfoListDTO.class);
+        for(RecruitInfoListDTO dto : pageDTO.getResult()){
+            dto.setWorkRegionName(dataDictionaryService.findNameByCatalogNameAndValue("区域",dto.getWorkRegion()));
+            dto.setWorkYearName(dataDictionaryService.findNameByCatalogNameAndValue("工作年限",dto.getWorkYear()));
+            dto.setEducationName(dataDictionaryService.findNameByCatalogNameAndValue("学历",dto.getEducation()));
+            dto.setSalaryLevelName(dataDictionaryService.findNameByCatalogNameAndValue("薪资水平",dto.getSalaryLevel()));
+        }
 
         msgResult.setResult(true);
-        msgResult.setData(PojoUtils.pageWrapper(page));
+        msgResult.setData(PojoUtils.pageWrapper(pageDTO));
 
         return msgResult;
     }