Browse Source

首页 用户来源统计

傅行帆 5 years ago
parent
commit
f948f4dbfd

+ 10
- 0
src/main/java/com/huiju/estateagents/controller/StatisticalController.java View File

163
         return iStatisticalService.selectIntentionUser(pageNum, pageSize, getOrgId(request), buildingId);
163
         return iStatisticalService.selectIntentionUser(pageNum, pageSize, getOrgId(request), buildingId);
164
     }
164
     }
165
 
165
 
166
+    /**
167
+     * 用户来源  首页
168
+     * @return
169
+     */
170
+    @GetMapping(value = "/admin/selectPersonFrom")
171
+    public ResponseBean selectPersonFrom(@RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDate startDate,
172
+                                         @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDate endDate,
173
+                                            HttpServletRequest request) {
174
+        return iStatisticalService.selectPersonFrom(getOrgId(request), startDate,endDate);
175
+    }
166
 }
176
 }

+ 9
- 0
src/main/java/com/huiju/estateagents/service/IStatisticalService.java View File

106
      * @return
106
      * @return
107
      */
107
      */
108
     ResponseBean selectIntentionUser(Integer pageNum, Integer pageSize, Integer orgId, String buildingId);
108
     ResponseBean selectIntentionUser(Integer pageNum, Integer pageSize, Integer orgId, String buildingId);
109
+
110
+    /**
111
+     * 用户来源数据 首页
112
+     * @param orgId
113
+     * @param startDate
114
+     * @param endDate
115
+     * @return
116
+     */
117
+    ResponseBean selectPersonFrom(Integer orgId, LocalDate startDate, LocalDate endDate);
109
 }
118
 }

+ 19
- 0
src/main/java/com/huiju/estateagents/service/impl/StatisticalServiceImpl.java View File

9
 import com.huiju.estateagents.mapper.*;
9
 import com.huiju.estateagents.mapper.*;
10
 import com.huiju.estateagents.po.PersonPO;
10
 import com.huiju.estateagents.po.PersonPO;
11
 import com.huiju.estateagents.service.IStatisticalService;
11
 import com.huiju.estateagents.service.IStatisticalService;
12
+import com.huiju.estateagents.statistic.entity.TsPersonFromStatistic;
13
+import com.huiju.estateagents.statistic.mapper.TsPersonFromStatisticMapper;
12
 import lombok.extern.slf4j.Slf4j;
14
 import lombok.extern.slf4j.Slf4j;
13
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.beans.factory.annotation.Autowired;
14
 import org.springframework.stereotype.Service;
16
 import org.springframework.stereotype.Service;
42
     @Autowired
44
     @Autowired
43
     private TaPersonIntentionRecordMapper taPersonIntentionRecordMapper;
45
     private TaPersonIntentionRecordMapper taPersonIntentionRecordMapper;
44
 
46
 
47
+    @Autowired
48
+    private TsPersonFromStatisticMapper tsPersonFromStatisticMapper;
49
+
45
 
50
 
46
     @Override
51
     @Override
47
     public ResponseBean indexStatistical(Integer orgId) {
52
     public ResponseBean indexStatistical(Integer orgId) {
302
         responseBean.addSuccess(page);
307
         responseBean.addSuccess(page);
303
         return responseBean;
308
         return responseBean;
304
     }
309
     }
310
+
311
+    /**
312
+     * 用户来源数据 首页
313
+     *
314
+     * @param orgId
315
+     * @param startDate
316
+     * @param endDate
317
+     * @return
318
+     */
319
+    @Override
320
+    public ResponseBean selectPersonFrom(Integer orgId, LocalDate startDate, LocalDate endDate) {
321
+        List<TsPersonFromStatistic> list = tsPersonFromStatisticMapper.selectPersonFrom(orgId,startDate,endDate);
322
+        return null;
323
+    }
305
 }
324
 }

+ 3
- 0
src/main/java/com/huiju/estateagents/statistic/mapper/TsPersonFromStatisticMapper.java View File

4
 import com.huiju.estateagents.statistic.entity.TsPersonFromStatistic;
4
 import com.huiju.estateagents.statistic.entity.TsPersonFromStatistic;
5
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Mapper;
6
 
6
 
7
+import java.time.LocalDate;
7
 import java.util.List;
8
 import java.util.List;
8
 
9
 
9
 /**
10
 /**
18
 public interface TsPersonFromStatisticMapper extends BaseMapper<TsPersonFromStatistic> {
19
 public interface TsPersonFromStatisticMapper extends BaseMapper<TsPersonFromStatistic> {
19
 
20
 
20
     void insertStatisticList(List<TsPersonFromStatistic> list);
21
     void insertStatisticList(List<TsPersonFromStatistic> list);
22
+
23
+    List<TsPersonFromStatistic> selectPersonFrom(Integer orgId, LocalDate startDate, LocalDate endDate);
21
 }
24
 }

+ 13
- 0
src/main/resources/mapper/statistic/TsPersonFromStatisticMapper.xml View File

9
             (#{item.sceneType},#{item.eventType},#{item.fromNum},#{item.orgId},#{item.createDate},#{item.registeredNum})
9
             (#{item.sceneType},#{item.eventType},#{item.fromNum},#{item.orgId},#{item.createDate},#{item.registeredNum})
10
         </foreach>
10
         </foreach>
11
     </insert>
11
     </insert>
12
+    <select id="selectPersonFrom" resultType="com.huiju.estateagents.statistic.entity.TsPersonFromStatistic">
13
+        SELECT
14
+            *
15
+        FROM
16
+        ta_person_from_record tp
17
+        where tp.org_id = #{org}
18
+        <if test="startDate != null or endDate != null">
19
+            AND  tp.create_date BETWEEN #{startDate} and #{endDate}
20
+        </if>
21
+        <if test="startDate == null or endDate == null">
22
+            AND tp.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
23
+        </if>
24
+    </select>
12
 </mapper>
25
 </mapper>