Jelajahi Sumber

代码同步

shuzhan 1 tahun lalu
induk
melakukan
8df60b12ce

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

@@ -22,4 +22,5 @@ public interface PersonInfoDAO {
 	int clearOpenId(String id);
 	PersonInfo findByPhone(String phone);
 	Integer dailyReportList(@Param("searchParams") Map<String, Object> searchParams);
+	PersonInfo findByEnterpriseId(String enterpriseId);
 }

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

@@ -20,5 +20,6 @@ public interface PersonLoginLogDAO {
 	List<Map> dailyReport(Map<String, Object> searchParams, List<Sort> sortList);
 	Integer dailyReportList(@Param("searchParams") Map<String, Object> searchParams);
 	List<String> totalDailyReportList(@Param("searchParams") Map<String, Object> searchParams);
+	PersonLoginLog findTopByPersonId(String personId);
 
 }

+ 6 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/JobInformationInfo.java

@@ -142,4 +142,10 @@ public class JobInformationInfo {
 	@Transient
 	@ApiModelProperty(value = "简历状态(1公开0隐藏")
 	private String jobStatus;
+
+	@Transient
+	@ApiModelProperty(value = "上次登陆时间")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date lastLoginTime;
 }

+ 6 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/RecruitInformationInfo.java

@@ -110,4 +110,10 @@ public class RecruitInformationInfo {
 	@Transient
 	@ApiModelProperty(value = "未读数量")
 	private Integer isReadNumber;
+
+	@Transient
+	@ApiModelProperty(value = "企业用户上次登陆时间")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date lastLoginTime;
 }

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

@@ -20,4 +20,5 @@ public interface PersonInfoService {
 	int clearOpenId(String id);
 	PersonInfo findByPhone(String phone);
 	Integer dailyReportList(Map<String, Object> searchParams);
+	PersonInfo findByEnterpriseId(String enterpriseId);
 }

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

@@ -18,5 +18,5 @@ public interface PersonLoginLogService {
 	Integer dailyReportList(Map<String, Object> searchParams);
 	List<String> totalDailyReportList(Map<String, Object> searchParams);
 
-
+	PersonLoginLog findTopByPersonId(String personId);
 }

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

@@ -87,4 +87,9 @@ public class PersonInfoServiceImpl implements PersonInfoService {
 	public Integer dailyReportList(Map<String, Object> searchParams){
 		return personInfoDAO.dailyReportList(searchParams);
 	}
+
+	@Override
+	public PersonInfo findByEnterpriseId(String enterpriseId){
+		return personInfoDAO.findByEnterpriseId(enterpriseId);
+	}
 }

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

@@ -88,4 +88,9 @@ public class PersonLoginLogServiceImpl implements PersonLoginLogService {
 	public List<String> totalDailyReportList(Map<String, Object> searchParams){
 		return personLoginLogDAO.totalDailyReportList(searchParams);
 	}
+
+	@Override
+	public PersonLoginLog findTopByPersonId(String personId){
+		return personLoginLogDAO.findTopByPersonId(personId);
+	}
 }

+ 10 - 0
common/src/main/resources/mapper/base/PersonInfo.xml

@@ -187,4 +187,14 @@
 			]]>
 		</if>
 	</select>
+	<select id="findByEnterpriseId" parameterType="string" resultMap="PersonInfoMap">
+		SELECT
+		*
+		FROM
+		base_person_info
+		WHERE
+		enterprise_id = #{enterpriseId}
+		and del_flag = 0
+		limit 1
+	</select>
 </mapper>

+ 12 - 2
common/src/main/resources/mapper/base/PersonLoginLog.xml

@@ -66,8 +66,7 @@
         where id_=#{id}
     </update>
     <select id="get" parameterType="string" resultMap="PersonLoginLogMap">
-		select 
-id_,person_id,remark_,create_by,create_time,update_by,update_time,del_flag		from base_person_login_log where id_=#{0}
+		select * from base_person_login_log where id_=#{0}
 	</select>
     <select id="exist" parameterType="string" resultType="int">
 		select count(*) from base_person_login_log where id_=#{0}
@@ -138,4 +137,15 @@ id_,person_id,remark_,create_by,create_time,update_by,update_time,del_flag		from
         </where>
         GROUP BY DATE_FORMAT(create_time,"%Y年%m月%d日"),person_id
 	</select>
+    <select id="findTopByPersonId" parameterType="string" resultMap="PersonLoginLogMap">
+        SELECT
+        *
+        FROM
+        base_person_login_log
+        WHERE
+        del_flag = 0
+        and person_id = #{personId}
+        order by create_time desc
+        limit 1
+    </select>
 </mapper>

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

@@ -61,6 +61,9 @@ public class RecruitApiController {
     private ShareWorksInfoService shareWorksInfoService;
     @Autowired
     private RecruitPersonRelationService recruitPersonRelationService;
+    @Autowired
+    private PersonLoginLogService personLoginLogService;
+
 
     @PostMapping("findRecruitHomePage")
     @ApiOperation(value = " 首页查询全部(公开接口)")
@@ -171,6 +174,14 @@ public class RecruitApiController {
                 for(RecruitInformationInfo recruitInformationInfo : page.getResult()){
                     recruitInformationInfo.setSettlementMethodN(dataDictionaryService.findNameByCatalogNameAndValue("结算方式",recruitInformationInfo.getSettlementMethod()));
                     recruitInformationInfo.setIndustryN(dataDictionaryService.findNameByCatalogNameAndValue("意向行业",recruitInformationInfo.getIndustry()));
+
+                    PersonInfo personInfo = personInfoService.findByEnterpriseId(recruitInformationInfo.getEnterpriseId());
+                    if(personInfo!=null){
+                        PersonLoginLog personLoginLog = personLoginLogService.findTopByPersonId(personInfo.getId());
+                        if(personLoginLog != null){
+                            recruitInformationInfo.setLastLoginTime(personLoginLog.getCreateTime());
+                        }
+                    }
                 }
 
                 messageResult.setData(PojoUtils.pageWrapper(page));
@@ -204,6 +215,10 @@ public class RecruitApiController {
                         jobInformationInfo.setPersonName(personInfo.getRealName());
                         jobInformationInfo.setGender(personInfo.getGender());
                         jobInformationInfo.setAge(personInfo.getAge());
+                        PersonLoginLog personLoginLog = personLoginLogService.findTopByPersonId(personInfo.getId());
+                        if(personLoginLog != null){
+                            jobInformationInfo.setLastLoginTime(personLoginLog.getCreateTime());
+                        }
                     }
 
                     jobInformationInfo.setIntendedIndustriesN(dataDictionaryService.findNameByCatalogNameAndValue("意向行业",jobInformationInfo.getIntendedIndustries()));

+ 8 - 0
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/UserApiController.java

@@ -539,6 +539,14 @@ public class UserApiController {
                 personLoginLog.setCreateTime(new Date());
                 personLoginLog.setPersonId(regUser.getId());
                 personLoginLogService.insert(personLoginLog);
+
+
+                //更新简历
+                JobInformationInfo jobInformationInfo = jobInformationInfoService.findByPersonId(regUser.getId());
+                if(jobInformationInfo != null) {
+                    jobInformationInfo.setUpdateTime(new Date());
+                    jobInformationInfoService.update(jobInformationInfo);
+                }
             }
             msgResult.setResult(true);
         } catch (Exception ex) {