Procházet zdrojové kódy

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents into dev

# Conflicts:
#	src/main/resources/mapper/TaLiveActivityMapper.xml
傅行帆 před 5 roky
rodič
revize
7c065c7b7e

+ 1
- 0
src/main/java/com/huiju/estateagents/common/CommConstant.java Zobrazit soubor

@@ -440,6 +440,7 @@ public class CommConstant {
440 440
 	public static final Object GROUP_ACTIVITY = "groupActivity";
441 441
 	public static final String TARGET_TYPE_H5 = "H5";
442 442
     public static final String ACTIVITY_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"pages/checkin/index\"}";
443
+    public static final String LIVE_ACTIVITY_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"onlineSelling/pages/live/index\"}";
443 444
     public static final String DRAINAGE_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"pages/project/h5Page\"}";
444 445
     public static final String HOUSE_QRCODE = "{\"scene\":\"id=#0&type=#1\",\"page\":\"onlineSelling/pages/houseList/index\"}";
445 446
     

+ 26
- 0
src/main/java/com/huiju/estateagents/controller/TaLiveActivityController.java Zobrazit soubor

@@ -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 {

+ 9
- 4
src/main/java/com/huiju/estateagents/entity/TaLiveActivity.java Zobrazit soubor

@@ -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
      * 创建时间
@@ -147,14 +148,18 @@ public class TaLiveActivity implements Serializable {
147 148
     @TableField(exist = false)
148 149
     private String cityName;
149 150
 
151
+    /**
152
+     * 直播app名称
153
+     */
150 154
     @TableField(exist = false)
151 155
     private String liveAppName;
152 156
 
157
+    /**
158
+     * 直播app小程序appid
159
+     */
153 160
     @TableField(exist = false)
154 161
     private String liveAppAppId;
155 162
 
156
-    @TableField(exist = false)
157 163
     private String liveAppPath;
158 164
 
159
-
160 165
 }

+ 6
- 5
src/main/java/com/huiju/estateagents/service/impl/TaLiveActivityServiceImpl.java Zobrazit soubor

@@ -68,6 +68,10 @@ public class TaLiveActivityServiceImpl extends ServiceImpl<TaLiveActivityMapper,
68 68
         taLiveActivity.setVisitNum(0);
69 69
         taLiveActivity.setCreateDate(LocalDateTime.now());
70 70
         taLiveActivity.setUpdateDate(LocalDateTime.now());
71
+        if (StringUtils.isNotBlank(taLiveActivity.getLiveRoomParam())) {
72
+            taLiveActivity.setLiveAppPath(taLiveActivity.getLiveRoomParam().replace(".html", ""));
73
+        }
74
+
71 75
         Boolean result = save(taLiveActivity);
72 76
         if (!result) {
73 77
             responseBean.addError("fail");
@@ -78,11 +82,8 @@ public class TaLiveActivityServiceImpl extends ServiceImpl<TaLiveActivityMapper,
78 82
         QueryWrapper<TaMiniapp> taMiniappQuery = new QueryWrapper<>();
79 83
         taMiniappQuery.eq("org_id", taLiveActivity.getOrgId());
80 84
         TaMiniapp taMiniapp = taMiniappService.getOne(taMiniappQuery);
81
-        /**
82
-         *  TODO 部分信息待修改
83
-         */
84 85
         ResponseBean taMiniappQrcode = miniAppService.getQrCode
85
-                (CommConstant.ACTIVITY_QRCODE.replace("#0", taLiveActivity.getLiveActivityId().toString())
86
+                (CommConstant.LIVE_ACTIVITY_QRCODE.replace("#0", taLiveActivity.getLiveActivityId().toString())
86 87
                         .replace("#1", "live"), taMiniapp.getMiniappId());
87 88
         taLiveActivity.setQrCode(String.valueOf(taMiniappQrcode.getData()));
88 89
         updateById(taLiveActivity);
@@ -144,7 +145,7 @@ public class TaLiveActivityServiceImpl extends ServiceImpl<TaLiveActivityMapper,
144 145
         tdLiveDictQueryWrapper.eq("id", result.getLiveApp());
145 146
         tdLiveDictQueryWrapper.eq("status", "1");
146 147
         TdLiveDict tdLiveDict = tdLiveDictMapper.selectOne(tdLiveDictQueryWrapper);
147
-        if(tdLiveDict == null){
148
+        if (tdLiveDict == null) {
148 149
             responseBean.addSuccess(null);
149 150
             return responseBean;
150 151
         }

+ 2
- 1
src/main/resources/mapper/TaLiveActivityMapper.xml Zobrazit soubor

@@ -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 != ''">
@@ -43,6 +43,7 @@
43 43
             #{personBuilding.buildingId}
44 44
         </foreach>
45 45
     </if>
46
+        order by t.weight desc
46 47
     </select>
47 48
 
48 49
 </mapper>