|
@@ -31,10 +31,8 @@ import com.zhongzheng.modules.course.bo.CourseModuleChapterQueryBo;
|
|
import com.zhongzheng.modules.course.bo.CourseSectionQueryBo;
|
|
import com.zhongzheng.modules.course.bo.CourseSectionQueryBo;
|
|
import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
import com.zhongzheng.modules.course.domain.CourseSection;
|
|
import com.zhongzheng.modules.course.domain.CourseSection;
|
|
-import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
|
|
|
|
-import com.zhongzheng.modules.course.service.ICourseMenuService;
|
|
|
|
-import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
|
|
|
|
-import com.zhongzheng.modules.course.service.ICourseSectionService;
|
|
|
|
|
|
+import com.zhongzheng.modules.course.domain.CourseSubject;
|
|
|
|
+import com.zhongzheng.modules.course.service.*;
|
|
import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
|
|
import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
|
|
import com.zhongzheng.modules.course.vo.CourseMenuVo;
|
|
import com.zhongzheng.modules.course.vo.CourseMenuVo;
|
|
import com.zhongzheng.modules.course.vo.CourseModuleChapterVo;
|
|
import com.zhongzheng.modules.course.vo.CourseModuleChapterVo;
|
|
@@ -58,15 +56,9 @@ import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
import com.zhongzheng.modules.goods.vo.GoodsCourseVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsCourseVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
-import com.zhongzheng.modules.grade.domain.ClassGradeUser;
|
|
|
|
-import com.zhongzheng.modules.grade.domain.ClassGradeUserTemp;
|
|
|
|
-import com.zhongzheng.modules.grade.domain.UserPeriod;
|
|
|
|
-import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
|
|
|
|
|
|
+import com.zhongzheng.modules.grade.domain.*;
|
|
import com.zhongzheng.modules.grade.service.*;
|
|
import com.zhongzheng.modules.grade.service.*;
|
|
-import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
|
|
|
|
-import com.zhongzheng.modules.grade.vo.ClassGradeUserVo;
|
|
|
|
-import com.zhongzheng.modules.grade.vo.ClassPeriodSectionVo;
|
|
|
|
-import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
|
|
|
|
|
|
+import com.zhongzheng.modules.grade.vo.*;
|
|
import com.zhongzheng.modules.inform.bo.InformQueryBo;
|
|
import com.zhongzheng.modules.inform.bo.InformQueryBo;
|
|
import com.zhongzheng.modules.inform.bo.InformUserAddBo;
|
|
import com.zhongzheng.modules.inform.bo.InformUserAddBo;
|
|
import com.zhongzheng.modules.inform.domain.Inform;
|
|
import com.zhongzheng.modules.inform.domain.Inform;
|
|
@@ -76,6 +68,13 @@ import com.zhongzheng.modules.inform.service.IInformService;
|
|
import com.zhongzheng.modules.inform.service.IInformUserService;
|
|
import com.zhongzheng.modules.inform.service.IInformUserService;
|
|
import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
import com.zhongzheng.modules.inform.vo.InformVo;
|
|
import com.zhongzheng.modules.inform.vo.InformVo;
|
|
|
|
+import com.zhongzheng.modules.mock.domain.MockApply;
|
|
|
|
+import com.zhongzheng.modules.mock.domain.MockMajorSubject;
|
|
|
|
+import com.zhongzheng.modules.mock.domain.MockMajorSubjectTime;
|
|
|
|
+import com.zhongzheng.modules.mock.service.IMockApplyService;
|
|
|
|
+import com.zhongzheng.modules.mock.service.IMockMajorSubjectService;
|
|
|
|
+import com.zhongzheng.modules.mock.service.IMockMajorSubjectTimeService;
|
|
|
|
+import com.zhongzheng.modules.mock.vo.MockApplyVo;
|
|
import com.zhongzheng.modules.order.bo.OrderQueryBo;
|
|
import com.zhongzheng.modules.order.bo.OrderQueryBo;
|
|
import com.zhongzheng.modules.order.domain.Order;
|
|
import com.zhongzheng.modules.order.domain.Order;
|
|
import com.zhongzheng.modules.order.mapper.OrderGoodsMapper;
|
|
import com.zhongzheng.modules.order.mapper.OrderGoodsMapper;
|
|
@@ -231,6 +230,24 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
@Autowired
|
|
@Autowired
|
|
private OrderGoodsMapper orderGoodsMapper;
|
|
private OrderGoodsMapper orderGoodsMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IClassGradeService iClassGradeService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IMockApplyService iMockApplyService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserMockSubscribeService iUserMockSubscribeService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IMockMajorSubjectTimeService iMockMajorSubjectTimeService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IMockMajorSubjectService iMockMajorSubjectService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICourseSubjectService iCourseSubjectService;
|
|
|
|
+
|
|
@Value("${aliyun.sms.OpenTheGoodsCode}")
|
|
@Value("${aliyun.sms.OpenTheGoodsCode}")
|
|
private String OpenTheGoodsCode;
|
|
private String OpenTheGoodsCode;
|
|
|
|
|
|
@@ -1307,4 +1324,183 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void sendMockSubscribe(UserQueryBo bo) {
|
|
|
|
+ List<ClassGradeVo> classGradeVos = iClassGradeService.listGradeSubjects();
|
|
|
|
+ List<MockApplyVo> mockApplyVos = iMockApplyService.listSubjects();
|
|
|
|
+ List<Long> gradeIds = new ArrayList<>();
|
|
|
|
+ classGradeVos.forEach(classGradeVo -> {
|
|
|
|
+ String[] subjectId = classGradeVo.getSubjectIds().split(",");
|
|
|
|
+ List<String> subjectIds = Arrays.asList(subjectId);
|
|
|
|
+ for (MockApplyVo mockApplyVo : mockApplyVos) {
|
|
|
|
+ if (subjectIds.contains(mockApplyVo.getSubjectId())) {
|
|
|
|
+ gradeIds.add(classGradeVo.getGradeId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ List<ClassGradeStudentVo> classGradeStudentVos = new ArrayList<>();
|
|
|
|
+ if (gradeIds != null && gradeIds.size() > 0) {
|
|
|
|
+ gradeIds.forEach(gradeId -> {
|
|
|
|
+ ClassGradeUserQueryBo bo1 = new ClassGradeUserQueryBo();
|
|
|
|
+ bo1.setGradeId(gradeId);
|
|
|
|
+ classGradeStudentVos.addAll(iClassGradeService.listGrade(bo1));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (ClassGradeStudentVo classGradeStudentVo : classGradeStudentVos) {
|
|
|
|
+ InformRemindVo informRemindVo = informRemindService.queryById(25L);
|
|
|
|
+ if (informRemindVo.getWayStatus().equals(1)) {
|
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
|
+ informUserAddBo.setUserId(classGradeStudentVo.getUserId());
|
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setRemindId(25L);
|
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
|
+ informUserAddBo.setRemind("模考预约提醒");
|
|
|
|
+ informUserAddBo.setText("尊敬的用户:【" + classGradeStudentVo.getBusinessName() + classGradeStudentVo.getProjectName() + "】建考前模拟考试将开始报名参加模拟考试。请登录【祥粤云小程序】或【web.xyyxt.net】进行报名。");
|
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
|
+ }
|
|
|
|
+ if (informRemindVo.getNoteStatus().equals(1)) {
|
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
|
+ informUserAddBo.setUserId(classGradeStudentVo.getUserId());
|
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setRemindId(25L);
|
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
|
+ informUserAddBo.setRemind("模考预约提醒");
|
|
|
|
+ informUserAddBo.setText("尊敬的用户:【" + classGradeStudentVo.getBusinessName() + classGradeStudentVo.getProjectName() + "】建考前模拟考试将开始报名参加模拟考试。请登录【祥粤云小程序】或【web.xyyxt.net】进行报名。");
|
|
|
|
+ UserVo userVo = iUserService.queryById(classGradeStudentVo.getUserId());
|
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
|
+ if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), bookingReminder))) {
|
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void mockTimeSend(UserQueryBo bo) {
|
|
|
|
+ //提醒考试
|
|
|
|
+ LambdaQueryWrapper<UserMockSubscribe> lqw = Wrappers.lambdaQuery();
|
|
|
|
+ lqw.eq(UserMockSubscribe::getMockRemind,1);
|
|
|
|
+ List<UserMockSubscribe> userMockSubscribeList = iUserMockSubscribeService.list(lqw);
|
|
|
|
+ userMockSubscribeList.removeIf(userMockSubscribe -> {
|
|
|
|
+ try {
|
|
|
|
+ return System.currentTimeMillis()/1000 + 3600 <= formatTime(userMockSubscribe.getApplySiteExamTime(), userMockSubscribe.getApplySiteStartTime());
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ });
|
|
|
|
+ InformRemindVo informRemindVo = informRemindService.queryById(26L);
|
|
|
|
+ if (userMockSubscribeList != null && userMockSubscribeList.size() > 0) {
|
|
|
|
+ for (UserMockSubscribe subscribeVo : userMockSubscribeList) {
|
|
|
|
+ String res;
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ Long timeId = subscribeVo.getApplySiteExamTime() * 1000;
|
|
|
|
+ Date date = new Date(timeId);
|
|
|
|
+ res = simpleDateFormat.format(date);
|
|
|
|
+ String startTime = subscribeVo.getApplySiteStartTime();
|
|
|
|
+ String endTime = subscribeVo.getApplySiteEndTime();
|
|
|
|
+ LambdaQueryWrapper<MockMajorSubjectTime> lqw2 = Wrappers.lambdaQuery();
|
|
|
|
+ lqw2.eq(MockMajorSubjectTime::getId, subscribeVo.getEachExamId());
|
|
|
|
+ MockMajorSubjectTime mockMajorSubjectTime = iMockMajorSubjectTimeService.getOne(lqw2);
|
|
|
|
+ LambdaQueryWrapper<MockMajorSubject> lqw3 = Wrappers.lambdaQuery();
|
|
|
|
+ lqw3.eq(MockMajorSubject::getMockMajorSubjectId, mockMajorSubjectTime.getMockMajorSubjectId());
|
|
|
|
+ MockMajorSubject mockMajorSubject = iMockMajorSubjectService.getOne(lqw3);
|
|
|
|
+ LambdaQueryWrapper<CourseSubject> lqw4 = Wrappers.lambdaQuery();
|
|
|
|
+ lqw4.eq(CourseSubject::getId, mockMajorSubject.getSubjectId());
|
|
|
|
+ CourseSubject courseSubject = iCourseSubjectService.getOne(lqw4);
|
|
|
|
+ LambdaQueryWrapper<MockApply> lqw5 = Wrappers.lambdaQuery();
|
|
|
|
+ lqw5.eq(MockApply::getApplyId, subscribeVo.getApplyId());
|
|
|
|
+ MockApply mockApply = iMockApplyService.getOne(lqw5);
|
|
|
|
+ if (informRemindVo.getWayStatus().equals(1)) {
|
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
|
+ informUserAddBo.setUserId(subscribeVo.getUserId());
|
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setRemindId(26L);
|
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
|
+ informUserAddBo.setRemind("模考提醒");
|
|
|
|
+ informUserAddBo.setText("祥粤云学堂提醒:您学习【" + courseSubject.getSubjectName() + "】科目中的【" + mockApply.getApplyName() + "模考】已将于60分钟后开始直播,请及时在【祥粤云小程序】或【web.xyyxt.net】进行考试。");
|
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
|
+ }
|
|
|
|
+ if (informRemindVo.getNoteStatus().equals(1)) {
|
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
|
+ informUserAddBo.setUserId(subscribeVo.getUserId());
|
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setRemindId(3L);
|
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
|
+ informUserAddBo.setRemind("模考提醒");
|
|
|
|
+ informUserAddBo.setText("祥粤云学堂提醒:您学习【" + courseSubject.getSubjectName() + "】科目中的【" + mockApply.getApplyName() + "模考】已将于60分钟后开始直播,请及时在【祥粤云小程序】或【web.xyyxt.net】进行考试。");
|
|
|
|
+ UserVo userVo = iUserService.queryById(subscribeVo.getUserId());
|
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
|
+ param.put("time", res + "(" + startTime + "-" + endTime + ")");
|
|
|
|
+ if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), examinationRemind))) {
|
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void mockLiveSend(UserQueryBo bo) {
|
|
|
|
+ List<UserMockSubscribeVo> userMockSubscribeVoList = iUserMockSubscribeService.listLiveSubscribe();
|
|
|
|
+ userMockSubscribeVoList.removeIf(userMockSubscribeVo -> System.currentTimeMillis()/1000 + 3600 <= userMockSubscribeVo.getLiveStartTime());
|
|
|
|
+ for (UserMockSubscribeVo userMockSubscribeVo : userMockSubscribeVoList) {
|
|
|
|
+ InformRemindVo informRemindVo = informRemindService.queryById(27L);
|
|
|
|
+ if (informRemindVo.getWayStatus().equals(1)) {
|
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
|
+ informUserAddBo.setUserId(userMockSubscribeVo.getUserId());
|
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setRemindId(27L);
|
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
|
+ informUserAddBo.setRemind("直播开课提醒");
|
|
|
|
+ informUserAddBo.setText("祥粤云学堂提醒:您学习【" + userMockSubscribeVo.getSubjectName() + "】科目中的【" + userMockSubscribeVo.getPrefixName() + "直播】已将于60分钟后开始直播,请及时在【祥粤云小程序】或【web.xyyxt.net】进行观看。");
|
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
|
+ }
|
|
|
|
+ if (informRemindVo.getNoteStatus().equals(1)) {
|
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
|
+ informUserAddBo.setUserId(userMockSubscribeVo.getUserId());
|
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
+ informUserAddBo.setRemindId(13L);
|
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
|
+ informUserAddBo.setRemind("考试预约提醒");
|
|
|
|
+ informUserAddBo.setText("祥粤云学堂提醒:您学习【" + userMockSubscribeVo.getSubjectName() + "】科目中的【" + userMockSubscribeVo.getPrefixName() + "直播】已将于60分钟后开始直播,请及时在【祥粤云小程序】或【web.xyyxt.net】进行观看。");
|
|
|
|
+ UserVo userVo = iUserService.queryById(userMockSubscribeVo.getUserId());
|
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
|
+ if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), bookingReminder))) {
|
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private Long formatTime(Long startTime, String addTime) throws ParseException{
|
|
|
|
+ Long times = startTime*1000;//时间戳
|
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ String dateString = formatter.format(times);
|
|
|
|
+ String dateForma =null;
|
|
|
|
+ dateForma = dateString+" "+addTime.replace("-", ":");
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
|
+ return sdf.parse(dateForma).getTime() / 1000;
|
|
|
|
+ }
|
|
}
|
|
}
|