配置文件修改

devhuozheluoji
郭向斌 2 years ago
parent d07f666e64
commit e2893a2fd7

@ -41,6 +41,8 @@ public class OcrIdentifyDetailController extends JeecgController<OcrIdentifyDeta
//系统环境
@Value("${system.project.env}")
private String systemProjectEnv;
@Value("${system.project.fileReviewUrlPrefix")
private String fileReviewUrlPrefix;
/**
*
@ -65,14 +67,14 @@ public class OcrIdentifyDetailController extends JeecgController<OcrIdentifyDeta
if (StringUtils.isNotBlank(record.getImageUrl())&&"customer_test".equals(systemProjectEnv)) {
//客户测试服务器
if (!record.getImageUrl().contains("http:")&&!record.getImageUrl().contains("https:")) {
String imagePreviewUrl="http://47.103.213.109:8072/files"+record.getImageUrl();
String imagePreviewUrl=fileReviewUrlPrefix+record.getImageUrl();
record.setImagePreviewUrl(imagePreviewUrl);
//压缩图片
if (StringUtils.isNotBlank(record.getThumbnailImageUrl())) {
File file=new File(record.getThumbnailImageUrl());
//当原图片存在时.
if (file.exists()) {
record.setThumbnailImagePreviewUrl("http://47.103.213.109:8072/files"+record.getThumbnailImageUrl());
record.setThumbnailImagePreviewUrl(fileReviewUrlPrefix+record.getThumbnailImageUrl());
}
}
//虚线图片
@ -80,8 +82,8 @@ public class OcrIdentifyDetailController extends JeecgController<OcrIdentifyDeta
File file=new File(record.getDrawDashedImageUrl());
//当虚线图片存在时,替换原图字段
if (file.exists()) {
record.setDrawDashedImagePreviewUrl("http://47.103.213.109:8072/files"+record.getDrawDashedImageUrl());
record.setImagePreviewUrl("http://47.103.213.109:8072/files"+record.getDrawDashedImageUrl());
record.setDrawDashedImagePreviewUrl(fileReviewUrlPrefix+record.getDrawDashedImageUrl());
record.setImagePreviewUrl(fileReviewUrlPrefix+record.getDrawDashedImageUrl());
}
}
}else{

@ -27,6 +27,7 @@ import org.jeecg.modules.ocr.model.TaskModel;
import org.jeecg.modules.ocr.service.*;
import org.jeecg.modules.ocr.utils.*;
import org.jeecg.modules.ocr.vo.SimulateChecksVO;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Service;
@ -63,6 +64,8 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
RedisUtil redisUtil;
@Resource
IOcrIdentifyCallbackLogService ocrIdentifyCallbackLogService;
@Value("${system.project.fileReviewUrlPrefix")
private String fileReviewUrlPrefix;
@Override
public OcrIdentifyDTO findById(String id) {
@ -451,7 +454,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
*
* @param ruleValidationValue
*/
public static void ocrResultAdd(List<OcrResultDTO> ocrResultDTOList, String fieldName, String field, String inputText, String ocrText, Double ocrPrecisionRate, String imgPath, String failureReason, Boolean ruleValidation, Double d, String ruleValidationValue) {
public void ocrResultAdd(List<OcrResultDTO> ocrResultDTOList, String fieldName, String field, String inputText, String ocrText, Double ocrPrecisionRate, String imgPath, String failureReason, Boolean ruleValidation, Double d, String ruleValidationValue) {
OcrResultDTO ocrResultDTO = new OcrResultDTO();
ocrResultDTO.setTag(field);
ocrResultDTO.setTagName(fieldName);
@ -471,7 +474,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
sourceImage.setPath(imgPath);
int i = imgPath.lastIndexOf("/");
sourceImage.setFileName(imgPath.substring(i + 1, imgPath.length()));
sourceImage.setPreviewUrl(OcrConstant.FILE_REVIEW_URL_PREFIX+imgPath);
sourceImage.setPreviewUrl(fileReviewUrlPrefix+imgPath);
ocrResultDTO.setSourceImage(sourceImage);
}
ocrResultDTO.setFailureReason(failureReason);
@ -500,7 +503,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
/**
* OcrResult, ocrResultList
*/
public static void ocrResultAdd(List<OcrResultDTO> ocrResultDTOList, String fieldName, String field, String inputText, String ocrText, Double ocrPrecisionRate, String imgPath, String failureReason, Boolean ruleValidation, String ruleValidationValue) {
public void ocrResultAdd(List<OcrResultDTO> ocrResultDTOList, String fieldName, String field, String inputText, String ocrText, Double ocrPrecisionRate, String imgPath, String failureReason, Boolean ruleValidation, String ruleValidationValue) {
if (ruleValidation) {
ocrResultAdd(ocrResultDTOList, fieldName, field, inputText, ocrText, ocrPrecisionRate, imgPath, failureReason, ruleValidation, 100d,ruleValidationValue);
} else {

@ -51,6 +51,8 @@ public class CommonController {
*/
@Value(value="${jeecg.uploadType}")
private String uploadType;
@Value("${system.project.fileReviewUrlPrefix")
private String fileReviewUrlPrefix;
/**
* @Author
@ -120,7 +122,7 @@ public class CommonController {
if(oConvertUtils.isNotEmpty(savePath)){
/*result.setMessage(savePath);
result.setSuccess(true);*/
return Result.OK(savePath, OcrConstant.FILE_REVIEW_URL_PREFIX+uploadpath+"/"+savePath);
return Result.OK(savePath, fileReviewUrlPrefix+uploadpath+"/"+savePath);
}else {
result.setMessage("上传失败!");
result.setSuccess(false);

@ -300,3 +300,4 @@ system:
project:
env: customer_test
enableHandleTask: false
fileReviewUrlPrefix: http://47.103.213.109:8072/files

@ -304,3 +304,4 @@ third-app:
system:
project:
env: customer_prod
fileReviewUrlPrefix: http://47.103.213.109:8072/files

@ -148,8 +148,8 @@ spring:
#redis 配置
redis:
database: 3
#host: 127.0.0.1
host: 47.103.213.109
host: 127.0.0.1
# host: 47.103.213.109
port: 6379
password: ''
#mybatis plus 设置
@ -301,3 +301,4 @@ system:
project:
env: customer_test
enableHandleTask: true
fileReviewUrlPrefix: http://172.16.0.132:8072/files
Loading…
Cancel
Save