录音统计,代码优化
This commit is contained in:
@@ -169,7 +169,6 @@ public class AudioManagementController {
|
||||
List<String> dealershipIds = DataEnrichmentUtil.extractIds(audioPage.getRecords(), AudioManagement::getDealershipId);
|
||||
List<String> saleIds = DataEnrichmentUtil.extractIds(audioPage.getRecords(), AudioManagement::getSalesId);
|
||||
List<String> projectIds = DataEnrichmentUtil.extractIds(audioPage.getRecords(), AudioManagement::getProjectId);
|
||||
List<String> customerIds = DataEnrichmentUtil.extractIds(audioPage.getRecords(), AudioManagement::getCustomerId);
|
||||
|
||||
|
||||
// 使用工具类批量获取关联数据
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.rj.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.rj.common.DataEnrichmentUtil;
|
||||
import com.rj.entity.AudioManagement;
|
||||
import com.rj.entity.VideoManagement;
|
||||
import com.rj.service.IVideoManagementService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -116,6 +118,11 @@ public class VideoManagementController {
|
||||
}
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private DataEnrichmentUtil dataEnrichmentUtil;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询视频列表
|
||||
*/
|
||||
@@ -157,7 +164,21 @@ public class VideoManagementController {
|
||||
queryWrapper.orderByDesc(VideoManagement::getCreateTime);
|
||||
|
||||
Page<VideoManagement> videoPage = videoManagementService.page(page, queryWrapper);
|
||||
|
||||
|
||||
// 使用工具类提取ID列表
|
||||
List<String> dealershipIds = DataEnrichmentUtil.extractIds(videoPage.getRecords(), VideoManagement::getDealershipId);
|
||||
List<String> salesIds = DataEnrichmentUtil.extractIds(videoPage.getRecords(), VideoManagement::getSalesId);
|
||||
|
||||
// 使用工具类批量获取关联数据
|
||||
Map<String, String> dealershipNameMap = dataEnrichmentUtil.getDealershipIdNameMap(dealershipIds);
|
||||
Map<String, String> saleNameMap = dataEnrichmentUtil.getSalesIdNameMap(salesIds);
|
||||
|
||||
videoPage.getRecords().forEach(video -> {
|
||||
video.setDealershipName(dealershipNameMap.get(video.getDealershipId()));
|
||||
video.setSalesName(saleNameMap.get(video.getSalesId()));
|
||||
});
|
||||
|
||||
|
||||
result.put("success", true);
|
||||
result.put("message", "查询成功");
|
||||
result.put("data", videoPage.getRecords());
|
||||
|
||||
@@ -170,3 +170,4 @@ public class AuthController {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -309,3 +309,4 @@ public class MenuController {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -279,3 +279,4 @@ public class RoleController {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -285,3 +285,4 @@ public class UserRoleController {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user