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 b692129d
authored
Sep 18, 2024
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拆班推送/班级里分组推送
1 parent
829fbc99
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
100 additions
and
4 deletions
src/main/java/com/subsidy/controller/RenSheJuController.java
src/main/java/com/subsidy/dto/renshe/PushClassMembersDataDTO.java
src/main/java/com/subsidy/mapper/RenSheJuMapper.java
src/main/java/com/subsidy/service/RenSheJuService.java
src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
src/main/java/com/subsidy/vo/renshe/VodClassIdsVO.java
src/main/resources/mapper/RenSheJuMapper.xml
src/main/java/com/subsidy/controller/RenSheJuController.java
View file @
b692129
package
com
.
subsidy
.
controller
;
import
com.subsidy.common.ResponseVO
;
import
com.subsidy.dto.renshe.PushClassMembersDataDTO
;
import
com.subsidy.service.RenSheJuService
;
import
com.subsidy.vo.renshe.RensheResponseVO
;
import
com.subsidy.vo.renshe.RensheStringVO
;
...
...
@@ -7,6 +9,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -74,4 +77,10 @@ public class RenSheJuController {
return
renSheJuService
.
post6plus
();
}
@PostMapping
(
"pushClassMembersData"
)
@ApiOperation
(
"推送某个班级前一天的数据 classId memberIds 逗号隔开"
)
public
RensheResponseVO
pushClassMembersData
(
@RequestBody
PushClassMembersDataDTO
pushClassMembersDataDTO
)
throws
Exception
{
return
renSheJuService
.
pushClassMembersData
(
pushClassMembersDataDTO
);
}
}
src/main/java/com/subsidy/dto/renshe/PushClassMembersDataDTO.java
0 → 100644
View file @
b692129
package
com
.
subsidy
.
dto
.
renshe
;
import
lombok.Data
;
@Data
public
class
PushClassMembersDataDTO
{
private
Long
classId
;
private
String
memberIds
;
}
src/main/java/com/subsidy/mapper/RenSheJuMapper.java
View file @
b692129
...
...
@@ -35,9 +35,19 @@ public interface RenSheJuMapper {
List
<
Long
>
newClasses
(
String
classType
);
/**
* 前一天
新增视频学习数据
* 前一天
班级的基本信息
*/
List
<
DailyStudyInfoVO
>
dailyStudyInfo
(
Long
classId
);
List
<
DailyStudyInfoVO
>
dailyStudyInfo
(
Long
classId
,
List
<
Long
>
memberIds
);
/**
* 某班级去重学员
*/
List
<
Long
>
classDistinctMember
(
Long
classId
);
/**
* 查看前一天班级的数据条数
*/
Integer
dataCount
(
Long
classId
);
/**
* 前一天活跃度检测列表
...
...
@@ -131,6 +141,11 @@ public interface RenSheJuMapper {
List
<
Long
>
vodClassIds
(
String
classType
);
/**
* 产生数据班级+数据量
*/
List
<
VodClassIdsVO
>
vodClassCnt
(
String
classType
);
/**
* 产生考试数据的班级
*/
List
<
Long
>
examClassIds
(
String
classType
);
...
...
src/main/java/com/subsidy/service/RenSheJuService.java
View file @
b692129
package
com
.
subsidy
.
service
;
import
com.subsidy.dto.renshe.PushClassMembersDataDTO
;
import
com.subsidy.vo.renshe.RensheResponseVO
;
import
com.subsidy.vo.renshe.RensheStringVO
;
...
...
@@ -24,8 +25,8 @@ public interface RenSheJuService {
RensheStringVO
clear
()
throws
IOException
;
void
test
();
RensheResponseVO
post6plus
()
throws
Exception
;
RensheResponseVO
pushClassMembersData
(
PushClassMembersDataDTO
pushClassMembersDataDTO
)
throws
Exception
;
}
src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
View file @
b692129
This diff is collapsed.
Click to expand it.
src/main/java/com/subsidy/vo/renshe/VodClassIdsVO.java
0 → 100644
View file @
b692129
package
com
.
subsidy
.
vo
.
renshe
;
import
lombok.Data
;
@Data
public
class
VodClassIdsVO
{
private
Long
classId
;
private
String
classCode
;
private
Integer
cnt
;
}
src/main/resources/mapper/RenSheJuMapper.xml
View file @
b692129
...
...
@@ -96,8 +96,36 @@
t.delete_date IS NULL
AND t3.delete_date IS NULL
AND t.class_id = #{classId}
<if
test=
"memberIds != null and memberIds.size>0"
>
and t.member_id in
<foreach
collection=
"memberIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</if>
</select>
<select
id=
"classDistinctMember"
parameterType=
"long"
resultType=
"long"
>
SELECT DISTINCT
t.member_id
FROM
vod_play_history t
WHERE
t.class_id = #{classId}
AND t.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t.create_date, interval 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
</select>
<select
id=
"dataCount"
parameterType=
"long"
resultType=
"integer"
>
SELECT
count( 0 )
FROM
vod_play_history t
LEFT JOIN class_dict t2 ON t.class_id = t2.id
WHERE
t.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t.create_date, interval 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
and t2.id = #{classId}
</select>
<select
id=
"dailyActivities"
resultType=
"com.subsidy.vo.renshe.DailyActivitiesVO"
>
SELECT
...
...
@@ -429,6 +457,23 @@
AND t.class_type = #{classType}
</select>
<select
id=
"vodClassCnt"
parameterType=
"string"
resultType=
"com.subsidy.vo.renshe.VodClassIdsVO"
>
SELECT
class_id,
t2.class_code,
count( 0 )
FROM
vod_play_history t
LEFT JOIN class_dict t2 ON t.class_id = t2.id
WHERE
t.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t.create_date, interval 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t2.class_type = #{classType}
GROUP BY
class_id,
t2.class_code
</select>
<select
id=
"examClassIds"
parameterType=
"string"
resultType=
"long"
>
SELECT
t.id
...
...
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