| | |
| | | package com.zt.life.modules.project.service; |
| | | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.core.context.User; |
| | | import com.zt.core.context.UserContext; |
| | | import com.zt.core.sys.dto.DictDto; |
| | | import com.zt.core.sys.dto.DictItemDto; |
| | | 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.contractReview.model.ContractReview; |
| | | 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; |
| | |
| | | if (data.getTestAgencyInfo() == null) |
| | | data.setTestAgencyInfo(testAgencyInfoService.get(10000L)); |
| | | if (environId != null) { |
| | | OssDto ossDto = sysOssConfigService.getOssByBusiType(environId, "test_environt_diagram"); |
| | | if (ossDto != null) { |
| | | data.setFiles(ossDto); |
| | | OssDto ossDto1 = sysOssConfigService.getOssByBusiType(environId, "test_environ_diagram"); |
| | | OssDto ossDto2 = sysOssConfigService.getOssByBusiType(environId, "test_environ"); |
| | | if (ossDto1 != null ) { |
| | | data.setFiles(ossDto1); |
| | | } |
| | | if (ossDto2 != null){ |
| | | data.setFiles2(ossDto2); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public List<Environ> page(QueryFilter queryFilter) { |
| | | return baseDao.getList(queryFilter.getQueryParams()); |
| | | User user = UserContext.getUser(); |
| | | Integer secretClass = user.getSecretClass(); |
| | | Long deptId = user.getDeptId(); |
| | | queryFilter.getQueryParams().put("secretClass",secretClass); |
| | | queryFilter.getQueryParams().put("deptId",deptId); |
| | | List<Environ> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | if (list.size() > 0) { |
| | | sysOssService.setListOsses(list, "test_environ"); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | |
| | | testAgencyInfoService.update(environDto.getTestAgencyInfo()); |
| | | } |
| | | sysOssConfigService.updateOss(environDto.getEnviron().getId(), environDto.getFiles());// 保存附件 |
| | | sysOssConfigService.updateOss(environDto.getEnviron().getId(), environDto.getFiles2());// 保存附件 |
| | | return true; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | |
| | | } |