| | |
| | | import com.zt.core.sys.dto.DictLeafDto; |
| | | import com.zt.life.export.dto.WordFile; |
| | | import com.zt.life.export.service.WordFileService; |
| | | import com.zt.life.modules.mainPart.utils.GetFilesPath; |
| | | import com.zt.life.modules.mainPart.utils.GetShowDictList; |
| | | import com.zt.life.modules.project.dao.EnvironDao; |
| | | import com.zt.life.modules.project.dto.EnvironDto; |
| | |
| | | private SysOssService sysOssService; |
| | | |
| | | @Autowired |
| | | private LocalStorageService localStorageService; |
| | | private GetFilesPath getFilesPath; |
| | | |
| | | @Value("${zt.oss.local-path}") |
| | | private String localPath; |
| | |
| | | public void exportEnviron(Long id, HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | EnvironDto dataObj = this.getDto(id, null); |
| | | String imagePath = "文件图片:"+getFirstImagePath(dataObj.getFiles()); |
| | | String imagePath = "文件图片:"+getFilesPath.getFirstImagePath(dataObj.getFiles()); |
| | | dataObj.getEnviron().setTestEnvirontDiagram(imagePath); |
| | | //通用字典列表字符串生成 |
| | | String isVirusScanStr = getShowDictList.getShowDictList(dataObj.getEnviron().getIsVirusScan(), "is_or_not", false); |
| | |
| | | } |
| | | } |
| | | |
| | | public String getFirstImagePath(OssDto oss) { |
| | | String filePath = ""; |
| | | if (oss != null) { |
| | | if (oss.getGroups().size() > 0) { |
| | | OssDto.OssFieldGroupDto group = oss.getGroups().get(0); |
| | | if (group.getFields().size() > 0) { |
| | | OssDto.OssFieldDto field = group.getFields().get(0); |
| | | if (field.getFiles().size() > 0) { |
| | | com.zt.core.oss.dto.OssDto file = field.getFiles().get(0); |
| | | SysOss sysOss = sysOssService.get(file.getId()); |
| | | filePath = localPath+sysOss.getPath(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return filePath; |
| | | } |
| | | |
| | | } |