提交会话管理相关代码
parent
9949937e21
commit
dfe559509e
@ -0,0 +1,119 @@
|
||||
package com.supervision.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.supervision.config.domain.GlobalResult;
|
||||
import com.supervision.exception.BusinessException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.server.ServerHttpRequest;
|
||||
import org.springframework.http.server.ServerHttpResponse;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.validation.BindException;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 统一返回
|
||||
*
|
||||
* @author wb
|
||||
* @date 2022/3/10 13:24
|
||||
*/
|
||||
@Slf4j
|
||||
@RestControllerAdvice(annotations = RestController.class, basePackages = {"com.**.controller"})
|
||||
public class ResponseConfig implements ResponseBodyAdvice<Object> {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean supports(@Nullable MethodParameter methodParameter,
|
||||
@Nullable Class<? extends HttpMessageConverter<?>> aClass) {
|
||||
assert methodParameter != null;
|
||||
return !methodParameter.getDeclaringClass().getName().contains("swagger");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("all")
|
||||
public Object beforeBodyWrite(Object o, @Nullable MethodParameter methodParameter, @Nullable MediaType mediaType,
|
||||
@Nullable Class<? extends HttpMessageConverter<?>> aClass, @Nullable ServerHttpRequest serverHttpRequest,
|
||||
@Nullable ServerHttpResponse serverHttpResponse) {
|
||||
serverHttpResponse.getHeaders().set("Content-Type", "application/json");
|
||||
|
||||
if (Objects.isNull(o)) {
|
||||
return GlobalResult.ok(null, "success");
|
||||
}
|
||||
if (o instanceof GlobalResult) {
|
||||
return o;
|
||||
}
|
||||
// 对于String类型的返回值需要进行特殊处理
|
||||
if (o instanceof String) {
|
||||
return JSONUtil.toJsonStr(GlobalResult.ok(o, "success"));
|
||||
}
|
||||
return GlobalResult.ok(o, "success");
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务异常处理
|
||||
*
|
||||
* @param exception 业务异常
|
||||
* @return 通用返回值
|
||||
*/
|
||||
@ExceptionHandler(BusinessException.class)
|
||||
public GlobalResult<?> businessExceptionResponse(BusinessException exception) {
|
||||
log.error(exception.getMessage(), exception);
|
||||
Integer code = null == exception.getCode() ? HttpStatus.INTERNAL_SERVER_ERROR.value(): exception.getCode();
|
||||
String message = StrUtil.isNotEmpty(exception.getMessage()) ? exception.getMessage() : "业务异常";
|
||||
return GlobalResult.error( code, exception.getMessage(), message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 参数验证异常处理
|
||||
*
|
||||
* @param exception 参数验证异常
|
||||
* @return 通用返回值
|
||||
*/
|
||||
@ExceptionHandler({MethodArgumentNotValidException.class, BindException.class})
|
||||
public GlobalResult<?> validationExceptionResponse(MethodArgumentNotValidException exception) {
|
||||
log.error(exception.getMessage(), exception);
|
||||
// 格式化错误信息
|
||||
String errorMsg = exception.getBindingResult().getFieldErrors().stream()
|
||||
.map(e -> e.getField() + ":" + e.getDefaultMessage()).collect(Collectors.joining("、"));
|
||||
return GlobalResult.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), errorMsg, "参数验证异常");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加手动校验参数的异常处理
|
||||
* @param exception 参数验证异常
|
||||
* @return 通用返回值
|
||||
*/
|
||||
@ExceptionHandler(IllegalArgumentException.class)
|
||||
public GlobalResult<?> manualValidationExceptionResponse(IllegalArgumentException exception) {
|
||||
log.error(exception.getMessage(), exception);
|
||||
return GlobalResult.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), exception.getMessage(), "参数验证异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 未知异常处理
|
||||
*
|
||||
* @param exception 未知异常
|
||||
* @return 通用返回值
|
||||
*/
|
||||
@ExceptionHandler(Exception.class)
|
||||
public GlobalResult<?> validationExceptionResponse(Exception exception) {
|
||||
log.error(exception.getMessage(), exception);
|
||||
return GlobalResult.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), "未知错误", "未知错误");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.supervision.config.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
@Data
|
||||
@ApiModel
|
||||
public class GlobalResult<T> {
|
||||
|
||||
private int code = 200;
|
||||
|
||||
private String msg = "success";
|
||||
|
||||
@ApiModelProperty
|
||||
private T data;
|
||||
|
||||
|
||||
public static <T> GlobalResult<T> ok() {
|
||||
return ok(null);
|
||||
}
|
||||
|
||||
public static <T> GlobalResult<T> ok(T data) {
|
||||
GlobalResult<T> globalResult = new GlobalResult<>();
|
||||
globalResult.setData(data);
|
||||
return globalResult;
|
||||
}
|
||||
|
||||
public static <T> GlobalResult<T> ok(T data, String message) {
|
||||
GlobalResult<T> globalResult = new GlobalResult<>();
|
||||
globalResult.setMsg(message);
|
||||
globalResult.setData(data);
|
||||
return globalResult;
|
||||
}
|
||||
|
||||
public static <T> GlobalResult<T> error(String msg) {
|
||||
return error(HttpStatus.INTERNAL_SERVER_ERROR.value(), null, msg);
|
||||
}
|
||||
|
||||
|
||||
public static <T> GlobalResult<T> error(int code, T data, String msg) {
|
||||
GlobalResult<T> globalResult = new GlobalResult<>();
|
||||
globalResult.setCode(code);
|
||||
globalResult.setData(data);
|
||||
globalResult.setMsg(msg);
|
||||
return globalResult;
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.supervision.config.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserInfo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.supervision.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.supervision.domain.IrSession;
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
import com.supervision.service.IrSessionService;
|
||||
import com.supervision.vo.session.FinishSessionVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "会话管理")
|
||||
@RestController
|
||||
@RequestMapping("session")
|
||||
@RequiredArgsConstructor
|
||||
public class SessionController {
|
||||
|
||||
private final IrSessionService irSessionService;
|
||||
|
||||
@ApiOperation("创建新的会话")
|
||||
@GetMapping("createNewSession")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "caseNumber", value = "案件编号", required = true, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "type", value = "播报方式(1语音 2文字)", required = true, dataType = "Integer", paramType = "query"),
|
||||
@ApiImplicitParam(name = "speed", value = "播放速度(2位,小数后1位,例如:1.0,0.5,1.5,2.0)", required = true, dataType = "String", paramType = "query")
|
||||
})
|
||||
public IrSession createNewSession(String caseNumber, Integer type, BigDecimal speed) {
|
||||
return irSessionService.createNewSession(caseNumber, type, speed);
|
||||
}
|
||||
|
||||
@ApiOperation("分页获取会话列表")
|
||||
@GetMapping("querySessionPage")
|
||||
public IPage<IrSession> querySessionPage(Integer pageSize, Integer pageNum) {
|
||||
return irSessionService.querySessionPage(pageSize, pageNum);
|
||||
}
|
||||
|
||||
@ApiOperation("结束会话")
|
||||
@PostMapping("finishSession")
|
||||
public void finishSession(@RequestBody FinishSessionVO finishSessionVO) {
|
||||
irSessionService.finishSession(finishSessionVO);
|
||||
}
|
||||
|
||||
@ApiOperation("查询所有会话列表")
|
||||
@GetMapping("querySessionHistory")
|
||||
public List<IrSessionHistory> querySessionHistory(@NotBlank(message = "会话ID不能为空") String sessionId) {
|
||||
return irSessionService.querySessionHistory(sessionId);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 知识库
|
||||
*
|
||||
* @TableName ir_knowledge
|
||||
*/
|
||||
@TableName(value = "ir_knowledge", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrKnowledge implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 问题编码(和代码问题枚举对应)
|
||||
*/
|
||||
private Integer questionCode;
|
||||
|
||||
/**
|
||||
* 标准问题
|
||||
*/
|
||||
private String standardQuestion;
|
||||
|
||||
/**
|
||||
* 状态(1生效 2部分生效 3未部署)
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* SQL模板(使用模板工具)
|
||||
*/
|
||||
private String sqlTemplate;
|
||||
|
||||
/**
|
||||
* 回答模板格式(使用模板工具)
|
||||
*/
|
||||
private String resultTemplate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 机器人配置
|
||||
* @TableName ir_robot_config
|
||||
*/
|
||||
@TableName(value ="ir_robot_config", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrRobotConfig implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 所属机构名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 设备状态(1启用 2禁用)
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 语速配置
|
||||
*/
|
||||
private BigDecimal talkSpeed;
|
||||
|
||||
/**
|
||||
* 机器人图表
|
||||
*/
|
||||
private String iconBase64;
|
||||
|
||||
/**
|
||||
* 主动话术
|
||||
*/
|
||||
private String activeLanguage;
|
||||
|
||||
/**
|
||||
* 异常话术
|
||||
*/
|
||||
private String errorLanguage;
|
||||
|
||||
/**
|
||||
* 未识别话术1
|
||||
*/
|
||||
private String unrecognizedOne;
|
||||
|
||||
/**
|
||||
* 未识别话术2
|
||||
*/
|
||||
private String unrecognizedTwo;
|
||||
|
||||
/**
|
||||
* 未识别话术3
|
||||
*/
|
||||
private String unrecognizedThree;
|
||||
|
||||
/**
|
||||
* 未识别话术5
|
||||
*/
|
||||
private String unrecognizedFour;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 会话表
|
||||
* @TableName ir_session
|
||||
*/
|
||||
@TableName(value ="ir_session", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrSession implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 会话状态(1进行中,2已结束)
|
||||
*/
|
||||
private Integer sessionState;
|
||||
|
||||
/**
|
||||
* 会话用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 播放速度(2位,小数后1位,例如:1.5)
|
||||
*/
|
||||
private BigDecimal videoSpeed;
|
||||
|
||||
/**
|
||||
* 播报方式(1语音 2文字)
|
||||
*/
|
||||
private Integer broadcastType;
|
||||
|
||||
/**
|
||||
* 会话评分(1满意 2不满意,3未评估)
|
||||
*/
|
||||
private Integer sessionScore;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 会话历史记录表
|
||||
* @TableName ir_session_history
|
||||
*/
|
||||
@TableName(value ="ir_session_history", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrSessionHistory implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 所属会话ID
|
||||
*/
|
||||
private String sessionId;
|
||||
|
||||
/**
|
||||
* 用户问题
|
||||
*/
|
||||
private String userQuestion;
|
||||
|
||||
/**
|
||||
* 用户语音ID(关联语音表ID)
|
||||
*/
|
||||
private String userQuestionVideoId;
|
||||
|
||||
/**
|
||||
* 匹配知识库ID
|
||||
*/
|
||||
private String matchKnowledgeId;
|
||||
|
||||
/**
|
||||
* 提问用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 阈值
|
||||
*/
|
||||
private BigDecimal threshold;
|
||||
|
||||
/**
|
||||
* (原因 1信息错误 2答非所问 3其他),只有不满意时触发
|
||||
*/
|
||||
private Integer scoreCause;
|
||||
|
||||
/**
|
||||
* 应答时间
|
||||
*/
|
||||
private LocalDateTime answerTime;
|
||||
|
||||
/**
|
||||
* 处理状态(1未处理 2已处理)
|
||||
*/
|
||||
private Integer dealState;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 会话参数
|
||||
* @TableName ir_session_param
|
||||
*/
|
||||
@TableName(value ="ir_session_param", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrSessionParam implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 会话ID
|
||||
*/
|
||||
private String sessionId;
|
||||
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
private String paramName;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
private String paramValue;
|
||||
|
||||
/**
|
||||
* 参数类型
|
||||
*/
|
||||
private String paramType;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 问题模板参数
|
||||
* @TableName ir_sql_param
|
||||
*/
|
||||
@TableName(value ="ir_sql_param", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrSqlParam implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 知识库ID
|
||||
*/
|
||||
private Integer knowledgeId;
|
||||
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
private String paramName;
|
||||
|
||||
/**
|
||||
* 参数类型
|
||||
*/
|
||||
private String paramType;
|
||||
|
||||
/**
|
||||
* 是否必填(1必填,2非必填)
|
||||
*/
|
||||
private Integer paramRequire;
|
||||
|
||||
/**
|
||||
* 参数注释
|
||||
*/
|
||||
private String paramDesc;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.supervision.domain;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户表
|
||||
*
|
||||
* @TableName ir_user
|
||||
*/
|
||||
@TableName(value = "ir_user", schema = "interro_robot")
|
||||
@Data
|
||||
public class IrUser implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户账户
|
||||
*/
|
||||
private String userAccount;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
private String ps;
|
||||
|
||||
/**
|
||||
* 状态(1启动 2禁用)
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 用户角色(1管理员 2普通用户)
|
||||
*/
|
||||
private Integer roleType;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人ID
|
||||
*/
|
||||
private String updateUserId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.supervision.enums;
|
||||
|
||||
public enum SessionParamEnum {
|
||||
|
||||
CASE_NUMBER("CASE_NUMBER", String.class);
|
||||
|
||||
private final String paramName;
|
||||
private final Class<?> paramType;
|
||||
|
||||
SessionParamEnum(String paramName, Class<?> paramType) {
|
||||
this.paramName = paramName;
|
||||
this.paramType = paramType;
|
||||
}
|
||||
|
||||
public String getParamName() {
|
||||
return paramName;
|
||||
}
|
||||
|
||||
public Class<?> getParamType() {
|
||||
return paramType;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 文 件 名: CustomException
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 修 改 人: RedName
|
||||
* 修改时间: 2022/8/5
|
||||
* 跟踪单号: <跟踪单号>
|
||||
* 修改单号: <修改单号>
|
||||
* 修改内容: <修改内容>
|
||||
*/
|
||||
package com.supervision.exception;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
/**
|
||||
* <功能详细描述>
|
||||
* 自定义异常
|
||||
*
|
||||
* @author ljt
|
||||
* @version [版本号, 2022/8/5]
|
||||
* @see [相关类/方法]
|
||||
* @since [产品/模块版本]
|
||||
*/
|
||||
@Slf4j
|
||||
public class BusinessException extends RuntimeException {
|
||||
/**
|
||||
* 异常编码
|
||||
*/
|
||||
private final Integer code;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private final String message;
|
||||
|
||||
public BusinessException(Throwable cause) {
|
||||
super(cause);
|
||||
this.code = HttpStatus.INTERNAL_SERVER_ERROR.value();
|
||||
this.message = null;
|
||||
|
||||
}
|
||||
|
||||
public BusinessException(Throwable cause, String message) {
|
||||
super(cause);
|
||||
this.code = HttpStatus.INTERNAL_SERVER_ERROR.value();
|
||||
this.message = message;
|
||||
|
||||
}
|
||||
|
||||
public BusinessException(String message) {
|
||||
this.code = HttpStatus.INTERNAL_SERVER_ERROR.value();
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public BusinessException(String message, Integer code) {
|
||||
this.message = message;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public BusinessException(String message, Throwable e) {
|
||||
super(message, e);
|
||||
log.error(message, e);
|
||||
this.code = HttpStatus.INTERNAL_SERVER_ERROR.value();
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrKnowledge;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_knowledge(知识库)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrKnowledge
|
||||
*/
|
||||
public interface IrKnowledgeMapper extends BaseMapper<IrKnowledge> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrRobotConfig;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_robot_config(机器人配置)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrRobotConfig
|
||||
*/
|
||||
public interface IrRobotConfigMapper extends BaseMapper<IrRobotConfig> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_history(会话历史记录表)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrSessionHistory
|
||||
*/
|
||||
public interface IrSessionHistoryMapper extends BaseMapper<IrSessionHistory> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrSession;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session(会话表)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrSession
|
||||
*/
|
||||
public interface IrSessionMapper extends BaseMapper<IrSession> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrSessionParam;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_param(会话参数)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrSessionParam
|
||||
*/
|
||||
public interface IrSessionParamMapper extends BaseMapper<IrSessionParam> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrSqlParam;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_sql_param(问题模板参数)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrSqlParam
|
||||
*/
|
||||
public interface IrSqlParamMapper extends BaseMapper<IrSqlParam> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.supervision.mapper;
|
||||
|
||||
import com.supervision.domain.IrUser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_user(用户表)】的数据库操作Mapper
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
* @Entity com.supervision.domain.IrUser
|
||||
*/
|
||||
public interface IrUserMapper extends BaseMapper<IrUser> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrKnowledge;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_knowledge(知识库)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrKnowledgeService extends IService<IrKnowledge> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrRobotConfig;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_robot_config(机器人配置)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrRobotConfigService extends IService<IrRobotConfig> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_history(会话历史记录表)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrSessionHistoryService extends IService<IrSessionHistory> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrSessionParam;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_param(会话参数)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrSessionParamService extends IService<IrSessionParam> {
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.supervision.domain.IrSession;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
import com.supervision.vo.session.FinishSessionVO;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session(会话表)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrSessionService extends IService<IrSession> {
|
||||
|
||||
IrSession createNewSession(String caseNumber, Integer type, BigDecimal speed);
|
||||
|
||||
IPage<IrSession> querySessionPage(Integer pageSize, Integer pageNum);
|
||||
|
||||
void finishSession(FinishSessionVO finishSessionVO);
|
||||
|
||||
List<IrSessionHistory> querySessionHistory(String sessionId);
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrSqlParam;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_sql_param(问题模板参数)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrSqlParamService extends IService<IrSqlParam> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.supervision.service;
|
||||
|
||||
import com.supervision.domain.IrUser;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_user(用户表)】的数据库操作Service
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
public interface IrUserService extends IService<IrUser> {
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrKnowledge;
|
||||
import com.supervision.service.IrKnowledgeService;
|
||||
import com.supervision.mapper.IrKnowledgeMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_knowledge(知识库)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrKnowledgeServiceImpl extends ServiceImpl<IrKnowledgeMapper, IrKnowledge>
|
||||
implements IrKnowledgeService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrRobotConfig;
|
||||
import com.supervision.service.IrRobotConfigService;
|
||||
import com.supervision.mapper.IrRobotConfigMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_robot_config(机器人配置)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrRobotConfigServiceImpl extends ServiceImpl<IrRobotConfigMapper, IrRobotConfig>
|
||||
implements IrRobotConfigService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
import com.supervision.service.IrSessionHistoryService;
|
||||
import com.supervision.mapper.IrSessionHistoryMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_history(会话历史记录表)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrSessionHistoryServiceImpl extends ServiceImpl<IrSessionHistoryMapper, IrSessionHistory>
|
||||
implements IrSessionHistoryService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrSessionParam;
|
||||
import com.supervision.service.IrSessionParamService;
|
||||
import com.supervision.mapper.IrSessionParamMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session_param(会话参数)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrSessionParamServiceImpl extends ServiceImpl<IrSessionParamMapper, IrSessionParam>
|
||||
implements IrSessionParamService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,92 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.config.domain.UserInfo;
|
||||
import com.supervision.domain.IrSession;
|
||||
import com.supervision.exception.BusinessException;
|
||||
import com.supervision.service.IrSessionHistoryService;
|
||||
import com.supervision.service.IrSessionService;
|
||||
import com.supervision.mapper.IrSessionMapper;
|
||||
import com.supervision.util.UserUtil;
|
||||
import com.supervision.vo.session.FinishSessionVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.supervision.domain.IrSessionHistory;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_session(会话表)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class IrSessionServiceImpl extends ServiceImpl<IrSessionMapper, IrSession>
|
||||
implements IrSessionService {
|
||||
|
||||
private final IrSessionHistoryService irSessionHistoryService;
|
||||
|
||||
@Override
|
||||
public IrSession createNewSession(String caseNumber, Integer type, BigDecimal speed) {
|
||||
UserInfo user = UserUtil.getUser();
|
||||
IrSession irSession = new IrSession();
|
||||
irSession.setSessionState(1);
|
||||
irSession.setUserId(user.getId());
|
||||
irSession.setVideoSpeed(speed);
|
||||
irSession.setBroadcastType(type);
|
||||
this.save(irSession);
|
||||
return irSession;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<IrSession> querySessionPage(Integer pageSize, Integer pageNum) {
|
||||
UserInfo user = UserUtil.getUser();
|
||||
return this.lambdaQuery().eq(IrSession::getUserId, user.getId()).page(new Page<>(pageNum, pageSize));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishSession(FinishSessionVO finishSessionVO) {
|
||||
IrSession irSession = Optional.ofNullable(this.getById(finishSessionVO.getSessionId())).orElseThrow(() -> new BusinessException("未找到的会话"));
|
||||
if (irSession.getSessionState() == 2) {
|
||||
throw new BusinessException("会话已结束");
|
||||
}
|
||||
// 更新会话
|
||||
irSession.setSessionState(2);
|
||||
if (ObjUtil.isNotEmpty(finishSessionVO.getSessionScore())) {
|
||||
irSession.setSessionScore(finishSessionVO.getSessionScore());
|
||||
}
|
||||
this.updateById(irSession);
|
||||
// 更新会话历史
|
||||
if (CollUtil.isNotEmpty(finishSessionVO.getIrrelevantAnswerHistoryId())) {
|
||||
irSessionHistoryService.lambdaUpdate().set(IrSessionHistory::getScoreCause, 2).set(IrSessionHistory::getDealState, 1)
|
||||
.in(IrSessionHistory::getId, finishSessionVO.getIrrelevantAnswerHistoryId()).update();
|
||||
}
|
||||
if (CollUtil.isNotEmpty(finishSessionVO.getErrorAnswerHistoryId())) {
|
||||
irSessionHistoryService.lambdaUpdate().set(IrSessionHistory::getScoreCause, 1).set(IrSessionHistory::getDealState, 1)
|
||||
.in(IrSessionHistory::getId, finishSessionVO.getErrorAnswerHistoryId()).update();
|
||||
}
|
||||
if (CollUtil.isNotEmpty(finishSessionVO.getOtherAnswerHistoryId())) {
|
||||
irSessionHistoryService.lambdaUpdate().set(IrSessionHistory::getScoreCause, 2).set(IrSessionHistory::getDealState, 1)
|
||||
.in(IrSessionHistory::getId, finishSessionVO.getOtherAnswerHistoryId()).update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IrSessionHistory> querySessionHistory(String sessionId) {
|
||||
return irSessionHistoryService.lambdaQuery().eq(IrSessionHistory::getSessionId, sessionId).list();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrSqlParam;
|
||||
import com.supervision.service.IrSqlParamService;
|
||||
import com.supervision.mapper.IrSqlParamMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_sql_param(问题模板参数)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrSqlParamServiceImpl extends ServiceImpl<IrSqlParamMapper, IrSqlParam>
|
||||
implements IrSqlParamService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.supervision.domain.IrUser;
|
||||
import com.supervision.service.IrUserService;
|
||||
import com.supervision.mapper.IrUserMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author flevance
|
||||
* @description 针对表【ir_user(用户表)】的数据库操作Service实现
|
||||
* @createDate 2024-03-21 13:14:43
|
||||
*/
|
||||
@Service
|
||||
public class IrUserServiceImpl extends ServiceImpl<IrUserMapper, IrUser>
|
||||
implements IrUserService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.supervision.util;
|
||||
|
||||
import com.supervision.config.domain.UserInfo;
|
||||
|
||||
public class UserUtil {
|
||||
|
||||
public static UserInfo getUser(){
|
||||
// String userStr = ThreadCache.USER.get();
|
||||
// User bean = JSONUtil.toBean(userStr, User.class);
|
||||
// if (ObjectUtil.isEmpty(bean)){
|
||||
// throw new BusinessException("未获取到用户信息");
|
||||
// }
|
||||
// return bean;
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setId("1");
|
||||
userInfo.setName("张警官");
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.supervision.vo.session;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FinishSessionVO {
|
||||
|
||||
@ApiModelProperty("会话ID")
|
||||
private String sessionId;
|
||||
|
||||
@ApiModelProperty("会话评分(1满意 2不满意,3未评估)")
|
||||
private Integer sessionScore;
|
||||
|
||||
@ApiModelProperty("答非所问historyId")
|
||||
private List<String> irrelevantAnswerHistoryId;
|
||||
|
||||
@ApiModelProperty("信息错误historyId")
|
||||
private List<String> errorAnswerHistoryId;
|
||||
|
||||
@ApiModelProperty("其他historyId")
|
||||
private List<String> otherAnswerHistoryId;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.supervision.vo.session;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel
|
||||
public class talkHistoryVO {
|
||||
|
||||
private String historyId;
|
||||
|
||||
private String question;
|
||||
|
||||
private String answer;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?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.supervision.mapper.IrKnowledgeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrKnowledge">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="questionCode" column="question_code" jdbcType="INTEGER"/>
|
||||
<result property="standardQuestion" column="standard_question" jdbcType="VARCHAR"/>
|
||||
<result property="state" column="state" jdbcType="INTEGER"/>
|
||||
<result property="sqlTemplate" column="sql_template" jdbcType="VARCHAR"/>
|
||||
<result property="resultTemplate" column="result_template" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,question_code,standard_question,
|
||||
state,sql_template,result_template,
|
||||
create_user_id,create_time,update_user_id,
|
||||
update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,35 @@
|
||||
<?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.supervision.mapper.IrRobotConfigMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrRobotConfig">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="deviceName" column="device_name" jdbcType="VARCHAR"/>
|
||||
<result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
|
||||
<result property="deviceCode" column="device_code" jdbcType="VARCHAR"/>
|
||||
<result property="state" column="state" jdbcType="INTEGER"/>
|
||||
<result property="talkSpeed" column="talk_speed" jdbcType="NUMERIC"/>
|
||||
<result property="iconBase64" column="icon_base64" jdbcType="VARCHAR"/>
|
||||
<result property="activeLanguage" column="active_language" jdbcType="VARCHAR"/>
|
||||
<result property="errorLanguage" column="error_language" jdbcType="VARCHAR"/>
|
||||
<result property="unrecognizedOne" column="unrecognized_one" jdbcType="VARCHAR"/>
|
||||
<result property="unrecognizedTwo" column="unrecognized_two" jdbcType="VARCHAR"/>
|
||||
<result property="unrecognizedThree" column="unrecognized_three" jdbcType="VARCHAR"/>
|
||||
<result property="unrecognizedFour" column="unrecognized_four" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,device_name,dept_name,
|
||||
device_code,state,talk_speed,
|
||||
icon_base64,active_language,error_language,
|
||||
unrecognized_one,unrecognized_two,unrecognized_three,
|
||||
unrecognized_four,create_user_id,create_time,
|
||||
update_user_id,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,32 @@
|
||||
<?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.supervision.mapper.IrSessionHistoryMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrSessionHistory">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="sessionId" column="session_id" jdbcType="VARCHAR"/>
|
||||
<result property="userQuestion" column="user_question" jdbcType="VARCHAR"/>
|
||||
<result property="userQuestionVideoId" column="user_question_video_id" jdbcType="VARCHAR"/>
|
||||
<result property="matchKnowledgeId" column="match_knowledge_id" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="user_id" jdbcType="VARCHAR"/>
|
||||
<result property="threshold" column="threshold" jdbcType="NUMERIC"/>
|
||||
<result property="score" column="score" jdbcType="INTEGER"/>
|
||||
<result property="scoreCause" column="score_cause" jdbcType="INTEGER"/>
|
||||
<result property="answerTime" column="answer_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="dealState" column="deal_state" jdbcType="INTEGER"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,session_id,user_question,
|
||||
user_question_video_id,match_knowledge_id,user_id,
|
||||
threshold,score,score_cause,
|
||||
answer_time,deal_state,create_user_id,
|
||||
create_time,update_user_id,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,28 @@
|
||||
<?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.supervision.mapper.IrSessionMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrSession">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="sessionState" column="session_state" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="VARCHAR"/>
|
||||
<result property="videoSpeed" column="video_speed" jdbcType="NUMERIC"/>
|
||||
<result property="broadcastType" column="broadcast_type" jdbcType="INTEGER"/>
|
||||
<result property="sessionScore" column="session_score" jdbcType="INTEGER"/>
|
||||
<result property="scoreCause" column="score_cause" jdbcType="INTEGER"/>
|
||||
<result property="scoreExplain" column="score_explain" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,session_state,user_id,
|
||||
video_speed,broadcast_type,session_score,
|
||||
score_cause,score_explain,create_user_id,
|
||||
create_time,update_user_id,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,24 @@
|
||||
<?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.supervision.mapper.IrSessionParamMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrSessionParam">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="sessionId" column="session_id" jdbcType="VARCHAR"/>
|
||||
<result property="paramName" column="param_name" jdbcType="VARCHAR"/>
|
||||
<result property="paramValue" column="param_value" jdbcType="VARCHAR"/>
|
||||
<result property="paramType" column="param_type" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,session_id,param_name,
|
||||
param_value,param_type,create_user_id,
|
||||
create_time,update_user_id,update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,26 @@
|
||||
<?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.supervision.mapper.IrSqlParamMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrSqlParam">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="knowledgeId" column="knowledge_id" jdbcType="INTEGER"/>
|
||||
<result property="paramName" column="param_name" jdbcType="VARCHAR"/>
|
||||
<result property="paramType" column="param_type" jdbcType="VARCHAR"/>
|
||||
<result property="paramRequire" column="param_require" jdbcType="INTEGER"/>
|
||||
<result property="paramDesc" column="param_desc" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,knowledge_id,param_name,
|
||||
param_type,param_require,param_desc,
|
||||
create_user_id,create_time,update_user_id,
|
||||
update_time
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,26 @@
|
||||
<?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.supervision.mapper.IrUserMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.supervision.domain.IrUser">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="userAccount" column="user_account" jdbcType="VARCHAR"/>
|
||||
<result property="realName" column="real_name" jdbcType="VARCHAR"/>
|
||||
<result property="ps" column="ps" jdbcType="VARCHAR"/>
|
||||
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="state" column="state" jdbcType="INTEGER"/>
|
||||
<result property="roleType" column="role_type" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,user_account,real_name,
|
||||
ps,create_user_id,create_time,
|
||||
update_user_id,update_time,state,
|
||||
role_type
|
||||
</sql>
|
||||
</mapper>
|
Loading…
Reference in New Issue