浏览代码

分享直播间显示预告直播间;定时任务修改更新时间

yuhongqi 4 天之前
父节点
当前提交
b6e5115d80

+ 5 - 1
fs-live-socket/src/main/java/com/fs/live/websocket/service/WebSocketServer.java

@@ -431,6 +431,7 @@ public class WebSocketServer {
         SendMsgVo msg = new SendMsgVo();
         msg.setLiveId(task.getLiveId());
         msg.setData(task.getContent());
+        Date now = new Date();
         try {
             if (task.getTaskType() == 1L) {
                 msg.setCmd("goods");
@@ -440,11 +441,13 @@ public class WebSocketServer {
                 msg.setCmd("red");
                 LiveRedConf liveRedConf = JSON.parseObject(task.getContent(), LiveRedConf.class);
                 liveRedConf.setRedStatus(1L);
+                liveRedConf.setUpdateTime( now);
                 liveRedConfService.updateLiveRedConf(liveRedConf);
             }else if (task.getTaskType() == 4L) {
                 msg.setCmd("lottery");
                 LiveLotteryConf liveLotteryConf = JSON.parseObject(task.getContent(), LiveLotteryConf.class);
                 liveLotteryConf.setLotteryStatus("1");
+                liveLotteryConf.setUpdateTime( now);
                 liveLotteryConfService.updateLiveLotteryConf(liveLotteryConf);
             }else if (task.getTaskType() == 3L) {
                 msg.setCmd("sendMsg");
@@ -456,7 +459,8 @@ public class WebSocketServer {
                 liveMsg.setUserId(0L);
                 liveMsg.setNickName(task.getTaskName());
                 liveMsg.setMsg(task.getContent());
-                liveMsg.setCreateTime(new Date());
+                liveMsg.setCreateTime(now);
+                liveMsg.setUpdateTime(now);
                 liveMsgService.insertLiveMsg(liveMsg);
             }
             msg.setStatus(1);

+ 1 - 1
fs-service-system/src/main/java/com/fs/live/mapper/LiveMapper.java

@@ -119,7 +119,7 @@ public interface LiveMapper
 
     void updateStatusAndTimeBatchById(@Param("liveList") List<Live> list);
 
-    @Select("select * from live where company_id = #{companyId} or company_id is null")
+    @Select("select * from live where (company_id = #{companyId} or company_id is null) and and is_audit = 1 and a.is_del = 0 and a.is_show = 1 and status != 3")
     List<Live> liveCompanyList(@Param("companyId") Long companyId);
 
     @Select("select * from live where live_id = #{liveId} and (company_id = #{companyId} or company_id is null)")