| | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.config.RuoYiConfig; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.other.pojo.TempFile; |
| | | import com.ruoyi.production.dto.*; |
| | |
| | | |
| | | @Value("${file.upload-dir}") |
| | | private String uploadDir; |
| | | |
| | | @Autowired |
| | | private RuoYiConfig ruoYiConfig; |
| | | |
| | | @Autowired |
| | | private ProductionProductMainService productionProductMainService; |
| | |
| | | fileEntity.setProductionProductRouteItemId(productRouteItemEntity.getId()); |
| | | fileEntity.setFileName(originalFilename); |
| | | fileEntity.setFileUrl(formalFilePath.toString()); |
| | | Path basePath = Paths.get(RuoYiConfig.getProfile()); |
| | | String relativePath = basePath.relativize(formalFilePath).toString(); |
| | | relativePath = relativePath.replace("\\", "/"); |
| | | String url = "/profile/" + relativePath; |
| | | fileEntity.setUrl(url); |
| | | fileEntity.setFileSuffix(fileExtension); |
| | | fileEntity.setFileSize(Files.size(formalFilePath)); |
| | | fileEntity.setCreateTime(LocalDateTime.now()); |
| | |
| | | fileEntity.setProductionProductRouteItemId(routeItemId); |
| | | fileEntity.setFileName(originalFilename); |
| | | fileEntity.setFileUrl(formalFilePath.toString()); |
| | | Path basePath = Paths.get(RuoYiConfig.getProfile()); |
| | | String relativePath = basePath.relativize(formalFilePath).toString(); |
| | | relativePath = relativePath.replace("\\", "/"); |
| | | String url = "/profile/" + relativePath; |
| | | |
| | | fileEntity.setUrl(url); |
| | | fileEntity.setFileSuffix(fileExtension); |
| | | fileEntity.setFileSize(Files.size(formalFilePath)); |
| | | fileEntity.setCreateTime(LocalDateTime.now()); |