文档拆分-bug59381: 解决加载过长问题
This commit is contained in:
+4
-1
@@ -63,7 +63,10 @@ public interface BussDocumentLibraryEOMapper extends BaseMapper<BussDocumentLibr
|
|||||||
* @param condition
|
* @param condition
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IPage ocrPageInfo(@Param("page") IPage page,
|
// IPage ocrPageInfo(@Param("page") IPage page,
|
||||||
|
// @Param("field") String field,
|
||||||
|
// @Param("condition") String condition);
|
||||||
|
List<Map<String, Object>> ocrPageInfo(
|
||||||
@Param("field") String field,
|
@Param("field") String field,
|
||||||
@Param("condition") String condition);
|
@Param("condition") String condition);
|
||||||
|
|
||||||
|
|||||||
+21
-7
@@ -3473,6 +3473,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
|
|
||||||
//查询字段
|
//查询字段
|
||||||
StringBuilder fieldSb = new StringBuilder();
|
StringBuilder fieldSb = new StringBuilder();
|
||||||
|
StringBuilder osfSql = new StringBuilder();
|
||||||
StringBuilder join = new StringBuilder();
|
StringBuilder join = new StringBuilder();
|
||||||
int i = 1;
|
int i = 1;
|
||||||
if (ObjectUtils.isNotEmpty(fileFieldList)) {
|
if (ObjectUtils.isNotEmpty(fileFieldList)) {
|
||||||
@@ -3480,16 +3481,26 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
fieldSb.append("bdl." + fileField + ",");
|
fieldSb.append("bdl." + fileField + ",");
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
join.append(" on osf.connect_id = bdl." + fileField);
|
join.append(" on osf.connect_id = bdl." + fileField);
|
||||||
|
osfSql.append("(select id, file_name, connect_id from oss_file where connect_id in (select ").append(fileField).append(" from buss_document_library where ").append(fileField).append(" is not null)");
|
||||||
i++;
|
i++;
|
||||||
|
continue;
|
||||||
|
} else if (i == fileFieldList.size()) {
|
||||||
|
join.append(" or osf.connect_id = bdl." + fileField);
|
||||||
|
osfSql.append(" UNION select id, file_name, connect_id from oss_file where connect_id in (select ").append(fileField).append(" from buss_document_library where ").append(fileField).append(" is not null))");
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
join.append(" or osf.connect_id = bdl." + fileField);
|
join.append(" or osf.connect_id = bdl." + fileField);
|
||||||
|
osfSql.append(" UNION select id, file_name, connect_id from oss_file where connect_id in (select ").append(fileField).append(" from buss_document_library where ").append(fileField).append(" is not null)");
|
||||||
|
i++;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String fieldStr = fieldSb.substring(0, fieldSb.length() - 1);
|
String fieldStr = fieldSb.substring(0, fieldSb.length() - 1);
|
||||||
|
|
||||||
String field = " osf.id,bdl.id as \"buss_document_library_id\",bdl.serial_number,bdl.title,bdl.title_en,bdl.state,osf.file_name,osf.connect_id," + fieldStr
|
String field = " osf.id,bdl.id as \"buss_document_library_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();
|
+ " from " + osfSql.toString() + " osf join buss_document_library bdl" + join.toString();
|
||||||
|
|
||||||
//查询条件
|
//查询条件
|
||||||
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
|
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
|
||||||
@@ -3535,14 +3546,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
int pageNo = Integer.parseInt(parameter.get("pageNo").toString());
|
int pageNo = Integer.parseInt(parameter.get("pageNo").toString());
|
||||||
int pageSize = Integer.parseInt(parameter.get("pageSize").toString());
|
int pageSize = Integer.parseInt(parameter.get("pageSize").toString());
|
||||||
IPage page = new Page(pageNo, pageSize);
|
IPage page = new Page(pageNo, pageSize);
|
||||||
|
// IPage infoPage = bussDocumentLibraryEOMapper.ocrPageInfo(page, field, conditionSb.toString());
|
||||||
IPage infoPage = bussDocumentLibraryEOMapper.ocrPageInfo(page, field, conditionSb.toString());
|
// List records = infoPage.getRecords();
|
||||||
List records = infoPage.getRecords();
|
List records = bussDocumentLibraryEOMapper.ocrPageInfo(field, conditionSb.toString());
|
||||||
|
page.setTotal(records.size());
|
||||||
|
records = records.subList(pageNo * pageSize - pageSize, pageNo * pageSize);
|
||||||
|
|
||||||
//数据字典
|
//数据字典
|
||||||
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
||||||
//下拉选处理数据字典
|
//下拉选处理数据字典
|
||||||
|
|
||||||
for (Object record : records) {
|
for (Object record : records) {
|
||||||
Map<String, Object> record1 = (Map) record;
|
Map<String, Object> record1 = (Map) record;
|
||||||
String key = "";
|
String key = "";
|
||||||
@@ -3580,7 +3592,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
record1.put("text_info", onlCgformFieldList.get(0).getDbFieldEnName());
|
record1.put("text_info", onlCgformFieldList.get(0).getDbFieldEnName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return infoPage;
|
|
||||||
|
page.setRecords(records);
|
||||||
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPage getInfoPage(Map<String, Object> parameter) {
|
public IPage getInfoPage(Map<String, Object> parameter) {
|
||||||
@@ -3683,7 +3697,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
String cut = (String) parameter.get("cut");
|
String cut = (String) parameter.get("cut");
|
||||||
String flag = String.valueOf(parameter.get("flag"));
|
String flag = String.valueOf(parameter.get("flag"));
|
||||||
//查询条件
|
//查询条件
|
||||||
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
|
StringBuilder conditionSb = new StringBuilder("where 1 = 1 and osf.connect_id is not null");
|
||||||
|
|
||||||
//过滤查询条件字段类型使用
|
//过滤查询条件字段类型使用
|
||||||
List<Map<String, Object>> mapList = queryCondition("1", cut, null);
|
List<Map<String, Object>> mapList = queryCondition("1", cut, null);
|
||||||
|
|||||||
Reference in New Issue
Block a user