@@ -151,4 +151,15 @@ public class ScheduleController extends BaseController {
iScheduleService.officialInfoPush(bo);
return AjaxResult.success();
}
+
+ /**
+ * 官方学时推送
+ * @return
+ */
+ @ApiOperation("官方学时推送")
+ @GetMapping("/officialPeriodPush")
+ public AjaxResult officialPeriodPush(UserQueryBo bo){
+ iScheduleService.officialPeriodPush(bo);
+ return AjaxResult.success();
+ }
@@ -64,4 +64,6 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
List<ClassGradeUserGoodsVo> selectOfficialNotPush(UserQueryBo bo);
+ List<ClassGradeUserGoodsVo> selectPeriodNotPush(UserQueryBo bo);
@@ -106,4 +106,6 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
@@ -1536,6 +1536,11 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
return baseMapper.selectOfficialNotPush(bo);
+ @Override
+ public List<ClassGradeUserGoodsVo> selectPeriodNotPush(UserQueryBo bo) {
+ return baseMapper.selectPeriodNotPush(bo);
/**
* 实体类转化成视图对象
@@ -44,4 +44,6 @@ public interface IScheduleService extends IService<PolyvVideo> {
void bindBefore(UserQueryBo bo);
void officialInfoPush(UserQueryBo bo);
+ void officialPeriodPush(UserQueryBo bo);
@@ -855,6 +855,21 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
+ * @param bo
+ public void officialPeriodPush(UserQueryBo bo) {
+ List<ClassGradeUserGoodsVo> list = iClassGradeUserService.selectPeriodNotPush(bo);
+ for(ClassGradeUserGoodsVo vo : list){
+ ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
+ queryBo.setGradeId(vo.getGradeId());
+ queryBo.setUserId(bo.getUserId());
+ iClassGradeUserService.pushOfficialPeriod(queryBo);
//获得可用学习天数
private static int getDutyDays(Date startDateStr, Date endDateStr,Long[] longs,Long studyDay) {
int result = 0;
@@ -1022,10 +1022,24 @@
class_grade g
LEFT JOIN class_grade_user gu ON g.grade_id = gu.grade_id
WHERE
- g.interface_push_id = 1
+ g.interface_push_id > 0
AND g.`status` = 1
AND gu.`status` = 1
AND gu.change_grade = 0
- AND gu.official_status = 0
+ AND gu.official_status !=1
+ </select>
+ <select id="selectPeriodNotPush" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo" resultMap="ClassGradeUserGoodsVoResult">
+ SELECT
+ gu.*
+ FROM
+ class_grade g
+ LEFT JOIN class_grade_user gu ON g.grade_id = gu.grade_id
+ WHERE
+ g.interface_period_id > 0
+ AND g.`status` = 1
+ AND gu.`status` = 1
+ AND gu.change_grade = 0
+ AND gu.period_plush !=1
</select>
</mapper>