虚拟中心添加调用文档库数据

This commit is contained in:
zhn
2022-05-19 16:15:45 +08:00
parent 9f3deff2b3
commit 054670814b
3 changed files with 73 additions and 0 deletions
@@ -460,6 +460,17 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
return Result.OK(pageList);
}
@ApiOperation(value="虚拟中心添加调用文档库数据--分页", notes="虚拟中心添加调用文档库数据--分页")
@PostMapping(value = "/queryPageDummy")
@ResponseBody
public JSONObject queryPageDummy(@RequestBody Map<String,Object> parameter) {
IPage infoPage = bussDocumentLibraryEOService.getPageDummy(parameter);
Result<IPage> ok = Result.OK(infoPage);
JSONObject jsonResult = JSONObject.fromObject(ok);
return jsonResult;
}
/**
* 查看已上传的文件
* @param id
@@ -207,4 +207,6 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
IPage<BussDocumentLibraryEO> queryPageInfoDummy(Page<BussDocumentLibraryEO> page, QueryWrapper<BussDocumentLibraryEO> queryWrapper,BussDocumentLibraryEO bussDocumentLibraryEO);
IPage getPageDummy(Map<String, Object> parameter);
}
@@ -4949,4 +4949,64 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
return pageList;
}
public IPage getPageDummy(Map<String, Object> parameter) {
String cut = (String) parameter.get("cut");//中英文切换标识
//文档库字段
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(ModuleEnum.DOCUMENT_LIBRARY.getValue());
//需要查询的字段
List<String> fieldListQuery = new ArrayList<>();
fieldListQuery.add("serial_number");
fieldListQuery.add("title");
fieldListQuery.add("title_en");
fieldListQuery.add("state");
fieldListQuery.add("technology_territory");
fieldListQuery.add("xin1_che1_xing2_shi2_shi1_ri4_qi1");
fieldListQuery.add("implement_time");
List<String> fieldListNew = new ArrayList<>();
fieldListNew.add("id");
//转时间格式
for (String field : fieldListQuery) {
String fieldTemp = null;
if ("xin1_che1_xing2_shi2_shi1_ri4_qi1".equals(field) || "implement_time".equals(field)) {
String fieldNew = "date_format(" + field + ", '%Y-%m-%d')";
fieldTemp = "case when " + fieldNew + " is null then \"\" else " + fieldNew + " end " + field;
fieldListNew.add(fieldTemp);
} else {
fieldTemp = "case when " + field + " is null then \"\" else " + field + " end " + field;
fieldListNew.add(fieldTemp);
}
}
//封装查询条件
String condition = getConditionStr(parameter);
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.getInfoPage(page, " " + StringUtils.join(fieldListNew, ","), condition);
//树形数据字典
List<SysCategory> categoryList = sysCategoryService.list();
//过滤出树形字段
List<OnlCgformField> treeFieldList = fieldList.stream()
.filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
.collect(Collectors.toList());
List<Map> records = infoPage.getRecords();
//数据字典
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
//下拉选处理数据字典
for (Map record : records) {
Map<String, Object> record1 = (Map) record;
for (Map.Entry<String, Object> entry : record1.entrySet()) {
//下拉选处理数据字典
dictItem(sysDictItems, entry, cut, fieldList,null);
treeDictItem(categoryList, entry, treeFieldList, cut,null);
}
}
return infoPage;
}
}