魏熙美 5 years ago
parent
commit
ec4de94a95

+ 0
- 15
src/main/java/com/huiju/estateagents/controller/MiniAppController.java View File

356
 //            if(list.size()<=0){
356
 //            if(list.size()<=0){
357
 //                taCustomerPersonService.insertBean(person.getPersonId(),customers.getCustomerId());
357
 //                taCustomerPersonService.insertBean(person.getPersonId(),customers.getCustomerId());
358
 //            }
358
 //            }
359
-        } else{
360
-            TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
361
-            taRecommendCustomer.setPersonId(person.getPersonId());
362
-            taRecommendCustomer.setPicture(person.getAvatarurl());
363
-            taRecommendCustomer.setCountry(person.getCountry());
364
-            taRecommendCustomer.setCity(person.getCity());
365
-            taRecommendCustomer.setProvince(person.getProvince());
366
-            taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
367
-            taRecommendCustomer.setOrgId(getOrgId(request));
368
-            taRecommendCustomer.setEntryType(CommConstant.ENTRY_VOLUNTEER);
369
-            taRecommendCustomer.setSex(Integer.getInteger(person.getGender()));
370
-            taRecommendCustomer.setName(person.getNickname());
371
-            taRecommendCustomer.setPhone(person.getPhone());
372
-            taRecommendCustomer.setCreateDate(LocalDateTime.now());
373
-            taRecommendCustomerService.save(taRecommendCustomer);
374
         }
359
         }
375
         return ResponseBean.success(phoneNoInfo);
360
         return ResponseBean.success(phoneNoInfo);
376
     }
361
     }

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaRecommendCustomerMapper.java View File

44
      * @param sex
44
      * @param sex
45
      * @return
45
      * @return
46
      */
46
      */
47
-    IPage<TaRecommendCustomer> getPublicCustomerList(IPage<TaRecommendCustomer> page, @Param("buildingId") String buildingId, @Param("name") String name, @Param("tel") String tel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId,@Param("consultTel")String consultTel);
47
+    IPage<TaPerson> getPublicCustomerList(IPage<TaPerson> page, @Param("buildingId") String buildingId, @Param("name") String name, @Param("tel") String tel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId,@Param("consultTel")String consultTel);
48
 
48
 
49
     /**
49
     /**
50
      * 导出数据 获取推荐用户数据
50
      * 导出数据 获取推荐用户数据

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

398
              */
398
              */
399
 
399
 
400
             // 公客
400
             // 公客
401
-            IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
401
+            IPage<TaPerson>page = new Page<>(pageNumber,pageSize);
402
             return taRecommendCustomerMapper.getPublicCustomerList(page, building,name, tel,  entryType, verifyStatus, sex, orgId,consultTel);
402
             return taRecommendCustomerMapper.getPublicCustomerList(page, building,name, tel,  entryType, verifyStatus, sex, orgId,consultTel);
403
         } else {
403
         } else {
404
             // 私客
404
             // 私客

+ 29
- 5
src/main/resources/mapper/TaRecommendCustomerMapper.xml View File

203
 	WHERE a.customer_id = #{customerId}
203
 	WHERE a.customer_id = #{customerId}
204
     </select>
204
     </select>
205
 
205
 
206
-    <select id="getPublicCustomerList" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">
207
-        select * from
208
-        ta_recommend_customer ta
209
-        WHERE (ta.realty_consultant is NULL OR ta.realty_consultant = '')
210
-        order by ta.create_date desc
206
+    <select id="getPublicCustomerList" resultType="com.huiju.estateagents.entity.TaPerson">
207
+        SELECT
208
+                b.*
209
+                FROM
210
+                ta_person b
211
+               <where>
212
+                    b.status > 0
213
+                   AND IFNULL(b.person_type, '') in ('estate agent', 'customer')
214
+                    <if test="name != null and name !=''">
215
+                        and b.nickname like CONCAT('%',#{name}, '%')
216
+                    </if>
217
+                    <if test="tel != null and tel!=''">
218
+                        and b.phone like CONCAT('%',#{tel}, '%')
219
+                    </if>
220
+                    <if test="entryType != null and entryType !=''">
221
+                        and b.entry_type = #{entryType}
222
+                    </if>
223
+                    <if test="sex != null and sex !=''">
224
+                        and b.sex = #{sex}
225
+                    </if>
226
+                    <if test="orgId != null">
227
+                       and b.org_id = #{orgId}
228
+                    </if>
229
+                    <if test="consultTel != null and consultTel !=''">
230
+                        and b.tel like CONCAT('%',#{consultTel}, '%')
231
+                    </if>
232
+                    and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
233
+                </where>
234
+               order by b.create_date desc
211
     </select>
235
     </select>
212
 
236
 
213
     <select id="getRecCustomerExport" resultType="com.huiju.estateagents.excel.ExcelRecommendCustomer">
237
     <select id="getRecCustomerExport" resultType="com.huiju.estateagents.excel.ExcelRecommendCustomer">