| | |
| | | import com.bstek.dorado.uploader.annotation.FileResolver; |
| | | import com.fzzy.igds.service.FileService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.config.FrameworkConfig; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * @Description Dorado7 附件上传公共管理层 |
| | |
| | | @FileResolver |
| | | public String imgFile(UploadFile file, Map<String, Object> parameter) { |
| | | |
| | | String fileId = null; |
| | | String filePath = null; |
| | | try { |
| | | |
| | | String basePath = fileService.getFileSavePath("DEPT"); |
| | | |
| | | fileId = "aerial-" + ContextUtil.subDeptId(null) |
| | | //新文件名 |
| | | String fileId = "aerial-" + ContextUtil.subDeptId(null) |
| | | + file.getFileName().substring( |
| | | file.getFileName().lastIndexOf(".")); |
| | | //文件全路径 |
| | | filePath = basePath + fileId; |
| | | //保存 |
| | | file.transferTo(new File(filePath)); |
| | | |
| | | file.transferTo(new File(basePath + fileId)); |
| | | //替换后文件全路径 |
| | | filePath = filePath.replace(FrameworkConfig.getProfile(), "/profile/"); |
| | | |
| | | } catch (IllegalStateException e) { |
| | | e.printStackTrace(); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return fileId; |
| | | return filePath; |
| | | } |
| | | |
| | | /** |