Parcourir la source

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents

魏熙美 il y a 5 ans
Parent
révision
bd8231612f

+ 1
- 1
pom.xml Voir le fichier

@@ -10,7 +10,7 @@
10 10
 	</parent>
11 11
 	<groupId>com.huiju</groupId>
12 12
 	<artifactId>estateagents</artifactId>
13
-	<version>v0.3.1</version>
13
+	<version>v0.3.2</version>
14 14
 	<name>estateagents</name>
15 15
 	<description>置业经纪人</description>
16 16
 

+ 1
- 4
src/main/java/com/huiju/estateagents/controller/MiniAppController.java Voir le fichier

@@ -208,10 +208,7 @@ public class MiniAppController {
208 208
             customerPersonQueryWrapper.eq("customer_id",customers.getCustomerId());
209 209
             List<TaCustomerPerson> list = taCustomerPersonService.list(customerPersonQueryWrapper);
210 210
             if(list.size()<=0){
211
-                TaCustomerPerson customerPerson = new TaCustomerPerson();
212
-                customerPerson.setCustomerId(customers.getCustomerId());
213
-                customerPerson.setPersonId(person.getPersonId());
214
-                taCustomerPersonService.save(customerPerson);
211
+                taCustomerPersonService.insertBean(person.getPersonId(),customers.getCustomerId());
215 212
             }
216 213
         }
217 214
 

+ 2
- 1
src/main/java/com/huiju/estateagents/controller/TaBuildingDynamicController.java Voir le fichier

@@ -234,11 +234,12 @@ public class TaBuildingDynamicController extends BaseController {
234 234
     }
235 235
 
236 236
     @RequestMapping(value = "/admin/buildingDynamic/delete", method = RequestMethod.DELETE)
237
-    public ResponseBean pageImdelect(@RequestParam(value = "id",required = false)String id) {
237
+    public ResponseBean buildingDynamicdelect(@RequestParam(value = "id",required = false)String id) {
238 238
         ResponseBean responseBean = iBuildingDynamicService.buildingDynamicDelete(id);
239 239
         return responseBean;
240 240
     }
241 241
 
242
+
242 243
     @RequestMapping(value = "/admin/buildingDynamic/send/{dynamicId}", method = RequestMethod.PUT)
243 244
     public ResponseBean send(@PathVariable String dynamicId) {
244 245
         ResponseBean responseBean = new ResponseBean();

+ 3
- 0
src/main/java/com/huiju/estateagents/mapper/TaCustomerPersonMapper.java Voir le fichier

@@ -3,7 +3,9 @@ package com.huiju.estateagents.mapper;
3 3
 
4 4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 5
 import com.huiju.estateagents.entity.TaCustomerPerson;
6
+import org.apache.ibatis.annotations.Insert;
6 7
 import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
7 9
 
8 10
 /**
9 11
  * <p>
@@ -15,5 +17,6 @@ import org.apache.ibatis.annotations.Mapper;
15 17
  */
16 18
 @Mapper
17 19
 public interface TaCustomerPersonMapper extends BaseMapper<TaCustomerPerson> {
20
+    void insertBean(@Param("personId") String personId, @Param("customerId") String customerId);
18 21
 
19 22
 }

+ 1
- 0
src/main/java/com/huiju/estateagents/service/ITaCustomerPersonService.java Voir le fichier

@@ -13,5 +13,6 @@ import com.huiju.estateagents.entity.TaCustomerPerson;
13 13
  * @since 2019-08-08
14 14
  */
15 15
 public interface ITaCustomerPersonService extends IService<TaCustomerPerson> {
16
+    void insertBean(String personId,String customerId);
16 17
 
17 18
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/TaBuildingDynamicServiceImpl.java Voir le fichier

@@ -336,7 +336,7 @@ public class TaBuildingDynamicServiceImpl extends ServiceImpl<TaBuildingDynamicM
336 336
             }
337 337
             return result;
338 338
         }else {
339
-            return null;
339
+            return page;
340 340
         }
341 341
     }
342 342
 }

+ 3
- 0
src/main/java/com/huiju/estateagents/service/impl/TaCustomerPersonServiceImpl.java Voir le fichier

@@ -18,4 +18,7 @@ import org.springframework.stereotype.Service;
18 18
 @Service
19 19
 public class TaCustomerPersonServiceImpl extends ServiceImpl<TaCustomerPersonMapper, TaCustomerPerson> implements ITaCustomerPersonService {
20 20
 
21
+    public void insertBean(String personId,String customerId){
22
+
23
+    }
21 24
 }

+ 2
- 2
src/main/java/com/huiju/estateagents/service/impl/TaNewsServiceImpl.java Voir le fichier

@@ -213,9 +213,9 @@ public class TaNewsServiceImpl extends ServiceImpl<TaNewsMapper, TaNews> impleme
213 213
 
214 214
         injectType(taNewsIPage.getRecords());
215 215
         if (null != targets&&targets.size()<=0 && mine){
216
-            return null;
217
-        }else {
218 216
             return page;
217
+        }else {
218
+            return taNewsIPage;
219 219
         }
220 220
 
221 221
     }

+ 6
- 0
src/main/java/com/huiju/estateagents/service/impl/TaPersonServiceImpl.java Voir le fichier

@@ -102,6 +102,12 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
102 102
             wrapper.eq("mini_openid", openid);
103 103
             wrapper.set("nickname", userInfo.getNickName());
104 104
             wrapper.set("avatarurl", userInfo.getAvatarUrl());
105
+            wrapper.set("gender",userInfo.getGender());
106
+            wrapper.set("city",userInfo.getCity());
107
+            wrapper.set("province",userInfo.getProvince());
108
+            wrapper.set("language",userInfo.getLanguage());
109
+            wrapper.set("union_id",userInfo.getUnionId());
110
+            wrapper.set("country",userInfo.getCountry());
105 111
             taPersonMapper.update(person, wrapper);
106 112
 
107 113
             person.setAvatarurl(userInfo.getAvatarUrl());

+ 348
- 345
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Voir le fichier

@@ -1,345 +1,348 @@
1
-package com.huiju.estateagents.service.impl;
2
-
3
-import ch.qos.logback.core.status.StatusUtil;
4
-import com.alibaba.fastjson.JSONObject;
5
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
7
-import com.baomidou.mybatisplus.core.metadata.IPage;
8
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
9
-import com.huiju.estateagents.base.ResponseBean;
10
-import com.huiju.estateagents.common.CommConstant;
11
-import com.huiju.estateagents.common.DateUtils;
12
-import com.huiju.estateagents.common.StringUtils;
13
-import com.huiju.estateagents.entity.TaPerson;
14
-import com.huiju.estateagents.entity.TaRecommendCustomer;
15
-import com.huiju.estateagents.mapper.TaPersonMapper;
16
-import com.huiju.estateagents.mapper.TaPersonVisitRecordMapper;
17
-import com.huiju.estateagents.mapper.TaRecommendCustomerMapper;
18
-import com.huiju.estateagents.service.IMiniAppService;
19
-import com.huiju.estateagents.service.ITaRecommendCustomerService;
20
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
21
-import org.springframework.beans.factory.annotation.Autowired;
22
-import org.springframework.stereotype.Service;
23
-
24
-import javax.naming.spi.ResolveResult;
25
-import java.time.LocalDateTime;
26
-import java.util.HashMap;
27
-import java.util.List;
28
-import java.util.Map;
29
-
30
-/**
31
- * <p>
32
- * 推荐客户表 服务实现类
33
- * </p>
34
- *
35
- * @author jobob
36
- * @since 2019-05-10
37
- */
38
-@Service
39
-public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCustomerMapper, TaRecommendCustomer> implements ITaRecommendCustomerService {
40
-
41
-    @Autowired
42
-    TaPersonMapper taPersonMapper;
43
-
44
-    @Autowired
45
-    TaRecommendCustomerMapper taRecommendCustomerMapper;
46
-
47
-    @Autowired
48
-    IMiniAppService iMiniAppService;
49
-
50
-    @Autowired
51
-    TaPersonVisitRecordMapper taPersonVisitRecordMapper;
52
-
53
-    @Override
54
-    public ResponseBean getMyCustList(String openid, String keywords, int pageNumber, int pageSize) {
55
-        List<TaPerson> taPersons = getPersonsByOpenId(openid);
56
-        if (null == taPersons || taPersons.size() != 1) {
57
-            return ResponseBean.error("验证当前人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
58
-        }
59
-
60
-        TaPerson taPerson = taPersons.get(0);
61
-
62
-        IPage<TaRecommendCustomer> page = new Page<>();
63
-        page.setCurrent(pageNumber);
64
-        page.setSize(pageSize);
65
-
66
-        QueryWrapper<TaRecommendCustomer> query = new QueryWrapper<>();
67
-        query.eq("person_id", taPerson.getPersonId());
68
-        query.like(null != keywords && "".equals(keywords.trim()), "name", keywords);
69
-        query.orderByDesc("report_date");
70
-
71
-        IPage<TaRecommendCustomer> result = taRecommendCustomerMapper.selectPage(page, query);
72
-        return ResponseBean.success(result);
73
-    }
74
-
75
-    @Override
76
-    public ResponseBean getCustDetail(String id) {
77
-        TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(id);
78
-
79
-        if (!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())) {
80
-            TaPerson taPerson = taPersonMapper.selectById(taRecommendCustomer.getRealtyConsultant());
81
-            if (null != taPerson) {
82
-                taRecommendCustomer.setConsultants(new HashMap<String, Object>() {{
83
-                    put("name", taPerson.getName());
84
-                    put("phone", taPerson.getTel());
85
-                    put("photo", taPerson.getPhoto());
86
-                }});
87
-            }
88
-        }
89
-
90
-        return ResponseBean.success(taRecommendCustomer);
91
-    }
92
-
93
-    @Override
94
-    public ResponseBean updateCustByJSON(String paramStr) {
95
-        JSONObject params = JSONObject.parseObject(paramStr);
96
-        if (null == params) {
97
-            return ResponseBean.error("解析参数失败", ResponseBean.ERROR_ILLEGAL_PARAMS);
98
-        }
99
-
100
-        String checkResult = checkCustomerParams(params);
101
-        if (null != checkResult) {
102
-            return ResponseBean.error(checkResult, ResponseBean.ERROR_MISSING_PARAMS);
103
-        }
104
-
105
-
106
-        UpdateWrapper<TaRecommendCustomer> wrapper = new UpdateWrapper<>();
107
-        wrapper.eq("customer_id", params.get("id"));
108
-        wrapper.set("name", params.get("name"));
109
-        wrapper.set("picture", params.get("picture"));
110
-        wrapper.set("phone", params.get("phone"));
111
-        wrapper.set("sex", params.get("sex"));
112
-        wrapper.set("describe", params.get("describe"));
113
-
114
-        String at = params.getString("appointmentTime");
115
-        if (!StringUtils.isEmpty(at)) {
116
-            wrapper.set("appointmentTime", DateUtils.day2LocalDateime(at));
117
-        }
118
-        wrapper.set("vistors", params.get("vistors"));
119
-        wrapper.set("explain", params.get("explain"));
120
-        wrapper.set("intention", params.get("intention"));
121
-        wrapper.set("realtyManageType", params.get("realtyManageType"));
122
-        wrapper.set("demandType", params.get("demandType"));
123
-        wrapper.set("priceRange", params.get("priceRange"));
124
-        wrapper.set("realtyConsultant", params.get("realtyConsultant"));
125
-
126
-        // todo 需要约定时间格式
127
-//        wrapper.set("reportDate", params.get("reportDate"));
128
-
129
-        String status = params.getString("status");
130
-        if (null != status) {
131
-            wrapper.set("status", params.get("status"));
132
-        }
133
-
134
-        int row = taRecommendCustomerMapper.update(new TaRecommendCustomer(), wrapper);
135
-        if (row <= 0) {
136
-            return ResponseBean.error("更新客户信息失败", ResponseBean.ERROR_UNAVAILABLE);
137
-        }
138
-
139
-        return ResponseBean.success("更新客户信息成功");
140
-    }
141
-
142
-    @Override
143
-    public ResponseBean recommendCust(String paramStr, String openid) {
144
-        JSONObject params = JSONObject.parseObject(paramStr);
145
-        if (null == params) {
146
-            return ResponseBean.error("解析参数失败", ResponseBean.ERROR_ILLEGAL_PARAMS);
147
-        }
148
-        List<TaPerson> taPersons = getPersonsByOpenId(openid);
149
-        if (null == taPersons || taPersons.size() != 1) {
150
-            return ResponseBean.error("验证当前人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
151
-        }
152
-        TaPerson taPerson = taPersons.get(0);
153
-
154
-        String checkResult = checkCustomerParams(params);
155
-        if (null != checkResult) {
156
-            return ResponseBean.error(checkResult, ResponseBean.ERROR_MISSING_PARAMS);
157
-        }
158
-
159
-        TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
160
-
161
-        taRecommendCustomer.setName(params.getString("name"));
162
-        taRecommendCustomer.setPicture(params.getString("picture"));
163
-        taRecommendCustomer.setPhone(params.getString("phone"));
164
-        taRecommendCustomer.setSex(params.getInteger("sex"));
165
-        taRecommendCustomer.setDescribe(params.getString("describe"));
166
-        taRecommendCustomer.setRealtyConsultant(params.getString("realtyConsultant"));
167
-
168
-        // 时间格式 yyyy-MM-dd
169
-        String at = params.getString("appointmentTime");
170
-        if (!StringUtils.isEmpty(at)) {
171
-            taRecommendCustomer.setAppointmentTime(DateUtils.day2LocalDateime(at));
172
-        }
173
-
174
-//        taRecommendCustomer.setAppointmentTime((String) params.get("appointmentTime"));
175
-        taRecommendCustomer.setVisiteNum(params.getInteger("visiteNum"));
176
-        taRecommendCustomer.setIntention(params.getString("intention"));
177
-        taRecommendCustomer.setRealtyManageType(params.getString("realtyManageType"));
178
-        taRecommendCustomer.setDemandType(params.getString("demandType"));
179
-        taRecommendCustomer.setPriceRange(params.getString("priceRange"));
180
-
181
-        // 报备日期是今天
182
-        taRecommendCustomer.setReportDate(LocalDateTime.now());
183
-
184
-        String status = params.getString("status");
185
-        if (null == status) status = "1";
186
-        taRecommendCustomer.setStatus(status);
187
-        taRecommendCustomer.setRecommendPerson(taPerson.getPersonId());
188
-
189
-        // 报备有 10 天有效期
190
-        QueryWrapper<TaRecommendCustomer> queryWrapper = new QueryWrapper<>();
191
-        queryWrapper.eq("name", taRecommendCustomer.getName());
192
-        queryWrapper.eq("phone", taRecommendCustomer.getPhone());
193
-        queryWrapper.ge("report_date", LocalDateTime.now().minusDays(10));
194
-        List<TaRecommendCustomer> result = taRecommendCustomerMapper.selectList(queryWrapper);
195
-        if (null != result && result.size() > 0) {
196
-            return ResponseBean.error("当前客户尚在保护期, 不能再次推荐", ResponseBean.ERROR_ILLEGAL_PARAMS);
197
-        }
198
-
199
-        int row = taRecommendCustomerMapper.insert(taRecommendCustomer);
200
-        if (row < 1) {
201
-            return ResponseBean.error("推荐客户失败", ResponseBean.ERROR_UNAVAILABLE);
202
-        }
203
-
204
-        // 找到销售经理,并推送消息
205
-        TaPerson saleMan = taPersonMapper.getSalesExecutive();
206
-        if (null != saleMan && !StringUtils.isEmpty(saleMan.getMiniOpenid())) {
207
-            // 发送消息
208
-            iMiniAppService.sendNewCustomerMessage(saleMan.getMiniOpenid(), CommConstant.MINIAPP_INDEX, taRecommendCustomer.getName(), taRecommendCustomer.getPhone(), "", taPerson.getName());
209
-        }
210
-
211
-        return ResponseBean.success(taRecommendCustomer);
212
-    }
213
-
214
-    String checkCustomerParams(JSONObject params) {
215
-        if (null == params.getString("name")) {
216
-            return "请设置客户姓名";
217
-        }
218
-        if (null == params.getString("phone")) {
219
-            return "请设置客户电话";
220
-        }
221
-        if (null == params.getInteger("sex")) {
222
-            return "请设置客户性别";
223
-        }
224
-        if (null == params.getString("intention")) {
225
-            return "请设置意向楼盘";
226
-        }
227
-
228
-        return null;
229
-    }
230
-
231
-
232
-
233
-
234
-    List<TaPerson> getPersonsByOpenId(String openid) {
235
-        return taPersonMapper.getPersonByOpenId(openid);
236
-    }
237
-
238
-    @Override
239
-    public IPage<TaRecommendCustomer> getUnSignedCustomerList(int pageNumber, int pageSize,String building,String personId){
240
-        QueryWrapper<TaRecommendCustomer>queryWrapper = new QueryWrapper<>();
241
-//        queryWrapper.eq("building_id",building);
242
-        queryWrapper.eq("realty_consultant",personId);
243
-        queryWrapper.gt("status", CommConstant.MESSAGE_UNREAD);
244
-        IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
245
-        return taRecommendCustomerMapper.selectPage(page,queryWrapper);
246
-    }
247
-
248
-    @Override
249
-    public IPage<TaRecommendCustomer> getCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus){
250
-        IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
251
-        return taRecommendCustomerMapper.getCustomerList(page,building,name,tel,consultName,consultTel,entryType,verifyStatus);
252
-    }
253
-
254
-    @Override
255
-    public TaRecommendCustomer getCustomerById(String customerId){
256
-        return taRecommendCustomerMapper.getCustomerById(customerId);
257
-    }
258
-
259
-
260
-    @Override
261
-    public TaRecommendCustomer getCustomerDetail(String customerId){
262
-        String personId = taRecommendCustomerMapper.getCustomerPersonId(customerId);
263
-        TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.getCustomerDetail(customerId);
264
-        if(!StringUtils.isEmpty(personId)){
265
-            taRecommendCustomer.setVisitRecords(taPersonVisitRecordMapper.visitRecordByPersonId(personId));
266
-            taRecommendCustomer.setVisitTimes(taPersonVisitRecordMapper.visitRecordByPersonId(personId).size());
267
-        }
268
-        if(!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())){
269
-            TaPerson consultant =  taPersonMapper.getById(taRecommendCustomer.getRealtyConsultant());
270
-            consultant.setProjects(taPersonMapper.getUserProjects(consultant.getPersonId()));
271
-            taRecommendCustomer.setConsultant(consultant);
272
-        }
273
-        return taRecommendCustomer;
274
-    }
275
-
276
-    @Override
277
-    public IPage<TaRecommendCustomer>getCustomersIRecommended(int pageNumber, int pageSize,String customerId,String building){
278
-        String personId = taRecommendCustomerMapper.getCustomerPersonId(customerId);
279
-        QueryWrapper<TaRecommendCustomer>queryWrapper = new QueryWrapper<>();
280
-        queryWrapper.eq("person_id",personId);
281
-//        queryWrapper.eq("building_id",building);
282
-        queryWrapper.gt("status", CommConstant.MESSAGE_UNREAD);
283
-        IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
284
-        return taRecommendCustomerMapper.selectPage(page,queryWrapper);
285
-    }
286
-
287
-    @Override
288
-    public TaRecommendCustomer newByPerson(TaPerson person) {
289
-        // 没有手机号, 暂时不生成客户信息
290
-        String phone = StringUtils.ifNull(person.getTel(), person.getPhone());
291
-        if (StringUtils.isEmpty(phone)) {
292
-            return null;
293
-        }
294
-
295
-        // 已经存在的, 随机返回一条记录
296
-        List<TaRecommendCustomer> custs = getCustomerByPhone(phone);
297
-        if (null != custs && custs.size() > 0) {
298
-            return custs.get(0);
299
-        }
300
-
301
-        TaRecommendCustomer cust = new TaRecommendCustomer();
302
-        cust.setName(StringUtils.ifNull(person.getName(), person.getNickname()));
303
-        cust.setSex(null == person.getSex() ? str2Int(person.getGender()) : person.getSex());
304
-        cust.setPhone(phone);
305
-        cust.setPicture(StringUtils.ifNull(person.getPhoto(), person.getAvatarurl()));
306
-        cust.setCountry(person.getCountry());
307
-        cust.setCity(person.getCity());
308
-        cust.setProvince(person.getProvince());
309
-        // 审核同意
310
-        cust.setVerifyStatus(CommConstant.VERIFY_AGREE);
311
-        // 报备状态
312
-        cust.setStatus(CommConstant.CUSTOMER_REPORT);
313
-        // 当前日期
314
-        cust.setReportDate(LocalDateTime.now());
315
-
316
-        if (taRecommendCustomerMapper.insert(cust) > 0) {
317
-            return cust;
318
-        } else {
319
-            log.error("依据人员新增推荐客户失败");
320
-            return null;
321
-        }
322
-    }
323
-
324
-    private List<TaRecommendCustomer> getCustomerByPhone(String phone) {
325
-        QueryWrapper<TaRecommendCustomer> queryWrapper = new QueryWrapper<>();
326
-        queryWrapper.eq("phone", phone);
327
-        queryWrapper.gt("status", CommConstant.STATUS_DELETE);
328
-        queryWrapper.orderByDesc("report_date");
329
-
330
-        List<TaRecommendCustomer> custs = taRecommendCustomerMapper.selectList(queryWrapper);
331
-        return custs;
332
-    }
333
-
334
-    private Integer str2Int(String str) {
335
-        if (null == str) {
336
-            return null;
337
-        }
338
-
339
-        try {
340
-            return Integer.valueOf(str);
341
-        } catch (Exception e) {
342
-            return 0;
343
-        }
344
-    }
345
-}
1
+package com.huiju.estateagents.service.impl;
2
+
3
+import ch.qos.logback.core.status.StatusUtil;
4
+import com.alibaba.fastjson.JSONObject;
5
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
7
+import com.baomidou.mybatisplus.core.metadata.IPage;
8
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
9
+import com.huiju.estateagents.base.ResponseBean;
10
+import com.huiju.estateagents.common.CommConstant;
11
+import com.huiju.estateagents.common.DateUtils;
12
+import com.huiju.estateagents.common.StringUtils;
13
+import com.huiju.estateagents.entity.TaPerson;
14
+import com.huiju.estateagents.entity.TaRecommendCustomer;
15
+import com.huiju.estateagents.mapper.TaPersonMapper;
16
+import com.huiju.estateagents.mapper.TaPersonVisitRecordMapper;
17
+import com.huiju.estateagents.mapper.TaRecommendCustomerMapper;
18
+import com.huiju.estateagents.service.IMiniAppService;
19
+import com.huiju.estateagents.service.ITaRecommendCustomerService;
20
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
21
+import org.springframework.beans.factory.annotation.Autowired;
22
+import org.springframework.stereotype.Service;
23
+
24
+import javax.naming.spi.ResolveResult;
25
+import java.time.LocalDateTime;
26
+import java.util.HashMap;
27
+import java.util.List;
28
+import java.util.Map;
29
+
30
+/**
31
+ * <p>
32
+ * 推荐客户表 服务实现类
33
+ * </p>
34
+ *
35
+ * @author jobob
36
+ * @since 2019-05-10
37
+ */
38
+@Service
39
+public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCustomerMapper, TaRecommendCustomer> implements ITaRecommendCustomerService {
40
+
41
+    @Autowired
42
+    TaPersonMapper taPersonMapper;
43
+
44
+    @Autowired
45
+    TaRecommendCustomerMapper taRecommendCustomerMapper;
46
+
47
+    @Autowired
48
+    IMiniAppService iMiniAppService;
49
+
50
+    @Autowired
51
+    TaPersonVisitRecordMapper taPersonVisitRecordMapper;
52
+
53
+    @Override
54
+    public ResponseBean getMyCustList(String openid, String keywords, int pageNumber, int pageSize) {
55
+        List<TaPerson> taPersons = getPersonsByOpenId(openid);
56
+        if (null == taPersons || taPersons.size() != 1) {
57
+            return ResponseBean.error("验证当前人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
58
+        }
59
+
60
+        TaPerson taPerson = taPersons.get(0);
61
+
62
+        IPage<TaRecommendCustomer> page = new Page<>();
63
+        page.setCurrent(pageNumber);
64
+        page.setSize(pageSize);
65
+
66
+        QueryWrapper<TaRecommendCustomer> query = new QueryWrapper<>();
67
+        query.eq("recommend_person", taPerson.getPersonId());
68
+        query.like(null != keywords && "".equals(keywords.trim()), "name", keywords);
69
+        query.orderByDesc("report_date");
70
+
71
+        IPage<TaRecommendCustomer> result = taRecommendCustomerMapper.selectPage(page, query);
72
+        return ResponseBean.success(result);
73
+    }
74
+
75
+    @Override
76
+    public ResponseBean getCustDetail(String id) {
77
+        TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(id);
78
+
79
+        if (!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())) {
80
+            TaPerson taPerson = taPersonMapper.selectById(taRecommendCustomer.getRealtyConsultant());
81
+            if (null != taPerson) {
82
+                taRecommendCustomer.setConsultants(new HashMap<String, Object>() {{
83
+                    put("name", taPerson.getName());
84
+                    put("phone", taPerson.getTel());
85
+                    put("photo", taPerson.getPhoto());
86
+                }});
87
+            }
88
+        }
89
+
90
+        return ResponseBean.success(taRecommendCustomer);
91
+    }
92
+
93
+    @Override
94
+    public ResponseBean updateCustByJSON(String paramStr) {
95
+        JSONObject params = JSONObject.parseObject(paramStr);
96
+        if (null == params) {
97
+            return ResponseBean.error("解析参数失败", ResponseBean.ERROR_ILLEGAL_PARAMS);
98
+        }
99
+
100
+        String checkResult = checkCustomerParams(params);
101
+        if (null != checkResult) {
102
+            return ResponseBean.error(checkResult, ResponseBean.ERROR_MISSING_PARAMS);
103
+        }
104
+
105
+
106
+        UpdateWrapper<TaRecommendCustomer> wrapper = new UpdateWrapper<>();
107
+        wrapper.eq("customer_id", params.get("id"));
108
+        wrapper.set("name", params.get("name"));
109
+        wrapper.set("picture", params.get("picture"));
110
+        wrapper.set("phone", params.get("phone"));
111
+        wrapper.set("sex", params.get("sex"));
112
+        wrapper.set("describe", params.get("describe"));
113
+
114
+        String at = params.getString("appointmentTime");
115
+        if (!StringUtils.isEmpty(at)) {
116
+            wrapper.set("appointmentTime", DateUtils.day2LocalDateime(at));
117
+        }
118
+        wrapper.set("vistors", params.get("vistors"));
119
+        wrapper.set("explain", params.get("explain"));
120
+        wrapper.set("intention", params.get("intention"));
121
+        wrapper.set("realtyManageType", params.get("realtyManageType"));
122
+        wrapper.set("demandType", params.get("demandType"));
123
+        wrapper.set("priceRange", params.get("priceRange"));
124
+        wrapper.set("realtyConsultant", params.get("realtyConsultant"));
125
+
126
+        // todo 需要约定时间格式
127
+//        wrapper.set("reportDate", params.get("reportDate"));
128
+
129
+        String status = params.getString("status");
130
+        if (null != status) {
131
+            wrapper.set("status", params.get("status"));
132
+        }
133
+
134
+        int row = taRecommendCustomerMapper.update(new TaRecommendCustomer(), wrapper);
135
+        if (row <= 0) {
136
+            return ResponseBean.error("更新客户信息失败", ResponseBean.ERROR_UNAVAILABLE);
137
+        }
138
+
139
+        return ResponseBean.success("更新客户信息成功");
140
+    }
141
+
142
+    @Override
143
+    public ResponseBean recommendCust(String paramStr, String openid) {
144
+        JSONObject params = JSONObject.parseObject(paramStr);
145
+        if (null == params) {
146
+            return ResponseBean.error("解析参数失败", ResponseBean.ERROR_ILLEGAL_PARAMS);
147
+        }
148
+        List<TaPerson> taPersons = getPersonsByOpenId(openid);
149
+        if (null == taPersons || taPersons.size() != 1) {
150
+            return ResponseBean.error("验证当前人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
151
+        }
152
+        TaPerson taPerson = taPersons.get(0);
153
+
154
+        String checkResult = checkCustomerParams(params);
155
+        if (null != checkResult) {
156
+            return ResponseBean.error(checkResult, ResponseBean.ERROR_MISSING_PARAMS);
157
+        }
158
+
159
+        TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
160
+
161
+        taRecommendCustomer.setName(params.getString("name"));
162
+        taRecommendCustomer.setPicture(params.getString("picture"));
163
+        taRecommendCustomer.setPhone(params.getString("phone"));
164
+        taRecommendCustomer.setSex(params.getInteger("sex"));
165
+        taRecommendCustomer.setDescribe(params.getString("describe"));
166
+        taRecommendCustomer.setRealtyConsultant(params.getString("realtyConsultant"));
167
+
168
+        // 时间格式 yyyy-MM-dd
169
+        String at = params.getString("appointmentTime");
170
+        if (!StringUtils.isEmpty(at)) {
171
+            taRecommendCustomer.setAppointmentTime(DateUtils.day2LocalDateime(at));
172
+        }
173
+
174
+//        taRecommendCustomer.setAppointmentTime((String) params.get("appointmentTime"));
175
+        taRecommendCustomer.setVisiteNum(params.getInteger("visiteNum"));
176
+        taRecommendCustomer.setIntention(params.getString("intention"));
177
+        taRecommendCustomer.setRealtyManageType(params.getString("realtyManageType"));
178
+        taRecommendCustomer.setDemandType(params.getString("demandType"));
179
+        taRecommendCustomer.setPriceRange(params.getString("priceRange"));
180
+        taRecommendCustomer.setEntryType(CommConstant.ENTRY_INPUT);
181
+
182
+        // 报备日期是今天
183
+        taRecommendCustomer.setReportDate(LocalDateTime.now());
184
+
185
+        String status = params.getString("status");
186
+        if (null == status) status = "1";
187
+        taRecommendCustomer.setStatus(status);
188
+        taRecommendCustomer.setRecommendPerson(taPerson.getPersonId());
189
+
190
+        // 报备有 10 天有效期
191
+        QueryWrapper<TaRecommendCustomer> queryWrapper = new QueryWrapper<>();
192
+        queryWrapper.eq("name", taRecommendCustomer.getName());
193
+        queryWrapper.eq("phone", taRecommendCustomer.getPhone());
194
+        queryWrapper.ge("report_date", LocalDateTime.now().minusDays(10));
195
+        List<TaRecommendCustomer> result = taRecommendCustomerMapper.selectList(queryWrapper);
196
+        if (null != result && result.size() > 0) {
197
+            return ResponseBean.error("当前客户尚在保护期, 不能再次推荐", ResponseBean.ERROR_ILLEGAL_PARAMS);
198
+        }
199
+
200
+        int row = taRecommendCustomerMapper.insert(taRecommendCustomer);
201
+        if (row < 1) {
202
+            return ResponseBean.error("推荐客户失败", ResponseBean.ERROR_UNAVAILABLE);
203
+        }
204
+
205
+        // 找到销售经理,并推送消息
206
+        TaPerson saleMan = taPersonMapper.getSalesExecutive();
207
+        if (null != saleMan && !StringUtils.isEmpty(saleMan.getMiniOpenid())) {
208
+            // 发送消息
209
+            iMiniAppService.sendNewCustomerMessage(saleMan.getMiniOpenid(), CommConstant.MINIAPP_INDEX, taRecommendCustomer.getName(), taRecommendCustomer.getPhone(), "", taPerson.getName());
210
+        }
211
+
212
+        return ResponseBean.success(taRecommendCustomer);
213
+    }
214
+
215
+    String checkCustomerParams(JSONObject params) {
216
+        if (null == params.getString("name")) {
217
+            return "请设置客户姓名";
218
+        }
219
+        if (null == params.getString("phone")) {
220
+            return "请设置客户电话";
221
+        }
222
+        if (null == params.getInteger("sex")) {
223
+            return "请设置客户性别";
224
+        }
225
+        if (null == params.getString("intention")) {
226
+            return "请设置意向楼盘";
227
+        }
228
+
229
+        return null;
230
+    }
231
+
232
+
233
+
234
+
235
+    List<TaPerson> getPersonsByOpenId(String openid) {
236
+        return taPersonMapper.getPersonByOpenId(openid);
237
+    }
238
+
239
+    @Override
240
+    public IPage<TaRecommendCustomer> getUnSignedCustomerList(int pageNumber, int pageSize,String building,String personId){
241
+        QueryWrapper<TaRecommendCustomer>queryWrapper = new QueryWrapper<>();
242
+//        queryWrapper.eq("building_id",building);
243
+        queryWrapper.eq("realty_consultant",personId);
244
+        queryWrapper.gt("status", CommConstant.MESSAGE_UNREAD);
245
+        IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
246
+        return taRecommendCustomerMapper.selectPage(page,queryWrapper);
247
+    }
248
+
249
+    @Override
250
+    public IPage<TaRecommendCustomer> getCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus){
251
+        IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
252
+        return taRecommendCustomerMapper.getCustomerList(page,building,name,tel,consultName,consultTel,entryType,verifyStatus);
253
+    }
254
+
255
+    @Override
256
+    public TaRecommendCustomer getCustomerById(String customerId){
257
+        return taRecommendCustomerMapper.getCustomerById(customerId);
258
+    }
259
+
260
+
261
+    @Override
262
+    public TaRecommendCustomer getCustomerDetail(String customerId){
263
+        String personId = taRecommendCustomerMapper.getCustomerPersonId(customerId);
264
+        TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.getCustomerDetail(customerId);
265
+        if(!StringUtils.isEmpty(personId)){
266
+            taRecommendCustomer.setVisitRecords(taPersonVisitRecordMapper.visitRecordByPersonId(personId));
267
+            taRecommendCustomer.setVisitTimes(taPersonVisitRecordMapper.visitRecordByPersonId(personId).size());
268
+        }
269
+        if(!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())){
270
+            TaPerson consultant =  taPersonMapper.getById(taRecommendCustomer.getRealtyConsultant());
271
+            consultant.setProjects(taPersonMapper.getUserProjects(consultant.getPersonId()));
272
+            taRecommendCustomer.setConsultant(consultant);
273
+        }
274
+        return taRecommendCustomer;
275
+    }
276
+
277
+    @Override
278
+    public IPage<TaRecommendCustomer>getCustomersIRecommended(int pageNumber, int pageSize,String customerId,String building){
279
+        String personId = taRecommendCustomerMapper.getCustomerPersonId(customerId);
280
+        QueryWrapper<TaRecommendCustomer>queryWrapper = new QueryWrapper<>();
281
+        // todo
282
+        // 此处可能不是 person_id 而是 recommend_person
283
+        queryWrapper.eq("person_id",personId);
284
+//        queryWrapper.eq("building_id",building);
285
+        queryWrapper.gt("status", CommConstant.MESSAGE_UNREAD);
286
+        IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
287
+        return taRecommendCustomerMapper.selectPage(page,queryWrapper);
288
+    }
289
+
290
+    @Override
291
+    public TaRecommendCustomer newByPerson(TaPerson person) {
292
+        // 没有手机号, 暂时不生成客户信息
293
+        String phone = StringUtils.ifNull(person.getTel(), person.getPhone());
294
+        if (StringUtils.isEmpty(phone)) {
295
+            return null;
296
+        }
297
+
298
+        // 已经存在的, 随机返回一条记录
299
+        List<TaRecommendCustomer> custs = getCustomerByPhone(phone);
300
+        if (null != custs && custs.size() > 0) {
301
+            return custs.get(0);
302
+        }
303
+
304
+        TaRecommendCustomer cust = new TaRecommendCustomer();
305
+        cust.setName(StringUtils.ifNull(person.getName(), person.getNickname()));
306
+        cust.setSex(null == person.getSex() ? str2Int(person.getGender()) : person.getSex());
307
+        cust.setPhone(phone);
308
+        cust.setPicture(StringUtils.ifNull(person.getPhoto(), person.getAvatarurl()));
309
+        cust.setCountry(person.getCountry());
310
+        cust.setCity(person.getCity());
311
+        cust.setProvince(person.getProvince());
312
+        // 审核同意
313
+        cust.setVerifyStatus(CommConstant.VERIFY_AGREE);
314
+        // 报备状态
315
+        cust.setStatus(CommConstant.CUSTOMER_REPORT);
316
+        // 当前日期
317
+        cust.setReportDate(LocalDateTime.now());
318
+
319
+        if (taRecommendCustomerMapper.insert(cust) > 0) {
320
+            return cust;
321
+        } else {
322
+            log.error("依据人员新增推荐客户失败");
323
+            return null;
324
+        }
325
+    }
326
+
327
+    private List<TaRecommendCustomer> getCustomerByPhone(String phone) {
328
+        QueryWrapper<TaRecommendCustomer> queryWrapper = new QueryWrapper<>();
329
+        queryWrapper.eq("phone", phone);
330
+        queryWrapper.gt("status", CommConstant.STATUS_DELETE);
331
+        queryWrapper.orderByDesc("report_date");
332
+
333
+        List<TaRecommendCustomer> custs = taRecommendCustomerMapper.selectList(queryWrapper);
334
+        return custs;
335
+    }
336
+
337
+    private Integer str2Int(String str) {
338
+        if (null == str) {
339
+            return null;
340
+        }
341
+
342
+        try {
343
+            return Integer.valueOf(str);
344
+        } catch (Exception e) {
345
+            return 0;
346
+        }
347
+    }
348
+}

+ 99
- 91
src/main/java/com/huiju/estateagents/service/impl/TaUvServiceImpl.java Voir le fichier

@@ -1,91 +1,99 @@
1
-package com.huiju.estateagents.service.impl;
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.ResponseBean;
7
-import com.huiju.estateagents.common.CommConstant;
8
-import com.huiju.estateagents.entity.TaPerson;
9
-import com.huiju.estateagents.entity.TaUv;
10
-import com.huiju.estateagents.mapper.TaPersonMapper;
11
-import com.huiju.estateagents.mapper.TaUvMapper;
12
-import com.huiju.estateagents.service.ITaUvService;
13
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
14
-import org.springframework.beans.factory.annotation.Autowired;
15
-import org.springframework.stereotype.Service;
16
-
17
-import java.time.LocalDateTime;
18
-import java.util.List;
19
-
20
-/**
21
- * <p>
22
- * 用户访问表 服务实现类
23
- * </p>
24
- *
25
- * @author jobob
26
- * @since 2019-05-10
27
- */
28
-@Service
29
-public class TaUvServiceImpl extends ServiceImpl<TaUvMapper, TaUv> implements ITaUvService {
30
-    @Autowired
31
-    TaPersonMapper taPersonMapper;
32
-
33
-    @Autowired
34
-    TaUvMapper taUvMapper;
35
-
36
-    @Override
37
-    public ResponseBean saveData(String openid, String typeOf, String id) {
38
-        List<TaPerson> persons = getPersonsByOpenId(openid);
39
-        if (null == persons || persons.size() != 1) {
40
-            return ResponseBean.error("验证当前人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
41
-        }
42
-
43
-        TaPerson taPerson = persons.get(0);
44
-
45
-        QueryWrapper<TaUv> queryWrapper = new QueryWrapper<>();
46
-        queryWrapper.eq("person_id", taPerson.getPersonId());
47
-        queryWrapper.eq("be_uv", id);
48
-        queryWrapper.eq("tagert_type", typeOf);
49
-        List<TaUv> uvs = taUvMapper.selectList(queryWrapper);
50
-        if (null != uvs && uvs.size() > 0) {
51
-            return ResponseBean.success("");
52
-        }
53
-
54
-        TaUv taUv = new TaUv();
55
-        taUv.setBeUv(id);
56
-        taUv.setCreateDate(LocalDateTime.now());
57
-        taUv.setNameOrnick(taPerson.getNickname());
58
-        taUv.setPersonId(taPerson.getPersonId());
59
-        taUv.setPhotoOravatar(taPerson.getAvatarurl());
60
-        taUv.setTagertType(typeOf);
61
-
62
-        int row = taUvMapper.insert(taUv);
63
-        if (row < 1) {
64
-            return ResponseBean.error("人气增加失败", ResponseBean.ERROR_UNAVAILABLE);
65
-        }
66
-
67
-        // 如果是点赞置业, 则人员点赞 + 1
68
-        if (typeOf == CommConstant.FAVOR_CONSULTANT) {
69
-            taPersonMapper.setFieldIncrement(id,"hot_num", 1);
70
-        }
71
-
72
-        return ResponseBean.success("");
73
-    }
74
-
75
-    @Override
76
-    public ResponseBean getListOf(String id, String typeOf, Integer pageNumber, Integer pageSize) {
77
-        IPage<TaUv> page = new Page(pageNumber, pageSize);
78
-        QueryWrapper<TaUv> queryWrapper = new QueryWrapper<>();
79
-        queryWrapper.eq("be_uv", id);
80
-        queryWrapper.eq("tagert_type", typeOf);
81
-        queryWrapper.orderByDesc("create_date");
82
-
83
-        IPage<TaUv> result = taUvMapper.selectPage(page, queryWrapper);
84
-        return ResponseBean.success(result);
85
-    }
86
-
87
-
88
-    List<TaPerson> getPersonsByOpenId(String openid) {
89
-        return taPersonMapper.getPersonByOpenId(openid);
90
-    }
91
-}
1
+package com.huiju.estateagents.service.impl;
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.ResponseBean;
7
+import com.huiju.estateagents.common.CommConstant;
8
+import com.huiju.estateagents.entity.TaPerson;
9
+import com.huiju.estateagents.entity.TaUv;
10
+import com.huiju.estateagents.mapper.TaPersonMapper;
11
+import com.huiju.estateagents.mapper.TaUvMapper;
12
+import com.huiju.estateagents.service.ITaUvService;
13
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.stereotype.Service;
16
+
17
+import java.time.LocalDateTime;
18
+import java.util.List;
19
+
20
+/**
21
+ * <p>
22
+ * 用户访问表 服务实现类
23
+ * </p>
24
+ *
25
+ * @author jobob
26
+ * @since 2019-05-10
27
+ */
28
+@Service
29
+public class TaUvServiceImpl extends ServiceImpl<TaUvMapper, TaUv> implements ITaUvService {
30
+    @Autowired
31
+    TaPersonMapper taPersonMapper;
32
+
33
+    @Autowired
34
+    TaUvMapper taUvMapper;
35
+
36
+    @Override
37
+    public ResponseBean saveData(String openid, String typeOf, String id) {
38
+        List<TaPerson> persons = getPersonsByOpenId(openid);
39
+        if (null == persons || persons.size() != 1) {
40
+            return ResponseBean.error("验证当前人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
41
+        }
42
+
43
+        TaPerson taPerson = persons.get(0);
44
+
45
+        QueryWrapper<TaUv> queryWrapper = new QueryWrapper<>();
46
+        queryWrapper.eq("person_id", taPerson.getPersonId());
47
+        queryWrapper.eq("be_uv", id);
48
+        queryWrapper.eq("tagert_type", typeOf);
49
+        List<TaUv> uvs = taUvMapper.selectList(queryWrapper);
50
+        if (null != uvs && uvs.size() > 0) {
51
+            for(int i=0;i<uvs.size();i++){
52
+                uvs.get(i).setCreateDate(LocalDateTime.now());
53
+            }
54
+            if(this.updateBatchById(uvs)){
55
+                return ResponseBean.success("");
56
+            }else {
57
+                return ResponseBean.error("",ResponseBean.ERROR_UNAVAILABLE);
58
+            }
59
+
60
+        }
61
+
62
+        TaUv taUv = new TaUv();
63
+        taUv.setBeUv(id);
64
+        taUv.setCreateDate(LocalDateTime.now());
65
+        taUv.setNameOrnick(taPerson.getNickname());
66
+        taUv.setPersonId(taPerson.getPersonId());
67
+        taUv.setPhotoOravatar(taPerson.getAvatarurl());
68
+        taUv.setTagertType(typeOf);
69
+
70
+        int row = taUvMapper.insert(taUv);
71
+        if (row < 1) {
72
+            return ResponseBean.error("人气增加失败", ResponseBean.ERROR_UNAVAILABLE);
73
+        }
74
+
75
+        // 如果是点赞置业, 则人员点赞 + 1
76
+        if (typeOf == CommConstant.FAVOR_CONSULTANT) {
77
+            taPersonMapper.setFieldIncrement(id,"hot_num", 1);
78
+        }
79
+
80
+        return ResponseBean.success("");
81
+    }
82
+
83
+    @Override
84
+    public ResponseBean getListOf(String id, String typeOf, Integer pageNumber, Integer pageSize) {
85
+        IPage<TaUv> page = new Page(pageNumber, pageSize);
86
+        QueryWrapper<TaUv> queryWrapper = new QueryWrapper<>();
87
+        queryWrapper.eq("be_uv", id);
88
+        queryWrapper.eq("tagert_type", typeOf);
89
+        queryWrapper.orderByDesc("create_date");
90
+
91
+        IPage<TaUv> result = taUvMapper.selectPage(page, queryWrapper);
92
+        return ResponseBean.success(result);
93
+    }
94
+
95
+
96
+    List<TaPerson> getPersonsByOpenId(String openid) {
97
+        return taPersonMapper.getPersonByOpenId(openid);
98
+    }
99
+}

+ 5
- 0
src/main/resources/mapper/TaCustomerPersonMapper.xml Voir le fichier

@@ -1,5 +1,10 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.huiju.estateagents.mapper.TaCustomerPersonMapper">
4
+    <insert id="insertBean">
5
+        insert into ta_customer_person (person_id,customer_id)
6
+        values
7
+        (#{personId},#{customerId})
8
+    </insert>
4 9
 
5 10
 </mapper>

+ 1
- 1
src/main/resources/mapper/TaRecommendCustomerMapper.xml Voir le fichier

@@ -7,7 +7,7 @@
7 7
         FROM
8 8
             ta_recommend_customer t
9 9
         WHERE
10
-            t.person_id = #{personId}
10
+            t.recommend_person = #{personId}
11 11
             AND t.status &gt; -1
12 12
     </select>
13 13
     <select id="getCustomerPersonId" resultType="java.lang.String">