diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/BussDocumentLibraryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/BussDocumentLibraryEOController.java index b0e836ff3..c27c46e44 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/BussDocumentLibraryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/BussDocumentLibraryEOController.java @@ -288,6 +288,14 @@ public class BussDocumentLibraryEOController extends JeroController>> getMenuList(@RequestParam(name="id",required=true) String id, + @RequestParam(name="cut",required=true) String cut) { + List> list = bussDocumentLibraryEOService.getMenuList(id,cut); + return Result.OK(list); + } + /** * 新增数据 * @param map diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/IBussDocumentLibraryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/IBussDocumentLibraryEOService.java index 562e2337b..5a3989602 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/IBussDocumentLibraryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/IBussDocumentLibraryEOService.java @@ -98,6 +98,7 @@ public interface IBussDocumentLibraryEOService extends IService> getInfoById(String id, String cut); + List> getMenuList(String id, String cut); /** * 新增数据 * diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java index c12829455..03805e41e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java @@ -1030,6 +1030,53 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl> getMenuList(String id, String cut) { + //字段属性 + List fieldList = onlCgformFieldService.getFieldList(ModuleEnum.DOCUMENT_LIBRARY.getValue()); + //标准选择字段 + List standardOnlCgformFieldList = fieldList.stream() + .filter(e -> FieldTypeEnum.STANDARD.getValue().equals(e.getFieldShowType())).collect(Collectors.toList()); + List standFieldList = standardOnlCgformFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList()); + List> result = new ArrayList<>(); // 要返回的结果 + + //区域管理 + OnlCgformArea onlCgformArea = new OnlCgformArea(); + onlCgformArea.setIsModel(ModuleEnum.DOCUMENT_LIBRARY.getValue()); + List areaList = onlCgformAreaServiceImpl.queryList(onlCgformArea); + + for (OnlCgformArea onlCgformAreaTemp : areaList) { + String areaName = ""; + if (CutEnum.CN.getValue().equals(cut)) { + areaName = onlCgformAreaTemp.getShowArea(); + } else { + areaName = onlCgformAreaTemp.getEnName(); + } + Map menuMap = new HashMap<>(); + menuMap.put("name",areaName); + result.add(menuMap); + List fieldListTemp = fieldList.stream().filter(e -> onlCgformAreaTemp.getId().equals(e.getShowArea())).collect(Collectors.toList()); + for (OnlCgformField onlCgformField : fieldListTemp) { + //字段 + String dbFieldName = onlCgformField.getDbFieldName(); + //字段类型 + String fieldShowType = onlCgformField.getFieldShowType(); + + if (FieldTypeEnum.FILE.getValue().equals(fieldShowType)) { + Map menuMap1 = new HashMap<>(); + menuMap1.put("pname",areaName); + if (CutEnum.CN.getValue().equals(cut)) { + menuMap1.put("name",onlCgformField.getDbFieldTxt()); + } else { + menuMap1.put("name",onlCgformField.getDbFieldEnName()); + } + result.add(menuMap1); + } + } + } + return result; + } + /** * 详情数据查询 * @@ -1098,7 +1145,6 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl表单是否显示0否 1是) fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowForm()))).collect(Collectors.toList()); } - for (OnlCgformArea onlCgformAreaTemp : areaList) { String areaName = ""; if (CutEnum.CN.getValue().equals(cut)) { @@ -1161,61 +1207,31 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl mapNew = new HashMap<>(); + List> listVal = new ArrayList<>(); List fileInfos = iOSSFileService.getFileInfosByConnectId(value); //多文件处理 - if (fileInfos.size() > 1) { - if (fileInfos.size() != 0) { - int i = 0; - for (OSSFile fileInfo : fileInfos) { - if (i == 0) { - Map mapNew = new HashMap<>(); - mapNew.put("value", fileInfo); - mapPut(cut, mapNew, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName, null); - mapNew.put("count", fileInfos.size()); - // 添加标准分解单跳转 - List infoEOList = sarFileSplitInfoService.queryByFileId(fileInfo.getId()); - if (CollectionUtil.isNotEmpty(infoEOList)) { - mapNew.put("splitFlag", 1); - mapNew.put("splitInfoId", infoEOList.get(0).getId()); - } else{ - mapNew.put("splitFlag", 0); - } - - resultTemp.add(mapNew); - i++; - } else { - Map mapNew = new HashMap<>(); - mapNew.put("value", fileInfo); - mapPut(cut, mapNew, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName, null); - // 添加标准分解单跳转 - List infoEOList = sarFileSplitInfoService.queryByFileId(fileInfo.getId()); - if (CollectionUtil.isNotEmpty(infoEOList)) { - mapNew.put("splitFlag", 1); - mapNew.put("splitInfoId", infoEOList.get(0).getId()); - } else{ - mapNew.put("splitFlag", 0); - } - resultTemp.add(mapNew); - } - } - } - } else if (fileInfos.size() == 1) { - //单个文件处理 - Map mapNew = new HashMap<>(); - mapNew.put("count", fileInfos.size()); - mapNew.put("value", fileInfos.get(0)); + if(ObjectUtils.isNotEmpty(fileInfos)){ mapPut(cut, mapNew, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName, null); - // 添加标准分解单跳转 - List infoEOList = sarFileSplitInfoService.queryByFileId(fileInfos.get(0).getId()); - if (CollectionUtil.isNotEmpty(infoEOList)) { - mapNew.put("splitFlag", 1); - mapNew.put("splitInfoId", infoEOList.get(0).getId()); - } else{ - mapNew.put("splitFlag", 0); + for (OSSFile fileInfo : fileInfos) { + Map mapValue = new HashMap<>(); + mapValue.put("id",fileInfo.getId()); + mapValue.put("fileName",fileInfo.getFileName()); + List infoEOList = sarFileSplitInfoService.queryByFileId(fileInfo.getId()); + // 添加标准分解单跳转 + if (CollectionUtil.isNotEmpty(infoEOList)) { + mapValue.put("splitFlag", 1); + mapValue.put("splitInfoId", infoEOList.get(0).getId()); + } else{ + mapValue.put("splitFlag", 0); + } + listVal.add(mapValue); } - resultTemp.add(mapNew); } + mapNew.put("value", listVal); + resultTemp.add(mapNew); } else { Map mapNew = new HashMap<>(); mapNew.put("value", ""); @@ -1973,11 +1989,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl