Browse Source

企业分页添加标签

master
DX 2 months ago
parent
commit
f318deea6d
  1. 2
      yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java
  2. 2
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java
  3. 2
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java
  4. 11
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java
  5. 8
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java
  6. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java
  7. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java
  8. 11
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java

2
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<String, String> createFile(String name, String path, byte[] content);
List<String> listFile(List<Long> ids);
List<Map<String, String>> listFile(List<Long> ids);
}

2
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<String> listFile(List<Long> ids) {
public List<Map<String, String>> listFile(List<Long> ids) {
return fileService.listFile(ids);
}

2
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<String> listFile(List<Long> ids);
List<Map<String,String>> listFile(List<Long> ids);
}

11
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<String> listFile(List<Long> ids) {
public List<Map<String, String>> listFile(List<Long> ids) {
LambdaQueryWrapper<FileDO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(FileDO::getId, ids);
return fileMapper.selectList(wrapper).stream().map(FileDO::getUrl).collect(Collectors.toList());
final List<FileDO> fileDOS = fileMapper.selectList(wrapper);
return fileDOS.stream().map(fileDO -> {
Map<String, String> map = new HashMap<>();
map.put("id", fileDO.getId().toString());
map.put("url", fileDO.getUrl());
return map;
}).collect(Collectors.toList());
}
}

8
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<Long> collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList());
if (!collect.isEmpty()) {
final List<String> list = fileApi.listFile(collect);
final List<Map<String,String>> list = fileApi.listFile(collect);
enterprise.setFiles(list);
}
@ -135,7 +135,6 @@ public class EnterpriseController {
if (enterpriseAuditLogDO != null) {
item.setAudit(enterpriseAuditLogDO.getAudit());
}
//企业图片
LambdaQueryWrapper<FileInfoDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FileInfoDO::getDictType, 644l);
@ -144,10 +143,9 @@ public class EnterpriseController {
final List<Long> collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList());
if (!collect.isEmpty()) {
final List<String> list = fileApi.listFile(collect);
final List<Map<String,String>> list = fileApi.listFile(collect);
item.setFiles(list);
}
// 企业标签
LambdaQueryWrapper<EnterpriseTagDO> tagDOLambdaQueryWrapper = new LambdaQueryWrapper<>();
tagDOLambdaQueryWrapper.eq(EnterpriseTagDO::getEnterpriseId, item.getId());
@ -188,7 +186,7 @@ public class EnterpriseController {
final List<Long> collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList());
if (!collect.isEmpty()) {
final List<String> list = fileApi.listFile(collect);
final List<Map<String,String>> list = fileApi.listFile(collect);
item.setFiles(list);
}

2
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<EnterpriseQualificationDO> qualificationList;
@Schema(description = "企业标签", example = "26433")
private List<String> tagList;
private List<Map<String, String>> tagList;
}

2
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<String> files;
private List<Map<String, String>> files;
@TableField(exist = false)
private List<EnterpriseQualificationDO> qualificationList;

11
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); //文件类型

Loading…
Cancel
Save