Browse Source

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

胡轶钦 5 years ago
parent
commit
5c24d889b7
46 changed files with 679 additions and 161 deletions
  1. 3
    0
      src/main/java/com/huiju/estateagents/activity/controller/ActivityController.java
  2. 6
    0
      src/main/java/com/huiju/estateagents/center/taUser/entity/TaUser.java
  3. 42
    12
      src/main/java/com/huiju/estateagents/center/taUser/service/impl/TaUserServiceImpl.java
  4. 3
    2
      src/main/java/com/huiju/estateagents/controller/MiniAppController.java
  5. 143
    0
      src/main/java/com/huiju/estateagents/controller/TaBuildingMapRelationController.java
  6. 3
    3
      src/main/java/com/huiju/estateagents/controller/TaPersonVisitRecordController.java
  7. 23
    4
      src/main/java/com/huiju/estateagents/controller/TdCityController.java
  8. 1
    0
      src/main/java/com/huiju/estateagents/entity/TaBuilding.java
  9. 51
    0
      src/main/java/com/huiju/estateagents/entity/TaBuildingMapRelation.java
  10. 14
    1
      src/main/java/com/huiju/estateagents/entity/TaOrgCity.java
  11. 6
    0
      src/main/java/com/huiju/estateagents/entity/TaPersonVisitRecord.java
  12. 6
    14
      src/main/java/com/huiju/estateagents/job/CustomerStatisticTimeJob.java
  13. 18
    0
      src/main/java/com/huiju/estateagents/mapper/TaBuildingMapRelationMapper.java
  14. 13
    0
      src/main/java/com/huiju/estateagents/mapper/TaOrgCityMapper.java
  15. 6
    0
      src/main/java/com/huiju/estateagents/mapper/TdCityMapper.java
  16. 16
    0
      src/main/java/com/huiju/estateagents/service/ITaBuildingMapRelationService.java
  17. 2
    0
      src/main/java/com/huiju/estateagents/service/ITdCityService.java
  18. 20
    0
      src/main/java/com/huiju/estateagents/service/impl/TaBuildingMapRelationServiceImpl.java
  19. 62
    3
      src/main/java/com/huiju/estateagents/service/impl/TaBuildingServiceImpl.java
  20. 42
    0
      src/main/java/com/huiju/estateagents/service/impl/TaPersonVisitRecordServiceImpl.java
  21. 8
    0
      src/main/java/com/huiju/estateagents/service/impl/TdCityServiceImpl.java
  22. 8
    4
      src/main/java/com/huiju/estateagents/statistic/controller/TaCustomerFollowUpRecordController.java
  23. 12
    12
      src/main/java/com/huiju/estateagents/statistic/controller/TsCustomerGenderStatisticController.java
  24. 11
    11
      src/main/java/com/huiju/estateagents/statistic/controller/TsCustomerStatisticDailyController.java
  25. 11
    11
      src/main/java/com/huiju/estateagents/statistic/controller/TsCustomerStatisticMonthlyController.java
  26. 1
    1
      src/main/java/com/huiju/estateagents/statistic/entity/TsCustomerGenderStatistic.java
  27. 6
    1
      src/main/java/com/huiju/estateagents/statistic/entity/TsCustomerStatisticDaily.java
  28. 1
    1
      src/main/java/com/huiju/estateagents/statistic/entity/TsCustomerStatisticMonthly.java
  29. 2
    3
      src/main/java/com/huiju/estateagents/statistic/mapper/TsCustomerGenderStatisticMapper.java
  30. 6
    7
      src/main/java/com/huiju/estateagents/statistic/mapper/TsCustomerStatisticDailyMapper.java
  31. 6
    6
      src/main/java/com/huiju/estateagents/statistic/mapper/TsCustomerStatisticMonthlyMapper.java
  32. 2
    2
      src/main/java/com/huiju/estateagents/statistic/service/ITsCustomerGenderStatisticService.java
  33. 3
    3
      src/main/java/com/huiju/estateagents/statistic/service/ITsCustomerStatisticDailyService.java
  34. 3
    3
      src/main/java/com/huiju/estateagents/statistic/service/ITsCustomerStatisticMonthlyService.java
  35. 10
    10
      src/main/java/com/huiju/estateagents/statistic/service/impl/TsCustomerGenderStatisticServiceImpl.java
  36. 18
    14
      src/main/java/com/huiju/estateagents/statistic/service/impl/TsCustomerStatisticDailyServiceImpl.java
  37. 14
    15
      src/main/java/com/huiju/estateagents/statistic/service/impl/TsCustomerStatisticMonthlyServiceImpl.java
  38. 6
    3
      src/main/resources/mapper/Activity.xml
  39. 2
    0
      src/main/resources/mapper/HelpActivityMapper.xml
  40. 5
    0
      src/main/resources/mapper/TaBuildingMapRelationMapper.xml
  41. 22
    0
      src/main/resources/mapper/TaOrgCity.xml
  42. 3
    3
      src/main/resources/mapper/TaRecommendCustomerMapper.xml
  43. 28
    1
      src/main/resources/mapper/TdCityMapper.xml
  44. 1
    1
      src/main/resources/mapper/statistic/TsCustomerGenderStatisticMapper.xml
  45. 5
    5
      src/main/resources/mapper/statistic/TsCustomerStatisticDailyMapper.xml
  46. 5
    5
      src/main/resources/mapper/statistic/TsCustomerStatisticMonthlyMapper.xml

+ 3
- 0
src/main/java/com/huiju/estateagents/activity/controller/ActivityController.java View File

@@ -75,6 +75,9 @@ public class ActivityController extends BaseController {
75 75
 		QueryWrapper<TaPerson> taPersonQueryWrapper = new QueryWrapper<>();
76 76
 		taPersonQueryWrapper.eq("person_id",taRecommendCustomer.getPersonId());
77 77
 		TaPerson person = taPersonService.getOne(taPersonQueryWrapper);
78
+		if (null == person){
79
+			return ResponseBean.error("验证人员信息失败",ResponseBean.ERROR_UNAVAILABLE);
80
+		}
78 81
 		responseBean = activityService.getCustomerActivityList(pageNumber,pageSize,orgId,person);
79 82
 		return responseBean;
80 83
 	}

+ 6
- 0
src/main/java/com/huiju/estateagents/center/taUser/entity/TaUser.java View File

@@ -184,4 +184,10 @@ public class TaUser implements Serializable {
184 184
      */
185 185
     @TableField(exist = false)
186 186
     private Integer cityId;
187
+
188
+    /**
189
+     * 默认城市
190
+     */
191
+    @TableField(exist = false)
192
+    private Integer defaultCityId;
187 193
 }

+ 42
- 12
src/main/java/com/huiju/estateagents/center/taUser/service/impl/TaUserServiceImpl.java View File

@@ -100,6 +100,9 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
100 100
 			taUser.setLoginName(taUser.getPhone());
101 101
 		}
102 102
 
103
+		//判断默认城市是否在维护城市内
104
+		verificationCity(taUser.getSelectCityTree(),taUser.getDefaultCityId());
105
+
103 106
 		QueryWrapper<TaUser> wrapper = new QueryWrapper<>();
104 107
 		wrapper.eq("phone", taUser.getPhone()).or().eq("login_Name", taUser.getLoginName());
105 108
 		List<TaUser> taUserList = this.list(wrapper);
@@ -113,7 +116,7 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
113 116
 		taOrg.setWaterMark(taUser.getWaterMark());
114 117
 		taOrg.setCreateDate(LocalDateTime.now());
115 118
 		taOrg.setBuildingNum(taUser.getOrgNum());
116
-		taOrg.setDefaultCityId(taUser.getCityId());
119
+		taOrg.setDefaultCityId(taUser.getDefaultCityId());
117 120
 		if (taOrgMapper.insert(taOrg) < 1) {
118 121
 			throw new Exception("生成用户公司信息失败");
119 122
 		}
@@ -165,30 +168,51 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
165 168
 
166 169
 	// 维护公司所在城市
167 170
 	public void addAndupdate(ArrayList<Integer> selectCityTree,boolean isA,Integer orgid){
168
-
171
+			// 查询当前所有的市
169 172
 			QueryWrapper<TdCity> tdCityQuery= new QueryWrapper<>();
170
-			tdCityQuery.eq("leveltype",1);
171
-			 List<TdCity> tdCityList= tdCityMapper.selectList(tdCityQuery);
173
+			tdCityQuery.eq("leveltype",2);
174
+			List<TdCity> tdCityList= tdCityMapper.selectList(tdCityQuery);
172 175
 
173 176
 		// isA=true删除所有城市重新添加
174 177
 		if (isA == true){
175
-			for(Integer city:selectCityTree) {
176
-				taOrgCityMapper.deleteById(city);
177
-			}
178
+			QueryWrapper<TaOrgCity> taOrgCity= new  QueryWrapper<>();
179
+			taOrgCity.eq("org_id",orgid);
180
+			taOrgCityMapper.delete(taOrgCity);
178 181
 		}
182
+		TaOrgCity  taOrgCity = new TaOrgCity();
179 183
 			 // 对比现在的城市ID
180 184
 			 for(Integer city:selectCityTree){
181 185
 				for (TdCity tdCity : tdCityList){
186
+						// 入库城市
182 187
 					if (city.equals(tdCity.getId())){
183
-						TaOrgCity  taOrgCity = new TaOrgCity();
184
-						taOrgCity.setId(city).setName(tdCity.getName()).setOrgId(orgid).setStatus(1).setParentid(tdCity.getParentid());
188
+						taOrgCity.setCityId(city).setName(tdCity.getName()).setOrgId(orgid).setStatus(1).setParentid(tdCity.getParentid());
189
+						taOrgCityMapper.insert(taOrgCity);
190
+						// 查询当前公司选择省份是否存在
191
+                       QueryWrapper<TaOrgCity> taOrgCityParent = new QueryWrapper<>();
192
+                        taOrgCityParent.eq("city_id",tdCity.getParentid());
193
+                        taOrgCityParent.eq("org_id",orgid);
194
+						TaOrgCity taOrgParent = taOrgCityMapper.selectOne(taOrgCityParent);
195
+						// 如果为空,查询行政表
196
+						if (null == taOrgParent){
197
+							TdCity  tdCityParent = tdCityMapper.selectById(tdCity.getParentid());
198
+							taOrgCity.setCityId(tdCityParent.getId()).setName(tdCityParent.getName()).setOrgId(orgid).setStatus(1).setParentid(100000);
199
+							taOrgCityMapper.insert(taOrgCity);
200
+						}
185 201
 					}
186 202
 
187 203
 				}
188 204
 			 }
189 205
 
190 206
 	}
191
-
207
+	// 判断当前城市是否存在
208
+	public void  verificationCity(ArrayList<Integer> selectCityTree,Integer city)throws Exception{
209
+		for (Integer id: selectCityTree) {
210
+			if (id.equals(city)) {
211
+				return;
212
+				}
213
+			}
214
+		throw new Exception("当前默认城市不在维护城市内");
215
+	}
192 216
 	@Override
193 217
 	public TaUser getInfoWithOrg(Integer id) {
194 218
 		TaUser taUser = this.getById(id);
@@ -201,7 +225,7 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
201 225
 			taUser.setOrgName(taOrg.getName());
202 226
 			taUser.setWaterMark(taOrg.getWaterMark());
203 227
 			taUser.setOrgNum(taOrg.getBuildingNum());
204
-			taOrg.setDefaultCityId(taUser.getCityId());
228
+			taUser.setDefaultCityId(taOrg.getDefaultCityId());
205 229
 		}
206 230
 
207 231
 		QueryWrapper<TaMiniapp> wrapper = new QueryWrapper<>();
@@ -216,17 +240,23 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
216 240
 
217 241
 		taUser.setMiniapp(taMiniapp);
218 242
 		taUser.setLoginPassword(null);
243
+		// 查询所有城市id
244
+		ArrayList<Integer> taOrgCityList= taOrgCityMapper.selectByIdCity(taUser.getOrgId());
245
+		taUser.setSelectCityTree(taOrgCityList);
219 246
 		return taUser;
220 247
 	}
221 248
 
222 249
 	@Override
223 250
 	public void updateInfoWithOrg(TaUser taUser) throws Exception {
251
+		//判断默认城市是否在维护城市内
252
+		verificationCity(taUser.getSelectCityTree(),taUser.getDefaultCityId());
253
+
224 254
 		TaOrg taOrg = taOrgMapper.selectById(taUser.getOrgId());
225 255
 		if (null != taOrg) {
226 256
 			taOrg.setName(taUser.getOrgName());
227 257
 			taOrg.setWaterMark(taUser.getWaterMark());
228 258
 			taOrg.setBuildingNum(taUser.getOrgNum());
229
-
259
+			taOrg.setDefaultCityId(taUser.getDefaultCityId());
230 260
 			if (taOrgMapper.updateById(taOrg) < 1) {
231 261
 				throw new Exception("更新用户公司信息失败");
232 262
 			}

+ 3
- 2
src/main/java/com/huiju/estateagents/controller/MiniAppController.java View File

@@ -204,12 +204,13 @@ public class MiniAppController extends BaseController {
204 204
 
205 205
             // 获取其余信息
206 206
             Map<String, Object> extraInfo = taPersonService.getExtraInfo(taPerson.getPersonId());
207
-            if (CommConstant.PERSON_REALTY_CONSULTANT.equals(taPerson.getPersonType())){
207
+            // 所有人员都返回 org yansen 2019-11-13 19:56:18
208
+//            if (CommConstant.PERSON_REALTY_CONSULTANT.equals(taPerson.getPersonType())){
208 209
                 QueryWrapper<TaOrg>orgQueryWrapper = new QueryWrapper<>();
209 210
                 orgQueryWrapper.eq("org_id",taPerson.getOrgId());
210 211
                 TaOrg org = taOrgService.getOne(orgQueryWrapper);
211 212
                 taPerson.setOrg(org);
212
-            }
213
+//            }
213 214
             Map<String, Object> result = new HashMap<>();
214 215
             result.put("miniApp", miniResp);
215 216
             result.put("person", taPerson);

+ 143
- 0
src/main/java/com/huiju/estateagents/controller/TaBuildingMapRelationController.java View File

@@ -0,0 +1,143 @@
1
+package com.huiju.estateagents.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.huiju.estateagents.base.BaseController;
7
+import com.huiju.estateagents.base.ResponseBean;
8
+import com.huiju.estateagents.entity.TaBuildingMapRelation;
9
+import com.huiju.estateagents.service.ITaBuildingMapRelationService;
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.*;
14
+
15
+/**
16
+ * <p>
17
+    *  前端控制器
18
+    * </p>
19
+ *
20
+ * @author jobob
21
+ * @since 2019-11-13
22
+ */
23
+@RestController
24
+@RequestMapping("/")
25
+public class TaBuildingMapRelationController extends BaseController {
26
+
27
+    private final Logger logger = LoggerFactory.getLogger(TaBuildingMapRelationController.class);
28
+
29
+    @Autowired
30
+    public ITaBuildingMapRelationService iTaBuildingMapRelationService;
31
+
32
+
33
+    /**
34
+     * 分页查询列表
35
+     * @param pageNum
36
+     * @param pageSize
37
+     * @return
38
+     */
39
+    @RequestMapping(value="/buildingMapRelation",method= RequestMethod.GET)
40
+    public ResponseBean buildingMapRelationList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
41
+                                                @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
42
+        ResponseBean responseBean = new ResponseBean();
43
+        try {
44
+            //使用分页插件
45
+		    IPage<TaBuildingMapRelation> pg = new Page<>(pageNum, pageSize);
46
+            QueryWrapper<TaBuildingMapRelation> queryWrapper = new QueryWrapper<>();
47
+            queryWrapper.orderByDesc("create_date");
48
+
49
+            IPage<TaBuildingMapRelation> result = iTaBuildingMapRelationService.page(pg, queryWrapper);
50
+            responseBean.addSuccess(result);
51
+        }catch (Exception e){
52
+            e.printStackTrace();
53
+            logger.error("buildingMapRelationList -=- {}",e.toString());
54
+            responseBean.addError(e.getMessage());
55
+        }
56
+        return responseBean;
57
+    }
58
+
59
+    /**
60
+     * 保存对象
61
+     * @param taBuildingMapRelation 实体对象
62
+     * @return
63
+     */
64
+    @RequestMapping(value="/buildingMapRelation",method= RequestMethod.POST)
65
+    public ResponseBean buildingMapRelationAdd(@RequestBody TaBuildingMapRelation taBuildingMapRelation){
66
+        ResponseBean responseBean = new ResponseBean();
67
+        try {
68
+            if (iTaBuildingMapRelationService.save(taBuildingMapRelation)){
69
+                responseBean.addSuccess(taBuildingMapRelation);
70
+            }else {
71
+                responseBean.addError("fail");
72
+            }
73
+        }catch (Exception e){
74
+            e.printStackTrace();
75
+            logger.error("buildingMapRelationAdd -=- {}",e.toString());
76
+            responseBean.addError(e.getMessage());
77
+        }
78
+        return responseBean;
79
+    }
80
+
81
+    /**
82
+     * 根据id删除对象
83
+     * @param id  实体ID
84
+     */
85
+    @ResponseBody
86
+    @RequestMapping(value="/buildingMapRelation/{id}", method= RequestMethod.DELETE)
87
+    public ResponseBean buildingMapRelationDelete(@PathVariable Integer id){
88
+        ResponseBean responseBean = new ResponseBean();
89
+        try {
90
+            if(iTaBuildingMapRelationService.removeById(id)){
91
+                responseBean.addSuccess("success");
92
+            }else {
93
+                responseBean.addError("fail");
94
+            }
95
+        }catch (Exception e){
96
+            e.printStackTrace();
97
+            logger.error("buildingMapRelationDelete -=- {}",e.toString());
98
+            responseBean.addError(e.getMessage());
99
+        }
100
+        return responseBean;
101
+    }
102
+
103
+    /**
104
+     * 修改对象
105
+     * @param id  实体ID
106
+     * @param taBuildingMapRelation 实体对象
107
+     * @return
108
+     */
109
+    @RequestMapping(value="/buildingMapRelation/{id}",method= RequestMethod.PUT)
110
+    public ResponseBean buildingMapRelationUpdate(@PathVariable Integer id,
111
+                                        @RequestBody TaBuildingMapRelation taBuildingMapRelation){
112
+        ResponseBean responseBean = new ResponseBean();
113
+        try {
114
+            if (iTaBuildingMapRelationService.updateById(taBuildingMapRelation)){
115
+                responseBean.addSuccess(taBuildingMapRelation);
116
+            }else {
117
+                responseBean.addError("fail");
118
+            }
119
+        }catch (Exception e){
120
+            e.printStackTrace();
121
+            logger.error("buildingMapRelationUpdate -=- {}",e.toString());
122
+            responseBean.addError(e.getMessage());
123
+        }
124
+        return responseBean;
125
+    }
126
+
127
+    /**
128
+     * 根据id查询对象
129
+     * @param id  实体ID
130
+     */
131
+    @RequestMapping(value="/buildingMapRelation/{id}",method= RequestMethod.GET)
132
+    public ResponseBean buildingMapRelationGet(@PathVariable Integer id){
133
+        ResponseBean responseBean = new ResponseBean();
134
+        try {
135
+            responseBean.addSuccess(iTaBuildingMapRelationService.getById(id));
136
+        }catch (Exception e){
137
+            e.printStackTrace();
138
+            logger.error("buildingMapRelationDelete -=- {}",e.toString());
139
+            responseBean.addError(e.getMessage());
140
+        }
141
+        return responseBean;
142
+    }
143
+}

+ 3
- 3
src/main/java/com/huiju/estateagents/controller/TaPersonVisitRecordController.java View File

@@ -203,17 +203,17 @@ public class TaPersonVisitRecordController extends BaseController {
203 203
     
204 204
     /**
205 205
      * 盘客工具分页获取访问记录
206
-     * @param pageNum
206
+     * @param pageNumber
207 207
      * @param pageSize
208 208
      * @return
209 209
      */
210 210
     @RequestMapping(value="/wx/taPersonVisitRecord",method= RequestMethod.GET)
211
-    public ResponseBean wxPersonVisitRecordList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
211
+    public ResponseBean wxPersonVisitRecordList(@RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
212 212
                                                 @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
213 213
                                                 @RequestParam(value = "customerId") String customerId){
214 214
         try {
215 215
             //使用分页插件
216
-            IPage<TaPersonVisitRecord> pg = new Page<>(pageNum, pageSize);
216
+            IPage<TaPersonVisitRecord> pg = new Page<>(pageNumber, pageSize);
217 217
             IPage<TaPersonVisitRecord> result = iTaPersonVisitRecordService.getPersonVisitRecordList(pg, customerId);
218 218
             return ResponseBean.success(result);
219 219
         }catch (Exception e){

+ 23
- 4
src/main/java/com/huiju/estateagents/controller/TdCityController.java View File

@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.huiju.estateagents.base.ResponseBean;
7 7
 import com.huiju.estateagents.common.CommConstant;
8
+import com.huiju.estateagents.entity.TaOrgCity;
8 9
 import com.huiju.estateagents.entity.TdCity;
10
+import com.huiju.estateagents.mapper.TaOrgCityMapper;
9 11
 import com.huiju.estateagents.service.ITdCityService;
10 12
 import org.slf4j.Logger;
11 13
 import org.slf4j.LoggerFactory;
@@ -19,6 +21,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
19 21
 import org.springframework.web.bind.annotation.RestController;
20 22
 import com.huiju.estateagents.base.BaseController;
21 23
 
24
+import javax.servlet.http.HttpServletRequest;
22 25
 import java.util.List;
23 26
 
24 27
 /**
@@ -38,12 +41,15 @@ public class TdCityController extends BaseController {
38 41
     @Autowired
39 42
     public ITdCityService iTdCityService;
40 43
 
44
+    @Autowired
45
+    private TaOrgCityMapper taOrgCityMapper;
46
+
41 47
 
42 48
     /**
43
-     * 查询列表
49
+     * 中心端城市
44 50
      * @return
45 51
      */
46
-    @RequestMapping(value="/admin/tdCity",method= RequestMethod.GET)
52
+    @RequestMapping(value="/center/tdCity",method= RequestMethod.GET)
47 53
     public ResponseBean tdCityList(@RequestParam(value = "leveltype", required = false) String leveltype){
48 54
         ResponseBean responseBean = new ResponseBean();
49 55
         try {
@@ -56,15 +62,28 @@ public class TdCityController extends BaseController {
56 62
         return responseBean;
57 63
     }
58 64
 
65
+    /**
66
+     * 业务端城市
67
+     */
68
+    @RequestMapping(value="/admin/tdCityList/tdCity",method= RequestMethod.GET)
69
+    public ResponseBean adminTdCityList(HttpServletRequest request){
70
+        ResponseBean responseBean = new ResponseBean<>();
71
+        List<TaOrgCity> taOrgCityList = taOrgCityMapper.selectAdminTdCityList(getOrgId(request));
72
+        responseBean.addSuccess(taOrgCityList);
73
+        return responseBean;
74
+    }
75
+
76
+
59 77
     /**
60 78
      * 查询列表
61 79
      * @return
62 80
      */
63 81
     @RequestMapping(value="/wx/tdCity",method= RequestMethod.GET)
64
-    public ResponseBean tdCityListWx(@RequestParam(value = "leveltype", required = false) String leveltype){
82
+    public ResponseBean tdCityListWx(@RequestParam(value = "leveltype", required = false) String leveltype,HttpServletRequest request){
65 83
         ResponseBean responseBean = new ResponseBean();
66 84
         try {
67
-            List<TdCity> result = iTdCityService.selectCity(leveltype, "1");
85
+            /**leveltype,暂时保留*/
86
+            List<TdCity> result = iTdCityService.selectWxCity(leveltype,getOrgId(request));
68 87
             responseBean.addSuccess(result);
69 88
         }catch (Exception e){
70 89
             logger.error("tdCityList -=- {}",e.toString());

+ 1
- 0
src/main/java/com/huiju/estateagents/entity/TaBuilding.java View File

@@ -201,6 +201,7 @@ public class TaBuilding implements Serializable {
201 201
     /**
202 202
      * 地图数据
203 203
      */
204
+    @TableField(exist = false)
204 205
     private String mapJson;
205 206
 
206 207
     /**

+ 51
- 0
src/main/java/com/huiju/estateagents/entity/TaBuildingMapRelation.java View File

@@ -0,0 +1,51 @@
1
+package com.huiju.estateagents.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+import java.io.Serializable;
12
+import java.time.LocalDateTime;
13
+
14
+/**
15
+ * <p>
16
+ * 
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-11-13
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("ta_building_map_relation")
26
+public class TaBuildingMapRelation implements Serializable {
27
+
28
+    @TableId(value = "map_id", type = IdType.AUTO)
29
+    private Integer mapId;
30
+
31
+    private static final long serialVersionUID = 1L;
32
+
33
+    private String buildingId;
34
+
35
+    private Integer orgId;
36
+
37
+    private String types;
38
+
39
+    private String data;
40
+
41
+    private String label;
42
+
43
+    @TableField(value = "`key`")
44
+    private String key;
45
+
46
+    private Integer status;
47
+
48
+    private LocalDateTime createDate;
49
+
50
+
51
+}

+ 14
- 1
src/main/java/com/huiju/estateagents/entity/TaOrgCity.java View File

@@ -24,11 +24,18 @@ import java.util.List;
24 24
 public class TaOrgCity implements Serializable {
25 25
 
26 26
     private static final long serialVersionUID = 1L;
27
+
28
+    /**
29
+     * id
30
+     */
31
+    @TableId(value = "id", type = IdType.AUTO)
32
+    private Integer id;
33
+
27 34
     /**
28 35
      * 省份id
29 36
      * 城市id
30 37
      */
31
-    private Integer id;
38
+    private Integer cityId;
32 39
 
33 40
     /**
34 41
      * 省市区名称
@@ -49,4 +56,10 @@ public class TaOrgCity implements Serializable {
49 56
      * 上级ID
50 57
      */
51 58
     private Integer parentid;
59
+
60
+    /**
61
+     * 城市首字母
62
+     */
63
+    @TableField(exist = false)
64
+    private String initial;
52 65
 }

+ 6
- 0
src/main/java/com/huiju/estateagents/entity/TaPersonVisitRecord.java View File

@@ -107,5 +107,11 @@ public class TaPersonVisitRecord implements Serializable {
107 107
      */
108 108
     @TableField(exist = false)
109 109
     private String buildingName;
110
+    
111
+    /**
112
+     * 活动名称
113
+     */
114
+    @TableField(exist = false)
115
+    private String activityName;
110 116
 
111 117
 }

+ 6
- 14
src/main/java/com/huiju/estateagents/job/CustomerStatisticTimeJob.java View File

@@ -1,17 +1,9 @@
1 1
 package com.huiju.estateagents.job;
2 2
 
3 3
 import com.huiju.estateagents.base.BaseController;
4
-import com.huiju.estateagents.common.DateUtils;
5
-import com.huiju.estateagents.service.IHelpActivityService;
6
-import com.huiju.estateagents.service.IHelpInitiateRecordService;
7
-import com.huiju.estateagents.service.IHelpRecordService;
8
-import com.huiju.estateagents.service.ITaBuildingDynamicService;
9
-import com.huiju.estateagents.service.ITaShareActivityService;
10
-import com.huiju.estateagents.service.ITaShareChildRecordService;
11
-import com.huiju.estateagents.service.ITaShareRecordService;
12
-import com.huiju.estateagents.statistic.service.ITaCustomerGenderStatisticService;
13
-import com.huiju.estateagents.statistic.service.ITaCustomerStatisticDailyService;
14
-import com.huiju.estateagents.statistic.service.ITaCustomerStatisticMonthlyService;
4
+import com.huiju.estateagents.statistic.service.ITsCustomerGenderStatisticService;
5
+import com.huiju.estateagents.statistic.service.ITsCustomerStatisticDailyService;
6
+import com.huiju.estateagents.statistic.service.ITsCustomerStatisticMonthlyService;
15 7
 import org.slf4j.Logger;
16 8
 import org.slf4j.LoggerFactory;
17 9
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,13 +28,13 @@ public class CustomerStatisticTimeJob extends BaseController {
36 28
     private final Logger logger = LoggerFactory.getLogger(CustomerStatisticTimeJob.class);
37 29
 
38 30
     @Autowired
39
-    private ITaCustomerStatisticDailyService customerStatisticDailyService;
31
+    private ITsCustomerStatisticDailyService customerStatisticDailyService;
40 32
     
41 33
     @Autowired
42
-    private ITaCustomerGenderStatisticService taCustomerGenderStatisticService;
34
+    private ITsCustomerGenderStatisticService taCustomerGenderStatisticService;
43 35
     
44 36
     @Autowired
45
-    private ITaCustomerStatisticMonthlyService customerStatisticMonthlyService;
37
+    private ITsCustomerStatisticMonthlyService customerStatisticMonthlyService;
46 38
 
47 39
     /**
48 40
      *

+ 18
- 0
src/main/java/com/huiju/estateagents/mapper/TaBuildingMapRelationMapper.java View File

@@ -0,0 +1,18 @@
1
+package com.huiju.estateagents.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.huiju.estateagents.entity.TaBuildingMapRelation;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ *  Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-11-13
14
+ */
15
+@Mapper
16
+public interface TaBuildingMapRelationMapper extends BaseMapper<TaBuildingMapRelation> {
17
+
18
+}

+ 13
- 0
src/main/java/com/huiju/estateagents/mapper/TaOrgCityMapper.java View File

@@ -3,6 +3,10 @@ package com.huiju.estateagents.mapper;
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.huiju.estateagents.entity.TaOrgCity;
5 5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.ArrayList;
9
+import java.util.List;
6 10
 
7 11
 /**
8 12
  * <p>
@@ -14,4 +18,13 @@ import org.apache.ibatis.annotations.Mapper;
14 18
  */
15 19
 @Mapper
16 20
 public interface TaOrgCityMapper extends BaseMapper<TaOrgCity> {
21
+    // 查询所有的城市排除省份
22
+    ArrayList<Integer> selectByIdCity(@Param("orgId") Integer orgId);
23
+
24
+    /**
25
+     * 根据orgid查询城市并排除省份
26
+     * @param orgId
27
+     * @return
28
+     */
29
+    List<TaOrgCity> selectAdminTdCityList(Integer orgId);
17 30
 }

+ 6
- 0
src/main/java/com/huiju/estateagents/mapper/TdCityMapper.java View File

@@ -20,4 +20,10 @@ import java.util.List;
20 20
 public interface TdCityMapper extends BaseMapper<TdCity> {
21 21
     List<TdCity> selectCity(@Param("leveltype")String leveltype,@Param("status") String status);
22 22
 
23
+    /**
24
+     *查出当前ta_org_city下的城市
25
+     * @param orgId
26
+     * @return
27
+     */
28
+    List<TdCity> selectWxCity(@Param("orgId") Integer orgId);
23 29
 }

+ 16
- 0
src/main/java/com/huiju/estateagents/service/ITaBuildingMapRelationService.java View File

@@ -0,0 +1,16 @@
1
+package com.huiju.estateagents.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.huiju.estateagents.entity.TaBuildingMapRelation;
5
+
6
+/**
7
+ * <p>
8
+ *  服务类
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-11-13
13
+ */
14
+public interface ITaBuildingMapRelationService extends IService<TaBuildingMapRelation> {
15
+
16
+}

+ 2
- 0
src/main/java/com/huiju/estateagents/service/ITdCityService.java View File

@@ -17,4 +17,6 @@ import java.util.List;
17 17
 public interface ITdCityService extends IService<TdCity> {
18 18
     List<TdCity> selectCity(String leveltype,String status);
19 19
 
20
+    // 微信端城市
21
+    List<TdCity> selectWxCity(String leveltype,Integer orgId);
20 22
 }

+ 20
- 0
src/main/java/com/huiju/estateagents/service/impl/TaBuildingMapRelationServiceImpl.java View File

@@ -0,0 +1,20 @@
1
+package com.huiju.estateagents.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.huiju.estateagents.entity.TaBuildingMapRelation;
5
+import com.huiju.estateagents.mapper.TaBuildingMapRelationMapper;
6
+import com.huiju.estateagents.service.ITaBuildingMapRelationService;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ *  服务实现类
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-11-13
16
+ */
17
+@Service
18
+public class TaBuildingMapRelationServiceImpl extends ServiceImpl<TaBuildingMapRelationMapper, TaBuildingMapRelation> implements ITaBuildingMapRelationService {
19
+
20
+}

+ 62
- 3
src/main/java/com/huiju/estateagents/service/impl/TaBuildingServiceImpl.java View File

@@ -13,6 +13,7 @@ import com.huiju.estateagents.common.DateUtils;
13 13
 import com.huiju.estateagents.common.StringUtils;
14 14
 import com.huiju.estateagents.entity.*;
15 15
 import com.huiju.estateagents.mapper.*;
16
+import com.huiju.estateagents.service.ITaBuildingMapRelationService;
16 17
 import com.huiju.estateagents.service.ITaBuildingService;
17 18
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
18 19
 import com.huiju.estateagents.service.TaPosterService;
@@ -86,6 +87,9 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
86 87
     @Autowired
87 88
     private  TaOrgMapper  taOrgMapper;
88 89
 
90
+    @Autowired
91
+    private ITaBuildingMapRelationService iTaBuildingMapRelationService;
92
+
89 93
     @Override
90 94
     public ResponseBean buildingList(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain, Integer orgId) {
91 95
         Page<TaBuilding> page = new Page<>();
@@ -168,6 +172,13 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
168 172
         building.setPosters(taPosterService.getPostersForTarget(id,CommConstant.POSTER_CONTENT_TYPE_BUILDING));
169 173
         building.setShareContents(taShareContentService.getPostersForTarget(id,CommConstant.POSTER_CONTENT_TYPE_BUILDING));
170 174
 
175
+        // 查询 周边数据
176
+        QueryWrapper<TaBuildingMapRelation> mapRelationQueryWrapper = new QueryWrapper<>();
177
+        mapRelationQueryWrapper.eq("building_id", building.getBuildingId());
178
+        mapRelationQueryWrapper.eq("org_id", building.getOrgId());
179
+        List<TaBuildingMapRelation> mapRelationList = iTaBuildingMapRelationService.list(mapRelationQueryWrapper);
180
+        building.setMapJson(mapRelationList.size() > 0 ? JSONObject.toJSONString(mapRelationList) : null);
181
+
171 182
         return ResponseBean.success(building);
172 183
     }
173 184
 
@@ -247,9 +258,14 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
247 258
         shareActivityQueryWrapper.eq("status", 1);
248 259
         shareActivityQueryWrapper.in("activity_status", 0, 1);
249 260
         List<TaShareActivity> shareActivityList = taShareActivityMapper.selectList(shareActivityQueryWrapper);
250
-
251 261
         building.setShareActivityList(shareActivityList);
252 262
 
263
+        // 查询 周边数据
264
+        QueryWrapper<TaBuildingMapRelation> mapRelationQueryWrapper = new QueryWrapper<>();
265
+        mapRelationQueryWrapper.eq("building_id", building.getBuildingId());
266
+        mapRelationQueryWrapper.eq("org_id", building.getOrgId());
267
+        List<TaBuildingMapRelation> mapRelationList = iTaBuildingMapRelationService.list(mapRelationQueryWrapper);
268
+        building.setMapJson(mapRelationList.size() > 0 ? JSONObject.toJSONString(mapRelationList) : null);
253 269
 
254 270
         return ResponseBean.success(building);
255 271
     }
@@ -258,7 +274,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
258 274
     public ResponseBean buildingUpdate(String parameter, Integer orgId) {
259 275
         JSONObject object= JSONObject.parseObject(parameter);
260 276
 
261
-        TaBuilding building = JSONObject.parseObject(parameter,TaBuilding.class);
277
+        TaBuilding building = object.toJavaObject(TaBuilding.class);
262 278
 
263 279
         // 先删除视频
264 280
         UpdateWrapper<TaBuilding> updateWrapper = new UpdateWrapper<>();
@@ -328,6 +344,20 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
328 344
         if (CollectionUtils.isNotEmpty(buildingProjectTypeArray)) {
329 345
             taBuildingProjectTypeMapper.insertBuildingProjectTypeBatch(buildingProjectTypeArray, building.getBuildingId());
330 346
         }
347
+
348
+        // 地图周边
349
+        JSONArray mapJson = object.getJSONArray("mapJson");
350
+        if (null != mapJson) {
351
+            // 先删除
352
+            QueryWrapper<TaBuildingMapRelation> mapRelationQueryWrapper = new QueryWrapper<>();
353
+            mapRelationQueryWrapper.eq("building_id", building.getBuildingId());
354
+            mapRelationQueryWrapper.eq("org_id", orgId);
355
+            iTaBuildingMapRelationService.remove(mapRelationQueryWrapper);
356
+
357
+            List<TaBuildingMapRelation> taBuildingMapRelations = mapJson.toJavaList(TaBuildingMapRelation.class);
358
+            insertBuildingMapRelationBeach(taBuildingMapRelations, building.getBuildingId(), orgId);
359
+        }
360
+
331 361
         return ResponseBean.success(building);
332 362
     }
333 363
 
@@ -350,7 +380,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
350 380
             return ResponseBean.error("楼盘已超过最大限制", ResponseBean.ERROR_UNAVAILABLE);
351 381
         }
352 382
 
353
-        TaBuilding building = JSONObject.parseObject(parameter,TaBuilding.class);
383
+        TaBuilding building = object.toJavaObject(TaBuilding.class);
354 384
         if(null!= object.getDate("openingDate")){
355 385
             building.setOpeningDate(DateUtils.date2LocalDateTime(object.getDate("openingDate")));
356 386
         }
@@ -401,9 +431,37 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
401 431
             taBuildingProjectTypeMapper.insertBuildingProjectTypeBatch(buildingProjectTypeArray, building.getBuildingId());
402 432
         }
403 433
 
434
+        // 地图周边
435
+        JSONArray mapJson = object.getJSONArray("mapJson");
436
+        if (null != mapJson) {
437
+            List<TaBuildingMapRelation> taBuildingMapRelations = mapJson.toJavaList(TaBuildingMapRelation.class);
438
+            insertBuildingMapRelationBeach(taBuildingMapRelations, building.getBuildingId(), orgId);
439
+        }
440
+
441
+
404 442
         return ResponseBean.success(building);
405 443
     }
406 444
 
445
+    /**
446
+     * 批量插入 周边地图数据
447
+     * @param list
448
+     * @param buildingId
449
+     * @param orgId
450
+     * @return
451
+     */
452
+    private List<TaBuildingMapRelation> insertBuildingMapRelationBeach(List<TaBuildingMapRelation> list, String buildingId, Integer orgId) {
453
+        List<TaBuildingMapRelation> newList = list.stream().map(e -> {
454
+            e.setBuildingId(buildingId);
455
+            e.setOrgId(orgId);
456
+            e.setStatus(1);
457
+            e.setCreateDate(LocalDateTime.now());
458
+            return e;
459
+        }).collect(Collectors.toList());
460
+
461
+        iTaBuildingMapRelationService.saveBatch(newList);
462
+        return newList;
463
+    }
464
+
407 465
     @Override
408 466
     public ResponseBean buildingUpdateStatus(String parameter, Integer orgId) {
409 467
         TaBuilding  building = new TaBuilding();
@@ -449,6 +507,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
449 507
         }
450 508
 
451 509
         JSONObject jsonobject = JSONObject.parseObject(parameter);
510
+
452 511
         //图片数组
453 512
         String imgStr = jsonobject.getString("img");
454 513
         //转集合

+ 42
- 0
src/main/java/com/huiju/estateagents/service/impl/TaPersonVisitRecordServiceImpl.java View File

@@ -2,12 +2,18 @@ package com.huiju.estateagents.service.impl;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4 4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.huiju.estateagents.entity.HelpActivity;
6
+import com.huiju.estateagents.entity.TaBuildingDynamic;
5 7
 import com.huiju.estateagents.entity.TaPerson;
6 8
 import com.huiju.estateagents.entity.TaPersonVisitRecord;
7 9
 import com.huiju.estateagents.entity.TaRecommendCustomer;
10
+import com.huiju.estateagents.entity.TaShareActivity;
11
+import com.huiju.estateagents.mapper.HelpActivityMapper;
12
+import com.huiju.estateagents.mapper.TaBuildingDynamicMapper;
8 13
 import com.huiju.estateagents.mapper.TaPersonMapper;
9 14
 import com.huiju.estateagents.mapper.TaPersonVisitRecordMapper;
10 15
 import com.huiju.estateagents.mapper.TaRecommendCustomerMapper;
16
+import com.huiju.estateagents.mapper.TaShareActivityMapper;
11 17
 import com.huiju.estateagents.service.ITaPersonVisitRecordService;
12 18
 import org.springframework.beans.factory.annotation.Autowired;
13 19
 import org.springframework.stereotype.Service;
@@ -31,6 +37,15 @@ public class TaPersonVisitRecordServiceImpl extends ServiceImpl<TaPersonVisitRec
31 37
 	@Autowired
32 38
 	private TaPersonVisitRecordMapper personVisitRecordMapper;
33 39
 	
40
+	@Autowired
41
+	private TaBuildingDynamicMapper taBuildingDynamicMapper;
42
+	
43
+	@Autowired
44
+	private TaShareActivityMapper taShareActivityMapper;
45
+	
46
+	@Autowired
47
+	private HelpActivityMapper helpActivityMapper;
48
+	
34 49
 	/**
35 50
 	 * 分页获取客户访问记录
36 51
 	 *
@@ -42,6 +57,33 @@ public class TaPersonVisitRecordServiceImpl extends ServiceImpl<TaPersonVisitRec
42 57
 	public IPage<TaPersonVisitRecord> getPersonVisitRecordList(IPage<TaPersonVisitRecord> pg, String customerId) {
43 58
 		TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(customerId);
44 59
 		IPage<TaPersonVisitRecord> result = personVisitRecordMapper.getPersonVisitRecordList(pg,taRecommendCustomer.getPersonId());
60
+		List<TaPersonVisitRecord> records = result.getRecords();
61
+		records.forEach(e -> {
62
+			//获取活动标题
63
+			if (e.getEventType().equals("activity") && null != e.getTargetId()){
64
+				TaBuildingDynamic taBuildingDynamic = taBuildingDynamicMapper.selectById(e.getTargetId());
65
+				if (null != taBuildingDynamic){
66
+					e.setActivityName(taBuildingDynamic.getTitle());
67
+				}
68
+				
69
+			}
70
+			//获取拼团标题
71
+			if (e.getEventType().equals("group") && null != e.getTargetId()){
72
+				TaShareActivity taShareActivity = taShareActivityMapper.selectById(e.getTargetId());
73
+				if (null != taShareActivity){
74
+					e.setActivityName(taShareActivity.getActivityName());
75
+				}
76
+			}
77
+			//获取助力标题
78
+			if (e.getEventType().equals("help") && null != e.getTargetId()){
79
+				HelpActivity helpActivity = helpActivityMapper.selectById(e.getTargetId());
80
+				if (null != helpActivity){
81
+					e.setActivityName(helpActivity.getTitle());
82
+				}
83
+				
84
+			}
85
+		});
86
+		result.setRecords(records);
45 87
 		return result;
46 88
 	}
47 89
 //    @Autowired

+ 8
- 0
src/main/java/com/huiju/estateagents/service/impl/TdCityServiceImpl.java View File

@@ -2,6 +2,7 @@ package com.huiju.estateagents.service.impl;
2 2
 
3 3
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 4
 import com.huiju.estateagents.entity.TdCity;
5
+import com.huiju.estateagents.mapper.TaOrgCityMapper;
5 6
 import com.huiju.estateagents.mapper.TdCityMapper;
6 7
 import com.huiju.estateagents.service.ITdCityService;
7 8
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,4 +27,11 @@ public class TdCityServiceImpl extends ServiceImpl<TdCityMapper, TdCity> impleme
26 27
         return tdCityMapper.selectCity(leveltype, status);
27 28
     }
28 29
 
30
+
31
+    @Override
32
+    public List<TdCity> selectWxCity(String leveltype, Integer orgId) {
33
+        List<TdCity>  tdCityList= tdCityMapper.selectWxCity(orgId);
34
+        return tdCityList;
35
+    }
36
+
29 37
 }

+ 8
- 4
src/main/java/com/huiju/estateagents/statistic/controller/TaCustomerFollowUpRecordController.java View File

@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
21 21
 import org.springframework.web.bind.annotation.RestController;
22 22
 
23 23
 import javax.servlet.http.HttpServletRequest;
24
+import java.time.LocalDateTime;
24 25
 import java.util.List;
25 26
 
26 27
 /**
@@ -171,6 +172,8 @@ public class TaCustomerFollowUpRecordController extends BaseController {
171 172
         TaPerson person = taPersons.get(0);
172 173
         try {
173 174
             taCustomerFollowUpRecord.setFollowerId(person.getPersonId());
175
+            taCustomerFollowUpRecord.setCreateDate(LocalDateTime.now());
176
+            taCustomerFollowUpRecord.setOrgId(orgId);
174 177
             if (iTaCustomerFollowUpRecordService.save(taCustomerFollowUpRecord)){
175 178
                 responseBean.addSuccess(taCustomerFollowUpRecord);
176 179
             }else {
@@ -186,14 +189,14 @@ public class TaCustomerFollowUpRecordController extends BaseController {
186 189
     
187 190
     /**
188 191
      * 分页查询跟进记录列表
189
-     * @param pageNum
192
+     * @param pageNumber
190 193
      * @param pageSize
191 194
      * @return
192 195
      */
193 196
     @RequestMapping(value="/wx/taCustomerFollowUpRecord",method= RequestMethod.GET)
194
-    public ResponseBean wxCustomerFollowUpRecordList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
197
+    public ResponseBean wxCustomerFollowUpRecordList(@RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
195 198
                                                      @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
196
-                                                     @RequestParam(value ="customerId",required = true) Integer customerId,
199
+                                                     @RequestParam(value ="customerId",required = true) String customerId,
197 200
                                                      HttpServletRequest request){
198 201
         ResponseBean responseBean = new ResponseBean();
199 202
         String openid = getOpenId(request);
@@ -205,7 +208,7 @@ public class TaCustomerFollowUpRecordController extends BaseController {
205 208
         TaPerson person = taPersons.get(0);
206 209
         try {
207 210
             //使用分页插件
208
-            IPage<TaCustomerFollowUpRecord> pg = new Page<>(pageNum, pageSize);
211
+            IPage<TaCustomerFollowUpRecord> pg = new Page<>(pageNumber, pageSize);
209 212
             QueryWrapper<TaCustomerFollowUpRecord> queryWrapper = new QueryWrapper<>();
210 213
             queryWrapper.eq("follower_id",person.getPersonId());
211 214
             queryWrapper.eq("org_id",orgId);
@@ -222,3 +225,4 @@ public class TaCustomerFollowUpRecordController extends BaseController {
222 225
         return responseBean;
223 226
     }
224 227
 }
228
+

src/main/java/com/huiju/estateagents/statistic/controller/TaCustomerGenderStatisticController.java → src/main/java/com/huiju/estateagents/statistic/controller/TsCustomerGenderStatisticController.java View File

@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.huiju.estateagents.base.BaseController;
7 7
 import com.huiju.estateagents.base.ResponseBean;
8
-import com.huiju.estateagents.statistic.entity.TaCustomerGenderStatistic;
9
-import com.huiju.estateagents.statistic.service.ITaCustomerGenderStatisticService;
8
+import com.huiju.estateagents.statistic.entity.TsCustomerGenderStatistic;
9
+import com.huiju.estateagents.statistic.service.ITsCustomerGenderStatisticService;
10 10
 import org.slf4j.Logger;
11 11
 import org.slf4j.LoggerFactory;
12 12
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,12 +31,12 @@ import java.util.List;
31 31
  */
32 32
 @RestController
33 33
 @RequestMapping("/api")
34
-public class TaCustomerGenderStatisticController extends BaseController {
34
+public class TsCustomerGenderStatisticController extends BaseController {
35 35
 
36
-    private final Logger logger = LoggerFactory.getLogger(TaCustomerGenderStatisticController.class);
36
+    private final Logger logger = LoggerFactory.getLogger(TsCustomerGenderStatisticController.class);
37 37
 
38 38
     @Autowired
39
-    public ITaCustomerGenderStatisticService iTaCustomerGenderStatisticService;
39
+    public ITsCustomerGenderStatisticService iTaCustomerGenderStatisticService;
40 40
 
41 41
 
42 42
     /**
@@ -51,11 +51,11 @@ public class TaCustomerGenderStatisticController extends BaseController {
51 51
         ResponseBean responseBean = new ResponseBean();
52 52
         try {
53 53
             //使用分页插件
54
-		    IPage<TaCustomerGenderStatistic> pg = new Page<>(pageNum, pageSize);
55
-            QueryWrapper<TaCustomerGenderStatistic> queryWrapper = new QueryWrapper<>();
54
+		    IPage<TsCustomerGenderStatistic> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TsCustomerGenderStatistic> queryWrapper = new QueryWrapper<>();
56 56
             queryWrapper.orderByDesc("create_date");
57 57
 
58
-            IPage<TaCustomerGenderStatistic> result = iTaCustomerGenderStatisticService.page(pg, queryWrapper);
58
+            IPage<TsCustomerGenderStatistic> result = iTaCustomerGenderStatisticService.page(pg, queryWrapper);
59 59
             responseBean.addSuccess(result);
60 60
         }catch (Exception e){
61 61
             e.printStackTrace();
@@ -71,7 +71,7 @@ public class TaCustomerGenderStatisticController extends BaseController {
71 71
      * @return
72 72
      */
73 73
     @RequestMapping(value="/taCustomerGenderStatistic",method= RequestMethod.POST)
74
-    public ResponseBean taCustomerGenderStatisticAdd(@RequestBody TaCustomerGenderStatistic taCustomerGenderStatistic){
74
+    public ResponseBean taCustomerGenderStatisticAdd(@RequestBody TsCustomerGenderStatistic taCustomerGenderStatistic){
75 75
         ResponseBean responseBean = new ResponseBean();
76 76
         try {
77 77
             if (iTaCustomerGenderStatisticService.save(taCustomerGenderStatistic)){
@@ -117,7 +117,7 @@ public class TaCustomerGenderStatisticController extends BaseController {
117 117
      */
118 118
     @RequestMapping(value="/taCustomerGenderStatistic/{id}",method= RequestMethod.PUT)
119 119
     public ResponseBean taCustomerGenderStatisticUpdate(@PathVariable Integer id,
120
-                                        @RequestBody TaCustomerGenderStatistic taCustomerGenderStatistic){
120
+                                        @RequestBody TsCustomerGenderStatistic taCustomerGenderStatistic){
121 121
         ResponseBean responseBean = new ResponseBean();
122 122
         try {
123 123
             if (iTaCustomerGenderStatisticService.updateById(taCustomerGenderStatistic)){
@@ -159,12 +159,12 @@ public class TaCustomerGenderStatisticController extends BaseController {
159 159
         ResponseBean responseBean = new ResponseBean();
160 160
         try {
161 161
             //查询当前小程序的男女比统计
162
-            QueryWrapper<TaCustomerGenderStatistic> queryWrapper = new QueryWrapper<>();
162
+            QueryWrapper<TsCustomerGenderStatistic> queryWrapper = new QueryWrapper<>();
163 163
             queryWrapper.eq("org_id",getOrgId(request));
164 164
             queryWrapper.eq("customer_type",customerType);
165 165
             queryWrapper.orderByDesc("create_date");
166 166
      
167
-            List<TaCustomerGenderStatistic> result = iTaCustomerGenderStatisticService.list(queryWrapper);
167
+            List<TsCustomerGenderStatistic> result = iTaCustomerGenderStatisticService.list(queryWrapper);
168 168
             responseBean.addSuccess(result);
169 169
         }catch (Exception e){
170 170
             e.printStackTrace();

src/main/java/com/huiju/estateagents/statistic/controller/TaCustomerStatisticDailyController.java → src/main/java/com/huiju/estateagents/statistic/controller/TsCustomerStatisticDailyController.java View File

@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.huiju.estateagents.base.BaseController;
7 7
 import com.huiju.estateagents.base.ResponseBean;
8
-import com.huiju.estateagents.statistic.entity.TaCustomerStatisticDaily;
9
-import com.huiju.estateagents.statistic.service.ITaCustomerStatisticDailyService;
8
+import com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily;
9
+import com.huiju.estateagents.statistic.service.ITsCustomerStatisticDailyService;
10 10
 import org.slf4j.Logger;
11 11
 import org.slf4j.LoggerFactory;
12 12
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,12 +31,12 @@ import java.util.List;
31 31
  */
32 32
 @RestController
33 33
 @RequestMapping("/api")
34
-public class TaCustomerStatisticDailyController extends BaseController {
34
+public class TsCustomerStatisticDailyController extends BaseController {
35 35
 
36
-    private final Logger logger = LoggerFactory.getLogger(TaCustomerStatisticDailyController.class);
36
+    private final Logger logger = LoggerFactory.getLogger(TsCustomerStatisticDailyController.class);
37 37
 
38 38
     @Autowired
39
-    public ITaCustomerStatisticDailyService iTaCustomerStatisticDailyService;
39
+    public ITsCustomerStatisticDailyService iTaCustomerStatisticDailyService;
40 40
 
41 41
 
42 42
     /**
@@ -51,11 +51,11 @@ public class TaCustomerStatisticDailyController extends BaseController {
51 51
         ResponseBean responseBean = new ResponseBean();
52 52
         try {
53 53
             //使用分页插件
54
-		    IPage<TaCustomerStatisticDaily> pg = new Page<>(pageNum, pageSize);
55
-            QueryWrapper<TaCustomerStatisticDaily> queryWrapper = new QueryWrapper<>();
54
+		    IPage<TsCustomerStatisticDaily> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TsCustomerStatisticDaily> queryWrapper = new QueryWrapper<>();
56 56
             queryWrapper.orderByDesc("create_date");
57 57
 
58
-            IPage<TaCustomerStatisticDaily> result = iTaCustomerStatisticDailyService.page(pg, queryWrapper);
58
+            IPage<TsCustomerStatisticDaily> result = iTaCustomerStatisticDailyService.page(pg, queryWrapper);
59 59
             responseBean.addSuccess(result);
60 60
         }catch (Exception e){
61 61
             e.printStackTrace();
@@ -71,7 +71,7 @@ public class TaCustomerStatisticDailyController extends BaseController {
71 71
      * @return
72 72
      */
73 73
     @RequestMapping(value="/taCustomerStatisticDaily",method= RequestMethod.POST)
74
-    public ResponseBean taCustomerStatisticDailyAdd(@RequestBody TaCustomerStatisticDaily taCustomerStatisticDaily){
74
+    public ResponseBean taCustomerStatisticDailyAdd(@RequestBody TsCustomerStatisticDaily taCustomerStatisticDaily){
75 75
         ResponseBean responseBean = new ResponseBean();
76 76
         try {
77 77
             if (iTaCustomerStatisticDailyService.save(taCustomerStatisticDaily)){
@@ -117,7 +117,7 @@ public class TaCustomerStatisticDailyController extends BaseController {
117 117
      */
118 118
     @RequestMapping(value="/taCustomerStatisticDaily/{id}",method= RequestMethod.PUT)
119 119
     public ResponseBean taCustomerStatisticDailyUpdate(@PathVariable Integer id,
120
-                                        @RequestBody TaCustomerStatisticDaily taCustomerStatisticDaily){
120
+                                        @RequestBody TsCustomerStatisticDaily taCustomerStatisticDaily){
121 121
         ResponseBean responseBean = new ResponseBean();
122 122
         try {
123 123
             if (iTaCustomerStatisticDailyService.updateById(taCustomerStatisticDaily)){
@@ -160,7 +160,7 @@ public class TaCustomerStatisticDailyController extends BaseController {
160 160
                                                      HttpServletRequest request){
161 161
         ResponseBean responseBean = new ResponseBean();
162 162
         try {
163
-            List<TaCustomerStatisticDaily> list = iTaCustomerStatisticDailyService.getDailyList(customerType,getOrgId(request));
163
+            List<TsCustomerStatisticDaily> list = iTaCustomerStatisticDailyService.getDailyList(customerType,getOrgId(request));
164 164
             responseBean.addSuccess(list);
165 165
         }catch (Exception e){
166 166
             e.printStackTrace();

src/main/java/com/huiju/estateagents/statistic/controller/TaCustomerStatisticMonthlyController.java → src/main/java/com/huiju/estateagents/statistic/controller/TsCustomerStatisticMonthlyController.java View File

@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.huiju.estateagents.base.BaseController;
7 7
 import com.huiju.estateagents.base.ResponseBean;
8
-import com.huiju.estateagents.statistic.entity.TaCustomerStatisticMonthly;
9
-import com.huiju.estateagents.statistic.service.ITaCustomerStatisticMonthlyService;
8
+import com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly;
9
+import com.huiju.estateagents.statistic.service.ITsCustomerStatisticMonthlyService;
10 10
 import org.slf4j.Logger;
11 11
 import org.slf4j.LoggerFactory;
12 12
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,12 +31,12 @@ import java.util.List;
31 31
  */
32 32
 @RestController
33 33
 @RequestMapping("/api")
34
-public class TaCustomerStatisticMonthlyController extends BaseController {
34
+public class TsCustomerStatisticMonthlyController extends BaseController {
35 35
 
36
-    private final Logger logger = LoggerFactory.getLogger(TaCustomerStatisticMonthlyController.class);
36
+    private final Logger logger = LoggerFactory.getLogger(TsCustomerStatisticMonthlyController.class);
37 37
 
38 38
     @Autowired
39
-    public ITaCustomerStatisticMonthlyService iTaCustomerStatisticMonthlyService;
39
+    public ITsCustomerStatisticMonthlyService iTaCustomerStatisticMonthlyService;
40 40
 
41 41
 
42 42
     /**
@@ -51,11 +51,11 @@ public class TaCustomerStatisticMonthlyController extends BaseController {
51 51
         ResponseBean responseBean = new ResponseBean();
52 52
         try {
53 53
             //使用分页插件
54
-		    IPage<TaCustomerStatisticMonthly> pg = new Page<>(pageNum, pageSize);
55
-            QueryWrapper<TaCustomerStatisticMonthly> queryWrapper = new QueryWrapper<>();
54
+		    IPage<TsCustomerStatisticMonthly> pg = new Page<>(pageNum, pageSize);
55
+            QueryWrapper<TsCustomerStatisticMonthly> queryWrapper = new QueryWrapper<>();
56 56
             queryWrapper.orderByDesc("create_date");
57 57
 
58
-            IPage<TaCustomerStatisticMonthly> result = iTaCustomerStatisticMonthlyService.page(pg, queryWrapper);
58
+            IPage<TsCustomerStatisticMonthly> result = iTaCustomerStatisticMonthlyService.page(pg, queryWrapper);
59 59
             responseBean.addSuccess(result);
60 60
         }catch (Exception e){
61 61
             e.printStackTrace();
@@ -71,7 +71,7 @@ public class TaCustomerStatisticMonthlyController extends BaseController {
71 71
      * @return
72 72
      */
73 73
     @RequestMapping(value="/taCustomerStatisticMonthly",method= RequestMethod.POST)
74
-    public ResponseBean taCustomerStatisticMonthlyAdd(@RequestBody TaCustomerStatisticMonthly taCustomerStatisticMonthly){
74
+    public ResponseBean taCustomerStatisticMonthlyAdd(@RequestBody TsCustomerStatisticMonthly taCustomerStatisticMonthly){
75 75
         ResponseBean responseBean = new ResponseBean();
76 76
         try {
77 77
             if (iTaCustomerStatisticMonthlyService.save(taCustomerStatisticMonthly)){
@@ -117,7 +117,7 @@ public class TaCustomerStatisticMonthlyController extends BaseController {
117 117
      */
118 118
     @RequestMapping(value="/taCustomerStatisticMonthly/{id}",method= RequestMethod.PUT)
119 119
     public ResponseBean taCustomerStatisticMonthlyUpdate(@PathVariable Integer id,
120
-                                        @RequestBody TaCustomerStatisticMonthly taCustomerStatisticMonthly){
120
+                                        @RequestBody TsCustomerStatisticMonthly taCustomerStatisticMonthly){
121 121
         ResponseBean responseBean = new ResponseBean();
122 122
         try {
123 123
             if (iTaCustomerStatisticMonthlyService.updateById(taCustomerStatisticMonthly)){
@@ -161,7 +161,7 @@ public class TaCustomerStatisticMonthlyController extends BaseController {
161 161
         ResponseBean responseBean = new ResponseBean();
162 162
         try {
163 163
             //查询月客户分析数据
164
-            List<TaCustomerStatisticMonthly> result = iTaCustomerStatisticMonthlyService.getCustomerMonthlyList(customerType, getOrgId(request));
164
+            List<TsCustomerStatisticMonthly> result = iTaCustomerStatisticMonthlyService.getCustomerMonthlyList(customerType, getOrgId(request));
165 165
             responseBean.addSuccess(result);
166 166
         }catch (Exception e){
167 167
             e.printStackTrace();

src/main/java/com/huiju/estateagents/statistic/entity/TaCustomerGenderStatistic.java → src/main/java/com/huiju/estateagents/statistic/entity/TsCustomerGenderStatistic.java View File

@@ -21,7 +21,7 @@ import java.time.LocalDateTime;
21 21
 @Data
22 22
 @EqualsAndHashCode(callSuper = false)
23 23
 @Accessors(chain = true)
24
-public class TaCustomerGenderStatistic implements Serializable {
24
+public class TsCustomerGenderStatistic implements Serializable {
25 25
 
26 26
     private static final long serialVersionUID = 1L;
27 27
 

src/main/java/com/huiju/estateagents/statistic/entity/TaCustomerStatisticDaily.java → src/main/java/com/huiju/estateagents/statistic/entity/TsCustomerStatisticDaily.java View File

@@ -22,7 +22,7 @@ import java.time.LocalDateTime;
22 22
 @EqualsAndHashCode(callSuper = false)
23 23
 @Accessors(chain = true)
24 24
 @TableName("ta_customer_statistic_daily")
25
-public class TaCustomerStatisticDaily implements Serializable {
25
+public class TsCustomerStatisticDaily implements Serializable {
26 26
 
27 27
     private static final long serialVersionUID = 1L;
28 28
 
@@ -51,6 +51,11 @@ public class TaCustomerStatisticDaily implements Serializable {
51 51
      * 创建时间
52 52
      */
53 53
     private LocalDateTime createDate;
54
+    
55
+    /**
56
+     * 日期 格式yyyymmdd例20191111
57
+     */
58
+    private String day;
54 59
 
55 60
 
56 61
 }

src/main/java/com/huiju/estateagents/statistic/entity/TaCustomerStatisticMonthly.java → src/main/java/com/huiju/estateagents/statistic/entity/TsCustomerStatisticMonthly.java View File

@@ -22,7 +22,7 @@ import java.time.LocalDateTime;
22 22
 @EqualsAndHashCode(callSuper = false)
23 23
 @Accessors(chain = true)
24 24
 @TableName("ta_customer_statistic_monthly")
25
-public class TaCustomerStatisticMonthly implements Serializable {
25
+public class TsCustomerStatisticMonthly implements Serializable {
26 26
 
27 27
     private static final long serialVersionUID = 1L;
28 28
 

src/main/java/com/huiju/estateagents/statistic/mapper/TaCustomerGenderStatisticMapper.java → src/main/java/com/huiju/estateagents/statistic/mapper/TsCustomerGenderStatisticMapper.java View File

@@ -2,11 +2,10 @@ package com.huiju.estateagents.statistic.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.huiju.estateagents.statistic.entity.GenderStatistic;
5
-import com.huiju.estateagents.statistic.entity.TaCustomerGenderStatistic;
5
+import com.huiju.estateagents.statistic.entity.TsCustomerGenderStatistic;
6 6
 import org.apache.ibatis.annotations.Mapper;
7 7
 
8 8
 import java.util.List;
9
-import java.util.Map;
10 9
 
11 10
 /**
12 11
  * <p>
@@ -17,7 +16,7 @@ import java.util.Map;
17 16
  * @since 2019-11-08
18 17
  */
19 18
 @Mapper
20
-public interface TaCustomerGenderStatisticMapper extends BaseMapper<TaCustomerGenderStatistic> {
19
+public interface TsCustomerGenderStatisticMapper extends BaseMapper<TsCustomerGenderStatistic> {
21 20
 	
22 21
 	/**
23 22
 	 * 获取新增客户的男女性别比

src/main/java/com/huiju/estateagents/statistic/mapper/TaCustomerStatisticDailyMapper.java → src/main/java/com/huiju/estateagents/statistic/mapper/TsCustomerStatisticDailyMapper.java View File

@@ -1,13 +1,12 @@
1 1
 package com.huiju.estateagents.statistic.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
-import com.huiju.estateagents.statistic.entity.TaCustomerStatisticDaily;
4
+import com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily;
5 5
 import org.apache.ibatis.annotations.Mapper;
6 6
 import org.apache.ibatis.annotations.Param;
7 7
 
8 8
 import java.time.LocalDateTime;
9 9
 import java.util.List;
10
-import java.util.Map;
11 10
 
12 11
 /**
13 12
  * <p>
@@ -18,14 +17,14 @@ import java.util.Map;
18 17
  * @since 2019-11-08
19 18
  */
20 19
 @Mapper
21
-public interface TaCustomerStatisticDailyMapper extends BaseMapper<TaCustomerStatisticDaily> {
20
+public interface TsCustomerStatisticDailyMapper extends BaseMapper<TsCustomerStatisticDaily> {
22 21
 	
23 22
 	/**
24 23
 	 * 获取当天跟进客户数
25 24
 	 * @param nowDate
26 25
 	 * @return
27 26
 	 */
28
-	List<TaCustomerStatisticDaily> getFollowUpData(@Param("nowDate") LocalDateTime nowDate);
27
+	List<TsCustomerStatisticDaily> getFollowUpData(@Param("nowDate") LocalDateTime nowDate);
29 28
 	
30 29
 	/**
31 30
 	 * 获取当天新增客户数
@@ -33,7 +32,7 @@ public interface TaCustomerStatisticDailyMapper extends BaseMapper<TaCustomerSta
33 32
 	 * @param status
34 33
 	 * @return
35 34
 	 */
36
-	List<TaCustomerStatisticDaily> getNewCustomerData(@Param("nowDate") LocalDateTime nowDate,@Param("status") int status);
35
+	List<TsCustomerStatisticDaily> getNewCustomerData(@Param("nowDate") LocalDateTime nowDate, @Param("status") int status);
37 36
 	
38 37
 	/**
39 38
 	 * 获取当天到访客户数
@@ -41,7 +40,7 @@ public interface TaCustomerStatisticDailyMapper extends BaseMapper<TaCustomerSta
41 40
 	 * @param checkin
42 41
 	 * @return
43 42
 	 */
44
-	List<TaCustomerStatisticDaily> getVisiteCustomerData(@Param("nowDate") LocalDateTime nowDate,@Param("checkin") int checkin);
43
+	List<TsCustomerStatisticDaily> getVisiteCustomerData(@Param("nowDate") LocalDateTime nowDate, @Param("checkin") int checkin);
45 44
 	
46 45
 	/**
47 46
 	 * 获取31天的统计数据
@@ -51,7 +50,7 @@ public interface TaCustomerStatisticDailyMapper extends BaseMapper<TaCustomerSta
51 50
 	 * @param beforeDate
52 51
 	 * @return
53 52
 	 */
54
-	List<TaCustomerStatisticDaily> getDailyList(@Param("customerType") String customerType,@Param("orgId")  Integer orgId,@Param("nowDate")  LocalDateTime nowDate,@Param("beforeDate")  LocalDateTime beforeDate);
53
+	List<TsCustomerStatisticDaily> getDailyList(@Param("customerType") String customerType, @Param("orgId")  Integer orgId, @Param("nowDate")  LocalDateTime nowDate, @Param("beforeDate")  LocalDateTime beforeDate);
55 54
 	
56 55
 	int deleteNowDate(@Param("nowDate") LocalDateTime nowDate,@Param("customerType") String customerType);
57 56
 }

src/main/java/com/huiju/estateagents/statistic/mapper/TaCustomerStatisticMonthlyMapper.java → src/main/java/com/huiju/estateagents/statistic/mapper/TsCustomerStatisticMonthlyMapper.java View File

@@ -1,7 +1,7 @@
1 1
 package com.huiju.estateagents.statistic.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
-import com.huiju.estateagents.statistic.entity.TaCustomerStatisticMonthly;
4
+import com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly;
5 5
 import org.apache.ibatis.annotations.Mapper;
6 6
 import org.apache.ibatis.annotations.Param;
7 7
 
@@ -17,7 +17,7 @@ import java.util.List;
17 17
  * @since 2019-11-08
18 18
  */
19 19
 @Mapper
20
-public interface TaCustomerStatisticMonthlyMapper extends BaseMapper<TaCustomerStatisticMonthly> {
20
+public interface TsCustomerStatisticMonthlyMapper extends BaseMapper<TsCustomerStatisticMonthly> {
21 21
 	
22 22
 	/**
23 23
 	 * 获取一个月新增客户的数据插入
@@ -25,14 +25,14 @@ public interface TaCustomerStatisticMonthlyMapper extends BaseMapper<TaCustomerS
25 25
 	 * @param status
26 26
 	 * @return
27 27
 	 */
28
-	List<TaCustomerStatisticMonthly> getNewCustomerStatisticMonthly(@Param("nowDate") LocalDateTime nowDate,@Param("status") int status);
28
+	List<TsCustomerStatisticMonthly> getNewCustomerStatisticMonthly(@Param("nowDate") LocalDateTime nowDate, @Param("status") int status);
29 29
 	
30 30
 	/**
31 31
 	 * 获取一个月跟进客户数据插入
32 32
 	 * @param nowDate
33 33
 	 * @return
34 34
 	 */
35
-	List<TaCustomerStatisticMonthly> getFollowUpStatisticMonthly(@Param("nowDate") LocalDateTime nowDate);
35
+	List<TsCustomerStatisticMonthly> getFollowUpStatisticMonthly(@Param("nowDate") LocalDateTime nowDate);
36 36
 	
37 37
 	/**
38 38
 	 * 获取一个月访问客户数据插入
@@ -40,7 +40,7 @@ public interface TaCustomerStatisticMonthlyMapper extends BaseMapper<TaCustomerS
40 40
 	 * @param checkin
41 41
 	 * @return
42 42
 	 */
43
-	List<TaCustomerStatisticMonthly> getVisiteStatisticMonthly(@Param("nowDate") LocalDateTime nowDate,@Param("checkin") int checkin);
43
+	List<TsCustomerStatisticMonthly> getVisiteStatisticMonthly(@Param("nowDate") LocalDateTime nowDate, @Param("checkin") int checkin);
44 44
 	
45 45
 	/**
46 46
 	 * 获取12个月的统计数据
@@ -50,5 +50,5 @@ public interface TaCustomerStatisticMonthlyMapper extends BaseMapper<TaCustomerS
50 50
 	 * @param beforeDate
51 51
 	 * @return
52 52
 	 */
53
-	List<TaCustomerStatisticMonthly> getMonthlyList(@Param("customerType") String customerType,@Param("orgId") Integer orgId,@Param("nowDate") LocalDateTime nowDate,@Param("beforeDate") LocalDateTime beforeDate);
53
+	List<TsCustomerStatisticMonthly> getMonthlyList(@Param("customerType") String customerType, @Param("orgId") Integer orgId, @Param("nowDate") LocalDateTime nowDate, @Param("beforeDate") LocalDateTime beforeDate);
54 54
 }

src/main/java/com/huiju/estateagents/statistic/service/ITaCustomerGenderStatisticService.java → src/main/java/com/huiju/estateagents/statistic/service/ITsCustomerGenderStatisticService.java View File

@@ -1,7 +1,7 @@
1 1
 package com.huiju.estateagents.statistic.service;
2 2
 
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4
-import com.huiju.estateagents.statistic.entity.TaCustomerGenderStatistic;
4
+import com.huiju.estateagents.statistic.entity.TsCustomerGenderStatistic;
5 5
 
6 6
 import java.time.LocalDateTime;
7 7
 
@@ -13,7 +13,7 @@ import java.time.LocalDateTime;
13 13
  * @author jobob
14 14
  * @since 2019-11-08
15 15
  */
16
-public interface ITaCustomerGenderStatisticService extends IService<TaCustomerGenderStatistic> {
16
+public interface ITsCustomerGenderStatisticService extends IService<TsCustomerGenderStatistic> {
17 17
 	
18 18
 	/**
19 19
 	 * 每天的新增客户性别统计

src/main/java/com/huiju/estateagents/statistic/service/ITaCustomerStatisticDailyService.java → src/main/java/com/huiju/estateagents/statistic/service/ITsCustomerStatisticDailyService.java View File

@@ -1,7 +1,7 @@
1 1
 package com.huiju.estateagents.statistic.service;
2 2
 
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4
-import com.huiju.estateagents.statistic.entity.TaCustomerStatisticDaily;
4
+import com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily;
5 5
 
6 6
 import java.time.LocalDateTime;
7 7
 import java.util.List;
@@ -14,7 +14,7 @@ import java.util.List;
14 14
  * @author jobob
15 15
  * @since 2019-11-08
16 16
  */
17
-public interface ITaCustomerStatisticDailyService extends IService<TaCustomerStatisticDaily> {
17
+public interface ITsCustomerStatisticDailyService extends IService<TsCustomerStatisticDaily> {
18 18
 	
19 19
 	/**
20 20
 	 * 每天的跟进客户统计
@@ -40,5 +40,5 @@ public interface ITaCustomerStatisticDailyService extends IService<TaCustomerSta
40 40
 	 * @param orgId
41 41
 	 * @return
42 42
 	 */
43
-	List<TaCustomerStatisticDaily> getDailyList(String customerType, Integer orgId);
43
+	List<TsCustomerStatisticDaily> getDailyList(String customerType, Integer orgId);
44 44
 }

src/main/java/com/huiju/estateagents/statistic/service/ITaCustomerStatisticMonthlyService.java → src/main/java/com/huiju/estateagents/statistic/service/ITsCustomerStatisticMonthlyService.java View File

@@ -1,7 +1,7 @@
1 1
 package com.huiju.estateagents.statistic.service;
2 2
 
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4
-import com.huiju.estateagents.statistic.entity.TaCustomerStatisticMonthly;
4
+import com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly;
5 5
 
6 6
 import java.time.LocalDateTime;
7 7
 import java.util.List;
@@ -14,7 +14,7 @@ import java.util.List;
14 14
  * @author jobob
15 15
  * @since 2019-11-08
16 16
  */
17
-public interface ITaCustomerStatisticMonthlyService extends IService<TaCustomerStatisticMonthly> {
17
+public interface ITsCustomerStatisticMonthlyService extends IService<TsCustomerStatisticMonthly> {
18 18
 	
19 19
 	/**
20 20
 	 * 每月新增客户统计,每天都更新
@@ -40,5 +40,5 @@ public interface ITaCustomerStatisticMonthlyService extends IService<TaCustomerS
40 40
 	 * @param orgId
41 41
 	 * @return
42 42
 	 */
43
-	List<TaCustomerStatisticMonthly> getCustomerMonthlyList(String customerType, Integer orgId);
43
+	List<TsCustomerStatisticMonthly> getCustomerMonthlyList(String customerType, Integer orgId);
44 44
 }

src/main/java/com/huiju/estateagents/statistic/service/impl/TaCustomerGenderStatisticServiceImpl.java → src/main/java/com/huiju/estateagents/statistic/service/impl/TsCustomerGenderStatisticServiceImpl.java View File

@@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5 5
 import com.huiju.estateagents.common.CommConstant;
6 6
 import com.huiju.estateagents.statistic.entity.GenderStatistic;
7
-import com.huiju.estateagents.statistic.entity.TaCustomerGenderStatistic;
8
-import com.huiju.estateagents.statistic.mapper.TaCustomerGenderStatisticMapper;
9
-import com.huiju.estateagents.statistic.service.ITaCustomerGenderStatisticService;
7
+import com.huiju.estateagents.statistic.entity.TsCustomerGenderStatistic;
8
+import com.huiju.estateagents.statistic.mapper.TsCustomerGenderStatisticMapper;
9
+import com.huiju.estateagents.statistic.service.ITsCustomerGenderStatisticService;
10 10
 import org.springframework.beans.factory.annotation.Autowired;
11 11
 import org.springframework.stereotype.Service;
12 12
 
@@ -23,10 +23,10 @@ import java.util.List;
23 23
  * @since 2019-11-08
24 24
  */
25 25
 @Service
26
-public class TaCustomerGenderStatisticServiceImpl extends ServiceImpl<TaCustomerGenderStatisticMapper, TaCustomerGenderStatistic> implements ITaCustomerGenderStatisticService {
26
+public class TsCustomerGenderStatisticServiceImpl extends ServiceImpl<TsCustomerGenderStatisticMapper, TsCustomerGenderStatistic> implements ITsCustomerGenderStatisticService {
27 27
 	
28 28
 	@Autowired
29
-	private TaCustomerGenderStatisticMapper customerGenderStatisticMapper;
29
+	private TsCustomerGenderStatisticMapper customerGenderStatisticMapper;
30 30
 	
31 31
 	/**
32 32
 	 * 每天的新增客户性别统计
@@ -80,14 +80,14 @@ public class TaCustomerGenderStatisticServiceImpl extends ServiceImpl<TaCustomer
80 80
 	 */
81 81
 	private void saveBatchCustomerSexData(List<GenderStatistic> customerSexList, LocalDateTime nowDate,String customerType) {
82 82
 		//先删除在添加
83
-		QueryWrapper<TaCustomerGenderStatistic> queryWrapper = new QueryWrapper<>();
83
+		QueryWrapper<TsCustomerGenderStatistic> queryWrapper = new QueryWrapper<>();
84 84
 		queryWrapper.eq("customer_type",customerType);
85 85
 		customerGenderStatisticMapper.delete(queryWrapper);
86 86
 		
87
-		List<TaCustomerGenderStatistic> list = new ArrayList<>();
87
+		List<TsCustomerGenderStatistic> list = new ArrayList<>();
88 88
 		//划分男女未知三条数据
89 89
 		customerSexList.forEach(e -> {
90
-			TaCustomerGenderStatistic maleCustomer = new TaCustomerGenderStatistic();
90
+			TsCustomerGenderStatistic maleCustomer = new TsCustomerGenderStatistic();
91 91
 			maleCustomer.setCreateDate(nowDate);
92 92
 			maleCustomer.setGenderType(CommConstant.SEX_MALE);
93 93
 			maleCustomer.setCustomerType(customerType);
@@ -96,7 +96,7 @@ public class TaCustomerGenderStatisticServiceImpl extends ServiceImpl<TaCustomer
96 96
 			maleCustomer.setOrgId(e.getOrgId());
97 97
 			list.add(maleCustomer);
98 98
 			
99
-			TaCustomerGenderStatistic femaleCustomer = new TaCustomerGenderStatistic();
99
+			TsCustomerGenderStatistic femaleCustomer = new TsCustomerGenderStatistic();
100 100
 			femaleCustomer.setCreateDate(nowDate);
101 101
 			femaleCustomer.setGenderType(CommConstant.SEX_FEMALE);
102 102
 			femaleCustomer.setCustomerType(customerType);
@@ -105,7 +105,7 @@ public class TaCustomerGenderStatisticServiceImpl extends ServiceImpl<TaCustomer
105 105
 			femaleCustomer.setOrgId(e.getOrgId());
106 106
 			list.add(femaleCustomer);
107 107
 			
108
-			TaCustomerGenderStatistic unknownCustomer = new TaCustomerGenderStatistic();
108
+			TsCustomerGenderStatistic unknownCustomer = new TsCustomerGenderStatistic();
109 109
 			unknownCustomer.setCreateDate(nowDate);
110 110
 			unknownCustomer.setGenderType(CommConstant.SEX_UNKNOWN);
111 111
 			unknownCustomer.setCustomerType(customerType);

src/main/java/com/huiju/estateagents/statistic/service/impl/TaCustomerStatisticDailyServiceImpl.java → src/main/java/com/huiju/estateagents/statistic/service/impl/TsCustomerStatisticDailyServiceImpl.java View File

@@ -2,17 +2,16 @@ package com.huiju.estateagents.statistic.service.impl;
2 2
 
3 3
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 4
 import com.huiju.estateagents.common.CommConstant;
5
-import com.huiju.estateagents.common.StringUtils;
6
-import com.huiju.estateagents.statistic.entity.TaCustomerStatisticDaily;
7
-import com.huiju.estateagents.statistic.mapper.TaCustomerStatisticDailyMapper;
8
-import com.huiju.estateagents.statistic.service.ITaCustomerStatisticDailyService;
5
+import com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily;
6
+import com.huiju.estateagents.statistic.mapper.TsCustomerStatisticDailyMapper;
7
+import com.huiju.estateagents.statistic.service.ITsCustomerStatisticDailyService;
9 8
 import org.springframework.beans.factory.annotation.Autowired;
10 9
 import org.springframework.stereotype.Service;
11 10
 
12 11
 import java.time.LocalDateTime;
12
+import java.time.format.DateTimeFormatter;
13 13
 import java.util.ArrayList;
14 14
 import java.util.List;
15
-import java.util.Map;
16 15
 
17 16
 /**
18 17
  * <p>
@@ -23,10 +22,10 @@ import java.util.Map;
23 22
  * @since 2019-11-08
24 23
  */
25 24
 @Service
26
-public class TaCustomerStatisticDailyServiceImpl extends ServiceImpl<TaCustomerStatisticDailyMapper, TaCustomerStatisticDaily> implements ITaCustomerStatisticDailyService {
25
+public class TsCustomerStatisticDailyServiceImpl extends ServiceImpl<TsCustomerStatisticDailyMapper, TsCustomerStatisticDaily> implements ITsCustomerStatisticDailyService {
27 26
 	
28 27
 	@Autowired
29
-	private TaCustomerStatisticDailyMapper customerStatisticDailyMapper;
28
+	private TsCustomerStatisticDailyMapper customerStatisticDailyMapper;
30 29
 	
31 30
 	/**
32 31
 	 * 每天的跟进客户统计
@@ -36,7 +35,7 @@ public class TaCustomerStatisticDailyServiceImpl extends ServiceImpl<TaCustomerS
36 35
 	@Override
37 36
 	public void followUpStatisticDaily(LocalDateTime nowDate) {
38 37
 		//按当前时间获取当天的跟进客户的数量,多一个客户进行多次跟进行为,只记录一次
39
-		List<TaCustomerStatisticDaily> list = customerStatisticDailyMapper.getFollowUpData(nowDate);
38
+		List<TsCustomerStatisticDaily> list = customerStatisticDailyMapper.getFollowUpData(nowDate);
40 39
 		//批量保存
41 40
 		statisticDailySaveBatch(list,nowDate,CommConstant.CUSTOMER_TYPE_FOLLOW);
42 41
 	}
@@ -49,7 +48,7 @@ public class TaCustomerStatisticDailyServiceImpl extends ServiceImpl<TaCustomerS
49 48
 	@Override
50 49
 	public void newCustomerStatisticDaily(LocalDateTime nowDate) {
51 50
 		//按当前时间获取当天的新增客户的数量,ta_recommend_customer 表的status 为1 的就是新增客户
52
-		List<TaCustomerStatisticDaily> list = customerStatisticDailyMapper.getNewCustomerData(nowDate,CommConstant.STATUS_NORMAL);
51
+		List<TsCustomerStatisticDaily> list = customerStatisticDailyMapper.getNewCustomerData(nowDate,CommConstant.STATUS_NORMAL);
53 52
 		//批量保存
54 53
 		statisticDailySaveBatch(list,nowDate,CommConstant.CUSTOMER_TYPE_NEW);
55 54
 	}
@@ -62,8 +61,8 @@ public class TaCustomerStatisticDailyServiceImpl extends ServiceImpl<TaCustomerS
62 61
 	@Override
63 62
 	public void visiteStatisticDaily(LocalDateTime nowDate) {
64 63
 		//按当前时间获取当天的到访客户的数量,同一天同一个项目只记录一次
65
-		List<TaCustomerStatisticDaily> list = customerStatisticDailyMapper.getVisiteCustomerData(nowDate,CommConstant.STATUS_NORMAL);
66
-		List<TaCustomerStatisticDaily> saveList = new ArrayList<>();
64
+		List<TsCustomerStatisticDaily> list = customerStatisticDailyMapper.getVisiteCustomerData(nowDate,CommConstant.STATUS_NORMAL);
65
+		List<TsCustomerStatisticDaily> saveList = new ArrayList<>();
67 66
 		list.forEach(e -> {
68 67
 			if (null != e.getOrgId() && !e.getOrgId().equals("null")){
69 68
 				saveList.add(e);
@@ -81,13 +80,13 @@ public class TaCustomerStatisticDailyServiceImpl extends ServiceImpl<TaCustomerS
81 80
 	 * @return
82 81
 	 */
83 82
 	@Override
84
-	public List<TaCustomerStatisticDaily> getDailyList(String customerType, Integer orgId) {
83
+	public List<TsCustomerStatisticDaily> getDailyList(String customerType, Integer orgId) {
85 84
 		//当前日期
86 85
 		LocalDateTime nowDate = LocalDateTime.now();
87 86
 		//31天前的日期
88 87
 		LocalDateTime beforeDate = nowDate.plusDays(-31);
89 88
 		//获取31天的日期数据
90
-		List<TaCustomerStatisticDaily> list = customerStatisticDailyMapper.getDailyList(customerType,orgId,nowDate,beforeDate);
89
+		List<TsCustomerStatisticDaily> list = customerStatisticDailyMapper.getDailyList(customerType,orgId,nowDate,beforeDate);
91 90
 		return list;
92 91
 	}
93 92
 	
@@ -97,13 +96,18 @@ public class TaCustomerStatisticDailyServiceImpl extends ServiceImpl<TaCustomerS
97 96
 	 * @param nowDate
98 97
 	 * @param customerType
99 98
 	 */
100
-	private void statisticDailySaveBatch(List<TaCustomerStatisticDaily> list, LocalDateTime nowDate, String customerType) {
99
+	private void statisticDailySaveBatch(List<TsCustomerStatisticDaily> list, LocalDateTime nowDate, String customerType) {
100
+		//格式化年月日
101
+		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
102
+		String todayDate = nowDate.format(formatter);
103
+		
101 104
 		//先删除当天数据在添加防止有脏数据
102 105
 		customerStatisticDailyMapper.deleteNowDate(nowDate,customerType);
103 106
 		
104 107
 		list.forEach(e -> {
105 108
 			e.setCreateDate(nowDate);
106 109
 			e.setCustomerType(customerType);
110
+			e.setDay(todayDate);
107 111
 		});
108 112
 		//批量保存
109 113
 		this.saveBatch(list);

src/main/java/com/huiju/estateagents/statistic/service/impl/TaCustomerStatisticMonthlyServiceImpl.java → src/main/java/com/huiju/estateagents/statistic/service/impl/TsCustomerStatisticMonthlyServiceImpl.java View File

@@ -3,10 +3,9 @@ package com.huiju.estateagents.statistic.service.impl;
3 3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5 5
 import com.huiju.estateagents.common.CommConstant;
6
-import com.huiju.estateagents.statistic.entity.TaCustomerStatisticDaily;
7
-import com.huiju.estateagents.statistic.entity.TaCustomerStatisticMonthly;
8
-import com.huiju.estateagents.statistic.mapper.TaCustomerStatisticMonthlyMapper;
9
-import com.huiju.estateagents.statistic.service.ITaCustomerStatisticMonthlyService;
6
+import com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly;
7
+import com.huiju.estateagents.statistic.mapper.TsCustomerStatisticMonthlyMapper;
8
+import com.huiju.estateagents.statistic.service.ITsCustomerStatisticMonthlyService;
10 9
 import org.springframework.beans.factory.annotation.Autowired;
11 10
 import org.springframework.stereotype.Service;
12 11
 
@@ -24,10 +23,10 @@ import java.util.List;
24 23
  * @since 2019-11-08
25 24
  */
26 25
 @Service
27
-public class TaCustomerStatisticMonthlyServiceImpl extends ServiceImpl<TaCustomerStatisticMonthlyMapper, TaCustomerStatisticMonthly> implements ITaCustomerStatisticMonthlyService {
26
+public class TsCustomerStatisticMonthlyServiceImpl extends ServiceImpl<TsCustomerStatisticMonthlyMapper, TsCustomerStatisticMonthly> implements ITsCustomerStatisticMonthlyService {
28 27
 	
29 28
 	@Autowired
30
-	private TaCustomerStatisticMonthlyMapper customerStatisticMonthlyMapper;
29
+	private TsCustomerStatisticMonthlyMapper customerStatisticMonthlyMapper;
31 30
 	
32 31
 	/**
33 32
 	 * 每月新增客户统计,每天都更新
@@ -37,7 +36,7 @@ public class TaCustomerStatisticMonthlyServiceImpl extends ServiceImpl<TaCustome
37 36
 	@Override
38 37
 	public void newCustomerStatisticMonthly(LocalDateTime nowDate) {
39 38
 		//获取当月新增客户总数
40
-		List<TaCustomerStatisticMonthly> newCustomerMonthList = customerStatisticMonthlyMapper.getNewCustomerStatisticMonthly(nowDate,CommConstant.STATUS_NORMAL);
39
+		List<TsCustomerStatisticMonthly> newCustomerMonthList = customerStatisticMonthlyMapper.getNewCustomerStatisticMonthly(nowDate,CommConstant.STATUS_NORMAL);
41 40
 		//批量插入
42 41
 		statisticMonthlySaveBatch(newCustomerMonthList,nowDate, CommConstant.CUSTOMER_TYPE_NEW);
43 42
 	}
@@ -50,7 +49,7 @@ public class TaCustomerStatisticMonthlyServiceImpl extends ServiceImpl<TaCustome
50 49
 	@Override
51 50
 	public void followUpStatisticMonthly(LocalDateTime nowDate) {
52 51
 		//获取当月跟进客户总数
53
-		List<TaCustomerStatisticMonthly> followUpMonthList = customerStatisticMonthlyMapper.getFollowUpStatisticMonthly(nowDate);
52
+		List<TsCustomerStatisticMonthly> followUpMonthList = customerStatisticMonthlyMapper.getFollowUpStatisticMonthly(nowDate);
54 53
 		statisticMonthlySaveBatch(followUpMonthList,nowDate, CommConstant.CUSTOMER_TYPE_FOLLOW);
55 54
 	}
56 55
 	
@@ -62,8 +61,8 @@ public class TaCustomerStatisticMonthlyServiceImpl extends ServiceImpl<TaCustome
62 61
 	@Override
63 62
 	public void visiteStatisticMonthly(LocalDateTime nowDate) {
64 63
 		//获取当月访问客户总数
65
-		List<TaCustomerStatisticMonthly> visiteMonthList = customerStatisticMonthlyMapper.getVisiteStatisticMonthly(nowDate,CommConstant.STATUS_NORMAL);
66
-		List<TaCustomerStatisticMonthly> newVisiteMonthList = new ArrayList<>();
64
+		List<TsCustomerStatisticMonthly> visiteMonthList = customerStatisticMonthlyMapper.getVisiteStatisticMonthly(nowDate,CommConstant.STATUS_NORMAL);
65
+		List<TsCustomerStatisticMonthly> newVisiteMonthList = new ArrayList<>();
67 66
 		visiteMonthList.forEach(e -> {
68 67
 			if (null != e.getOrgId() && !e.getOrgId().equals("null")){
69 68
 				newVisiteMonthList.add(e);
@@ -80,13 +79,13 @@ public class TaCustomerStatisticMonthlyServiceImpl extends ServiceImpl<TaCustome
80 79
 	 * @return
81 80
 	 */
82 81
 	@Override
83
-	public List<TaCustomerStatisticMonthly> getCustomerMonthlyList(String customerType, Integer orgId) {
82
+	public List<TsCustomerStatisticMonthly> getCustomerMonthlyList(String customerType, Integer orgId) {
84 83
 		//当前日期
85 84
 		LocalDateTime nowDate = LocalDateTime.now();
86 85
 		//12个月前的日期
87 86
 		LocalDateTime beforeDate = nowDate.plusMonths(-12);
88 87
 		//获取31天的日期数据
89
-		List<TaCustomerStatisticMonthly> list = customerStatisticMonthlyMapper.getMonthlyList(customerType,orgId,nowDate,beforeDate);
88
+		List<TsCustomerStatisticMonthly> list = customerStatisticMonthlyMapper.getMonthlyList(customerType,orgId,nowDate,beforeDate);
90 89
 		return list;
91 90
 	}
92 91
 	
@@ -96,13 +95,13 @@ public class TaCustomerStatisticMonthlyServiceImpl extends ServiceImpl<TaCustome
96 95
 	 * @param nowDate
97 96
 	 * @param customerType
98 97
 	 */
99
-	private void statisticMonthlySaveBatch(List<TaCustomerStatisticMonthly> list, LocalDateTime nowDate, String customerType) {
100
-		//格式化年月
98
+	private void statisticMonthlySaveBatch(List<TsCustomerStatisticMonthly> list, LocalDateTime nowDate, String customerType) {
99
+		//格式化年月
101 100
 		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
102 101
 		String todayDate = nowDate.format(formatter);
103 102
 		
104 103
 		//先删除在添加
105
-		QueryWrapper<TaCustomerStatisticMonthly> queryWrapper = new QueryWrapper<>();
104
+		QueryWrapper<TsCustomerStatisticMonthly> queryWrapper = new QueryWrapper<>();
106 105
 		queryWrapper.eq("customer_type",customerType);
107 106
 		queryWrapper.eq("month",todayDate);
108 107
 		customerStatisticMonthlyMapper.delete(queryWrapper);

+ 6
- 3
src/main/resources/mapper/Activity.xml View File

@@ -30,9 +30,10 @@
30 30
             t.enlist_id AS id,
31 31
             t.dynamic_id AS activityId,
32 32
             t.create_date AS createDate,
33
-            IF( t.is_checkin = 1, "已签到", "未签到" ) AS `status`,
33
+            IF( t.is_checkin = 1, "已签到", "未签到" ) AS `joinStatus`,
34 34
             d.list_img_url AS mainImg,
35 35
             d.title,
36
+            d.status,
36 37
             d.start_date AS startDate,
37 38
             d.enlist_end AS endDate,
38 39
             'dynamic' AS type
@@ -58,9 +59,10 @@
58 59
         "成功未核销"
59 60
         WHEN t.STATUS = 2 THEN
60 61
         "失败"
61
-        END `status`,
62
+        END `joinStatus`,
62 63
             d.list_img AS mainImg,
63 64
             d.activity_name AS title,
65
+            d.status,
64 66
             d.start_time AS startDate,
65 67
             d.end_time AS endDate,
66 68
             'group' AS type
@@ -86,9 +88,10 @@
86 88
                         "成功未核销"
87 89
                         WHEN t.STATUS = 2 THEN
88 90
                         "失败"
89
-                    END `status`,
91
+                    END `joinStatus`,
90 92
             d.list_img AS mainImg,
91 93
             d.title,
94
+            d.status,
92 95
             d.start_date AS startDate,
93 96
             d.end_date AS endDate,
94 97
             'help' AS type

+ 2
- 0
src/main/resources/mapper/HelpActivityMapper.xml View File

@@ -61,6 +61,7 @@
61 61
                 a.city_id as cityId,
62 62
 				a.help_activity_id as activityId,
63 63
 				a.img as img,
64
+                a.banner_list_img as bannerListImg,
64 65
 				1 AS type
65 66
 			FROM
66 67
 				ta_help_activity a
@@ -82,6 +83,7 @@
82 83
                     s.city_id as cityId,
83 84
 					s.group_activity_id as activityId,
84 85
 					s.main_img as img,
86
+                    s.banner_list_img as bannerListImg,
85 87
 					2 AS type
86 88
 				FROM
87 89
 					ta_share_activity s

+ 5
- 0
src/main/resources/mapper/TaBuildingMapRelationMapper.xml View File

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.huiju.estateagents.ta.mapper.TaBuildingMapRelationMapper">
4
+
5
+</mapper>

+ 22
- 0
src/main/resources/mapper/TaOrgCity.xml View File

@@ -1,4 +1,26 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.huiju.estateagents.mapper.TaOrgCityMapper">
4
+    <select id="selectByIdCity"  resultType="int">
5
+        select city_id from ta_org_city where  parentid != 100000 and  org_id = #{orgId}
6
+    </select>
7
+
8
+    <select id="selectAdminTdCityList" resultType="com.huiju.estateagents.entity.TaOrgCity">
9
+                SELECT
10
+                    oc.city_id AS id,
11
+                    oc.`name` AS name,
12
+                    oc.org_id,
13
+                    oc.`status`,
14
+                    oc.parentid,
15
+                LEFT (c.pinyin, 1) AS initial
16
+                FROM
17
+                ta_org_city oc
18
+                LEFT JOIN td_city c ON oc.city_id = c.id
19
+                WHERE
20
+                oc.org_id = #{orgId}
21
+                and  oc.parentid  !=100000
22
+                and  oc.status = 1
23
+                ORDER BY
24
+                c.pinyin
25
+    </select>
4 26
 </mapper>

+ 3
- 3
src/main/resources/mapper/TaRecommendCustomerMapper.xml View File

@@ -607,8 +607,8 @@ FROM
607 607
 
608 608
     <select id="getMyCustStatistics" resultType="java.util.Map">
609 609
         SELECT
610
-            sum( IF ( STATUS = 4, 1, 0 ) ) AS followSum,
611
-            sum( IF ( STATUS != 4 AND STATUS != 4, 1, 0 ) ) AS clinchSum
610
+            sum( IF ( STATUS = 4, 1, 0 ) ) AS clinchSum,
611
+            sum( IF ( STATUS != 4 AND STATUS != 4, 1, 0 ) ) AS followSum
612 612
         FROM
613 613
             ta_recommend_customer
614 614
         WHERE
@@ -631,7 +631,7 @@ FROM
631 631
         <if test="type == 'follow'">
632 632
           AND STATUS != 4
633 633
             <if test="name != null and name !=''">
634
-                and `name` like CONCAT('%',#{name}, '%')
634
+                and (`name` like CONCAT('%',#{name}, '%') or phone like CONCAT('%',#{name}, '%'))
635 635
             </if>
636 636
             <if test="phone != null and phone !=''">
637 637
                 and phone like CONCAT('%',#{phone}, '%')

+ 28
- 1
src/main/resources/mapper/TdCityMapper.xml View File

@@ -19,6 +19,33 @@ FROM
19 19
 ORDER BY
20 20
 	pinyin
21 21
     </select>
22
-    
22
+
23
+
24
+    <select id="selectWxCity" resultType="com.huiju.estateagents.entity.TdCity">
25
+
26
+        SELECT
27
+                    c.id,
28
+                    c.name,
29
+                    c.parentid,
30
+                    c.shortname,
31
+                    c.leveltype,
32
+                    c.citycode,
33
+                    c.zipcode,
34
+                    c.lng,
35
+                    c.lat,
36
+                    c.pinyin,
37
+                    oc.org_id,
38
+                    oc.`status`,
39
+                    LEFT (c.pinyin, 1) AS initial
40
+                FROM
41
+                ta_org_city oc
42
+                INNER JOIN td_city c ON oc.city_id = c.id
43
+                WHERE
44
+                oc.org_id = #{orgId}
45
+                and  oc.parentid  !=100000
46
+                and  oc.status = 1
47
+                ORDER BY
48
+                c.pinyin
49
+    </select>
23 50
 
24 51
 </mapper>

src/main/resources/mapper/statistic/TaCustomerGenderStatisticMapper.xml → src/main/resources/mapper/statistic/TsCustomerGenderStatisticMapper.xml View File

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.huiju.estateagents.statistic.mapper.TaCustomerGenderStatisticMapper">
3
+<mapper namespace="com.huiju.estateagents.statistic.mapper.TsCustomerGenderStatisticMapper">
4 4
 
5 5
     <select id="getNewCustomerSexCount" resultType="com.huiju.estateagents.statistic.entity.GenderStatistic">
6 6
         SELECT

src/main/resources/mapper/statistic/TaCustomerStatisticDailyMapper.xml → src/main/resources/mapper/statistic/TsCustomerStatisticDailyMapper.xml View File

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.huiju.estateagents.statistic.mapper.TaCustomerStatisticDailyMapper">
3
+<mapper namespace="com.huiju.estateagents.statistic.mapper.TsCustomerStatisticDailyMapper">
4 4
 
5 5
     <delete id="deleteNowDate">
6 6
         delete from ta_customer_statistic_daily
@@ -8,7 +8,7 @@
8 8
         AND date_format( create_date, '%Y-%m-%d' ) = date_format( #{nowDate}, '%Y-%m-%d' )
9 9
     </delete>
10 10
 
11
-    <select id="getFollowUpData" resultType="com.huiju.estateagents.statistic.entity.TaCustomerStatisticDaily">
11
+    <select id="getFollowUpData" resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily">
12 12
         SELECT
13 13
             org_id,
14 14
             count( DISTINCT ( customer_id ) ) as customer_num
@@ -20,7 +20,7 @@
20 20
             org_id
21 21
     </select>
22 22
 
23
-    <select id="getNewCustomerData" resultType="com.huiju.estateagents.statistic.entity.TaCustomerStatisticDaily">
23
+    <select id="getNewCustomerData" resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily">
24 24
         SELECT
25 25
             org_id,
26 26
             count( customer_id ) as customer_num
@@ -32,7 +32,7 @@
32 32
         GROUP BY
33 33
             org_id
34 34
     </select>
35
-    <select id="getVisiteCustomerData" resultType="com.huiju.estateagents.statistic.entity.TaCustomerStatisticDaily">
35
+    <select id="getVisiteCustomerData" resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily">
36 36
         SELECT
37 37
             count( DISTINCT ( c.customer_id ) ) as customer_num,
38 38
             c.org_id
@@ -48,7 +48,7 @@
48 48
             c.org_id
49 49
     </select>
50 50
 
51
-    <select id="getDailyList" resultType="com.huiju.estateagents.statistic.entity.TaCustomerStatisticDaily">
51
+    <select id="getDailyList" resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily">
52 52
         SELECT
53 53
           *
54 54
         FROM

src/main/resources/mapper/statistic/TaCustomerStatisticMonthlyMapper.xml → src/main/resources/mapper/statistic/TsCustomerStatisticMonthlyMapper.xml View File

@@ -1,9 +1,9 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.huiju.estateagents.statistic.mapper.TaCustomerStatisticMonthlyMapper">
3
+<mapper namespace="com.huiju.estateagents.statistic.mapper.TsCustomerStatisticMonthlyMapper">
4 4
 
5 5
     <select id="getNewCustomerStatisticMonthly"
6
-            resultType="com.huiju.estateagents.statistic.entity.TaCustomerStatisticMonthly">
6
+            resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly">
7 7
         SELECT
8 8
             org_id,
9 9
             count( customer_id ) as customer_num
@@ -17,7 +17,7 @@
17 17
     </select>
18 18
 
19 19
     <select id="getFollowUpStatisticMonthly"
20
-            resultType="com.huiju.estateagents.statistic.entity.TaCustomerStatisticMonthly">
20
+            resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly">
21 21
         SELECT
22 22
             org_id,
23 23
             count( DISTINCT ( customer_id ) ) as customer_num
@@ -29,7 +29,7 @@
29 29
             org_id
30 30
     </select>
31 31
     <select id="getVisiteStatisticMonthly"
32
-            resultType="com.huiju.estateagents.statistic.entity.TaCustomerStatisticMonthly">
32
+            resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly">
33 33
         SELECT
34 34
             count( DISTINCT ( c.customer_id ) ) as customer_num,
35 35
             c.org_id
@@ -44,7 +44,7 @@
44 44
         GROUP BY
45 45
             c.org_id
46 46
     </select>
47
-    <select id="getMonthlyList" resultType="com.huiju.estateagents.statistic.entity.TaCustomerStatisticMonthly">
47
+    <select id="getMonthlyList" resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly">
48 48
         SELECT
49 49
           *
50 50
         FROM