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
      */
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 View File

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
 

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

398
                 taBuildingDynamic.setPosters(taPosterService.getPostersForTarget(taBuildingDynamic.getDynamicId(), CommConstant.POSTER_CONTENT_TYPE_ACTIVITY));
398
                 taBuildingDynamic.setPosters(taPosterService.getPostersForTarget(taBuildingDynamic.getDynamicId(), CommConstant.POSTER_CONTENT_TYPE_ACTIVITY));
399
                 taBuildingDynamic.setShareContents(taShareContentService.getPostersForTarget(taBuildingDynamic.getDynamicId(), CommConstant.POSTER_CONTENT_TYPE_ACTIVITY));
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
             return result;
405
             return result;

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

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);
437
     public TaRecommendCustomer getCustomerDetail(String customerId){
438
     public TaRecommendCustomer getCustomerDetail(String customerId){
438
         String personId = taRecommendCustomerMapper.getCustomerById(customerId).getPersonId();
439
         String personId = taRecommendCustomerMapper.getCustomerById(customerId).getPersonId();
439
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.getCustomerDetail(customerId,personId);
440
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.getCustomerDetail(customerId,personId);
441
+        TaPerson person = taPersonMapper.selectById(personId);
440
         if(!StringUtils.isEmpty(personId)){
442
         if(!StringUtils.isEmpty(personId)){
441
             taRecommendCustomer.setVisitRecords(taPersonVisitRecordMapper.visitRecordByPersonId(personId));
443
             taRecommendCustomer.setVisitRecords(taPersonVisitRecordMapper.visitRecordByPersonId(personId));
442
             taRecommendCustomer.setVisitTimes(taPersonVisitRecordMapper.visitRecordByPersonId(personId).size());
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
         if(!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())){
456
         if(!StringUtils.isEmpty(taRecommendCustomer.getRealtyConsultant())){
445
             TaPerson consultant =  taPersonMapper.getById(taRecommendCustomer.getRealtyConsultant());
457
             TaPerson consultant =  taPersonMapper.getById(taRecommendCustomer.getRealtyConsultant());
446
-            consultant.setProjects(taPersonMapper.getUserProjects(consultant.getPersonId()));
458
+            consultant.setProjects(taPersonMapper.getUserProjects(consultant.getUserId()));
447
             taRecommendCustomer.setConsultant(consultant);
459
             taRecommendCustomer.setConsultant(consultant);
448
         }
460
         }
449
         return taRecommendCustomer;
461
         return taRecommendCustomer;

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

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

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

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