浏览代码

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

胡轶钦 5 年前
父节点
当前提交
5c24d889b7
共有 46 个文件被更改,包括 679 次插入161 次删除
  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 查看文件

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

+ 6
- 0
src/main/java/com/huiju/estateagents/center/taUser/entity/TaUser.java 查看文件

184
      */
184
      */
185
     @TableField(exist = false)
185
     @TableField(exist = false)
186
     private Integer cityId;
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 查看文件

100
 			taUser.setLoginName(taUser.getPhone());
100
 			taUser.setLoginName(taUser.getPhone());
101
 		}
101
 		}
102
 
102
 
103
+		//判断默认城市是否在维护城市内
104
+		verificationCity(taUser.getSelectCityTree(),taUser.getDefaultCityId());
105
+
103
 		QueryWrapper<TaUser> wrapper = new QueryWrapper<>();
106
 		QueryWrapper<TaUser> wrapper = new QueryWrapper<>();
104
 		wrapper.eq("phone", taUser.getPhone()).or().eq("login_Name", taUser.getLoginName());
107
 		wrapper.eq("phone", taUser.getPhone()).or().eq("login_Name", taUser.getLoginName());
105
 		List<TaUser> taUserList = this.list(wrapper);
108
 		List<TaUser> taUserList = this.list(wrapper);
113
 		taOrg.setWaterMark(taUser.getWaterMark());
116
 		taOrg.setWaterMark(taUser.getWaterMark());
114
 		taOrg.setCreateDate(LocalDateTime.now());
117
 		taOrg.setCreateDate(LocalDateTime.now());
115
 		taOrg.setBuildingNum(taUser.getOrgNum());
118
 		taOrg.setBuildingNum(taUser.getOrgNum());
116
-		taOrg.setDefaultCityId(taUser.getCityId());
119
+		taOrg.setDefaultCityId(taUser.getDefaultCityId());
117
 		if (taOrgMapper.insert(taOrg) < 1) {
120
 		if (taOrgMapper.insert(taOrg) < 1) {
118
 			throw new Exception("生成用户公司信息失败");
121
 			throw new Exception("生成用户公司信息失败");
119
 		}
122
 		}
165
 
168
 
166
 	// 维护公司所在城市
169
 	// 维护公司所在城市
167
 	public void addAndupdate(ArrayList<Integer> selectCityTree,boolean isA,Integer orgid){
170
 	public void addAndupdate(ArrayList<Integer> selectCityTree,boolean isA,Integer orgid){
168
-
171
+			// 查询当前所有的市
169
 			QueryWrapper<TdCity> tdCityQuery= new QueryWrapper<>();
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
 		// isA=true删除所有城市重新添加
176
 		// isA=true删除所有城市重新添加
174
 		if (isA == true){
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
 			 // 对比现在的城市ID
183
 			 // 对比现在的城市ID
180
 			 for(Integer city:selectCityTree){
184
 			 for(Integer city:selectCityTree){
181
 				for (TdCity tdCity : tdCityList){
185
 				for (TdCity tdCity : tdCityList){
186
+						// 入库城市
182
 					if (city.equals(tdCity.getId())){
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
 	@Override
216
 	@Override
193
 	public TaUser getInfoWithOrg(Integer id) {
217
 	public TaUser getInfoWithOrg(Integer id) {
194
 		TaUser taUser = this.getById(id);
218
 		TaUser taUser = this.getById(id);
201
 			taUser.setOrgName(taOrg.getName());
225
 			taUser.setOrgName(taOrg.getName());
202
 			taUser.setWaterMark(taOrg.getWaterMark());
226
 			taUser.setWaterMark(taOrg.getWaterMark());
203
 			taUser.setOrgNum(taOrg.getBuildingNum());
227
 			taUser.setOrgNum(taOrg.getBuildingNum());
204
-			taOrg.setDefaultCityId(taUser.getCityId());
228
+			taUser.setDefaultCityId(taOrg.getDefaultCityId());
205
 		}
229
 		}
206
 
230
 
207
 		QueryWrapper<TaMiniapp> wrapper = new QueryWrapper<>();
231
 		QueryWrapper<TaMiniapp> wrapper = new QueryWrapper<>();
216
 
240
 
217
 		taUser.setMiniapp(taMiniapp);
241
 		taUser.setMiniapp(taMiniapp);
218
 		taUser.setLoginPassword(null);
242
 		taUser.setLoginPassword(null);
243
+		// 查询所有城市id
244
+		ArrayList<Integer> taOrgCityList= taOrgCityMapper.selectByIdCity(taUser.getOrgId());
245
+		taUser.setSelectCityTree(taOrgCityList);
219
 		return taUser;
246
 		return taUser;
220
 	}
247
 	}
221
 
248
 
222
 	@Override
249
 	@Override
223
 	public void updateInfoWithOrg(TaUser taUser) throws Exception {
250
 	public void updateInfoWithOrg(TaUser taUser) throws Exception {
251
+		//判断默认城市是否在维护城市内
252
+		verificationCity(taUser.getSelectCityTree(),taUser.getDefaultCityId());
253
+
224
 		TaOrg taOrg = taOrgMapper.selectById(taUser.getOrgId());
254
 		TaOrg taOrg = taOrgMapper.selectById(taUser.getOrgId());
225
 		if (null != taOrg) {
255
 		if (null != taOrg) {
226
 			taOrg.setName(taUser.getOrgName());
256
 			taOrg.setName(taUser.getOrgName());
227
 			taOrg.setWaterMark(taUser.getWaterMark());
257
 			taOrg.setWaterMark(taUser.getWaterMark());
228
 			taOrg.setBuildingNum(taUser.getOrgNum());
258
 			taOrg.setBuildingNum(taUser.getOrgNum());
229
-
259
+			taOrg.setDefaultCityId(taUser.getDefaultCityId());
230
 			if (taOrgMapper.updateById(taOrg) < 1) {
260
 			if (taOrgMapper.updateById(taOrg) < 1) {
231
 				throw new Exception("更新用户公司信息失败");
261
 				throw new Exception("更新用户公司信息失败");
232
 			}
262
 			}

+ 3
- 2
src/main/java/com/huiju/estateagents/controller/MiniAppController.java 查看文件

204
 
204
 
205
             // 获取其余信息
205
             // 获取其余信息
206
             Map<String, Object> extraInfo = taPersonService.getExtraInfo(taPerson.getPersonId());
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
                 QueryWrapper<TaOrg>orgQueryWrapper = new QueryWrapper<>();
209
                 QueryWrapper<TaOrg>orgQueryWrapper = new QueryWrapper<>();
209
                 orgQueryWrapper.eq("org_id",taPerson.getOrgId());
210
                 orgQueryWrapper.eq("org_id",taPerson.getOrgId());
210
                 TaOrg org = taOrgService.getOne(orgQueryWrapper);
211
                 TaOrg org = taOrgService.getOne(orgQueryWrapper);
211
                 taPerson.setOrg(org);
212
                 taPerson.setOrg(org);
212
-            }
213
+//            }
213
             Map<String, Object> result = new HashMap<>();
214
             Map<String, Object> result = new HashMap<>();
214
             result.put("miniApp", miniResp);
215
             result.put("miniApp", miniResp);
215
             result.put("person", taPerson);
216
             result.put("person", taPerson);

+ 143
- 0
src/main/java/com/huiju/estateagents/controller/TaBuildingMapRelationController.java 查看文件

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 查看文件

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

+ 23
- 4
src/main/java/com/huiju/estateagents/controller/TdCityController.java 查看文件

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

+ 1
- 0
src/main/java/com/huiju/estateagents/entity/TaBuilding.java 查看文件

201
     /**
201
     /**
202
      * 地图数据
202
      * 地图数据
203
      */
203
      */
204
+    @TableField(exist = false)
204
     private String mapJson;
205
     private String mapJson;
205
 
206
 
206
     /**
207
     /**

+ 51
- 0
src/main/java/com/huiju/estateagents/entity/TaBuildingMapRelation.java 查看文件

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 查看文件

24
 public class TaOrgCity implements Serializable {
24
 public class TaOrgCity implements Serializable {
25
 
25
 
26
     private static final long serialVersionUID = 1L;
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
      * 省份id
35
      * 省份id
29
      * 城市id
36
      * 城市id
30
      */
37
      */
31
-    private Integer id;
38
+    private Integer cityId;
32
 
39
 
33
     /**
40
     /**
34
      * 省市区名称
41
      * 省市区名称
49
      * 上级ID
56
      * 上级ID
50
      */
57
      */
51
     private Integer parentid;
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 查看文件

107
      */
107
      */
108
     @TableField(exist = false)
108
     @TableField(exist = false)
109
     private String buildingName;
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 查看文件

1
 package com.huiju.estateagents.job;
1
 package com.huiju.estateagents.job;
2
 
2
 
3
 import com.huiju.estateagents.base.BaseController;
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
 import org.slf4j.Logger;
7
 import org.slf4j.Logger;
16
 import org.slf4j.LoggerFactory;
8
 import org.slf4j.LoggerFactory;
17
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.beans.factory.annotation.Autowired;
36
     private final Logger logger = LoggerFactory.getLogger(CustomerStatisticTimeJob.class);
28
     private final Logger logger = LoggerFactory.getLogger(CustomerStatisticTimeJob.class);
37
 
29
 
38
     @Autowired
30
     @Autowired
39
-    private ITaCustomerStatisticDailyService customerStatisticDailyService;
31
+    private ITsCustomerStatisticDailyService customerStatisticDailyService;
40
     
32
     
41
     @Autowired
33
     @Autowired
42
-    private ITaCustomerGenderStatisticService taCustomerGenderStatisticService;
34
+    private ITsCustomerGenderStatisticService taCustomerGenderStatisticService;
43
     
35
     
44
     @Autowired
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 查看文件

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 查看文件

3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.huiju.estateagents.entity.TaOrgCity;
4
 import com.huiju.estateagents.entity.TaOrgCity;
5
 import org.apache.ibatis.annotations.Mapper;
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
  * <p>
12
  * <p>
14
  */
18
  */
15
 @Mapper
19
 @Mapper
16
 public interface TaOrgCityMapper extends BaseMapper<TaOrgCity> {
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 查看文件

20
 public interface TdCityMapper extends BaseMapper<TdCity> {
20
 public interface TdCityMapper extends BaseMapper<TdCity> {
21
     List<TdCity> selectCity(@Param("leveltype")String leveltype,@Param("status") String status);
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 查看文件

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 查看文件

17
 public interface ITdCityService extends IService<TdCity> {
17
 public interface ITdCityService extends IService<TdCity> {
18
     List<TdCity> selectCity(String leveltype,String status);
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 查看文件

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 查看文件

13
 import com.huiju.estateagents.common.StringUtils;
13
 import com.huiju.estateagents.common.StringUtils;
14
 import com.huiju.estateagents.entity.*;
14
 import com.huiju.estateagents.entity.*;
15
 import com.huiju.estateagents.mapper.*;
15
 import com.huiju.estateagents.mapper.*;
16
+import com.huiju.estateagents.service.ITaBuildingMapRelationService;
16
 import com.huiju.estateagents.service.ITaBuildingService;
17
 import com.huiju.estateagents.service.ITaBuildingService;
17
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
18
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
18
 import com.huiju.estateagents.service.TaPosterService;
19
 import com.huiju.estateagents.service.TaPosterService;
86
     @Autowired
87
     @Autowired
87
     private  TaOrgMapper  taOrgMapper;
88
     private  TaOrgMapper  taOrgMapper;
88
 
89
 
90
+    @Autowired
91
+    private ITaBuildingMapRelationService iTaBuildingMapRelationService;
92
+
89
     @Override
93
     @Override
90
     public ResponseBean buildingList(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain, Integer orgId) {
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
         Page<TaBuilding> page = new Page<>();
95
         Page<TaBuilding> page = new Page<>();
168
         building.setPosters(taPosterService.getPostersForTarget(id,CommConstant.POSTER_CONTENT_TYPE_BUILDING));
172
         building.setPosters(taPosterService.getPostersForTarget(id,CommConstant.POSTER_CONTENT_TYPE_BUILDING));
169
         building.setShareContents(taShareContentService.getPostersForTarget(id,CommConstant.POSTER_CONTENT_TYPE_BUILDING));
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
         return ResponseBean.success(building);
182
         return ResponseBean.success(building);
172
     }
183
     }
173
 
184
 
247
         shareActivityQueryWrapper.eq("status", 1);
258
         shareActivityQueryWrapper.eq("status", 1);
248
         shareActivityQueryWrapper.in("activity_status", 0, 1);
259
         shareActivityQueryWrapper.in("activity_status", 0, 1);
249
         List<TaShareActivity> shareActivityList = taShareActivityMapper.selectList(shareActivityQueryWrapper);
260
         List<TaShareActivity> shareActivityList = taShareActivityMapper.selectList(shareActivityQueryWrapper);
250
-
251
         building.setShareActivityList(shareActivityList);
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
         return ResponseBean.success(building);
270
         return ResponseBean.success(building);
255
     }
271
     }
258
     public ResponseBean buildingUpdate(String parameter, Integer orgId) {
274
     public ResponseBean buildingUpdate(String parameter, Integer orgId) {
259
         JSONObject object= JSONObject.parseObject(parameter);
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
         UpdateWrapper<TaBuilding> updateWrapper = new UpdateWrapper<>();
280
         UpdateWrapper<TaBuilding> updateWrapper = new UpdateWrapper<>();
328
         if (CollectionUtils.isNotEmpty(buildingProjectTypeArray)) {
344
         if (CollectionUtils.isNotEmpty(buildingProjectTypeArray)) {
329
             taBuildingProjectTypeMapper.insertBuildingProjectTypeBatch(buildingProjectTypeArray, building.getBuildingId());
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
         return ResponseBean.success(building);
361
         return ResponseBean.success(building);
332
     }
362
     }
333
 
363
 
350
             return ResponseBean.error("楼盘已超过最大限制", ResponseBean.ERROR_UNAVAILABLE);
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
         if(null!= object.getDate("openingDate")){
384
         if(null!= object.getDate("openingDate")){
355
             building.setOpeningDate(DateUtils.date2LocalDateTime(object.getDate("openingDate")));
385
             building.setOpeningDate(DateUtils.date2LocalDateTime(object.getDate("openingDate")));
356
         }
386
         }
401
             taBuildingProjectTypeMapper.insertBuildingProjectTypeBatch(buildingProjectTypeArray, building.getBuildingId());
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
         return ResponseBean.success(building);
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
     @Override
465
     @Override
408
     public ResponseBean buildingUpdateStatus(String parameter, Integer orgId) {
466
     public ResponseBean buildingUpdateStatus(String parameter, Integer orgId) {
409
         TaBuilding  building = new TaBuilding();
467
         TaBuilding  building = new TaBuilding();
449
         }
507
         }
450
 
508
 
451
         JSONObject jsonobject = JSONObject.parseObject(parameter);
509
         JSONObject jsonobject = JSONObject.parseObject(parameter);
510
+
452
         //图片数组
511
         //图片数组
453
         String imgStr = jsonobject.getString("img");
512
         String imgStr = jsonobject.getString("img");
454
         //转集合
513
         //转集合

+ 42
- 0
src/main/java/com/huiju/estateagents/service/impl/TaPersonVisitRecordServiceImpl.java 查看文件

2
 
2
 
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.huiju.estateagents.entity.HelpActivity;
6
+import com.huiju.estateagents.entity.TaBuildingDynamic;
5
 import com.huiju.estateagents.entity.TaPerson;
7
 import com.huiju.estateagents.entity.TaPerson;
6
 import com.huiju.estateagents.entity.TaPersonVisitRecord;
8
 import com.huiju.estateagents.entity.TaPersonVisitRecord;
7
 import com.huiju.estateagents.entity.TaRecommendCustomer;
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
 import com.huiju.estateagents.mapper.TaPersonMapper;
13
 import com.huiju.estateagents.mapper.TaPersonMapper;
9
 import com.huiju.estateagents.mapper.TaPersonVisitRecordMapper;
14
 import com.huiju.estateagents.mapper.TaPersonVisitRecordMapper;
10
 import com.huiju.estateagents.mapper.TaRecommendCustomerMapper;
15
 import com.huiju.estateagents.mapper.TaRecommendCustomerMapper;
16
+import com.huiju.estateagents.mapper.TaShareActivityMapper;
11
 import com.huiju.estateagents.service.ITaPersonVisitRecordService;
17
 import com.huiju.estateagents.service.ITaPersonVisitRecordService;
12
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.beans.factory.annotation.Autowired;
13
 import org.springframework.stereotype.Service;
19
 import org.springframework.stereotype.Service;
31
 	@Autowired
37
 	@Autowired
32
 	private TaPersonVisitRecordMapper personVisitRecordMapper;
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
 	public IPage<TaPersonVisitRecord> getPersonVisitRecordList(IPage<TaPersonVisitRecord> pg, String customerId) {
57
 	public IPage<TaPersonVisitRecord> getPersonVisitRecordList(IPage<TaPersonVisitRecord> pg, String customerId) {
43
 		TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(customerId);
58
 		TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(customerId);
44
 		IPage<TaPersonVisitRecord> result = personVisitRecordMapper.getPersonVisitRecordList(pg,taRecommendCustomer.getPersonId());
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
 		return result;
87
 		return result;
46
 	}
88
 	}
47
 //    @Autowired
89
 //    @Autowired

+ 8
- 0
src/main/java/com/huiju/estateagents/service/impl/TdCityServiceImpl.java 查看文件

2
 
2
 
3
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
3
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
 import com.huiju.estateagents.entity.TdCity;
4
 import com.huiju.estateagents.entity.TdCity;
5
+import com.huiju.estateagents.mapper.TaOrgCityMapper;
5
 import com.huiju.estateagents.mapper.TdCityMapper;
6
 import com.huiju.estateagents.mapper.TdCityMapper;
6
 import com.huiju.estateagents.service.ITdCityService;
7
 import com.huiju.estateagents.service.ITdCityService;
7
 import org.springframework.beans.factory.annotation.Autowired;
8
 import org.springframework.beans.factory.annotation.Autowired;
26
         return tdCityMapper.selectCity(leveltype, status);
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 查看文件

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

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

src/main/java/com/huiju/estateagents/statistic/controller/TaCustomerStatisticDailyController.java → src/main/java/com/huiju/estateagents/statistic/controller/TsCustomerStatisticDailyController.java 查看文件

5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.huiju.estateagents.base.BaseController;
6
 import com.huiju.estateagents.base.BaseController;
7
 import com.huiju.estateagents.base.ResponseBean;
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
 import org.slf4j.Logger;
10
 import org.slf4j.Logger;
11
 import org.slf4j.LoggerFactory;
11
 import org.slf4j.LoggerFactory;
12
 import org.springframework.beans.factory.annotation.Autowired;
12
 import org.springframework.beans.factory.annotation.Autowired;
31
  */
31
  */
32
 @RestController
32
 @RestController
33
 @RequestMapping("/api")
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
     @Autowired
38
     @Autowired
39
-    public ITaCustomerStatisticDailyService iTaCustomerStatisticDailyService;
39
+    public ITsCustomerStatisticDailyService iTaCustomerStatisticDailyService;
40
 
40
 
41
 
41
 
42
     /**
42
     /**
51
         ResponseBean responseBean = new ResponseBean();
51
         ResponseBean responseBean = new ResponseBean();
52
         try {
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
             queryWrapper.orderByDesc("create_date");
56
             queryWrapper.orderByDesc("create_date");
57
 
57
 
58
-            IPage<TaCustomerStatisticDaily> result = iTaCustomerStatisticDailyService.page(pg, queryWrapper);
58
+            IPage<TsCustomerStatisticDaily> result = iTaCustomerStatisticDailyService.page(pg, queryWrapper);
59
             responseBean.addSuccess(result);
59
             responseBean.addSuccess(result);
60
         }catch (Exception e){
60
         }catch (Exception e){
61
             e.printStackTrace();
61
             e.printStackTrace();
71
      * @return
71
      * @return
72
      */
72
      */
73
     @RequestMapping(value="/taCustomerStatisticDaily",method= RequestMethod.POST)
73
     @RequestMapping(value="/taCustomerStatisticDaily",method= RequestMethod.POST)
74
-    public ResponseBean taCustomerStatisticDailyAdd(@RequestBody TaCustomerStatisticDaily taCustomerStatisticDaily){
74
+    public ResponseBean taCustomerStatisticDailyAdd(@RequestBody TsCustomerStatisticDaily taCustomerStatisticDaily){
75
         ResponseBean responseBean = new ResponseBean();
75
         ResponseBean responseBean = new ResponseBean();
76
         try {
76
         try {
77
             if (iTaCustomerStatisticDailyService.save(taCustomerStatisticDaily)){
77
             if (iTaCustomerStatisticDailyService.save(taCustomerStatisticDaily)){
117
      */
117
      */
118
     @RequestMapping(value="/taCustomerStatisticDaily/{id}",method= RequestMethod.PUT)
118
     @RequestMapping(value="/taCustomerStatisticDaily/{id}",method= RequestMethod.PUT)
119
     public ResponseBean taCustomerStatisticDailyUpdate(@PathVariable Integer id,
119
     public ResponseBean taCustomerStatisticDailyUpdate(@PathVariable Integer id,
120
-                                        @RequestBody TaCustomerStatisticDaily taCustomerStatisticDaily){
120
+                                        @RequestBody TsCustomerStatisticDaily taCustomerStatisticDaily){
121
         ResponseBean responseBean = new ResponseBean();
121
         ResponseBean responseBean = new ResponseBean();
122
         try {
122
         try {
123
             if (iTaCustomerStatisticDailyService.updateById(taCustomerStatisticDaily)){
123
             if (iTaCustomerStatisticDailyService.updateById(taCustomerStatisticDaily)){
160
                                                      HttpServletRequest request){
160
                                                      HttpServletRequest request){
161
         ResponseBean responseBean = new ResponseBean();
161
         ResponseBean responseBean = new ResponseBean();
162
         try {
162
         try {
163
-            List<TaCustomerStatisticDaily> list = iTaCustomerStatisticDailyService.getDailyList(customerType,getOrgId(request));
163
+            List<TsCustomerStatisticDaily> list = iTaCustomerStatisticDailyService.getDailyList(customerType,getOrgId(request));
164
             responseBean.addSuccess(list);
164
             responseBean.addSuccess(list);
165
         }catch (Exception e){
165
         }catch (Exception e){
166
             e.printStackTrace();
166
             e.printStackTrace();

src/main/java/com/huiju/estateagents/statistic/controller/TaCustomerStatisticMonthlyController.java → src/main/java/com/huiju/estateagents/statistic/controller/TsCustomerStatisticMonthlyController.java 查看文件

5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.huiju.estateagents.base.BaseController;
6
 import com.huiju.estateagents.base.BaseController;
7
 import com.huiju.estateagents.base.ResponseBean;
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
 import org.slf4j.Logger;
10
 import org.slf4j.Logger;
11
 import org.slf4j.LoggerFactory;
11
 import org.slf4j.LoggerFactory;
12
 import org.springframework.beans.factory.annotation.Autowired;
12
 import org.springframework.beans.factory.annotation.Autowired;
31
  */
31
  */
32
 @RestController
32
 @RestController
33
 @RequestMapping("/api")
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
     @Autowired
38
     @Autowired
39
-    public ITaCustomerStatisticMonthlyService iTaCustomerStatisticMonthlyService;
39
+    public ITsCustomerStatisticMonthlyService iTaCustomerStatisticMonthlyService;
40
 
40
 
41
 
41
 
42
     /**
42
     /**
51
         ResponseBean responseBean = new ResponseBean();
51
         ResponseBean responseBean = new ResponseBean();
52
         try {
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
             queryWrapper.orderByDesc("create_date");
56
             queryWrapper.orderByDesc("create_date");
57
 
57
 
58
-            IPage<TaCustomerStatisticMonthly> result = iTaCustomerStatisticMonthlyService.page(pg, queryWrapper);
58
+            IPage<TsCustomerStatisticMonthly> result = iTaCustomerStatisticMonthlyService.page(pg, queryWrapper);
59
             responseBean.addSuccess(result);
59
             responseBean.addSuccess(result);
60
         }catch (Exception e){
60
         }catch (Exception e){
61
             e.printStackTrace();
61
             e.printStackTrace();
71
      * @return
71
      * @return
72
      */
72
      */
73
     @RequestMapping(value="/taCustomerStatisticMonthly",method= RequestMethod.POST)
73
     @RequestMapping(value="/taCustomerStatisticMonthly",method= RequestMethod.POST)
74
-    public ResponseBean taCustomerStatisticMonthlyAdd(@RequestBody TaCustomerStatisticMonthly taCustomerStatisticMonthly){
74
+    public ResponseBean taCustomerStatisticMonthlyAdd(@RequestBody TsCustomerStatisticMonthly taCustomerStatisticMonthly){
75
         ResponseBean responseBean = new ResponseBean();
75
         ResponseBean responseBean = new ResponseBean();
76
         try {
76
         try {
77
             if (iTaCustomerStatisticMonthlyService.save(taCustomerStatisticMonthly)){
77
             if (iTaCustomerStatisticMonthlyService.save(taCustomerStatisticMonthly)){
117
      */
117
      */
118
     @RequestMapping(value="/taCustomerStatisticMonthly/{id}",method= RequestMethod.PUT)
118
     @RequestMapping(value="/taCustomerStatisticMonthly/{id}",method= RequestMethod.PUT)
119
     public ResponseBean taCustomerStatisticMonthlyUpdate(@PathVariable Integer id,
119
     public ResponseBean taCustomerStatisticMonthlyUpdate(@PathVariable Integer id,
120
-                                        @RequestBody TaCustomerStatisticMonthly taCustomerStatisticMonthly){
120
+                                        @RequestBody TsCustomerStatisticMonthly taCustomerStatisticMonthly){
121
         ResponseBean responseBean = new ResponseBean();
121
         ResponseBean responseBean = new ResponseBean();
122
         try {
122
         try {
123
             if (iTaCustomerStatisticMonthlyService.updateById(taCustomerStatisticMonthly)){
123
             if (iTaCustomerStatisticMonthlyService.updateById(taCustomerStatisticMonthly)){
161
         ResponseBean responseBean = new ResponseBean();
161
         ResponseBean responseBean = new ResponseBean();
162
         try {
162
         try {
163
             //查询月客户分析数据
163
             //查询月客户分析数据
164
-            List<TaCustomerStatisticMonthly> result = iTaCustomerStatisticMonthlyService.getCustomerMonthlyList(customerType, getOrgId(request));
164
+            List<TsCustomerStatisticMonthly> result = iTaCustomerStatisticMonthlyService.getCustomerMonthlyList(customerType, getOrgId(request));
165
             responseBean.addSuccess(result);
165
             responseBean.addSuccess(result);
166
         }catch (Exception e){
166
         }catch (Exception e){
167
             e.printStackTrace();
167
             e.printStackTrace();

src/main/java/com/huiju/estateagents/statistic/entity/TaCustomerGenderStatistic.java → src/main/java/com/huiju/estateagents/statistic/entity/TsCustomerGenderStatistic.java 查看文件

21
 @Data
21
 @Data
22
 @EqualsAndHashCode(callSuper = false)
22
 @EqualsAndHashCode(callSuper = false)
23
 @Accessors(chain = true)
23
 @Accessors(chain = true)
24
-public class TaCustomerGenderStatistic implements Serializable {
24
+public class TsCustomerGenderStatistic implements Serializable {
25
 
25
 
26
     private static final long serialVersionUID = 1L;
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 查看文件

22
 @EqualsAndHashCode(callSuper = false)
22
 @EqualsAndHashCode(callSuper = false)
23
 @Accessors(chain = true)
23
 @Accessors(chain = true)
24
 @TableName("ta_customer_statistic_daily")
24
 @TableName("ta_customer_statistic_daily")
25
-public class TaCustomerStatisticDaily implements Serializable {
25
+public class TsCustomerStatisticDaily implements Serializable {
26
 
26
 
27
     private static final long serialVersionUID = 1L;
27
     private static final long serialVersionUID = 1L;
28
 
28
 
51
      * 创建时间
51
      * 创建时间
52
      */
52
      */
53
     private LocalDateTime createDate;
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 查看文件

22
 @EqualsAndHashCode(callSuper = false)
22
 @EqualsAndHashCode(callSuper = false)
23
 @Accessors(chain = true)
23
 @Accessors(chain = true)
24
 @TableName("ta_customer_statistic_monthly")
24
 @TableName("ta_customer_statistic_monthly")
25
-public class TaCustomerStatisticMonthly implements Serializable {
25
+public class TsCustomerStatisticMonthly implements Serializable {
26
 
26
 
27
     private static final long serialVersionUID = 1L;
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 查看文件

2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.huiju.estateagents.statistic.entity.GenderStatistic;
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
 import org.apache.ibatis.annotations.Mapper;
6
 import org.apache.ibatis.annotations.Mapper;
7
 
7
 
8
 import java.util.List;
8
 import java.util.List;
9
-import java.util.Map;
10
 
9
 
11
 /**
10
 /**
12
  * <p>
11
  * <p>
17
  * @since 2019-11-08
16
  * @since 2019-11-08
18
  */
17
  */
19
 @Mapper
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 查看文件

1
 package com.huiju.estateagents.statistic.mapper;
1
 package com.huiju.estateagents.statistic.mapper;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Mapper;
6
 import org.apache.ibatis.annotations.Param;
6
 import org.apache.ibatis.annotations.Param;
7
 
7
 
8
 import java.time.LocalDateTime;
8
 import java.time.LocalDateTime;
9
 import java.util.List;
9
 import java.util.List;
10
-import java.util.Map;
11
 
10
 
12
 /**
11
 /**
13
  * <p>
12
  * <p>
18
  * @since 2019-11-08
17
  * @since 2019-11-08
19
  */
18
  */
20
 @Mapper
19
 @Mapper
21
-public interface TaCustomerStatisticDailyMapper extends BaseMapper<TaCustomerStatisticDaily> {
20
+public interface TsCustomerStatisticDailyMapper extends BaseMapper<TsCustomerStatisticDaily> {
22
 	
21
 	
23
 	/**
22
 	/**
24
 	 * 获取当天跟进客户数
23
 	 * 获取当天跟进客户数
25
 	 * @param nowDate
24
 	 * @param nowDate
26
 	 * @return
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
 	 * @param status
32
 	 * @param status
34
 	 * @return
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
 	 * @param checkin
40
 	 * @param checkin
42
 	 * @return
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
 	 * 获取31天的统计数据
46
 	 * 获取31天的统计数据
51
 	 * @param beforeDate
50
 	 * @param beforeDate
52
 	 * @return
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
 	int deleteNowDate(@Param("nowDate") LocalDateTime nowDate,@Param("customerType") String customerType);
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 查看文件

1
 package com.huiju.estateagents.statistic.mapper;
1
 package com.huiju.estateagents.statistic.mapper;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Mapper;
6
 import org.apache.ibatis.annotations.Param;
6
 import org.apache.ibatis.annotations.Param;
7
 
7
 
17
  * @since 2019-11-08
17
  * @since 2019-11-08
18
  */
18
  */
19
 @Mapper
19
 @Mapper
20
-public interface TaCustomerStatisticMonthlyMapper extends BaseMapper<TaCustomerStatisticMonthly> {
20
+public interface TsCustomerStatisticMonthlyMapper extends BaseMapper<TsCustomerStatisticMonthly> {
21
 	
21
 	
22
 	/**
22
 	/**
23
 	 * 获取一个月新增客户的数据插入
23
 	 * 获取一个月新增客户的数据插入
25
 	 * @param status
25
 	 * @param status
26
 	 * @return
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
 	 * @param nowDate
32
 	 * @param nowDate
33
 	 * @return
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
 	 * @param checkin
40
 	 * @param checkin
41
 	 * @return
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
 	 * 获取12个月的统计数据
46
 	 * 获取12个月的统计数据
50
 	 * @param beforeDate
50
 	 * @param beforeDate
51
 	 * @return
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 查看文件

1
 package com.huiju.estateagents.statistic.service;
1
 package com.huiju.estateagents.statistic.service;
2
 
2
 
3
 import com.baomidou.mybatisplus.extension.service.IService;
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
 import java.time.LocalDateTime;
6
 import java.time.LocalDateTime;
7
 
7
 
13
  * @author jobob
13
  * @author jobob
14
  * @since 2019-11-08
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 查看文件

1
 package com.huiju.estateagents.statistic.service;
1
 package com.huiju.estateagents.statistic.service;
2
 
2
 
3
 import com.baomidou.mybatisplus.extension.service.IService;
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
 import java.time.LocalDateTime;
6
 import java.time.LocalDateTime;
7
 import java.util.List;
7
 import java.util.List;
14
  * @author jobob
14
  * @author jobob
15
  * @since 2019-11-08
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
 	 * @param orgId
40
 	 * @param orgId
41
 	 * @return
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 查看文件

1
 package com.huiju.estateagents.statistic.service;
1
 package com.huiju.estateagents.statistic.service;
2
 
2
 
3
 import com.baomidou.mybatisplus.extension.service.IService;
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
 import java.time.LocalDateTime;
6
 import java.time.LocalDateTime;
7
 import java.util.List;
7
 import java.util.List;
14
  * @author jobob
14
  * @author jobob
15
  * @since 2019-11-08
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
 	 * @param orgId
40
 	 * @param orgId
41
 	 * @return
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 查看文件

4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
 import com.huiju.estateagents.common.CommConstant;
5
 import com.huiju.estateagents.common.CommConstant;
6
 import com.huiju.estateagents.statistic.entity.GenderStatistic;
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
 import org.springframework.beans.factory.annotation.Autowired;
10
 import org.springframework.beans.factory.annotation.Autowired;
11
 import org.springframework.stereotype.Service;
11
 import org.springframework.stereotype.Service;
12
 
12
 
23
  * @since 2019-11-08
23
  * @since 2019-11-08
24
  */
24
  */
25
 @Service
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
 	@Autowired
28
 	@Autowired
29
-	private TaCustomerGenderStatisticMapper customerGenderStatisticMapper;
29
+	private TsCustomerGenderStatisticMapper customerGenderStatisticMapper;
30
 	
30
 	
31
 	/**
31
 	/**
32
 	 * 每天的新增客户性别统计
32
 	 * 每天的新增客户性别统计
80
 	 */
80
 	 */
81
 	private void saveBatchCustomerSexData(List<GenderStatistic> customerSexList, LocalDateTime nowDate,String customerType) {
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
 		queryWrapper.eq("customer_type",customerType);
84
 		queryWrapper.eq("customer_type",customerType);
85
 		customerGenderStatisticMapper.delete(queryWrapper);
85
 		customerGenderStatisticMapper.delete(queryWrapper);
86
 		
86
 		
87
-		List<TaCustomerGenderStatistic> list = new ArrayList<>();
87
+		List<TsCustomerGenderStatistic> list = new ArrayList<>();
88
 		//划分男女未知三条数据
88
 		//划分男女未知三条数据
89
 		customerSexList.forEach(e -> {
89
 		customerSexList.forEach(e -> {
90
-			TaCustomerGenderStatistic maleCustomer = new TaCustomerGenderStatistic();
90
+			TsCustomerGenderStatistic maleCustomer = new TsCustomerGenderStatistic();
91
 			maleCustomer.setCreateDate(nowDate);
91
 			maleCustomer.setCreateDate(nowDate);
92
 			maleCustomer.setGenderType(CommConstant.SEX_MALE);
92
 			maleCustomer.setGenderType(CommConstant.SEX_MALE);
93
 			maleCustomer.setCustomerType(customerType);
93
 			maleCustomer.setCustomerType(customerType);
96
 			maleCustomer.setOrgId(e.getOrgId());
96
 			maleCustomer.setOrgId(e.getOrgId());
97
 			list.add(maleCustomer);
97
 			list.add(maleCustomer);
98
 			
98
 			
99
-			TaCustomerGenderStatistic femaleCustomer = new TaCustomerGenderStatistic();
99
+			TsCustomerGenderStatistic femaleCustomer = new TsCustomerGenderStatistic();
100
 			femaleCustomer.setCreateDate(nowDate);
100
 			femaleCustomer.setCreateDate(nowDate);
101
 			femaleCustomer.setGenderType(CommConstant.SEX_FEMALE);
101
 			femaleCustomer.setGenderType(CommConstant.SEX_FEMALE);
102
 			femaleCustomer.setCustomerType(customerType);
102
 			femaleCustomer.setCustomerType(customerType);
105
 			femaleCustomer.setOrgId(e.getOrgId());
105
 			femaleCustomer.setOrgId(e.getOrgId());
106
 			list.add(femaleCustomer);
106
 			list.add(femaleCustomer);
107
 			
107
 			
108
-			TaCustomerGenderStatistic unknownCustomer = new TaCustomerGenderStatistic();
108
+			TsCustomerGenderStatistic unknownCustomer = new TsCustomerGenderStatistic();
109
 			unknownCustomer.setCreateDate(nowDate);
109
 			unknownCustomer.setCreateDate(nowDate);
110
 			unknownCustomer.setGenderType(CommConstant.SEX_UNKNOWN);
110
 			unknownCustomer.setGenderType(CommConstant.SEX_UNKNOWN);
111
 			unknownCustomer.setCustomerType(customerType);
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 查看文件

2
 
2
 
3
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
3
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
 import com.huiju.estateagents.common.CommConstant;
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
 import org.springframework.beans.factory.annotation.Autowired;
8
 import org.springframework.beans.factory.annotation.Autowired;
10
 import org.springframework.stereotype.Service;
9
 import org.springframework.stereotype.Service;
11
 
10
 
12
 import java.time.LocalDateTime;
11
 import java.time.LocalDateTime;
12
+import java.time.format.DateTimeFormatter;
13
 import java.util.ArrayList;
13
 import java.util.ArrayList;
14
 import java.util.List;
14
 import java.util.List;
15
-import java.util.Map;
16
 
15
 
17
 /**
16
 /**
18
  * <p>
17
  * <p>
23
  * @since 2019-11-08
22
  * @since 2019-11-08
24
  */
23
  */
25
 @Service
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
 	@Autowired
27
 	@Autowired
29
-	private TaCustomerStatisticDailyMapper customerStatisticDailyMapper;
28
+	private TsCustomerStatisticDailyMapper customerStatisticDailyMapper;
30
 	
29
 	
31
 	/**
30
 	/**
32
 	 * 每天的跟进客户统计
31
 	 * 每天的跟进客户统计
36
 	@Override
35
 	@Override
37
 	public void followUpStatisticDaily(LocalDateTime nowDate) {
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
 		statisticDailySaveBatch(list,nowDate,CommConstant.CUSTOMER_TYPE_FOLLOW);
40
 		statisticDailySaveBatch(list,nowDate,CommConstant.CUSTOMER_TYPE_FOLLOW);
42
 	}
41
 	}
49
 	@Override
48
 	@Override
50
 	public void newCustomerStatisticDaily(LocalDateTime nowDate) {
49
 	public void newCustomerStatisticDaily(LocalDateTime nowDate) {
51
 		//按当前时间获取当天的新增客户的数量,ta_recommend_customer 表的status 为1 的就是新增客户
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
 		statisticDailySaveBatch(list,nowDate,CommConstant.CUSTOMER_TYPE_NEW);
53
 		statisticDailySaveBatch(list,nowDate,CommConstant.CUSTOMER_TYPE_NEW);
55
 	}
54
 	}
62
 	@Override
61
 	@Override
63
 	public void visiteStatisticDaily(LocalDateTime nowDate) {
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
 		list.forEach(e -> {
66
 		list.forEach(e -> {
68
 			if (null != e.getOrgId() && !e.getOrgId().equals("null")){
67
 			if (null != e.getOrgId() && !e.getOrgId().equals("null")){
69
 				saveList.add(e);
68
 				saveList.add(e);
81
 	 * @return
80
 	 * @return
82
 	 */
81
 	 */
83
 	@Override
82
 	@Override
84
-	public List<TaCustomerStatisticDaily> getDailyList(String customerType, Integer orgId) {
83
+	public List<TsCustomerStatisticDaily> getDailyList(String customerType, Integer orgId) {
85
 		//当前日期
84
 		//当前日期
86
 		LocalDateTime nowDate = LocalDateTime.now();
85
 		LocalDateTime nowDate = LocalDateTime.now();
87
 		//31天前的日期
86
 		//31天前的日期
88
 		LocalDateTime beforeDate = nowDate.plusDays(-31);
87
 		LocalDateTime beforeDate = nowDate.plusDays(-31);
89
 		//获取31天的日期数据
88
 		//获取31天的日期数据
90
-		List<TaCustomerStatisticDaily> list = customerStatisticDailyMapper.getDailyList(customerType,orgId,nowDate,beforeDate);
89
+		List<TsCustomerStatisticDaily> list = customerStatisticDailyMapper.getDailyList(customerType,orgId,nowDate,beforeDate);
91
 		return list;
90
 		return list;
92
 	}
91
 	}
93
 	
92
 	
97
 	 * @param nowDate
96
 	 * @param nowDate
98
 	 * @param customerType
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
 		customerStatisticDailyMapper.deleteNowDate(nowDate,customerType);
105
 		customerStatisticDailyMapper.deleteNowDate(nowDate,customerType);
103
 		
106
 		
104
 		list.forEach(e -> {
107
 		list.forEach(e -> {
105
 			e.setCreateDate(nowDate);
108
 			e.setCreateDate(nowDate);
106
 			e.setCustomerType(customerType);
109
 			e.setCustomerType(customerType);
110
+			e.setDay(todayDate);
107
 		});
111
 		});
108
 		//批量保存
112
 		//批量保存
109
 		this.saveBatch(list);
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 查看文件

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

+ 6
- 3
src/main/resources/mapper/Activity.xml 查看文件

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

+ 2
- 0
src/main/resources/mapper/HelpActivityMapper.xml 查看文件

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

+ 5
- 0
src/main/resources/mapper/TaBuildingMapRelationMapper.xml 查看文件

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 查看文件

1
 <?xml version="1.0" encoding="UTF-8"?>
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">
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.mapper.TaOrgCityMapper">
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
 </mapper>
26
 </mapper>

+ 3
- 3
src/main/resources/mapper/TaRecommendCustomerMapper.xml 查看文件

607
 
607
 
608
     <select id="getMyCustStatistics" resultType="java.util.Map">
608
     <select id="getMyCustStatistics" resultType="java.util.Map">
609
         SELECT
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
         FROM
612
         FROM
613
             ta_recommend_customer
613
             ta_recommend_customer
614
         WHERE
614
         WHERE
631
         <if test="type == 'follow'">
631
         <if test="type == 'follow'">
632
           AND STATUS != 4
632
           AND STATUS != 4
633
             <if test="name != null and name !=''">
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
             </if>
635
             </if>
636
             <if test="phone != null and phone !=''">
636
             <if test="phone != null and phone !=''">
637
                 and phone like CONCAT('%',#{phone}, '%')
637
                 and phone like CONCAT('%',#{phone}, '%')

+ 28
- 1
src/main/resources/mapper/TdCityMapper.xml 查看文件

19
 ORDER BY
19
 ORDER BY
20
 	pinyin
20
 	pinyin
21
     </select>
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
 </mapper>
51
 </mapper>

src/main/resources/mapper/statistic/TaCustomerGenderStatisticMapper.xml → src/main/resources/mapper/statistic/TsCustomerGenderStatisticMapper.xml 查看文件

1
 <?xml version="1.0" encoding="UTF-8"?>
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">
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
     <select id="getNewCustomerSexCount" resultType="com.huiju.estateagents.statistic.entity.GenderStatistic">
5
     <select id="getNewCustomerSexCount" resultType="com.huiju.estateagents.statistic.entity.GenderStatistic">
6
         SELECT
6
         SELECT

src/main/resources/mapper/statistic/TaCustomerStatisticDailyMapper.xml → src/main/resources/mapper/statistic/TsCustomerStatisticDailyMapper.xml 查看文件

1
 <?xml version="1.0" encoding="UTF-8"?>
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">
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
     <delete id="deleteNowDate">
5
     <delete id="deleteNowDate">
6
         delete from ta_customer_statistic_daily
6
         delete from ta_customer_statistic_daily
8
         AND date_format( create_date, '%Y-%m-%d' ) = date_format( #{nowDate}, '%Y-%m-%d' )
8
         AND date_format( create_date, '%Y-%m-%d' ) = date_format( #{nowDate}, '%Y-%m-%d' )
9
     </delete>
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
         SELECT
12
         SELECT
13
             org_id,
13
             org_id,
14
             count( DISTINCT ( customer_id ) ) as customer_num
14
             count( DISTINCT ( customer_id ) ) as customer_num
20
             org_id
20
             org_id
21
     </select>
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
         SELECT
24
         SELECT
25
             org_id,
25
             org_id,
26
             count( customer_id ) as customer_num
26
             count( customer_id ) as customer_num
32
         GROUP BY
32
         GROUP BY
33
             org_id
33
             org_id
34
     </select>
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
         SELECT
36
         SELECT
37
             count( DISTINCT ( c.customer_id ) ) as customer_num,
37
             count( DISTINCT ( c.customer_id ) ) as customer_num,
38
             c.org_id
38
             c.org_id
48
             c.org_id
48
             c.org_id
49
     </select>
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
         SELECT
52
         SELECT
53
           *
53
           *
54
         FROM
54
         FROM

src/main/resources/mapper/statistic/TaCustomerStatisticMonthlyMapper.xml → src/main/resources/mapper/statistic/TsCustomerStatisticMonthlyMapper.xml 查看文件

1
 <?xml version="1.0" encoding="UTF-8"?>
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">
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
     <select id="getNewCustomerStatisticMonthly"
5
     <select id="getNewCustomerStatisticMonthly"
6
-            resultType="com.huiju.estateagents.statistic.entity.TaCustomerStatisticMonthly">
6
+            resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly">
7
         SELECT
7
         SELECT
8
             org_id,
8
             org_id,
9
             count( customer_id ) as customer_num
9
             count( customer_id ) as customer_num
17
     </select>
17
     </select>
18
 
18
 
19
     <select id="getFollowUpStatisticMonthly"
19
     <select id="getFollowUpStatisticMonthly"
20
-            resultType="com.huiju.estateagents.statistic.entity.TaCustomerStatisticMonthly">
20
+            resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly">
21
         SELECT
21
         SELECT
22
             org_id,
22
             org_id,
23
             count( DISTINCT ( customer_id ) ) as customer_num
23
             count( DISTINCT ( customer_id ) ) as customer_num
29
             org_id
29
             org_id
30
     </select>
30
     </select>
31
     <select id="getVisiteStatisticMonthly"
31
     <select id="getVisiteStatisticMonthly"
32
-            resultType="com.huiju.estateagents.statistic.entity.TaCustomerStatisticMonthly">
32
+            resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly">
33
         SELECT
33
         SELECT
34
             count( DISTINCT ( c.customer_id ) ) as customer_num,
34
             count( DISTINCT ( c.customer_id ) ) as customer_num,
35
             c.org_id
35
             c.org_id
44
         GROUP BY
44
         GROUP BY
45
             c.org_id
45
             c.org_id
46
     </select>
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
         SELECT
48
         SELECT
49
           *
49
           *
50
         FROM
50
         FROM