Commit b692129d by 涂亚平

拆班推送/班级里分组推送

1 parent 829fbc99
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);
}
}
package com.subsidy.dto.renshe;
import lombok.Data;
@Data
public class PushClassMembersDataDTO {
private Long classId;
private String memberIds;
}
......@@ -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);
......
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 ;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class VodClassIdsVO {
private Long classId;
private String classCode;
private Integer cnt;
}
......@@ -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
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!