diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java index 46db718..d322a86 100644 --- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java +++ b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java @@ -41,6 +41,6 @@ public interface FileApi { */ Map createFile(String name, String path, byte[] content); - List listFile(List ids); + List> listFile(List ids); } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java index 8dcdaf5..467574a 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java @@ -26,7 +26,7 @@ public class FileApiImpl implements FileApi { } @Override - public List listFile(List ids) { + public List> listFile(List ids) { return fileService.listFile(ids); } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java index d626575..e9078f3 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java @@ -66,5 +66,5 @@ public interface FileService { */ FilePresignedUrlRespVO getFilePresignedUrl(String path) throws Exception; - List listFile(List ids); + List> listFile(List ids); } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java index d51a61d..67a56eb 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java @@ -126,10 +126,17 @@ public class FileServiceImpl implements FileService { } @Override - public List listFile(List ids) { + public List> listFile(List ids) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.in(FileDO::getId, ids); - return fileMapper.selectList(wrapper).stream().map(FileDO::getUrl).collect(Collectors.toList()); + + final List fileDOS = fileMapper.selectList(wrapper); + return fileDOS.stream().map(fileDO -> { + Map map = new HashMap<>(); + map.put("id", fileDO.getId().toString()); + map.put("url", fileDO.getUrl()); + return map; + }).collect(Collectors.toList()); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java index 443603c..4895cc6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java @@ -107,7 +107,7 @@ public class EnterpriseController { final List collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList()); if (!collect.isEmpty()) { - final List list = fileApi.listFile(collect); + final List> list = fileApi.listFile(collect); enterprise.setFiles(list); } @@ -135,7 +135,6 @@ public class EnterpriseController { if (enterpriseAuditLogDO != null) { item.setAudit(enterpriseAuditLogDO.getAudit()); } - //企业图片 LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(FileInfoDO::getDictType, 644l); @@ -144,10 +143,9 @@ public class EnterpriseController { final List collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList()); if (!collect.isEmpty()) { - final List list = fileApi.listFile(collect); + final List> list = fileApi.listFile(collect); item.setFiles(list); } - // 企业标签 LambdaQueryWrapper tagDOLambdaQueryWrapper = new LambdaQueryWrapper<>(); tagDOLambdaQueryWrapper.eq(EnterpriseTagDO::getEnterpriseId, item.getId()); @@ -188,7 +186,7 @@ public class EnterpriseController { final List collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList()); if (!collect.isEmpty()) { - final List list = fileApi.listFile(collect); + final List> list = fileApi.listFile(collect); item.setFiles(list); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java index e4436f4..5703a42 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java @@ -95,7 +95,7 @@ public class EnterpriseRespVO { private List qualificationList; @Schema(description = "企业标签", example = "26433") - private List tagList; + private List> tagList; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java index 1a8d92f..2ca89dd 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java @@ -89,7 +89,7 @@ public class EnterpriseDO extends BaseDO { private Integer audit; @TableField(exist = false) - private List files; + private List> files; @TableField(exist = false) private List qualificationList; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java index 54945e7..b446dea 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.enterprise; import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseauditlog.EnterpriseAuditLogDO; import cn.iocoder.yudao.module.system.dal.dataobject.fileInfo.FileInfoDO; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.mysql.enterpriseauditlog.EnterpriseAuditLogMapper; import cn.iocoder.yudao.module.system.dal.mysql.fileInfo.FileInfoMapper; import cn.iocoder.yudao.module.system.service.fileInfo.FileInfoService; @@ -57,7 +58,12 @@ public class EnterpriseServiceImpl implements EnterpriseService { if (enterpriseDO != null) { throw exception(ENTERPRISE_EXISTS); } - + //专管员所属部门 +// final AdminUserDO user = adminUserService.getUser(createReqVO.getUserId()); +// if (user == null) { +// throw exception(USER_NOT_EXISTS); +// } +// createReqVO.setDeptId(user.getDeptId()); // 插入 EnterpriseDO enterprise = BeanUtils.toBean(createReqVO, EnterpriseDO.class); enterpriseMapper.insert(enterprise); @@ -68,7 +74,7 @@ public class EnterpriseServiceImpl implements EnterpriseService { enterpriseAuditLogDO.setAudit(1); enterpriseAuditLogMapper.insert(enterpriseAuditLogDO); - if (createReqVO.getFileIds().length > 0) { + if (createReqVO.getFileIds() != null && createReqVO.getFileIds().length > 0) { for (Long fileId : createReqVO.getFileIds()) { FileInfoDO fileInfoDO = new FileInfoDO(); fileInfoDO.setDictData(1l); //文件类型 @@ -95,7 +101,6 @@ public class EnterpriseServiceImpl implements EnterpriseService { fileInfoMapper.delete(wrapper); } - for (Long fileId : updateReqVO.getFileIds()) { FileInfoDO fileInfoDO = new FileInfoDO(); fileInfoDO.setDictData(1l); //文件类型