Browse Source

客户跟进记录添加 客户名称

yzc 1 year ago
parent
commit
031ece4122

+ 7 - 2
hx-customer/src/main/java/com/fjhx/customer/entity/customer/vo/CustomerFollowRecordsVo.java

@@ -10,7 +10,7 @@ import java.util.List;
 /**
  * 客户跟进记录列表查询返回值实体
  *
- * @author 
+ * @author
  * @since 2023-05-05
  */
 @Getter
@@ -19,5 +19,10 @@ public class CustomerFollowRecordsVo extends CustomerFollowRecords {
     /**
      * 文件列表
      */
-    List<ObsFile> fileList;
+    private List<ObsFile> fileList;
+
+    /**
+     * 客户名称
+     */
+    private String customerName;
 }

+ 9 - 2
hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerFollowRecordsServiceImpl.java

@@ -13,6 +13,7 @@ import com.fjhx.customer.entity.customer.po.CustomerFollowRecords;
 import com.fjhx.customer.entity.customer.vo.CustomerFollowRecordsVo;
 import com.fjhx.customer.mapper.customer.CustomerFollowRecordsMapper;
 import com.fjhx.customer.service.customer.CustomerFollowRecordsService;
+import com.fjhx.customer.service.customer.CustomerService;
 import com.fjhx.file.entity.FileInfo;
 import com.fjhx.file.entity.ObsFile;
 import com.fjhx.file.service.FileInfoService;
@@ -39,12 +40,14 @@ import java.util.stream.Collectors;
 public class CustomerFollowRecordsServiceImpl extends ServiceImpl<CustomerFollowRecordsMapper, CustomerFollowRecords> implements CustomerFollowRecordsService {
 
     @Autowired
-    FileInfoService fileInfoService;
+    private FileInfoService fileInfoService;
+    @Autowired
+    private CustomerService customerService;
 
     @Override
     public Page<CustomerFollowRecordsVo> getPage(CustomerFollowRecordsSelectDto dto) {
         IWrapper<CustomerFollowRecords> wrapper = getWrapper();
-        wrapper.eq("cfr",CustomerFollowRecords::getCustomerId,dto.getCustomerId());//根据客户id过滤
+        wrapper.eq("cfr", CustomerFollowRecords::getCustomerId, dto.getCustomerId());//根据客户id过滤
         wrapper.orderByDesc("cfr", CustomerFollowRecords::getDate);
         Page<CustomerFollowRecordsVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         List<CustomerFollowRecordsVo> records = page.getRecords();
@@ -58,6 +61,10 @@ public class CustomerFollowRecordsServiceImpl extends ServiceImpl<CustomerFollow
                 record.setFileList(obsFiles);
             }
         }
+        //赋值客户名称
+        customerService.attributeAssign(records, CustomerFollowRecordsVo::getCustomerId, (item, customer) -> {
+            item.setCustomerName(customer.getName());
+        });
 
         return page;
     }