文档库--ocr识别调取已入库文件分页
This commit is contained in:
+14
@@ -117,6 +117,20 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
|||||||
return Result.OK(infoPage);
|
return Result.OK(infoPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ocr识别调取已入库文件
|
||||||
|
* @param parameter
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "ocr识别调取已入库文件分页")
|
||||||
|
@ApiOperation(value="ocr识别调取已入库文件", notes="ocr识别调取已入库文件")
|
||||||
|
@PostMapping(value = "/ocrPageInfo")
|
||||||
|
@ResponseBody
|
||||||
|
public Result<?> ocrPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||||
|
IPage infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
|
||||||
|
return Result.OK(infoPage);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
|
|||||||
+12
@@ -55,5 +55,17 @@ public interface BussDocumentLibraryEOMapper extends BaseMapper<BussDocumentLibr
|
|||||||
@Param("field") String field,
|
@Param("field") String field,
|
||||||
@Param("condition") String condition);
|
@Param("condition") String condition);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ocr识别调取已入库文件分页
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param field
|
||||||
|
* @param condition
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage ocrPageInfo(@Param("page") IPage page,
|
||||||
|
@Param("field") String field,
|
||||||
|
@Param("condition") String condition);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+5
@@ -54,5 +54,10 @@
|
|||||||
select ${field} from buss_document_library
|
select ${field} from buss_document_library
|
||||||
${condition}
|
${condition}
|
||||||
</select>
|
</select>
|
||||||
|
<!--ocr识别调取已入库文件分页-->
|
||||||
|
<select id="ocrPageInfo" resultType="java.util.LinkedHashMap">
|
||||||
|
select ${field}
|
||||||
|
${condition}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+7
@@ -110,6 +110,13 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
|
|||||||
*/
|
*/
|
||||||
IPage replacePageInfo(Map<String,Object> parameter);
|
IPage replacePageInfo(Map<String,Object> parameter);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ocr识别调取已入库文件分页
|
||||||
|
* @param parameter
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage ocrPageInfo(Map<String,Object> parameter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加收藏
|
* 添加收藏
|
||||||
* @param id
|
* @param id
|
||||||
|
|||||||
+91
@@ -801,6 +801,93 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
return infoPage;
|
return infoPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ocr识别调取已入库文件分页
|
||||||
|
*
|
||||||
|
* @param parameter
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
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());
|
||||||
|
|
||||||
|
//查询字段
|
||||||
|
StringBuilder fieldSb = new StringBuilder();
|
||||||
|
StringBuilder join = new StringBuilder();
|
||||||
|
int i = 1;
|
||||||
|
if (ObjectUtils.isNotEmpty(fileFieldList)) {
|
||||||
|
for (String fileField : fileFieldList) {
|
||||||
|
fieldSb.append("bdl." + fileField + ",");
|
||||||
|
if (i == 1) {
|
||||||
|
join.append(" on of.connect_id = bdl." + fileField);
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
join.append(" or of.connect_id = bdl." + fileField);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String fieldStr = fieldSb.substring(0, fieldSb.length() - 1);
|
||||||
|
|
||||||
|
String field = " bdl.id,bdl.serial_number,bdl.title,bdl.state,of.file_name,of.connect_id," + fieldStr
|
||||||
|
+ " from oss_file of join buss_document_library bdl" + join.toString();
|
||||||
|
|
||||||
|
//查询条件
|
||||||
|
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
|
||||||
|
|
||||||
|
//编码
|
||||||
|
String serialNumber = (String) parameter.get("serialNumber");
|
||||||
|
|
||||||
|
//标题
|
||||||
|
String title = (String) parameter.get("title");
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(serialNumber)) {
|
||||||
|
conditionSb.append(" and " + "serial_number" + " like concat(concat('%','" + serialNumber + "'),'%')");
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(title)) {
|
||||||
|
conditionSb.append(" and " + "title" + " like concat(concat('%','" + title + "'),'%')");
|
||||||
|
}
|
||||||
|
|
||||||
|
conditionSb.append(" order by bdl.create_time desc");
|
||||||
|
int pageNo = Integer.parseInt(parameter.get("pageNo").toString());
|
||||||
|
int pageSize = Integer.parseInt(parameter.get("pageSize").toString());
|
||||||
|
IPage page = new Page(pageNo, pageSize);
|
||||||
|
|
||||||
|
IPage infoPage = bussDocumentLibraryEOMapper.ocrPageInfo(page, field, conditionSb.toString());
|
||||||
|
List records = infoPage.getRecords();
|
||||||
|
|
||||||
|
//数据字典
|
||||||
|
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
||||||
|
//下拉选处理数据字典
|
||||||
|
|
||||||
|
for (Object record : records) {
|
||||||
|
Map<String, Object> record1 = (Map) record;
|
||||||
|
String key = "";
|
||||||
|
for (Map.Entry<String, Object> entry : record1.entrySet()) {
|
||||||
|
//状态数据字典
|
||||||
|
if ("state".equals(entry.getKey())) {
|
||||||
|
List<SysDictItem> stateList = sysDictItems.stream()
|
||||||
|
.filter(e -> StringUtils.isNotBlank(e.getDictCode()) && e.getDictCode().equals("state"))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
List<SysDictItem> state = stateList.stream().filter(e -> e.getItemValue().equals(entry.getValue())).collect(Collectors.toList());
|
||||||
|
if (state.size() != 0) {
|
||||||
|
entry.setValue(state.get(0).getItemText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//添加文本信息
|
||||||
|
String connectId = (String) record1.get("connect_id");
|
||||||
|
if (connectId.equals(entry.getValue())) {
|
||||||
|
key = entry.getKey();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
return infoPage;
|
||||||
|
}
|
||||||
|
|
||||||
public IPage getInfoPage(Map<String, Object> parameter) {
|
public IPage getInfoPage(Map<String, Object> parameter) {
|
||||||
//需要查询的字段
|
//需要查询的字段
|
||||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
|
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
|
||||||
@@ -921,6 +1008,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
*/
|
*/
|
||||||
private void collectAndSubscribe(List<Map> records, List<String> idList) {
|
private void collectAndSubscribe(List<Map> records, List<String> idList) {
|
||||||
//收藏
|
//收藏
|
||||||
|
if (idList.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
LambdaQueryWrapper<OnlCgformCollection> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<OnlCgformCollection> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.in(OnlCgformCollection::getDocumentId, idList);
|
wrapper.in(OnlCgformCollection::getDocumentId, idList);
|
||||||
List<OnlCgformCollection> collectList = iOnlCgformCollectionService.list(wrapper);
|
List<OnlCgformCollection> collectList = iOnlCgformCollectionService.list(wrapper);
|
||||||
@@ -1300,6 +1390,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 带文件导出
|
* 带文件导出
|
||||||
|
*
|
||||||
* @param map
|
* @param map
|
||||||
* @param response
|
* @param response
|
||||||
* @param request
|
* @param request
|
||||||
|
|||||||
Reference in New Issue
Block a user