傅行帆 3 years ago
parent
commit
e7813a8fcf

+ 1
- 1
src/main/java/com/yunzhi/marketing/mapper/TaRecommendCustomerMapper.java View File

313
      */
313
      */
314
     IPage<TaRecommendCustomerPO> getMarkingCustList(IPage<TaRecommendCustomerPO> page,@Param("keywords") String keywords,@Param("buildingId") String buildingId);
314
     IPage<TaRecommendCustomerPO> getMarkingCustList(IPage<TaRecommendCustomerPO> page,@Param("keywords") String keywords,@Param("buildingId") String buildingId);
315
 
315
 
316
-    IPage<TaRecommendCustomerPO> getCustomersRecommended(IPage<TaRecommendCustomerPO> page, @Param("customerId") String customerId, @Param("status") Integer status, @Param("orgId") Integer orgId, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList,@Param("startDate") LocalDateTime startDate,@Param("endDate") LocalDateTime endDate);
316
+    IPage<TaRecommendCustomer> getCustomersRecommended(IPage<TaRecommendCustomer> page, @Param("customerId") String customerId, @Param("status") Integer status, @Param("orgId") Integer orgId, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList,@Param("startDate") LocalDateTime startDate,@Param("endDate") LocalDateTime endDate);
317
 }
317
 }

+ 1
- 1
src/main/java/com/yunzhi/marketing/service/ITaRecommendCustomerService.java View File

55
 
55
 
56
     TaRecommendCustomer getCustomerById(String customerId);
56
     TaRecommendCustomer getCustomerById(String customerId);
57
 
57
 
58
-    IPage<TaRecommendCustomerPO> getCustomersRecommended(int pageNumber, int pageSize, String customerId, Integer orgId, List<TaPersonBuilding> taPersonBuildingList, LocalDateTime startDate,LocalDateTime endDate,Integer status);
58
+    IPage<TaRecommendCustomer> getCustomersRecommended(int pageNumber, int pageSize, String customerId, Integer orgId, List<TaPersonBuilding> taPersonBuildingList, LocalDateTime startDate,LocalDateTime endDate,Integer status);
59
 
59
 
60
     IPage<TaRecommendCustomerPO> getCustomersIRecommended(int pageNumber, int pageSize, String customerId, Integer orgId, List<TaPersonBuilding> taPersonBuildingList, LocalDateTime startDate,LocalDateTime endDate,Integer status);
60
     IPage<TaRecommendCustomerPO> getCustomersIRecommended(int pageNumber, int pageSize, String customerId, Integer orgId, List<TaPersonBuilding> taPersonBuildingList, LocalDateTime startDate,LocalDateTime endDate,Integer status);
61
 
61
 

+ 3
- 20
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java View File

1367
     }
1367
     }
1368
 
1368
 
1369
     @Override
1369
     @Override
1370
-    public IPage<TaRecommendCustomerPO> getCustomersRecommended(int pageNumber, int pageSize, String customerId, Integer orgId, List<TaPersonBuilding> taPersonBuildingList, LocalDateTime startDate,LocalDateTime endDate,Integer status) {
1371
-
1372
-//        QueryWrapper<TaRecommendCustomer> queryWrapper = new QueryWrapper<>();
1373
-        // todo
1374
-        // 此处可能不是 person_id 而是 recommend_person
1375
-        IPage<TaRecommendCustomerPO> page = new Page<>(pageNumber, pageSize);
1376
-        IPage<TaRecommendCustomerPO> customersIRecommended = taRecommendCustomerMapper.getCustomersRecommended(page, customerId, status, orgId, taPersonBuildingList, startDate, endDate);
1377
-        List<TaRecommendCustomerPO> records = customersIRecommended.getRecords();
1378
-        records.forEach(e -> {
1379
-            LambdaQueryWrapper<BuildingChannel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
1380
-            lambdaQueryWrapper.eq(BuildingChannel::getBuildingId,e.getBuildingId());
1381
-            lambdaQueryWrapper.last("limit 1");
1382
-            BuildingChannel buildingChannel = buildingChannelMapper.selectOne(lambdaQueryWrapper);
1383
-
1384
-            if (null != buildingChannel) {
1385
-                Integer expirationDay = buildingChannel.getExpirationDate();
1386
-                LocalDateTime expirationDate = e.getCreateDate().plusDays(expirationDay);
1387
-                e.setExpirationDate(expirationDate);
1388
-            }
1389
-        });
1370
+    public IPage<TaRecommendCustomer> getCustomersRecommended(int pageNumber, int pageSize, String customerId, Integer orgId, List<TaPersonBuilding> taPersonBuildingList, LocalDateTime startDate,LocalDateTime endDate,Integer status) {
1371
+        IPage<TaRecommendCustomer> page = new Page<>(pageNumber, pageSize);
1372
+        IPage<TaRecommendCustomer> customersIRecommended = taRecommendCustomerMapper.getCustomersRecommended(page, customerId, status, orgId, taPersonBuildingList, startDate, endDate);
1390
         return customersIRecommended;
1373
         return customersIRecommended;
1391
     }
1374
     }
1392
 
1375
 

+ 2
- 14
src/main/resources/mapper/TaRecommendCustomerMapper.xml View File

1041
             and t.name like CONCAT('%',#{keywords}, '%')
1041
             and t.name like CONCAT('%',#{keywords}, '%')
1042
         </if>
1042
         </if>
1043
     </select>
1043
     </select>
1044
-    <select id="getCustomersRecommended" resultType="com.yunzhi.marketing.po.TaRecommendCustomerPO">
1045
-        select a.customer_id AS id,
1046
-        a.NAME,
1047
-        a.phone,
1048
-        a.picture,
1049
-        a.sex,
1050
-        a.building_id AS buildingId,
1051
-        "customer" AS type,
1052
-        a.create_date as createDate,
1053
-        a.realty_consultant AS consultant,
1054
-        a.STATUS AS customerStatus,
1055
-        NULL AS channelStatus,
1056
-        b.avatarurl
1057
-        from ta_recommend_customer a left join ta_person b on a.person_id = b.person_id
1044
+    <select id="getCustomersRecommended" resultType="com.yunzhi.marketing.entity.TaRecommendCustomer">
1045
+        select a.*,b.avatarurl from ta_recommend_customer a left join ta_person b on a.person_id = b.person_id
1058
         where a.recommend_person = #{customerId}
1046
         where a.recommend_person = #{customerId}
1059
         <if test="status != null and status !=''">
1047
         <if test="status != null and status !=''">
1060
             and a.status = #{status}
1048
             and a.status = #{status}