09-03-修复供应商入库修改

This commit is contained in:
2025-09-03 15:11:01 +08:00
parent 3b6b1d53a9
commit a929225ed5
2 changed files with 9 additions and 6 deletions

View File

@ -17,6 +17,7 @@ import org.dromara.system.service.ISysOssService;
import org.dromara.tender.domain.TenderSupplierInput;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
@ -122,11 +123,12 @@ public class TenderSupplierInputController extends BaseController {
/**
* 修改供应商入库
*/
@Transactional
@SaCheckPermission("supplierInput:supplierInput:edit")
@Log(title = "供应商入库", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(TenderSupplierInputBo bo,@RequestPart("file") MultipartFile file) {
public R<Void> edit(@RequestBody TenderSupplierInputBo bo,@RequestPart(value = "file",required = false) MultipartFile file) {
return toAjax(tenderSupplierInputService.updateByBo(bo,file));
}

View File

@ -128,11 +128,12 @@ public class TenderSupplierInputServiceImpl extends ServiceImpl<TenderSupplierIn
public Boolean updateByBo(TenderSupplierInputBo bo,MultipartFile file) {
TenderSupplierInput update = MapstructUtils.convert(bo, TenderSupplierInput.class);
TenderSupplierInput byId = getById(update.getId());
ossService.deleteWithValidByIds(List.of(byId.getFileId()), false);
SysOssVo sysOssUploadVo = ossService.upload(file, ossService.minioFileName(SupplierInput, file));
update.setInputFile(sysOssUploadVo.getUrl());
update.setFileId(Long.valueOf(sysOssUploadVo.getOssId()));
if (file != null) {
ossService.deleteWithValidByIds(List.of(byId.getFileId()), false);
SysOssVo sysOssUploadVo = ossService.upload(file, ossService.minioFileName(SupplierInput, file));
update.setInputFile(sysOssUploadVo.getUrl());
update.setFileId(Long.valueOf(sysOssUploadVo.getOssId()));
}
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}