09-25-供应商入库更新修复

This commit is contained in:
2025-09-25 11:26:33 +08:00
parent 1bb59cc2f1
commit af83c40d98
3 changed files with 13 additions and 12 deletions

View File

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

View File

@ -60,7 +60,7 @@ ITenderSupplierInputService extends IService<TenderSupplierInput>{
* @param bo 供应商入库 * @param bo 供应商入库
* @return 是否修改成功 * @return 是否修改成功
*/ */
Boolean updateByBo(TenderSupplierInputBo bo,MultipartFile file); Boolean updateByBo(TenderSupplierInputBo bo);
/** /**
* 校验并批量删除供应商入库信息 * 校验并批量删除供应商入库信息

View File

@ -125,7 +125,7 @@ public class TenderSupplierInputServiceImpl extends ServiceImpl<TenderSupplierIn
* @return 是否修改成功 * @return 是否修改成功
*/ */
@Override @Override
public Boolean updateByBo(TenderSupplierInputBo bo,MultipartFile file) { public Boolean updateByBo(TenderSupplierInputBo bo) {
if (bo.getId() == null) { if (bo.getId() == null) {
throw new ServiceException("id不能为空"); throw new ServiceException("id不能为空");
} }
@ -136,14 +136,14 @@ public class TenderSupplierInputServiceImpl extends ServiceImpl<TenderSupplierIn
} }
validEntityBeforeSave(update); validEntityBeforeSave(update);
if (file != null) { // if (file != null) {
if (byId.getFileId() != null) { // if (byId.getFileId() != null) {
ossService.deleteWithValidByIds(List.of(byId.getFileId()), false); // ossService.deleteWithValidByIds(List.of(byId.getFileId()), false);
} // }
SysOssVo sysOssUploadVo = ossService.upload(file, ossService.minioFileName(SupplierInput, file)); // SysOssVo sysOssUploadVo = ossService.upload(file, ossService.minioFileName(SupplierInput, file));
update.setInputFile(sysOssUploadVo.getUrl()); // update.setInputFile(sysOssUploadVo.getUrl());
update.setFileId(sysOssUploadVo.getOssId()); // update.setFileId(sysOssUploadVo.getOssId());
} // }
return baseMapper.updateById(update) > 0; return baseMapper.updateById(update) > 0;
} }