配置文件修改

devhuozheluoji
郭向斌 2 years ago
parent d07f666e64
commit e2893a2fd7

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

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

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

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

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

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