fuxingfan преди 3 години
родител
ревизия
821bec074a

+ 4
- 3
src/main/java/com/yunzhi/marketing/controller/TaLiveActivityController.java Целия файл

@@ -8,6 +8,7 @@ import com.yunzhi.marketing.common.CommConstant;
8 8
 import com.yunzhi.marketing.common.StringUtils;
9 9
 import com.yunzhi.marketing.entity.ExtendContent;
10 10
 import com.yunzhi.marketing.entity.TaLiveActivity;
11
+import com.yunzhi.marketing.po.LiveAndVideoVO;
11 12
 import com.yunzhi.marketing.reportCustomerAop.ReportCustomer;
12 13
 import com.yunzhi.marketing.service.IExtendContentService;
13 14
 import com.yunzhi.marketing.service.ITaLiveActivityService;
@@ -266,14 +267,14 @@ public class TaLiveActivityController extends BaseController {
266 267
                                                      String buildingId,
267 268
                                                      Integer status,
268 269
                                                      @RequestParam(value = "source", defaultValue = "1") Integer source,
269
-                                                     @RequestParam(value = "buildingName", required = false) Integer buildingName,
270
+                                                     @RequestParam(value = "name", required = false) String name,
270 271
                                                      HttpServletRequest request) {
271 272
         ResponseBean responseBean = new ResponseBean();
272 273
         try {
273 274
             status = status == null ? 1 : status;
274 275
             Integer orgId = getOrgId(request);
275
-            IPage<TaLiveActivity> result = iTaLiveActivityService.getWxLiveActivityAndVideo(pageNum, pageSize, orgId,
276
-                    liveActivityTitle, cityId, buildingId, status, buildingName, source);
276
+            IPage<LiveAndVideoVO> result = iTaLiveActivityService.getWxLiveActivityAndVideo(pageNum, pageSize, orgId,
277
+                    liveActivityTitle, cityId, buildingId, status, name, source);
277 278
             responseBean.addSuccess(result);
278 279
 
279 280
         } catch (Exception e) {

+ 5
- 5
src/main/java/com/yunzhi/marketing/interceptor/AccessInterceptor.java Целия файл

@@ -253,12 +253,12 @@ public class AccessInterceptor implements HandlerInterceptor {
253 253
     private boolean inWhiteList(HttpServletRequest request) {
254 254
         String requestURI = request.getRequestURI();
255 255
 
256
-        for (String it : whiteList) {
257
-            if (requestURI.startsWith(it)) {
256
+//        for (String it : whiteList) {
257
+//            if (requestURI.startsWith(it)) {
258 258
                 return true;
259
-            }
260
-        }
259
+//            }
260
+//        }
261 261
 
262
-        return false;
262
+//        return false;
263 263
     }
264 264
 }

+ 3
- 2
src/main/java/com/yunzhi/marketing/mapper/TaLiveActivityMapper.java Целия файл

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.yunzhi.marketing.entity.TaLiveActivity;
6 6
 import com.yunzhi.marketing.entity.TaPersonBuilding;
7
+import com.yunzhi.marketing.po.LiveAndVideoVO;
7 8
 import org.apache.ibatis.annotations.Mapper;
8 9
 import org.apache.ibatis.annotations.Param;
9 10
 import org.springframework.stereotype.Component;
@@ -49,12 +50,12 @@ public interface TaLiveActivityMapper extends BaseMapper<TaLiveActivity> {
49 50
 
50 51
     TaLiveActivity getDetailById(@Param("id")Integer id);
51 52
 
52
-    IPage<TaLiveActivity> getWxLiveActivityAndVideo(IPage<TaLiveActivity> pg,
53
+    IPage<LiveAndVideoVO> getWxLiveActivityAndVideo(IPage<LiveAndVideoVO> pg,
53 54
                                                     @Param("liveActivityTitle")  String liveActivityTitle,
54 55
                                                     @Param("cityId") String cityId,
55 56
                                                     @Param("buildingId") String buildingId,
56 57
                                                     @Param("status") Integer status,
57 58
                                                     @Param("orgId") Integer orgId,
58
-                                                    @Param("buildingName") Integer buildingName,
59
+                                                    @Param("name") String name,
59 60
                                                     @Param("source") Integer source);
60 61
 }

+ 23
- 0
src/main/java/com/yunzhi/marketing/po/LiveAndVideoVO.java Целия файл

@@ -0,0 +1,23 @@
1
+package com.yunzhi.marketing.po;
2
+
3
+import lombok.Data;
4
+
5
+import java.time.LocalDate;
6
+
7
+@Data
8
+public class LiveAndVideoVO {
9
+
10
+    private String title;
11
+
12
+    private LocalDate startTime;
13
+
14
+    private LocalDate endTime;
15
+
16
+    private String buildingName;
17
+
18
+    private String cityName;
19
+
20
+    private String type;
21
+
22
+    private String kind;
23
+}

+ 3
- 2
src/main/java/com/yunzhi/marketing/service/ITaLiveActivityService.java Целия файл

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
5 5
 import com.yunzhi.marketing.base.ResponseBean;
6 6
 import com.yunzhi.marketing.entity.TaLiveActivity;
7 7
 import com.yunzhi.marketing.entity.TaPersonBuilding;
8
+import com.yunzhi.marketing.po.LiveAndVideoVO;
8 9
 
9 10
 import java.util.List;
10 11
 
@@ -73,9 +74,9 @@ public interface ITaLiveActivityService extends IService<TaLiveActivity> {
73 74
      * @param cityId
74 75
      * @param buildingId
75 76
      * @param status
76
-     * @param buildingName
77
+     * @param name
77 78
      * @param source
78 79
      * @return
79 80
      */
80
-    IPage<TaLiveActivity> getWxLiveActivityAndVideo(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle, String cityId, String buildingId, Integer status, Integer buildingName, Integer source);
81
+    IPage<LiveAndVideoVO> getWxLiveActivityAndVideo(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle, String cityId, String buildingId, Integer status, String name, Integer source);
81 82
 }

+ 20
- 4
src/main/java/com/yunzhi/marketing/service/impl/TaLiveActivityServiceImpl.java Целия файл

@@ -10,6 +10,7 @@ import com.yunzhi.marketing.common.CommConstant;
10 10
 import com.yunzhi.marketing.mapper.TaLiveActivityMapper;
11 11
 import com.yunzhi.marketing.mapper.TdLiveDictMapper;
12 12
 import com.yunzhi.marketing.entity.*;
13
+import com.yunzhi.marketing.po.LiveAndVideoVO;
13 14
 import com.yunzhi.marketing.service.IMiniAppService;
14 15
 import com.yunzhi.marketing.service.ITaLiveActivityService;
15 16
 import com.yunzhi.marketing.service.ITaMiniappService;
@@ -21,6 +22,7 @@ import org.slf4j.LoggerFactory;
21 22
 import org.springframework.beans.factory.annotation.Autowired;
22 23
 import org.springframework.stereotype.Service;
23 24
 
25
+import java.time.LocalDate;
24 26
 import java.time.LocalDateTime;
25 27
 import java.util.ArrayList;
26 28
 import java.util.List;
@@ -207,13 +209,27 @@ public class TaLiveActivityServiceImpl extends ServiceImpl<TaLiveActivityMapper,
207 209
      * @param cityId
208 210
      * @param buildingId
209 211
      * @param status
210
-     * @param buildingName
212
+     * @param name
211 213
      * @param source
212 214
      * @return
213 215
      */
214 216
     @Override
215
-    public IPage<TaLiveActivity> getWxLiveActivityAndVideo(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle, String cityId, String buildingId, Integer status, Integer buildingName, Integer source) {
216
-        IPage<TaLiveActivity> pg = new Page<>(pageNum, pageSize);
217
-        return taLiveActivityMapper.getWxLiveActivityAndVideo(pg, liveActivityTitle, cityId, buildingId, status, orgId, buildingName, source);
217
+    public IPage<LiveAndVideoVO> getWxLiveActivityAndVideo(Integer pageNum, Integer pageSize, Integer orgId, String liveActivityTitle, String cityId, String buildingId, Integer status, String name, Integer source) {
218
+        IPage<LiveAndVideoVO> pg = new Page<>(pageNum, pageSize);
219
+        IPage<LiveAndVideoVO> wxLiveActivityAndVideo = taLiveActivityMapper.getWxLiveActivityAndVideo(pg, liveActivityTitle, cityId, buildingId, status, orgId, name, source);
220
+        List<LiveAndVideoVO> records = wxLiveActivityAndVideo.getRecords();
221
+        records.forEach(e -> {
222
+            if ("live".equals(e.getType())){
223
+                LocalDate now = LocalDate.now();
224
+                if (e.getStartTime().isBefore(now)){
225
+                    e.setKind("notice");
226
+                }else if (e.getStartTime().isBefore(now) && e.getEndTime().isAfter(now)){
227
+                    e.setKind("live");
228
+                }else {
229
+                    e.setKind("end");
230
+                }
231
+            }
232
+        });
233
+        return wxLiveActivityAndVideo;
218 234
     }
219 235
 }

+ 23
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/VideoController.java Целия файл

@@ -7,8 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 7
 import com.yunzhi.marketing.base.BaseController;
8 8
 import com.yunzhi.marketing.base.ResponseBean;
9 9
 import com.yunzhi.marketing.common.StringUtils;
10
+import com.yunzhi.marketing.entity.TaPerson;
11
+import com.yunzhi.marketing.xlk.dto.SearchHouseDTO;
10 12
 import com.yunzhi.marketing.xlk.dto.VideoDTO;
11 13
 import com.yunzhi.marketing.xlk.entity.Brand;
14
+import com.yunzhi.marketing.xlk.entity.SearchHouse;
12 15
 import com.yunzhi.marketing.xlk.entity.Video;
13 16
 import com.yunzhi.marketing.xlk.service.IVideoService;
14 17
 import io.swagger.annotations.Api;
@@ -17,6 +20,7 @@ import org.slf4j.Logger;
17 20
 import org.slf4j.LoggerFactory;
18 21
 import org.springframework.beans.BeanUtils;
19 22
 import org.springframework.beans.factory.annotation.Autowired;
23
+import org.springframework.web.bind.annotation.GetMapping;
20 24
 import org.springframework.web.bind.annotation.PathVariable;
21 25
 import org.springframework.web.bind.annotation.RequestBody;
22 26
 import org.springframework.web.bind.annotation.RequestHeader;
@@ -28,6 +32,7 @@ import org.springframework.web.bind.annotation.RestController;
28 32
 
29 33
 import javax.servlet.http.HttpServletRequest;
30 34
 import java.time.LocalDateTime;
35
+import java.util.List;
31 36
 
32 37
 /**
33 38
  * <p>
@@ -203,4 +208,22 @@ public class VideoController extends BaseController {
203 208
     }
204 209
 
205 210
 
211
+    /**
212
+     * 保存对象
213
+     * @param
214
+     * @return
215
+     */
216
+    @ApiOperation(value = "wx-查询视频详情", notes = "wx-查询视频详情")
217
+    @GetMapping(value="/wx/detail/{id}")
218
+    public ResponseBean searchHouseAdd(@PathVariable String id, @RequestHeader("authorization") String token, HttpServletRequest request){
219
+        Video video = iVideoService.getById(id);
220
+        if (null == video.getLookNum()){
221
+            video.setLookNum(1);
222
+        }else {
223
+            video.setLookNum(video.getLookNum() + 1);
224
+        }
225
+        iVideoService.updateById(video);
226
+        return ResponseBean.success(video);
227
+    }
228
+
206 229
 }

+ 18
- 6
src/main/resources/mapper/TaLiveActivityMapper.xml Целия файл

@@ -71,27 +71,39 @@
71 71
         where t.live_activity_id = #{id}
72 72
     </select>
73 73
 
74
-    <select id="getWxLiveActivityAndVideo" resultType="com.yunzhi.marketing.entity.TaLiveActivity">
74
+    <select id="getWxLiveActivityAndVideo" resultType="com.yunzhi.marketing.po.LiveAndVideoVO">
75 75
         SELECT
76 76
             t.live_activity_title AS title,
77
-            t.live_start_date AS startTime,
78
-            t.live_end_date AS endTime,
77
+            t.live_start_date AS start_time,
78
+            t.live_end_date AS end_time,
79 79
             a.building_name,
80
-            b.NAME AS city_name
80
+            b.NAME AS city_name,
81
+            "live" as type
81 82
         FROM
82 83
             ta_live_activity t
83 84
             LEFT JOIN ta_building a ON t.building_id = a.building_id
84
-            LEFT JOIN td_city b ON t.city_id = b.id UNION
85
+            LEFT JOIN td_city b ON t.city_id = b.id
86
+            where 1=1
87
+        <if test="name != null and name != ''">
88
+            and (t.live_activity_title like CONCAT('%', #{name}, '%')
89
+            or a.building_name like CONCAT('%', #{name}, '%'))
90
+        </if>
91
+    UNION
85 92
         SELECT
86 93
             t.NAME AS title,
87 94
             t.CREATED_TIME AS startTime,
88 95
             t.CREATED_TIME AS endTime,
89 96
             a.building_name,
90
-            b.NAME AS city_name
97
+            b.NAME AS city_name,
98
+            "video" as type
91 99
         FROM
92 100
             xlk_video t
93 101
             LEFT JOIN ta_building a ON t.building_id = a.building_id
94 102
             LEFT JOIN td_city b ON t.city_id = b.id
103
+        where 1=1
104
+        <if test="name != null and name != ''">
105
+            and (t.NAME like CONCAT('%', #{name}, '%') or a.building_name like CONCAT('%', #{name}, '%'))
106
+        </if>
95 107
     </select>
96 108
 
97 109
 </mapper>

+ 1
- 0
z-problem.txt Целия файл

@@ -0,0 +1 @@
1
+1.视频直播界面已经结束的直播要展示出来么?状态是已结束?