魏熙美 пре 5 година
родитељ
комит
a734159c65

+ 10
- 10
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java Прегледај датотеку

@@ -265,16 +265,16 @@ public class TaRecommendCustomerController extends BaseController {
265 265
         try{
266 266
 
267 267
             // TODO 目前如果是公客,就取当前操作人员的 buildingId
268
-            if ("public".equals(customerType)) {
269
-                Map<String,Object> map = JWTUtils.getUserIdAndOrgId(request);
270
-                String userId = (String) map.get("userId");
271
-                QueryWrapper<TaPersonBuilding> queryWrapper = new QueryWrapper<>();
272
-                queryWrapper.eq("user_id", userId);
273
-                queryWrapper.orderByDesc("create_date");
274
-                queryWrapper.last("limit 1");
275
-                TaPersonBuilding personBuilding = taPersonBuildingMapper.selectOne(queryWrapper);
276
-                buildingId = personBuilding.getBuildingId();
277
-            }
268
+//            if ("public".equals(customerType)) {
269
+//                Map<String,Object> map = JWTUtils.getUserIdAndOrgId(request);
270
+//                String userId = (String) map.get("userId");
271
+//                QueryWrapper<TaPersonBuilding> queryWrapper = new QueryWrapper<>();
272
+//                queryWrapper.eq("user_id", userId);
273
+//                queryWrapper.orderByDesc("create_date");
274
+//                queryWrapper.last("limit 1");
275
+//                TaPersonBuilding personBuilding = taPersonBuildingMapper.selectOne(queryWrapper);
276
+//                buildingId = personBuilding.getBuildingId();
277
+//            }
278 278
             return ResponseBean.success(taRecommendCustomerService.getCustomerList(status,pageNumber,pageSize,buildingId,name,tel,consultName,consultTel,entryType,verifyStatus,sex, customerType, getOrgId(request)));
279 279
         }catch (Exception e){
280 280
             e.printStackTrace();

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

@@ -686,6 +686,7 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
686 686
             queryWrapper.eq("building_id",building);
687 687
         }
688 688
         queryWrapper.eq(orgId != null, "org_id", orgId);
689
+        queryWrapper.orderByDesc("create_date");
689 690
         IPage<TaPerson> page = new Page<>(pageNumber, pageSize);
690 691
         return taPersonMapper.selectPage(page,queryWrapper);
691 692
     }

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

@@ -359,6 +359,44 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
359 359
     public IPage getCustomerList(Integer status,int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex, String customerType, Integer orgId){
360 360
 
361 361
         if (CommConstant.CUTOMER_TYPE_PUBLIC.equals(customerType)) {
362
+
363
+            /**
364
+             * <if test="buildingId != null">
365
+             *             ,(select tpp.name from ta_share_person_from tspf left join ta_person tpp on  tspf.share_person = tpp.person_id where tspf.building_id = #{buildingId} and tspf.is_first_time = 1) as sharePersonName
366
+             *         </if>
367
+             */
368
+
369
+            /**
370
+             * SELECT
371
+             *         b.*
372
+             *         FROM
373
+             *         ta_person b
374
+             *         <where>
375
+             *             b.status > 0
376
+             *             AND IFNULL(b.person_type, '') in ('estate agent', 'customer')
377
+             *             <if test="name != null and name !=''">
378
+             *                 and b.nickname like CONCAT('%',#{name}, '%')
379
+             *             </if>
380
+             *             <if test="tel != null and tel!=''">
381
+             *                 and b.phone like CONCAT('%',#{tel}, '%')
382
+             *             </if>
383
+             *             <if test="entryType != null and entryType !=''">
384
+             *                 and b.entry_type = #{entryType}
385
+             *             </if>
386
+             *             <if test="sex != null and sex !=''">
387
+             *                 and b.sex = #{sex}
388
+             *             </if>
389
+             *             <if test="orgId != null">
390
+             *                 and b.org_id = #{orgId}
391
+             *             </if>
392
+             *             <if test="consultTel != null and consultTel !=''">
393
+             *                 and b.tel like CONCAT('%',#{consultTel}, '%')
394
+             *             </if>
395
+             *             and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
396
+             *         </where>
397
+             *         order by b.create_date desc
398
+             */
399
+
362 400
             // 公客
363 401
             IPage<TaPerson>page = new Page<>(pageNumber,pageSize);
364 402
             return taRecommendCustomerMapper.getPublicCustomerList(page, building,name, tel,  entryType, verifyStatus, sex, orgId,consultTel);

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

@@ -205,8 +205,7 @@ FROM
205 205
 
206 206
     <select id="getPublicCustomerList" resultType="com.huiju.estateagents.entity.TaPerson">
207 207
         SELECT
208
-        b.*,
209
-        (select tpp.name from ta_share_person_from tspf left join ta_person tpp on  tspf.share_person = tpp.person_id where tspf.building_id = #{buildingId} and tspf.is_first_time = 1) as sharePersonName
208
+        b.*
210 209
         FROM
211 210
         ta_person b
212 211
         <where>