胡轶钦 пре 5 година
родитељ
комит
acd315901e

+ 3
- 0
src/main/java/com/huiju/estateagents/entity/TaRecommendCustomer.java Прегледај датотеку

@@ -184,4 +184,7 @@ public class TaRecommendCustomer implements Serializable {
184 184
      */
185 185
     @TableField(exist = false)
186 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,7 +38,7 @@ public interface TaPersonMapper extends BaseMapper<TaPerson> {
38 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 43
     TaPerson selectByIdPerson(@Param("openid") String openid);
44 44
 

+ 17
- 5
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Прегледај датотеку

@@ -15,13 +15,11 @@ import com.huiju.estateagents.common.StringUtils;
15 15
 import com.huiju.estateagents.entity.TaBuilding;
16 16
 import com.huiju.estateagents.entity.TaPerson;
17 17
 import com.huiju.estateagents.entity.TaRecommendCustomer;
18
+import com.huiju.estateagents.entity.TdCity;
18 19
 import com.huiju.estateagents.excel.AgentsRecommendCustomer;
19 20
 import com.huiju.estateagents.excel.ExcelRecommendCustomer;
20 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 23
 import com.huiju.estateagents.service.IMiniAppService;
26 24
 import com.huiju.estateagents.service.ITaRecommendCustomerService;
27 25
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -63,6 +61,9 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
63 61
     @Autowired
64 62
     private TaBuildingMapper taBuildingMapper;
65 63
 
64
+    @Autowired
65
+    private TdCityMapper cityMapper;
66
+
66 67
     @Override
67 68
     public ResponseBean getMyCustList(String openid, String keywords, int pageNumber, int pageSize) {
68 69
         List<TaPerson> taPersons = getPersonsByOpenId(openid);
@@ -436,13 +437,24 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
436 437
     public TaRecommendCustomer getCustomerDetail(String customerId){
437 438
         String personId = taRecommendCustomerMapper.getCustomerById(customerId).getPersonId();
438 439
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.getCustomerDetail(customerId,personId);
440
+        TaPerson person = taPersonMapper.selectById(personId);
439 441
         if(!StringUtils.isEmpty(personId)){
440 442
             taRecommendCustomer.setVisitRecords(taPersonVisitRecordMapper.visitRecordByPersonId(personId));
441 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 455
         if(!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())){
444 456
             TaPerson consultant =  taPersonMapper.getById(taRecommendCustomer.getRealtyConsultant());
445
-            consultant.setProjects(taPersonMapper.getUserProjects(consultant.getPersonId()));
457
+            consultant.setProjects(taPersonMapper.getUserProjects(consultant.getUserId()));
446 458
             taRecommendCustomer.setConsultant(consultant);
447 459
         }
448 460
         return taRecommendCustomer;

+ 3
- 3
src/main/resources/mapper/TaPersonMapper.xml Прегледај датотеку

@@ -108,7 +108,7 @@ WHERE
108 108
 FROM
109 109
 	ta_person_building a
110 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 112
     </select>
113 113
 
114 114
     <select id="selectByIdPerson" resultType="com.huiju.estateagents.entity.TaPerson">
@@ -536,11 +536,11 @@ FROM
536 536
            UPDATE ta_person a
537 537
         INNER JOIN (
538 538
             SELECT
539
-                t.*, s.name AS province
539
+                t.*, s.shortname AS province
540 540
             FROM
541 541
                 td_city t
542 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 544
         AND a.province = b.province
545 545
         set a.city = b.id
546 546
         where a.city IS NOT NULL