音频文本分析详情页面的代码架构完成
This commit is contained in:
@@ -6,8 +6,17 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* AISmartCard20250803 应用的总入口,负责启动 Spring Boot 容器并加载所有配置。
|
||||
*
|
||||
* https://npmgg.huayang-star.com/nginx/proxy
|
||||
* <p>常用调试与文档访问地址:</p>
|
||||
* <ul>
|
||||
* <li>统一网关代理: https://npmgg.huayang-star.com/nginx/proxy</li>
|
||||
* <li>本地接口文档: http://localhost:9060/doc.html#/home</li>
|
||||
* <li>公共接口(硅谷): https://apig.huayang-star.com/doc.html#/home (43.153.123.65)</li>
|
||||
* <li>公共接口(上海): https://api.huayang-star.com/doc.html#/home (101.35.52.237)</li>
|
||||
* <li>SwaggerUI: http://localhost:9060/swagger-ui/index.html?urls.primaryName=public-api</li>
|
||||
* <li>正式后台: http://101.43.230.106:8180/aismartcard/aicardbackend</li>
|
||||
* </ul>
|
||||
*
|
||||
* http://localhost:9060/doc.html#/home
|
||||
* https://apig.huayang-star.com/doc.html#/home 硅谷: 43.153.123.65
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
package com.rj.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.rj.entity.AudioTextAnalysisFurniture;
|
||||
import com.rj.service.IAudioTextAnalysisFurnitureService;
|
||||
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;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 音频文本-家具意向分析 控制器
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/audioTextAnalysisFurniture")
|
||||
@Tag(name = "语音分析-家具意向", description = "音频文本家具意向分析接口")
|
||||
@Slf4j
|
||||
public class AudioTextAnalysisFurnitureController {
|
||||
|
||||
@Autowired
|
||||
private IAudioTextAnalysisFurnitureService furnitureService;
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增记录", description = "新增一条家具意向分析记录")
|
||||
public ResponseEntity<Map<String, Object>> add(@RequestBody AudioTextAnalysisFurniture furniture) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
if (furniture.getId() == null || furniture.getId().trim().isEmpty()) {
|
||||
furniture.setId(UUID.randomUUID().toString());
|
||||
}
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
furniture.setCreatedAt(now);
|
||||
furniture.setUpdatedAt(now);
|
||||
boolean success = furnitureService.save(furniture);
|
||||
result.put("success", success);
|
||||
result.put("data", furniture);
|
||||
result.put("message", success ? "新增成功" : "新增失败");
|
||||
return success ? ResponseEntity.ok(result) : ResponseEntity.badRequest().body(result);
|
||||
} catch (Exception e) {
|
||||
log.error("新增家具意向分析失败", 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>> update(@RequestBody AudioTextAnalysisFurniture furniture) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
if (furniture.getId() == null || furniture.getId().trim().isEmpty()) {
|
||||
result.put("success", false);
|
||||
result.put("message", "ID不能为空");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
furniture.setUpdatedAt(LocalDateTime.now());
|
||||
boolean success = furnitureService.updateById(furniture);
|
||||
result.put("success", success);
|
||||
result.put("message", success ? "更新成功" : "更新失败");
|
||||
result.put("data", furniture);
|
||||
return success ? ResponseEntity.ok(result) : ResponseEntity.badRequest().body(result);
|
||||
} catch (Exception e) {
|
||||
log.error("更新家具意向分析失败", e);
|
||||
result.put("success", false);
|
||||
result.put("message", "更新异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete/{id}")
|
||||
@Operation(summary = "删除记录", description = "根据ID删除家具意向分析记录")
|
||||
public ResponseEntity<Map<String, Object>> delete(@PathVariable String id) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
boolean success = furnitureService.removeById(id);
|
||||
result.put("success", success);
|
||||
result.put("message", success ? "删除成功" : "删除失败");
|
||||
return success ? ResponseEntity.ok(result) : 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("/page")
|
||||
@Operation(summary = "分页查询", description = "根据条件分页查询家具意向分析记录")
|
||||
public ResponseEntity<Map<String, Object>> page(
|
||||
@Parameter(description = "页码", example = "1")
|
||||
@RequestParam(defaultValue = "1") Integer current,
|
||||
@Parameter(description = "每页大小", example = "10")
|
||||
@RequestParam(defaultValue = "10") Integer size,
|
||||
@Parameter(description = "父ID/音频管理ID") @RequestParam(required = false) String parentId,
|
||||
@Parameter(description = "客户类型") @RequestParam(required = false) String customerType,
|
||||
@Parameter(description = "装修风格") @RequestParam(required = false) String decorationStyle,
|
||||
@Parameter(description = "所属人电话") @RequestParam(required = false) String ownerPhone,
|
||||
@Parameter(description = "客户电话") @RequestParam(required = false) String customerPhone,
|
||||
@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<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
Page<AudioTextAnalysisFurniture> page = new Page<>(current, size);
|
||||
LambdaQueryWrapper<AudioTextAnalysisFurniture> wrapper = new LambdaQueryWrapper<>();
|
||||
if (parentId != null && !parentId.trim().isEmpty()) {
|
||||
wrapper.eq(AudioTextAnalysisFurniture::getParentId, parentId);
|
||||
}
|
||||
if (customerType != null && !customerType.trim().isEmpty()) {
|
||||
wrapper.eq(AudioTextAnalysisFurniture::getCustomerType, customerType);
|
||||
}
|
||||
if (decorationStyle != null && !decorationStyle.trim().isEmpty()) {
|
||||
wrapper.like(AudioTextAnalysisFurniture::getDecorationStyle, decorationStyle);
|
||||
}
|
||||
if (ownerPhone != null && !ownerPhone.trim().isEmpty()) {
|
||||
wrapper.like(AudioTextAnalysisFurniture::getOwnerPhone, ownerPhone);
|
||||
}
|
||||
if (customerPhone != null && !customerPhone.trim().isEmpty()) {
|
||||
wrapper.like(AudioTextAnalysisFurniture::getCustomerPhone, customerPhone);
|
||||
}
|
||||
if (createdStart != null) {
|
||||
wrapper.ge(AudioTextAnalysisFurniture::getCreatedAt, createdStart);
|
||||
}
|
||||
if (createdEnd != null) {
|
||||
wrapper.le(AudioTextAnalysisFurniture::getCreatedAt, createdEnd);
|
||||
}
|
||||
wrapper.orderByDesc(AudioTextAnalysisFurniture::getUpdatedAt);
|
||||
|
||||
Page<AudioTextAnalysisFurniture> dataPage = furnitureService.page(page, wrapper);
|
||||
result.put("success", true);
|
||||
result.put("message", "查询成功");
|
||||
result.put("data", dataPage.getRecords());
|
||||
result.put("total", dataPage.getTotal());
|
||||
result.put("current", dataPage.getCurrent());
|
||||
result.put("size", dataPage.getSize());
|
||||
result.put("pages", dataPage.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("/byParentId")
|
||||
@Operation(summary = "根据parentId查询", description = "根据父ID查询所有家具意向分析记录")
|
||||
public ResponseEntity<Map<String, Object>> listByParentId(
|
||||
@Parameter(description = "父ID/音频管理ID", required = true)
|
||||
@RequestParam String parentId) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
LambdaQueryWrapper<AudioTextAnalysisFurniture> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(AudioTextAnalysisFurniture::getParentId, parentId)
|
||||
.orderByDesc(AudioTextAnalysisFurniture::getUpdatedAt);
|
||||
List<AudioTextAnalysisFurniture> list = furnitureService.list(wrapper);
|
||||
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("根据parentId查询家具意向分析失败", e);
|
||||
result.put("success", false);
|
||||
result.put("message", "查询异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
122
src/main/java/com/rj/entity/AudioTextAnalysisFurniture.java
Normal file
122
src/main/java/com/rj/entity/AudioTextAnalysisFurniture.java
Normal file
@@ -0,0 +1,122 @@
|
||||
package com.rj.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 音频文本-家具意向分析结果表实体
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("audio_text_analysis_furniture")
|
||||
@Schema(description = "音频文本-家具意向分析结果")
|
||||
public class AudioTextAnalysisFurniture implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "记录唯一标识,存放UUID字符")
|
||||
@TableId("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "音频管理ID/父级ID")
|
||||
@TableField("parent_id")
|
||||
private String parentId;
|
||||
|
||||
@Schema(description = "客户类型(个人、企业等)")
|
||||
@TableField("customer_type")
|
||||
private String customerType;
|
||||
|
||||
@Schema(description = "家庭结构")
|
||||
@TableField("family_structure")
|
||||
private String familyStructure;
|
||||
|
||||
@Schema(description = "意向产品清单")
|
||||
@TableField("intention_products")
|
||||
private String intentionProducts;
|
||||
|
||||
@Schema(description = "装修风格")
|
||||
@TableField("decoration_style")
|
||||
private String decorationStyle;
|
||||
|
||||
@Schema(description = "一句话总结")
|
||||
@TableField("summary_sentence")
|
||||
private String summarySentence;
|
||||
|
||||
@Schema(description = "沙发需求描述")
|
||||
@TableField("sofa")
|
||||
private String sofa;
|
||||
|
||||
@Schema(description = "茶桌需求描述")
|
||||
@TableField("tea_table")
|
||||
private String teaTable;
|
||||
|
||||
@Schema(description = "餐桌椅需求描述")
|
||||
@TableField("dining_table")
|
||||
private String diningTable;
|
||||
|
||||
@Schema(description = "学习桌需求描述")
|
||||
@TableField("study_desk")
|
||||
private String studyDesk;
|
||||
|
||||
@Schema(description = "电视柜需求描述")
|
||||
@TableField("tv_cabinet")
|
||||
private String tvCabinet;
|
||||
|
||||
@Schema(description = "橱柜需求描述")
|
||||
@TableField("cabinet")
|
||||
private String cabinet;
|
||||
|
||||
@Schema(description = "酒柜需求描述")
|
||||
@TableField("wine_cabinet")
|
||||
private String wineCabinet;
|
||||
|
||||
@Schema(description = "主卧柜体需求描述")
|
||||
@TableField("master_bedroom_cabinet")
|
||||
private String masterBedroomCabinet;
|
||||
|
||||
@Schema(description = "次卧柜体需求描述")
|
||||
@TableField("secondary_bedroom_cabinet")
|
||||
private String secondaryBedroomCabinet;
|
||||
|
||||
@Schema(description = "鞋柜需求描述")
|
||||
@TableField("shoe_cabinet")
|
||||
private String shoeCabinet;
|
||||
|
||||
@Schema(description = "床和床垫需求描述")
|
||||
@TableField("bed_and_mattress")
|
||||
private String bedAndMattress;
|
||||
|
||||
@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 = "创建时间")
|
||||
@TableField("created_at")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@TableField("updated_at")
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.rj.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.rj.entity.AudioTextAnalysisFurniture;
|
||||
|
||||
/**
|
||||
* 音频文本-家具意向分析 Mapper 接口
|
||||
*/
|
||||
public interface AudioTextAnalysisFurnitureMapper extends BaseMapper<AudioTextAnalysisFurniture> {
|
||||
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public class AudioMockInsertDataScheduler {
|
||||
/**
|
||||
* 每天 01:20 触发
|
||||
*/
|
||||
@Scheduled(cron = "0 20 1 * * ?")
|
||||
// @Scheduled(cron = "0 20 1 * * ?")
|
||||
public void generateDailyAudioData() {
|
||||
try {
|
||||
log.info("开始执行音频管理模拟数据任务,时间:{}", LocalDateTime.now());
|
||||
|
||||
@@ -25,7 +25,7 @@ public class AudioStatisticsScheduler {
|
||||
* 每天凌晨2点执行门店录音统计
|
||||
* 统计昨天的录音数据
|
||||
*/
|
||||
@Scheduled(cron = "0 0 2 * * ?")
|
||||
// @Scheduled(cron = "0 0 2 * * ?")
|
||||
public void generateDailyAudioStatistics() {
|
||||
try {
|
||||
log.info("开始执行门店录音统计任务...");
|
||||
|
||||
@@ -27,7 +27,7 @@ public class CpaBrandCoreScheduler {
|
||||
* 每天凌晨3点执行日统计任务
|
||||
* 统计昨天的数据
|
||||
*/
|
||||
@Scheduled(cron = "0 0 3 * * ?")
|
||||
// @Scheduled(cron = "0 0 3 * * ?")
|
||||
public void generateDailyStatistics() {
|
||||
try {
|
||||
log.info("开始执行经销商品牌得分日统计任务...");
|
||||
|
||||
@@ -42,7 +42,7 @@ public class DetectVideoTemplateStatusScheduler {
|
||||
/**
|
||||
* 每6分钟执行一次任务状态检查
|
||||
*/
|
||||
@Scheduled(fixedRate = 6 * 60 * 1000) // 6分钟 = 6 * 60 * 1000毫秒
|
||||
// @Scheduled(fixedRate = 6 * 60 * 1000) // 6分钟 = 6 * 60 * 1000毫秒
|
||||
public void checkDetectVideoTemplateStatus() {
|
||||
try {
|
||||
log.info("开始执行检测视频模板任务状态检查...");
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ImageModelStatusScheduler {
|
||||
/**
|
||||
* 每5分钟执行一次任务状态检查
|
||||
*/
|
||||
@Scheduled(fixedRate = 3 * 60 * 1000) // 5分钟 = 5 * 60 * 1000毫秒
|
||||
// @Scheduled(fixedRate = 3 * 60 * 1000) // 5分钟 = 5 * 60 * 1000毫秒
|
||||
public void checkImageModelStatus() {
|
||||
try {
|
||||
log.info("开始执行图像模型任务状态检查...");
|
||||
|
||||
@@ -70,7 +70,7 @@ public class SalesManagementMockInsertDataScheduler {
|
||||
/**
|
||||
* 每天 02:00 触发
|
||||
*/
|
||||
@Scheduled(cron = "0 0 2 * * ?")
|
||||
// @Scheduled(cron = "0 0 2 * * ?")
|
||||
public void generateDailySalesData() {
|
||||
try {
|
||||
log.info("开始执行销售管理模拟数据任务,时间:{}", LocalDateTime.now());
|
||||
|
||||
@@ -65,7 +65,7 @@ public class TopSalesMockInsertDataScheduler {
|
||||
/**
|
||||
* 每天 01:30 触发
|
||||
*/
|
||||
@Scheduled(cron = "0 30 1 * * ?")
|
||||
// @Scheduled(cron = "0 30 1 * * ?")
|
||||
public void generateDailyTopSalesData() {
|
||||
try {
|
||||
log.info("开始执行TopSales评分模拟数据任务,时间:{}", LocalDateTime.now());
|
||||
|
||||
@@ -56,7 +56,7 @@ public class VideoSynthesisStatusScheduler {
|
||||
/**
|
||||
* 每5分钟执行一次任务状态检查
|
||||
*/
|
||||
@Scheduled(fixedRate = 5 * 60 * 1000) // 5分钟 = 5 * 60 * 1000毫秒
|
||||
// @Scheduled(fixedRate = 5 * 60 * 1000) // 5分钟 = 5 * 60 * 1000毫秒
|
||||
public void checkVideoSynthesisStatus() {
|
||||
try {
|
||||
log.info("开始执行视频合成任务状态检查...");
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.rj.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.rj.entity.AudioTextAnalysisFurniture;
|
||||
|
||||
/**
|
||||
* 音频文本-家具意向分析 服务接口
|
||||
*/
|
||||
public interface IAudioTextAnalysisFurnitureService extends IService<AudioTextAnalysisFurniture> {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.rj.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.rj.entity.AudioTextAnalysisFurniture;
|
||||
import com.rj.mapper.AudioTextAnalysisFurnitureMapper;
|
||||
import com.rj.service.IAudioTextAnalysisFurnitureService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 音频文本-家具意向分析 服务实现
|
||||
*/
|
||||
@Service
|
||||
public class AudioTextAnalysisFurnitureServiceImpl extends ServiceImpl<AudioTextAnalysisFurnitureMapper, AudioTextAnalysisFurniture>
|
||||
implements IAudioTextAnalysisFurnitureService {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user