xiao547607 4 anni fa
parent
commit
6dde33da7c
16 ha cambiato i file con 343 aggiunte e 34 eliminazioni
  1. 1 0
      common/src/main/java/com/jpsoft/employment/modules/base/dao/MessageReadDAO.java
  2. 4 0
      common/src/main/java/com/jpsoft/employment/modules/base/entity/MessageNotice.java
  3. 2 0
      common/src/main/java/com/jpsoft/employment/modules/base/entity/MessageRead.java
  4. 1 0
      common/src/main/java/com/jpsoft/employment/modules/base/service/MessageReadService.java
  5. 5 0
      common/src/main/java/com/jpsoft/employment/modules/base/service/impl/MessageReadServiceImpl.java
  6. 1 0
      common/src/main/java/com/jpsoft/employment/modules/job/dao/ResumeDeliverContentDAO.java
  7. 8 0
      common/src/main/java/com/jpsoft/employment/modules/job/entity/ResumeDeliverContent.java
  8. 2 0
      common/src/main/java/com/jpsoft/employment/modules/job/service/ResumeDeliverContentService.java
  9. 5 0
      common/src/main/java/com/jpsoft/employment/modules/job/service/impl/ResumeDeliverContentServiceImpl.java
  10. 18 1
      common/src/main/resources/mapper/base/MessageNotice.xml
  11. 18 1
      common/src/main/resources/mapper/base/MessageRead.xml
  12. 12 9
      common/src/main/resources/mapper/job/Recruitment.xml
  13. 30 1
      common/src/main/resources/mapper/job/ResumeDeliverContent.xml
  14. 2 2
      web/src/main/java/com/jpsoft/employment/modules/job/controller/RecruitmentController.java
  15. 190 20
      web/src/main/java/com/jpsoft/employment/modules/mobile/controller/MessageNoticeApiController.java
  16. 44 0
      web/src/main/java/com/jpsoft/employment/modules/mobile/controller/RecruitmentApiController.java

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dao/MessageReadDAO.java

@@ -16,4 +16,5 @@ public interface MessageReadDAO {
 	int delete(String id);
 	List<MessageRead> list();
 	List<MessageRead> search(Map<String, Object> searchParams, List<Sort> sortList);
+	MessageRead findByMIdAndUserId(String messageId,String userId);
 }

+ 4 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/MessageNotice.java

@@ -52,4 +52,8 @@ public class MessageNotice {
     private Boolean sendWechat;
         @ApiModelProperty(value = "消息模板code")
     private String wechatCode;
+    @ApiModelProperty(value = "是否需要收件人答复")
+    private Boolean isNeedAgree;
+    @ApiModelProperty(value = "投递表ID")
+    private String deliverId;
 }

+ 2 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/MessageRead.java

@@ -38,4 +38,6 @@ public class MessageRead {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
 	    @ApiModelProperty(value = "更新时间")
     private Date updateTime;
+    @ApiModelProperty(value = "是否同意")
+    private Boolean isAgree;
 }

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/MessageReadService.java

@@ -14,4 +14,5 @@ public interface MessageReadService {
 	int delete(String id);
 	List<MessageRead> list();
 	Page<MessageRead> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+	MessageRead findByMIdAndUserId(String messageId,String userId);
 }

+ 5 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/impl/MessageReadServiceImpl.java

@@ -68,4 +68,9 @@ public class MessageReadServiceImpl implements MessageReadService {
         
         return page;
 	}
+
+	@Override
+	public MessageRead findByMIdAndUserId(String messageId,String userId){
+		return messageReadDAO.findByMIdAndUserId(messageId,userId);
+	}
 }

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/job/dao/ResumeDeliverContentDAO.java

@@ -16,4 +16,5 @@ public interface ResumeDeliverContentDAO {
 	int delete(String id);
 	List<ResumeDeliverContent> list();
 	List<ResumeDeliverContent> search(Map<String, Object> searchParams, List<Sort> sortList);
+	ResumeDeliverContent findTopByUserId(String userId);
 }

+ 8 - 0
common/src/main/java/com/jpsoft/employment/modules/job/entity/ResumeDeliverContent.java

@@ -50,4 +50,12 @@ public class ResumeDeliverContent {
     private String entryDepartment;
         @ApiModelProperty(value = "备注-拒绝原因")
     private String remark;
+    @ApiModelProperty(value = "用户ID")
+    private String jobUserId;
+
+    @ApiModelProperty(value = "简历ID")
+    private String jobResumeId;
+
+    @ApiModelProperty(value = "招聘ID")
+    private String jobRecruitmentId;
 }

+ 2 - 0
common/src/main/java/com/jpsoft/employment/modules/job/service/ResumeDeliverContentService.java

@@ -3,6 +3,7 @@ package com.jpsoft.employment.modules.job.service;
 import java.util.List;
 import java.util.Map;
 import com.github.pagehelper.Page;
+import com.jpsoft.employment.modules.base.entity.MessageNotice;
 import com.jpsoft.employment.modules.common.dto.Sort;
 import com.jpsoft.employment.modules.job.entity.ResumeDeliverContent;
 
@@ -14,4 +15,5 @@ public interface ResumeDeliverContentService {
 	int delete(String id);
 	List<ResumeDeliverContent> list();
 	Page<ResumeDeliverContent> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+	ResumeDeliverContent findTopByUserId(String userId);
 }

+ 5 - 0
common/src/main/java/com/jpsoft/employment/modules/job/service/impl/ResumeDeliverContentServiceImpl.java

@@ -68,4 +68,9 @@ public class ResumeDeliverContentServiceImpl implements ResumeDeliverContentServ
         
         return page;
 	}
+
+	@Override
+	public ResumeDeliverContent findTopByUserId(String userId){
+		return resumeDeliverContentDAO.findTopByUserId(userId);
+	}
 }

+ 18 - 1
common/src/main/resources/mapper/base/MessageNotice.xml

@@ -20,6 +20,8 @@
 			<result property="noticeLink" column="notice_link" />
 			<result property="sendWechat" column="send_wechat" />
 			<result property="wechatCode" column="wechat_code" />
+			<result property="isNeedAgree" column="is_need_agree" />
+			<result property="deliverId" column="deliver_id" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.MessageNotice">
 	<!--
@@ -29,7 +31,8 @@
 	-->
 	<![CDATA[
 		insert into base_message_notice
-	    (id_,title_,content_,recipient_id,status_,del_flag,create_by,create_time,update_by,update_time,classify_,type_,notice_link,send_wechat,wechat_code)
+	    (id_,title_,content_,recipient_id,status_,del_flag,create_by,create_time,update_by,update_time,classify_,type_,notice_link,send_wechat,wechat_code,
+	    is_need_agree,deliver_id)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -47,6 +50,8 @@
 ,#{noticeLink,jdbcType=VARCHAR}
 ,#{sendWechat,jdbcType= NUMERIC }
 ,#{wechatCode,jdbcType=VARCHAR}
+,#{isNeedAgree,jdbcType=NUMERIC}
+,#{deliverId,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -98,6 +103,18 @@
 				<if test="wechatCode!=null">
 		wechat_code=#{wechatCode,jdbcType=VARCHAR},
 		</if>
+			<if test="isNeedAgree!=null">
+				is_need_agree=#{isNeedAgree,jdbcType=NUMERIC},
+			</if>
+			<if test="jobResumeId!=null">
+				job_resume_id=#{jobResumeId,jdbcType=VARCHAR},
+			</if>
+			<if test="jobRecruitmentId!=null">
+				job_recruitment_id=#{jobRecruitmentId,jdbcType=VARCHAR},
+			</if>
+			<if test="deliverId!=null">
+				deliver_id=#{deliverId,jdbcType=VARCHAR},
+			</if>
 		</set>
 	where id_=#{id}
 	</update>

+ 18 - 1
common/src/main/resources/mapper/base/MessageRead.xml

@@ -13,6 +13,7 @@
 			<result property="createTime" column="create_time" />
 			<result property="updateBy" column="update_by" />
 			<result property="updateTime" column="update_time" />
+			<result property="isAgree" column="is_agree" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.MessageRead">
 	<!--
@@ -22,7 +23,8 @@
 	-->
 	<![CDATA[
 		insert into base_message_read
-	    (id_,message_id,user_id,is_read,del_flag,create_by,create_time,update_by,update_time)
+	    (id_,message_id,user_id,is_read,del_flag,create_by,create_time,update_by,update_time,
+	    is_agree)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -34,6 +36,7 @@
 ,#{createTime,jdbcType= TIMESTAMP }
 ,#{updateBy,jdbcType=VARCHAR}
 ,#{updateTime,jdbcType= TIMESTAMP }
+,#{isAgree,jdbcType=NUMERIC}
 		)
 	]]>
 	</insert>
@@ -67,6 +70,9 @@
 				<if test="updateTime!=null">
 		update_time=#{updateTime,jdbcType= TIMESTAMP },
 		</if>
+			<if test="isAgree!=null">
+				is_agree=#{isAgree,jdbcType=NUMERIC},
+			</if>
 		</set>
 	where id_=#{id}
 	</update>
@@ -92,4 +98,15 @@
 	        ${sort.name} ${sort.order}
 	 	</foreach>
 	</select>
+	<select id="findByMIdAndUserId" resultMap="MessageReadMap">
+		SELECT
+			*
+		FROM
+			base_message_read
+		WHERE
+			del_flag = 0
+			and message_id = #{messageId}
+			and user_id = #{userId}
+	</select>
+
 </mapper>

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

@@ -187,28 +187,31 @@
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="RecruitmentMap">
 		<![CDATA[
-			select * from job_recruitment
+			select a.* from job_recruitment a
 		]]>
 		<where>
-			del_flag = false
+			a.del_flag = false
 			<if test="searchParams.companyId != null">
-				and company_id = #{searchParams.companyId}
+				and a.company_id = #{searchParams.companyId}
 			</if>
 			<if test="searchParams.area != null">
-				and area_ = #{searchParams.area}
+				and a.area_ = #{searchParams.area}
 			</if>
 			<if test="searchParams.position != null">
-				and position_ = #{searchParams.position}
+				and a.position_ = #{searchParams.position}
 			</if>
 			<if test="searchParams.status != null">
-				and status_ = #{searchParams.status}
+				and a.status_ = #{searchParams.status}
 			</if>
 			<if test="searchParams.approveStatus != null">
-				and approve_status = #{searchParams.approveStatus}
+				and a.approve_status = #{searchParams.approveStatus}
 			</if>
-			<if test="searchParams.position != null">
-				and position_ = #{searchParams.position}
+			<if test="searchParams.positionList != null">
+				<foreach item="position" collection="positionList"  open="and a.position_ in (" separator="," close=")">
+					#{position.id}
+				</foreach>
 			</if>
+
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 	        ${sort.name} ${sort.order}

+ 30 - 1
common/src/main/resources/mapper/job/ResumeDeliverContent.xml

@@ -19,6 +19,9 @@
 			<result property="entryPost" column="entry_post" />
 			<result property="entryDepartment" column="entry_department" />
 			<result property="remark" column="remark_" />
+			<result property="jobUserId" column="job_user_id" />
+			<result property="jobResumeId" column="job_resume_id" />
+			<result property="jobRecruitmentId" column="job_recruitment_id" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.job.entity.ResumeDeliverContent">
 	<!--
@@ -28,7 +31,8 @@
 	-->
 	<![CDATA[
 		insert into job_resume_deliver_content
-	    (id_,create_by,create_time,update_by,update_time,del_flag,deliver_id,chat_status,todo_time,todo_minute_start,todo_minute_end,address_,entry_post,entry_department,remark_)
+	    (id_,create_by,create_time,update_by,update_time,del_flag,deliver_id,chat_status,todo_time,todo_minute_start,todo_minute_end,address_,entry_post,entry_department,remark_,
+	    job_user_id,job_resume_id,job_recruitment_id)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -46,6 +50,9 @@
 ,#{entryPost,jdbcType=VARCHAR}
 ,#{entryDepartment,jdbcType=VARCHAR}
 ,#{remark,jdbcType=VARCHAR}
+,#{jobUserId,jdbcType=VARCHAR}
+,#{jobResumeId,jdbcType=VARCHAR}
+,#{jobRecruitmentId,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -97,6 +104,15 @@
 				<if test="remark!=null">
 		remark_=#{remark,jdbcType=VARCHAR},
 		</if>
+			<if test="jobUserId!=null">
+				job_user_id=#{jobUserId,jdbcType=VARCHAR},
+			</if>
+			<if test="jobResumeId!=null">
+				job_resume_id=#{jobResumeId,jdbcType=VARCHAR},
+			</if>
+			<if test="jobRecruitmentId!=null">
+				job_recruitment_id=#{jobRecruitmentId,jdbcType=VARCHAR},
+			</if>
 		</set>
 	where id_=#{id}
 	</update>
@@ -122,4 +138,17 @@
 	        ${sort.name} ${sort.order}
 	 	</foreach>
 	</select>
+
+	<select id="findTopByUserId" resultMap="ResumeDeliverContentMap">
+		SELECT
+			*
+		FROM
+			job_resume_deliver_content
+		WHERE
+			job_user_id = #{userId}
+			and del_flag = 0
+		ORDER BY
+			create_time DESC
+		LIMIT 1
+	</select>
 </mapper>

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

@@ -536,7 +536,7 @@ public class RecruitmentController {
         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(companyId)) {
             searchParams.put("companyId",companyId);
@@ -590,7 +590,7 @@ public class RecruitmentController {
         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(status)) {
             searchParams.put("status",status);

+ 190 - 20
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/MessageNoticeApiController.java

@@ -1,20 +1,23 @@
 package com.jpsoft.employment.modules.mobile.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.Page;
 import com.jpsoft.employment.config.OSSConfig;
 import com.jpsoft.employment.modules.base.entity.MessageNotice;
+import com.jpsoft.employment.modules.base.entity.MessageRead;
 import com.jpsoft.employment.modules.base.entity.UserAuthenticationApprove;
 import com.jpsoft.employment.modules.base.service.MessageNoticeService;
+import com.jpsoft.employment.modules.base.service.MessageReadService;
 import com.jpsoft.employment.modules.base.service.UserAuthenticationApproveService;
 import com.jpsoft.employment.modules.common.dto.MessageResult;
 import com.jpsoft.employment.modules.common.dto.Sort;
 import com.jpsoft.employment.modules.common.utils.*;
-import com.jpsoft.employment.modules.job.entity.JobUser;
-import com.jpsoft.employment.modules.job.service.JobUserService;
-import com.jpsoft.employment.modules.job.service.ResumeDeliverService;
-import com.jpsoft.employment.modules.job.service.ResumeService;
-import com.jpsoft.employment.modules.job.service.UserCollectionService;
+import com.jpsoft.employment.modules.job.dto.EducationExpDTO;
+import com.jpsoft.employment.modules.job.dto.ExpJsonDTO;
+import com.jpsoft.employment.modules.job.dto.WorkExpDTO;
+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.entity.SysLog;
 import com.jpsoft.employment.modules.sys.entity.User;
@@ -33,6 +36,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import sun.misc.BASE64Decoder;
@@ -72,6 +76,24 @@ public class MessageNoticeApiController {
     @Autowired
     private UserService userService;
 
+    @Autowired
+    private ResumeDeliverContentService resumeDeliverContentService;
+
+    @Autowired
+    private WorkCategoryService workCategoryService;
+
+    @Autowired
+    private ResumeService resumeService;
+
+    @Autowired
+    private MessageReadService messageReadService;
+
+    @Autowired
+    private ResumeDeliverService resumeDeliverService;
+
+    @Autowired
+    private ResumeDeliverRecordService resumeDeliverRecordService;
+
 
     @PostMapping("messageClassify")
     @ApiOperation(value = "消息分类")
@@ -86,19 +108,55 @@ public class MessageNoticeApiController {
             if (jobUser == null) {
                 throw new Exception("未登录!");
             }
-            List<DataDictionary> ddList = dataDictionaryService.findByCatalogName("消息分类");
+            //List<DataDictionary> ddList = dataDictionaryService.findByCatalogName("消息分类");
+//            系统消息1
+//            求职消息2
+//            政策发布3
+//            推荐职位4--求职者
+//            推荐简历5--HR
+            int classifyNum = 5;
+            for(int i = 1;i<=classifyNum;i++){
+                if(i == 1){
+                    Map<String, Object> mnMap = new HashMap<>();
+                    MessageNotice mn = messageNoticeService.findTopByUserIdAndClassify(jobUser.getId(),"1");
+                    mnMap.put("classify","系统消息");
+                    mnMap.put("classifyId","1");
+                    mnMap.put("newMessage",mn);
+                    mnMap.put("num",0);
+
+                    resultList.add(mnMap);
+                }else if(i == 2){
+                    Map<String, Object> mnMap = new HashMap<>();
+                    //job_resume_deliver_content
+                    ResumeDeliverContent rdc = resumeDeliverContentService.findTopByUserId(jobUser.getId());
+
+                    mnMap.put("classify","求职消息");
+                    mnMap.put("classifyId","2");
+                    mnMap.put("newMessage",rdc);
+                    mnMap.put("num",0);
+
+                    resultList.add(mnMap);
+                }else if(i == 3){
+                    Map<String, Object> mnMap = new HashMap<>();
+                    MessageNotice mn = messageNoticeService.findTopByUserIdAndClassify(jobUser.getId(),"3");
+                    mnMap.put("classify","政策发布");
+                    mnMap.put("classifyId","3");
+                    mnMap.put("newMessage",mn);
+                    mnMap.put("num",0);
+
+                    resultList.add(mnMap);
+                }else if(i == 4){
+                    Map<String, Object> mnMap = new HashMap<>();
+
+                    mnMap.put("classify","推荐职位");
+                    mnMap.put("classifyId","4");
+                    mnMap.put("newMessage","");
+                    mnMap.put("num",0);
+
+                    resultList.add(mnMap);
+                }
 
-            for(DataDictionary dd :ddList){
-                Map<String, Object> mnMap = new HashMap<>();
-                MessageNotice mn = messageNoticeService.findTopByUserIdAndClassify(subject,dd.getValue());
-                mnMap.put("classify",dd.getName());
-                mnMap.put("classifyId",dd.getValue());
-                mnMap.put("newMessage",mn);
-                mnMap.put("num",0);
-
-                resultList.add(mnMap);
             }
-
             messageResult.setData(resultList);
             messageResult.setResult(true);
             messageResult.setCode(200);
@@ -150,10 +208,12 @@ public class MessageNoticeApiController {
                 page = messageNoticeService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
             }else if("1".equals(classifyId)){
                 //1系统消息
+                page = messageNoticeService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
             }else if("2".equals(classifyId)){
                 //2求职信息
+                page = messageNoticeService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
             }else if("4".equals(classifyId)){
-                //4推荐职位
+                //4推荐职位 no
             }
 
             messageResult.setData(PojoUtils.pageWrapper(page));
@@ -173,11 +233,11 @@ public class MessageNoticeApiController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "messageId", value = "消息ID", required = true, paramType = "query"),
     })
-    public MessageResult<MessageNotice> messageDetail(
+    public MessageResult<Map> messageDetail(
             String messageId,
             String token,
             @RequestAttribute  String subject) {
-        MessageResult<MessageNotice> messageResult = new MessageResult<>();
+        MessageResult<Map> messageResult = new MessageResult<>();
 
         try {
             JobUser jobUser = jobUserService.get(subject);
@@ -194,7 +254,42 @@ public class MessageNoticeApiController {
             User createUser = userService.get(mc.getCreateBy());
             mc.setCreateByN(createUser.getRealName());
 
-            messageResult.setData(mc);
+            MessageRead messageRead = messageReadService.findByMIdAndUserId(mc.getId(),subject);
+            Boolean isNeedAgree = false;
+            Boolean isAgree = false;
+            if(messageRead == null){
+                messageRead = new MessageRead();
+                messageRead.setId(UUID.randomUUID().toString());
+                messageRead.setCreateBy(subject);
+                messageRead.setCreateTime(new Date());
+                messageRead.setDelFlag(false);
+                messageRead.setMessageId(mc.getId());
+                messageRead.setUserId(subject);
+                messageRead.setIsRead(true);
+                messageRead.setIsAgree(false);
+                messageReadService.insert(messageRead);
+                isAgree = messageRead.getIsAgree();
+            }else{
+                messageRead.setUpdateBy(subject);
+                messageRead.setUpdateTime(new Date());
+                messageRead.setIsRead(true);
+                if(messageRead.getIsAgree() == null){
+                    messageRead.setIsAgree(false);
+                }
+                messageReadService.update(messageRead);
+                isAgree = messageRead.getIsAgree();
+            }
+
+            if(mc.getIsNeedAgree() != null){
+                isNeedAgree = mc.getIsNeedAgree();
+            }
+
+            Map<String, Object> returnMap = new HashMap<>();
+            returnMap.put("messageDetail",mc);
+            returnMap.put("isNeedAgree",isNeedAgree);
+            returnMap.put("isAgree",isAgree);
+
+            messageResult.setData(returnMap);
             messageResult.setResult(true);
             messageResult.setCode(200);
         } catch (Exception ex) {
@@ -206,4 +301,79 @@ public class MessageNoticeApiController {
         return messageResult;
     }
 
+
+    @PostMapping("changeAgree")
+    @ApiOperation(value = "用户是否同意")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "messageId", value = "消息ID", paramType = "query"),
+            @ApiImplicitParam(name = "isAgree", value = "是否同意", paramType = "query"),
+    })
+    public MessageResult<String> changeAgree(
+            @RequestParam(value="messageId",defaultValue="") String messageId,
+            Boolean isAgree,
+            String token,
+            @RequestAttribute  String subject) {
+        MessageResult<String> messageResult = new MessageResult<>();
+
+        try {
+
+            MessageNotice messageNotice = messageNoticeService.get(messageId);
+            if(messageNotice == null){
+                throw new Exception("查询消息错误!");
+            }
+            MessageRead messageRead = messageReadService.findByMIdAndUserId(messageId,subject);
+            if(messageRead == null){
+                messageRead = new MessageRead();
+                messageRead.setId(UUID.randomUUID().toString());
+                messageRead.setCreateBy(subject);
+                messageRead.setCreateTime(new Date());
+                messageRead.setDelFlag(false);
+                messageRead.setMessageId(messageId);
+                messageRead.setUserId(subject);
+                messageRead.setIsRead(true);
+                messageRead.setIsAgree(isAgree);
+                messageReadService.insert(messageRead);
+            }else{
+                messageRead.setUpdateBy(subject);
+                messageRead.setUpdateTime(new Date());
+                messageRead.setIsRead(true);
+                messageRead.setIsAgree(isAgree);
+                messageReadService.update(messageRead);
+            }
+
+
+            if(isAgree){
+                if(StringUtils.isNotEmpty(messageNotice.getDeliverId())){
+                    ResumeDeliver resumeDeliver = resumeDeliverService.get(messageNotice.getDeliverId());
+                    String chatStatus = resumeDeliver.getChatStatus();
+                    int chatStatusNum = Integer.parseInt(chatStatus) + 1;
+
+                    resumeDeliver.setChatStatus(String.valueOf(chatStatusNum));
+                    resumeDeliver.setUpdateBy(subject);
+                    resumeDeliver.setUpdateTime(new Date());
+                    resumeDeliverService.update(resumeDeliver);
+
+                    ResumeDeliverRecord resumeDeliverRecord = new ResumeDeliverRecord();
+                    resumeDeliverRecord.setId(UUID.randomUUID().toString());
+                    resumeDeliverRecord.setCreateBy(subject);
+                    resumeDeliverRecord.setCreateTime(new Date());
+                    resumeDeliverRecord.setDelFlag(false);
+                    resumeDeliverRecord.setResumeDeliverId(resumeDeliver.getId());
+                    resumeDeliverRecord.setStep("同意");
+                    resumeDeliverRecord.setRemark("用户同意");
+                    resumeDeliverRecordService.insert(resumeDeliverRecord);
+                }
+            }
+
+            messageResult.setResult(true);
+            messageResult.setData("保存成功,请等待审批");
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            log.error(ex.getMessage());
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
 }

+ 44 - 0
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/RecruitmentApiController.java

@@ -500,4 +500,48 @@ public class RecruitmentApiController {
 
         return messageResult;
     }
+
+
+    @PostMapping("positionRecruitmentList")
+    @ApiOperation(value = "推荐职位")
+    public MessageResult<Map> positionRecruitmentList(
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="10") int pageSize,
+            String token,
+            @RequestAttribute  String subject){
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+
+
+        Resume resume = resumeService.findByUserId(subject);
+        if(resume != null){
+            WorkCategory wc = workCategoryService.get(resume.getPositionCategoryId());
+            if(wc != null){
+                String parentId = "";
+                if(wc.getParentId() == null){
+                    parentId = wc.getId();
+                }else{
+                    parentId = wc.getParentId();
+                }
+                List<WorkCategory> wcList = workCategoryService.findListByParentId(parentId);
+                searchParams.put("positionList", wcList);
+            }
+        }
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("a.create_time","desc"));
+
+        searchParams.put("status", 1);
+        searchParams.put("approveStatus", 3);
+
+        Page<Recruitment> page = recruitmentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
 }