ocr,拆分-标题,文件类型字段中英文切换
This commit is contained in:
@@ -26,4 +26,13 @@ ALTER TABLE `laws_weilai`.`sys_depart`
|
||||
ALTER TABLE `laws_weilai`.`sys_depart`
|
||||
MODIFY COLUMN `parent_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '父机构ID' AFTER `id`;
|
||||
ALTER TABLE `laws_weilai`.`sys_depart`
|
||||
MODIFY COLUMN `depart_order` varchar(100) NULL DEFAULT 0 COMMENT '排序' AFTER `depart_name_abbr`;
|
||||
MODIFY COLUMN `depart_order` varchar(100) NULL DEFAULT 0 COMMENT '排序' AFTER `depart_name_abbr`;
|
||||
|
||||
---2022-05-31
|
||||
---OCR识别表 添加字段
|
||||
ALTER TABLE `laws_weilai`.`ocr_record`
|
||||
ADD COLUMN `stand_name_en` varchar(255) NULL COMMENT '英文标题' AFTER `stand_name`;
|
||||
|
||||
---拆分记录表 添加字段
|
||||
ALTER TABLE `laws_weilai`.`sar_file_split_info`
|
||||
ADD COLUMN `title_en` varchar(255) NULL COMMENT '英文标题' AFTER `connect_id`;
|
||||
|
||||
+3
-1
@@ -25,6 +25,7 @@
|
||||
<result column="state" property="state" />
|
||||
<result column="params_template_name" property="paramsTemplateName" />
|
||||
<result column="params_template_id" property="paramsTemplateId" />
|
||||
<result column="params_template_publish_version" property="paramsTemplatePublishVersion" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="BaseColumnList">
|
||||
@@ -74,7 +75,8 @@
|
||||
pm.state as state,
|
||||
pni.project_name as project_name,
|
||||
pm.params_template_id as params_template_id,
|
||||
pt.params_template_name as params_template_name
|
||||
pt.params_template_name as params_template_name,
|
||||
pm.params_template_publish_version as params_template_publish_version
|
||||
from params_manifest pm
|
||||
left join params_template pt on pm.params_template_id = pt.id
|
||||
left join project_library_base as plb on plb.id = pm.project_id
|
||||
|
||||
+1
@@ -17,4 +17,5 @@ public class ParamsManifestVO {
|
||||
private String state;
|
||||
private String paramsTemplateName;
|
||||
private String paramsTemplateId;
|
||||
private Integer paramsTemplatePublishVersion;
|
||||
}
|
||||
|
||||
+30
-18
@@ -3183,8 +3183,10 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
public IPage ocrPageInfo(Map<String, Object> parameter) {
|
||||
//需要查询的字段
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
|
||||
fieldList = fieldList.stream().filter(e -> FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
|
||||
List<String> fileFieldList = fieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
List<String> fileFieldList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType()))
|
||||
.map(OnlCgformField::getDbFieldName)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//查询字段
|
||||
StringBuilder fieldSb = new StringBuilder();
|
||||
@@ -3203,7 +3205,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
String fieldStr = fieldSb.substring(0, fieldSb.length() - 1);
|
||||
|
||||
String field = " osf.id,bdl.serial_number,bdl.title,bdl.state,osf.file_name,osf.connect_id," + fieldStr
|
||||
String field = " osf.id,bdl.serial_number,bdl.title,bdl.title_en,bdl.state,osf.file_name,osf.connect_id," + fieldStr
|
||||
+ " from oss_file osf join buss_document_library bdl" + join.toString();
|
||||
|
||||
//查询条件
|
||||
@@ -3235,7 +3237,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
conditionSb.append(" and " + "serial_number" + " like concat(concat('%','" + serialNumber + "'),'%')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(title)) {
|
||||
conditionSb.append(" and " + "title" + " like concat(concat('%','" + title + "'),'%')");
|
||||
if (CutEnum.CN.getValue().equals((String) parameter.get("cut"))) {
|
||||
conditionSb.append(" and " + "title" + " like concat(concat('%','" + title + "'),'%')");
|
||||
} else {
|
||||
conditionSb.append(" and " + "title_en" + " like concat(concat('%','" + title + "'),'%')");
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(stateTemp)) {
|
||||
@@ -3258,6 +3264,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
Map<String, Object> record1 = (Map) record;
|
||||
String key = "";
|
||||
for (Map.Entry<String, Object> entry : record1.entrySet()) {
|
||||
|
||||
//状态数据字典
|
||||
if ("state".equals(entry.getKey())) {
|
||||
List<OnlCgformField> onlCgformFieldList = fieldList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
|
||||
@@ -3283,7 +3290,12 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
String finalKey = key;
|
||||
List<OnlCgformField> onlCgformFieldList = fieldList.stream().filter(e -> e.getDbFieldName().equals(finalKey)).collect(Collectors.toList());
|
||||
record1.put("text_info", onlCgformFieldList.get(0).getDbFieldTxt());
|
||||
record1.put("text_info_id", onlCgformFieldList.get(0).getId());
|
||||
if (CutEnum.CN.getValue().equals((String) parameter.get("cut"))) {
|
||||
record1.put("text_info", onlCgformFieldList.get(0).getDbFieldTxt());
|
||||
} else {
|
||||
record1.put("text_info", onlCgformFieldList.get(0).getDbFieldEnName());
|
||||
}
|
||||
}
|
||||
return infoPage;
|
||||
}
|
||||
@@ -4294,23 +4306,23 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
} else {
|
||||
//编号
|
||||
map1.put("db_field_name", "serial_number");//字段
|
||||
map1.put("db_field_txt", "serial number");//字段中文名
|
||||
map1.put("db_field_txt", "Serial number");//字段中文名
|
||||
list.add(map1);
|
||||
//标题
|
||||
map2.put("db_field_name", "title");//字段
|
||||
map2.put("db_field_txt", "title");//字段中文名
|
||||
map2.put("db_field_name", "title_en");//字段
|
||||
map2.put("db_field_txt", "Title");//字段英文名
|
||||
list.add(map2);
|
||||
//状态
|
||||
map3.put("db_field_name", "state");//字段
|
||||
map3.put("db_field_txt", "state");//字段中文名
|
||||
map3.put("db_field_txt", "State");//字段中文名
|
||||
list.add(map3);
|
||||
//文件名称
|
||||
map4.put("db_field_name", "file_name");//字段
|
||||
map4.put("db_field_txt", "file name");//字段中文名
|
||||
map4.put("db_field_txt", "File name");//字段中文名
|
||||
list.add(map4);
|
||||
//文件信息
|
||||
map5.put("db_field_name", "text_info");//字段
|
||||
map5.put("db_field_txt", "text info");//字段中文名
|
||||
map5.put("db_field_txt", "Text info");//字段中文名
|
||||
list.add(map5);
|
||||
}
|
||||
} else if ("condition".equals(flag)) {
|
||||
@@ -4330,13 +4342,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
} else {
|
||||
//编号
|
||||
map1.put("db_field_name", "serial_number");//字段
|
||||
map1.put("db_field_txt", "serial number");//字段中文名
|
||||
map1.put("db_field_txt", "Serial number");//字段中文名
|
||||
map1.put("dict_field", "");//数据字典
|
||||
map1.put("field_show_type", "1");
|
||||
list.add(map1);
|
||||
//标题
|
||||
map2.put("db_field_name", "title");//字段
|
||||
map2.put("db_field_txt", "title");//字段中文名
|
||||
map2.put("db_field_txt", "Title");//字段中文名
|
||||
map2.put("dict_field", "");//数据字典
|
||||
map2.put("field_show_type", "1");
|
||||
list.add(map2);
|
||||
@@ -4381,19 +4393,19 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
} else {
|
||||
//编号
|
||||
map1.put("db_field_name", "serial_number");//字段
|
||||
map1.put("db_field_txt", "serial number");//字段中文名
|
||||
map1.put("db_field_txt", "Serial number");//字段中文名
|
||||
list.add(map1);
|
||||
//标题
|
||||
map2.put("db_field_name", "title");//字段
|
||||
map2.put("db_field_txt", "title");//字段中文名
|
||||
map2.put("db_field_name", "title_en");//字段
|
||||
map2.put("db_field_txt", "Title");//字段英文名
|
||||
list.add(map2);
|
||||
//文件名称
|
||||
map3.put("db_field_name", "file_name");//字段
|
||||
map3.put("db_field_txt", "file name");//字段中文名
|
||||
map3.put("db_field_txt", "File name");//字段中文名
|
||||
list.add(map3);
|
||||
//文件信息
|
||||
map4.put("db_field_name", "text_info");//字段
|
||||
map4.put("db_field_txt", "text info");//字段中文名
|
||||
map4.put("db_field_txt", "Text info");//字段中文名
|
||||
list.add(map4);
|
||||
}
|
||||
} else if ("condition".equals(flag)) {
|
||||
|
||||
+2
-1
@@ -66,7 +66,8 @@ public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecor
|
||||
ocrRecordEOPage.setStandNumber(ocrRecordEOPage.getStandNumber().replace("%","\\%"));
|
||||
}
|
||||
|
||||
queryWrapper.like(StringUtils.isNotEmpty(ocrRecordEOPage.getStandName()), OcrRecordEO::getStandName, ocrRecordEOPage.getStandName())
|
||||
queryWrapper.like(StringUtils.isNotEmpty(ocrRecordEOPage.getStandName()) && CutEnum.CN.getValue().equals(ocrRecordEOPage.getCut()), OcrRecordEO::getStandName, ocrRecordEOPage.getStandName())
|
||||
.like(StringUtils.isNotEmpty(ocrRecordEOPage.getStandName()) && CutEnum.EN.getValue().equals(ocrRecordEOPage.getCut()), OcrRecordEO::getStandNameEn, ocrRecordEOPage.getStandName())
|
||||
.like(StringUtils.isNotEmpty(ocrRecordEOPage.getStandNumber()), OcrRecordEO::getStandNumber, ocrRecordEOPage.getStandNumber())
|
||||
.eq(StringUtils.isNotEmpty(ocrRecordEOPage.getResultContent()), OcrRecordEO::getResultContent, ocrRecordEOPage.getResultContent())
|
||||
.orderBy(StringUtils.isNotBlank(ocrRecordEOPage.getOrderByField()), "1".equals(ocrRecordEOPage.getOrderBy())?true:false, OcrRecordEO::getUpdateTime)
|
||||
|
||||
@@ -65,6 +65,11 @@ public class OcrRecordEO implements Serializable {
|
||||
@ApiModelProperty(value = "标准名称")
|
||||
private String standName;
|
||||
|
||||
/**标准英文名称*/
|
||||
@Excel(name = "标准英文名称", width = 15)
|
||||
@ApiModelProperty(value = "标准英文名称")
|
||||
private String standNameEn;
|
||||
|
||||
/**标准编号*/
|
||||
@Excel(name = "标准编号", width = 15)
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
|
||||
+1
@@ -9,6 +9,7 @@
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="stand_name" property="standName" />
|
||||
<result column="stand_name_en" property="standNameEn" />
|
||||
<result column="stand_number" property="standNumber" />
|
||||
<result column="file_type" property="fileType" />
|
||||
<result column="file_name" property="fileName" />
|
||||
|
||||
+2
@@ -92,4 +92,6 @@ public interface IOcrRecordEOService extends IService<OcrRecordEO> {
|
||||
* @return
|
||||
*/
|
||||
void dataProcessing(String cut, List<OcrRecordEO> ocrRecordEOList);
|
||||
|
||||
boolean batchUpdateByDocumentSerialNumber(String serialNumber);
|
||||
}
|
||||
|
||||
+45
-3
@@ -1,6 +1,8 @@
|
||||
package com.jero.modules.ocr.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.ModuleEnum;
|
||||
@@ -143,6 +145,13 @@ public class OcrRecordEOServiceImpl extends ServiceImpl<OcrRecordEOMapper, OcrRe
|
||||
// }else{
|
||||
// map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName));//字段
|
||||
// }
|
||||
if(CutEnum.CN.getValue().equals(cut) && "stand_name_en".equals(onlCgformField.getDbFieldName())) {
|
||||
continue;
|
||||
}
|
||||
if(CutEnum.EN.getValue().equals(cut) && "stand_name".equals(onlCgformField.getDbFieldName())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName));//字段
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
|
||||
@@ -212,7 +221,20 @@ public class OcrRecordEOServiceImpl extends ServiceImpl<OcrRecordEOMapper, OcrRe
|
||||
List<OnlCgformField> documentLibraryFieldList = onlCgformFieldService.getFieldList(ModuleEnum.DOCUMENT_LIBRARY.getValue());
|
||||
documentLibraryFieldList = documentLibraryFieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
|
||||
List<String> fieldFileList = documentLibraryFieldList.stream().map(OnlCgformField::getDbFieldTxt).collect(Collectors.toList());
|
||||
List<Map<String, String>> fieldFileList = new ArrayList<>();
|
||||
for (OnlCgformField field : documentLibraryFieldList) {
|
||||
Map<String, String> map1 = new HashMap<>();
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
map1.put("label",field.getDbFieldTxt());
|
||||
map1.put("value",field.getId());
|
||||
|
||||
} else {
|
||||
map1.put("label",field.getDbFieldEnName());
|
||||
map1.put("value",field.getId());
|
||||
|
||||
}
|
||||
fieldFileList.add(map1);
|
||||
}
|
||||
map.put("value_list",fieldFileList);
|
||||
}
|
||||
list.add(map);
|
||||
@@ -243,12 +265,20 @@ public class OcrRecordEOServiceImpl extends ServiceImpl<OcrRecordEOMapper, OcrRe
|
||||
|
||||
// 处理数据中所有下拉字典值
|
||||
for (OcrRecordEO ocrRecordEO : ocrRecordEOList){
|
||||
String fileType = null;
|
||||
OnlCgformField fileTypeField = onlCgformFieldService.queryById(ocrRecordEO.getFileType());
|
||||
if (ObjectUtil.isNotEmpty(fileTypeField)) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
fileType = fileTypeField.getDbFieldTxt();
|
||||
} else {
|
||||
fileType = fileTypeField.getDbFieldEnName();
|
||||
}
|
||||
}
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
Map<String, String> cnMap = dictItemListAll.stream()
|
||||
.filter(e->e.getItemValue().equals(ocrRecordEO.getResultContent())
|
||||
|| e.getItemValue().equals(ocrRecordEO.getSyncState()))
|
||||
.collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getItemText)); // 优化
|
||||
// ocrRecordEO.setFileType(cnMap.get(ocrRecordEO.getFileType()));
|
||||
ocrRecordEO.setResultContent(cnMap.get(ocrRecordEO.getResultContent()));
|
||||
ocrRecordEO.setSyncState(cnMap.get(ocrRecordEO.getSyncState()));
|
||||
} else {
|
||||
@@ -256,10 +286,11 @@ public class OcrRecordEOServiceImpl extends ServiceImpl<OcrRecordEOMapper, OcrRe
|
||||
.filter(e->e.getItemValue().equals(ocrRecordEO.getResultContent())
|
||||
|| e.getItemValue().equals(ocrRecordEO.getSyncState()))
|
||||
.collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getEnName)); // 优化
|
||||
// ocrRecordEO.setFileType(enMap.get(ocrRecordEO.getFileType()));
|
||||
|
||||
ocrRecordEO.setResultContent(enMap.get(ocrRecordEO.getResultContent()));
|
||||
ocrRecordEO.setSyncState(enMap.get(ocrRecordEO.getSyncState()));
|
||||
}
|
||||
ocrRecordEO.setFileType(fileType);
|
||||
if(StringUtils.isNotEmpty(ocrRecordEO.getConnectId())) {
|
||||
ocrRecordEO.setFileSource(FileSourceEnum.IMPORT.getValue());
|
||||
}else{
|
||||
@@ -273,4 +304,15 @@ public class OcrRecordEOServiceImpl extends ServiceImpl<OcrRecordEOMapper, OcrRe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean batchUpdateByDocumentSerialNumber(String serialNumber) {
|
||||
LambdaQueryWrapper<OcrRecordEO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(OcrRecordEO::getStandNumber, serialNumber);
|
||||
List<OcrRecordEO> ocrRecordEOList = list(lambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(ocrRecordEOList)) {
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+38
-8
@@ -2,6 +2,7 @@ package com.jero.modules.ocr.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.modules.FeignClient.LocalToolFeignClient;
|
||||
import com.jero.modules.ocr.entity.OcrRecordEO;
|
||||
import com.jero.modules.ocr.entity.OcrResultEO;
|
||||
@@ -107,12 +108,20 @@ public class OcrRestfulServiceImpl implements IOcrRestfulService {
|
||||
String authCode = RsaUtil.publicEncrypt(OcrAuthCode);
|
||||
if(authCode == null){
|
||||
log.error("客户认证RSA加密失败");
|
||||
return Result.error("客户认证RSA加密失败");
|
||||
if (CutEnum.CN.getValue().equals(getOcrEO.getCut())) {
|
||||
return Result.error("客户认证RSA加密失败!");
|
||||
} else {
|
||||
return Result.error("Customer authentication RSA encryption failure!");
|
||||
}
|
||||
}
|
||||
String fileContent = Base64Util.PDFToBase64(file);
|
||||
if(fileContent == null){
|
||||
log.error("PDF转Base64失败");
|
||||
return Result.error("PDF转Base64失败");
|
||||
if (CutEnum.CN.getValue().equals(getOcrEO.getCut())) {
|
||||
return Result.error("PDF转Base64失败!");
|
||||
} else {
|
||||
return Result.error("Turn PDF base64 failure!");
|
||||
}
|
||||
}
|
||||
|
||||
MultiValueMap<String, Object> paramMap = new LinkedMultiValueMap<String, Object>();
|
||||
@@ -146,7 +155,11 @@ public class OcrRestfulServiceImpl implements IOcrRestfulService {
|
||||
HttpStatus statusCode = responseEntity.getStatusCode();
|
||||
if(statusCode != HttpStatus.OK){
|
||||
log.error("请求出现异常:"+statusCode.value());
|
||||
return Result.error("请求出现异常");
|
||||
if (CutEnum.CN.getValue().equals(getOcrEO.getCut())) {
|
||||
return Result.error("请求出现异常!");
|
||||
} else {
|
||||
return Result.error("Request an exception!");
|
||||
}
|
||||
}else{
|
||||
OcrResultEO ocrResultEO = JSONObject.parseObject(responseEntity.getBody(), OcrResultEO.class);
|
||||
if(ocrResultEO.getResultCode().equals("0")){
|
||||
@@ -158,14 +171,23 @@ public class OcrRestfulServiceImpl implements IOcrRestfulService {
|
||||
ocrRecordEO.setSyncState(FileSyncStateEnum.SYNC_NO.getValue());
|
||||
ocrRecordEO.setStandNumber(getOcrEO.getStandNumber());
|
||||
ocrRecordEO.setStandName(getOcrEO.getStandName());
|
||||
ocrRecordEO.setFileType(getOcrEO.getFileType());
|
||||
ocrRecordEO.setFileType(getOcrEO.getFileType()); // 存文档库文件类型标签的id
|
||||
ocrRecordEO.setConnectId(getOcrEO.getConnectId());
|
||||
ocrRecordEO.setAttId(getOcrEO.getAttId());
|
||||
if (StringUtils.isEmpty(getOcrEO.getStandName())) {
|
||||
ocrRecordEO.setStandNameEn(getOcrEO.getStandName());
|
||||
} else {
|
||||
ocrRecordEO.setStandNameEn(getOcrEO.getStandNameEn());
|
||||
}
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// ocrRecordEO.setCreateBy(sysUser.getId());
|
||||
// ocrRecordEO.setCreateTime(new Date());
|
||||
ocrRecordEOService.add(ocrRecordEO);
|
||||
return Result.OK("加入转换成功", taskId);
|
||||
if (CutEnum.CN.getValue().equals(getOcrEO.getCut())) {
|
||||
return Result.OK("加入转换成功!", taskId);
|
||||
} else {
|
||||
return Result.OK("Join the conversion succeeded!", taskId);
|
||||
}
|
||||
} else {
|
||||
OcrRecordEO ocrRecordEO = new OcrRecordEO();
|
||||
ocrRecordEO.setId(taskId);
|
||||
@@ -178,8 +200,12 @@ public class OcrRestfulServiceImpl implements IOcrRestfulService {
|
||||
ocrRecordEO.setCreateTime(new Date());
|
||||
ocrRecordEO.setConnectId(getOcrEO.getConnectId());
|
||||
ocrRecordEO.setAttId(getOcrEO.getAttId());
|
||||
ocrRecordEOService.editById(ocrRecordEO); //TODO ??
|
||||
return Result.OK( "加入转换成功", taskId);
|
||||
ocrRecordEOService.editById(ocrRecordEO);
|
||||
if (CutEnum.CN.getValue().equals(getOcrEO.getCut())) {
|
||||
return Result.OK("加入转换成功!", taskId);
|
||||
} else {
|
||||
return Result.OK("Join the conversion succeeded!", taskId);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return Result.error(ocrResultEO.getReturnMessage());
|
||||
@@ -187,7 +213,11 @@ public class OcrRestfulServiceImpl implements IOcrRestfulService {
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(),e);
|
||||
return Result.error("OCR接口请求出现异常,无法将文件传输到OCR引擎!");
|
||||
if (CutEnum.CN.getValue().equals(getOcrEO.getCut())) {
|
||||
return Result.error("OCR接口请求出现异常,无法将文件传输到OCR引擎!");
|
||||
} else {
|
||||
return Result.error("OCR Interface request an exception occurs, the files cannot be transferred to the OCR engine!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.lanswitch.service.ILanguageSwitchService;
|
||||
@@ -66,7 +67,8 @@ public class SarFileSplitInfoController extends JeroController<SarFileSplitInfoE
|
||||
sarFileSplitInfoEOPage.setTitle(sarFileSplitInfoEOPage.getTitle().replace("%","\\%"));
|
||||
}
|
||||
queryWrapper.like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getSerialNumber()), SarFileSplitInfoEO::getSerialNumber, sarFileSplitInfoEOPage.getSerialNumber())
|
||||
.like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getTitle()), SarFileSplitInfoEO::getTitle, sarFileSplitInfoEOPage.getTitle())
|
||||
.like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getTitle()) && CutEnum.CN.getValue().equals(sarFileSplitInfoEOPage.getCut()), SarFileSplitInfoEO::getTitle, sarFileSplitInfoEOPage.getTitle())
|
||||
.like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getTitle()) && CutEnum.EN.getValue().equals(sarFileSplitInfoEOPage.getCut()), SarFileSplitInfoEO::getTitleEn, sarFileSplitInfoEOPage.getTitle())
|
||||
.orderBy(StringUtils.isNotBlank(sarFileSplitInfoEOPage.getOrderByField()), "1".equals(sarFileSplitInfoEOPage.getOrderBy())?true:false, SarFileSplitInfoEO::getCreateTime)
|
||||
.orderBy(StringUtils.isBlank(sarFileSplitInfoEOPage.getOrderByField()), false, SarFileSplitInfoEO::getCreateTime);
|
||||
Page<SarFileSplitInfoEO> page = new Page<SarFileSplitInfoEO>(sarFileSplitInfoEOPage.getPageNo(), sarFileSplitInfoEOPage.getPageSize());
|
||||
|
||||
+5
@@ -69,6 +69,11 @@ public class SarFileSplitInfoEO implements Serializable {
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
/**英文标题*/
|
||||
@Excel(name = "英文标题", width = 15)
|
||||
@ApiModelProperty(value = "英文标题")
|
||||
private String titleEn;
|
||||
|
||||
/**文本状态*/
|
||||
@Excel(name = "文本状态", width = 15, dicCode = "file_type")
|
||||
// @Dict(dicCode = "file_type")
|
||||
|
||||
+1
@@ -10,6 +10,7 @@
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="serial_number" property="serialNumber" />
|
||||
<result column="title" property="title" />
|
||||
<result column="title_en" property="titleEn" />
|
||||
<result column="file_type" property="fileType" />
|
||||
<result column="file_name" property="fileName" />
|
||||
<result column="split_result" property="splitResult" />
|
||||
|
||||
+17
-2
@@ -248,19 +248,28 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
|
||||
|
||||
// 处理数据中所有下拉字典值
|
||||
for (SarFileSplitInfoEO splitInfoEO : sarFileSplitInfoEOList){
|
||||
String fileType = null;
|
||||
OnlCgformField fileTypeField = onlCgformFieldService.queryById(splitInfoEO.getFileType());
|
||||
if (ObjectUtil.isNotEmpty(fileTypeField)) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
fileType = fileTypeField.getDbFieldTxt();
|
||||
} else {
|
||||
fileType = fileTypeField.getDbFieldEnName();
|
||||
}
|
||||
}
|
||||
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
Map<String, String> cnMap = dictItemListAll.stream()
|
||||
.filter(e-> e.getItemValue().equals(splitInfoEO.getSplitResult()))
|
||||
.collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getItemText)); // 优化
|
||||
// splitInfoEO.setFileType(cnMap.get(splitInfoEO.getFileType()));
|
||||
splitInfoEO.setSplitResult(cnMap.get(splitInfoEO.getSplitResult()));
|
||||
} else {
|
||||
Map<String, String> enMap = dictItemListAll.stream()
|
||||
.filter(e-> e.getItemValue().equals(splitInfoEO.getSplitResult()))
|
||||
.collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getEnName)); // 优化
|
||||
// splitInfoEO.setFileType(enMap.get(splitInfoEO.getFileType()));
|
||||
splitInfoEO.setSplitResult(enMap.get(splitInfoEO.getSplitResult()));
|
||||
}
|
||||
splitInfoEO.setFileType(fileType);
|
||||
// 处理文档库id字段 根据编号和标题查询
|
||||
List<Map<String, Object>> bussDocumentLibraryEOList = bussDocumentLibraryEOService.getListBySerialNumber(splitInfoEO.getSerialNumber());
|
||||
if (CollectionUtil.isNotEmpty(bussDocumentLibraryEOList)) {
|
||||
@@ -306,6 +315,12 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
|
||||
map.put("sort", "true");//列表排序标识
|
||||
}
|
||||
|
||||
if(CutEnum.CN.getValue().equals(cut) && "title_en".equals(onlCgformField.getDbFieldName())) {
|
||||
continue;
|
||||
}
|
||||
if(CutEnum.EN.getValue().equals(cut) && "title".equals(onlCgformField.getDbFieldName())) {
|
||||
continue;
|
||||
}
|
||||
String dbFieldName = onlCgformField.getDbFieldName();
|
||||
map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user