Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

yanliming 2 lat temu
rodzic
commit
453439f558

+ 3 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dao/JobEnterpriseRelationDAO.java

@@ -20,4 +20,7 @@ public interface JobEnterpriseRelationDAO {
 	List<JobEnterpriseRelation> findByEnterpriseId(String enterpriseId);
 	Integer countByJobInformationId(String jobInformationId);
 	JobEnterpriseRelation findByEnterpriseIdAndJobInformationId(String enterpriseId,String jobInformationId);
+	int findNotReadNumByEnterpriseId(String enterpriseId);
+	int findNotReadNumByPersonId(String personId);
+	JobEnterpriseRelation findByPersonIdAndRecruitId(String personId,String recruitId);
 }

+ 3 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dao/RecruitPersonRelationDAO.java

@@ -21,4 +21,7 @@ public interface RecruitPersonRelationDAO {
 	List<RecruitPersonRelation> findByPersonId(String personId);
 
 	Integer isReadCountByRecruit(String recruitId);
+	int findNotReadNumByEnterpriseId(String enterpriseId);
+	int findNotReadNumByPersonId(String personId);
+	RecruitPersonRelation findByPersonIdAndRecruitId(String personId, String recruitId);
 }

+ 4 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/JobEnterpriseRelationService.java

@@ -18,4 +18,8 @@ public interface JobEnterpriseRelationService {
 	List<JobEnterpriseRelation> findByEnterpriseId(String enterpriseId);
 	JobEnterpriseRelation findByEnterpriseIdAndJobInformationId(String enterpriseId,String jobInformationId);
 	Integer countByJobInformationId(String jobInformationId);
+	int findNotReadNumByEnterpriseId(String enterpriseId);
+	int findNotReadNumByPersonId(String personId);
+
+	JobEnterpriseRelation findByPersonIdAndRecruitId(String personId,String recruitId);
 }

+ 4 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/RecruitPersonRelationService.java

@@ -20,4 +20,8 @@ public interface RecruitPersonRelationService {
 	List<RecruitPersonRelation> findByPersonId(String personId);
 
 	Integer isReadCountByRecruit(String recruitId);
+	int findNotReadNumByEnterpriseId(String enterpriseId);
+	int findNotReadNumByPersonId(String personId);
+
+	RecruitPersonRelation findByPersonIdAndRecruitId(String personId, String recruitId);
 }

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

@@ -92,4 +92,19 @@ public class JobEnterpriseRelationServiceImpl implements JobEnterpriseRelationSe
 	public Integer countByJobInformationId(String jobInformationId){
 		return jobEnterpriseRelationDAO.countByJobInformationId(jobInformationId);
 	}
+
+	@Override
+	public int findNotReadNumByEnterpriseId(String enterpriseId){
+		return jobEnterpriseRelationDAO.findNotReadNumByEnterpriseId(enterpriseId);
+	}
+
+	@Override
+	public int findNotReadNumByPersonId(String personId){
+		return jobEnterpriseRelationDAO.findNotReadNumByPersonId(personId);
+	}
+
+	@Override
+	public JobEnterpriseRelation findByPersonIdAndRecruitId(String personId,String recruitId){
+		return jobEnterpriseRelationDAO.findByPersonIdAndRecruitId(personId,recruitId);
+	}
 }

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

@@ -92,4 +92,19 @@ public class RecruitPersonRelationServiceImpl implements RecruitPersonRelationSe
 	public Integer isReadCountByRecruit(String recruitId){
 		return recruitPersonRelationDAO.isReadCountByRecruit(recruitId);
 	}
+
+	@Override
+	public int findNotReadNumByEnterpriseId(String enterpriseId){
+		return recruitPersonRelationDAO.findNotReadNumByEnterpriseId(enterpriseId);
+	}
+
+	@Override
+	public int findNotReadNumByPersonId(String personId){
+		return recruitPersonRelationDAO.findNotReadNumByPersonId(personId);
+	}
+
+	@Override
+	public RecruitPersonRelation findByPersonIdAndRecruitId(String personId, String recruitId){
+		return recruitPersonRelationDAO.findByPersonIdAndRecruitId(personId,recruitId);
+	}
 }

+ 42 - 0
common/src/main/resources/mapper/base/JobEnterpriseRelation.xml

@@ -143,4 +143,46 @@
 	<select id="findByEnterpriseIdAndJobInformationId" resultMap="JobEnterpriseRelationMap">
 		select * from base_job_enterprise_relation where del_flag = 0 and enterprise_id = #{enterpriseId}  and job_information_id = #{jobInformationId}
 	</select>
+	<select id="findNotReadNumByEnterpriseId" resultType="int">
+		<![CDATA[
+		SELECT
+			count(a.id_)
+		FROM
+			base_job_enterprise_relation a
+		WHERE
+			a.del_flag = FALSE
+			AND ( a.is_read <> '1' OR a.is_read IS NULL )
+			AND a.enterprise_id = #{enterpriseId}
+		]]>
+	</select>
+	<select id="findNotReadNumByPersonId" resultType="int">
+		<![CDATA[
+		SELECT
+			count(a.id_)
+		FROM
+			base_job_enterprise_relation a
+			LEFT JOIN base_job_information_info c ON a.job_information_id = c.id_
+		WHERE
+			a.del_flag = FALSE
+			and c.del_flag = 0
+			AND ( a.is_read <> '1' OR a.is_read IS NULL )
+			AND c.person_id =  #{personId}
+		]]>
+	</select>
+	<select id="findByPersonIdAndRecruitId" resultMap="JobEnterpriseRelationMap">
+		<![CDATA[
+		SELECT
+			a.*
+		FROM
+			base_job_enterprise_relation a
+			LEFT JOIN base_job_information_info c ON a.job_information_id = c.id_
+		WHERE
+			a.del_flag = FALSE
+			and c.del_flag = 0
+			AND ( a.is_read <> '1' OR a.is_read IS NULL )
+			AND c.person_id =  #{personId}
+			and a.recruit_information_id = #{recruitId}
+			limit 1
+		]]>
+	</select>
 </mapper>

+ 3 - 1
common/src/main/resources/mapper/base/JobInformationInfo.xml

@@ -197,7 +197,9 @@
 					#{id}
 				</foreach>
 			</if>
-
+			<if test="searchParams.status != null">
+				and a.status_ = #{searchParams.status}
+			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 			${sort.name} ${sort.order}

+ 42 - 0
common/src/main/resources/mapper/base/RecruitPersonRelation.xml

@@ -161,4 +161,46 @@
 			${sort.name} ${sort.order}
 		</foreach>
 	</select>
+	<select id="findNotReadNumByEnterpriseId" resultType="int">
+		<![CDATA[
+		SELECT
+			count(a.id_)
+		FROM
+			base_recruit_person_relation a
+			LEFT JOIN base_recruit_information_info c ON a.recruit_information_id = c.id_
+		WHERE
+			a.del_flag = FALSE
+			AND c.del_flag = 0
+			AND ( a.is_read <> '1' OR a.is_read IS NULL )
+			AND c.enterprise_id = #{enterpriseId}
+		]]>
+	</select>
+	<select id="findNotReadNumByPersonId" resultType="int">
+		<![CDATA[
+		SELECT
+			count(a.id_)
+		FROM
+			base_recruit_person_relation a
+			LEFT JOIN base_person_info b ON a.work_person_id = b.id_
+		WHERE
+			a.del_flag = 0
+			and b.del_flag = 0
+			and b.id_ = #{personId}
+			AND ( a.is_read <> '1' OR a.is_read IS NULL )
+		]]>
+	</select>
+	<select id="findByPersonIdAndRecruitId" resultMap="RecruitPersonRelationMap">
+		<![CDATA[
+		SELECT
+			a.*
+		FROM
+			base_recruit_person_relation a
+		WHERE
+			a.del_flag = FALSE
+			AND ( a.is_read <> '1' OR a.is_read IS NULL )
+			AND a.work_person_id =  #{personId}
+			and a.recruit_information_id = #{recruitId}
+			limit 1
+		]]>
+	</select>
 </mapper>

+ 1 - 0
web/src/main/java/com/jpsoft/employment/modules/base/controller/RecruitInformationInfoController.java

@@ -461,6 +461,7 @@ public class RecruitInformationInfoController {
                     recruitInformationInfo.setDelFlag(false);
                     recruitInformationInfo.setCreateBy(subject);
                     recruitInformationInfo.setCreateTime(new Date());
+                    recruitInformationInfo.setUpdateTime(new Date());
                     recruitInformationInfo.setStatus("1");
                     recruitInformationInfo.setBrowseNumber(0);
                     recruitInformationInfo.setEnterpriseId(enterpriseInfo.getId());

+ 41 - 0
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/JobApiController.java

@@ -205,10 +205,13 @@ public class JobApiController {
     @RequestMapping(value = "jobHuntDetail",method = RequestMethod.POST)
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "简历ID", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "isRead", value = "是否已读(1为已读", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "rprId", value = "关联表ID", required = false, paramType = "form"),
     })
     public MessageResult<Map> jobDetail(
             @RequestParam(value="id",defaultValue="") String id,
             @RequestParam(value="isRead",defaultValue="0") String isRead,
+            @RequestParam(value="rprId",defaultValue="") String rprId,
             HttpServletRequest request){
 
         MessageResult<Map> msgResult = new MessageResult<>();
@@ -273,6 +276,14 @@ public class JobApiController {
                 JobEnterpriseRelation jobEnterpriseRelation = jobEnterpriseRelationService.findByEnterpriseIdAndJobInformationId(user.getEnterpriseId(),id);
                 if(jobEnterpriseRelation != null) {
                     isInvite = true;
+                    if("1".equals(isRead)) {
+                        RecruitPersonRelation recruitPersonRelation = recruitPersonRelationService.get(rprId);
+                        if(recruitPersonRelation != null) {
+                            recruitPersonRelation.setIsRead(true);
+                            recruitPersonRelation.setUpdateTime(new Date());
+                            recruitPersonRelationService.update(recruitPersonRelation);
+                        }
+                    }
                 }
             }
 
@@ -433,4 +444,34 @@ public class JobApiController {
 
         return msgResult;
     }
+
+    @ApiOperation(value="我的报名(查未读数量")
+    @RequestMapping(value = "myRegistrationNotReadNum",method = RequestMethod.POST)
+    public MessageResult<Map> myRegistrationNotReadNum(
+            @RequestAttribute String subject){
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+        try {
+
+            PersonInfo personInfo = personInfoService.get(subject);
+            if (personInfo == null) {
+                throw new Exception("未登录");
+            }
+
+            Map<String,Object> returnMap = new HashMap<>();
+            //int rprNum = recruitPersonRelationService.findNotReadNumByPersonId(personInfo.getId());
+            int jerNum = jobEnterpriseRelationService.findNotReadNumByPersonId(personInfo.getId());
+
+            returnMap.put("notReadNum",jerNum);
+            msgResult.setResult(true);
+            msgResult.setData(returnMap);
+
+        }catch (Exception e){
+            msgResult.setResult(false);
+            msgResult.setMessage(e.getMessage());
+            e.printStackTrace();
+        }
+
+        return msgResult;
+    }
 }

+ 42 - 0
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/RecruitApiController.java

@@ -380,9 +380,13 @@ public class RecruitApiController {
     @RequestMapping(value = "recruitDetail",method = RequestMethod.POST)
     @ApiImplicitParams({
             @ApiImplicitParam(name = "recruitId", value = "招聘信息ID", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "isRead", value = "是否已读(1为已读", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "jerId", value = "关联表ID", required = false, paramType = "form"),
     })
     public MessageResult<Map> recruitDetail(
             @RequestParam(value="recruitId",defaultValue="") String recruitId,
+            @RequestParam(value="isRead",defaultValue="0") String isRead,
+            @RequestParam(value="jerId",defaultValue="") String jerId,
             HttpServletRequest request){
         MessageResult<Map> msgResult = new MessageResult<>();
         try {
@@ -430,6 +434,15 @@ public class RecruitApiController {
                 if(recruitPersonRelation != null){
                     isJoin = true;
                 }
+
+                if("1".equals(isRead)) {
+                    JobEnterpriseRelation jobEnterpriseRelation = jobEnterpriseRelationService.get(jerId);
+                    if(jobEnterpriseRelation != null) {
+                        jobEnterpriseRelation.setIsRead(true);
+                        jobEnterpriseRelation.setUpdateTime(new Date());
+                        jobEnterpriseRelationService.update(jobEnterpriseRelation);
+                    }
+                }
             }
 
             recruitInformationInfo.setIndustryN(dataDictionaryService.findNameByCatalogNameAndValue("意向行业",recruitInformationInfo.getIndustry()));
@@ -761,6 +774,35 @@ public class RecruitApiController {
         return msgResult;
     }
 
+    @ApiOperation(value="我的收到报名(查未读数量")
+    @RequestMapping(value = "myReceivedRegistrationNotReadNum",method = RequestMethod.POST)
+    public MessageResult<Map> myReceivedRegistrationNotReadNum(
+            @RequestAttribute String subject){
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+        try {
+
+            PersonInfo personInfo = personInfoService.get(subject);
+            if (personInfo == null) {
+                throw new Exception("未登录");
+            }
+
+            Map<String,Object> returnMap = new HashMap<>();
+            int rprNum = recruitPersonRelationService.findNotReadNumByEnterpriseId(personInfo.getEnterpriseId());
+            //int jerNum = jobEnterpriseRelationService.findNotReadNumByEnterpriseId(personInfo.getEnterpriseId());
+
+            returnMap.put("notReadNum",rprNum);
+            msgResult.setResult(true);
+            msgResult.setData(returnMap);
+        }catch (Exception e){
+            msgResult.setResult(false);
+            msgResult.setMessage(e.getMessage());
+            e.printStackTrace();
+        }
+
+        return msgResult;
+    }
+
 
     @ApiOperation(value="我的共享用工")
     @RequestMapping(value = "myShareWork",method = RequestMethod.POST)