From 146d56fbd403091b2703961695ce5f25a28a8224 Mon Sep 17 00:00:00 2001 From: zhonghua1 Date: Tue, 6 Jan 2026 09:43:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- audio_text_analysis_meeting.sql | 32 ++ .../AudioTextAnalysisMeetingController.java | 353 ++++++++++++++++++ .../rj/entity/AudioTextAnalysisMeeting.java | 104 ++++++ .../AudioTextAnalysisMeetingMapper.java | 17 + .../IAudioTextAnalysisMeetingService.java | 17 + .../AudioTextAnalysisMeetingServiceImpl.java | 21 ++ 6 files changed, 544 insertions(+) create mode 100644 audio_text_analysis_meeting.sql create mode 100644 src/main/java/com/rj/controller/AudioTextAnalysisMeetingController.java create mode 100644 src/main/java/com/rj/entity/AudioTextAnalysisMeeting.java create mode 100644 src/main/java/com/rj/mapper/AudioTextAnalysisMeetingMapper.java create mode 100644 src/main/java/com/rj/service/IAudioTextAnalysisMeetingService.java create mode 100644 src/main/java/com/rj/service/impl/AudioTextAnalysisMeetingServiceImpl.java diff --git a/audio_text_analysis_meeting.sql b/audio_text_analysis_meeting.sql new file mode 100644 index 0000000..cca1f8a --- /dev/null +++ b/audio_text_analysis_meeting.sql @@ -0,0 +1,32 @@ +CREATE TABLE `audio_text_analysis_meeting` ( + `id` char(36) COLLATE utf16_bin NOT NULL COMMENT '主键ID', + `tenant_id` varchar(36) COLLATE utf16_bin DEFAULT NULL COMMENT '租户ID', + `parent_id` char(36) COLLATE utf16_bin DEFAULT NULL COMMENT '父ID', + `meeting_type` varchar(50) COLLATE utf16_bin DEFAULT NULL COMMENT '会议类型', + `meeting_member` varchar(200) COLLATE utf16_bin DEFAULT NULL COMMENT '会议成员', + `meeting_item` varchar(200) COLLATE utf16_bin DEFAULT NULL COMMENT '会议议题', + `decoration_style` varchar(200) COLLATE utf16_bin DEFAULT NULL COMMENT '会议风格', + `summary_sentence` varchar(500) COLLATE utf16_bin DEFAULT NULL COMMENT '会议总结', + `meeting_item_detail` text COLLATE utf16_bin DEFAULT NULL COMMENT '会议议题详情', + `mind_map` text COLLATE utf16_bin DEFAULT NULL COMMENT '会议脑图', + `owner_phone` varchar(30) COLLATE utf16_bin DEFAULT NULL COMMENT '所有者电话', + `owner_id` char(36) COLLATE utf16_bin DEFAULT NULL COMMENT '所有者ID', + `customer_phone` varchar(30) COLLATE utf16_bin DEFAULT NULL COMMENT '客户电话', + `customer_id` char(36) COLLATE utf16_bin DEFAULT NULL COMMENT '客户ID', + `summary1` text COLLATE utf16_bin DEFAULT NULL COMMENT '总结1', + `summary2` text COLLATE utf16_bin DEFAULT NULL COMMENT '总结2', + `summary3` text COLLATE utf16_bin DEFAULT NULL COMMENT '总结3', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + PRIMARY KEY (`id`), + KEY `idx_atam_tenant_id` (`tenant_id`), + KEY `idx_atam_tenant_parent` (`tenant_id`, `parent_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_bin COMMENT='音频文本分析会议表'; + + + + + + + + diff --git a/src/main/java/com/rj/controller/AudioTextAnalysisMeetingController.java b/src/main/java/com/rj/controller/AudioTextAnalysisMeetingController.java new file mode 100644 index 0000000..0e1bebc --- /dev/null +++ b/src/main/java/com/rj/controller/AudioTextAnalysisMeetingController.java @@ -0,0 +1,353 @@ +package com.rj.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rj.entity.AudioTextAnalysisMeeting; +import com.rj.service.IAudioTextAnalysisMeetingService; +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.format.annotation.DateTimeFormat; +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; + +/** + *

+ * 音频文本分析会议表 前端控制器 + *

+ * + * @author system + * @since 2025-01-XX + */ +@RestController +@RequestMapping("/api/audioTextAnalysisMeeting") +@Tag(name = "音频文本分析会议", description = "音频文本分析会议相关接口") +@Slf4j +public class AudioTextAnalysisMeetingController { + + @Autowired + private IAudioTextAnalysisMeetingService audioTextAnalysisMeetingService; + + /** + * 新增会议记录 + */ + @PostMapping("/add") + @Operation(summary = "新增会议记录", description = "添加新的会议信息") + public ResponseEntity> addMeeting( + @Parameter(description = "会议信息", required = true) + @RequestBody AudioTextAnalysisMeeting meeting) { + Map result = new HashMap<>(); + try { + meeting.setCreatedAt(LocalDateTime.now()); + meeting.setUpdatedAt(LocalDateTime.now()); + boolean success = audioTextAnalysisMeetingService.save(meeting); + if (success) { + result.put("success", true); + result.put("message", "会议记录添加成功"); + result.put("data", meeting); + return ResponseEntity.ok(result); + } else { + result.put("success", false); + result.put("message", "会议记录添加失败"); + return ResponseEntity.badRequest().body(result); + } + } catch (Exception e) { + log.error("新增会议记录异常:", 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> getMeetingById( + @Parameter(description = "会议ID", required = true) + @PathVariable String id) { + Map result = new HashMap<>(); + try { + AudioTextAnalysisMeeting meeting = audioTextAnalysisMeetingService.getById(id); + if (meeting != null) { + result.put("success", true); + result.put("message", "查询成功"); + result.put("data", meeting); + return ResponseEntity.ok(result); + } else { + result.put("success", false); + result.put("message", "会议记录不存在"); + return ResponseEntity.notFound().build(); + } + } catch (Exception e) { + log.error("根据ID查询会议记录异常:", e); + result.put("success", false); + result.put("message", "查询异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + /** + * 更新会议记录 + */ + @PutMapping("/update") + @Operation(summary = "更新会议记录", description = "更新会议详细信息") + public ResponseEntity> updateMeeting( + @Parameter(description = "会议信息", required = true) + @RequestBody AudioTextAnalysisMeeting meeting) { + Map result = new HashMap<>(); + try { + if (meeting.getId() == null || meeting.getId().trim().isEmpty()) { + result.put("success", false); + result.put("message", "会议ID不能为空"); + return ResponseEntity.badRequest().body(result); + } + + meeting.setUpdatedAt(LocalDateTime.now()); + boolean success = audioTextAnalysisMeetingService.updateById(meeting); + + if (success) { + result.put("success", true); + result.put("message", "会议记录更新成功"); + result.put("data", meeting); + return ResponseEntity.ok(result); + } else { + result.put("success", false); + result.put("message", "会议记录更新失败"); + return ResponseEntity.badRequest().body(result); + } + } catch (Exception e) { + log.error("更新会议记录异常:", 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> deleteMeeting( + @Parameter(description = "会议ID", required = true) + @PathVariable String id) { + Map result = new HashMap<>(); + try { + boolean success = audioTextAnalysisMeetingService.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); + result.put("success", false); + result.put("message", "删除异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + /** + * 分页条件查询会议记录列表 + */ + @GetMapping("/list") + @Operation(summary = "分页条件查询会议记录列表", description = "分页查询会议信息列表,支持多条件查询") + public ResponseEntity> getMeetingList( + @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 tenantId, + @Parameter(description = "父ID") + @RequestParam(required = false) String parentId, + @Parameter(description = "会议类型") + @RequestParam(required = false) String meetingType, + @Parameter(description = "会议成员(模糊查询)") + @RequestParam(required = false) String meetingMember, + @Parameter(description = "会议议题(模糊查询)") + @RequestParam(required = false) String meetingItem, + @Parameter(description = "会议风格") + @RequestParam(required = false) String decorationStyle, + @Parameter(description = "所有者电话") + @RequestParam(required = false) String ownerPhone, + @Parameter(description = "所有者ID") + @RequestParam(required = false) String ownerId, + @Parameter(description = "客户电话") + @RequestParam(required = false) String customerPhone, + @Parameter(description = "客户ID") + @RequestParam(required = false) String customerId, + @Parameter(description = "创建开始时间", example = "2025-01-01 00:00:00") + @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime createdStart, + @Parameter(description = "创建结束时间", example = "2025-12-31 23:59:59") + @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime createdEnd) { + Map result = new HashMap<>(); + try { + Page page = new Page<>(current, size); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + // 添加查询条件 + if (tenantId != null && !tenantId.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getTenantId, tenantId); + } + if (parentId != null && !parentId.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getParentId, parentId); + } + if (meetingType != null && !meetingType.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getMeetingType, meetingType); + } + if (meetingMember != null && !meetingMember.trim().isEmpty()) { + queryWrapper.like(AudioTextAnalysisMeeting::getMeetingMember, meetingMember); + } + if (meetingItem != null && !meetingItem.trim().isEmpty()) { + queryWrapper.like(AudioTextAnalysisMeeting::getMeetingItem, meetingItem); + } + if (decorationStyle != null && !decorationStyle.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getDecorationStyle, decorationStyle); + } + if (ownerPhone != null && !ownerPhone.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getOwnerPhone, ownerPhone); + } + if (ownerId != null && !ownerId.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getOwnerId, ownerId); + } + if (customerPhone != null && !customerPhone.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getCustomerPhone, customerPhone); + } + if (customerId != null && !customerId.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getCustomerId, customerId); + } + if (createdStart != null) { + queryWrapper.ge(AudioTextAnalysisMeeting::getCreatedAt, createdStart); + } + if (createdEnd != null) { + queryWrapper.le(AudioTextAnalysisMeeting::getCreatedAt, createdEnd); + } + + // 按更新时间倒序排列 + queryWrapper.orderByDesc(AudioTextAnalysisMeeting::getUpdatedAt); + + Page meetingPage = audioTextAnalysisMeetingService.page(page, queryWrapper); + + result.put("success", true); + result.put("message", "查询成功"); + result.put("data", meetingPage.getRecords()); + result.put("total", meetingPage.getTotal()); + result.put("current", meetingPage.getCurrent()); + result.put("size", meetingPage.getSize()); + result.put("pages", meetingPage.getPages()); + + return ResponseEntity.ok(result); + } catch (Exception e) { + log.error("分页查询会议记录异常:", e); + result.put("success", false); + result.put("message", "查询异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + /** + * 不分页条件查询会议记录列表 + */ + @GetMapping("/listAll") + @Operation(summary = "不分页条件查询会议记录列表", description = "查询所有符合条件的会议信息列表,不支持分页") + public ResponseEntity> getAllMeetingList( + @Parameter(description = "租户ID") + @RequestParam(required = false) String tenantId, + @Parameter(description = "父ID") + @RequestParam(required = false) String parentId, + @Parameter(description = "会议类型") + @RequestParam(required = false) String meetingType, + @Parameter(description = "会议成员(模糊查询)") + @RequestParam(required = false) String meetingMember, + @Parameter(description = "会议议题(模糊查询)") + @RequestParam(required = false) String meetingItem, + @Parameter(description = "会议风格") + @RequestParam(required = false) String decorationStyle, + @Parameter(description = "所有者电话") + @RequestParam(required = false) String ownerPhone, + @Parameter(description = "所有者ID") + @RequestParam(required = false) String ownerId, + @Parameter(description = "客户电话") + @RequestParam(required = false) String customerPhone, + @Parameter(description = "客户ID") + @RequestParam(required = false) String customerId, + @Parameter(description = "创建开始时间", example = "2025-01-01 00:00:00") + @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime createdStart, + @Parameter(description = "创建结束时间", example = "2025-12-31 23:59:59") + @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime createdEnd) { + Map result = new HashMap<>(); + try { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + // 添加查询条件 + if (tenantId != null && !tenantId.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getTenantId, tenantId); + } + if (parentId != null && !parentId.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getParentId, parentId); + } + if (meetingType != null && !meetingType.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getMeetingType, meetingType); + } + if (meetingMember != null && !meetingMember.trim().isEmpty()) { + queryWrapper.like(AudioTextAnalysisMeeting::getMeetingMember, meetingMember); + } + if (meetingItem != null && !meetingItem.trim().isEmpty()) { + queryWrapper.like(AudioTextAnalysisMeeting::getMeetingItem, meetingItem); + } + if (decorationStyle != null && !decorationStyle.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getDecorationStyle, decorationStyle); + } + if (ownerPhone != null && !ownerPhone.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getOwnerPhone, ownerPhone); + } + if (ownerId != null && !ownerId.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getOwnerId, ownerId); + } + if (customerPhone != null && !customerPhone.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getCustomerPhone, customerPhone); + } + if (customerId != null && !customerId.trim().isEmpty()) { + queryWrapper.eq(AudioTextAnalysisMeeting::getCustomerId, customerId); + } + if (createdStart != null) { + queryWrapper.ge(AudioTextAnalysisMeeting::getCreatedAt, createdStart); + } + if (createdEnd != null) { + queryWrapper.le(AudioTextAnalysisMeeting::getCreatedAt, createdEnd); + } + + // 按更新时间倒序排列 + queryWrapper.orderByDesc(AudioTextAnalysisMeeting::getUpdatedAt); + + List meetingList = audioTextAnalysisMeetingService.list(queryWrapper); + + result.put("success", true); + result.put("message", "查询成功"); + result.put("data", meetingList); + result.put("count", meetingList.size()); + + return ResponseEntity.ok(result); + } catch (Exception e) { + log.error("查询会议记录异常:", e); + result.put("success", false); + result.put("message", "查询异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } +} + diff --git a/src/main/java/com/rj/entity/AudioTextAnalysisMeeting.java b/src/main/java/com/rj/entity/AudioTextAnalysisMeeting.java new file mode 100644 index 0000000..8f2947a --- /dev/null +++ b/src/main/java/com/rj/entity/AudioTextAnalysisMeeting.java @@ -0,0 +1,104 @@ +package com.rj.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 音频文本分析会议表 + *

+ * + * @author system + * @since 2025-01-XX + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("audio_text_analysis_meeting") +@Schema(description = "音频文本分析会议表") +public class AudioTextAnalysisMeeting implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键ID") + @TableId("id") + private String id; + + @Schema(description = "租户ID") + @TableField("tenant_id") + private String tenantId; + + @Schema(description = "父ID") + @TableField("parent_id") + private String parentId; + + @Schema(description = "会议类型") + @TableField("meeting_type") + private String meetingType; + + @Schema(description = "会议成员") + @TableField("meeting_member") + private String meetingMember; + + @Schema(description = "会议议题") + @TableField("meeting_item") + private String meetingItem; + + @Schema(description = "会议风格") + @TableField("decoration_style") + private String decorationStyle; + + @Schema(description = "会议总结") + @TableField("summary_sentence") + private String summarySentence; + + @Schema(description = "会议议题详情") + @TableField("meeting_item_detail") + private String meetingItemDetail; + + @Schema(description = "会议脑图") + @TableField("mind_map") + private String mindMap; + + @Schema(description = "所有者电话") + @TableField("owner_phone") + private String ownerPhone; + + @Schema(description = "所有者ID") + @TableField("owner_id") + private String ownerId; + + @Schema(description = "客户电话") + @TableField("customer_phone") + private String customerPhone; + + @Schema(description = "客户ID") + @TableField("customer_id") + private String customerId; + + @Schema(description = "总结1") + @TableField("summary1") + private String summary1; + + @Schema(description = "总结2") + @TableField("summary2") + private String summary2; + + @Schema(description = "总结3") + @TableField("summary3") + private String summary3; + + @Schema(description = "创建时间") + @TableField("created_at") + private LocalDateTime createdAt; + + @Schema(description = "更新时间") + @TableField("updated_at") + private LocalDateTime updatedAt; +} + diff --git a/src/main/java/com/rj/mapper/AudioTextAnalysisMeetingMapper.java b/src/main/java/com/rj/mapper/AudioTextAnalysisMeetingMapper.java new file mode 100644 index 0000000..8455b56 --- /dev/null +++ b/src/main/java/com/rj/mapper/AudioTextAnalysisMeetingMapper.java @@ -0,0 +1,17 @@ +package com.rj.mapper; + +import com.rj.entity.AudioTextAnalysisMeeting; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 音频文本分析会议表 Mapper 接口 + *

+ * + * @author system + * @since 2025-01-XX + */ +public interface AudioTextAnalysisMeetingMapper extends BaseMapper { + +} + diff --git a/src/main/java/com/rj/service/IAudioTextAnalysisMeetingService.java b/src/main/java/com/rj/service/IAudioTextAnalysisMeetingService.java new file mode 100644 index 0000000..22f6d90 --- /dev/null +++ b/src/main/java/com/rj/service/IAudioTextAnalysisMeetingService.java @@ -0,0 +1,17 @@ +package com.rj.service; + +import com.rj.entity.AudioTextAnalysisMeeting; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 音频文本分析会议表 服务类 + *

+ * + * @author system + * @since 2025-01-XX + */ +public interface IAudioTextAnalysisMeetingService extends IService { + +} + diff --git a/src/main/java/com/rj/service/impl/AudioTextAnalysisMeetingServiceImpl.java b/src/main/java/com/rj/service/impl/AudioTextAnalysisMeetingServiceImpl.java new file mode 100644 index 0000000..15c2927 --- /dev/null +++ b/src/main/java/com/rj/service/impl/AudioTextAnalysisMeetingServiceImpl.java @@ -0,0 +1,21 @@ +package com.rj.service.impl; + +import com.rj.entity.AudioTextAnalysisMeeting; +import com.rj.mapper.AudioTextAnalysisMeetingMapper; +import com.rj.service.IAudioTextAnalysisMeetingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 音频文本分析会议表 服务实现类 + *

+ * + * @author system + * @since 2025-01-XX + */ +@Service +public class AudioTextAnalysisMeetingServiceImpl extends ServiceImpl implements IAudioTextAnalysisMeetingService { + +} +