fix(product): 修复产品模型文件迁移逻辑
- 调整了临时文件删除和正式文件迁移的执行顺序
- 确保只有在存在临时文件时才执行文件迁移操作
- 优化了文件服务调用的条件判断逻辑
| | |
| | | product.setProductName(productModelDto.getProductName()); |
| | | productMapper.updateById(product); |
| | | } |
| | | commonFileService.deleteByBusinessIds(Collections.singletonList(productModelDto.getId()), FileNameType.PRODUCT_MODEL.getValue()); |
| | | if(CollectionUtils.isNotEmpty(productModelDto.getTempFileIds())){ |
| | | commonFileService.deleteByBusinessIds(Collections.singletonList(productModelDto.getId()), FileNameType.PRODUCT_MODEL.getValue()); |
| | | commonFileService.migrateTempFilesToFormal(productModelDto.getId(), productModelDto.getTempFileIds()); |
| | | } |
| | | return productModelMapper.updateById(productModelDto); |