录音统计,代码优化

This commit is contained in:
spllzh
2025-08-16 06:11:06 +08:00
parent 7fe50bb811
commit 45548df6bd
20 changed files with 84 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ package com.rj;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
*
@@ -13,6 +14,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
*/
@MapperScan("com.rj.mapper")
@SpringBootApplication
@EnableScheduling
public class Langchain4jHeima20250803Application {
public static void main(String[] args) {

View File

@@ -87,3 +87,4 @@ public class PasswordUtil {

View File

@@ -71,3 +71,4 @@ public class ServiceManager {
return reservationService;
}
}

View File

@@ -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);
// 使用工具类批量获取关联数据

View File

@@ -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());

View File

@@ -170,3 +170,4 @@ public class AuthController {

View File

@@ -309,3 +309,4 @@ public class MenuController {

View File

@@ -279,3 +279,4 @@ public class RoleController {

View File

@@ -285,3 +285,4 @@ public class UserRoleController {

View File

@@ -36,3 +36,4 @@ public class LoginResponse {

View File

@@ -18,3 +18,4 @@ public interface IMenuService extends IService<Menu> {

View File

@@ -18,3 +18,4 @@ public interface IRoleService extends IService<Role> {

View File

@@ -18,3 +18,4 @@ public interface IUserRoleService extends IService<UserRole> {

View File

@@ -22,3 +22,4 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IM

View File

@@ -22,3 +22,4 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR

View File

@@ -22,3 +22,4 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i