|
|
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.enterprise;
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; |
|
|
|
|
import cn.iocoder.yudao.module.infra.api.file.FileApi; |
|
|
|
|
import cn.iocoder.yudao.module.infra.api.file.dto.InfraFileInfoDTO; |
|
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.taglibrary.vo.TagLibraryPageReqVO; |
|
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.taglibrary.vo.TagLibraryRespVO; |
|
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; |
|
|
|
@ -16,6 +17,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.enterprisetag.EnterpriseTagMappe
|
|
|
|
|
import cn.iocoder.yudao.module.system.dal.mysql.fileInfo.FileInfoMapper; |
|
|
|
|
import cn.iocoder.yudao.module.system.dal.mysql.qualification.EnterpriseQualificationMapper; |
|
|
|
|
import cn.iocoder.yudao.module.system.dal.mysql.taglibrary.TagLibraryMapper; |
|
|
|
|
import cn.iocoder.yudao.module.system.service.enterprise.EnterpriseServiceImpl; |
|
|
|
|
import cn.iocoder.yudao.module.system.service.enterprisetag.EnterpriseTagService; |
|
|
|
|
import cn.iocoder.yudao.module.system.service.fileInfo.FileInfoService; |
|
|
|
|
import cn.iocoder.yudao.module.system.service.qualification.EnterpriseQualificationService; |
|
|
|
@ -124,16 +126,17 @@ public class EnterpriseController {
|
|
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|
|
|
|
// @PreAuthorize("@ss.hasPermission('system:enterprise:query')")
|
|
|
|
|
public CommonResult<EnterpriseRespVO> getEnterprise(@RequestParam("id") Long id) { |
|
|
|
|
EnterpriseDO enterprise = enterpriseService.getEnterprise(id); |
|
|
|
|
EnterpriseDO bean = enterpriseService.getEnterprise(id); |
|
|
|
|
EnterpriseRespVO enterprise= BeanUtils.toBean(bean, EnterpriseRespVO.class); |
|
|
|
|
if (enterprise != null) { |
|
|
|
|
LambdaQueryWrapper<FileInfoDO> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.eq(FileInfoDO::getDictType, 644l); |
|
|
|
|
wrapper.eq(FileInfoDO::getDictData, 1l); |
|
|
|
|
wrapper.eq(FileInfoDO::getDictType, EnterpriseServiceImpl.DEFAULT_DICT_TYPE); |
|
|
|
|
wrapper.eq(FileInfoDO::getDictData, EnterpriseServiceImpl.DEFAULT_DICT_DATA_QY); |
|
|
|
|
wrapper.eq(FileInfoDO::getUnitId, enterprise.getId()); |
|
|
|
|
final List<Long> collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
if (!collect.isEmpty()) { |
|
|
|
|
final List<Map<String,String>> list = fileApi.listFile(collect); |
|
|
|
|
final List<InfraFileInfoDTO> list = fileApi.listFile(collect); |
|
|
|
|
enterprise.setFiles(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -153,7 +156,6 @@ public class EnterpriseController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//通过userID获取专管人
|
|
|
|
|
if (enterprise.getUserId() != null) { |
|
|
|
|
final AdminUserDO user = adminUserService.getUser(Long.valueOf(enterprise.getUserId())); |
|
|
|
@ -186,7 +188,7 @@ public class EnterpriseController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return success(BeanUtils.toBean(enterprise, EnterpriseRespVO.class)); |
|
|
|
|
return success(enterprise); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/pcpage") |
|
|
|
@ -208,7 +210,7 @@ public class EnterpriseController {
|
|
|
|
|
PageResult<EnterpriseDO> pageResult = enterpriseService.getEnterprisePage(pageReqVO); |
|
|
|
|
pageResult.getList().forEach(item->{ |
|
|
|
|
//企业图片
|
|
|
|
|
final List<Map<String, String>> fileList = fileInfoService.getFileList("664", "1", item.getId().toString()); |
|
|
|
|
final List<InfraFileInfoDTO> fileList = fileInfoService.getFileList(EnterpriseServiceImpl.DEFAULT_DICT_TYPE, EnterpriseServiceImpl.DEFAULT_DICT_DATA_QY, item.getId().toString()); |
|
|
|
|
item.setFiles(fileList); |
|
|
|
|
|
|
|
|
|
// 企业标签
|
|
|
|
@ -228,7 +230,7 @@ public class EnterpriseController {
|
|
|
|
|
final PageResult<EnterpriseDO> pageResult = enterpriseService.getEnterpriseByUserId(pageReqVO); |
|
|
|
|
pageResult.getList().forEach(item->{ |
|
|
|
|
//企业图片
|
|
|
|
|
final List<Map<String, String>> fileList = fileInfoService.getFileList("664", "1", item.getId().toString()); |
|
|
|
|
final List<InfraFileInfoDTO> fileList = fileInfoService.getFileList(EnterpriseServiceImpl.DEFAULT_DICT_TYPE, EnterpriseServiceImpl.DEFAULT_DICT_DATA_QY, item.getId().toString()); |
|
|
|
|
item.setFiles(fileList); |
|
|
|
|
|
|
|
|
|
// 企业标签
|
|
|
|
|