Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3a53359c
authored
Dec 08, 2023
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1106版本上线
1 parent
56870d91
Hide whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
1632 additions
and
381 deletions
pom.xml
src/main/java/com/subsidy/controller/PushDataController.java
src/main/java/com/subsidy/controller/RenSheJuController.java
src/main/java/com/subsidy/controller/VodPlayHistoryController.java
src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java
src/main/java/com/subsidy/dto/renshe/AnswerBasic.java
src/main/java/com/subsidy/dto/renshe/ChapterExamBasic.java
src/main/java/com/subsidy/dto/renshe/ChapterList3.java
src/main/java/com/subsidy/dto/renshe/ClassHourBasic.java
src/main/java/com/subsidy/dto/renshe/EpidemicSituationClassBasic.java
src/main/java/com/subsidy/dto/renshe/UploadImageDTO.java
src/main/java/com/subsidy/jobs/PushJob.java
src/main/java/com/subsidy/jobs/RenSheJuJob.java
src/main/java/com/subsidy/mapper/DudaoMapper.java
src/main/java/com/subsidy/mapper/PushAnsweringDataMapper.java
src/main/java/com/subsidy/mapper/PushDetectionDataMapper.java
src/main/java/com/subsidy/mapper/PushExerciseDataMapper.java
src/main/java/com/subsidy/mapper/PushImageDataMapper.java
src/main/java/com/subsidy/mapper/PushOprDataMapper.java
src/main/java/com/subsidy/mapper/PushVodDataMapper.java
src/main/java/com/subsidy/mapper/RenSheJuMapper.java
src/main/java/com/subsidy/mapper/RenshejuHistoryMapper.java
src/main/java/com/subsidy/model/PushAnsweringDataDO.java
src/main/java/com/subsidy/model/PushDetectionDataDO.java
src/main/java/com/subsidy/model/PushExerciseDataDO.java
src/main/java/com/subsidy/model/PushImageDataDO.java
src/main/java/com/subsidy/model/PushOprDataDO.java
src/main/java/com/subsidy/model/PushVodDataDO.java
src/main/java/com/subsidy/service/PushDataService.java
src/main/java/com/subsidy/service/RenSheJuService.java
src/main/java/com/subsidy/service/VodPlayHistoryService.java
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
src/main/java/com/subsidy/service/impl/DudaoServiceImpl.java
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
src/main/java/com/subsidy/service/impl/PushDataServiceImpl.java
src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
src/main/java/com/subsidy/util/RenSheJuConstant.java
src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java
src/main/java/com/subsidy/vo/renshe/ClassBaseInfoVO.java
src/main/java/com/subsidy/vo/renshe/DailyStudyInfoVO.java
src/main/resources/mapper/DudaoMapper.xml
src/main/resources/mapper/PushAnsweringDataMapper.xml
src/main/resources/mapper/PushDetectionDataMapper.xml
src/main/resources/mapper/PushExerciseDataMapper.xml
src/main/resources/mapper/PushImageDataMapper.xml
src/main/resources/mapper/PushOprDataMapper.xml
src/main/resources/mapper/PushVodDataMapper.xml
src/main/resources/mapper/RenSheJuMapper.xml
src/main/resources/mapper/RenshejuHistoryMapper.xml
src/main/resources/mybatis-plus.properties
pom.xml
View file @
3a53359
...
...
@@ -266,6 +266,12 @@
<artifactId>
okio
</artifactId>
<version>
1.13.0
</version>
</dependency>
<dependency>
<groupId>
com.google.code.gson
</groupId>
<artifactId>
gson
</artifactId>
<version>
2.8.6
</version>
</dependency>
</dependencies>
<build>
...
...
src/main/java/com/subsidy/controller/PushDataController.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
controller
;
import
com.subsidy.common.ResponseData
;
import
com.subsidy.common.ResponseVO
;
import
com.subsidy.service.PushDataService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
io.swagger.annotations.Api
;
/**
* <p>
* 问题答疑表 前端控制器
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@RestController
@Api
(
tags
=
"推数据回显"
)
@RequestMapping
(
"/pushData"
)
public
class
PushDataController
{
@Autowired
private
PushDataService
pushDataService
;
@PostMapping
(
"post4"
)
@ApiOperation
(
"学时数据回显"
)
public
void
post4
()
{
pushDataService
.
post4
();
}
@PostMapping
(
"post5"
)
@ApiOperation
(
"考试数据回显"
)
public
void
post5
()
{
pushDataService
.
post5
();
}
@PostMapping
(
"post6"
)
@ApiOperation
(
"答疑数据回显"
)
public
void
post6
()
{
pushDataService
.
post6
();
}
@PostMapping
(
"post7"
)
@ApiOperation
(
"人脸数据回显"
)
public
void
post7
()
{
pushDataService
.
post7
();
}
@GetMapping
(
"check"
)
@ApiOperation
(
"核对数据"
)
public
ResponseVO
check
(){
return
ResponseData
.
generateCreatedResponse
(
0
,
pushDataService
.
check
());
}
}
src/main/java/com/subsidy/controller/RenSheJuController.java
View file @
3a53359
...
...
@@ -21,56 +21,50 @@ public class RenSheJuController {
@Autowired
private
RenSheJuService
renSheJuService
;
@PostMapping
(
"getClassCodeByPrivateKey"
)
@ApiOperation
(
"POST-2 获取培训待绑定的(班级编号,项目编号)列表"
)
public
RensheResponseVO
getClassCodeByPrivateKey
()
throws
IOException
{
return
renSheJuService
.
getClassCodeByPrivateKey
();
}
@PostMapping
(
"classBaseInfo"
)
@ApiOperation
(
"POST-
2
:班级基本信息信息采集接口"
)
@ApiOperation
(
"POST-
3
:班级基本信息信息采集接口"
)
public
RensheResponseVO
classBaseInfo
()
throws
IOException
{
return
renSheJuService
.
classBaseInfo
();
}
@PostMapping
(
"classHourBehavior"
)
@ApiOperation
(
"POST-
3
:学时信息采集接口"
)
@ApiOperation
(
"POST-
4
:学时信息采集接口"
)
public
RensheResponseVO
classHourBehavior
()
throws
IOException
{
return
renSheJuService
.
classHourBehavior
();
}
@PostMapping
(
"uploadChapterBehavior"
)
@ApiOperation
(
"POST-
4
:考试信息采集接口"
)
@ApiOperation
(
"POST-
5
:考试信息采集接口"
)
public
RensheResponseVO
uploadChapterBehavior
()
throws
IOException
{
return
renSheJuService
.
uploadChapterBehavior
();
}
@PostMapping
(
"uploadClassAnswerQuestionBehavior"
)
@ApiOperation
(
"POST-
5
:答疑辅导采集接口"
)
@ApiOperation
(
"POST-
6
:答疑辅导采集接口"
)
public
RensheResponseVO
uploadClassAnswerQuestionBehavior
()
throws
IOException
{
return
renSheJuService
.
uploadClassAnswerQuestionBehavior
();
}
@PostMapping
(
"uploadImage"
)
@ApiOperation
(
"POST-
6
班级活跃度/实名认证照片信息采集接口"
)
@ApiOperation
(
"POST-
7
班级活跃度/实名认证照片信息采集接口"
)
public
List
<
RensheResponseVO
>
uploadImage
()
throws
IOException
{
return
renSheJuService
.
uploadImage
();
}
@PostMapping
(
"getClassCodeByPrivateKey"
)
@ApiOperation
(
"POST-7 获取培训待绑定的(班级编号,项目编号)列表"
)
public
RensheResponseVO
getClassCodeByPrivateKey
()
throws
IOException
{
return
renSheJuService
.
getClassCodeByPrivateKey
();
}
@PostMapping
(
"uploadClassCode"
)
@ApiOperation
(
"POST-8 上下游班级数据绑定接口"
)
public
RensheResponseVO
uploadClassCode
()
throws
IOException
{
return
renSheJuService
.
uploadClassCode
();
}
@PostMapping
(
"getErrorClass"
)
@ApiOperation
(
"POST-
9
获取推送失败班级列表"
)
@ApiOperation
(
"POST-
8
获取推送失败班级列表"
)
public
RensheResponseVO
getErrorClass
()
throws
IOException
{
return
renSheJuService
.
getErrorClass
();
}
@PostMapping
(
"clear"
)
@ApiOperation
(
"POST-
10
清除推送失败班级缓存"
)
@ApiOperation
(
"POST-
9
清除推送失败班级缓存"
)
public
RensheStringVO
clear
()
throws
IOException
{
return
renSheJuService
.
clear
();
}
...
...
src/main/java/com/subsidy/controller/VodPlayHistoryController.java
View file @
3a53359
...
...
@@ -40,7 +40,7 @@ public class VodPlayHistoryController {
"memberId 成员id playLength 播放时长 playRecord 位点 suspendLength暂停时长 "
)
@LoginRequired
@TimeRequired
public
ResponseVO
insertHistory
(
@RequestBody
VodPlayHistoryDO
vodPlayHistoryDO
,
HttpServletRequest
request
){
public
ResponseVO
insertHistory
(
@RequestBody
VodPlayHistoryDO
vodPlayHistoryDO
,
HttpServletRequest
request
)
throws
Exception
{
return
ResponseData
.
generateCreatedResponse
(
0
,
vodPlayHistoryService
.
insertHistory
(
vodPlayHistoryDO
,
request
));
}
...
...
@@ -48,7 +48,7 @@ public class VodPlayHistoryController {
@ApiOperation
(
"记录学生看视频位置 classId班级id vodId 视频id memberId 成员id "
+
"playLength 播放时长 playRecord 位点 suspendLength"
)
@TimeRequired
public
ResponseVO
insertHistoryNew
(
@RequestBody
String
param
,
HttpServletRequest
request
){
public
ResponseVO
insertHistoryNew
(
@RequestBody
String
param
,
HttpServletRequest
request
)
throws
Exception
{
InsertHistoryNewDTO
insertHistoryNewDTO
=
JSON
.
parseObject
(
param
,
InsertHistoryNewDTO
.
class
);
return
ResponseData
.
generateCreatedResponse
(
0
,
vodPlayHistoryService
.
insertHistoryNew
(
insertHistoryNewDTO
,
request
));
}
...
...
src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java
View file @
3a53359
...
...
@@ -17,4 +17,5 @@ public class GetPaperExerciseDTO {
private
String
title
;
private
Long
userId
;
}
src/main/java/com/subsidy/dto/renshe/AnswerBasic.java
View file @
3a53359
...
...
@@ -11,7 +11,7 @@ public class AnswerBasic {
* 答疑辅导,提问和回答都存在值时才进行传递
*/
private
List
<
AnswerAndQuestionList
>
answerAndQuestionList
;
private
String
down
Code
;
private
String
class
Code
;
private
String
identity
;
...
...
src/main/java/com/subsidy/dto/renshe/ChapterExamBasic.java
View file @
3a53359
...
...
@@ -7,10 +7,10 @@ import java.util.List;
@Data
public
class
ChapterExamBasic
{
/**
* 是否通过,0通过1未通过
*/
private
Long
access
;
//
/**
//
* 是否通过,0通过1未通过
//
*/
//
private Long access;
/**
* 活跃度列表(数组),【数组】
*/
...
...
@@ -22,7 +22,7 @@ public class ChapterExamBasic {
/**
* 临时班级(项目)编号
*/
private
String
down
Code
;
private
String
class
Code
;
/**
* 章节(课程)考试时间列表,【数组】
*/
...
...
src/main/java/com/subsidy/dto/renshe/ChapterList3.java
View file @
3a53359
...
...
@@ -9,21 +9,18 @@ public class ChapterList3 {
* 章节(课程)编码,与基本信息内的章节(课程)编码相对应
*/
private
String
chapterCode
;
/**
* 章节(课程)学习时长,该学习时间段内本章节学习累计时长【秒】
*/
private
long
chapterTime
;
/**
* 学习结束时间(视频播放结束时间),【13位时间戳】【精确到毫秒】
*/
private
l
ong
endTime
;
private
L
ong
endTime
;
/**
* 章节(课程)暂停时长,该学习时间段内本章节播放暂停累计时长【秒】(2023年2月1日开始实行)
*/
private
l
ong
pauseTime
;
private
L
ong
pauseTime
;
/**
* 学习开始时间(视频播放开始时间),【13位时间戳】【精确到毫秒】
*/
private
l
ong
startTime
;
private
L
ong
startTime
;
}
src/main/java/com/subsidy/dto/renshe/ClassHourBasic.java
View file @
3a53359
...
...
@@ -11,7 +11,7 @@ public class ClassHourBasic {
/**
* 临时班级(临时项目)编号
*/
private
String
down
Code
;
private
String
class
Code
;
/**
* 学员姓名
...
...
@@ -25,16 +25,8 @@ public class ClassHourBasic {
* 学员身份证号,会对身份证号长度、格式进行校验、X用大写
*/
private
String
identity
;
/**
* 当日累计学习时长,视频暂停时间不计入【秒】
*/
private
long
learnTime
;
/**
* 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】
*/
private
long
loginTime
;
/**
* 当日累计播放时长,视频暂停时间计入【秒】
*/
private
Long
playTime
;
...
...
src/main/java/com/subsidy/dto/renshe/EpidemicSituationClassBasic.java
View file @
3a53359
...
...
@@ -8,28 +8,16 @@ import java.util.List;
@Data
public
class
EpidemicSituationClassBasic
{
private
String
areaName
;
private
List
<
ChapterList2
>
chapterList
;
private
Long
courseHour
;
private
String
downCode
;
private
String
classCode
;
private
Long
endDate
;
private
Long
learnHour
;
// private String professionName;
private
String
shortName
;
private
Long
startDate
;
private
List
<
MemberVO
>
studentList
;
private
String
trainingCode
;
private
String
trainingName
;
}
src/main/java/com/subsidy/dto/renshe/UploadImageDTO.java
View file @
3a53359
...
...
@@ -10,7 +10,7 @@ public class UploadImageDTO {
/**
* 临时班级(项目)编码
*/
private
String
down
Code
;
private
String
class
Code
;
/**
* 活跃度照片列表,【数组】
*/
...
...
src/main/java/com/subsidy/jobs/PushJob.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
jobs
;
import
com.subsidy.service.PushDataService
;
import
com.subsidy.service.impl.PushDataServiceImpl
;
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
;
/**
* 核对数据定时任务
*/
@Component
public
class
PushJob
{
@Value
(
"${spring.profiles.active}"
)
private
String
env
;
@Autowired
private
PushDataService
pushDataService
;
/**
* POST-4:学时
*/
@Scheduled
(
cron
=
"0 0 4 * * ?"
)
public
void
post4
()
throws
IOException
{
if
(
"prod"
.
equals
(
env
))
{
pushDataService
.
post4
();
}
}
/**
* POST-5: 考试
*/
@Scheduled
(
cron
=
"0 10 4 * * ?"
)
public
void
post5
()
throws
IOException
{
if
(
"prod"
.
equals
(
env
))
{
pushDataService
.
post5
();
}
}
/**
* POST-6: 答疑
*/
@Scheduled
(
cron
=
"0 20 4 * * ?"
)
public
void
post6
()
throws
IOException
{
if
(
"prod"
.
equals
(
env
))
{
pushDataService
.
post6
();
}
}
/**
* POST-7:人脸
*/
@Scheduled
(
cron
=
"0 30 4 * * ?"
)
public
void
post7
()
throws
IOException
{
if
(
"prod"
.
equals
(
env
))
{
pushDataService
.
post7
();
}
}
}
src/main/java/com/subsidy/jobs/RenSheJuJob.java
View file @
3a53359
...
...
@@ -65,7 +65,7 @@ public class RenSheJuJob {
/**
// * POST-
2
:班级基本信息信息采集接口
// * POST-
3
:班级基本信息信息采集接口
// */
@Scheduled
(
cron
=
"0 0 1 * * ?"
)
public
void
classBaseInfo
()
throws
IOException
{
...
...
@@ -75,7 +75,7 @@ public class RenSheJuJob {
}
/**
* POST-
3
:学时信息采集接口
* POST-
4
:学时信息采集接口
*/
@Scheduled
(
cron
=
"0 5 1 * * ?"
)
public
void
classHourBehavior
()
throws
IOException
{
...
...
@@ -85,7 +85,7 @@ public class RenSheJuJob {
}
/**
* POST-
4
:考试信息采集接口
* POST-
5
:考试信息采集接口
*/
@Scheduled
(
cron
=
"0 10 1 * * ?"
)
public
void
uploadChapterBehavior
()
throws
IOException
{
...
...
@@ -95,7 +95,7 @@ public class RenSheJuJob {
}
/**
* POST-
5
:答疑辅导采集接口
* POST-
6
:答疑辅导采集接口
*/
@Scheduled
(
cron
=
"0 15 1 * * ?"
)
public
void
uploadClassAnswerQuestionBehavior
()
throws
IOException
{
...
...
@@ -105,7 +105,7 @@ public class RenSheJuJob {
}
/**
* POST-
6
班级活跃度/实名认证照片信息采集接口
* POST-
7
班级活跃度/实名认证照片信息采集接口
*/
@Scheduled
(
cron
=
"0 20 1 * * ?"
)
public
void
uploadImage
()
throws
IOException
{
...
...
@@ -115,7 +115,7 @@ public class RenSheJuJob {
}
/**
* POST-
7
获取培训待绑定的(班级编号,项目编号)列表
* POST-
8
获取培训待绑定的(班级编号,项目编号)列表
*/
@Scheduled
(
cron
=
"0 25 1 * * ?"
)
public
void
getClassCodeByPrivateKey
()
throws
IOException
{
...
...
@@ -124,16 +124,16 @@ public class RenSheJuJob {
}
}
/**
* POST-8 上下游班级数据绑定接口
*/
@Scheduled
(
cron
=
"0 30 1 * * ?"
)
public
void
uploadClassCode
()
throws
IOException
{
if
(
"prod"
.
equals
(
env
))
{
renSheJuService
.
uploadClassCode
();
}
System
.
gc
();
}
//
/**
//
* POST-8 上下游班级数据绑定接口
//
*/
//
@Scheduled(cron = "0 30 1 * * ?")
//
public void uploadClassCode() throws IOException {
//
if ("prod".equals(env)) {
//
renSheJuService.uploadClassCode();
//
}
//
System.gc();
//
}
// /**
// * POST-9 获取推送失败班级列表
...
...
@@ -299,7 +299,6 @@ public class RenSheJuJob {
});
}
/**
* 补登录登出数据
*/
...
...
src/main/java/com/subsidy/mapper/DudaoMapper.java
View file @
3a53359
package
com
.
subsidy
.
mapper
;
import
com.subsidy.vo.renshe.DailyAnswerVO
;
import
com.subsidy.vo.renshe.DailyStudyInfoVO
;
import
com.subsidy.dto.renshe.ChapterList2
;
import
com.subsidy.dto.renshe.ChapterList3
;
import
com.subsidy.model.ExerciseDoneResultDO
;
import
com.subsidy.model.MemberDO
;
import
com.subsidy.model.OprMemDictDO
;
import
com.subsidy.vo.renshe.*
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
...
...
@@ -49,8 +53,70 @@ public interface DudaoMapper {
*/
List
<
Long
>
newClasses
(
String
classType
);
/**
* 查询班级基本信息
*/
ClassBaseInfoVO
classBaseInfo
(
Long
classId
);
/**
* 课程下章节信息
*/
List
<
ChapterList2
>
classChapters
(
Long
classId
);
/**
* 查询班级学员信息
*/
List
<
MemberVO
>
classMembers
(
Long
classId
);
/**
* 前一天新增视频学习数据
*/
List
<
DailyStudyInfoVO
>
dailyStudyInfo1
(
Long
classId
);
/**
* 查看某人前一天上线的时间
*/
List
<
OprMemDictDO
>
loginRecords
(
Long
memberId
);
/**
* 查看某人前一天下线的时间
*/
List
<
OprMemDictDO
>
loginOutRecords
(
Long
memberId
);
/**
* 某个人某时间段的学习记录
*/
List
<
ChapterList3
>
dailyStudyRecords
(
Long
memberId
,
Long
classId
,
String
startDate
,
String
endDate
);
/**
* 前一天活跃度检测列表
*/
List
<
DailyActivitiesVO
>
dailyActivities
(
Long
classId
,
Long
memberId
);
/**
* 前一天做过考试通过数据
*/
List
<
MemberDO
>
memberIds
(
Long
classId
);
/**
* 查找课程最后一个视频
*/
String
classVodName
(
Long
classId
);
/**
* 查出考试时间
*/
Long
examLength
(
Long
memberId
,
Long
classId
);
/**
* 考试活跃度检测--人脸
*/
List
<
ExamActivitiesVO
>
examActivities
(
Long
classId
,
Long
memberId
);
/**
* 找到某人某个时间段内的测评记录
*/
List
<
ExerciseDoneResultDO
>
dailyExerciseDone
(
Long
memberId
,
String
startDate
,
String
endDate
,
Long
classId
);
}
src/main/java/com/subsidy/mapper/PushAnsweringDataMapper.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
mapper
;
import
com.subsidy.model.PushAnsweringDataDO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 问题答疑表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public
interface
PushAnsweringDataMapper
extends
BaseMapper
<
PushAnsweringDataDO
>
{
void
insertAnswerData
(
Long
classId
,
Long
userId
,
Date
question
,
Date
answer
);
List
<
Long
>
answerList
();
}
src/main/java/com/subsidy/mapper/PushDetectionDataMapper.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
mapper
;
import
com.subsidy.model.PushDetectionDataDO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 活跃度检测表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public
interface
PushDetectionDataMapper
extends
BaseMapper
<
PushDetectionDataDO
>
{
void
insertData
(
Long
classId
,
Integer
checkType
,
Long
memberId
,
Date
createDate
);
List
<
Long
>
activityList
();
}
src/main/java/com/subsidy/mapper/PushExerciseDataMapper.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
mapper
;
import
com.subsidy.model.PushExerciseDataDO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 学生课程习题完成情况 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public
interface
PushExerciseDataMapper
extends
BaseMapper
<
PushExerciseDataDO
>
{
void
pushExamData
(
Long
classId
,
Date
startDate
,
Long
memberId
,
Date
createDate
,
Integer
examTime
);
List
<
Long
>
examList
();
}
src/main/java/com/subsidy/mapper/PushImageDataMapper.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
mapper
;
import
com.subsidy.model.PushImageDataDO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 人脸识别记录表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public
interface
PushImageDataMapper
extends
BaseMapper
<
PushImageDataDO
>
{
void
pushImageData
(
Long
classId
,
Long
detectionType
,
Long
memberId
,
Long
processType
,
Date
activityTime
);
List
<
Long
>
imageList
();
}
src/main/java/com/subsidy/mapper/PushOprDataMapper.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
mapper
;
import
com.subsidy.model.PushOprDataDO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
/**
* <p>
* 审计表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public
interface
PushOprDataMapper
extends
BaseMapper
<
PushOprDataDO
>
{
void
insertData
(
Long
userId
,
String
opr
,
String
ipAddress
,
Date
createDate
);
}
src/main/java/com/subsidy/mapper/PushVodDataMapper.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
mapper
;
import
com.subsidy.model.PushVodDataDO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 视频播放历史记录表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public
interface
PushVodDataMapper
extends
BaseMapper
<
PushVodDataDO
>
{
void
insertData
(
Long
classId
,
Long
vodId
,
Long
memberId
,
Integer
playLength
,
Integer
suspendLength
,
Integer
playRecord
,
Date
createDate
,
String
ipAddress
);
List
<
Long
>
vodIds
();
}
src/main/java/com/subsidy/mapper/RenSheJuMapper.java
View file @
3a53359
...
...
@@ -42,7 +42,7 @@ public interface RenSheJuMapper {
/**
* 前一天活跃度检测列表
*/
List
<
DailyActivitiesVO
>
dailyActivities
(
Stri
ng
classId
,
Long
memberId
);
List
<
DailyActivitiesVO
>
dailyActivities
(
Lo
ng
classId
,
Long
memberId
);
/**
* 考试活跃度检测--人脸
...
...
@@ -67,7 +67,7 @@ public interface RenSheJuMapper {
/**
* 某个人某时间段的学习记录
*/
List
<
ChapterList3
>
dailyStudyRecords
(
Long
memberId
,
Stri
ng
classId
,
String
startDate
,
String
endDate
);
List
<
ChapterList3
>
dailyStudyRecords
(
Long
memberId
,
Lo
ng
classId
,
String
startDate
,
String
endDate
);
/**
* 前一天考试通过数据
...
...
@@ -145,4 +145,5 @@ public interface RenSheJuMapper {
*/
List
<
Long
>
imageClassIds
(
String
classType
);
}
src/main/java/com/subsidy/mapper/RenshejuHistoryMapper.java
View file @
3a53359
...
...
@@ -4,6 +4,8 @@ import com.subsidy.model.RenshejuHistoryDO;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* <p>
* 人社局推送失败记录表 Mapper 接口
...
...
@@ -12,7 +14,18 @@ import org.springframework.stereotype.Repository;
* @author Tuyp
* @since 2023-02-07
*/
@Repository
@Repository
public
interface
RenshejuHistoryMapper
extends
BaseMapper
<
RenshejuHistoryDO
>
{
/**
* 查找当天推出去的数据 POST456
*/
RenshejuHistoryDO
dailyData
(
String
post
);
/**
* 人脸有多个
*/
List
<
RenshejuHistoryDO
>
dailyDatas
(
String
post
);
}
src/main/java/com/subsidy/model/PushAnsweringDataDO.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
model
;
import
com.subsidy.util.BaseModel
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
* 问题答疑表
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"push_answering_data"
)
public
class
PushAnsweringDataDO
extends
BaseModel
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 科目id
*/
private
Long
classId
;
/**
* 提问id
*/
private
Long
askId
;
/**
* 回答人id
*/
private
Long
answerId
;
/**
* 问题
*/
private
String
title
;
/**
* 答案
*/
private
String
answer
;
}
src/main/java/com/subsidy/model/PushDetectionDataDO.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
model
;
import
com.subsidy.util.BaseModel
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
* 活跃度检测表
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"push_detection_data"
)
public
class
PushDetectionDataDO
extends
BaseModel
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 班级id
*/
private
Long
classId
;
/**
* 检测类型:0:滑块 1:人脸
*/
private
Integer
checkType
;
/**
* 人员id
*/
private
Long
memberId
;
private
Long
vodId
;
/**
* 成功/失败
*/
private
Integer
status
;
/**
* RequestId
*/
private
String
requestId
;
/**
* 人脸识别id
*/
private
Integer
faceCheckId
;
}
src/main/java/com/subsidy/model/PushExerciseDataDO.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
model
;
import
com.subsidy.util.BaseModel
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
* 学生课程习题完成情况
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"push_exercise_data"
)
public
class
PushExerciseDataDO
extends
BaseModel
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
private
Long
paperId
;
/**
* 成员id
*/
private
Long
memberId
;
/**
* 班级id
*/
private
Long
classId
;
/**
* 课程id
*/
private
Long
courseId
;
/**
* 正确个数
*/
private
Integer
rightCounts
;
/**
* 总共个数
*/
private
Integer
totalCounts
;
/**
* 时长
*/
private
Integer
length
;
private
Integer
score
;
private
String
result
;
private
LocalDateTime
startDate
;
}
src/main/java/com/subsidy/model/PushImageDataDO.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
model
;
import
com.subsidy.util.BaseModel
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
* 人脸识别记录表
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"push_image_data"
)
public
class
PushImageDataDO
extends
BaseModel
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 班级id
*/
private
Long
classId
;
/**
* 试卷id
*/
private
Long
paperId
;
/**
* 学员id
*/
private
Long
memberId
;
/**
* 活体检测得分
*/
private
String
liveRate
;
/**
* 人脸比对得分
*/
private
String
similarity
;
/**
* 刷脸时间
*/
private
LocalDateTime
occurredTime
;
/**
* 图片
*/
private
String
photo
;
/**
* 流水号
*/
private
String
bizSeqNo
;
/**
* 检测类型 1,权威库 0照片比对
*/
private
Integer
checkType
;
/**
* 检测地点 1,签到页 0 班级内
*/
private
Integer
checkPlace
;
/**
* 1:视频的时候检测 2:测评的时候检测
*/
private
Integer
classPlace
;
/**
* 结果
*/
private
Integer
result
;
}
src/main/java/com/subsidy/model/PushOprDataDO.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
model
;
import
com.subsidy.util.BaseModel
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
* 审计表
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"push_opr_data"
)
public
class
PushOprDataDO
extends
BaseModel
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 用户id
*/
private
Long
userId
;
/**
* 操作类型
*/
private
String
oprType
;
/**
* 1:成功,0:失败
*/
private
Integer
result
;
/**
* 登录ip
*/
private
String
ipAddress
;
}
src/main/java/com/subsidy/model/PushVodDataDO.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
model
;
import
com.subsidy.util.BaseModel
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
* 视频播放历史记录表
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"push_vod_data"
)
public
class
PushVodDataDO
extends
BaseModel
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 班级id
*/
private
Long
classId
;
/**
* 视频id
*/
private
Long
vodId
;
/**
* 学生id
*/
private
Long
memberId
;
/**
* 观看时长
*/
private
Integer
playLength
;
/**
* 播放视频位置
*/
private
Integer
playRecord
;
private
LocalDateTime
playDate
;
/**
* 暂停时长
*/
private
Integer
suspendLength
;
private
String
ipAddress
;
}
src/main/java/com/subsidy/service/PushDataService.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
service
;
import
com.subsidy.model.PushAnsweringDataDO
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* <p>
* 问题答疑表 服务类
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
public
interface
PushDataService
extends
IService
<
PushAnsweringDataDO
>
{
void
post4
();
void
post5
();
void
post6
();
void
post7
();
HashMap
<
String
,
List
<
Long
>>
check
();
}
src/main/java/com/subsidy/service/RenSheJuService.java
View file @
3a53359
...
...
@@ -20,8 +20,6 @@ public interface RenSheJuService {
RensheResponseVO
getClassCodeByPrivateKey
()
throws
IOException
;
RensheResponseVO
uploadClassCode
()
throws
IOException
;
RensheResponseVO
getErrorClass
()
throws
IOException
;
RensheStringVO
clear
()
throws
IOException
;
...
...
src/main/java/com/subsidy/service/VodPlayHistoryService.java
View file @
3a53359
...
...
@@ -23,9 +23,9 @@ import java.util.List;
*/
public
interface
VodPlayHistoryService
extends
IService
<
VodPlayHistoryDO
>
{
String
insertHistory
(
VodPlayHistoryDO
vodPlayHistoryDO
,
HttpServletRequest
request
);
String
insertHistory
(
VodPlayHistoryDO
vodPlayHistoryDO
,
HttpServletRequest
request
)
throws
Exception
;
String
insertHistoryNew
(
InsertHistoryNewDTO
insertHistoryNewDT
,
HttpServletRequest
request
);
String
insertHistoryNew
(
InsertHistoryNewDTO
insertHistoryNewDT
,
HttpServletRequest
request
)
throws
Exception
;
void
dataFix
(
SignDatePlaysDTO
dataFixDTO
);
...
...
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
View file @
3a53359
...
...
@@ -305,6 +305,11 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
.
lambda
()
.
eq
(
RoleAdministerMappingDO:
:
getAdministerId
,
administerDO
.
getId
()));
administerPermissionVO
.
setRole
(
roleAdministerMappingDO
.
getRoleId
());
CompanyDictDO
companyDictDO
=
companyDictMapper
.
selectById
(
administerDO
.
getCompanyId
());
administerPermissionVO
.
setCompanyName
(
companyDictDO
.
getCompanyName
());
administerPermissionVO
.
setShortName
(
companyDictDO
.
getShortName
());
return
administerPermissionVO
;
}
...
...
@@ -1391,7 +1396,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
memberDO1
.
setAccountName
(
accountName
.
replace
(
"u:"
,
"v"
));
}
}
catch
(
Exception
ex
)
{
System
.
out
.
println
(
ex
.
getStackTrace
());
}
memberDO1
.
setCompanyId
(
companyId
);
memberDO1
.
setFirstLogin
(
0
);
...
...
src/main/java/com/subsidy/service/impl/DudaoServiceImpl.java
View file @
3a53359
...
...
@@ -38,9 +38,6 @@ public class DudaoServiceImpl implements DudaoService {
private
RenSheConfig
renSheConfig
;
@Autowired
private
RenSheJuMapper
renSheJuMapper
;
@Autowired
private
ClassDictMapper
classDictMapper
;
@Autowired
...
...
@@ -49,6 +46,9 @@ public class DudaoServiceImpl implements DudaoService {
@Autowired
private
DudaoMapper
dudaoMapper
;
// @Autowired
// private RenSheJuMapper renSheJuMapper;
public
RensheResponseVO
all
()
throws
IOException
{
classBaseInfo
();
...
...
@@ -98,18 +98,18 @@ public class DudaoServiceImpl implements DudaoService {
for
(
Long
classId
:
classIds
)
{
EpidemicSituationClassBasic
epidemicSituationClassBasic
=
new
EpidemicSituationClassBasic
();
//班级基本信息
ClassBaseInfoVO
classBaseInfoVO
=
renSheJu
Mapper
.
classBaseInfo
(
classId
);
ClassBaseInfoVO
classBaseInfoVO
=
dudao
Mapper
.
classBaseInfo
(
classId
);
BeanUtils
.
copyProperties
(
classBaseInfoVO
,
epidemicSituationClassBasic
);
epidemicSituationClassBasic
.
set
Down
Code
(
classBaseInfoVO
.
getDownCode
());
epidemicSituationClassBasic
.
set
Class
Code
(
classBaseInfoVO
.
getDownCode
());
//章节
List
<
ChapterList2
>
chapterLists
=
renSheJu
Mapper
.
classChapters
(
classId
);
List
<
ChapterList2
>
chapterLists
=
dudao
Mapper
.
classChapters
(
classId
);
ChapterList2
chapterList2
=
chapterLists
.
get
(
chapterLists
.
size
()
-
1
);
chapterList2
.
setIsExam
(
1
);
epidemicSituationClassBasic
.
setChapterList
(
chapterLists
);
//学员列表
List
<
MemberVO
>
memberVOS
=
renSheJu
Mapper
.
classMembers
(
classId
);
List
<
MemberVO
>
memberVOS
=
dudao
Mapper
.
classMembers
(
classId
);
epidemicSituationClassBasic
.
setStudentList
(
memberVOS
);
epidemicSituationClassBasics
.
add
(
epidemicSituationClassBasic
);
...
...
@@ -182,21 +182,21 @@ public class DudaoServiceImpl implements DudaoService {
for
(
Long
classId
:
vodClassIds
){
//产生数据的班级
List
<
DailyStudyInfoVO
>
dailyStudyInfoVOS
=
renSheJuMapper
.
dailyStudyInfo
(
classId
);
List
<
DailyStudyInfoVO
>
dailyStudyInfoVOS
=
dudaoMapper
.
dailyStudyInfo1
(
classId
);
result
.
addAll
(
dailyStudyInfoVOS
);
}
for
(
DailyStudyInfoVO
dailyStudyInfoVO
:
result
)
{
ClassHourBasic
classHourBasic
=
new
ClassHourBasic
();
BeanUtils
.
copyProperties
(
dailyStudyInfoVO
,
classHourBasic
);
classHourBasic
.
set
Down
Code
(
dailyStudyInfoVO
.
getDownCode
());
classHourBasic
.
set
Class
Code
(
dailyStudyInfoVO
.
getDownCode
());
//上线时间列表
//找到当天每次上线下线时间
//上线时间
List
<
OprMemDictDO
>
loginRecords
=
renSheJu
Mapper
.
loginRecords
(
dailyStudyInfoVO
.
getMemberId
());
List
<
OprMemDictDO
>
loginRecords
=
dudao
Mapper
.
loginRecords
(
dailyStudyInfoVO
.
getMemberId
());
//下线时间
List
<
OprMemDictDO
>
loginOutRecords
=
renSheJu
Mapper
.
loginOutRecords
(
dailyStudyInfoVO
.
getMemberId
());
List
<
OprMemDictDO
>
loginOutRecords
=
dudao
Mapper
.
loginOutRecords
(
dailyStudyInfoVO
.
getMemberId
());
List
<
LoginList
>
loginLists
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
loginRecords
.
size
();
i
++)
{
...
...
@@ -206,7 +206,7 @@ public class DudaoServiceImpl implements DudaoService {
loginList
.
setEndTime
(
Timestamp
.
valueOf
(
loginOutRecords
.
get
(
i
).
getCreateDate
()).
getTime
());
//查看这个人该时间段的学习记录
List
<
ChapterList3
>
chapterList3s
=
renSheJuMapper
.
dailyStudyRecords
(
dailyStudyInfoVO
.
getMemberId
(),
dailyStudyInfoVO
.
getDownCode
(),
loginRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
),
loginOutRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
));
List
<
ChapterList3
>
chapterList3s
=
dudaoMapper
.
dailyStudyRecords
(
dailyStudyInfoVO
.
getMemberId
(),
dailyStudyInfoVO
.
getClassId
(),
loginRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
),
loginOutRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
));
if
(
chapterList3s
.
size
()
>
0
)
{
loginList
.
setChapterList
(
chapterList3s
);
loginLists
.
add
(
loginList
);
...
...
@@ -216,7 +216,7 @@ public class DudaoServiceImpl implements DudaoService {
//活跃度列表
List
<
ActivityList
>
activityLists
=
new
ArrayList
<>();
List
<
DailyActivitiesVO
>
activityDetectionDOS
=
renSheJuMapper
.
dailyActivities
(
dailyStudyInfoVO
.
getDownCode
(),
dailyStudyInfoVO
.
getMemberId
());
List
<
DailyActivitiesVO
>
activityDetectionDOS
=
dudaoMapper
.
dailyActivities
(
dailyStudyInfoVO
.
getClassId
(),
dailyStudyInfoVO
.
getMemberId
());
for
(
DailyActivitiesVO
dailyActivitiesVO
:
activityDetectionDOS
)
{
ActivityList
activityList
=
new
ActivityList
();
...
...
@@ -311,16 +311,18 @@ public class DudaoServiceImpl implements DudaoService {
for
(
Long
classId
:
classIds
)
{
//具体哪些人做了
List
<
MemberDO
>
memberDOList
=
renSheJuMapper
.
memberIds
(
classId
);
List
<
MemberDO
>
memberDOList
=
dudaoMapper
.
memberIds
(
classId
);
ClassDictDO
classDictDO
=
classDictMapper
.
selectById
(
classId
);
for
(
MemberDO
memberDO
:
memberDOList
)
{
//章节课程考试时间列表
ChapterExamBasic
chapterExamBasic
=
new
ChapterExamBasic
();
chapterExamBasic
.
set
DownCode
(
String
.
valueOf
(
classId
));
chapterExamBasic
.
set
ClassCode
(
classDictDO
.
getClassCode
(
));
//最后一节课作为chapterCode
String
vodId
=
renSheJu
Mapper
.
classVodName
(
classId
);
String
vodId
=
dudao
Mapper
.
classVodName
(
classId
);
chapterExamBasic
.
setChapterCode
(
vodId
);
chapterExamBasic
.
setStudentName
(
memberDO
.
getUserName
());
...
...
@@ -328,12 +330,12 @@ public class DudaoServiceImpl implements DudaoService {
chapterExamBasic
.
setIdentity
(
memberDO
.
getIdCard
());
//考试花了多长时间
Long
examLength
=
renSheJu
Mapper
.
examLength
(
memberDO
.
getId
(),
classId
);
Long
examLength
=
dudao
Mapper
.
examLength
(
memberDO
.
getId
(),
classId
);
chapterExamBasic
.
setExamTime
(
examLength
);
//考试活跃度列表
List
<
ActivityList
>
activityLists
=
new
ArrayList
<>();
List
<
ExamActivitiesVO
>
activityDetectionDOS
=
renSheJu
Mapper
.
examActivities
(
classId
,
memberDO
.
getId
());
List
<
ExamActivitiesVO
>
activityDetectionDOS
=
dudao
Mapper
.
examActivities
(
classId
,
memberDO
.
getId
());
for
(
ExamActivitiesVO
dailyActivitiesVO
:
activityDetectionDOS
)
{
ActivityList
activityList
=
new
ActivityList
();
...
...
@@ -352,31 +354,31 @@ public class DudaoServiceImpl implements DudaoService {
List
<
ExamList
>
examLists
=
new
ArrayList
<>();
//上线时间
List
<
OprMemDictDO
>
loginRecords
=
renSheJu
Mapper
.
loginRecords
(
memberDO
.
getId
());
List
<
OprMemDictDO
>
loginRecords
=
dudao
Mapper
.
loginRecords
(
memberDO
.
getId
());
//下线时间
List
<
OprMemDictDO
>
loginOutRecords
=
renSheJu
Mapper
.
loginOutRecords
(
memberDO
.
getId
());
List
<
OprMemDictDO
>
loginOutRecords
=
dudao
Mapper
.
loginOutRecords
(
memberDO
.
getId
());
boolean
flag
=
false
;
//
boolean flag = false;
for
(
int
i
=
0
;
i
<
loginRecords
.
size
();
i
++)
{
//找到该时间段内的测评
List
<
ExerciseDoneResultDO
>
exerciseDoneResultDOS
=
renSheJu
Mapper
.
dailyExerciseDone
(
memberDO
.
getId
(),
loginRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
),
loginOutRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
),
classId
);
List
<
ExerciseDoneResultDO
>
exerciseDoneResultDOS
=
dudao
Mapper
.
dailyExerciseDone
(
memberDO
.
getId
(),
loginRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
),
loginOutRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
),
classId
);
for
(
ExerciseDoneResultDO
exerciseDoneResultDO
:
exerciseDoneResultDOS
)
{
ExamList
examList
=
new
ExamList
();
examList
.
setStartTime
(
Timestamp
.
valueOf
(
exerciseDoneResultDO
.
getStartDate
()).
getTime
());
examList
.
setEndTime
(
Timestamp
.
valueOf
(
exerciseDoneResultDO
.
getCreateDate
()).
getTime
());
examList
.
setIp
(
loginRecords
.
get
(
i
).
getIpAddress
());
if
(
"合格"
.
equals
(
exerciseDoneResultDO
.
getResult
()))
{
flag
=
true
;
}
//
if ("合格".equals(exerciseDoneResultDO.getResult())) {
//
flag = true;
//
}
examLists
.
add
(
examList
);
}
}
if
(
flag
==
true
)
{
chapterExamBasic
.
setAccess
(
0L
);
}
else
{
chapterExamBasic
.
setAccess
(
1L
);
}
//
if (flag == true) {
//
chapterExamBasic.setAccess(0L);
//
} else {
//
chapterExamBasic.setAccess(1L);
//
}
chapterExamBasic
.
setExamList
(
examLists
);
chapterExamBasics
.
add
(
chapterExamBasic
);
}
...
...
@@ -471,7 +473,7 @@ public class DudaoServiceImpl implements DudaoService {
AnswerBasic
answerBasic
=
new
AnswerBasic
();
String
downCode
=
key
.
split
(
":"
)[
0
];
String
identity
=
key
.
split
(
":"
)[
1
];
answerBasic
.
set
Down
Code
(
downCode
);
answerBasic
.
set
Class
Code
(
downCode
);
answerBasic
.
setIdentity
(
identity
);
answerBasic
.
setAnswerAndQuestionList
(
hashMap
.
get
(
key
));
answerBasics
.
add
(
answerBasic
);
...
...
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
View file @
3a53359
...
...
@@ -953,27 +953,17 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
public
String
checkTimes
(
ExerciseDoneResultDO
exerciseDoneResultDO
)
{
MemberDO
memberDO
=
this
.
baseMapper
.
selectById
(
exerciseDoneResultDO
.
getMemberId
());
ClassHourDictDO
classHourDictDO
=
classHourDictMapper
.
selectOne
(
new
QueryWrapper
<
ClassHourDic
tDO
>()
//查看这个人这个卷子做了几次
Integer
count
=
exerciseDoneResultMapper
.
selectCount
(
new
QueryWrapper
<
ExerciseDoneResul
tDO
>()
.
lambda
()
.
eq
(
ClassHourDictDO:
:
getCompanyId
,
memberDO
.
getCompanyId
()));
if
(
null
!=
classHourDictDO
)
{
Integer
status
=
classHourDictDO
.
getRepeatStatus
();
if
(
1
==
status
)
{
int
cnt
=
classHourDictDO
.
getRepeatTime
();
//查看这个人这个卷子做了几次
Integer
count
=
exerciseDoneResultMapper
.
selectCount
(
new
QueryWrapper
<
ExerciseDoneResultDO
>()
.
lambda
()
.
eq
(
ExerciseDoneResultDO:
:
getMemberId
,
exerciseDoneResultDO
.
getMemberId
())
.
eq
(
ExerciseDoneResultDO:
:
getPaperId
,
exerciseDoneResultDO
.
getPaperId
()));
.
eq
(
ExerciseDoneResultDO:
:
getMemberId
,
exerciseDoneResultDO
.
getMemberId
())
.
eq
(
ExerciseDoneResultDO:
:
getPaperId
,
exerciseDoneResultDO
.
getPaperId
())
.
eq
(
ExerciseDoneResultDO:
:
getClassId
,
exerciseDoneResultDO
.
getClassId
()));
if
(
cnt
<=
count
)
{
throw
new
HttpException
(
60001
);
}
}
if
(
count
>
3
)
{
throw
new
HttpException
(
60001
);
}
return
ConstantUtils
.
CHECK_STATUS
;
}
...
...
src/main/java/com/subsidy/service/impl/PushDataServiceImpl.java
0 → 100644
View file @
3a53359
package
com
.
subsidy
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.google.gson.Gson
;
import
com.subsidy.dto.renshe.*
;
import
com.subsidy.mapper.*
;
import
com.subsidy.model.*
;
import
com.subsidy.service.PushDataService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.subsidy.service.RenshejuHistoryService
;
import
com.subsidy.util.RenSheJuConstant
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.configurationprocessor.json.JSONObject
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* <p>
* 问题答疑表 服务实现类
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Service
public
class
PushDataServiceImpl
extends
ServiceImpl
<
PushAnsweringDataMapper
,
PushAnsweringDataDO
>
implements
PushDataService
{
@Autowired
private
RenshejuHistoryMapper
renshejuHistoryMapper
;
@Autowired
private
MemberMapper
memberMapper
;
@Autowired
private
PushOprDataMapper
pushOprDataMapper
;
@Autowired
private
PushVodDataMapper
pushVodDataMapper
;
@Autowired
private
ClassDictMapper
classDictMapper
;
@Autowired
private
PushDetectionDataMapper
pushDetectionDataMapper
;
@Autowired
private
PushExerciseDataMapper
pushExerciseDataMapper
;
@Autowired
private
PushImageDataMapper
pushImageDataMapper
;
@Autowired
private
PushAnsweringDataMapper
pushAnsweringDataMapper
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
post4
()
{
RenshejuHistoryDO
renshejuHistoryDO
=
renshejuHistoryMapper
.
dailyData
(
RenSheJuConstant
.
POST_4
);
// RenshejuHistoryDO renshejuHistoryDO =renshejuHistoryMapper.selectById(5362);
String
input
=
renshejuHistoryDO
.
getInputParam
();
Gson
gson
=
new
Gson
();
ClassHourBehaviorDTO
classHourBehaviorDTO
=
gson
.
fromJson
(
input
,
ClassHourBehaviorDTO
.
class
);
List
<
ClassHourBasic
>
classHourBasics
=
classHourBehaviorDTO
.
getClassHourBasic
();
for
(
ClassHourBasic
chb
:
classHourBasics
)
{
MemberDO
memberDO
=
memberMapper
.
selectOne
(
new
QueryWrapper
<
MemberDO
>()
.
lambda
()
.
eq
(
MemberDO:
:
getIdCard
,
chb
.
getIdentity
())
);
ClassDictDO
classDictDO
=
classDictMapper
.
selectOne
(
new
QueryWrapper
<
ClassDictDO
>()
.
lambda
()
.
eq
(
ClassDictDO:
:
getClassCode
,
chb
.
getClassCode
()));
List
<
LoginList
>
loginLists
=
chb
.
getLoginList
();
if
(
loginLists
.
size
()
>
0
)
{
LoginList
loginList
=
loginLists
.
get
(
0
);
Date
loginInTime
=
new
Date
(
loginList
.
getStartTime
());
Date
loginOutTime
=
new
Date
(
loginList
.
getEndTime
());
String
ip
=
loginList
.
getIp
();
//opr
pushOprDataMapper
.
insertData
(
memberDO
.
getId
(),
"登录"
,
ip
,
loginInTime
);
pushOprDataMapper
.
insertData
(
memberDO
.
getId
(),
"登出"
,
null
,
loginOutTime
);
//回写视频数据
List
<
ChapterList3
>
chapterList
=
loginList
.
getChapterList
();
for
(
ChapterList3
chapter
:
chapterList
)
{
pushVodDataMapper
.
insertData
(
classDictDO
.
getId
(),
Long
.
valueOf
(
chapter
.
getChapterCode
()),
memberDO
.
getId
(),
(
chapter
.
getEndTime
().
intValue
()
-
chapter
.
getStartTime
().
intValue
())
/
1000
,
chapter
.
getPauseTime
().
intValue
(),
0
,
new
Date
(
chapter
.
getEndTime
()),
ip
);
}
}
//回写活跃度数据
List
<
ActivityList
>
activityLists
=
chb
.
getActivityList
();
for
(
ActivityList
activityList
:
activityLists
)
{
pushDetectionDataMapper
.
insertData
(
classDictDO
.
getId
(),
activityList
.
getActivityDetection
(),
memberDO
.
getId
(),
new
Date
(
activityList
.
getActivityTime
()));
}
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
post5
()
{
RenshejuHistoryDO
renshejuHistoryDO
=
renshejuHistoryMapper
.
dailyData
(
RenSheJuConstant
.
POST_5
);
// RenshejuHistoryDO renshejuHistoryDO = renshejuHistoryMapper.selectById(5365);
String
input
=
renshejuHistoryDO
.
getInputParam
();
Gson
gson
=
new
Gson
();
UploadChapterBehaviorDTO
uploadChapterBehaviorDTO
=
gson
.
fromJson
(
input
,
UploadChapterBehaviorDTO
.
class
);
System
.
out
.
println
(
uploadChapterBehaviorDTO
);
List
<
ChapterExamBasic
>
chapterExamBasics
=
uploadChapterBehaviorDTO
.
getChapterExamBasic
();
for
(
ChapterExamBasic
ceb
:
chapterExamBasics
)
{
MemberDO
memberDO
=
memberMapper
.
selectOne
(
new
QueryWrapper
<
MemberDO
>()
.
lambda
()
.
eq
(
MemberDO:
:
getIdCard
,
ceb
.
getIdentity
())
);
ClassDictDO
classDictDO
=
classDictMapper
.
selectOne
(
new
QueryWrapper
<
ClassDictDO
>()
.
lambda
()
.
eq
(
ClassDictDO:
:
getClassCode
,
ceb
.
getClassCode
()));
//考试活跃度 学时里已经推过全部的活跃度了
// List<ActivityList> activityLists = ceb.getActivityList();
// for (ActivityList activityList : activityLists) {
// pushDetectionDataMapper.insertData(classDictDO.getId(), activityList.getActivityDetection(), memberDO.getId(), new Date(activityList.getActivityTime()));
// }
//考试表
List
<
ExamList
>
examLists
=
ceb
.
getExamList
();
for
(
ExamList
examList
:
examLists
)
{
pushExerciseDataMapper
.
pushExamData
(
classDictDO
.
getId
(),
new
Date
(
examList
.
getStartTime
()),
memberDO
.
getId
(),
new
Date
(
examList
.
getEndTime
()),
ceb
.
getExamTime
().
intValue
());
}
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
post6
()
{
RenshejuHistoryDO
renshejuHistoryDO
=
renshejuHistoryMapper
.
dailyData
(
RenSheJuConstant
.
POST_6
);
// RenshejuHistoryDO renshejuHistoryDO = renshejuHistoryMapper.selectById(5366);
String
input
=
renshejuHistoryDO
.
getInputParam
();
Gson
gson
=
new
Gson
();
UploadClassAnswerQuestionBehaviorDTO
uploadClassAnswerQuestionBehaviorDTO
=
gson
.
fromJson
(
input
,
UploadClassAnswerQuestionBehaviorDTO
.
class
);
System
.
out
.
println
(
uploadClassAnswerQuestionBehaviorDTO
);
List
<
AnswerBasic
>
answerBasics
=
uploadClassAnswerQuestionBehaviorDTO
.
getAnswerBasic
();
for
(
AnswerBasic
ab
:
answerBasics
)
{
ClassDictDO
classDictDO
=
classDictMapper
.
selectOne
(
new
QueryWrapper
<
ClassDictDO
>()
.
lambda
()
.
eq
(
ClassDictDO:
:
getClassCode
,
ab
.
getClassCode
()));
MemberDO
memberDO
=
memberMapper
.
selectOne
(
new
QueryWrapper
<
MemberDO
>()
.
lambda
()
.
eq
(
MemberDO:
:
getIdCard
,
ab
.
getIdentity
())
);
List
<
AnswerAndQuestionList
>
answerAndQuestionLists
=
ab
.
getAnswerAndQuestionList
();
for
(
AnswerAndQuestionList
aaql
:
answerAndQuestionLists
)
{
pushAnsweringDataMapper
.
insertAnswerData
(
classDictDO
.
getId
(),
memberDO
.
getId
(),
new
Date
(
aaql
.
getQuestion
()),
new
Date
(
aaql
.
getAnswer
()));
}
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
post7
()
{
List
<
RenshejuHistoryDO
>
renshejuHistoryDOS
=
renshejuHistoryMapper
.
dailyDatas
(
RenSheJuConstant
.
POST_7
);
// List<Long> longs = new ArrayList<Long>();
// longs.add(5370L);
// longs.add(5372L);
// longs.add(5373L);
// longs.add(5376L);
// longs.add(5377L);
// List<RenshejuHistoryDO> renshejuHistoryDOS = renshejuHistoryMapper.selectList(new QueryWrapper<RenshejuHistoryDO>()
// .lambda()
// .in(RenshejuHistoryDO::getId,longs));
for
(
RenshejuHistoryDO
renshejuHistoryDO
:
renshejuHistoryDOS
){
String
input
=
renshejuHistoryDO
.
getInputParam
();
Gson
gson
=
new
Gson
();
UploadImageDTO
uploadImageDTO
=
gson
.
fromJson
(
input
,
UploadImageDTO
.
class
);
System
.
out
.
println
(
uploadImageDTO
);
ClassDictDO
classDictDO
=
classDictMapper
.
selectOne
(
new
QueryWrapper
<
ClassDictDO
>()
.
lambda
()
.
eq
(
ClassDictDO:
:
getClassCode
,
uploadImageDTO
.
getClassCode
()));
List
<
ImageDetailList
>
imageDetailList
=
uploadImageDTO
.
getImageDetailList
();
for
(
ImageDetailList
idl
:
imageDetailList
)
{
MemberDO
memberDO
=
memberMapper
.
selectOne
(
new
QueryWrapper
<
MemberDO
>()
.
lambda
()
.
eq
(
MemberDO:
:
getIdCard
,
idl
.
getIdentity
())
);
pushImageDataMapper
.
pushImageData
(
classDictDO
.
getId
(),
idl
.
getDetectionType
(),
memberDO
.
getId
(),
idl
.
getProcessType
(),
new
Date
(
idl
.
getActivityTime
()));
}
}
}
public
HashMap
<
String
,
List
<
Long
>>
check
(){
HashMap
<
String
,
List
<
Long
>>
hashMap
=
new
HashMap
();
//视频
List
<
Long
>
vodList
=
pushVodDataMapper
.
vodIds
();
hashMap
.
put
(
"视频"
,
vodList
);
//答疑
List
<
Long
>
answerList
=
pushAnsweringDataMapper
.
answerList
();
hashMap
.
put
(
"答疑"
,
answerList
);
//考试
List
<
Long
>
examList
=
pushExerciseDataMapper
.
examList
();
hashMap
.
put
(
"考试"
,
examList
);
//活跃度
List
<
Long
>
activityList
=
pushDetectionDataMapper
.
activityList
();
hashMap
.
put
(
"活跃度"
,
activityList
);
//人脸
List
<
Long
>
imageList
=
pushImageDataMapper
.
imageList
();
hashMap
.
put
(
"人脸"
,
imageList
);
return
hashMap
;
}
}
src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
View file @
3a53359
...
...
@@ -43,9 +43,6 @@ public class RenSheJuServiceImpl implements RenSheJuService {
@Autowired
private
ImageCheckRecordMapper
imageCheckRecordMapper
;
@Autowired
private
SMSUtils
smsUtils
;
public
RensheResponseVO
classBaseInfo
()
throws
IOException
{
OkHttpClient
client
=
new
OkHttpClient
().
newBuilder
()
...
...
@@ -87,7 +84,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
//班级基本信息
ClassBaseInfoVO
classBaseInfoVO
=
renSheJuMapper
.
classBaseInfo
(
classId
);
BeanUtils
.
copyProperties
(
classBaseInfoVO
,
epidemicSituationClassBasic
);
epidemicSituationClassBasic
.
set
Down
Code
(
classBaseInfoVO
.
getDownCode
());
epidemicSituationClassBasic
.
set
Class
Code
(
classBaseInfoVO
.
getDownCode
());
//章节
List
<
ChapterList2
>
chapterLists
=
renSheJuMapper
.
classChapters
(
classId
);
...
...
@@ -116,7 +113,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
RensheResponseVO
rensheResponseVO
=
JSON
.
parseObject
(
response
.
body
().
string
(),
RensheResponseVO
.
class
);
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
2
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
3
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
classBaseInfoDTO
).
toString
());
if
(
200
==
response
.
code
())
{
renshejuHistoryDO
.
setOutputParam
(
rensheResponseVO
.
getCtt
().
toString
());
...
...
@@ -128,7 +125,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
// return null;
}
else
{
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
2
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
3
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
classBaseInfoDTO
).
toString
());
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
NO_DATA
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
...
...
@@ -138,7 +135,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
2
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
3
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
classBaseInfoDTO
).
toString
());
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
PUSH_FAIL
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
...
...
@@ -168,6 +165,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
List
<
DailyStudyInfoVO
>
result
=
new
ArrayList
<>();
// List<Long> vodClassIds = new ArrayList<>();
// vodClassIds.add(477L);
try
{
for
(
Long
classId
:
vodClassIds
)
{
...
...
@@ -178,7 +176,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
for
(
DailyStudyInfoVO
dailyStudyInfoVO
:
result
)
{
ClassHourBasic
classHourBasic
=
new
ClassHourBasic
();
BeanUtils
.
copyProperties
(
dailyStudyInfoVO
,
classHourBasic
);
classHourBasic
.
set
Down
Code
(
dailyStudyInfoVO
.
getDownCode
());
classHourBasic
.
set
Class
Code
(
dailyStudyInfoVO
.
getDownCode
());
//找到当天每次上线下线时间
//上线时间
...
...
@@ -194,7 +192,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
loginList
.
setEndTime
(
Timestamp
.
valueOf
(
loginOutRecords
.
get
(
i
).
getCreateDate
()).
getTime
());
//查看这个人该时间段的学习记录
List
<
ChapterList3
>
chapterList3s
=
renSheJuMapper
.
dailyStudyRecords
(
dailyStudyInfoVO
.
getMemberId
(),
dailyStudyInfoVO
.
get
DownCode
(),
loginRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
),
loginOutRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
));
List
<
ChapterList3
>
chapterList3s
=
renSheJuMapper
.
dailyStudyRecords
(
dailyStudyInfoVO
.
getMemberId
(),
dailyStudyInfoVO
.
get
ClassId
(),
loginRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
),
loginOutRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
));
if
(
chapterList3s
.
size
()
>
0
)
{
loginList
.
setChapterList
(
chapterList3s
);
loginLists
.
add
(
loginList
);
...
...
@@ -204,16 +202,10 @@ public class RenSheJuServiceImpl implements RenSheJuService {
//活跃度列表
List
<
ActivityList
>
activityLists
=
new
ArrayList
<>();
List
<
DailyActivitiesVO
>
activityDetectionDOS
=
renSheJuMapper
.
dailyActivities
(
dailyStudyInfoVO
.
get
DownCode
(),
dailyStudyInfoVO
.
getMemberId
());
List
<
DailyActivitiesVO
>
activityDetectionDOS
=
renSheJuMapper
.
dailyActivities
(
dailyStudyInfoVO
.
get
ClassId
(),
dailyStudyInfoVO
.
getMemberId
());
for
(
DailyActivitiesVO
dailyActivitiesVO
:
activityDetectionDOS
)
{
ActivityList
activityList
=
new
ActivityList
();
if
(
null
==
dailyActivitiesVO
.
getAccess
()
||
0
==
dailyActivitiesVO
.
getAccess
())
{
activityList
.
setAccess
(
1
);
activityList
.
setErrorInfo
(
2
);
}
else
{
activityList
.
setAccess
(
0
);
}
if
(
0
==
dailyActivitiesVO
.
getCheckType
())
{
activityList
.
setActivityDetection
(
2
);
...
...
@@ -243,7 +235,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
RensheResponseVO
rensheResponseVO
=
JSON
.
parseObject
(
response
.
body
().
string
(),
RensheResponseVO
.
class
);
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
3
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
4
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
classHourBehaviorDTO
).
toString
());
if
(
200
==
response
.
code
())
{
renshejuHistoryDO
.
setOutputParam
(
rensheResponseVO
.
getCtt
().
toString
());
...
...
@@ -252,10 +244,9 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
return
rensheResponseVO
;
// return null;
}
else
{
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
3
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
4
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
classHourBehaviorDTO
).
toString
());
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
NO_DATA
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
...
...
@@ -264,7 +255,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
3
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
4
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
classHourBehaviorDTO
).
toString
());
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
PUSH_FAIL
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
...
...
@@ -292,18 +283,21 @@ public class RenSheJuServiceImpl implements RenSheJuService {
//找出前一天产生考试数据的班级
List
<
Long
>
classIds
=
renSheJuMapper
.
dailyExamBasic
(
"0"
);
// List<Long> classIds = new ArrayList<>();
// classIds.add(439L);
try
{
if
(
classIds
.
size
()
>
0
)
{
for
(
Long
classId
:
classIds
)
{
//具体哪些人做了
List
<
MemberDO
>
memberDOList
=
renSheJuMapper
.
memberIds
(
classId
);
ClassDictDO
classDictDO
=
classDictMapper
.
selectById
(
classId
);
for
(
MemberDO
memberDO
:
memberDOList
)
{
//章节课程考试时间列表
ChapterExamBasic
chapterExamBasic
=
new
ChapterExamBasic
();
chapterExamBasic
.
set
DownCode
(
String
.
valueOf
(
classId
));
chapterExamBasic
.
set
ClassCode
(
classDictDO
.
getClassCode
(
));
//最后一节课作为chapterCode
String
vodId
=
renSheJuMapper
.
classVodName
(
classId
);
...
...
@@ -323,12 +317,6 @@ public class RenSheJuServiceImpl implements RenSheJuService {
for
(
ExamActivitiesVO
dailyActivitiesVO
:
activityDetectionDOS
)
{
ActivityList
activityList
=
new
ActivityList
();
if
(
null
==
dailyActivitiesVO
.
getAccess
()
||
0
==
dailyActivitiesVO
.
getAccess
())
{
activityList
.
setAccess
(
1
);
activityList
.
setErrorInfo
(
1
);
}
else
{
activityList
.
setAccess
(
0
);
}
activityList
.
setActivityDetection
(
1
);
activityList
.
setActivityTime
(
dailyActivitiesVO
.
getActivityTime
());
activityLists
.
add
(
activityList
);
...
...
@@ -342,8 +330,6 @@ public class RenSheJuServiceImpl implements RenSheJuService {
//下线时间
List
<
OprMemDictDO
>
loginOutRecords
=
renSheJuMapper
.
loginOutRecords
(
memberDO
.
getId
());
boolean
flag
=
false
;
for
(
int
i
=
0
;
i
<
loginRecords
.
size
();
i
++)
{
//找到该时间段内的测评
List
<
ExerciseDoneResultDO
>
exerciseDoneResultDOS
=
renSheJuMapper
.
dailyExerciseDone
(
memberDO
.
getId
(),
loginRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
),
loginOutRecords
.
get
(
i
).
getCreateDate
().
toString
().
replace
(
"T"
,
" "
),
classId
);
...
...
@@ -352,17 +338,10 @@ public class RenSheJuServiceImpl implements RenSheJuService {
examList
.
setStartTime
(
Timestamp
.
valueOf
(
exerciseDoneResultDO
.
getStartDate
()).
getTime
());
examList
.
setEndTime
(
Timestamp
.
valueOf
(
exerciseDoneResultDO
.
getCreateDate
()).
getTime
());
examList
.
setIp
(
loginRecords
.
get
(
i
).
getIpAddress
());
if
(
"合格"
.
equals
(
exerciseDoneResultDO
.
getResult
()))
{
flag
=
true
;
}
examLists
.
add
(
examList
);
}
}
if
(
flag
==
true
)
{
chapterExamBasic
.
setAccess
(
0L
);
}
else
{
chapterExamBasic
.
setAccess
(
1L
);
}
chapterExamBasic
.
setExamList
(
examLists
);
chapterExamBasics
.
add
(
chapterExamBasic
);
}
...
...
@@ -384,7 +363,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
System
.
out
.
println
(
rensheResponseVO
);
if
(
200
==
response
.
code
())
{
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
4
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
5
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
uploadChapterBehaviorDTO
).
toString
());
if
(
200
==
response
.
code
())
{
renshejuHistoryDO
.
setOutputParam
(
rensheResponseVO
.
getCtt
().
toString
());
...
...
@@ -396,7 +375,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
return
rensheResponseVO
;
}
else
{
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
4
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
5
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
uploadChapterBehaviorDTO
).
toString
());
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
NO_DATA
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
...
...
@@ -404,7 +383,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
}
catch
(
Exception
e
)
{
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
4
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
5
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
uploadChapterBehaviorDTO
).
toString
());
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
PUSH_FAIL
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
...
...
@@ -430,9 +409,6 @@ public class RenSheJuServiceImpl implements RenSheJuService {
List
<
DailyAnswerVO
>
dailyAnswerVOS
=
renSheJuMapper
.
dailyAnswer
(
"0"
);
// List<DailyAnswerVO> dailyAnswerVOS = new ArrayList<>();
try
{
if
(
dailyAnswerVOS
.
size
()
>
0
)
{
HashMap
<
String
,
List
<
AnswerAndQuestionList
>>
hashMap
=
new
HashMap
<>();
...
...
@@ -461,7 +437,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
AnswerBasic
answerBasic
=
new
AnswerBasic
();
String
downCode
=
key
.
split
(
":"
)[
0
];
String
identity
=
key
.
split
(
":"
)[
1
];
answerBasic
.
set
Down
Code
(
downCode
);
answerBasic
.
set
Class
Code
(
downCode
);
answerBasic
.
setIdentity
(
identity
);
answerBasic
.
setAnswerAndQuestionList
(
hashMap
.
get
(
key
));
answerBasics
.
add
(
answerBasic
);
...
...
@@ -480,7 +456,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
RensheResponseVO
rensheResponseVO
=
JSON
.
parseObject
(
response
.
body
().
string
(),
RensheResponseVO
.
class
);
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
5
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
6
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
uploadClassAnswerQuestionBehaviorDTO
).
toString
());
if
(
200
==
response
.
code
())
{
renshejuHistoryDO
.
setOutputParam
(
rensheResponseVO
.
getCtt
().
toString
());
...
...
@@ -492,7 +468,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
return
rensheResponseVO
;
}
else
{
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
5
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
6
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
uploadClassAnswerQuestionBehaviorDTO
).
toString
());
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
NO_DATA
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
...
...
@@ -500,7 +476,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
}
catch
(
Exception
e
)
{
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
5
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
6
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
uploadClassAnswerQuestionBehaviorDTO
).
toString
());
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
PUSH_FAIL
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
...
...
@@ -527,7 +503,8 @@ public class RenSheJuServiceImpl implements RenSheJuService {
UploadImageDTO
uploadImage
=
new
UploadImageDTO
();
uploadImage
.
setPrivateKey
(
getSecret
());
uploadImage
.
setDownCode
(
String
.
valueOf
(
classId
));
ClassDictDO
classDictDO
=
classDictMapper
.
selectById
(
classId
);
uploadImage
.
setClassCode
(
classDictDO
.
getClassCode
());
List
<
ImageDetailList
>
imageDetailLists
=
new
ArrayList
<
ImageDetailList
>();
try
{
...
...
@@ -591,7 +568,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
RensheResponseVO
rensheResponseVO
=
JSON
.
parseObject
(
response
.
body
().
string
(),
RensheResponseVO
.
class
);
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
6
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
7
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
uploadImage
).
toString
());
if
(
null
!=
rensheResponseVO
.
getCtt
())
{
renshejuHistoryDO
.
setOutputParam
(
rensheResponseVO
.
getCtt
().
toString
());
...
...
@@ -602,7 +579,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
rensheResponseVOS
.
add
(
rensheResponseVO
);
}
else
{
RenshejuHistoryDO
renshejuHistoryDO1
=
new
RenshejuHistoryDO
();
renshejuHistoryDO1
.
setInterfaceName
(
RenSheJuConstant
.
POST_
6
);
renshejuHistoryDO1
.
setInterfaceName
(
RenSheJuConstant
.
POST_
7
);
renshejuHistoryDO1
.
setInputParam
(
JSONObject
.
fromObject
(
uploadImage
).
toString
());
renshejuHistoryDO1
.
setOutputParam
(
RenSheJuConstant
.
NO_DATA
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO1
);
...
...
@@ -611,7 +588,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
6
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
7
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
uploadImage
).
toString
());
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
PUSH_FAIL
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
...
...
@@ -643,7 +620,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
RensheResponseVO
rensheResponseVO
=
JSON
.
parseObject
(
response
.
body
().
string
(),
RensheResponseVO
.
class
);
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
7
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
8
);
renshejuHistoryDO
.
setInputParam
(
getSecret
());
if
(
200
==
response
.
code
())
{
renshejuHistoryDO
.
setOutputParam
(
rensheResponseVO
.
getCtt
().
toString
());
...
...
@@ -655,7 +632,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
catch
(
Exception
e
)
{
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
7
);
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_
8
);
renshejuHistoryDO
.
setInputParam
(
getSecret
());
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
PUSH_FAIL
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
...
...
@@ -664,67 +641,6 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
public
RensheResponseVO
uploadClassCode
()
throws
IOException
{
OkHttpClient
client
=
new
OkHttpClient
().
newBuilder
()
.
build
();
MediaType
mediaType
=
MediaType
.
parse
(
"application/json"
);
UploadClassCodeDTO
uploadClassCodeDTO
=
new
UploadClassCodeDTO
();
uploadClassCodeDTO
.
setPrivateKey
(
getSecret
());
//所有班级
List
<
Long
>
classIds
=
renSheJuMapper
.
newClasses
(
"0"
);
List
<
ClassCodeBasic
>
classCodeBasics
=
new
ArrayList
<
ClassCodeBasic
>();
for
(
Long
classId
:
classIds
)
{
ClassCodeBasic
classCodeBasic
=
new
ClassCodeBasic
();
ClassDictDO
classDictDO
=
classDictMapper
.
selectById
(
classId
);
classCodeBasic
.
setDownCode
(
String
.
valueOf
(
classDictDO
.
getId
()));
classCodeBasic
.
setClassCode
(
classDictDO
.
getClassCode
());
classCodeBasics
.
add
(
classCodeBasic
);
}
uploadClassCodeDTO
.
setClassCodeBasic
(
classCodeBasics
);
System
.
out
.
println
(
com
.
alibaba
.
fastjson
.
JSONObject
.
toJSONString
(
uploadClassCodeDTO
));
try
{
RequestBody
body
=
RequestBody
.
create
(
mediaType
,
JSONObject
.
fromObject
(
uploadClassCodeDTO
).
toString
());
Request
request
=
new
Request
.
Builder
()
.
url
(
renSheConfig
.
getUrl
()
+
"/import/downstream/enterprise/uploadClassCode"
)
.
method
(
"POST"
,
body
)
.
addHeader
(
"User-Agent"
,
"Apifox/1.0.0 (https://www.apifox.cn)"
)
.
addHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
Response
response
=
client
.
newCall
(
request
).
execute
();
RensheResponseVO
rensheResponseVO
=
JSON
.
parseObject
(
response
.
body
().
string
(),
RensheResponseVO
.
class
);
System
.
out
.
println
(
rensheResponseVO
);
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_8
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
uploadClassCodeDTO
).
toString
());
if
(
200
==
response
.
code
())
{
if
(
null
!=
rensheResponseVO
.
getCtt
())
{
renshejuHistoryDO
.
setOutputParam
(
rensheResponseVO
.
getCtt
().
toString
());
}
else
{
renshejuHistoryDO
.
setOutputParam
(
response
.
body
().
toString
());
}
}
else
{
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
API_ERROR
);
}
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
return
rensheResponseVO
;
// return null;
}
catch
(
Exception
e
)
{
RenshejuHistoryDO
renshejuHistoryDO
=
new
RenshejuHistoryDO
();
renshejuHistoryDO
.
setInterfaceName
(
RenSheJuConstant
.
POST_8
);
renshejuHistoryDO
.
setInputParam
(
JSONObject
.
fromObject
(
uploadClassCodeDTO
).
toString
());
renshejuHistoryDO
.
setOutputParam
(
RenSheJuConstant
.
PUSH_FAIL
);
renshejuHistoryMapper
.
insert
(
renshejuHistoryDO
);
}
return
null
;
}
public
RensheResponseVO
getErrorClass
()
throws
IOException
{
OkHttpClient
client
=
new
OkHttpClient
().
newBuilder
()
...
...
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
View file @
3a53359
...
...
@@ -21,7 +21,9 @@ import org.springframework.transaction.annotation.Transactional;
import
sun.util.calendar.CalendarDate
;
import
javax.servlet.http.HttpServletRequest
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
/**
...
...
@@ -63,16 +65,30 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
private
ExerciseDoneResultMapper
exerciseDoneResultMapper
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
insertHistory
(
VodPlayHistoryDO
vodPlayHistoryDO
,
HttpServletRequest
request
)
{
public
String
insertHistory
(
VodPlayHistoryDO
vodPlayHistoryDO
,
HttpServletRequest
request
)
throws
Exception
{
Integer
count
=
exerciseDoneResultMapper
.
selectCount
(
new
QueryWrapper
<
ExerciseDoneResultDO
>()
.
lambda
()
.
eq
(
ExerciseDoneResultDO:
:
getClassId
,
vodPlayHistoryDO
.
getClassId
())
.
eq
(
ExerciseDoneResultDO:
:
getMemberId
,
vodPlayHistoryDO
.
getMemberId
()));
if
(
count
==
0
)
{
//只有开始学习时间晚于签到时间的数据才会插进去
Date
date
=
new
Date
();
Boolean
flag
=
false
;
SignInRecordDO
dailySignInRecord
=
signInRecordMapper
.
getDailySignInRecord
(
vodPlayHistoryDO
.
getMemberId
(),
vodPlayHistoryDO
.
getClassId
());
if
(
null
!=
dailySignInRecord
)
{
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
String
formatDateTime
=
dailySignInRecord
.
getSignInDate
().
format
(
formatter
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
signInDate
=
sdf
.
parse
(
formatDateTime
);
if
(
signInDate
.
getTime
()
<
date
.
getTime
()
-
(
vodPlayHistoryDO
.
getSuspendLength
()
+
vodPlayHistoryDO
.
getPlayLength
()))
{
flag
=
true
;
}
}
if
(
count
==
0
&&
flag
)
{
Date
date
=
new
Date
();
if
(
vodPlayHistoryDO
.
getPlayLength
()
>
8
&&
vodPlayHistoryDO
.
getSuspendLength
()
<=
3000
)
{
Date
latestDailyDate
=
this
.
baseMapper
.
latestDailyStudyRecord
(
vodPlayHistoryDO
.
getMemberId
());
...
...
@@ -120,15 +136,29 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
insertHistoryNew
(
InsertHistoryNewDTO
insertHistoryNewDTO
,
HttpServletRequest
request
)
{
public
String
insertHistoryNew
(
InsertHistoryNewDTO
insertHistoryNewDTO
,
HttpServletRequest
request
)
throws
Exception
{
Integer
count
=
exerciseDoneResultMapper
.
selectCount
(
new
QueryWrapper
<
ExerciseDoneResultDO
>()
.
lambda
()
.
eq
(
ExerciseDoneResultDO:
:
getClassId
,
insertHistoryNewDTO
.
getClassId
())
.
eq
(
ExerciseDoneResultDO:
:
getMemberId
,
insertHistoryNewDTO
.
getMemberId
()));
if
(
count
==
0
)
{
Date
date
=
new
Date
();
//只有开始学习时间晚于签到时间的数据才会插进去
Date
date
=
new
Date
();
Boolean
flag
=
false
;
SignInRecordDO
dailySignInRecord
=
signInRecordMapper
.
getDailySignInRecord
(
insertHistoryNewDTO
.
getMemberId
(),
insertHistoryNewDTO
.
getClassId
());
if
(
null
!=
dailySignInRecord
)
{
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
String
formatDateTime
=
dailySignInRecord
.
getSignInDate
().
format
(
formatter
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
signInDate
=
sdf
.
parse
(
formatDateTime
);
if
(
signInDate
.
getTime
()
<
date
.
getTime
()
-
(
insertHistoryNewDTO
.
getSuspendLength
()
+
insertHistoryNewDTO
.
getPlayLength
()))
{
flag
=
true
;
}
}
if
(
count
==
0
&&
flag
)
{
if
(
insertHistoryNewDTO
.
getPlayLength
()
>
8
&&
insertHistoryNewDTO
.
getSuspendLength
()
<=
3000
)
{
VodPlayHistoryDO
vodPlayHistoryDO
=
new
VodPlayHistoryDO
();
BeanUtils
.
copyProperties
(
insertHistoryNewDTO
,
vodPlayHistoryDO
);
...
...
src/main/java/com/subsidy/util/RenSheJuConstant.java
View file @
3a53359
...
...
@@ -5,37 +5,37 @@ public class RenSheJuConstant {
/**
* POST-2:班级基本信息信息采集接口
*/
public
static
final
String
POST_
2
=
"POST_2_classBaseInfo
"
;
public
static
final
String
POST_
3
=
"POST3_班级基本信息
"
;
/**
* POST-3:学时信息采集接口
*/
public
static
final
String
POST_
3
=
"POST_3_classHourBehavior
"
;
public
static
final
String
POST_
4
=
"POST4_学时信息
"
;
/**
* POST-4:考试信息采集接口
*/
public
static
final
String
POST_
4
=
"POST_4_uploadChapterBehavior
"
;
public
static
final
String
POST_
5
=
"POST5_考试信息
"
;
/**
* POST-5:答疑辅导采集接口
*/
public
static
final
String
POST_
5
=
"POST_5_uploadClassAnswerQuestionBehavior
"
;
public
static
final
String
POST_
6
=
"POST6_答疑辅导
"
;
/**
* POST-6 班级活跃度/实名认证照片信息采集接口
*/
public
static
final
String
POST_
6
=
"POST_6_uploadImage
"
;
public
static
final
String
POST_
7
=
"POST7_实名认证/活跃度
"
;
/**
* POST-7 获取培训待绑定的(班级编号,项目编号)列表
*/
public
static
final
String
POST_7
=
"POST_7_getClassCodeByPrivateKey"
;
//
public static final String POST_7 = "POST_7_getClassCodeByPrivateKey";
/**
* POST-8 上下游班级数据绑定接口
*/
public
static
final
String
POST_8
=
"POST
_8_uploadClassCode
"
;
public
static
final
String
POST_8
=
"POST
8_待绑定的班级
"
;
/**
* POST-9 获取推送失败班级列表
...
...
src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java
View file @
3a53359
...
...
@@ -17,5 +17,9 @@ public class AdministerPermissionVO {
private
Boolean
isRole
;
private
String
companyName
;
private
String
shortName
;
private
List
<
PermissionsVO
>
permissions
;
}
src/main/java/com/subsidy/vo/renshe/ClassBaseInfoVO.java
View file @
3a53359
...
...
@@ -7,20 +7,10 @@ public class ClassBaseInfoVO {
private
String
downCode
;
private
String
shortName
;
private
Long
learnHour
;
private
Long
courseHour
;
private
Long
startDate
;
private
Long
endDate
;
private
String
areaName
;
private
String
trainingName
;
private
String
trainingCode
;
}
src/main/java/com/subsidy/vo/renshe/DailyStudyInfoVO.java
View file @
3a53359
...
...
@@ -5,9 +5,9 @@ import lombok.Data;
@Data
public
class
DailyStudyInfoVO
{
private
Long
member
Id
;
private
Long
class
Id
;
// private Long class
Id;
private
Long
member
Id
;
/**
* 临时班级(临时项目)编号
...
...
@@ -17,23 +17,12 @@ public class DailyStudyInfoVO {
* 学员身份证号,会对身份证号长度、格式进行校验、X用大写
*/
private
String
identity
;
/**
* 当日累计学习时长,视频暂停时间不计入【秒】
*/
private
long
learnTime
;
/**
* 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】
*/
private
long
loginTime
;
/**
* 学员电话号,会对学生手机号长度、格式进行校验
*/
private
String
phone
;
/**
* 当日累计播放时长,视频暂停时间计入【秒】
*/
private
Long
playTime
;
/**
* 学员姓名
*/
...
...
src/main/resources/mapper/DudaoMapper.xml
View file @
3a53359
...
...
@@ -224,4 +224,290 @@
</if>
and t3.area_name = '普陀'
</select>
<select
id=
"classBaseInfo"
parameterType=
"long"
resultType=
"com.subsidy.vo.renshe.ClassBaseInfoVO"
>
SELECT
t2.id AS downCode,
t2.class_code,
t2.class_name AS shortName,
FLOOR( sum( t7.vod_length )/ 60 ) AS learnHour,
FLOOR( sum( t7.vod_length )/ 2700 ) AS courseHour,
REPLACE ( unix_timestamp( t2.start_date ), '.', '' )/ 1000 AS startDate,
REPLACE ( unix_timestamp( t2.end_date ), '.', '' )/ 1000 AS endDate,
t3.area_name AS areaName,
t3.company_name AS trainingName,
t3.company_code AS trainingCode
FROM
class_dict t2
LEFT JOIN company_dict t3 ON t2.company_id = t3.id
LEFT JOIN course_dict t4 ON t2.course_id = t4.id
LEFT JOIN course_content t5 ON t4.id = t5.course_id
LEFT JOIN content_vod_mapping t6 ON t5.id = t6.content_id
LEFT JOIN vod_dict t7 ON t6.vod_id = t7.id
WHERE
t2.id = #{classId}
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
AND t4.delete_date IS NULL
AND t5.delete_date IS NULL
AND t6.delete_date IS NULL
AND t7.delete_date IS NULL
</select>
<select
id=
"classChapters"
parameterType=
"long"
resultType=
"com.subsidy.dto.renshe.ChapterList2"
>
SELECT
t7.id AS chapterCode,
IFNULL( t6.vod_alias_name, t7.vod_name ) as chapterName,
FLOOR( t7.vod_length / 60 ) as chapterTime,
0 as isExam,
120 as examTime
FROM
class_dict t2
LEFT JOIN course_dict t4 ON t2.course_id = t4.id
LEFT JOIN course_content t5 ON t4.id = t5.course_id
LEFT JOIN content_vod_mapping t6 ON t5.id = t6.content_id
LEFT JOIN vod_dict t7 ON t6.vod_id = t7.id
WHERE
t2.id = #{classId}
AND t2.delete_date IS NULL
AND t4.delete_date IS NULL
AND t5.delete_date IS NULL
AND t6.delete_date IS NULL
AND t7.delete_date IS NULL
ORDER BY
t5.order_no,
t6.order_no,
t7.order_no
</select>
<select
id=
"classMembers"
parameterType=
"long"
resultType=
"com.subsidy.vo.renshe.MemberVO"
>
SELECT
t2.user_name as name,
t2.telephone as phone,
t2.id_card as identity
FROM
class_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
WHERE
t.class_id = #{classId}
AND t.delete_date IS NULL
AND t2.delete_date IS NULL
</select>
<select
id=
"dailyStudyInfo1"
resultType=
"com.subsidy.vo.renshe.DailyStudyInfoVO"
>
SELECT
t.class_id AS downCode,
t3.id AS member_id,
t3.user_name AS studentName,
t3.telephone AS phone,
t3.id_card identity,
IFNULL( t4.learnTime, 0 ) learnTime,
IFNULL( t4.playTime, 0 ) playTime,
t2.loginTime
FROM
class_member_mapping t
LEFT JOIN (
SELECT
t3.user_id,
login - logout AS loginTime
FROM
(
SELECT
user_id,
sum(
unix_timestamp( t1.create_date )) AS login
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
GROUP BY
user_id
) t3
LEFT JOIN (
SELECT
user_id,
sum(
unix_timestamp( t1.create_date )) AS logout
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
GROUP BY
user_id
) t2 ON t3.user_id = t2.user_id
) t2 ON t2.user_id = t.member_id
LEFT JOIN member t3 ON t.member_id = t3.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
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
AND t1.class_id = #{classId}
GROUP BY
t1.class_id,
t1.member_id
) t4 ON t.member_id = t4.member_id
WHERE
t.delete_date IS NULL
AND t3.delete_date IS NULL
AND t.class_id = #{classId}
AND t2.loginTime IS NOT NULL
</select>
<select
id=
"loginRecords"
parameterType=
"long"
resultType=
"com.subsidy.model.OprMemDictDO"
>
SELECT
distinct *
FROM
opr_mem_dict t
WHERE
user_id = #{memberId}
AND t.result = 1
AND t.delete_date IS NULL
AND opr_type = "登录"
AND DATE_FORMAT( DATE_ADD( create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT(
NOW(),
'%Y-%m-%d'
)
order by id
</select>
<select
id=
"loginOutRecords"
parameterType=
"long"
resultType=
"com.subsidy.model.OprMemDictDO"
>
select distinct *
FROM
opr_mem_dict t
WHERE
user_id = #{memberId}
AND t.result = 1
AND t.delete_date IS NULL
AND opr_type = "登出"
AND DATE_FORMAT( DATE_ADD( create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT(
NOW(),
'%Y-%m-%d'
)
order by id
</select>
<select
id=
"dailyStudyRecords"
resultType=
"com.subsidy.dto.renshe.ChapterList3"
>
SELECT
t2.id as chapterCode,
t.play_length AS chapterTime,
t.suspend_length AS pauseTime,
unix_timestamp(subdate( t.create_date, INTERVAL (t.play_length+t.suspend_length)SECOND ))*1000 AS startTime,
unix_timestamp(t.create_date)*1000 AS endTime
FROM
vod_play_history t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
t.delete_date IS NULL
AND t.member_id = #{memberId}
AND t.create_date BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%s' )
AND DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%s' )
and t.class_id = #{classId}
</select>
<select
id=
"dailyActivities"
resultType=
"com.subsidy.vo.renshe.DailyActivitiesVO"
>
SELECT
t1.`status` as access,
unix_timestamp( t1.create_date )*1000 as activityTime,
t1.check_type
FROM
activity_detection 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 t1.member_id = #{memberId}
AND t1.class_id = #{classId}
</select>
<select
id=
"memberIds"
parameterType=
"long"
resultType=
"com.subsidy.model.MemberDO"
>
SELECT DISTINCT
member_id as id,
t2.id_card,
t2.telephone,
t2.user_name
FROM
exercise_done_result t1
LEFT JOIN member t2 ON t1.member_id = t2.id
WHERE
t1.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
and class_id = #{classId}
</select>
<select
id=
"classVodName"
parameterType=
"long"
resultType=
"string"
>
SELECT
t7.id AS chapterCode
FROM
class_dict t2
LEFT JOIN course_dict t4 ON t2.course_id = t4.id
LEFT JOIN course_content t5 ON t4.id = t5.course_id
LEFT JOIN content_vod_mapping t6 ON t5.id = t6.content_id
LEFT JOIN vod_dict t7 ON t6.vod_id = t7.id
WHERE
t2.id = #{classId}
AND t2.delete_date IS NULL
AND t4.delete_date IS NULL
AND t5.delete_date IS NULL
AND t6.delete_date IS NULL
AND t7.delete_date IS NULL
ORDER BY
t5.order_no desc,
t6.order_no desc,
t7.order_no desc
limit 1
</select>
<select
id=
"examLength"
resultType=
"long"
>
SELECT
SUM(unix_timestamp( t1.create_date )- unix_timestamp( t1.start_date ) ) AS examTime
FROM
exercise_done_result t1
WHERE
t1.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND class_id = #{classId}
AND member_id = #{memberId}
</select>
<select
id=
"examActivities"
resultType=
"com.subsidy.vo.renshe.ExamActivitiesVO"
>
SELECT
t1.result AS access,
UNIX_TIMESTAMP( t1.create_date )* 1000 AS activityTime
FROM
image_check_record t1
WHERE
class_id =#{classId}
AND DATE_FORMAT( DATE_ADD( t1.create_date,interval 1 day), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.paper_id IS NOT NULL
and t1.result =1
AND t1.member_id=#{memberId}
</select>
<select
id=
"dailyExerciseDone"
resultType=
"com.subsidy.model.ExerciseDoneResultDO"
>
SELECT
*
FROM
exercise_done_result t
WHERE
t.delete_date IS NULL
AND t.member_id = #{memberId}
AND t.create_date BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%s' )
AND DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%s' )
and t.class_id = #{classId}
</select>
</mapper>
src/main/resources/mapper/PushAnsweringDataMapper.xml
0 → 100644
View file @
3a53359
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.subsidy.mapper.PushAnsweringDataMapper"
>
<select
id=
"insertAnswerData"
>
insert into push_answering_data (class_id,ask_id,create_date,update_date)
VALUES (#{classId},#{userId}, #{question}, #{answer})
</select>
<select
id=
"answerList"
resultType=
"long"
>
SELECT
t2.id AS 答疑id
FROM
answering_question t2
LEFT JOIN push_answering_data t1 ON t1.class_id = t2.class_id
AND t1.ask_id = t2.ask_id
AND t1.create_date = t2.create_date
AND t1.update_date = t2.update_date
WHERE
t2.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t2.update_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.create_date IS NULL
</select>
</mapper>
src/main/resources/mapper/PushDetectionDataMapper.xml
0 → 100644
View file @
3a53359
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.subsidy.mapper.PushDetectionDataMapper"
>
<select
id=
"insertData"
>
insert into push_detection_data (class_id,check_type,member_id,create_date)
VALUES (#{classId}, #{checkType}, #{memberId}, #{createDate})
</select>
<select
id=
"activityList"
resultType=
"long"
>
SELECT
t2.id 活跃度id
FROM
activity_detection t2
LEFT JOIN push_detection_data t1 ON t1.class_id = t2.class_id
AND t1.member_id = t2.member_id
AND t1.create_date = t2.create_date
WHERE
t2.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t2.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.create_date IS NULL
</select>
</mapper>
src/main/resources/mapper/PushExerciseDataMapper.xml
0 → 100644
View file @
3a53359
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.subsidy.mapper.PushExerciseDataMapper"
>
<select
id=
"pushExamData"
>
insert into push_exercise_data (class_id,start_date,member_id,create_date,length)
VALUES (#{classId}, #{startDate}, #{memberId}, #{createDate},#{examTime})
</select>
<select
id=
"examList"
resultType=
"long"
>
SELECT
t2.id as 考试id
FROM
exercise_done_result t2
LEFT JOIN push_exercise_data t1 ON t1.class_id = t2.class_id
AND t1.member_id = t2.member_id
AND t1.start_date = t2.start_date
AND t1.create_date = t2.create_date
WHERE
t2.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t2.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.create_date IS NULL
</select>
</mapper>
src/main/resources/mapper/PushImageDataMapper.xml
0 → 100644
View file @
3a53359
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.subsidy.mapper.PushImageDataMapper"
>
<select
id=
"pushImageData"
>
insert into push_image_data (class_id,check_type,member_id,check_place,occurred_time)
VALUES (#{classId}, #{detectionType}, #{memberId},#{processType}, #{activityTime})
</select>
<select
id=
"imageList"
resultType=
"long"
>
SELECT
t2.id 人脸id
FROM
image_check_record t2
LEFT JOIN push_image_data t1 ON t1.class_id = t2.class_id
AND t1.member_id = t2.member_id
AND t1.occurred_time = t2.create_date
WHERE
t2.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t2.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.id IS NULL
AND t2.result = 1
</select>
</mapper>
src/main/resources/mapper/PushOprDataMapper.xml
0 → 100644
View file @
3a53359
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.subsidy.mapper.PushOprDataMapper"
>
<select
id=
"insertData"
>
insert into push_opr_data (user_id,opr_type,result,ip_address,create_date)
VALUES (#{userId}, #{opr}, 1, #{ipAddress},#{createDate})
</select>
</mapper>
src/main/resources/mapper/PushVodDataMapper.xml
0 → 100644
View file @
3a53359
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.subsidy.mapper.PushVodDataMapper"
>
<insert
id=
"insertData"
>
insert into push_vod_data (class_id,vod_id,member_id,play_length,suspend_length,play_record,create_date,ip_address)
VALUES (#{classId}, #{vodId}, #{memberId}, #{playLength},#{suspendLength},#{playRecord},#{createDate},#{ipAddress})
</insert>
<select
id=
"vodIds"
resultType=
"long"
>
SELECT
t2.id as 视频id
FROM
vod_play_history t2
LEFT JOIN push_vod_data t1 ON t1.class_id = t2.class_id
AND t1.vod_id = t2.vod_id
AND t1.member_id = t2.member_id
AND t1.play_length = t2.play_length + t2.suspend_length
AND t1.suspend_length = t2.suspend_length
AND t1.create_date = t2.create_date
WHERE
t2.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t2.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.create_date IS NULL
</select>
</mapper>
src/main/resources/mapper/RenSheJuMapper.xml
View file @
3a53359
...
...
@@ -4,16 +4,11 @@
<select
id=
"classBaseInfo"
parameterType=
"long"
resultType=
"com.subsidy.vo.renshe.ClassBaseInfoVO"
>
SELECT
t2.id AS downCode,
t2.class_code,
t2.class_name AS shortName,
FLOOR( sum( t7.vod_length )/ 60 ) AS learnHour,
FLOOR( sum( t7.vod_length )/ 2700 ) AS courseHour,
t2.id,
t2.class_code downCode,
sum( t7.vod_length ) AS learnHour,
REPLACE ( unix_timestamp( t2.start_date ), '.', '' )/ 1000 AS startDate,
REPLACE ( unix_timestamp( t2.end_date ), '.', '' )/ 1000 AS endDate,
t3.area_name AS areaName,
t3.company_name AS trainingName,
t3.company_code AS trainingCode
REPLACE ( unix_timestamp( t2.end_date ), '.', '' )/ 1000 AS endDate
FROM
class_dict t2
LEFT JOIN company_dict t3 ON t2.company_id = t3.id
...
...
@@ -49,9 +44,9 @@
SELECT
t7.id AS chapterCode,
IFNULL( t6.vod_alias_name, t7.vod_name ) as chapterName,
FLOOR( t7.vod_length / 60 )
as chapterTime,
t7.vod_length
as chapterTime,
0 as isExam,
120 as examTime
120
*60
as examTime
FROM
class_dict t2
LEFT JOIN course_dict t4 ON t2.course_id = t4.id
...
...
@@ -87,74 +82,20 @@
<select
id=
"dailyStudyInfo"
resultType=
"com.subsidy.vo.renshe.DailyStudyInfoVO"
>
SELECT
t.class_id AS downCode,
t.class_id,
t5.class_code AS downCode,
t3.id AS member_id,
t3.user_name AS studentName,
t3.telephone AS phone,
t3.id_card identity,
IFNULL( t4.learnTime, 0 ) learnTime,
IFNULL( t4.playTime, 0 ) playTime,
t2.loginTime
t3.id_card identity
FROM
class_member_mapping t
LEFT JOIN (
SELECT
t3.user_id,
login - logout AS loginTime
FROM
(
SELECT
user_id,
sum(
unix_timestamp( t1.create_date )) AS login
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
GROUP BY
user_id
) t3
LEFT JOIN (
SELECT
user_id,
sum(
unix_timestamp( t1.create_date )) AS logout
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
GROUP BY
user_id
) t2 ON t3.user_id = t2.user_id
) t2 ON t2.user_id = t.member_id
left join class_dict t5 on t.class_id = t5.id
LEFT JOIN member t3 ON t.member_id = t3.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
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
AND t1.class_id = #{classId}
GROUP BY
t1.class_id,
t1.member_id
) t4 ON t.member_id = t4.member_id
WHERE
t.delete_date IS NULL
AND t3.delete_date IS NULL
AND t.class_id = #{classId}
AND t2.loginTime IS NOT NULL
</select>
...
...
@@ -257,7 +198,6 @@
<select
id=
"dailyStudyRecords"
resultType=
"com.subsidy.dto.renshe.ChapterList3"
>
SELECT
t2.id as chapterCode,
t.play_length AS chapterTime,
t.suspend_length AS pauseTime,
unix_timestamp(subdate( t.create_date, INTERVAL (t.play_length+t.suspend_length)SECOND ))*1000 AS startTime,
unix_timestamp(t.create_date)*1000 AS endTime
...
...
@@ -354,10 +294,10 @@
SELECT
t1.id,
t1.ask_id,
t2.
id
AS downCode,
t2.
class_code
AS downCode,
t3.id_card AS identity,
UNIX_TIMESTAMP( t1.create_date )*1000 AS
answer
,
UNIX_TIMESTAMP( t1.update_date )*1000 AS
question
UNIX_TIMESTAMP( t1.create_date )*1000 AS
question
,
UNIX_TIMESTAMP( t1.update_date )*1000 AS
answer
FROM
answering_question t1
LEFT JOIN class_dict t2 ON t1.class_id = t2.id
...
...
@@ -386,7 +326,6 @@
<if
test=
"classType != null and classType != ''"
>
and t2.class_type = #{classType}
</if>
</select>
<select
id=
"classImageChecks"
parameterType=
"long"
resultType=
"com.subsidy.vo.renshe.ClassImageChecksVO"
>
...
...
@@ -549,4 +488,5 @@
AND t.delete_date IS NULL
</select>
</mapper>
src/main/resources/mapper/RenshejuHistoryMapper.xml
View file @
3a53359
...
...
@@ -2,23 +2,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.subsidy.mapper.RenshejuHistoryMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"com.subsidy.model.RenshejuHistoryDO"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"create_date"
property=
"createDate"
/>
<result
column=
"update_date"
property=
"updateDate"
/>
<result
column=
"delete_date"
property=
"deleteDate"
/>
<result
column=
"interface_name"
property=
"interfaceName"
/>
<result
column=
"input_param"
property=
"inputParam"
/>
<result
column=
"output_param"
property=
"outputParam"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
create_date,
update_date,
delete_date,
id, interface_name, input_param, output_param
</sql>
<select
id=
"dailyData"
parameterType=
"string"
resultType=
"com.subsidy.model.RenshejuHistoryDO"
>
SELECT
*
FROM
rensheju_history t
WHERE
t.delete_date IS NULL
AND DATE_FORMAT( t.create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
AND t.interface_name = #{post}
</select>
<select
id=
"dailyDatas"
parameterType=
"string"
resultType=
"com.subsidy.model.RenshejuHistoryDO"
>
SELECT
*
FROM
rensheju_history t
WHERE
t.delete_date IS NULL
AND DATE_FORMAT( t.create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
AND t.interface_name = #{post}
</select>
</mapper>
src/main/resources/mybatis-plus.properties
View file @
3a53359
...
...
@@ -6,7 +6,7 @@ setParent=com.subsidy
# mapper.xml文件生成路径
mapperPath
=
/src/main/resources/mapper/
# 数据库地址
url
=
jdbc:mysql://1
16.62.57.92:3306/subsidy_test
?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&useAffectedRows=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
url
=
jdbc:mysql://1
39.224.253.21:3306/subsidy
?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&useAffectedRows=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
driverName
=
com.mysql.cj.jdbc.Driver
userName
=
devloper
password
=
dev@1553$
\ No newline at end of file
userName
=
root
password
=
ykhladmin302
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment