fllmoyu 4 лет назад
Родитель
Сommit
48ee65fd02

+ 4 - 0
common/src/main/java/com/jpsoft/enterprise/modules/base/dto/CompanyInfoDetailDTO.java

@@ -32,6 +32,10 @@ public class CompanyInfoDetailDTO {
 
     private List<NewsInfoListDTO> newsInfoDTOList;
 
+    private List<RecruitInfoListDTO> recruitInfoListDTO;
+
+    private Long recruitInfoNum;
+
     private String positionName;
 
 }

+ 2 - 0
common/src/main/java/com/jpsoft/enterprise/modules/base/dto/CompanyInfoListDTO.java

@@ -24,4 +24,6 @@ public class CompanyInfoListDTO {
     private String scaleName;
 
     private String industryName;
+
+    private String address;
 }

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

@@ -17,12 +17,20 @@ public class RecruitInfoListDTO {
 
     private String companyName;
 
+    private String workRegion;
+
     private String workRegionName;
 
+    private String workYear;
+
     private String workYearName;
 
+    private String education;
+
     private String educationName;
 
+    private String salaryLevel;
+
     private String salaryLevelName;
 
     private String describe;

+ 29 - 0
common/src/main/java/com/jpsoft/enterprise/modules/base/dto/WhisperingWallDTO.java

@@ -0,0 +1,29 @@
+package com.jpsoft.enterprise.modules.base.dto;
+
+import lombok.Data;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2021-1-19 9:43
+ */
+@Data
+public class WhisperingWallDTO {
+
+    private String id;
+
+    private String question;
+
+    private String questionCompanyName;
+
+    private Integer type;
+
+    private String typeName;
+
+    private String questionTime;
+
+    private CompanyInfoDetailDTO companyInfoDetailDTO;
+
+    private String answerTime;
+
+    private String answer;
+}

+ 29 - 0
common/src/main/java/com/jpsoft/enterprise/modules/base/dto/WhisperingWallListDTO.java

@@ -0,0 +1,29 @@
+package com.jpsoft.enterprise.modules.base.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2021-1-19 9:02
+ */
+@Data
+public class WhisperingWallListDTO {
+
+    private String id;
+
+    private String question;
+
+    private String answer;
+
+    private String answerCompanyName;
+
+    private String typeName;
+
+    private Integer type;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    private Date createTime;
+}

+ 37 - 22
common/src/main/java/com/jpsoft/enterprise/modules/base/entity/WhisperingWall.java

@@ -4,6 +4,7 @@ import java.io.Serializable;
 import java.util.Date;
 import java.text.SimpleDateFormat;
 import java.math.BigDecimal;
+
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
@@ -11,43 +12,57 @@ import io.swagger.annotations.ApiModel;
 import lombok.Data;
 
 /**
-  描述:base_whispering_wall的实体类
+ * 描述:base_whispering_wall的实体类
  */
 @Data
 @ApiModel(value = "base_whispering_wall的实体类")
 public class WhisperingWall {
-        @ApiModelProperty(value = "编号")
+    @ApiModelProperty(value = "编号")
     private String id;
-        @ApiModelProperty(value = "提问")
+    @ApiModelProperty(value = "提问")
     private String question;
-        @ApiModelProperty(value = "提问人")
+    @ApiModelProperty(value = "提问人")
     private String questionBy;
-        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-	    @ApiModelProperty(value = "提问时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "提问时间")
     private Date questionTime;
-        @ApiModelProperty(value = "回答")
+    @ApiModelProperty(value = "回答")
     private String answer;
-        @ApiModelProperty(value = "回答人")
+    @ApiModelProperty(value = "回答人")
     private String answerBy;
-        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-	    @ApiModelProperty(value = "回答时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "回答时间")
     private Date answerTime;
-        @ApiModelProperty(value = "类型")
+    @ApiModelProperty(value = "类型")
     private Integer type;
-        @ApiModelProperty(value = "是否删除")
+    @ApiModelProperty(value = "是否删除")
     private Boolean delFlag;
-        @ApiModelProperty(value = "创建人")
+    @ApiModelProperty(value = "创建人")
     private String createBy;
-        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-	    @ApiModelProperty(value = "创建时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
     private Date createTime;
-        @ApiModelProperty(value = "更新人")
+    @ApiModelProperty(value = "更新人")
     private String updateBy;
-        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-	    @ApiModelProperty(value = "更新时间")
+    @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 Boolean status = false;
+
+
+    public String getTypeName(){
+        String typeName = "";
+        if (type == 1){
+            typeName = "建议意见";
+        }
+        if (type == 2){
+            typeName = "问题反馈";
+        }
+        return typeName;
+    }
 }

+ 17 - 4
common/src/main/resources/mapper/base/WhisperingWall.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!-- namespace必须指向DAO接口 -->
 <mapper namespace="com.jpsoft.enterprise.modules.base.dao.WhisperingWallDAO">
@@ -17,6 +17,7 @@
 			<result property="createTime" column="create_time" />
 			<result property="updateBy" column="update_by" />
 			<result property="updateTime" column="update_time" />
+			<result property="status" column="status_"/>
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.enterprise.modules.base.entity.WhisperingWall">
 	<!--
@@ -26,7 +27,7 @@
 	-->
 	<![CDATA[
 		insert into base_whispering_wall
-	    (id_,question_,question_by,question_time,answer_,answer_by,answer_time,type_,del_flag,create_by,create_time,update_by,update_time)
+	    (id_,question_,question_by,question_time,answer_,answer_by,answer_time,type_,del_flag,create_by,create_time,update_by,update_time,status_)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -42,6 +43,7 @@
 ,#{createTime,jdbcType= TIMESTAMP }
 ,#{updateBy,jdbcType=VARCHAR}
 ,#{updateTime,jdbcType= TIMESTAMP }
+,#{status,jdbcType=NUMERIC}
 		)
 	]]>
 	</insert>
@@ -87,12 +89,14 @@
 				<if test="updateTime!=null">
 		update_time=#{updateTime,jdbcType= TIMESTAMP },
 		</if>
+			<if test="status!=null">
+				status_=#{status,jdbcType= NUMERIC },
+			</if>
 		</set>
 	where id_=#{id}
 	</update>
 	<select id="get" parameterType="string" resultMap="WhisperingWallMap">
-		select 
-id_,question_,question_by,question_time,answer_,answer_by,answer_time,type_,del_flag,create_by,create_time,update_by,update_time		from base_whispering_wall where id_=#{0}
+		select * from base_whispering_wall where id_=#{0} and del_flag = 0
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
 		select count(*) from base_whispering_wall where id_=#{0}
@@ -109,6 +113,15 @@ id_,question_,question_by,question_time,answer_,answer_by,answer_time,type_,del_
 			<if test="searchParams.question != null">
 				and question_ like #{searchParams.question}
 			</if>
+			<if test="searchParams.questionBy != null">
+				and question_by = #{searchParams.questionBy}
+			</if>
+			<if test="searchParams.type != null">
+				and type_ = #{searchParams.type}
+			</if>
+			<if test="searchParams.status != null">
+				and status_ = #{searchParams.status}
+			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 	        ${sort.name} ${sort.order}

+ 2 - 0
web/src/main/java/com/jpsoft/enterprise/config/WebMvcConfig.java

@@ -76,6 +76,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
 				.excludePathPatterns("/mobile/cooperationInfoApi/cooperationInfoDetail")
 				.excludePathPatterns("/mobile/recruitInfoApi/recruitInfoList")
 				.excludePathPatterns("/mobile/recruitInfoApi/recruitInfoDetail")
+				.excludePathPatterns("/mobile/whisperingWallApi/whisperingWallInfoList")
+				.excludePathPatterns("/mobile/whisperingWallApi/whisperingWallInfoDetail")
 				.excludePathPatterns("/wechat/**")
 
         ;

+ 62 - 33
web/src/main/java/com/jpsoft/enterprise/modules/mobile/controller/CompanyInfoApiController.java

@@ -3,14 +3,8 @@ package com.jpsoft.enterprise.modules.mobile.controller;
 import cn.hutool.core.date.DateUtil;
 import com.github.pagehelper.Page;
 import com.jpsoft.enterprise.modules.base.dto.*;
-import com.jpsoft.enterprise.modules.base.entity.CompanyInfo;
-import com.jpsoft.enterprise.modules.base.entity.IndustryInfo;
-import com.jpsoft.enterprise.modules.base.entity.NewsInfo;
-import com.jpsoft.enterprise.modules.base.entity.NewsType;
-import com.jpsoft.enterprise.modules.base.service.CompanyInfoService;
-import com.jpsoft.enterprise.modules.base.service.IndustryInfoService;
-import com.jpsoft.enterprise.modules.base.service.NewsInfoService;
-import com.jpsoft.enterprise.modules.base.service.NewsTypeService;
+import com.jpsoft.enterprise.modules.base.entity.*;
+import com.jpsoft.enterprise.modules.base.service.*;
 import com.jpsoft.enterprise.modules.common.dto.MessageResult;
 import com.jpsoft.enterprise.modules.common.dto.Sort;
 import com.jpsoft.enterprise.modules.sys.entity.DataDictionary;
@@ -58,6 +52,9 @@ public class CompanyInfoApiController {
     @Autowired
     private IndustryInfoService industryInfoService;
 
+    @Autowired
+    private RecruitInfoService recruitInfoService;
+
     @PostMapping("companyNum")
     @ApiOperation(value = "注册公司数量(公开接口)")
     public MessageResult<Map> companyNum() {
@@ -122,17 +119,17 @@ public class CompanyInfoApiController {
 
             Map<String, Object> map = new HashMap<>();
             List<IndustryListDTO> list = new ArrayList<>();
-            if (StringUtils.isBlank(id)){
+            if (StringUtils.isBlank(id)) {
                 List<IndustryInfo> industryInfoList = industryInfoService.findParentIndustry();
-                if (industryInfoList.size()>0){
-                    for (IndustryInfo industryInfo : industryInfoList){
+                if (industryInfoList.size() > 0) {
+                    for (IndustryInfo industryInfo : industryInfoList) {
                         IndustryListDTO industryListDTO = new IndustryListDTO();
                         industryListDTO.setValue(industryInfo.getId());
                         industryListDTO.setText(industryInfo.getIndustryName());
                         List<IndustryInfo> industryInfoList1 = industryInfoService.findIndustryByParentId(industryInfo.getId());
                         List<IndustryInfoDTO> industryInfoDTOList = new ArrayList<>();
-                        if (industryInfoList1.size()>0){
-                            for (IndustryInfo industryInfo1 : industryInfoList1){
+                        if (industryInfoList1.size() > 0) {
+                            for (IndustryInfo industryInfo1 : industryInfoList1) {
                                 IndustryInfoDTO industryInfoDTO = new IndustryInfoDTO();
                                 industryInfoDTO.setValue(industryInfo1.getId());
                                 industryInfoDTO.setText(industryInfo1.getIndustryName());
@@ -143,10 +140,10 @@ public class CompanyInfoApiController {
                         list.add(industryListDTO);
                     }
                 }
-            }else {
+            } else {
                 List<IndustryInfo> industryInfoList = industryInfoService.findIndustryByParentId(id);
-                if (industryInfoList.size()>0){
-                    for (IndustryInfo industryInfo : industryInfoList){
+                if (industryInfoList.size() > 0) {
+                    for (IndustryInfo industryInfo : industryInfoList) {
                         IndustryListDTO industryListDTO = new IndustryListDTO();
                         industryListDTO.setValue(industryInfo.getId());
                         industryListDTO.setText(industryInfo.getIndustryName());
@@ -156,7 +153,7 @@ public class CompanyInfoApiController {
             }
 
 
-            map.put("list",list);
+            map.put("list", list);
 
             messageResult.setData(map);
             messageResult.setResult(true);
@@ -197,7 +194,7 @@ public class CompanyInfoApiController {
             if (StringUtils.isNotBlank(industry)) {
                 searchParams.put("industry", industry);
             }
-            searchParams.put("inside",0);
+            searchParams.put("inside", 0);
 
             List<Sort> sortList = new ArrayList<>();
             sortList.add(new Sort("create_time", "desc"));
@@ -217,10 +214,10 @@ public class CompanyInfoApiController {
                     IndustryInfo industryInfo = industryInfoService.get(companyInfo.getIndustry());
                     String industryName = industryInfo.getIndustryName();
                     //父行业
-                    if (StringUtils.isNotBlank(industryInfo.getParentId())){
+                    if (StringUtils.isNotBlank(industryInfo.getParentId())) {
                         IndustryInfo industryInfo1 = industryInfoService.get(industryInfo.getParentId());
-                        if (industryInfo1 != null){
-                            industryName = industryInfo1.getIndustryName()+"/"+industryName;
+                        if (industryInfo1 != null) {
+                            industryName = industryInfo1.getIndustryName() + "/" + industryName;
                         }
 
                     }
@@ -279,10 +276,10 @@ public class CompanyInfoApiController {
             IndustryInfo industryInfo = industryInfoService.get(companyInfo.getIndustry());
             String industryName = industryInfo.getIndustryName();
             //父行业
-            if (StringUtils.isNotBlank(industryInfo.getParentId())){
+            if (StringUtils.isNotBlank(industryInfo.getParentId())) {
                 IndustryInfo industryInfo1 = industryInfoService.get(industryInfo.getParentId());
-                if (industryInfo1 != null){
-                    industryName = industryInfo1.getIndustryName()+"/"+industryName;
+                if (industryInfo1 != null) {
+                    industryName = industryInfo1.getIndustryName() + "/" + industryName;
                 }
 
             }
@@ -290,29 +287,61 @@ public class CompanyInfoApiController {
 
             //企业风采
             List<NewsInfoListDTO> newsInfoDTOList = new ArrayList<>();
-            Map<String,Object> searchParams = new HashMap<>();
-            searchParams.put("companyId",companyInfo.getId());
+            Map<String, Object> searchParams = new HashMap<>();
+            searchParams.put("companyId", companyInfo.getId());
 
             List<Sort> sortList = new ArrayList<>();
-            sortList.add(new Sort("a.create_time","desc"));
+            sortList.add(new Sort("a.create_time", "desc"));
 
-            Page<NewsInfo> page = newsInfoService.pageSearch(searchParams,1,3,false,sortList);
+            Page<NewsInfo> page = newsInfoService.pageSearch(searchParams, 1, 3, false, sortList);
 
             List<NewsInfo> newsInfoList = page.getResult();
-            if (newsInfoList.size()>0){
-                for (NewsInfo newsInfo : newsInfoList){
+            if (newsInfoList.size() > 0) {
+                for (NewsInfo newsInfo : newsInfoList) {
                     NewsInfoListDTO newsInfoListDTO = new NewsInfoListDTO();
-                    BeanUtils.copyProperties(newsInfo,newsInfoListDTO);
+                    BeanUtils.copyProperties(newsInfo, newsInfoListDTO);
                     NewsType newsType = newsTypeService.get(newsInfo.getNewsTypeId());
                     newsInfoListDTO.setTypeName(newsType.getName());
-                    newsInfoListDTO.setCreateTime(DateUtil.format(newsInfo.getCreateTime(),"yyyy-MM-dd"));
+                    newsInfoListDTO.setCreateTime(DateUtil.format(newsInfo.getCreateTime(), "yyyy-MM-dd"));
                     newsInfoDTOList.add(newsInfoListDTO);
                 }
             }
 
+
+            List<RecruitInfoListDTO> recruitInfoListDTOList = new ArrayList<>();
+            Map<String, Object> searchParams1 = new HashMap<>();
+            searchParams1.put("companyId", companyInfo.getId());
+            searchParams1.put("status",1);
+
+
+            List<Sort> sortList1 = new ArrayList<>();
+            sortList1.add(new Sort("create_time", "desc"));
+            Page<RecruitInfo> page1 = recruitInfoService.pageSearch(searchParams1, 1, 3, true, sortList1);
+            List<RecruitInfo> recruitInfoList = page1.getResult();
+            if (recruitInfoList.size()>0){
+                for (RecruitInfo recruitInfo : recruitInfoList){
+                    RecruitInfoListDTO recruitInfoListDTO = new RecruitInfoListDTO();
+                    BeanUtils.copyProperties(recruitInfo,recruitInfoListDTO);
+                    recruitInfoListDTO.setCompanyName(companyInfo.getCompanyName());
+                    String workRegionName = dataDictionaryService.findNameByCatalogNameAndValue("区域", recruitInfo.getWorkRegion());
+                    recruitInfoListDTO.setWorkRegionName(workRegionName);
+                    String workYearName = dataDictionaryService.findNameByCatalogNameAndValue("工作年限", recruitInfo.getWorkYear());
+                    recruitInfoListDTO.setWorkYearName(workYearName);
+                    String educationName = dataDictionaryService.findNameByCatalogNameAndValue("学历", recruitInfo.getEducation());
+                    recruitInfoListDTO.setEducationName(educationName);
+                    String salaryLevelName = dataDictionaryService.findNameByCatalogNameAndValue("薪资水平", recruitInfo.getSalaryLevel());
+                    recruitInfoListDTO.setSalaryLevelName(salaryLevelName);
+                    recruitInfoListDTOList.add(recruitInfoListDTO);
+
+                }
+            }
+
+
             companyInfoDetailDTO.setNewsInfoDTOList(newsInfoDTOList);
+            companyInfoDetailDTO.setRecruitInfoListDTO(recruitInfoListDTOList);
+            companyInfoDetailDTO.setRecruitInfoNum(page1.getTotal());
 
-            map.put("companyInfo",companyInfoDetailDTO);
+            map.put("companyInfo", companyInfoDetailDTO);
 
             messageResult.setData(map);
             messageResult.setResult(true);

+ 97 - 30
web/src/main/java/com/jpsoft/enterprise/modules/mobile/controller/RecruitInfoApiController.java

@@ -83,6 +83,7 @@ public class RecruitInfoApiController {
             if (StringUtils.isNotBlank(key)) {
                 searchParams.put("key", "%" + key + "%");
             }
+            searchParams.put("status",1);
             List<Sort> sortList = new ArrayList<>();
             sortList.add(new Sort("create_time", "desc"));
             Page<RecruitInfo> page = recruitInfoService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
@@ -196,7 +197,7 @@ public class RecruitInfoApiController {
             Map<String, Object> searchParams = new HashMap<>();
             searchParams.put("companyId", companyInfo.getId());
             List<Sort> sortList = new ArrayList<>();
-            sortList.add(new Sort("status", "desc"));
+            sortList.add(new Sort("status_", "desc"));
             sortList.add(new Sort("create_time", "desc"));
             Page<RecruitInfo> page = recruitInfoService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
             List<RecruitInfo> recruitInfoList = page.getResult();
@@ -243,18 +244,19 @@ public class RecruitInfoApiController {
     @PostMapping("submitRecruitInfo")
     @ApiOperation(value = "个人招聘信息提交")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "positionName", value = "职务名称", required = true, paramType = "form"),
-            @ApiImplicitParam(name = "workRegion", value = "区域", required = true, paramType = "form"),
-            @ApiImplicitParam(name = "workYear", value = "工作年限", required = true, paramType = "form"),
-            @ApiImplicitParam(name = "education", value = "学历", required = true, paramType = "form"),
-            @ApiImplicitParam(name = "salaryLevel", value = "薪资水平", required = true, paramType = "form"),
-            @ApiImplicitParam(name = "describe", value = "描述", required = true, paramType = "form"),
-            @ApiImplicitParam(name = "contactPhone", value = "联系电话", required = true, paramType = "form"),
-            @ApiImplicitParam(name = "status", value = "是否上架(0:否,1:是)", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "positionName", value = "职务名称", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "workRegion", value = "区域", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "workYear", value = "工作年限", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "education", value = "学历", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "salaryLevel", value = "薪资水平", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "describe", value = "描述", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "contactPhone", value = "联系电话", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "status", value = "是否上架(false:否,true:是)", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "id", value = "主id", required = false, paramType = "form"),
             @ApiImplicitParam(name = "token", value = "令牌", required = true, paramType = "form"),
             @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form"),
     })
-    public MessageResult<Map> submitRecruitInfo(String positionName, String workRegion, String workYear, String education, String salaryLevel, String describe, String contactPhone, String status, String token, @RequestAttribute String subject) {
+    public MessageResult<Map> submitRecruitInfo(String positionName, String workRegion, String workYear, String education, String salaryLevel, String describe, String contactPhone, boolean status,String id, String token, @RequestAttribute String subject) {
         MessageResult<Map> messageResult = new MessageResult<>();
 
         try {
@@ -267,28 +269,93 @@ public class RecruitInfoApiController {
             if (companyInfo == null) {
                 throw new Exception("公司信息有误");
             }
-            RecruitInfo recruitInfo = new RecruitInfo();
-            recruitInfo.setId(UUID.randomUUID().toString());
-            recruitInfo.setCompanyId(companyInfo.getId());
-            recruitInfo.setPositionName(positionName);
-            recruitInfo.setWorkRegion(workRegion);
-            recruitInfo.setWorkYear(workYear);
-            recruitInfo.setEducation(education);
-            recruitInfo.setSalaryLevel(salaryLevel);
-            recruitInfo.setDescribe(describe);
-            recruitInfo.setContactPhone(contactPhone);
-            if ("0".equals(status)){
-                recruitInfo.setStatus(false);
-            }
-            if ("1".equals(status)){
-                recruitInfo.setStatus(true);
+
+            if (StringUtils.isBlank(id)){
+                RecruitInfo recruitInfo = new RecruitInfo();
+                recruitInfo.setId(UUID.randomUUID().toString());
+                recruitInfo.setCompanyId(companyInfo.getId());
+                recruitInfo.setPositionName(positionName);
+                recruitInfo.setWorkRegion(workRegion);
+                recruitInfo.setWorkYear(workYear);
+                recruitInfo.setEducation(education);
+                recruitInfo.setSalaryLevel(salaryLevel);
+                recruitInfo.setDescribe(describe);
+                recruitInfo.setContactPhone(contactPhone);
+                recruitInfo.setStatus(status);
+                recruitInfo.setCreateTime(new Date());
+                recruitInfo.setCreateBy(personInfo.getId());
+                recruitInfo.setDelFlag(false);
+                recruitInfo.setKey(companyInfo.getCompanyName()+"+"+positionName);
+                recruitInfoService.insert(recruitInfo);
+            }else {
+                RecruitInfo recruitInfo = recruitInfoService.get(id);
+                if (StringUtils.isNotBlank(positionName)){
+                    recruitInfo.setPositionName(positionName);
+                }
+                if (StringUtils.isNotBlank(workRegion)){
+                    recruitInfo.setWorkRegion(workRegion);
+                }
+                if (StringUtils.isNotBlank(workYear)){
+                    recruitInfo.setWorkYear(workYear);
+                }
+                if (StringUtils.isNotBlank(education)){
+                    recruitInfo.setEducation(education);
+                }
+                if (StringUtils.isNotBlank(salaryLevel)){
+                    recruitInfo.setSalaryLevel(salaryLevel);
+                }
+                if (StringUtils.isNotBlank(describe)){
+                    recruitInfo.setDescribe(describe);
+                }
+                if (StringUtils.isNotBlank(contactPhone)){
+                    recruitInfo.setContactPhone(contactPhone);
+                }
+                recruitInfo.setStatus(status);
+
+                recruitInfo.setUpdateTime(new Date());
+                recruitInfo.setUpdateBy(personInfo.getId());
+                recruitInfo.setKey(companyInfo.getCompanyName()+"+"+recruitInfo.getPositionName());
+                recruitInfoService.update(recruitInfo);
             }
-            recruitInfo.setCreateTime(new Date());
-            recruitInfo.setCreateBy(personInfo.getId());
-            recruitInfo.setDelFlag(false);
-            recruitInfo.setKey(companyInfo.getCompanyName()+"+"+positionName);
-            recruitInfoService.insert(recruitInfo);
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            messageResult.setCode(400);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
 
+        return messageResult;
+    }
+
+    @PostMapping("deleteRecruitInfo")
+    @ApiOperation(value = "个人招聘信息删除")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "token", value = "令牌", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form")
+    })
+    public MessageResult<Map> deleteRecruitInfo(String id, String token, @RequestAttribute String subject) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+            PersonInfo personInfo = personInfoService.get(subject);
+            if (personInfo == null) {
+                throw new Exception("用户不存在");
+            }
+            CompanyInfo companyInfo = companyInfoService.get(personInfo.getCompanyId());
+            if (companyInfo == null) {
+                throw new Exception("公司信息有误");
+            }
+            RecruitInfo recruitInfo = recruitInfoService.get(id);
+            if (recruitInfo != null){
+                recruitInfo.setDelFlag(true);
+                recruitInfo.setUpdateBy(personInfo.getId());
+                recruitInfo.setUpdateTime(new Date());
+                recruitInfoService.update(recruitInfo);
+            }
 
             messageResult.setResult(true);
             messageResult.setCode(200);

+ 318 - 0
web/src/main/java/com/jpsoft/enterprise/modules/mobile/controller/WhisperingWallApiController.java

@@ -1,17 +1,29 @@
 package com.jpsoft.enterprise.modules.mobile.controller;
 
+import cn.hutool.core.date.DateUtil;
+import com.github.pagehelper.Page;
+import com.jpsoft.enterprise.modules.base.dto.CompanyInfoDetailDTO;
+import com.jpsoft.enterprise.modules.base.dto.RecruitInfoListDTO;
+import com.jpsoft.enterprise.modules.base.dto.WhisperingWallDTO;
+import com.jpsoft.enterprise.modules.base.dto.WhisperingWallListDTO;
+import com.jpsoft.enterprise.modules.base.entity.CompanyInfo;
 import com.jpsoft.enterprise.modules.base.entity.PersonInfo;
+import com.jpsoft.enterprise.modules.base.entity.RecruitInfo;
 import com.jpsoft.enterprise.modules.base.entity.WhisperingWall;
+import com.jpsoft.enterprise.modules.base.service.CompanyInfoService;
 import com.jpsoft.enterprise.modules.base.service.PersonInfoService;
 import com.jpsoft.enterprise.modules.base.service.WhisperingWallService;
 import com.jpsoft.enterprise.modules.common.dto.MessageResult;
 import com.jpsoft.enterprise.modules.common.dto.Sort;
+import com.jpsoft.enterprise.modules.sys.entity.DataDictionary;
+import com.jpsoft.enterprise.modules.sys.service.DataDictionaryService;
 import com.jpsoft.enterprise.modules.sys.service.UserService;
 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;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -26,6 +38,12 @@ public class WhisperingWallApiController {
     @Autowired
     private PersonInfoService personInfoService;
 
+    @Autowired
+    private CompanyInfoService companyInfoService;
+
+    @Autowired
+    private DataDictionaryService dataDictionaryService;
+
     @ApiOperation(value="提问")
     @PostMapping("questions")
     @ApiImplicitParams({
@@ -106,4 +124,304 @@ public class WhisperingWallApiController {
 
         return msgResult;
     }
+
+    @PostMapping("whisperingWallInfoList")
+    @ApiOperation(value = "回音壁列表(公开接口)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "类型(0:全部,1:建议意见,2:困难反馈)", required = true, paramType = "form")
+    })
+    public MessageResult<Map> whisperingWallInfoList(String type, @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex, @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+            List<WhisperingWallListDTO> list = new ArrayList<>();
+
+            Map<String, Object> searchParams = new HashMap<>();
+
+            if (!"0".equals(type)){
+                searchParams.put("type",Integer.valueOf(type));
+            }
+
+            searchParams.put("status",1);
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_time", "desc"));
+            Page<WhisperingWall> page = whisperingWallService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
+            List<WhisperingWall> whisperingWallList = page.getResult();
+            if (whisperingWallList.size() > 0) {
+
+                for (WhisperingWall whisperingWall : whisperingWallList) {
+                    WhisperingWallListDTO whisperingWallListDTO = new WhisperingWallListDTO();
+                    BeanUtils.copyProperties(whisperingWall, whisperingWallListDTO);
+                    //回答者
+                    PersonInfo personInfo = personInfoService.get(whisperingWall.getAnswerBy());
+                    //回答者的公司
+                    CompanyInfo companyInfo = companyInfoService.get(personInfo.getCompanyId());
+                    whisperingWallListDTO.setAnswerCompanyName(companyInfo.getCompanyName());
+                    if (whisperingWall.getType() == 1){
+                        whisperingWallListDTO.setTypeName("建议意见");
+                    }
+                    if (whisperingWall.getType() == 2){
+                        whisperingWallListDTO.setTypeName("困难反馈");
+                    }
+
+
+                    list.add(whisperingWallListDTO);
+
+                }
+            }
+            Map<String, Object> pageMap = new HashMap<>();
+            pageMap.put("recordsTotal", page.getTotal());
+            pageMap.put("recordsFiltered", page.getTotal());
+            pageMap.put("totalPage", page.getPages());
+            pageMap.put("pageNumber", page.getPageNum());
+            pageMap.put("pageSize", page.getPageSize());
+            pageMap.put("data", list);
+
+            messageResult.setData(pageMap);
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            messageResult.setCode(400);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping("whisperingWallInfoDetail")
+    @ApiOperation(value = "回音壁详情(公开接口)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", required = true, paramType = "form")
+    })
+    public MessageResult<WhisperingWallDTO> whisperingWallInfoDetail(String id) {
+        MessageResult<WhisperingWallDTO> messageResult = new MessageResult<>();
+
+        try {
+
+            WhisperingWall whisperingWall = whisperingWallService.get(id);
+            if (whisperingWall == null){
+                throw new Exception("记录不存在");
+            }
+
+            WhisperingWallDTO whisperingWallDTO = new WhisperingWallDTO();
+            BeanUtils.copyProperties(whisperingWall,whisperingWallDTO);
+            //提问者
+            PersonInfo personInfo = personInfoService.get(whisperingWall.getQuestionBy());
+            //提问人的公司
+            CompanyInfo companyInfo = companyInfoService.get(personInfo.getCompanyId());
+            whisperingWallDTO.setQuestionCompanyName(companyInfo.getCompanyName());
+            whisperingWallDTO.setTypeName(whisperingWall.getTypeName());
+            whisperingWallDTO.setQuestionTime(DateUtil.format(whisperingWall.getQuestionTime(),"yyyy-MM-dd"));
+
+            if (StringUtils.isNotBlank(whisperingWall.getAnswerBy())){
+                //回答者
+                PersonInfo personInfo1 = personInfoService.get(whisperingWall.getAnswerBy());
+                //回答者的公司
+                CompanyInfo companyInfo1 = companyInfoService.get(personInfo1.getCompanyId());
+                CompanyInfoDetailDTO companyInfoDetailDTO = new CompanyInfoDetailDTO();
+                BeanUtils.copyProperties(companyInfo1,companyInfoDetailDTO);
+                String  positionName  = dataDictionaryService.findNameByCatalogNameAndValue("企联职务",companyInfo1.getPosition());
+                companyInfoDetailDTO.setPositionName(positionName);
+                whisperingWallDTO.setCompanyInfoDetailDTO(companyInfoDetailDTO);
+                whisperingWallDTO.setAnswerTime(DateUtil.format(whisperingWall.getAnswerTime(),"yyyy-MM-dd"));
+            }
+
+
+            messageResult.setData(whisperingWallDTO);
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            messageResult.setCode(400);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+
+
+    @PostMapping("whisperingWallInfoListByCompany")
+    @ApiOperation(value = "诉求列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "function", value = "功能(1:诉求反应,2:诉求回复)", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "status", value = "状态(1:待回复,2:已回复)", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "token", value = "令牌", required = true, paramType = "form")
+    })
+    public MessageResult<Map> whisperingWallInfoListByCompany(String function, String status, String token, @RequestAttribute String subject,@RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex, @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+            List<WhisperingWallListDTO> list = new ArrayList<>();
+
+            Map<String, Object> searchParams = new HashMap<>();
+
+            PersonInfo personInfo0 = personInfoService.get(subject);
+            if (personInfo0 == null) {
+                throw new Exception("用户不存在");
+            }
+            CompanyInfo companyInfo0 = companyInfoService.get(personInfo0.getCompanyId());
+            if (personInfo0 == null) {
+                throw new Exception("公司信息有误");
+            }
+
+            if ("1".equals(function)){
+                searchParams.put("questionBy",personInfo0.getId());
+            }
+
+            int statusB = 1;
+            if ("1".equals(status)){
+                statusB = 0;
+            }
+
+            searchParams.put("status",statusB);
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_time", "desc"));
+            Page<WhisperingWall> page = whisperingWallService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
+            List<WhisperingWall> whisperingWallList = page.getResult();
+            if (whisperingWallList.size() > 0) {
+
+                for (WhisperingWall whisperingWall : whisperingWallList) {
+                    WhisperingWallListDTO whisperingWallListDTO = new WhisperingWallListDTO();
+                    BeanUtils.copyProperties(whisperingWall, whisperingWallListDTO);
+
+                    if (StringUtils.isNotBlank(whisperingWall.getAnswerBy())){
+                        //回答者
+                        PersonInfo personInfo = personInfoService.get(whisperingWall.getAnswerBy());
+                        //回答者的公司
+                        CompanyInfo companyInfo = companyInfoService.get(personInfo.getCompanyId());
+                        whisperingWallListDTO.setAnswerCompanyName(companyInfo.getCompanyName());
+                    }
+
+                    if (whisperingWall.getType() == 1){
+                        whisperingWallListDTO.setTypeName("建议意见");
+                    }
+                    if (whisperingWall.getType() == 2){
+                        whisperingWallListDTO.setTypeName("困难反馈");
+                    }
+
+
+                    list.add(whisperingWallListDTO);
+
+                }
+            }
+            Map<String, Object> pageMap = new HashMap<>();
+            pageMap.put("recordsTotal", page.getTotal());
+            pageMap.put("recordsFiltered", page.getTotal());
+            pageMap.put("totalPage", page.getPages());
+            pageMap.put("pageNumber", page.getPageNum());
+            pageMap.put("pageSize", page.getPageSize());
+            pageMap.put("data", list);
+
+            messageResult.setData(pageMap);
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            messageResult.setCode(400);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping("submitWhisperingWallInfo")
+    @ApiOperation(value = "提交诉求")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "类型(1:建议意见,2:困难反馈)", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "content", value = "内容", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "token", value = "令牌", required = true, paramType = "form")
+    })
+    public MessageResult<Map> submitWhisperingWallInfo(String type, String content, String token, @RequestAttribute String subject) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+            PersonInfo personInfo = personInfoService.get(subject);
+            if (personInfo == null) {
+                throw new Exception("用户不存在");
+            }
+            CompanyInfo companyInfo = companyInfoService.get(personInfo.getCompanyId());
+            if (companyInfo == null) {
+                throw new Exception("公司信息有误");
+            }
+
+            WhisperingWall whisperingWall = new WhisperingWall();
+            whisperingWall.setId(UUID.randomUUID().toString());
+            whisperingWall.setQuestion(content);
+            whisperingWall.setQuestionBy(personInfo.getId());
+            whisperingWall.setQuestionTime(new Date());
+            whisperingWall.setType(Integer.valueOf(type));
+            whisperingWall.setDelFlag(false);
+            whisperingWall.setCreateBy(personInfo.getId());
+            whisperingWall.setCreateTime(new Date());
+            whisperingWall.setStatus(false);
+            whisperingWallService.insert(whisperingWall);
+
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            messageResult.setCode(400);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping("replyWhisperingWallInfo")
+    @ApiOperation(value = "回复诉求")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "content", value = "回复内容", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "token", value = "令牌", required = true, paramType = "form")
+    })
+    public MessageResult<Map> replyWhisperingWallInfo(String id, String content, String token, @RequestAttribute String subject) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+            PersonInfo personInfo = personInfoService.get(subject);
+            if (personInfo == null) {
+                throw new Exception("用户不存在");
+            }
+            CompanyInfo companyInfo = companyInfoService.get(personInfo.getCompanyId());
+            if (companyInfo == null) {
+                throw new Exception("公司信息有误");
+            }
+
+            WhisperingWall whisperingWall = whisperingWallService.get(id);
+            if (whisperingWall == null){
+                throw new Exception("诉求不存在");
+            }
+            if (whisperingWall.getStatus()){
+                throw new Exception("诉求已回复");
+            }
+
+            whisperingWall.setAnswer(content);
+            whisperingWall.setAnswerBy(personInfo.getId());
+            whisperingWall.setAnswerTime(new Date());
+            whisperingWall.setUpdateBy(personInfo.getId());
+            whisperingWall.setUpdateTime(new Date());
+            whisperingWall.setStatus(true);
+            whisperingWallService.update(whisperingWall);
+
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            messageResult.setCode(400);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
 }