Commit b9001907 by 涂亚平

补贴培训第3次上课熬夜改数据

1 parent 9c71b838
......@@ -80,8 +80,8 @@ public class VodPlayHistoryController {
@GetMapping("testPlays")
@ApiOperation("解决有交叉时间的数据 classId")
public ResponseVO testPlays(@RequestParam("classId") Long classId ){
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.testPlays(classId));
public ResponseVO testPlays(){
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.testPlays());
}
@PostMapping("warning")
......
......@@ -10,13 +10,14 @@ import com.subsidy.vo.vod.VodPlayStateVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
//@Component
@Component
public class WarningJob {
/**
......@@ -67,11 +68,6 @@ public class WarningJob {
}
}
// List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"});
// telephones.stream().forEach(x -> {
// smsUtils.sendVerifySMS("SMS_460945631", x, result.toString());
// });
if (result.size()>0){
List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"});
for (String telephone : telephones){
......
......@@ -37,7 +37,7 @@ public interface RenSheJuMapper {
/**
* 前一天新增视频学习数据
*/
List<DailyStudyInfoVO> dailyStudyInfo(String classType);
List<DailyStudyInfoVO> dailyStudyInfo(String classId);
/**
* 前一天活跃度检测列表
......
......@@ -8,6 +8,7 @@ import com.subsidy.model.VodPlayHistoryDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.vod.VodPlayStateVO;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
......@@ -33,7 +34,7 @@ public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> {
void playLengthFix(RemainSecondsDTO remainSecondsDTO);
HashSet<Long> testPlays(Long classId);
HashMap<Long, HashSet<Long>> testPlays();
void warning();
......
......@@ -30,6 +30,12 @@ public class DudaoServiceImpl implements DudaoService {
*/
public static final String PREFIX_URL = "http://180.167.195.117:18015/ddproject";
/**
* 正式环境
*/
public static final String PROD_URL = "http://180.167.195.117:18025/ddproject";
@Autowired
private RenSheJuMapper renSheJuMapper;
......
......@@ -635,23 +635,27 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
// }
}
public HashSet<Long> testPlays(Long classId) {
public HashMap<Long, HashSet<Long>> testPlays() {
// String[] classIdArr = classIds.split(",");
HashSet<Long> result = new HashSet<>();
// for (String classId : classIdArr) {
List<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getClassId, classId));
for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) {
List<VodPlayStateVO> vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId));
for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) {
VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面
VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面
if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) {
//这一条数据有问题
System.out.println("111111111111111111111" + vodPlayStateVO);
//查看这个人 这个课程 当天的全部数据 按照createDate升序排序
//查看当天产生视频学习的班级
List<Long> classIds = vodPlayHistoryMapper.dailyVodRecord();
HashMap<Long, HashSet<Long>> hashMap = new HashMap();
for (Long classId : classIds) {
List<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getClassId, classId));
HashSet<Long> result = new HashSet<>();
for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) {
List<VodPlayStateVO> vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId));
for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) {
VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面
VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面
if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) {
//这一条数据有问题
// System.out.println("111111111111111111111" + vodPlayStateVO);
//查看这个人 这个课程 当天的全部数据 按照createDate升序排序
// List<VodPlayHistoryDO> vodPlayHistoryDOS = this.baseMapper.getVodPlayDay(Long.valueOf(classId), classMemberMappingDO.getMemberId(), vodPlayStateVO.getStartDate());
// //从第一条开始看,顺延减去第二条的playlength得到第二条的create_date 以此类推
// for (int l = 0; l < vodPlayHistoryDOS.size() - 1; l++) {
......@@ -664,13 +668,14 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
// vph2.setPlayDate(dateTmp);
// this.baseMapper.updateById(vph2);
// }
result.add(vodPlayStateVO.getId());
result.add(vodPlayStateVO.getId());
// break;
}
}
}
hashMap.put(classId,result);
}
// }
return result;
return hashMap;
}
public void warning() {
......@@ -691,7 +696,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面
VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面
if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) {
if (!result.contains(vodPlayStateVO1.getClassId())){
if (!result.contains(vodPlayStateVO1.getClassId())) {
result.add(vodPlayStateVO.getClassId());
}
}
......@@ -699,12 +704,13 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
}
}
if (result.size()>0){
List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"});
for (String telephone : telephones){
smsUtils.sendWarning("SMS_460945631", telephone, result.toString());
}
}
System.out.println(result.toString());
// if (result.size()>0){
// List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"});
// for (String telephone : telephones){
// smsUtils.sendWarning("SMS_460945631", telephone, result.toString());
// }
// }
}
//19为基数的话,3次签到6.5到8,4次签到4.8-6,
......
......@@ -105,70 +105,77 @@
<select id="dailyStudyInfo" resultType="com.subsidy.vo.renshe.DailyStudyInfoVO">
SELECT
t2.class_id AS downCode,
t2.member_id,
t4.user_name AS studentName,
t4.telephone AS phone,
t4.id_card AS identity,
t2.learnTime,
t2.playTime,
t5.loginTime
DISTINCT
IFNULL(t2.class_id,t7.class_id) AS downCode,
t6.member_id,
t4.user_name AS studentName,
t4.telephone AS phone,
t4.id_card AS identity,
IFNULL(t2.learnTime,0),
IFNULL(t2.playTime,0),
t5.loginTime
FROM
(
class_member_mapping t6
LEFT JOIN member t4 ON t4.id = t6.member_id
LEFT JOIN (
SELECT
t3.user_id,
login - logout AS loginTime
login - logout AS loginTime ,
t3.create_date
FROM
(
SELECT
user_id,
sum(
unix_timestamp( t1.create_date )) AS login
user_id,
sum(
unix_timestamp( t1.create_date )) AS login ,
create_date
FROM
opr_mem_dict t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND opr_type = "登出"
AND result = 1
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND opr_type = "登出"
AND result = 1
GROUP BY
user_id
user_id
) t3
LEFT JOIN (
SELECT
user_id,
sum(
unix_timestamp( t1.create_date )) AS logout
user_id,
sum(
unix_timestamp( t1.create_date )) AS logout ,
create_date
FROM
opr_mem_dict t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND opr_type = "登录"
AND result = 1
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND opr_type = "登录"
AND result = 1
GROUP BY
user_id
) t2 ON t3.user_id = t2.user_id
) t5
) t5 on t5.user_id = t4.id
LEFT JOIN (
SELECT
t1.class_id,
t1.member_id,
sum( t1.play_length ) AS learnTime,
sum( t1.play_length + t1.suspend_length ) AS playTime
t1.class_id,
t1.member_id,
sum( t1.play_length ) AS learnTime,
sum( t1.play_length + t1.suspend_length ) AS playTime
FROM
vod_play_history t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
GROUP BY
t1.class_id,
t1.member_id
t1.class_id,
t1.member_id
) t2 ON t5.user_id = t2.member_id
LEFT JOIN class_dict t3 ON t2.class_id = t3.id
LEFT JOIN member t4 ON t2.member_id = t4.id
LEFT JOIN class_dict t3 ON t2.class_id = t3.id and t6.class_id = t3.id
LEFT JOIN image_check_record t7 on t5.user_id = t7.member_id and DATE_FORMAT(t5.create_date,'%Y-%m-%d') = DATE_FORMAT(t7.create_date,'%Y-%m-%d') and t7.result = 1
where t6.delete_date is null and t5.loginTime is not null and IFNULL(t2.class_id,t7.class_id) is not null
<if test="classType != null and classType != ''">
where t3.class_type = #{classType}
and t3.class_type = #{classType}
</if>
</select>
......@@ -254,8 +261,7 @@
</select>
<select id="loginOutRecords" parameterType="long" resultType="com.subsidy.model.OprMemDictDO">
SELECT
distinct *
select distinct *
FROM
opr_mem_dict t
WHERE
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!