音频分段逻辑的代码架构
This commit is contained in:
@@ -111,7 +111,6 @@ public class AudioFileController {
|
||||
}
|
||||
String headersJson = objectMapper.writeValueAsString(headers);
|
||||
log.info("headers: {}", headersJson);
|
||||
System.out.println("headers: " + headersJson); // 参考C#的Console.WriteLine
|
||||
|
||||
// 解析请求数据
|
||||
Map<String, Object> requestBody = null;
|
||||
@@ -121,11 +120,8 @@ public class AudioFileController {
|
||||
if (contentType != null && contentType.contains(MediaType.MULTIPART_FORM_DATA_VALUE)) {
|
||||
// multipart/form-data格式
|
||||
log.info("检测到multipart/form-data格式请求");
|
||||
|
||||
// 检查并获取文件参数
|
||||
log.info("检查文件参数,file是否为null: {}", file == null);
|
||||
System.out.println("检查文件参数,file是否为null: " + (file == null));
|
||||
|
||||
// 无论file是否为空,都尝试从request中获取文件(确保能获取到)
|
||||
if (request instanceof org.springframework.web.multipart.MultipartHttpServletRequest) {
|
||||
System.out.println("request是MultipartHttpServletRequest类型");
|
||||
@@ -139,7 +135,6 @@ public class AudioFileController {
|
||||
fileParamNames.add(fileNames.next());
|
||||
}
|
||||
log.info("multipart请求中的文件参数名列表: {}", fileParamNames);
|
||||
System.out.println("multipart请求中的文件参数名列表: " + fileParamNames);
|
||||
|
||||
// 如果file为空,尝试从request中获取第一个文件
|
||||
if (file == null || file.isEmpty()) {
|
||||
@@ -150,23 +145,15 @@ public class AudioFileController {
|
||||
log.info("从multipart请求中获取到文件,参数名: {}, 文件名: {}, 大小: {} bytes",
|
||||
paramName, file != null ? file.getOriginalFilename() : "null",
|
||||
file != null ? file.getSize() : 0);
|
||||
System.out.println("从multipart请求中获取到文件,参数名: " + paramName +
|
||||
", 文件名: " + (file != null ? file.getOriginalFilename() : "null") +
|
||||
", 大小: " + (file != null ? file.getSize() : 0) + " bytes");
|
||||
} else {
|
||||
log.warn("multipart请求中未找到任何文件参数");
|
||||
System.out.println("multipart请求中未找到任何文件参数");
|
||||
}
|
||||
} else {
|
||||
log.info("通过@RequestParam获取到文件,文件名: {}, 大小: {} bytes",
|
||||
file.getOriginalFilename(), file.getSize());
|
||||
System.out.println("通过@RequestParam获取到文件,文件名: " + file.getOriginalFilename() +
|
||||
", 大小: " + file.getSize() + " bytes");
|
||||
}
|
||||
} else {
|
||||
log.warn("request不是MultipartHttpServletRequest类型,实际类型: {}",
|
||||
request.getClass().getName());
|
||||
System.out.println("request不是MultipartHttpServletRequest类型,实际类型: " + request.getClass().getName());
|
||||
log.warn("request不是MultipartHttpServletRequest类型,实际类型: {}", request.getClass().getName());
|
||||
if (file != null && !file.isEmpty()) {
|
||||
log.info("通过@RequestParam获取到文件,文件名: {}, 大小: {} bytes",
|
||||
file.getOriginalFilename(), file.getSize());
|
||||
@@ -253,7 +240,6 @@ public class AudioFileController {
|
||||
// 打印请求体(参考C#代码:打印body)
|
||||
String bodyJson = objectMapper.writeValueAsString(requestBody);
|
||||
log.info("body: {}", bodyJson);
|
||||
System.out.println("body: " + bodyJson); // 参考C#的Console.WriteLine
|
||||
|
||||
// 保存原始数据到 yhy_datatype_log 表(初步解析后保存)
|
||||
try {
|
||||
@@ -354,8 +340,11 @@ public class AudioFileController {
|
||||
com.rj.entity.AudioManagement newAudio = new com.rj.entity.AudioManagement();
|
||||
newAudio.setId(UUID.randomUUID().toString());
|
||||
newAudio.setRecordingName("服务中录音"); // 设置默认录音名称
|
||||
newAudio.setSalesName(salesName);
|
||||
newAudio.setSalesPhone(salesPhone);
|
||||
newAudio.setSalesName(deviceManagement.getSalesName());
|
||||
newAudio.setSalesPhone(deviceManagement.getSalesPhone());
|
||||
newAudio.setTenantId(deviceManagement.getTenantId()); // 租户id
|
||||
newAudio.setDealershipName(deviceManagement.getDealershipName());
|
||||
newAudio.setDealershipId(deviceManagement.getDealershipId());
|
||||
newAudio.setSyncStatus("服务中");
|
||||
newAudio.setCreateTime(TimeZoneUtils.now());
|
||||
newAudio.setUpdateTime(TimeZoneUtils.now());
|
||||
|
||||
@@ -0,0 +1,305 @@
|
||||
package com.rj.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.rj.entity.AudioManagementSegments;
|
||||
import com.rj.service.IAudioManagementSegmentsService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 录音分段管理表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* 对应表:audio_management_segments
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/audioManagementSegments")
|
||||
@Tag(name = "录音分段管理", description = "录音分段管理相关接口")
|
||||
@Slf4j
|
||||
public class AudioManagementSegmentsController {
|
||||
|
||||
@Autowired
|
||||
private IAudioManagementSegmentsService audioManagementSegmentsService;
|
||||
|
||||
/**
|
||||
* 新增录音分段
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增录音分段", description = "添加新的录音分段信息")
|
||||
public ResponseEntity<Map<String, Object>> addSegment(
|
||||
@Parameter(description = "录音分段信息", required = true)
|
||||
@RequestBody AudioManagementSegments segment) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
if (segment.getCreateTime() == null) {
|
||||
segment.setCreateTime(LocalDateTime.now());
|
||||
}
|
||||
boolean success = audioManagementSegmentsService.save(segment);
|
||||
if (success) {
|
||||
result.put("success", true);
|
||||
result.put("message", "录音分段添加成功");
|
||||
result.put("data", segment);
|
||||
return ResponseEntity.ok(result);
|
||||
} else {
|
||||
result.put("success", false);
|
||||
result.put("message", "录音分段添加失败");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("录音分段添加异常:{}", e.getMessage(), e);
|
||||
result.put("success", false);
|
||||
result.put("message", "录音分段添加异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询录音分段
|
||||
*/
|
||||
@GetMapping("/get/{id}")
|
||||
@Operation(summary = "根据ID查询录音分段", description = "根据分段ID获取录音分段详细信息")
|
||||
public ResponseEntity<Map<String, Object>> getSegmentById(
|
||||
@Parameter(description = "分段ID", required = true)
|
||||
@PathVariable String id) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
AudioManagementSegments segment = audioManagementSegmentsService.getById(id);
|
||||
if (segment != null) {
|
||||
result.put("success", true);
|
||||
result.put("message", "查询成功");
|
||||
result.put("data", segment);
|
||||
return ResponseEntity.ok(result);
|
||||
} else {
|
||||
result.put("success", false);
|
||||
result.put("message", "录音分段不存在");
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("录音分段查询异常:{}", e.getMessage(), e);
|
||||
result.put("success", false);
|
||||
result.put("message", "查询异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询录音分段列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "分页查询录音分段列表", description = "分页查询录音分段信息列表")
|
||||
public ResponseEntity<Map<String, Object>> getSegmentList(
|
||||
@Parameter(description = "页码", example = "1")
|
||||
@RequestParam(defaultValue = "1") Integer current,
|
||||
@Parameter(description = "每页大小", example = "10")
|
||||
@RequestParam(defaultValue = "10") Integer size,
|
||||
@Parameter(description = "父录音ID")
|
||||
@RequestParam(required = false) String parentId,
|
||||
@Parameter(description = "租户ID")
|
||||
@RequestParam(required = false) String tenantId,
|
||||
@Parameter(description = "设备编号(模糊查询)")
|
||||
@RequestParam(required = false) String deviceNo,
|
||||
@Parameter(description = "销售姓名(模糊查询)")
|
||||
@RequestParam(required = false) String salesName,
|
||||
@Parameter(description = "销售电话(模糊查询)")
|
||||
@RequestParam(required = false) String salesPhone,
|
||||
@Parameter(description = "意向级别")
|
||||
@RequestParam(required = false) String intentionLevel,
|
||||
@Parameter(description = "上传状态")
|
||||
@RequestParam(required = false) String uploadStatus,
|
||||
@Parameter(description = "同步状态")
|
||||
@RequestParam(required = false) String syncStatus) {
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
Page<AudioManagementSegments> page = new Page<>(current, size);
|
||||
LambdaQueryWrapper<AudioManagementSegments> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (parentId != null && !parentId.trim().isEmpty()) {
|
||||
queryWrapper.eq(AudioManagementSegments::getParentId, parentId);
|
||||
}
|
||||
if (tenantId != null && !tenantId.trim().isEmpty()) {
|
||||
queryWrapper.eq(AudioManagementSegments::getTenantId, tenantId);
|
||||
}
|
||||
if (deviceNo != null && !deviceNo.trim().isEmpty()) {
|
||||
queryWrapper.like(AudioManagementSegments::getDeviceNo, deviceNo);
|
||||
}
|
||||
if (salesName != null && !salesName.trim().isEmpty()) {
|
||||
queryWrapper.like(AudioManagementSegments::getSalesName, salesName);
|
||||
}
|
||||
if (salesPhone != null && !salesPhone.trim().isEmpty()) {
|
||||
queryWrapper.like(AudioManagementSegments::getSalesPhone, salesPhone);
|
||||
}
|
||||
if (intentionLevel != null && !intentionLevel.trim().isEmpty()) {
|
||||
queryWrapper.eq(AudioManagementSegments::getIntentionLevel, intentionLevel);
|
||||
}
|
||||
if (uploadStatus != null && !uploadStatus.trim().isEmpty()) {
|
||||
queryWrapper.eq(AudioManagementSegments::getUploadStatus, uploadStatus);
|
||||
}
|
||||
if (syncStatus != null && !syncStatus.trim().isEmpty()) {
|
||||
queryWrapper.eq(AudioManagementSegments::getSyncStatus, syncStatus);
|
||||
}
|
||||
|
||||
// 按创建时间倒序排列
|
||||
queryWrapper.orderByDesc(AudioManagementSegments::getCreateTime);
|
||||
|
||||
Page<AudioManagementSegments> segmentPage = audioManagementSegmentsService.page(page, queryWrapper);
|
||||
|
||||
result.put("success", true);
|
||||
result.put("message", "查询成功");
|
||||
result.put("data", segmentPage.getRecords());
|
||||
result.put("total", segmentPage.getTotal());
|
||||
result.put("current", segmentPage.getCurrent());
|
||||
result.put("size", segmentPage.getSize());
|
||||
result.put("pages", segmentPage.getPages());
|
||||
|
||||
return ResponseEntity.ok(result);
|
||||
} catch (Exception e) {
|
||||
log.error("录音分段分页查询异常:{}", e.getMessage(), e);
|
||||
result.put("success", false);
|
||||
result.put("message", "查询异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据父ID查询录音分段列表(不分页)
|
||||
*/
|
||||
@GetMapping("/listByParentId")
|
||||
@Operation(summary = "根据父ID查询录音分段列表(不分页)",
|
||||
description = "根据父录音ID查询所有分段列表,不分页")
|
||||
public ResponseEntity<Map<String, Object>> listByParentId(
|
||||
@Parameter(description = "父录音ID", required = true)
|
||||
@RequestParam String parentId) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
LambdaQueryWrapper<AudioManagementSegments> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AudioManagementSegments::getParentId, parentId);
|
||||
// 通常按开始时间或段索引排序
|
||||
queryWrapper.orderByAsc(AudioManagementSegments::getStartTime);
|
||||
|
||||
List<AudioManagementSegments> list = audioManagementSegmentsService.list(queryWrapper);
|
||||
|
||||
result.put("success", true);
|
||||
result.put("message", "查询成功");
|
||||
result.put("data", list);
|
||||
result.put("count", list.size());
|
||||
return ResponseEntity.ok(result);
|
||||
} catch (Exception e) {
|
||||
log.error("根据父ID查询录音分段列表异常:{}", e.getMessage(), e);
|
||||
result.put("success", false);
|
||||
result.put("message", "查询异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新录音分段信息
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新录音分段信息", description = "更新录音分段详细信息")
|
||||
public ResponseEntity<Map<String, Object>> updateSegment(
|
||||
@Parameter(description = "录音分段信息", required = true)
|
||||
@RequestBody AudioManagementSegments segment) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
if (segment.getId() == null || segment.getId().trim().isEmpty()) {
|
||||
result.put("success", false);
|
||||
result.put("message", "分段ID不能为空");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
|
||||
boolean success = audioManagementSegmentsService.updateById(segment);
|
||||
|
||||
if (success) {
|
||||
result.put("success", true);
|
||||
result.put("message", "录音分段信息更新成功");
|
||||
result.put("data", segment);
|
||||
return ResponseEntity.ok(result);
|
||||
} else {
|
||||
result.put("success", false);
|
||||
result.put("message", "录音分段信息更新失败");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("录音分段更新异常:{}", e.getMessage(), e);
|
||||
result.put("success", false);
|
||||
result.put("message", "更新异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除录音分段
|
||||
*/
|
||||
@DeleteMapping("/delete/{id}")
|
||||
@Operation(summary = "删除录音分段", description = "根据分段ID删除录音分段信息")
|
||||
public ResponseEntity<Map<String, Object>> deleteSegment(
|
||||
@Parameter(description = "分段ID", required = true)
|
||||
@PathVariable String id) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
boolean success = audioManagementSegmentsService.removeById(id);
|
||||
if (success) {
|
||||
result.put("success", true);
|
||||
result.put("message", "录音分段删除成功");
|
||||
return ResponseEntity.ok(result);
|
||||
} else {
|
||||
result.put("success", false);
|
||||
result.put("message", "录音分段删除失败");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("录音分段删除异常:{}", e.getMessage(), e);
|
||||
result.put("success", false);
|
||||
result.put("message", "删除异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除录音分段
|
||||
*/
|
||||
@DeleteMapping("/batchDelete")
|
||||
@Operation(summary = "批量删除录音分段", description = "根据分段ID列表批量删除录音分段信息")
|
||||
public ResponseEntity<Map<String, Object>> batchDeleteSegments(
|
||||
@Parameter(description = "分段ID列表", required = true)
|
||||
@RequestBody List<String> ids) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
result.put("success", false);
|
||||
result.put("message", "分段ID列表不能为空");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
|
||||
boolean success = audioManagementSegmentsService.removeByIds(ids);
|
||||
if (success) {
|
||||
result.put("success", true);
|
||||
result.put("message", "批量删除成功,共删除 " + ids.size() + " 条记录");
|
||||
return ResponseEntity.ok(result);
|
||||
} else {
|
||||
result.put("success", false);
|
||||
result.put("message", "批量删除失败");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("批量删除录音分段异常:{}", e.getMessage(), e);
|
||||
result.put("success", false);
|
||||
result.put("message", "批量删除异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
153
src/main/java/com/rj/entity/AudioManagementSegments.java
Normal file
153
src/main/java/com/rj/entity/AudioManagementSegments.java
Normal file
@@ -0,0 +1,153 @@
|
||||
package com.rj.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 录音分段管理表
|
||||
* </p>
|
||||
*
|
||||
* 对应表:audio_management_segments
|
||||
*
|
||||
* @author
|
||||
* @since 2025-12-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("audio_management_segments")
|
||||
@Schema(description = "录音分段管理表")
|
||||
public class AudioManagementSegments implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键,UUID")
|
||||
@TableId("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "父录音ID(对应 audio_management.id)")
|
||||
@TableField("parent_id")
|
||||
private String parentId;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
@TableField("tenant_id")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "录音名称")
|
||||
@TableField("recording_name")
|
||||
private String recordingName;
|
||||
|
||||
@Schema(description = "录音段数(序号)")
|
||||
@TableField("chunk_index")
|
||||
private String chunkIndex;
|
||||
|
||||
@Schema(description = "设备编号")
|
||||
@TableField("deviceNo")
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "记录时间")
|
||||
@TableField("recording_time")
|
||||
private LocalDateTime recordingTime;
|
||||
|
||||
@Schema(description = "信息卡内容")
|
||||
@TableField("info_card_description")
|
||||
private String infoCardDescription;
|
||||
|
||||
@Schema(description = "销售ID")
|
||||
@TableField("sales_id")
|
||||
private String salesId;
|
||||
|
||||
@Schema(description = "销售电话")
|
||||
@TableField("sales_phone")
|
||||
private String salesPhone;
|
||||
|
||||
@Schema(description = "销售姓名")
|
||||
@TableField("sales_name")
|
||||
private String salesName;
|
||||
|
||||
@Schema(description = "录音时长(分钟)")
|
||||
@TableField("duration")
|
||||
private BigDecimal duration;
|
||||
|
||||
@Schema(description = "上传时间")
|
||||
@TableField("upload_time")
|
||||
private LocalDateTime uploadTime;
|
||||
|
||||
@Schema(description = "关注程度/意向级别")
|
||||
@TableField("intention_level")
|
||||
private String intentionLevel;
|
||||
|
||||
@Schema(description = "经销售ID")
|
||||
@TableField("dealership_id")
|
||||
private String dealershipId;
|
||||
|
||||
@Schema(description = "经销售名称")
|
||||
@TableField("dealership_name")
|
||||
private String dealershipName;
|
||||
|
||||
@Schema(description = "上传状态")
|
||||
@TableField("upload_status")
|
||||
private String uploadStatus;
|
||||
|
||||
@Schema(description = "同步状态")
|
||||
@TableField("sync_status")
|
||||
private String syncStatus;
|
||||
|
||||
@Schema(description = "是否合并(0否1是)")
|
||||
@TableField("is_merged")
|
||||
private Boolean isMerged;
|
||||
|
||||
@Schema(description = "描述/备注")
|
||||
@TableField("remarks")
|
||||
private String remarks;
|
||||
|
||||
@Schema(description = "录音开始时间")
|
||||
@TableField("start_time")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "录音结束时间")
|
||||
@TableField("end_time")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@TableField("create_time")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "录音保存路径")
|
||||
@TableField("audio_file_path")
|
||||
private String audioFilePath;
|
||||
|
||||
@Schema(description = "录音保存minio路径")
|
||||
@TableField("audio_file_url")
|
||||
private String audioFileUrl;
|
||||
|
||||
@Schema(description = "文件大小(字节)")
|
||||
@TableField("audio_file_size")
|
||||
private Long audioFileSize;
|
||||
|
||||
@Schema(description = "文件原始名称")
|
||||
@TableField("audio_file_original_name")
|
||||
private String audioFileOriginalName;
|
||||
|
||||
@Schema(description = "文件扩展名")
|
||||
@TableField("audio_file_extension")
|
||||
private String audioFileExtension;
|
||||
|
||||
@Schema(description = "录音文本")
|
||||
@TableField("recording_text")
|
||||
private String recordingText;
|
||||
|
||||
@Schema(description = "总结")
|
||||
@TableField("summary")
|
||||
private String summary;
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,10 @@ public class DeviceManagement implements Serializable {
|
||||
@TableId("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
@TableField("tenant_id")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "设备编号")
|
||||
@TableField("device_code")
|
||||
private String deviceCode;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.rj.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.rj.entity.AudioManagementSegments;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 录音分段管理表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* 对应表:audio_management_segments
|
||||
*/
|
||||
public interface AudioManagementSegmentsMapper extends BaseMapper<AudioManagementSegments> {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.rj.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.rj.entity.AudioManagementSegments;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 录音分段管理表 服务类
|
||||
* </p>
|
||||
*
|
||||
* 对应表:audio_management_segments
|
||||
*/
|
||||
public interface IAudioManagementSegmentsService extends IService<AudioManagementSegments> {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.rj.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.rj.entity.AudioManagementSegments;
|
||||
import com.rj.mapper.AudioManagementSegmentsMapper;
|
||||
import com.rj.service.IAudioManagementSegmentsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 录音分段管理表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* 对应表:audio_management_segments
|
||||
*/
|
||||
@Service
|
||||
public class AudioManagementSegmentsServiceImpl
|
||||
extends ServiceImpl<AudioManagementSegmentsMapper, AudioManagementSegments>
|
||||
implements IAudioManagementSegmentsService {
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ logging:
|
||||
# 数据库连接池日志
|
||||
# com.zaxxer.hikari: DEBUG
|
||||
# Spring JDBC日志
|
||||
# org.springframework.jdbc: DEBUG
|
||||
org.springframework.jdbc: DEBUG
|
||||
# 显示SQL参数
|
||||
com.baomidou.mybatisplus.core.executor: DEBUG
|
||||
# 显示SQL执行时间
|
||||
|
||||
74
src/main/resources/mapper/AudioManagementSegmentsMapper.xml
Normal file
74
src/main/resources/mapper/AudioManagementSegmentsMapper.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rj.mapper.AudioManagementSegmentsMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.rj.entity.AudioManagementSegments">
|
||||
<id column="id" property="id"/>
|
||||
<result column="parent_id" property="parentId"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
<result column="recording_name" property="recordingName"/>
|
||||
<result column="chunk_index" property="chunkIndex"/>
|
||||
<result column="deviceNo" property="deviceNo"/>
|
||||
<result column="recording_time" property="recordingTime"/>
|
||||
<result column="info_card_description" property="infoCardDescription"/>
|
||||
<result column="sales_id" property="salesId"/>
|
||||
<result column="sales_phone" property="salesPhone"/>
|
||||
<result column="sales_name" property="salesName"/>
|
||||
<result column="duration" property="duration"/>
|
||||
<result column="upload_time" property="uploadTime"/>
|
||||
<result column="intention_level" property="intentionLevel"/>
|
||||
<result column="dealership_id" property="dealershipId"/>
|
||||
<result column="dealership_name" property="dealershipName"/>
|
||||
<result column="upload_status" property="uploadStatus"/>
|
||||
<result column="sync_status" property="syncStatus"/>
|
||||
<result column="is_merged" property="isMerged"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
<result column="start_time" property="startTime"/>
|
||||
<result column="end_time" property="endTime"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="audio_file_path" property="audioFilePath"/>
|
||||
<result column="audio_file_url" property="audioFileUrl"/>
|
||||
<result column="audio_file_size" property="audioFileSize"/>
|
||||
<result column="audio_file_original_name" property="audioFileOriginalName"/>
|
||||
<result column="audio_file_extension" property="audioFileExtension"/>
|
||||
<result column="recording_text" property="recordingText"/>
|
||||
<result column="summary" property="summary"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id,
|
||||
parent_id,
|
||||
tenant_id,
|
||||
recording_name,
|
||||
chunk_index,
|
||||
deviceNo,
|
||||
recording_time,
|
||||
info_card_description,
|
||||
sales_id,
|
||||
sales_phone,
|
||||
sales_name,
|
||||
duration,
|
||||
upload_time,
|
||||
intention_level,
|
||||
dealership_id,
|
||||
dealership_name,
|
||||
upload_status,
|
||||
sync_status,
|
||||
is_merged,
|
||||
remarks,
|
||||
start_time,
|
||||
end_time,
|
||||
create_time,
|
||||
audio_file_path,
|
||||
audio_file_url,
|
||||
audio_file_size,
|
||||
audio_file_original_name,
|
||||
audio_file_extension,
|
||||
recording_text,
|
||||
summary
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -128,6 +128,11 @@ ALTER TABLE `sales_management`
|
||||
ADD COLUMN `tenant_id` VARCHAR(36) NULL COMMENT '租户ID' AFTER `id`,
|
||||
ADD INDEX `idx_sm_tenant_sales` (`tenant_id`, `sales_id`);
|
||||
|
||||
ALTER TABLE `device_management`
|
||||
ADD COLUMN `tenant_id` VARCHAR(36) NULL COMMENT '租户ID' AFTER `id`,
|
||||
ADD INDEX `idx_dm_tenant_device_management` (`tenant_id`, `id`);
|
||||
|
||||
|
||||
|
||||
-- ======================
|
||||
-- 门店与项目类
|
||||
|
||||
Reference in New Issue
Block a user