胡轶钦 преди 5 години
родител
ревизия
acd315901e

+ 3
- 0
src/main/java/com/huiju/estateagents/entity/TaRecommendCustomer.java Целия файл

184
      */
184
      */
185
     @TableField(exist = false)
185
     @TableField(exist = false)
186
     private String sharePersonName;
186
     private String sharePersonName;
187
+
188
+    @TableField(exist = false)
189
+    private Map<String,String> geoInfo;
187
 }
190
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaPersonMapper.java Целия файл

38
     TaPerson getById(@Param("personId") String personId);
38
     TaPerson getById(@Param("personId") String personId);
39
 
39
 
40
 
40
 
41
-    List<String>getUserProjects(@Param("personId") String personId);
41
+    List<String>getUserProjects(@Param("personId") Integer personId);
42
 
42
 
43
     TaPerson selectByIdPerson(@Param("openid") String openid);
43
     TaPerson selectByIdPerson(@Param("openid") String openid);
44
 
44
 

+ 17
- 5
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Целия файл

15
 import com.huiju.estateagents.entity.TaBuilding;
15
 import com.huiju.estateagents.entity.TaBuilding;
16
 import com.huiju.estateagents.entity.TaPerson;
16
 import com.huiju.estateagents.entity.TaPerson;
17
 import com.huiju.estateagents.entity.TaRecommendCustomer;
17
 import com.huiju.estateagents.entity.TaRecommendCustomer;
18
+import com.huiju.estateagents.entity.TdCity;
18
 import com.huiju.estateagents.excel.AgentsRecommendCustomer;
19
 import com.huiju.estateagents.excel.AgentsRecommendCustomer;
19
 import com.huiju.estateagents.excel.ExcelRecommendCustomer;
20
 import com.huiju.estateagents.excel.ExcelRecommendCustomer;
20
 import com.huiju.estateagents.excel.ReporRecommendCustomer;
21
 import com.huiju.estateagents.excel.ReporRecommendCustomer;
21
-import com.huiju.estateagents.mapper.TaBuildingMapper;
22
-import com.huiju.estateagents.mapper.TaPersonMapper;
23
-import com.huiju.estateagents.mapper.TaPersonVisitRecordMapper;
24
-import com.huiju.estateagents.mapper.TaRecommendCustomerMapper;
22
+import com.huiju.estateagents.mapper.*;
25
 import com.huiju.estateagents.service.IMiniAppService;
23
 import com.huiju.estateagents.service.IMiniAppService;
26
 import com.huiju.estateagents.service.ITaRecommendCustomerService;
24
 import com.huiju.estateagents.service.ITaRecommendCustomerService;
27
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
25
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
63
     @Autowired
61
     @Autowired
64
     private TaBuildingMapper taBuildingMapper;
62
     private TaBuildingMapper taBuildingMapper;
65
 
63
 
64
+    @Autowired
65
+    private TdCityMapper cityMapper;
66
+
66
     @Override
67
     @Override
67
     public ResponseBean getMyCustList(String openid, String keywords, int pageNumber, int pageSize) {
68
     public ResponseBean getMyCustList(String openid, String keywords, int pageNumber, int pageSize) {
68
         List<TaPerson> taPersons = getPersonsByOpenId(openid);
69
         List<TaPerson> taPersons = getPersonsByOpenId(openid);
436
     public TaRecommendCustomer getCustomerDetail(String customerId){
437
     public TaRecommendCustomer getCustomerDetail(String customerId){
437
         String personId = taRecommendCustomerMapper.getCustomerById(customerId).getPersonId();
438
         String personId = taRecommendCustomerMapper.getCustomerById(customerId).getPersonId();
438
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.getCustomerDetail(customerId,personId);
439
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.getCustomerDetail(customerId,personId);
440
+        TaPerson person = taPersonMapper.selectById(personId);
439
         if(!StringUtils.isEmpty(personId)){
441
         if(!StringUtils.isEmpty(personId)){
440
             taRecommendCustomer.setVisitRecords(taPersonVisitRecordMapper.visitRecordByPersonId(personId));
442
             taRecommendCustomer.setVisitRecords(taPersonVisitRecordMapper.visitRecordByPersonId(personId));
441
             taRecommendCustomer.setVisitTimes(taPersonVisitRecordMapper.visitRecordByPersonId(personId).size());
443
             taRecommendCustomer.setVisitTimes(taPersonVisitRecordMapper.visitRecordByPersonId(personId).size());
444
+            Map<String,String>geoInfo = new HashMap<>();
445
+            geoInfo.put("provience",person.getProvince());
446
+            geoInfo.put("country",person.getCountry());
447
+            TdCity city = cityMapper.selectById(person.getCity());
448
+            if(null!=city){
449
+                geoInfo.put("city",city.getName());
450
+            }else {
451
+                geoInfo.put("city","未知");
452
+            }
453
+            taRecommendCustomer.setGeoInfo(geoInfo);
442
         }
454
         }
443
         if(!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())){
455
         if(!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())){
444
             TaPerson consultant =  taPersonMapper.getById(taRecommendCustomer.getRealtyConsultant());
456
             TaPerson consultant =  taPersonMapper.getById(taRecommendCustomer.getRealtyConsultant());
445
-            consultant.setProjects(taPersonMapper.getUserProjects(consultant.getPersonId()));
457
+            consultant.setProjects(taPersonMapper.getUserProjects(consultant.getUserId()));
446
             taRecommendCustomer.setConsultant(consultant);
458
             taRecommendCustomer.setConsultant(consultant);
447
         }
459
         }
448
         return taRecommendCustomer;
460
         return taRecommendCustomer;

+ 3
- 3
src/main/resources/mapper/TaPersonMapper.xml Целия файл

108
 FROM
108
 FROM
109
 	ta_person_building a
109
 	ta_person_building a
110
 	LEFT JOIN ta_building b ON a.building_id = b.building_id
110
 	LEFT JOIN ta_building b ON a.building_id = b.building_id
111
-	WHERE a.person_id = #{personId}
111
+	WHERE a.user_id = #{personId}
112
     </select>
112
     </select>
113
 
113
 
114
     <select id="selectByIdPerson" resultType="com.huiju.estateagents.entity.TaPerson">
114
     <select id="selectByIdPerson" resultType="com.huiju.estateagents.entity.TaPerson">
536
            UPDATE ta_person a
536
            UPDATE ta_person a
537
         INNER JOIN (
537
         INNER JOIN (
538
             SELECT
538
             SELECT
539
-                t.*, s.name AS province
539
+                t.*, s.shortname AS province
540
             FROM
540
             FROM
541
                 td_city t
541
                 td_city t
542
             INNER JOIN td_city s ON t.parentid = s.id
542
             INNER JOIN td_city s ON t.parentid = s.id
543
-        ) b ON a.city like CONCAT(b.shortname, '%')
543
+        ) b ON a.city = b.shortname
544
         AND a.province = b.province
544
         AND a.province = b.province
545
         set a.city = b.id
545
         set a.city = b.id
546
         where a.city IS NOT NULL
546
         where a.city IS NOT NULL