Browse Source

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

魏熙美 5 years ago
parent
commit
c18c6534f3

+ 3
- 0
src/main/java/com/huiju/estateagents/entity/TaRecommendCustomer.java View File

@@ -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 View File

@@ -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
 

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

@@ -398,6 +398,8 @@ public class TaBuildingDynamicServiceImpl extends ServiceImpl<TaBuildingDynamicM
398 398
                 taBuildingDynamic.setPosters(taPosterService.getPostersForTarget(taBuildingDynamic.getDynamicId(), CommConstant.POSTER_CONTENT_TYPE_ACTIVITY));
399 399
                 taBuildingDynamic.setShareContents(taShareContentService.getPostersForTarget(taBuildingDynamic.getDynamicId(), CommConstant.POSTER_CONTENT_TYPE_ACTIVITY));
400 400
 
401
+                //更改状态为已参与
402
+                taBuildingDynamic.setActivityStatus(CommConstant.ACTIVITY_STATUS_PARTNER);
401 403
 
402 404
             }
403 405
             return result;

+ 17
- 5
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java View File

@@ -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);
@@ -437,13 +438,24 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
437 438
     public TaRecommendCustomer getCustomerDetail(String customerId){
438 439
         String personId = taRecommendCustomerMapper.getCustomerById(customerId).getPersonId();
439 440
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.getCustomerDetail(customerId,personId);
441
+        TaPerson person = taPersonMapper.selectById(personId);
440 442
         if(!StringUtils.isEmpty(personId)){
441 443
             taRecommendCustomer.setVisitRecords(taPersonVisitRecordMapper.visitRecordByPersonId(personId));
442 444
             taRecommendCustomer.setVisitTimes(taPersonVisitRecordMapper.visitRecordByPersonId(personId).size());
445
+            Map<String,String>geoInfo = new HashMap<>();
446
+            geoInfo.put("provience",person.getProvince());
447
+            geoInfo.put("country",person.getCountry());
448
+            TdCity city = cityMapper.selectById(person.getCity());
449
+            if(null!=city){
450
+                geoInfo.put("city",city.getName());
451
+            }else {
452
+                geoInfo.put("city","未知");
453
+            }
454
+            taRecommendCustomer.setGeoInfo(geoInfo);
443 455
         }
444 456
         if(!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())){
445 457
             TaPerson consultant =  taPersonMapper.getById(taRecommendCustomer.getRealtyConsultant());
446
-            consultant.setProjects(taPersonMapper.getUserProjects(consultant.getPersonId()));
458
+            consultant.setProjects(taPersonMapper.getUserProjects(consultant.getUserId()));
447 459
             taRecommendCustomer.setConsultant(consultant);
448 460
         }
449 461
         return taRecommendCustomer;

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

@@ -62,9 +62,13 @@
62 62
 			FROM
63 63
 				ta_help_activity a
64 64
 				WHERE
65
-                  a.org_id =#{orgId}
65
+                    a.org_id =#{orgId}
66
+                <if test="buildingId  == null ">
66 67
                   and  a.is_main = 1
67
-                  and  a.city_id = #{cityID}
68
+                </if>
69
+                <if test="cityID != null and cityID != ''">
70
+                      and  a.city_id = #{cityID}
71
+                </if>
68 72
                 <if test="buildingId != null and buildingId != ''">
69 73
                   and a.building_id = #{buildingId}
70 74
                 </if>
@@ -79,9 +83,13 @@
79 83
 				FROM
80 84
 					ta_share_activity s
81 85
 					WHERE
82
-                        s.org_id =#{orgId}
86
+                    s.org_id =#{orgId}
87
+                <if test="buildingId  == null ">
83 88
                     and  s.sort = 1
89
+                </if>
90
+                <if test="cityID != null and cityID != ''">
84 91
                     and  s.city_id = #{cityID}
92
+                </if>
85 93
                 <if test="buildingId != null and buildingId != ''">
86 94
                     and s.building_id = #{buildingId}
87 95
                 </if>

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

@@ -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