weichaochao 5 년 전
부모
커밋
0455f9dde0

+ 26
- 0
src/main/java/com/huiju/estateagents/controller/TaLiveActivityController.java 파일 보기

@@ -1,9 +1,13 @@
1 1
 package com.huiju.estateagents.controller;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import com.huiju.estateagents.base.BaseController;
5 6
 import com.huiju.estateagents.base.ResponseBean;
7
+import com.huiju.estateagents.common.CommConstant;
8
+import com.huiju.estateagents.entity.ExtendContent;
6 9
 import com.huiju.estateagents.entity.TaLiveActivity;
10
+import com.huiju.estateagents.service.IExtendContentService;
7 11
 import com.huiju.estateagents.service.ITaLiveActivityService;
8 12
 import org.slf4j.Logger;
9 13
 import org.slf4j.LoggerFactory;
@@ -11,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
11 15
 import org.springframework.web.bind.annotation.*;
12 16
 
13 17
 import javax.servlet.http.HttpServletRequest;
18
+import java.time.LocalDateTime;
14 19
 import java.util.List;
15 20
 
16 21
 /**
@@ -30,6 +35,9 @@ public class TaLiveActivityController extends BaseController {
30 35
     @Autowired
31 36
     public ITaLiveActivityService iTaLiveActivityService;
32 37
 
38
+    @Autowired
39
+    public IExtendContentService iExtendContentService;
40
+
33 41
     /**
34 42
      * 分页查询列表
35 43
      *
@@ -115,6 +123,24 @@ public class TaLiveActivityController extends BaseController {
115 123
         ResponseBean responseBean = new ResponseBean();
116 124
         try {
117 125
             taLiveActivity.setLiveActivityId(id);
126
+            QueryWrapper<ExtendContent> queryWrapper = new QueryWrapper<>();
127
+            queryWrapper.eq("org_id",taLiveActivity.getOrgId());
128
+            queryWrapper.eq("content_type",CommConstant.LIVE);
129
+            queryWrapper.eq("target_id",taLiveActivity.getLiveActivityId());
130
+            List<ExtendContent> list = iExtendContentService.list(queryWrapper);
131
+            if (CommConstant.NOT_PUBLISH.equals(taLiveActivity.getStatus())){
132
+                list.forEach(e -> {
133
+                    e.setStatus(CommConstant.NOT_PUBLISH);
134
+                });
135
+            }else{
136
+                list.forEach(e -> {
137
+                    e.setStatus(CommConstant.IS_PUBLISH);
138
+                });
139
+            }
140
+            if (list.size() > 0){
141
+                iExtendContentService.updateBatchById(list);
142
+            }
143
+
118 144
             if (iTaLiveActivityService.updateById(taLiveActivity)) {
119 145
                 responseBean.addSuccess(taLiveActivity);
120 146
             } else {

+ 3
- 2
src/main/java/com/huiju/estateagents/entity/TaLiveActivity.java 파일 보기

@@ -93,6 +93,7 @@ public class TaLiveActivity implements Serializable {
93 93
     /**
94 94
      * 状态
95 95
      */
96
+
96 97
     private Integer status;
97 98
 
98 99
     /**
@@ -103,12 +104,12 @@ public class TaLiveActivity implements Serializable {
103 104
     /**
104 105
      * 直播开始时间
105 106
      */
106
-    private LocalDateTime liveStartDate;
107
+    private String liveStartDate;
107 108
 
108 109
     /**
109 110
      * 直播结束时间
110 111
      */
111
-    private LocalDateTime liveEndDate;
112
+    private String liveEndDate;
112 113
 
113 114
     /**
114 115
      * 创建时间

+ 2
- 1
src/main/resources/mapper/TaLiveActivityMapper.xml 파일 보기

@@ -26,7 +26,7 @@
26 26
      left join ta_building a on t.building_id = a.building_id
27 27
      LEFT JOIN td_city b on t.city_id = b.id
28 28
      where t.org_id = #{orgId} and t.status != -1
29
-     <if test="status != null and status != ''">
29
+     <if test="status != null">
30 30
          and t.status = #{status}
31 31
      </if>
32 32
      <if test="liveActivityTitle != null and liveActivityTitle != ''">
@@ -37,6 +37,7 @@
37 37
      </if><if test="buildingId != null and buildingId != ''">
38 38
          and t.building_id = #{buildingId}
39 39
     </if>
40
+        order by t.weight desc
40 41
     </select>
41 42
 
42 43
 </mapper>