Browse Source

课程提醒推送

cy 2 years ago
parent
commit
6a55611494

+ 9 - 0
cooleshow-common/src/main/java/com/yonge/cooleshow/common/constant/SysConfigConstant.java

@@ -216,4 +216,13 @@ public interface SysConfigConstant {
      */
     String HOMEWORK_EXPIRE_TIME = "homework_expire_time";
 
+    /**
+     * 敏感词-黑名单
+     */
+    String BLACK_LIST = "black_list";
+
+    /**
+     * 敏感词-白名单
+     */
+    String WHITE_LIST = "white_list";
 }

+ 2 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/SysConfigDao.java

@@ -28,4 +28,6 @@ public interface SysConfigDao extends BaseDAO<Long, SysConfig> {
     String findConfigValue(String paramName);
 
     void batchUpdate(@Param("configList") List<SysConfig> configList);
+
+    void updateByName(@Param("paramName") String paramName, @Param("paramValue") String paramValue);
 }

+ 3 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/SysConfigService.java

@@ -15,7 +15,7 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
      * @describe 根据配置名称获取配置信息
      */
     SysConfig findByParamName(String paramName);
-    
+
     List<SysConfig> findByParamName(List<String> paramNameList);
 
     String findConfigValue(String paramName);
@@ -23,4 +23,6 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
     void batchUpdate(List<SysConfig> configList);
 
     void updateConfig(SysConfig config);
+
+    void updateByName(String paramName, String paramValue);
 }

+ 9 - 7
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java

@@ -1424,17 +1424,19 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
                 Integer liveCount = 0;
                 Integer practiceCount = 0;
                 List<CountVo> typeCount = baseMapper.selectTypeCount(sysUser.getId(), tomorrow);
-                for (CountVo countVo : typeCount) {
-                    if (countVo.getType().equals(CourseScheduleEnum.LIVE.getCode())) {
-                        liveCount = countVo.getCount();
-                    }
-                    if (countVo.getType().equals(CourseScheduleEnum.PRACTICE.getCode())) {
-                        practiceCount = countVo.getCount();
+                if (CollectionUtils.isNotEmpty(typeCount)) {
+                    for (CountVo countVo : typeCount) {
+                        if (countVo.getType().equals(CourseScheduleEnum.LIVE.getCode())) {
+                            liveCount = countVo.getCount();
+                        }
+                        if (countVo.getType().equals(CourseScheduleEnum.PRACTICE.getCode())) {
+                            practiceCount = countVo.getCount();
+                        }
                     }
                 }
 
                 //老师端-明日课程提醒
-                if (liveCount != 0 && practiceCount != 0) {
+                if (liveCount != 0 || practiceCount != 0) {
                     String teacherUrl = sysMessageService.selectConfigUrl(MessageTypeEnum.TOMORROW_COURSE_REMINDER.getCode());
                     sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.TOMORROW_COURSE_REMINDER,
                             teacherReceivers, null, 0, teacherUrl, ClientEnum.TEACHER.getCode(),

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/SysConfigServiceImpl.java

@@ -47,4 +47,7 @@ public class SysConfigServiceImpl extends BaseServiceImpl<Long, SysConfig> imple
 		sysConfigDao.update(config);
 	}
 
+    public void updateByName(String paramName, String paramValue) {
+        sysConfigDao.updateByName(paramName, paramValue);
+    }
 }

+ 5 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/SysConfigMapper.xml

@@ -87,6 +87,11 @@
 				WHERE id_ = #{config.id}
 		</foreach>
 	</update>
+    <update id="updateByName">
+		UPDATE sys_config
+		SET param_value_=#{paramValue}
+		WHERE param_name_=#{paramName}
+	</update>
 
     <!-- 根据主键删除一条记录 -->
 	<delete id="delete">