From c4710bba207999fe645926cc0c6153fda50b37bc Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 4 Mar 2022 10:29:28 +0800 Subject: [PATCH] 2.2.1上线了。。。。 --- src/main/java/com/subsidy/controller/ClassNoticeController.java | 2 +- src/main/java/com/subsidy/model/ClassNoticeDO.java | 4 ++++ src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java | 2 +- src/main/java/com/subsidy/service/impl/ClassNoticeServiceImpl.java | 36 ++++++++++++++++++------------------ src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java | 6 ++++++ src/main/resources/application.properties | 4 ++-- 6 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/subsidy/controller/ClassNoticeController.java b/src/main/java/com/subsidy/controller/ClassNoticeController.java index b69d979..1e7540f 100644 --- a/src/main/java/com/subsidy/controller/ClassNoticeController.java +++ b/src/main/java/com/subsidy/controller/ClassNoticeController.java @@ -50,7 +50,7 @@ public class ClassNoticeController { } @PostMapping("queryClassNotices") - @ApiOperation("查看某个课程的通知提醒 classId 课程id noticeType 状态(待发送/已发送)") + @ApiOperation("查看某个课程的通知提醒 classId 课程id status 状态(待发送/已发送)") public ResponseVO queryClassNotices(@RequestBody ClassNoticeDO classNoticeDO){ return ResponseData.generateCreatedResponse(0,classNoticeService.queryClassNotices(classNoticeDO)); } diff --git a/src/main/java/com/subsidy/model/ClassNoticeDO.java b/src/main/java/com/subsidy/model/ClassNoticeDO.java index db2c169..8f48268 100644 --- a/src/main/java/com/subsidy/model/ClassNoticeDO.java +++ b/src/main/java/com/subsidy/model/ClassNoticeDO.java @@ -41,5 +41,9 @@ public class ClassNoticeDO extends BaseModel { */ private String noticeTime; + /** + * 发送状态 + */ + private String status; } diff --git a/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java index 3543fb6..138cc8d 100644 --- a/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java @@ -133,7 +133,7 @@ public class ClassHourDictServiceImpl extends ServiceImpl params = new HashMap<>(); params.put("classId", classNoticeDO.getClassId()); params.put("id", classNoticeDO.getId()); - String name = classDictDO.getClassName() + "-" + classNoticeDO.getNoticeType() + "-" + classNoticeDO.getNoticeTime(); - quartzUtil.addSimpleJob(CourseNotificationJob.class, DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH:mm:ss"), params, name, "CourseNotificationJob"); + String name = classDictDO.getClassName()+"-"+classNoticeDO.getNoticeType()+"-"+classNoticeDO.getNoticeTime(); + quartzUtil.addSimpleJob(CourseNotificationJob.class,DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH:mm:ss") , params, name, "CourseNotificationJob"); return ConstantUtils.ADD_SUCCESS; } @@ -78,41 +78,41 @@ public class ClassNoticeServiceImpl extends ServiceImpl queryClassNotices(ClassNoticeDO classNoticeDO) { + public List queryClassNotices(ClassNoticeDO classNoticeDO){ return this.baseMapper.selectList(new QueryWrapper() - .lambda() - .eq(ClassNoticeDO::getNoticeType, classNoticeDO.getNoticeType()) - .eq(ClassNoticeDO::getClassId, classNoticeDO.getClassId())); + .lambda() + .eq(ClassNoticeDO::getStatus, classNoticeDO.getStatus()) + .eq(ClassNoticeDO::getClassId,classNoticeDO.getClassId())); } @Override public void sendNotification(SendNotificationDTO sendNotificationDTO) { ClassAndCompanyInfoVO cmInfo = classDictMapper.getClassAndCompanyInfoVO(sendNotificationDTO.getClassId()); - if (sendNotificationDTO.getSendType().equals(SmsCode.ALL.getType())) { - String params = "{\"company\":\"" + cmInfo.getCompany() + "\", \"course\":\"" + cmInfo.getCourseName() + "\", \"startDate\": \"" + cmInfo.getStartDate() + "\", \"endDate\": \"" + cmInfo.getEndDate() + "\"}"; + if(sendNotificationDTO.getSendType().equals(SmsCode.ALL.getType())) { + String params = "{\"company\":\""+ cmInfo.getCompany() +"\", \"course\":\""+ cmInfo.getCourseName() +"\", \"startDate\": \""+ cmInfo.getStartDate()+"\", \"endDate\": \""+ cmInfo.getEndDate()+"\"}"; List list = memberMapper.getMemberList(sendNotificationDTO.getClassId()); - if (list != null) { + if(list != null) { for (MemberDO memberDO : list) { SMSUtils.sendNoticeSMS(SmsCode.ALL.getCode(), memberDO.getTelephone(), params); } } - } else if (sendNotificationDTO.getSendType().equals(SmsCode.NOT_SIGNED_IN.getType())) { - String params = "{ \"name\": \"" + cmInfo.getName() + "\", \"course\":\"" + cmInfo.getCourseName() + "\"}"; + } else if(sendNotificationDTO.getSendType().equals(SmsCode.NOT_SIGNED_IN.getType())) { + String params = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}"; List list = memberMapper.getMemberListBySignInRecord(sendNotificationDTO.getClassId()); - if (list != null) { + if(list != null) { for (MemberDO memberDO : list) { SMSUtils.sendNoticeSMS(SmsCode.NOT_SIGNED_IN.getCode(), memberDO.getTelephone(), params); } } - } else if (sendNotificationDTO.getSendType().equals(SmsCode.UNFINISHED.getType())) { - String params = "{ \"name\": \"" + cmInfo.getName() + "\", \"course\":\"" + cmInfo.getCourseName() + "\"}"; + } else if(sendNotificationDTO.getSendType().equals(SmsCode.UNFINISHED.getType())) { + String params = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}"; List list = memberMapper.getUnfinishedMemberList(sendNotificationDTO.getClassId()); - if (list != null) { + if(list != null) { for (MemberDO memberDO : list) { SMSUtils.sendNoticeSMS(SmsCode.UNFINISHED.getCode(), memberDO.getTelephone(), params); } diff --git a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java index c40e517..a58a537 100644 --- a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java @@ -71,6 +71,9 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl= classHourDictDO.getClassHour() * 3600) { + int playLength = classHourDictDO.getClassHour()*3600-total; + vodPlayHistoryDO.setPlayLength(playLength); + this.baseMapper.insert(vodPlayHistoryDO); throw new HttpException(13001); } } @@ -92,6 +95,9 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl= classHourDictDO.getClassHour() * 3600) { + int playLength = classHourDictDO.getClassHour()*3600-total; + vodPlayHistoryDO.setPlayLength(playLength); + this.baseMapper.insert(vodPlayHistoryDO); throw new HttpException(13001); } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 37ce64a..a62a220 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ # 环境配置 -spring.profiles.active=prod +spring.profiles.active=dev # 端口号 -spring.server.port=23459 +spring.server.port=23457 #嵌入tomcat配置 #和CPU数 spring.server.acceptorThreadCount=600 -- libgit2 0.25.0