Ver código fonte

Merge remote-tracking branch 'origin/dev' into dev

顾绍勇 5 anos atrás
pai
commit
6134dcd7bb

+ 2
- 2
src/main/java/com/huiju/estateagents/controller/TaChannelController.java Ver arquivo

@@ -331,7 +331,7 @@ public class TaChannelController extends BaseController {
331 331
     @GetMapping(value = "/admin/channel/introductionListExport")
332 332
     public void getChannelIntroductionListExport(@RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDate startDate,
333 333
                                                          @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDate endDate,
334
-                                                         @RequestParam(value = "channelType", required = false)String channelType,
334
+                                                         @RequestParam(value = "targetType", required = false)String targetType,
335 335
                                                          @RequestParam(value = "buildingId", required = false)String buildingId,
336 336
                                                          @RequestParam(value = "channelId") Integer channelId,
337 337
                                                          HttpServletRequest request, HttpServletResponse response) throws IOException {
@@ -341,7 +341,7 @@ public class TaChannelController extends BaseController {
341 341
         ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), TsChannelDaily.class).registerWriteHandler(new CustomCellWriteHandler()).build();
342 342
         // 设置 sheet, 同一个sheet只需要设置一次
343 343
         WriteSheet writeSheet = EasyExcel.writerSheet("引进注册用户").build();
344
-        List<TsChannelDaily> data = taChannelService.getChannelIntroductionListExport(getOrgId(request), startDate, endDate, channelType, buildingId, channelId);
344
+        List<TsChannelDaily> data = taChannelService.getChannelIntroductionListExport(getOrgId(request), startDate, endDate, targetType, buildingId, channelId, getTaPersonBuildingListByUserId(request));
345 345
         excelWriter.write(data, writeSheet);
346 346
         // finish 会帮忙关闭流
347 347
         excelWriter.finish();

+ 11
- 18
src/main/java/com/huiju/estateagents/drainage/controller/TaDrainageController.java Ver arquivo

@@ -1,23 +1,5 @@
1 1
 package com.huiju.estateagents.drainage.controller;
2 2
 
3
-import java.time.LocalDateTime;
4
-import java.util.List;
5
-import java.util.UUID;
6
-import java.util.stream.Collectors;
7
-
8
-import javax.servlet.http.HttpServletRequest;
9
-
10
-import org.slf4j.Logger;
11
-import org.slf4j.LoggerFactory;
12
-import org.springframework.beans.factory.annotation.Autowired;
13
-import org.springframework.web.bind.annotation.PathVariable;
14
-import org.springframework.web.bind.annotation.RequestBody;
15
-import org.springframework.web.bind.annotation.RequestMapping;
16
-import org.springframework.web.bind.annotation.RequestMethod;
17
-import org.springframework.web.bind.annotation.RequestParam;
18
-import org.springframework.web.bind.annotation.ResponseBody;
19
-import org.springframework.web.bind.annotation.RestController;
20
-
21 3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
22 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
23 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -38,6 +20,16 @@ import com.huiju.estateagents.service.IExtendContentService;
38 20
 import com.huiju.estateagents.service.IMiniAppService;
39 21
 import com.huiju.estateagents.third.entity.TaThirdPartyMiniappConfig;
40 22
 import com.huiju.estateagents.third.service.ITaThirdPartyMiniappConfigService;
23
+import org.slf4j.Logger;
24
+import org.slf4j.LoggerFactory;
25
+import org.springframework.beans.factory.annotation.Autowired;
26
+import org.springframework.web.bind.annotation.*;
27
+
28
+import javax.servlet.http.HttpServletRequest;
29
+import java.time.LocalDateTime;
30
+import java.util.List;
31
+import java.util.UUID;
32
+import java.util.stream.Collectors;
41 33
 
42 34
 
43 35
 /**
@@ -100,6 +92,7 @@ public class TaDrainageController extends BaseController {
100 92
             }
101 93
             queryWrapper.eq(null != status,"status",status);
102 94
             queryWrapper.eq(!StringUtils.isEmpty(buildingId),"building_id",buildingId);
95
+            queryWrapper.isNull(StringUtils.isEmpty(buildingId),"building_id");
103 96
             queryWrapper.eq(null != drainageId,"drainage_id",drainageId);
104 97
             queryWrapper.and(taPersonBuildingList.size() > 0, wapper -> wapper.in("building_id",taPersonBuildingList.stream().map(TaPersonBuilding::getBuildingId).collect(Collectors.toList())).or().eq("create_user",getUserId(request)));
105 98
             queryWrapper.like(!StringUtils.isEmpty(name),"name",name);

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaChannelMapper.java Ver arquivo

@@ -65,7 +65,7 @@ public interface TaChannelMapper extends BaseMapper<TaChannel> {
65 65
 
66 66
     IPage<ChannelVisitPersonNum> getChannelPersonNumList(IPage<ChannelVisitPersonNum> iPage,@Param("orgId") Integer orgId,@Param("channelId") Integer channelId,@Param("targetId") String targetId,@Param("targetType") String targetType,@Param("buildingId") String buildingId,@Param("startDate") LocalDate startDate,@Param("endDate") LocalDate endDate);
67 67
 
68
-    List<TsChannelDaily> getChannelIntroductionListExport(@Param("orgId") Integer orgId,@Param("startDate") LocalDate startDate,@Param("endDate") LocalDate endDate,@Param("channelType") String channelType,@Param("buildingId") String buildingId,@Param("channelId") Integer channelId);
68
+    List<TsChannelDaily> getChannelIntroductionListExport(@Param("orgId") Integer orgId,@Param("startDate") LocalDate startDate,@Param("endDate") LocalDate endDate,@Param("channelType") String channelType,@Param("buildingId") String buildingId,@Param("channelId") Integer channelId,@Param("taPersonBuildings") List<TaPersonBuilding> taPersonBuildings);
69 69
 
70 70
     List<ChannelAddRegistNum> getChannelNewuserListExport( @Param("orgId") Integer orgId, @Param("channelId") Integer channelId, @Param("activityId") String activityId, @Param("activityType") String activityType, @Param("buildingId") String buildingId,@Param("startDate") LocalDate startDate,@Param("endDate") LocalDate endDate);
71 71
 

+ 1
- 1
src/main/java/com/huiju/estateagents/service/TaChannelService.java Ver arquivo

@@ -84,7 +84,7 @@ public interface TaChannelService extends IService<TaChannel> {
84 84
      * @param channelId
85 85
      * @return
86 86
      */
87
-    List<TsChannelDaily> getChannelIntroductionListExport(Integer orgId, LocalDate startDate, LocalDate endDate, String channelType, String buildingId, Integer channelId);
87
+    List<TsChannelDaily> getChannelIntroductionListExport(Integer orgId, LocalDate startDate, LocalDate endDate, String channelType, String buildingId, Integer channelId, List<TaPersonBuilding> taPersonBuildings);
88 88
 
89 89
     /**
90 90
      * 导出

+ 0
- 1
src/main/java/com/huiju/estateagents/service/impl/ExtendContentServiceImpl.java Ver arquivo

@@ -188,7 +188,6 @@ public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, E
188 188
             taExtendContentQueryWrapper.eq("status", 1);
189 189
             taExtendContentQueryWrapper.eq("show_type", extendContent.getShowType());
190 190
             taExtendContentQueryWrapper.eq("show_position", extendContent.getShowPosition());
191
-            taExtendContentQueryWrapper.eq(StringUtils.isNotBlank(String.valueOf(extendContent.getIsHaveActive())), "is_have_active", extendContent.getIsHaveActive());
192 191
             if (null != extendContent.getContentId()){
193 192
                 taExtendContentQueryWrapper.ne("content_id", extendContent.getContentId());
194 193
             }

+ 4
- 4
src/main/java/com/huiju/estateagents/service/impl/TaChannelServiceImpl.java Ver arquivo

@@ -132,12 +132,12 @@ public class TaChannelServiceImpl extends ServiceImpl<TaChannelMapper, TaChannel
132 132
      * @return
133 133
      */
134 134
     @Override
135
-    public List<TsChannelDaily> getChannelIntroductionListExport(Integer orgId, LocalDate startDate, LocalDate endDate, String channelType, String buildingId, Integer channelId) {
136
-        List<TsChannelDaily> channelIntroductionListExport = taChannelMapper.getChannelIntroductionListExport(orgId, startDate, endDate, channelType, buildingId, channelId);
135
+    public List<TsChannelDaily> getChannelIntroductionListExport(Integer orgId, LocalDate startDate, LocalDate endDate, String channelType, String buildingId, Integer channelId, List<TaPersonBuilding> taPersonBuildings) {
136
+        List<TsChannelDaily> channelIntroductionListExport = taChannelMapper.getChannelIntroductionListExport(orgId, startDate, endDate, channelType, buildingId, channelId,taPersonBuildings);
137 137
         channelIntroductionListExport.forEach(e -> {
138 138
             String message = "";
139 139
             switch (e.getTargetType()){
140
-                case "project":
140
+                case "building":
141 141
                     message = "项目";
142 142
                     break;
143 143
                 case "activity":
@@ -159,7 +159,7 @@ public class TaChannelServiceImpl extends ServiceImpl<TaChannelMapper, TaChannel
159 159
                     message = "资讯";
160 160
                     break;
161 161
                 case "house":
162
-                    message = "销售批次";
162
+                    message = "在线选房";
163 163
                     break;
164 164
             }
165 165
             e.setTargetType(message);

+ 27
- 5
src/main/resources/mapper/TaChannelMapper.xml Ver arquivo

@@ -160,7 +160,7 @@
160 160
         FROM
161 161
         ta_person_visit_record t
162 162
         WHERE
163
-        t.`event` in ( 'detail', 'house_list' )
163
+        t.`event` in ( 'detail', 'house_list' , 'poster')
164 164
         AND t.event_type IN (
165 165
         'activity',
166 166
         'help',
@@ -216,7 +216,7 @@
216 216
         FROM
217 217
         ta_person_visit_record t
218 218
         WHERE
219
-        t.`event` in ( 'detail', 'house_list' )
219
+        t.`event` in ( 'detail', 'house_list' , 'poster')
220 220
         AND t.event_type IN (
221 221
         'activity',
222 222
         'help',
@@ -256,7 +256,22 @@
256 256
     <select id="getChannelIntroductionListExport"
257 257
             resultType="com.huiju.estateagents.excel.ActivityStatistics.TsChannelDaily">
258 258
         SELECT
259
-        *
259
+        serial_no,
260
+        statis_date,
261
+        org_id,
262
+        building_id,
263
+        building_name,
264
+        target_id,
265
+        target_type,
266
+        target_name,
267
+        sum( share_num ) AS share_num,
268
+        sum( share_persons ) AS share_persons,
269
+        sum( visit_num ) AS visit_num,
270
+        sum( visit_persons ) AS visit_persons,
271
+        sum( new_persons ) AS new_persons,
272
+        sum( new_customers ) AS new_customers,
273
+        qr_code_id,
274
+        channel_id
260 275
         FROM
261 276
         ts_channel_daily
262 277
         WHERE
@@ -271,6 +286,13 @@
271 286
         <if test="buildingId != null and buildingId != ''">
272 287
             and building_id = #{buildingId}
273 288
         </if>
289
+        <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
290
+            and building_id in
291
+            <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
292
+                #{taPersonBuilding.buildingId}
293
+            </foreach>
294
+        </if>
295
+        GROUP BY   target_id, target_type
274 296
     </select>
275 297
     <select id="getChannelNewuserListExport"
276 298
             resultType="com.huiju.estateagents.excel.ActivityStatistics.ChannelAddRegistNum">
@@ -322,7 +344,7 @@
322 344
         FROM
323 345
         ta_person_visit_record t
324 346
         WHERE
325
-        t.`event` in ( 'detail', 'house_list' )
347
+        t.`event` in ( 'detail', 'house_list', 'poster' )
326 348
         AND t.event_type IN (
327 349
         'activity',
328 350
         'help',
@@ -378,7 +400,7 @@
378 400
         FROM
379 401
         ta_person_visit_record t
380 402
         WHERE
381
-        t.`event` in ( 'detail', 'house_list' )
403
+        t.`event` in ( 'detail', 'house_list', 'poster' )
382 404
         AND t.event_type IN (
383 405
         'activity',
384 406
         'help',

+ 3
- 0
src/main/resources/mapper/TaLiveActivityMapper.xml Ver arquivo

@@ -39,6 +39,9 @@
39 39
      </if><if test="buildingId != null and buildingId != ''">
40 40
          and t.building_id = #{buildingId}
41 41
     </if>
42
+    <if test="buildingId == null or buildingId == ''">
43
+        and t.building_id is null
44
+    </if>
42 45
     <if test="personBuildingList != null and personBuildingList.size > 0">
43 46
         AND (t.building_id in
44 47
         <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">