xinquan-api/xinquan-api-course/src/main/java/com/xinquan/course/api/vo/CourseVO.java
@@ -1,5 +1,6 @@ package com.xinquan.course.api.vo; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -82,6 +83,11 @@ private Integer isVip; @ApiModelProperty(value = "头像列表") private List<String> headers; @ApiModelProperty(value = "实际学习人数") @TableField(exist = false) private Integer realLearnedNum; @ApiModelProperty(value = "虚拟学习人数") @TableField(exist = false) private Integer virtualLearnedNum; } xinquan-api/xinquan-api-system/src/main/java/com/xinquan/system/api/domain/AppUser.java
@@ -106,6 +106,9 @@ @ApiModelProperty(value = "邮箱") @TableField("email") private String email; @ApiModelProperty(value = "微信名称") @TableField("wxName") private String wxName; @ApiModelProperty(value = "会员到期时间") @TableField(value = "vip_expire_time",updateStrategy = FieldStrategy.IGNORED) xinquan-api/xinquan-api-system/src/main/java/com/xinquan/system/api/domain/AppUserTree.java
@@ -76,6 +76,8 @@ @ApiModelProperty(value = "是否完成签到 1是 2否") @TableField(exist = false) private Integer isSign; @ApiModelProperty(value = "当前累计能量值") @TableField(exist = false) private Integer totalEnergyValue; } xinquan-api/xinquan-api-system/src/main/java/com/xinquan/system/api/domain/MeditationReport.java
@@ -79,6 +79,9 @@ @ApiModelProperty(value = "回复内容") @TableField(exist = false) private String replyContent; @ApiModelProperty(value = "是否显示 1= 是 2=否") @TableField(exist = false) private Integer showFlag; @ApiModelProperty(value = "疗愈封面图") @TableField(exist = false) private String coverUrl; xinquan-modules/xinquan-course/src/main/java/com/xinquan/course/controller/client/ClientCourseController.java
@@ -896,8 +896,16 @@ .eq(Course::getCourseType, 1).list(); for (Course course : list) { List<AppUser> data = remoteAppUserService.getUserByCourseId(courseId).getData(); course.setCount(data.size()+course.getVirtualLearnedNum()); course.setRealLearnedNum(data.size()+course.getVirtualLearnedNum()); List<CourseChapter> list1 = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, course).list(); int a = 0; int b = 0; for (CourseChapter courseChapter : list1) { a+= courseChapter.getVirtualLearnedNum(); Long data1 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); b+=data1; } course.setCount(a+b); course.setRealLearnedNum(a+b); } List<Course> courses = new ArrayList<>(); @@ -934,9 +942,19 @@ .list(); for (Course course : page) { CourseVO courseVO = new CourseVO(); List<CourseChapter> list1 = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, course.getId()).list(); int a = 0; int b = 0; for (CourseChapter courseChapter : list1) { a+= courseChapter.getVirtualLearnedNum(); Long data1 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); b+=data1; } course.setCount(a+b); course.setRealLearnedNum(a+b); course.setVirtualLearnedNum(0); BeanUtils.copyProperties(course, courseVO); courseVOS.add(courseVO); studyPageVO.setCourseList(courseVOS); } } // 查询两个相同类型的线上免费课程 @@ -952,13 +970,57 @@ int size = freeCourseList.size(); int index = (int) (Math.random() * size); List<Course> courses = new ArrayList<>(); for (Course cours : freeCourseList) { List<CourseChapter> list1 = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, cours.getId()).list(); int a = 0; int b = 0; for (CourseChapter courseChapter : list1) { a+= courseChapter.getVirtualLearnedNum(); Long data2 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); b+=data2; } cours.setCount(a+b); cours.setRealLearnedNum(a+b); cours.setVirtualLearnedNum(0); } for (int i = 0; i < 2; i++) { courses.add(freeCourseList.get(index)); } studyPageVO.setFreeCourseList(courses); }else{ for (Course cours : freeCourseList) { List<CourseChapter> list1 = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, cours.getId()).list(); int a = 0; int b = 0; for (CourseChapter courseChapter : list1) { a+= courseChapter.getVirtualLearnedNum(); Long data2 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); b+=data2; } cours.setCount(a+b); cours.setRealLearnedNum(a+b); } studyPageVO.setFreeCourseList(freeCourseList); } for (Long l : data1) { CourseChapter byId1 = courseChapterService.getById(l); Course byId = courseService.getById(byId1.getCourseId()); CourseVO courseVO = new CourseVO(); BeanUtils.copyProperties(byId, courseVO); List<CourseChapter> list1 = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, byId1.getCourseId()).list(); int a = 0; int b = 0; for (CourseChapter courseChapter : list1) { a+= courseChapter.getVirtualLearnedNum(); Long data2 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); b+=data2; } courseVO.setCount(a+b); courseVO.setRealLearnedNum(a+b); courseVO.setVirtualLearnedNum(0); courseVOS.add(courseVO); } studyPageVO.setCourseList(courseVOS); return R.ok(studyPageVO); }else{ List<Course> list1 = courseService.lambdaQuery() @@ -981,6 +1043,8 @@ } studyPageVO.setFreeCourseList(courses); } studyPageVO.setCourseList(courseVOS); return R.ok(studyPageVO); } xinquan-modules/xinquan-course/src/main/java/com/xinquan/course/controller/client/ClientTutorSpecialColumnController.java
@@ -10,15 +10,16 @@ import com.xinquan.common.security.utils.SecurityUtils; import com.xinquan.course.api.domain.Course; import com.xinquan.course.api.domain.CourseCategory; import com.xinquan.course.api.domain.CourseChapter; import com.xinquan.course.domain.CourseLearningRecord; import com.xinquan.course.domain.TutorSpecialColumn; import com.xinquan.course.domain.TutorSpecialColumnCourse; import com.xinquan.course.domain.vo.ClientCourseVO; import com.xinquan.course.domain.vo.TutorCourseVO; import com.xinquan.course.domain.vo.TutorVo; import com.xinquan.course.service.CourseCategoryService; import com.xinquan.course.service.CourseService; import com.xinquan.course.service.TutorSpecialColumnCourseService; import com.xinquan.course.service.TutorSpecialColumnService; import com.xinquan.course.service.*; import com.xinquan.system.api.domain.AppUser; import com.xinquan.user.api.feign.RemoteAppUserService; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; @@ -53,6 +54,12 @@ private CourseCategoryService courseCategoryService; @Resource private CourseService courseService; @Resource private CourseLearningRecordService courseLearningRecordService; @Resource private CourseChapterService courseChapterService; @Resource private RemoteAppUserService remoteAppUserService; @PostMapping("/getCoursePageList") @ApiOperation(value = "导师专栏",tags = "导师专栏") public R<TutorVo> getCourseList() { @@ -71,6 +78,17 @@ List<Course> page = courseService.list(courseLambdaQueryWrapper); for (Course course : page) { TutorCourseVO tutorCourseVO = new TutorCourseVO(); List<AppUser> data = remoteAppUserService.getUserByCourseId(course.getId()).getData(); List<CourseChapter> list1 = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, course.getId()).list(); int a = 0; int b = 0; for (CourseChapter courseChapter : list1) { a+= courseChapter.getVirtualLearnedNum(); Long data1 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); b+=data1; } course.setCount(a+b); course.setRealLearnedNum(a+b); BeanUtils.copyProperties(course, tutorCourseVO); clientCourseVOS.add(tutorCourseVO); } xinquan-modules/xinquan-course/src/main/java/com/xinquan/course/domain/vo/TutorCourseVO.java
@@ -1,5 +1,6 @@ package com.xinquan.course.domain.vo; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -79,6 +80,10 @@ private Integer isBuy; @ApiModelProperty(value = "当前用户是否为会员") private Integer isVip; @ApiModelProperty(value = "实际学习人数") @TableField(exist = false) private Integer realLearnedNum; @ApiModelProperty(value = "虚拟学习人数") @TableField(exist = false) private Integer virtualLearnedNum; } xinquan-modules/xinquan-meditation/src/main/java/com/xinquan/meditation/controller/client/ClientMeditationReportController.java
@@ -98,6 +98,8 @@ record.setAvatar(data.getAvatar()); record.setCellPhone(data.getCellPhone()); } record.setShowFlag(byId1.getShowFlag()); record.setReplyContent(byId1.getReplyContent()); } AppUser data = remoteAppUserService.getAppUserById(record.getReportUserId().toString()).getData(); if (data!=null){ xinquan-modules/xinquan-meditation/src/main/java/com/xinquan/meditation/domain/vo/ClientMeditationEverydayVO.java
@@ -33,6 +33,8 @@ @ApiModelProperty(value = "每日冥想背景图片") private String imageUrl; @ApiModelProperty(value = "音频时长") private Integer time; @ApiModelProperty(value = "每日冥想") private ClientMeditationVO clientMeditationVO; xinquan-modules/xinquan-meditation/src/main/java/com/xinquan/meditation/service/impl/MeditationEverydayServiceImpl.java
@@ -37,13 +37,13 @@ */ @Override public ClientMeditationEverydayVO getTodayMeditation() { ClientMeditationEverydayVO vo = null; ClientMeditationEverydayVO vo = new ClientMeditationEverydayVO(); // 当前时间 String now = DateUtils.dateTimeNow("HH:mm:ss"); // 查询播放时间段在当前时间的每日冥想 Optional<MeditationEveryday> meditationEverydayOpt = this.lambdaQuery() .le(MeditationEveryday::getStartPlayTime, now) .ge(MeditationEveryday::getEndPlayTime, now) .ge(MeditationEveryday::getStartPlayTime, now) .le(MeditationEveryday::getEndPlayTime, now) .orderByDesc(MeditationEveryday::getUpdateTime) .last("limit 1").oneOpt(); if (!meditationEverydayOpt.isPresent()) { @@ -57,6 +57,11 @@ if (meditationEverydayOpt.isPresent()) { // 查询冥想详情 MeditationEveryday meditationEveryday = meditationEverydayOpt.get(); Long meditationId = meditationEveryday.getMeditationId(); Meditation meditation = meditationMapper.selectById(meditationId); if (meditation!=null){ vo.setTime(Integer.valueOf(meditation.getTutorAudioSecond())); } Optional<Meditation> meditationOpt = Optional.ofNullable( meditationMapper.selectById( meditationEveryday.getMeditationId())); xinquan-modules/xinquan-meditation/src/main/java/com/xinquan/meditation/service/impl/MeditationServiceImpl.java
@@ -344,7 +344,7 @@ if (data1.getVipExpireTime()!=null && data1.getVipExpireTime().isAfter(LocalDateTime.now())){ vo.setIsVip(1); }else{ vo.setIsVip(0); vo.setIsVip(2); } Integer data = remoteOrderService.getMeditationIsBuy(data1.getId(), id).getData(); vo.setIsBuy(data); xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/SysUserController.java
@@ -603,9 +603,7 @@ @PostMapping("/app-register") public R<SysUser> appRegister(@RequestBody SysUser sysUser) { String username = sysUser.getUserName(); if (!userService.checkAppUserNameUnique(sysUser)) { return R.fail("保存用户'" + username + "'失败,注册账号已存在"); } //添加用户 userService.registerUser(sysUser); return R.ok(sysUser); xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserController.java
@@ -119,6 +119,25 @@ List<AppUser> list = appUserService.list(); return R.ok(list); } @PostMapping("/bindVx") @ApiOperation(value = "绑定微信号", tags = "个人中心") public R bindVx(String openId,String wxName) { LoginUser loginUser = tokenService.getLoginUser(); if (loginUser==null){ return R.tokenError("登录失效"); } AppUser byId = appUserService.getById(loginUser.getUserid()); AppUser one = appUserService.lambdaQuery().eq(AppUser::getWxOpenId, openId) .isNotNull(AppUser::getCellPhone) .ne(AppUser::getUserStatus, 3).one(); if (one!=null){ return R.fail("当前微信号已绑定其他账号"); } byId.setWxOpenId(openId); byId.setWxName(wxName); appUserService.updateById(byId); return R.ok(); } public static void main(String[] args) { // 获取当前年份 int currentYear = LocalDate.now().getYear(); @@ -268,105 +287,7 @@ stringBuilder.append(year); return R.ok(stringBuilder.toString()); } // public static void main(String[] args) { // // 收件人电子邮箱,TODO 换成自己的收件箱 // String to = "443237572@qq.com"; // // 发件人电子邮箱,TODO 换成自己的发件箱 // String from = "13281306557@163.com"; // // 指定发送邮件的主机为 // String host = "smtp.163.com"; // Properties properties = new Properties(); // // 设置邮件服务器 // properties.setProperty("mail.smtp.host", host); // // 邮件发送协议 // properties.setProperty("mail.transport.protocol", "smtp"); // //是否启用调试模式(启用调试模式可打印客户端与服务器交互过程时一问一答的响应消息) // properties.setProperty("mail.debug","true"); // properties.setProperty("mail.smtp.auth", "true"); // // 获取默认session对象 // Session session = Session.getDefaultInstance(properties,new Authenticator(){ // @Override // public PasswordAuthentication getPasswordAuthentication() // { // //发件人邮件用户名、授权码,换成自己的发件箱及授权码 // return new PasswordAuthentication("13281306557@163.com", "NUSdxDQqadYvVek2"); // } // }); // // try{ // // 创建默认的 MimeMessage 对象 // MimeMessage message = new MimeMessage(session); // // Set From,设置发件人 // InternetAddress fromMail = new InternetAddress(from); // //设置发件人名称,TODO 换成自己的发件箱 // fromMail.setPersonal(MimeUtility.encodeText("明星电力<13281306557@163.com>")); // message.setFrom(fromMail); // // Set To: 设置收件人 // InternetAddress toMail = new InternetAddress(to); // // TODO 换成自己的收件箱 // InternetAddress toMail2 = new InternetAddress("443237572@qq.com"); // //发一个邮箱 //// message.setRecipient(Message.RecipientType.TO, toMail); // //发多个邮箱 // Address[] allRecipients = {toMail, toMail2}; // message.setRecipients(Message.RecipientType.TO, allRecipients); // // Set Subject: 邮件主体 // message.setSubject("明星电力"); // // 设置消息体 // message.setSentDate(new Date()); // // 指定为混合关系 // MimeMultipart msgMultipart = new MimeMultipart("mixed"); // message.setContent(msgMultipart); // // 邮件信息组装 // //组装的顺序非常重要,一定要先组装文本域,再组装文件 // MimeBodyPart htmlPart = new MimeBodyPart(); // // 组装内容 // htmlPart.setContent("This is message content", "text/html;charset=UTF-8"); // msgMultipart.addBodyPart(htmlPart); // // 组装附件 // MimeBodyPart filePart = new MimeBodyPart(); // String imageUrl = "https://xqgwzh.obs.cn-south-1.myhuaweicloud.com/xinquan/b176cf9af35d4773a276e55b7afe3b63.mp4"; // try { // // 下载数据 // URL url = new URL(imageUrl); // InputStream inputStream = url.openStream(); // byte[] imageBytes = IOUtils.toByteArray(inputStream); // // 创建临时文件 // // 截取imageUrl后缀名 // String fileExtension = imageUrl.substring(imageUrl.lastIndexOf(".")); // File tempFile = File.createTempFile("tempImage", fileExtension); // try (FileOutputStream fos = new FileOutputStream(tempFile)) { // fos.write(imageBytes); // } // // 创建 FileDataSource // FileDataSource fileDataSource = new FileDataSource(tempFile); // System.out.println("FileDataSource created: " + fileDataSource.getName()); // // 如果需要,可以使用 DataHandler 进行进一步处理 // DataHandler dh = new DataHandler(fileDataSource); // // 清理:删除临时文件(如果不再需要) // tempFile.deleteOnExit(); // 可根据需要保留或删除 //// DataHandler dh = new DataHandler(dataSource); // filePart.setDataHandler(dh); // // 附件区别内嵌内容的一个特点是有文件名,为防止中文乱码要编码 // filePart.setFileName(MimeUtility.encodeText(dh.getName())); // msgMultipart.addBodyPart(filePart); // // message.saveChanges(); // //发送 // //Transport.send(message, message.getAllRecipients()); // Transport.send(message); // System.out.println("Sent mail successfully...."); // } catch (Exception e) { // e.printStackTrace(); // } // //TODO 换成自己的附件地址 // // }catch (MessagingException | UnsupportedEncodingException mex) { // mex.printStackTrace(); // } catch (Exception e) { // throw new RuntimeException(e); // } // } @PostMapping("/userDetail") @ApiOperation(value = "用户详情-基础信息", tags = "管理后台-用户管理") @@ -380,23 +301,11 @@ }else{ byId.setIsVip(1); } List<AppUserTree> list1 = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, byId.getId()) .list(); // 查询用户等级最高的那颗树苗 AppUserTree tree = list1.stream().max((o1, o2) -> { if (o1.getTreeLevelType() > o2.getTreeLevelType()) { return 1; } else if (o1.getTreeLevelType() < o2.getTreeLevelType()) { return -1; } else { return 0; } }).orElse(null); AppUserTree list1 = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, uid) .eq(AppUserTree::getSowAgain,2) .one(); // 查询疗愈等级 名称 图标 int level = 1; if (tree != null){ level = tree.getTreeLevelType(); } int level = list1.getTreeLevelType(); // 根据等级查询疗愈名称和图标 UserLevelSetting data = remoteBannerService.getIconNameByLevel(level).getData(); byId.setLevel(level); @@ -1346,22 +1255,13 @@ currentDate = currentDate.minusDays(1); } appUserInfoVO.setToday(consecutiveDays); List<AppUserTree> list1 = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, userId) .list(); // 查询用户等级最高的那颗树苗 AppUserTree tree = list1.stream().max((o1, o2) -> { if (o1.getTreeLevelType() > o2.getTreeLevelType()) { return 1; } else if (o1.getTreeLevelType() < o2.getTreeLevelType()) { return -1; } else { return 0; } }).orElse(null); AppUserTree list1 = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, userId) .eq(AppUserTree::getSowAgain,2) .one(); // 查询疗愈等级 名称 图标 int level = 1; if (tree != null){ level = tree.getTreeLevelType(); if (list1 != null){ level = list1.getTreeLevelType(); } appUserInfoVO.setLevel(level); // 根据等级查询疗愈名称和图标 xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserCourseController.java
@@ -92,7 +92,7 @@ public R<PageDTO<AppUserCourse>> getPayCourse(@PathVariable("pageCurr")Integer pageCurr ,@PathVariable("pageSize")Integer pageSize,@PathVariable("id")String id) { Page<AppUserCourse> page = appUserCourseService.lambdaQuery() .eq(AppUserCourse::getCourseId, id) .eq(AppUserCourse::getAppUserId, id) .orderByDesc(AppUserCourse::getCreateTime) .page(new Page<>(pageCurr, pageSize)); if (CollUtils.isEmpty(page.getRecords())) { xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserTreeController.java
@@ -190,6 +190,7 @@ appUserTree.setEnergyValue(byId.getEnergyValue()); appUserTree.setNextLevel(1000); appUserTreeService.save(appUserTree); appUserTree.setTotalEnergyValue(byId.getTotalEnergyValue()); return R.ok(appUserTree); }else{ if (temp>=120){ @@ -278,6 +279,7 @@ one.setGrowthValue(total1); one.setEnergyValue(byId.getEnergyValue()); appUserTreeService.updateById(one); one.setTotalEnergyValue(byId.getTotalEnergyValue()); return R.ok(one); } } xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/service/impl/AppUserServiceImpl.java
@@ -122,7 +122,7 @@ } sysUser = sysUserClient.getSysUser(appUser.getUserId()).getData(); appUser.setAvatar(body.getHeadImgUrl()); appUser.setNickname(body.getNickname()); appUser.setWxName(body.getNickname()); if (appUser.getCellPhone()!=null){ appLoginUser.setBindStatus(DisabledEnum.NO.getCode()); appLoginUser.setCellPhone(appUser.getCellPhone()); @@ -151,6 +151,7 @@ appUser.setWxOpenId(body.getWxOpenId()); String nickname = "用户" + IdUtil.fastSimpleUUID().substring(0, 6); sysUser.setNickName(nickname); appUser.setWxName(body.getNickname()); appUser.setAvatar(body.getHeadImgUrl()); appUser.setGender(3); appUser.setBalance(BigDecimal.ZERO); @@ -160,6 +161,7 @@ appUser.setTotalEnergyValue(0); appUser.setRegisterTime(LocalDateTime.now()); appUser.setLevelSettingId(TreeLevelEnum.SEED.getCode()); appLoginUser.setBindStatus(DisabledEnum.YES.getCode()); this.save(appUser); // 初始化用户树苗 initUserTree(appUser.getId()); @@ -168,8 +170,8 @@ appLoginUser.setUsername(appUser.getNickname()); appLoginUser.setAppUserId(appUser.getId()); appLoginUser.setSysUser(sysUser); // if (Objects.nonNull(sysUser.getUserName())) { // appLoginUser.setBindStatus(DisabledEnum.YES.getCode()); // appLoginUser.setCellPhone(appUser.getCellPhone()); // } return appLoginUser; xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/utils/TaskUtil.java
@@ -102,8 +102,58 @@ +appUser.getVipExpireTime().toLocalDate()+"到期,到期后将不再享受会员权益,请及时续费"); noticeRecordService.save(noticeRecord); } } AppUserTree one = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, appUser.getId()) .eq(AppUserTree::getSowAgain, 2).one(); if(one.getTaskOne()==2||one.getTaskTwo()==2){ NoticeRecord noticeRecord = new NoticeRecord(); noticeRecord.setAppUserId(appUser.getId()); noticeRecord.setReadStatus(1); noticeRecord.setNoticeType(1); noticeRecord.setTitle("【冥想通知】"); noticeRecord.setContent("你今天的冥想任务还未完成,完成冥想后可获得能量值奖励,快去冥想吧!"); noticeRecordService.save(noticeRecord); } } } catch (Exception e) { e.printStackTrace(); } } @Scheduled(cron = "0 0 21 * * ?") public void taskNineDay() { try { LocalDateTime now = LocalDateTime.now(); List<AppUser> list = appUserService.lambdaQuery().ne(AppUser::getUserStatus, 3).list(); for (AppUser appUser : list) { AppUserTree one = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, appUser.getId()) .eq(AppUserTree::getSowAgain, 2).one(); if(one.getTaskOne()==2||one.getTaskTwo()==2){ NoticeRecord noticeRecord = new NoticeRecord(); noticeRecord.setAppUserId(appUser.getId()); noticeRecord.setReadStatus(1); noticeRecord.setNoticeType(1); noticeRecord.setTitle("【冥想通知】"); noticeRecord.setContent("你今天的冥想任务还未完成,完成冥想后可获得能量值奖励,快去冥想吧!"); noticeRecordService.save(noticeRecord); } if (appUser.getSignTime()==null){ NoticeRecord noticeRecord = new NoticeRecord(); noticeRecord.setAppUserId(appUser.getId()); noticeRecord.setReadStatus(1); noticeRecord.setNoticeType(1); noticeRecord.setTitle("【签到通知】"); noticeRecord.setContent("你今天还未签到,及时签到可获得能量值奖励,快去签到吧!"); noticeRecordService.save(noticeRecord); }else if (!appUser.getSignTime().toLocalDate().equals(LocalDateTime.now().toLocalDate())){ NoticeRecord noticeRecord = new NoticeRecord(); noticeRecord.setAppUserId(appUser.getId()); noticeRecord.setReadStatus(1); noticeRecord.setNoticeType(1); noticeRecord.setTitle("【签到通知】"); noticeRecord.setContent("你今天还未签到,及时签到可获得能量值奖励,快去签到吧!"); noticeRecordService.save(noticeRecord); } } } catch (Exception e) { e.printStackTrace();