diff --git a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java index aa54099..5e873fd 100644 --- a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java +++ b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.vod.InsertHistoryNewDTO; import com.subsidy.dto.vod.RemainSecondsDTO; import com.subsidy.dto.vod.SignDatePlaysDTO; import com.subsidy.model.VodPlayHistoryDO; @@ -42,10 +43,10 @@ public class VodPlayHistoryController { @RequestMapping("insertHistoryNew") @ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点") - @LoginRequired +// @LoginRequired public ResponseVO insertHistoryNew(@RequestBody String param){ - VodPlayHistoryDO vodPlayHistoryDO = JSON.parseObject(param,VodPlayHistoryDO.class); - return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistoryNew(vodPlayHistoryDO)); + InsertHistoryNewDTO insertHistoryNewDTO = JSON.parseObject(param, InsertHistoryNewDTO.class); + return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistoryNew(insertHistoryNewDTO)); } @PostMapping("dataFix") diff --git a/src/main/java/com/subsidy/dto/vod/InsertHistoryNewDTO.java b/src/main/java/com/subsidy/dto/vod/InsertHistoryNewDTO.java new file mode 100644 index 0000000..ee200dd --- /dev/null +++ b/src/main/java/com/subsidy/dto/vod/InsertHistoryNewDTO.java @@ -0,0 +1,11 @@ +package com.subsidy.dto.vod; + +import com.subsidy.model.VodPlayHistoryDO; +import lombok.Data; + +@Data +public class InsertHistoryNewDTO extends VodPlayHistoryDO { + + private String token; + +} diff --git a/src/main/java/com/subsidy/service/VodPlayHistoryService.java b/src/main/java/com/subsidy/service/VodPlayHistoryService.java index a907395..450eb8b 100644 --- a/src/main/java/com/subsidy/service/VodPlayHistoryService.java +++ b/src/main/java/com/subsidy/service/VodPlayHistoryService.java @@ -1,5 +1,6 @@ package com.subsidy.service; +import com.subsidy.dto.vod.InsertHistoryNewDTO; import com.subsidy.dto.vod.RemainSecondsDTO; import com.subsidy.dto.vod.SignDatePlaysDTO; import com.subsidy.dto.vod.FixDataTwoDTO; @@ -18,7 +19,7 @@ public interface VodPlayHistoryService extends IService { String insertHistory(VodPlayHistoryDO vodPlayHistoryDO); - String insertHistoryNew(VodPlayHistoryDO vodPlayHistoryDO); + String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDTO); void dataFix(SignDatePlaysDTO dataFixDTO); diff --git a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java index 2eb8235..f510627 100644 --- a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java @@ -134,17 +134,17 @@ public class ClassDictServiceImpl extends ServiceImpl classNoticeDOS = addClassDTO.getClassNoticeDOS(); for (ClassNoticeDO classNoticeDO : classNoticeDOS) { - if (DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd").before(new Date())) { + if (DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH").before(new Date())) { throw new HttpException(70001); } classNoticeDO.setClassId(classDictDO.getId()); - //classNoticeDO.setStatus(CourseNotification.UNSENT); + classNoticeDO.setStatus(CourseNotification.UNSENT); classNoticeMapper.insert(classNoticeDO); Map 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"), params, name, "CourseNotificationJob"); + quartzUtil.addSimpleJob(CourseNotificationJob.class, DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH:mm:ss"), params, name, "CourseNotificationJob"); } } diff --git a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java index 4b870d8..df10d5e 100644 --- a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java @@ -152,6 +152,7 @@ public class CompanyDictServiceImpl extends ServiceImpl() diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a62a220..37ce64a 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ # 环境配置 -spring.profiles.active=dev +spring.profiles.active=prod # 端口号 -spring.server.port=23457 +spring.server.port=23459 #嵌入tomcat配置 #和CPU数 spring.server.acceptorThreadCount=600 diff --git a/src/main/resources/mapper/VodPlayHistoryMapper.xml b/src/main/resources/mapper/VodPlayHistoryMapper.xml index 39b8003..1c318fd 100644 --- a/src/main/resources/mapper/VodPlayHistoryMapper.xml +++ b/src/main/resources/mapper/VodPlayHistoryMapper.xml @@ -266,7 +266,8 @@ vod_play_history t LEFT JOIN vod_dict t2 ON t.vod_id = t2.id WHERE - t.class_id = #{classId} + t.delete_date is null + and t.class_id = #{classId} AND t.member_id = #{memberId} ) t1 LEFT JOIN ( @@ -277,7 +278,8 @@ vod_play_history t LEFT JOIN vod_dict t2 ON t.vod_id = t2.id WHERE - t.class_id = #{classId} + t.delete_date is null + and t.class_id = #{classId} AND t.member_id = #{memberId} GROUP BY t.vod_id