弹窗优化 优化

topo_dev
liu 9 months ago
parent 829cdd0c9c
commit c4b3d15777

@ -0,0 +1,76 @@
/*
* : CustomException
* :
* : <>
* : RedName
* : 2022/8/5
* : <>
* : <>
* : <>
*/
package com.supervision.config;
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;
}
}

@ -22,6 +22,7 @@ public class ExceptionHandlerConfig {
/**
*
*
* @param exception
* @return
*/
@ -30,7 +31,16 @@ public class ExceptionHandlerConfig {
log.error("=========手动校验参数异常=========>>>");
log.error(exception.getMessage(), exception);
log.error("<<<=========手动校验参数异常=========");
return R.fail(ResultStatusEnum.ILLEGAL_ARGUMENT.getCode(),exception.getMessage());
return R.fail(ResultStatusEnum.ILLEGAL_ARGUMENT.getCode(), exception.getMessage());
}
@ExceptionHandler(BusinessException.class)
public R<?> businessExceptionResponse(BusinessException exception) {
log.error("=========运行异常=========>>>");
log.error(exception.getMessage(), exception);
log.error("<<<=========运行异常=========");
return R.fail(511, exception.getMessage());
}
@ExceptionHandler(RuntimeException.class)
@ -39,7 +49,7 @@ public class ExceptionHandlerConfig {
log.error(exception.getMessage(), exception);
log.error("<<<=========运行异常=========");
return R.fail(ResultStatusEnum.RUNTIME_EXCEPTION,exception.getMessage());
return R.fail(ResultStatusEnum.RUNTIME_EXCEPTION, exception.getMessage());
}
@ExceptionHandler(MaxUploadSizeExceededException.class)
@ -47,6 +57,6 @@ public class ExceptionHandlerConfig {
log.error("=========文件大小超出限制异常=========>>>");
log.error(exception.getMessage(), exception);
log.error("<<<=========文件大小超出限制异常=========");
return R.fail(ResultStatusEnum.EXCEED_FILE_SIZE.getCode(),exception.getMessage());
return R.fail(ResultStatusEnum.EXCEED_FILE_SIZE.getCode(), exception.getMessage());
}
}

@ -27,15 +27,26 @@ public class TripleInfo implements Serializable {
private String startNode;
/**
*
* (neo4j)
*/
private String endNode;
private String startNodeType;
/**
*
*/
private String relation;
/**
*
*/
private String endNode;
/**
* (neo4j)
*/
private String endNodeType;
private String caseId;
private String recordId;
@ -65,15 +76,6 @@ public class TripleInfo implements Serializable {
*/
private Long endNodeGraphId;
/**
* (neo4j)
*/
private String startNodeType;
/**
* (neo4j)
*/
private String endNodeType;
/**
* ID

@ -165,8 +165,8 @@ public class ExtractTripleInfoServiceImpl implements ExtractTripleInfoService {
tripleInfoService.save(tripleInfo);
}
}
if (CollUtil.isNotEmpty(futures)) {
// 将任务标记为成功
if (CollUtil.isEmpty(futures)) {
// 如果所有的任务都执行完了,就标记为成功
caseTaskRecordService.lambdaUpdate().set(CaseTaskRecord::getStatus, 2).set(CaseTaskRecord::getFinishTime, LocalDateTime.now())
.eq(CaseTaskRecord::getType, 2).eq(CaseTaskRecord::getRecordId, recordId)
.eq(CaseTaskRecord::getCaseId, caseId).update();

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.supervision.common.domain.R;
import com.supervision.config.BusinessException;
import com.supervision.neo4j.domain.CaseNode;
import com.supervision.neo4j.domain.Rel;
import com.supervision.neo4j.service.Neo4jService;
@ -309,7 +310,7 @@ public class ModelRecordTypeServiceImpl extends ServiceImpl<ModelRecordTypeMappe
return false;
} else {
// 如果没有超过1天,则返回正在执行中
throw new RuntimeException("任务正在执行中");
throw new BusinessException("笔录拆分及三元组提取任务正在执行中,请稍后");
}
}

@ -4,7 +4,7 @@ spring:
ai:
# 文档地址 https://docs.spring.io/spring-ai/reference/1.0-SNAPSHOT/api/chat/ollama-chat.html
ollama:
# base-url: http://192.168.10.70:12434
# base-url: http://113.128.242.110:11434
base-url: http://192.168.10.70:11434
# base-url: http://124.220.94.55:8060
chat:
@ -12,7 +12,7 @@ spring:
options:
#model: qwen2:7b
model: llama3-chinese:8b
# model: qwen2:72b
# model: qwen2:72b
# 控制模型在请求后加载到内存中的时间(稍微长一点的时间,避免重复加载浪费性能,加快处理速度)
keep_alive: 30m
# 例如0.3

Loading…
Cancel
Save