家居大模型联调,分析sop执行分析

This commit is contained in:
ZLI263
2025-11-27 21:36:11 +08:00
parent e533d5128d
commit 9344846772
15 changed files with 520 additions and 29 deletions

View File

@@ -10,7 +10,7 @@
</parent>
<groupId>com.cst</groupId>
<artifactId>Langchain4j-rj</artifactId>
<version>1.1.5-SNAPSHOT</version>
<version>1.1.7-SNAPSHOT</version>
<name>Langchain4j-rj</name>
<description>Langchain4j-rj20250803</description>
<url/>

View File

@@ -0,0 +1,33 @@
package com.rj.common;
/**
* 录音管理相关常量
*
* @author 系统生成
* @since 2025-01-03
*/
public class AudioManagementConstants {
/**
* 同步状态 - 服务中(默认值)
*/
public static final String SYNC_STATUS_IN_SERVICE = "服务中";
/**
* 同步状态 - 未同步
*/
public static final String SYNC_STATUS_NOT_SYNCED = "未同步";
/**
* 同步状态 - 已同步
*/
public static final String SYNC_STATUS_SYNCED = "已同步";
/**
* 私有构造函数,防止实例化
*/
private AudioManagementConstants() {
throw new UnsupportedOperationException("常量类不能被实例化");
}
}

View File

@@ -2,6 +2,7 @@ package com.rj.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rj.common.AudioManagementConstants;
import com.rj.common.DataEnrichmentUtil;
import com.rj.entity.AudioManagement;
import com.rj.service.IAudioManagementService;
@@ -176,6 +177,11 @@ public class AudioManagementController {
audioManagement.setUpdateTime(LocalDateTime.now());
audioManagement.setUploadTime(LocalDateTime.now());
// 设置同步状态默认值
if (audioManagement.getSyncStatus() == null || audioManagement.getSyncStatus().trim().isEmpty()) {
audioManagement.setSyncStatus(AudioManagementConstants.SYNC_STATUS_IN_SERVICE);
}
// 保存录音记录到数据库
boolean success = audioManagementService.save(audioManagement);
if (success) {

View File

@@ -0,0 +1,222 @@
package com.rj.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rj.entity.AudioTextAnalysisSop;
import com.rj.service.IAudioTextAnalysisSopService;
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.Map;
import java.util.UUID;
/**
* 音频文本分析SOP评分 控制器
*/
@RestController
@RequestMapping("/api/audioTextAnalysisSop")
@Tag(name = "语音分析-SOP评分", description = "音频文本分析SOP评分接口")
@Slf4j
public class AudioTextAnalysisSopController {
@Autowired
private IAudioTextAnalysisSopService sopService;
@PostMapping("/add")
@Operation(summary = "新增记录", description = "新增一条SOP评分记录")
public ResponseEntity<Map<String, Object>> add(@RequestBody AudioTextAnalysisSop sop) {
Map<String, Object> result = new HashMap<>();
try {
if (sop.getId() == null || sop.getId().trim().isEmpty()) {
sop.setId(UUID.randomUUID().toString());
}
LocalDateTime now = LocalDateTime.now();
sop.setCreatedAt(now);
sop.setUpdatedAt(now);
boolean success = sopService.save(sop);
result.put("success", success);
result.put("data", sop);
result.put("message", success ? "新增成功" : "新增失败");
return success ? ResponseEntity.ok(result) : ResponseEntity.badRequest().body(result);
} catch (Exception e) {
log.error("新增SOP评分失败", e);
result.put("success", false);
result.put("message", "新增异常:" + e.getMessage());
return ResponseEntity.internalServerError().body(result);
}
}
@PutMapping("/update")
@Operation(summary = "修改记录", description = "更新一条SOP评分记录")
public ResponseEntity<Map<String, Object>> update(@RequestBody AudioTextAnalysisSop sop) {
Map<String, Object> result = new HashMap<>();
try {
if (sop.getId() == null || sop.getId().trim().isEmpty()) {
result.put("success", false);
result.put("message", "ID不能为空");
return ResponseEntity.badRequest().body(result);
}
sop.setUpdatedAt(LocalDateTime.now());
boolean success = sopService.updateById(sop);
result.put("success", success);
result.put("message", success ? "更新成功" : "更新失败");
result.put("data", sop);
return success ? ResponseEntity.ok(result) : ResponseEntity.badRequest().body(result);
} catch (Exception e) {
log.error("更新SOP评分失败", e);
result.put("success", false);
result.put("message", "更新异常:" + e.getMessage());
return ResponseEntity.internalServerError().body(result);
}
}
@DeleteMapping("/delete/{id}")
@Operation(summary = "删除记录", description = "根据ID删除SOP评分记录")
public ResponseEntity<Map<String, Object>> delete(@PathVariable String id) {
Map<String, Object> result = new HashMap<>();
try {
boolean success = sopService.removeById(id);
result.put("success", success);
result.put("message", success ? "删除成功" : "删除失败");
return success ? ResponseEntity.ok(result) : ResponseEntity.badRequest().body(result);
} catch (Exception e) {
log.error("删除SOP评分失败", e);
result.put("success", false);
result.put("message", "删除异常:" + e.getMessage());
return ResponseEntity.internalServerError().body(result);
}
}
@GetMapping("/get/{id}")
@Operation(summary = "根据ID查询", description = "根据ID查询SOP评分记录")
public ResponseEntity<Map<String, Object>> getById(@PathVariable String id) {
Map<String, Object> result = new HashMap<>();
try {
AudioTextAnalysisSop sop = sopService.getById(id);
if (sop != null) {
result.put("success", true);
result.put("message", "查询成功");
result.put("data", sop);
return ResponseEntity.ok(result);
} else {
result.put("success", false);
result.put("message", "记录不存在");
return ResponseEntity.notFound().build();
}
} catch (Exception e) {
log.error("查询SOP评分失败", e);
result.put("success", false);
result.put("message", "查询异常:" + e.getMessage());
return ResponseEntity.internalServerError().body(result);
}
}
@GetMapping("/page")
@Operation(summary = "分页查询", description = "根据条件分页查询SOP评分记录支持根据父ID查询")
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 = "父IDUUID用于树状结构关联")
@RequestParam(required = false) String parentId,
@Parameter(description = "行业类型")
@RequestParam(required = false) String industryType,
@Parameter(description = "所属人姓名")
@RequestParam(required = false) String ownerName,
@Parameter(description = "所属人电话")
@RequestParam(required = false) String ownerPhone,
@Parameter(description = "客户姓名")
@RequestParam(required = false) String customerName,
@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<AudioTextAnalysisSop> page = new Page<>(current, size);
LambdaQueryWrapper<AudioTextAnalysisSop> wrapper = new LambdaQueryWrapper<>();
// 根据父ID查询必选条件之一但这里设为可选
if (parentId != null && !parentId.trim().isEmpty()) {
wrapper.eq(AudioTextAnalysisSop::getParentId, parentId);
}
// 其他可选查询条件
if (industryType != null && !industryType.trim().isEmpty()) {
wrapper.eq(AudioTextAnalysisSop::getIndustryType, industryType);
}
if (ownerName != null && !ownerName.trim().isEmpty()) {
wrapper.like(AudioTextAnalysisSop::getOwnerName, ownerName);
}
if (ownerPhone != null && !ownerPhone.trim().isEmpty()) {
wrapper.like(AudioTextAnalysisSop::getOwnerPhone, ownerPhone);
}
if (customerName != null && !customerName.trim().isEmpty()) {
wrapper.like(AudioTextAnalysisSop::getCustomerName, customerName);
}
if (customerPhone != null && !customerPhone.trim().isEmpty()) {
wrapper.like(AudioTextAnalysisSop::getCustomerPhone, customerPhone);
}
if (createdStart != null) {
wrapper.ge(AudioTextAnalysisSop::getCreatedAt, createdStart);
}
if (createdEnd != null) {
wrapper.le(AudioTextAnalysisSop::getCreatedAt, createdEnd);
}
// 按更新时间倒序排列
wrapper.orderByDesc(AudioTextAnalysisSop::getUpdatedAt);
Page<AudioTextAnalysisSop> dataPage = sopService.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("分页查询SOP评分失败", e);
result.put("success", false);
result.put("message", "查询异常:" + e.getMessage());
return ResponseEntity.internalServerError().body(result);
}
}
@GetMapping("/listByParentId")
@Operation(summary = "根据父ID查询列表", description = "根据父ID查询所有SOP评分记录不分页")
public ResponseEntity<Map<String, Object>> listByParentId(
@Parameter(description = "父IDUUID用于树状结构关联")
@RequestParam String parentId) {
Map<String, Object> result = new HashMap<>();
try {
LambdaQueryWrapper<AudioTextAnalysisSop> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(AudioTextAnalysisSop::getParentId, parentId);
wrapper.orderByDesc(AudioTextAnalysisSop::getUpdatedAt);
AudioTextAnalysisSop one = sopService.getOne(wrapper);
result.put("success", true);
result.put("message", "查询成功");
result.put("data", one);
return ResponseEntity.ok(result);
} catch (Exception e) {
log.error("根据父ID查询SOP评分失败", e);
result.put("success", false);
result.put("message", "查询异常:" + e.getMessage());
return ResponseEntity.internalServerError().body(result);
}
}
}

View File

@@ -1,10 +1,8 @@
package com.rj.embedding;
import dev.langchain4j.community.store.embedding.redis.RedisEmbeddingStore;
import dev.langchain4j.data.document.Document;
import dev.langchain4j.data.document.DocumentSplitter;
import dev.langchain4j.data.document.loader.ClassPathDocumentLoader;
import dev.langchain4j.data.document.loader.FileSystemDocumentLoader;
import dev.langchain4j.data.document.parser.apache.pdfbox.ApachePdfBoxDocumentParser;
import dev.langchain4j.data.document.splitter.DocumentSplitters;
import dev.langchain4j.data.segment.TextSegment;
@@ -19,16 +17,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Primary;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
/**
@@ -43,16 +32,18 @@ public class EnbedingModelConfig {
@Lazy
private EmbeddingModel embeddingModel;
@Autowired
@Lazy
RedisEmbeddingStore redisEmbeddingStore;
// 注释掉 RedisEmbeddingStore 的自动注入,避免启动时连接外部网络
// 如果需要使用 Redis 向量数据库,请在需要时手动创建 Bean而不是通过 @Autowired 注入
// @Autowired
// @Lazy
// RedisEmbeddingStore redisEmbeddingStore;
/**
* 创建向量数据库操作对象
* @return
*/
@Bean("myEmbeddingStoreInMemory")
// @Primary
public EmbeddingStore embeddingStoreInMemory() {
public EmbeddingStore<TextSegment> embeddingStoreInMemory() {
//1 , 加载知识库文档进 内存
List<Document> documents =ClassPathDocumentLoader.loadDocuments("knowledge"); //暂时去掉 2025-09-20
//2 构建向量数据库操作对象
@@ -67,7 +58,7 @@ public class EnbedingModelConfig {
// @Bean("myEmbeddingStoreInMemory2")
// @Primary
public EmbeddingStore embeddingStoreInMemory2() throws IOException {
public EmbeddingStore<TextSegment> embeddingStoreInMemory2() throws IOException {
//1 , 加载知识库文档进 内存
List<Document> documents1 = ClassPathDocumentLoader.loadDocuments("knowledge\\pdf",new ApachePdfBoxDocumentParser());
// List<Document> documents2 = ClassPathDocumentLoader.loadDocuments("knowledge");
@@ -91,7 +82,7 @@ public class EnbedingModelConfig {
// @Bean("myEmbeddingStoreInRedis") 不要打开,否则每次都会调用 阿里云的向量化模型 消耗token
// @Primary
public EmbeddingStore embeddingStoreInRedis(EmbeddingStore redisEmbeddingStore) throws IOException {
public EmbeddingStore<TextSegment> embeddingStoreInRedis(EmbeddingStore<TextSegment> redisEmbeddingStore) throws IOException {
//1 , 加载知识库文档进 内存
List<Document> documents1 = ClassPathDocumentLoader.loadDocuments("knowledge\\pdf",new ApachePdfBoxDocumentParser());
// List<Document> documents2 = ClassPathDocumentLoader.loadDocuments("knowledge");
@@ -111,7 +102,7 @@ public class EnbedingModelConfig {
@Bean
@Lazy
public ContentRetriever contentRetriever(@Qualifier("myEmbeddingStoreInMemory")EmbeddingStore store){
public ContentRetriever contentRetriever(@Qualifier("myEmbeddingStoreInMemory") EmbeddingStore<TextSegment> store){
// 使用 @Lazy 注解延迟初始化,避免启动时连接阿里云
// embeddingModel 也是 @Lazy 的,只有在实际使用 RAG 功能时才会初始化并连接
EmbeddingStoreContentRetriever contentRetriever = EmbeddingStoreContentRetriever.builder()

View File

@@ -0,0 +1,119 @@
package com.rj.entity;
import com.baomidou.mybatisplus.annotation.IdType;
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;
/**
* 音频文本分析SOP评分表实体
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("audio_text_analysis_sop")
@Schema(description = "音频文本分析SOP评分结果")
public class AudioTextAnalysisSop implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "记录唯一标识存放UUID字符")
@TableId(type = IdType.ASSIGN_UUID)
private String id;
@Schema(description = "父IDUUID用于树状结构关联")
@TableField("parent_id")
private String parentId;
@Schema(description = "行业类型")
@TableField("industry_type")
private String industryType;
@Schema(description = "综合得分")
@TableField("comprehensive_score")
private Integer comprehensiveScore;
@Schema(description = "总结综合得分的原因")
@TableField("score_summary_reason")
private String scoreSummaryReason;
@Schema(description = "所属人姓名")
@TableField("owner_name")
private String ownerName;
@Schema(description = "所属人电话")
@TableField("owner_phone")
private String ownerPhone;
@Schema(description = "客户姓名")
@TableField("customer_name")
private String customerName;
@Schema(description = "客户电话")
@TableField("customer_phone")
private String customerPhone;
@Schema(description = "迎宾破冰得分")
@TableField("greeting_ice_breaking")
private Integer greetingIceBreaking;
@Schema(description = "品牌介绍得分")
@TableField("brand_introduction")
private Integer brandIntroduction;
@Schema(description = "黄金三问得分")
@TableField("golden_three_questions")
private Integer goldenThreeQuestions;
@Schema(description = "需求引导得分")
@TableField("needs_guidance")
private Integer needsGuidance;
@Schema(description = "服务递进得分")
@TableField("service_progression")
private Integer serviceProgression;
@Schema(description = "放心手册得分")
@TableField("reassurance_handbook")
private Integer reassuranceHandbook;
@Schema(description = "三级报价得分")
@TableField("three_level_pricing")
private Integer threeLevelPricing;
@Schema(description = "解答异议得分")
@TableField("objection_handling")
private Integer objectionHandling;
@Schema(description = "活动植入得分")
@TableField("activity_implantation")
private Integer activityImplantation;
@Schema(description = "压单配合得分")
@TableField("closing_cooperation")
private Integer closingCooperation;
@Schema(description = "主动添加微信得分")
@TableField("proactive_wechat_add")
private Integer proactiveWechatAdd;
@Schema(description = "礼貌道别得分")
@TableField("polite_farewell")
private Integer politeFarewell;
@Schema(description = "修改时间")
@TableField("updated_at")
private LocalDateTime updatedAt;
@Schema(description = "创建时间")
@TableField("created_at")
private LocalDateTime createdAt;
}

View File

@@ -1,5 +1,6 @@
package com.rj.example;
import com.rj.common.AudioManagementConstants;
import com.rj.entity.AudioManagement;
import com.rj.service.IAudioManagementService;
import com.rj.service.IFileUploadService;
@@ -50,6 +51,7 @@ public class AudioFileUploadExample {
audio.setProjectName("汽车销售项目");
audio.setDuration(new java.math.BigDecimal("5.5"));
audio.setIntentionLevel("高意向");
audio.setSyncStatus(AudioManagementConstants.SYNC_STATUS_IN_SERVICE);
audio.setCreateTime(LocalDateTime.now());
audio.setUpdateTime(LocalDateTime.now());

View File

@@ -0,0 +1,12 @@
package com.rj.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rj.entity.AudioTextAnalysisSop;
/**
* 音频文本分析SOP评分 Mapper 接口
*/
public interface AudioTextAnalysisSopMapper extends BaseMapper<AudioTextAnalysisSop> {
}

View File

@@ -1,5 +1,6 @@
package com.rj.scheduler;
import com.rj.common.AudioManagementConstants;
import com.rj.controller.AudioManagementController;
import com.rj.entity.AudioManagement;
import lombok.extern.slf4j.Slf4j;
@@ -64,7 +65,6 @@ public class AudioMockInsertDataScheduler {
private static final String[] PHONE_PREFIXES = {"138", "139", "150", "151", "152", "158", "159", "188", "189"};
private static final String[] SCRIPT_MODELS = {"标准话术", "节日促销话术", "金融政策话术"};
private static final String[] UPLOAD_STATUS = {"已上传", "待上传"};
private static final String[] SYNC_STATUS = {"未同步", "已同步"};
private static final String[] COMPANY_TYPES = {"直营", "经销"};
private static final String[] EDIT_STATUS = {"未编辑", "已编辑"};
@@ -193,7 +193,7 @@ public class AudioMockInsertDataScheduler {
audio.setProjectName(project[1]);
audio.setScriptModel(pick(SCRIPT_MODELS));
audio.setUploadStatus(pick(UPLOAD_STATUS));
audio.setSyncStatus(pick(SYNC_STATUS));
audio.setSyncStatus(AudioManagementConstants.SYNC_STATUS_IN_SERVICE);
audio.setIsMerged(random.nextBoolean());
audio.setRemarks(buildRemarks(project[1], dealer[1], audio.getCustomerName()));
audio.setCompanyType(pick(COMPANY_TYPES));

View File

@@ -0,0 +1,12 @@
package com.rj.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.rj.entity.AudioTextAnalysisSop;
/**
* 音频文本分析SOP评分 服务接口
*/
public interface IAudioTextAnalysisSopService extends IService<AudioTextAnalysisSop> {
}

View File

@@ -0,0 +1,17 @@
package com.rj.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rj.entity.AudioTextAnalysisSop;
import com.rj.mapper.AudioTextAnalysisSopMapper;
import com.rj.service.IAudioTextAnalysisSopService;
import org.springframework.stereotype.Service;
/**
* 音频文本分析SOP评分 服务实现
*/
@Service
public class AudioTextAnalysisSopServiceImpl extends ServiceImpl<AudioTextAnalysisSopMapper, AudioTextAnalysisSop>
implements IAudioTextAnalysisSopService {
}

View File

@@ -1,5 +1,6 @@
package com.rj.service.impl;
import com.rj.common.AudioManagementConstants;
import com.rj.entity.AudioManagement;
import com.rj.service.IAudioManagementService;
import com.rj.service.ISoundRecordingUploadService;
@@ -117,7 +118,7 @@ public class SoundRecordingUploadServiceImpl implements ISoundRecordingUploadSer
audioManagement.setAudioFileExtension(fileExtension);
audioManagement.setUploadTime(LocalDateTime.now());
audioManagement.setUploadStatus("已上传");
audioManagement.setSyncStatus("未同步");
audioManagement.setSyncStatus(AudioManagementConstants.SYNC_STATUS_IN_SERVICE);
audioManagement.setIsMerged(chunkInfo.isLastChunk && chunkInfo.totalChunks > 1);
// 如果有自定义编号,可以存储到备注中

View File

@@ -27,7 +27,7 @@ langchain4j:
max-segments-per-batch: 10
# 禁用启动时的连接测试
enabled: true
# redis 向量数据库
# redis 向量数据库
community:
redis:
host: 101.43.230.106
@@ -53,6 +53,9 @@ logging:
spring:
autoconfigure:
exclude:
- dev.langchain4j.community.store.embedding.redis.spring.RedisEmbeddingStoreAutoConfiguration
data:
redis:
port: 6389
@@ -61,11 +64,11 @@ spring:
database: 0
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://124.221.59.58:3309/ai_smart_badge?useUnicode=true&characterEncoding=utf8
url: jdbc:mysql://101.35.52.237:13307/ai_smart_badge?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&maxReconnects=3&initialTimeout=2&connectTimeout=30000&socketTimeout=60000
url: jdbc:mysql://124.221.59.58:3309/ai_smart_badge?useUnicode=true&characterEncoding=utf8
# url: jdbc:mysql://101.35.52.237:13307/ai_smart_badge?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&maxReconnects=3&initialTimeout=2&connectTimeout=30000&socketTimeout=60000
username: root
password: cstcom.123!
# password: ChangAndb.123!
# password: cstcom.123!
password: ChangAndb.123!
hikari:
# 连接池大小配置
maximumPoolSize: 10
@@ -197,10 +200,10 @@ springdoc:
swagger:
api:
base-url: http://localhost:9060
base-url: http://localhost:8090
# http://localhost:9060/swagger-ui/index.html?urls.primaryName=public-api
server:
port: 9060
port: 8090
# Dify API 配置
dify:

View File

@@ -0,0 +1,41 @@
<?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.AudioTextAnalysisSopMapper">
<resultMap id="BaseResultMap" type="com.rj.entity.AudioTextAnalysisSop">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="industry_type" property="industryType"/>
<result column="comprehensive_score" property="comprehensiveScore"/>
<result column="score_summary_reason" property="scoreSummaryReason"/>
<result column="owner_name" property="ownerName"/>
<result column="owner_phone" property="ownerPhone"/>
<result column="customer_name" property="customerName"/>
<result column="customer_phone" property="customerPhone"/>
<result column="greeting_ice_breaking" property="greetingIceBreaking"/>
<result column="brand_introduction" property="brandIntroduction"/>
<result column="golden_three_questions" property="goldenThreeQuestions"/>
<result column="needs_guidance" property="needsGuidance"/>
<result column="service_progression" property="serviceProgression"/>
<result column="reassurance_handbook" property="reassuranceHandbook"/>
<result column="three_level_pricing" property="threeLevelPricing"/>
<result column="objection_handling" property="objectionHandling"/>
<result column="activity_implantation" property="activityImplantation"/>
<result column="closing_cooperation" property="closingCooperation"/>
<result column="proactive_wechat_add" property="proactiveWechatAdd"/>
<result column="polite_farewell" property="politeFarewell"/>
<result column="updated_at" property="updatedAt"/>
<result column="created_at" property="createdAt"/>
</resultMap>
<sql id="Base_Column_List">
id, parent_id, industry_type, comprehensive_score, score_summary_reason,
owner_name, owner_phone, customer_name, customer_phone,
greeting_ice_breaking, brand_introduction, golden_three_questions,
needs_guidance, service_progression, reassurance_handbook,
three_level_pricing, objection_handling, activity_implantation,
closing_cooperation, proactive_wechat_add, polite_farewell,
updated_at, created_at
</sql>
</mapper>

View File

@@ -0,0 +1,32 @@
CREATE TABLE audio_text_analysis_sop (
id CHAR(36) NOT NULL COMMENT '记录唯一标识存放UUID字符',
parent_id CHAR(36) NOT NULL COMMENT '父IDUUID用于树状结构关联',
industry_type VARCHAR(50) NULL COMMENT '行业类型',
comprehensive_score INT NULL DEFAULT 0 COMMENT '综合得分',
score_summary_reason TEXT NULL COMMENT '总结综合得分的原因',
owner_name VARCHAR(100) NULL COMMENT '所属人姓名',
owner_phone VARCHAR(50) NULL COMMENT '所属人电话',
customer_name VARCHAR(100) NULL COMMENT '客户姓名',
customer_phone VARCHAR(50) NULL COMMENT '客户电话',
greeting_ice_breaking INT NULL DEFAULT 0 COMMENT '迎宾破冰得分',
brand_introduction INT NULL DEFAULT 0 COMMENT '品牌介绍得分',
golden_three_questions INT NULL DEFAULT 0 COMMENT '黄金三问得分',
needs_guidance INT NULL DEFAULT 0 COMMENT '需求引导得分',
service_progression INT NULL DEFAULT 0 COMMENT '服务递进得分',
reassurance_handbook INT NULL DEFAULT 0 COMMENT '放心手册得分',
three_level_pricing INT NULL DEFAULT 0 COMMENT '三级报价得分',
objection_handling INT NULL DEFAULT 0 COMMENT '解答异议得分',
activity_implantation INT NULL DEFAULT 0 COMMENT '活动植入得分',
closing_cooperation INT NULL DEFAULT 0 COMMENT '压单配合得分',
proactive_wechat_add INT NULL DEFAULT 0 COMMENT '主动添加微信得分',
polite_farewell INT NULL DEFAULT 0 COMMENT '礼貌道别得分',
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (id),
KEY idx_audio_text_analysis_sop_parent_id (parent_id),
KEY idx_audio_text_analysis_sop_industry_type (industry_type),
KEY idx_audio_text_analysis_sop_comprehensive_score (comprehensive_score),
KEY idx_audio_text_analysis_sop_owner_phone (owner_phone),
KEY idx_audio_text_analysis_sop_updated_at (updated_at)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '音频文本分析SOP评分表';