1.修改保存生日报错问题
2.添加pc端获取消息列表
This commit is contained in:
@@ -62,7 +62,6 @@ public class AppUserController extends BaseController
|
|||||||
|
|
||||||
@ApiOperation("保存简历")
|
@ApiOperation("保存简历")
|
||||||
@PostMapping("/resume")
|
@PostMapping("/resume")
|
||||||
@BussinessLog(title = "保存简历")
|
|
||||||
public AjaxResult saveResume(@RequestBody AppUser appUser)
|
public AjaxResult saveResume(@RequestBody AppUser appUser)
|
||||||
{
|
{
|
||||||
appUser.setUserId(SiteSecurityUtils.getUserId());
|
appUser.setUserId(SiteSecurityUtils.getUserId());
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
package com.ruoyi.cms.controller.cms;
|
package com.ruoyi.cms.controller.cms;
|
||||||
|
|
||||||
import com.ruoyi.cms.domain.AppNotice;
|
import com.ruoyi.cms.domain.AppNotice;
|
||||||
|
import com.ruoyi.cms.domain.Notice;
|
||||||
import com.ruoyi.cms.service.IAppNoticeService;
|
import com.ruoyi.cms.service.IAppNoticeService;
|
||||||
|
import com.ruoyi.cms.service.IAppUserService;
|
||||||
|
import com.ruoyi.cms.util.RoleUtils;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.constant.HttpStatus;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -25,6 +32,8 @@ public class CmsNoticeController extends BaseController
|
|||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAppNoticeService noticeService;
|
private IAppNoticeService noticeService;
|
||||||
|
@Autowired
|
||||||
|
private IAppUserService appUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取通知公告列表
|
* 获取通知公告列表
|
||||||
@@ -82,4 +91,47 @@ public class CmsNoticeController extends BaseController
|
|||||||
{
|
{
|
||||||
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("pc端获取未读消息")
|
||||||
|
@GetMapping("/appNoticList")
|
||||||
|
public TableDataInfo list(Notice notice)
|
||||||
|
{
|
||||||
|
if(!SecurityUtils.isLogin()){
|
||||||
|
error(HttpStatus.ERROR,"未登录!");
|
||||||
|
}
|
||||||
|
if(notice.getUserId()==null){
|
||||||
|
String idCard= RoleUtils.getCurrentUseridCard();
|
||||||
|
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
|
||||||
|
if(appUser==null){
|
||||||
|
error(HttpStatus.ERROR,"用户信息未完善,请完善身份证信息!");
|
||||||
|
}else{
|
||||||
|
notice.setUserId(appUser.getUserId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
startPage();
|
||||||
|
List<Notice> notices = noticeService.selectListAppNotRead(notice);
|
||||||
|
return getDataTable(notices);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("系统通知标记已读")
|
||||||
|
@PostMapping("/read/sysNotice")
|
||||||
|
public AjaxResult sysNotice(@RequestParam String id)
|
||||||
|
{
|
||||||
|
Long userId=null;
|
||||||
|
if(!SecurityUtils.isLogin()){
|
||||||
|
return AjaxResult.error("未登录!");
|
||||||
|
}
|
||||||
|
if(userId==null){
|
||||||
|
String idCard= RoleUtils.getCurrentUseridCard();
|
||||||
|
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
|
||||||
|
if(appUser==null){
|
||||||
|
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
|
||||||
|
}else{
|
||||||
|
userId=appUser.getUserId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
noticeService.readSysNotices(id,userId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,4 +76,8 @@ public interface IAppNoticeService
|
|||||||
|
|
||||||
void recommendJobCron();
|
void recommendJobCron();
|
||||||
void fairCompanyCron();
|
void fairCompanyCron();
|
||||||
|
|
||||||
|
List<Notice> selectListAppNotRead(Notice notice);
|
||||||
|
|
||||||
|
void readSysNotices(String ids,Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,5 +198,28 @@ public class AppNoticeServiceImpl implements IAppNoticeService
|
|||||||
List<Notice> sysNoticeList = noticeInfoMapper.selectList(Wrappers.<Notice>lambdaQuery().eq(Notice::getUserId, userId).isNotNull(Notice::getNoticeType).notIn(Notice::getNoticeType,"").orderByDesc(Notice::getCreateTime));
|
List<Notice> sysNoticeList = noticeInfoMapper.selectList(Wrappers.<Notice>lambdaQuery().eq(Notice::getUserId, userId).isNotNull(Notice::getNoticeType).notIn(Notice::getNoticeType,"").orderByDesc(Notice::getCreateTime));
|
||||||
return sysNoticeList;
|
return sysNoticeList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Notice> selectListAppNotRead(Notice notice) {
|
||||||
|
List<Notice> sysNoticeList = noticeInfoMapper.selectList(Wrappers.<Notice>lambdaQuery().eq(Notice::getUserId, notice.getUserId()).eq(Notice::getRemark,"notice_bar").orderByDesc(Notice::getCreateTime));
|
||||||
|
return sysNoticeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSysNotices(String ids,Long userId) {
|
||||||
|
List<Long> longs = StringUtil.convertStringToLongList(ids);
|
||||||
|
List<Notice> notices = noticeInfoMapper.selectBatchIds(longs);
|
||||||
|
notices.forEach(notice -> {
|
||||||
|
notice.setIsRead(1);
|
||||||
|
noticeInfoMapper.updateById(notice);
|
||||||
|
});
|
||||||
|
List<Notice> notices1 = noticeInfoMapper.selectList(Wrappers.<Notice>lambdaQuery().eq(Notice::getUserId, userId).eq(Notice::getRemark, "notice_bar").eq(Notice::getTitle, "系统通知").orderByDesc(Notice::getCreateTime).last("limit 1"));
|
||||||
|
Notice notice = notices1.get(0);
|
||||||
|
notice.setNotReadCount(notice.getNotReadCount() - longs.size());
|
||||||
|
if(notice.getNotReadCount()==0){
|
||||||
|
notice.setIsRead(1);
|
||||||
|
}
|
||||||
|
noticeInfoMapper.updateById(notice);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class ESJobSearchImpl implements IESJobSearchService
|
|||||||
/**
|
/**
|
||||||
* 项目启动时,初始化索引及数据
|
* 项目启动时,初始化索引及数据
|
||||||
*/
|
*/
|
||||||
@PostConstruct
|
// @PostConstruct
|
||||||
public void init()
|
public void init()
|
||||||
{
|
{
|
||||||
resetTextCache();
|
resetTextCache();
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.ruoyi.cms.mapper.JobApplyMapper;
|
|||||||
import com.ruoyi.cms.mapper.JobMapper;
|
import com.ruoyi.cms.mapper.JobMapper;
|
||||||
import com.ruoyi.cms.service.IBussinessDictTypeService;
|
import com.ruoyi.cms.service.IBussinessDictTypeService;
|
||||||
import com.ruoyi.common.core.domain.entity.AppUser;
|
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.SiteSecurityUtils;
|
import com.ruoyi.common.utils.SiteSecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -266,7 +267,7 @@ public class JobCollectionServiceImpl extends ServiceImpl<JobCollectionMapper,Jo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 5. 年龄估算(从生日计算)
|
// 5. 年龄估算(从生日计算)
|
||||||
int userAge = getUserAge(user.getBirthDate());
|
int userAge = getUserAge(DateUtils.toDate(user.getBirthDate()));
|
||||||
// 假设最佳年龄区间为 22-35,越接近越匹配
|
// 假设最佳年龄区间为 22-35,越接近越匹配
|
||||||
if (userAge >= 22 && userAge <= 35) {
|
if (userAge >= 22 && userAge <= 35) {
|
||||||
matchScore += 1;
|
matchScore += 1;
|
||||||
@@ -292,7 +293,7 @@ public class JobCollectionServiceImpl extends ServiceImpl<JobCollectionMapper,Jo
|
|||||||
// ================== 计算雷达图数据(取平均值)==================
|
// ================== 计算雷达图数据(取平均值)==================
|
||||||
RadarChart radarChart = new RadarChart();
|
RadarChart radarChart = new RadarChart();
|
||||||
|
|
||||||
double avgAgeScore = userScores.stream().mapToInt(u -> getAgeScore(u.getUser().getBirthDate())).average().orElse(0);
|
double avgAgeScore = userScores.stream().mapToInt(u -> getAgeScore(DateUtils.toDate(u.getUser().getBirthDate()))).average().orElse(0);
|
||||||
double avgExperienceScore = userScores.stream().mapToInt(u -> getExperienceScore(u.getUser().getExperience(), job.getExperience(), experienceRank)).average().orElse(0);
|
double avgExperienceScore = userScores.stream().mapToInt(u -> getExperienceScore(u.getUser().getExperience(), job.getExperience(), experienceRank)).average().orElse(0);
|
||||||
double avgEducationScore = userScores.stream().mapToInt(u -> getEducationScore(u.getUser().getEducation(), job.getEducation(), educationRank)).average().orElse(0);
|
double avgEducationScore = userScores.stream().mapToInt(u -> getEducationScore(u.getUser().getEducation(), job.getEducation(), educationRank)).average().orElse(0);
|
||||||
double avgSkillScore = userScores.stream().mapToInt(u -> getSkillScore(u.getUser(), job)).average().orElse(0);
|
double avgSkillScore = userScores.stream().mapToInt(u -> getSkillScore(u.getUser(), job)).average().orElse(0);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.common.core.domain.entity;
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ public class AppUser extends BaseEntity
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
@ApiModelProperty("生日")
|
@ApiModelProperty("生日")
|
||||||
private Date birthDate;
|
private LocalDate birthDate;
|
||||||
|
|
||||||
@Excel(name = "学历 对应字典education")
|
@Excel(name = "学历 对应字典education")
|
||||||
@ApiModelProperty("学历 对应字典education")
|
@ApiModelProperty("学历 对应字典education")
|
||||||
|
|||||||
Reference in New Issue
Block a user