|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
4
|
4
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
5
|
5
|
import com.huiju.estateagents.base.ResponseBean;
|
6
|
6
|
import com.huiju.estateagents.common.StringUtils;
|
|
7
|
+import com.huiju.estateagents.entity.TaPersonBuilding;
|
7
|
8
|
import com.huiju.estateagents.excel.ActivityStatistics.*;
|
8
|
9
|
import com.huiju.estateagents.statistic.mapper.TaActicityStaticMapper;
|
9
|
10
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -22,18 +23,18 @@ public class TaActivityStaticServiceImpl {
|
22
|
23
|
@Autowired
|
23
|
24
|
private TaActicityStaticMapper taActicityStaticMapper;
|
24
|
25
|
|
25
|
|
- public ResponseBean activityStatistical(LocalDate startDate, LocalDate endDate, String building, String targetType, Integer orgId){
|
|
26
|
+ public ResponseBean activityStatistical(LocalDate startDate, LocalDate endDate, String building, String targetType, Integer orgId, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
26
|
27
|
|
27
|
28
|
ResponseBean responseBean = new ResponseBean();
|
28
|
29
|
Map<String, Object> map = new HashMap<>();
|
29
|
30
|
|
30
|
|
- Integer sharePersonNum = taActicityStaticMapper.selectSharePersonNum(LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), building, targetType, orgId);
|
|
31
|
+ Integer sharePersonNum = taActicityStaticMapper.selectSharePersonNum(LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), building, targetType, orgId, taPersonBuildings, userId);
|
31
|
32
|
|
32
|
|
- Integer shareNum = taActicityStaticMapper.selectShareNum(LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), building, targetType, orgId);
|
|
33
|
+ Integer shareNum = taActicityStaticMapper.selectShareNum(LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), building, targetType, orgId, taPersonBuildings, userId);
|
33
|
34
|
|
34
|
|
- Integer visitPersonNum = taActicityStaticMapper.selectVisitPersonNum(LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), building, targetType, orgId);
|
|
35
|
+ Integer visitPersonNum = taActicityStaticMapper.selectVisitPersonNum(LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), building, targetType, orgId, taPersonBuildings, userId);
|
35
|
36
|
|
36
|
|
- Integer visitNum = taActicityStaticMapper.selectVisitNum(LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), building, targetType, orgId);
|
|
37
|
+ Integer visitNum = taActicityStaticMapper.selectVisitNum(LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), building, targetType, orgId, taPersonBuildings, userId);
|
37
|
38
|
|
38
|
39
|
map.put("sharePersonNum", sharePersonNum);
|
39
|
40
|
map.put("shareNum", shareNum);
|
|
@@ -45,12 +46,12 @@ public class TaActivityStaticServiceImpl {
|
45
|
46
|
return responseBean;
|
46
|
47
|
}
|
47
|
48
|
|
48
|
|
- public ResponseBean selectAllActivityUser(Integer orgId, LocalDate startDate, LocalDate endDate, String buildingId, String targetType){
|
|
49
|
+ public ResponseBean selectAllActivityUser(Integer orgId, LocalDate startDate, LocalDate endDate, String buildingId, String targetType, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
49
|
50
|
ResponseBean responseBean = new ResponseBean();
|
50
|
51
|
|
51
|
52
|
// 新增用户数
|
52
|
|
- List<Map<String, Object>> selectShareCount = taActicityStaticMapper.selectShareCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType);
|
53
|
|
- List<Map<String, Object>> selectSharePersonCount = taActicityStaticMapper.selectSharePersonCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType);
|
|
53
|
+ List<Map<String, Object>> selectShareCount = taActicityStaticMapper.selectShareCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, taPersonBuildings, userId);
|
|
54
|
+ List<Map<String, Object>> selectSharePersonCount = taActicityStaticMapper.selectSharePersonCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, taPersonBuildings, userId);
|
54
|
55
|
List<Map<String, Object>> selectVisitCount = taActicityStaticMapper.selectVisitCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType);
|
55
|
56
|
List<Map<String, Object>> selectVisitPersonCount = taActicityStaticMapper.selectVisitPersonCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType);
|
56
|
57
|
List<Map<String, Object>> selectAddRegistCount = taActicityStaticMapper.selectAddRegistCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType);
|
|
@@ -90,64 +91,64 @@ public class TaActivityStaticServiceImpl {
|
90
|
91
|
return responseBean;
|
91
|
92
|
}
|
92
|
93
|
|
93
|
|
- public ResponseBean selectTableData(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String buildingId, String targetType, String sort, String colKey){
|
|
94
|
+ public ResponseBean selectTableData(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String buildingId, String targetType, String sort, String colKey, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
94
|
95
|
IPage<StatisicAttractUser> iPage = new Page<>(pageNum, pageSize);
|
95
|
96
|
String sortType = "ascend".equals(sort) ? "asc" : "desc";
|
96
|
|
- IPage<StatisicAttractUser> data = taActicityStaticMapper.selectTableData(iPage, orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, sortType, colKey);
|
|
97
|
+ IPage<StatisicAttractUser> data = taActicityStaticMapper.selectTableData(iPage, orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, sortType, colKey, taPersonBuildings, userId);
|
97
|
98
|
return ResponseBean.success(data);
|
98
|
99
|
}
|
99
|
100
|
|
100
|
|
- public List<StatisicAttractUser> selectExportTableData(Integer orgId, LocalDate startDate, LocalDate endDate, String buildingId, String targetType, String sort, String colKey){
|
|
101
|
+ public List<StatisicAttractUser> selectExportTableData(Integer orgId, LocalDate startDate, LocalDate endDate, String buildingId, String targetType, String sort, String colKey, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
101
|
102
|
String sortType = "ascend".equals(sort) ? "asc" : "desc";
|
102
|
|
- return taActicityStaticMapper.selectExportTableData(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, sortType, colKey);
|
|
103
|
+ return taActicityStaticMapper.selectExportTableData(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, sortType, colKey, taPersonBuildings, userId);
|
103
|
104
|
}
|
104
|
105
|
|
105
|
|
- public ResponseBean selectActivityStatisDetail(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String buildingId, String targetType, String activityName, String sort, String colKey){
|
|
106
|
+ public ResponseBean selectActivityStatisDetail(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String buildingId, String targetType, String activityName, String sort, String colKey, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
106
|
107
|
IPage<ActivityDetailShareRecord> iPage = new Page<>(pageNum, pageSize);
|
107
|
108
|
String sortType = "ascend".equals(sort) ? "asc" : "desc";
|
108
|
|
- IPage<ActivityDetailShareRecord> data = taActicityStaticMapper.selectActivityStatisDetail(iPage, orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, activityName, sortType, colKey);
|
|
109
|
+ IPage<ActivityDetailShareRecord> data = taActicityStaticMapper.selectActivityStatisDetail(iPage, orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, activityName, sortType, colKey, taPersonBuildings, userId);
|
109
|
110
|
return ResponseBean.success(data);
|
110
|
111
|
}
|
111
|
112
|
|
112
|
|
- public List<ActivityDetailShareRecord> selectActivityStatisDetailExport(Integer orgId, LocalDate startDate, LocalDate endDate, String buildingId, String targetType, String activityName, String sort, String colKey){
|
|
113
|
+ public List<ActivityDetailShareRecord> selectActivityStatisDetailExport(Integer orgId, LocalDate startDate, LocalDate endDate, String buildingId, String targetType, String activityName, String sort, String colKey, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
113
|
114
|
String sortType = "ascend".equals(sort) ? "asc" : "desc";
|
114
|
|
- return taActicityStaticMapper.selectActivityStatisDetailExport(orgId, startDate, endDate, buildingId, targetType, activityName, sortType, colKey);
|
|
115
|
+ return taActicityStaticMapper.selectActivityStatisDetailExport(orgId, startDate, endDate, buildingId, targetType, activityName, sortType, colKey, taPersonBuildings, userId);
|
115
|
116
|
}
|
116
|
117
|
|
117
|
|
- public ResponseBean selectActivitySharePersonNum(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String sharePersonType, String sharePersonName, String sharePhone, String activityId, String activityType, String buildingId, String sort, String colKey){
|
|
118
|
+ public ResponseBean selectActivitySharePersonNum(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String sharePersonType, String sharePersonName, String sharePhone, String activityId, String activityType, String buildingId, String sort, String colKey, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
118
|
119
|
IPage<SharePersonNum> iPage = new Page<>(pageNum, pageSize);
|
119
|
120
|
String sortType = "ascend".equals(sort) ? "asc" : "desc";
|
120
|
121
|
|
121
|
|
- IPage<SharePersonNum> data = taActicityStaticMapper.selectActivitySharePersonNum(iPage, orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), sharePersonType, sharePersonName, sharePhone, activityId, activityType, buildingId, sortType, colKey);
|
|
122
|
+ IPage<SharePersonNum> data = taActicityStaticMapper.selectActivitySharePersonNum(iPage, orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), sharePersonType, sharePersonName, sharePhone, activityId, activityType, buildingId, sortType, colKey, taPersonBuildings, userId);
|
122
|
123
|
return ResponseBean.success(data);
|
123
|
124
|
}
|
124
|
125
|
|
125
|
|
- public List<SharePersonNum> selectActivitySharePersonNumExport(Integer orgId, LocalDate startDate, LocalDate endDate, String sharePersonType, String sharePersonName, String sharePhone, String activityId, String activityType, String buildingId, String sort, String colKey){
|
|
126
|
+ public List<SharePersonNum> selectActivitySharePersonNumExport(Integer orgId, LocalDate startDate, LocalDate endDate, String sharePersonType, String sharePersonName, String sharePhone, String activityId, String activityType, String buildingId, String sort, String colKey, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
126
|
127
|
String sortType = "ascend".equals(sort) ? "asc" : "desc";
|
127
|
|
- return taActicityStaticMapper.selectActivitySharePersonNumExport(orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), sharePersonType, sharePersonName, sharePhone, activityId, activityType, buildingId, sortType, colKey);
|
|
128
|
+ return taActicityStaticMapper.selectActivitySharePersonNumExport(orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), sharePersonType, sharePersonName, sharePhone, activityId, activityType, buildingId, sortType, colKey, taPersonBuildings, userId);
|
128
|
129
|
}
|
129
|
130
|
|
130
|
|
- public ResponseBean selectActivityShareNum(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String sharePersonType, String sharePersonName, String sharePhone, String activityId, String activityType, String personId, String buildingId, String sort, String colKey){
|
|
131
|
+ public ResponseBean selectActivityShareNum(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String sharePersonType, String sharePersonName, String sharePhone, String activityId, String activityType, String personId, String buildingId, String sort, String colKey, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
131
|
132
|
IPage<ShareNum> iPage = new Page<>(pageNum, pageSize);
|
132
|
133
|
String sortType = "ascend".equals(sort) ? "asc" : "desc";
|
133
|
134
|
|
134
|
|
- IPage<ShareNum> data = taActicityStaticMapper.selectActivityShareNum(iPage, orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), sharePersonType, sharePersonName, sharePhone, activityId, activityType, personId, buildingId, sortType, colKey);
|
|
135
|
+ IPage<ShareNum> data = taActicityStaticMapper.selectActivityShareNum(iPage, orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), sharePersonType, sharePersonName, sharePhone, activityId, activityType, personId, buildingId, sortType, colKey, taPersonBuildings, userId);
|
135
|
136
|
return ResponseBean.success(data);
|
136
|
137
|
}
|
137
|
138
|
|
138
|
|
- public List<ShareNum> selectActivityShareNumExport(Integer orgId, LocalDate startDate, LocalDate endDate, String sharePersonType, String sharePersonName, String sharePhone, String activityId, String activityType, String personId, String buildingId, String sort, String colKey){
|
|
139
|
+ public List<ShareNum> selectActivityShareNumExport(Integer orgId, LocalDate startDate, LocalDate endDate, String sharePersonType, String sharePersonName, String sharePhone, String activityId, String activityType, String personId, String buildingId, String sort, String colKey, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
139
|
140
|
String sortType = "ascend".equals(sort) ? "asc" : "desc";
|
140
|
|
- return taActicityStaticMapper.selectActivityShareNumExport( orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), sharePersonType, sharePersonName, sharePhone, activityId, activityType, personId, buildingId, sortType, colKey);
|
|
141
|
+ return taActicityStaticMapper.selectActivityShareNumExport( orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), sharePersonType, sharePersonName, sharePhone, activityId, activityType, personId, buildingId, sortType, colKey, taPersonBuildings, userId);
|
141
|
142
|
}
|
142
|
143
|
|
143
|
|
- public ResponseBean selectActivityAddRegistNum(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String personFrom, String activityId, String activityType, String buildingId){
|
|
144
|
+ public ResponseBean selectActivityAddRegistNum(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String personFrom, String activityId, String activityType, String buildingId, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
144
|
145
|
IPage<AddRegistNum> iPage = new Page<>(pageNum, pageSize);
|
145
|
|
- IPage<AddRegistNum> data = taActicityStaticMapper.selectActivityAddRegistNum(iPage, orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), personFrom, activityId, activityType, buildingId);
|
|
146
|
+ IPage<AddRegistNum> data = taActicityStaticMapper.selectActivityAddRegistNum(iPage, orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), personFrom, activityId, activityType, buildingId, taPersonBuildings, userId);
|
146
|
147
|
return ResponseBean.success(data);
|
147
|
148
|
}
|
148
|
149
|
|
149
|
|
- public List<AddRegistNum> selectActivityAddRegistNumExport(Integer orgId, LocalDate startDate, LocalDate endDate, String personFrom, String activityId, String activityType, String buildingId){
|
150
|
|
- return taActicityStaticMapper.selectActivityAddRegistNumExport(orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), personFrom, activityId, activityType, buildingId);
|
|
150
|
+ public List<AddRegistNum> selectActivityAddRegistNumExport(Integer orgId, LocalDate startDate, LocalDate endDate, String personFrom, String activityId, String activityType, String buildingId, List<TaPersonBuilding> taPersonBuildings, Integer userId){
|
|
151
|
+ return taActicityStaticMapper.selectActivityAddRegistNumExport(orgId, LocalDateTime.of(startDate, LocalTime.MAX), LocalDateTime.of(endDate, LocalTime.MAX), personFrom, activityId, activityType, buildingId, taPersonBuildings, userId);
|
151
|
152
|
}
|
152
|
153
|
|
153
|
154
|
public ResponseBean selectActivityVisitNum(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String personFrom, String provice, String realtyConsultant, String realtyConsultantPhone, String activityId, String activityType, String personId, String buildingId){
|