Commit b7848432 by 涂亚平

2022.03.23 疫情备份

1 parent 9347a3c5
......@@ -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")
......
package com.subsidy.dto.vod;
import com.subsidy.model.VodPlayHistoryDO;
import lombok.Data;
@Data
public class InsertHistoryNewDTO extends VodPlayHistoryDO {
private String token;
}
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<VodPlayHistoryDO> {
String insertHistory(VodPlayHistoryDO vodPlayHistoryDO);
String insertHistoryNew(VodPlayHistoryDO vodPlayHistoryDO);
String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDTO);
void dataFix(SignDatePlaysDTO dataFixDTO);
......
......@@ -134,17 +134,17 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
if (null != addClassDTO.getClassNoticeDOS()) {
List<ClassNoticeDO> 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<String, Object> 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");
}
}
......
......@@ -152,6 +152,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
DepartmentDictDO departmentDictDO = new DepartmentDictDO();
departmentDictDO.setCompanyId(companyDictDO.getId());
departmentDictDO.setDepartmentName(companyDictDO.getCompanyName());
departmentDictDO.setFullName(companyDictDO.getCompanyName());
//departmentDictDO.setParentId(1L);
departmentDictMapper.insert(departmentDictDO);
......
......@@ -4,12 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.vod.FixDataTwoDTO;
import com.subsidy.dto.vod.InsertHistoryNewDTO;
import com.subsidy.dto.vod.RemainSecondsDTO;
import com.subsidy.dto.vod.SignDatePlaysDTO;
import com.subsidy.mapper.*;
import com.subsidy.model.*;
import com.subsidy.service.VodPlayHistoryService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.RedisUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -58,6 +62,9 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
@Autowired
private MemberMapper memberMapper;
@Autowired
private RedisUtil redisUtil;
public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO) {
MemberDO memberDO = memberMapper.selectById(vodPlayHistoryDO.getMemberId());
//查看系统设定的时长
......@@ -82,7 +89,17 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
return ConstantUtils.ADD_SUCCESS;
}
public String insertHistoryNew(VodPlayHistoryDO vodPlayHistoryDO) {
public String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDTO) {
//对比redis上的token
String token = redisUtil.get("mobile_"+insertHistoryNewDTO.getMemberId()).toString();
if (!insertHistoryNewDTO.getToken().equals(token)){
throw new HttpException(1010);
}
VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO();
BeanUtils.copyProperties(insertHistoryNewDTO,vodPlayHistoryDO);
MemberDO memberDO = memberMapper.selectById(vodPlayHistoryDO.getMemberId());
//查看系统设定的时长
ClassHourDictDO classHourDictDO = classHourDictMapper.selectOne(new QueryWrapper<ClassHourDictDO>()
......
# 环境配置
spring.profiles.active=dev
spring.profiles.active=prod
# 端口号
spring.server.port=23457
spring.server.port=23459
#嵌入tomcat配置
#和CPU数
spring.server.acceptorThreadCount=600
......
......@@ -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
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!