09-25-供应商入库更新修复
This commit is contained in:
@ -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.http.MediaType;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -122,8 +123,8 @@ public class TenderSupplierInputController extends BaseController {
|
||||
@Log(title = "供应商入库", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(TenderSupplierInputBo bo,@RequestParam("file") MultipartFile file) {
|
||||
return toAjax(tenderSupplierInputService.updateByBo(bo,file));
|
||||
public R<Void> edit(@RequestBody TenderSupplierInputBo bo) {
|
||||
return toAjax(tenderSupplierInputService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -60,7 +60,7 @@ ITenderSupplierInputService extends IService<TenderSupplierInput>{
|
||||
* @param bo 供应商入库
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(TenderSupplierInputBo bo,MultipartFile file);
|
||||
Boolean updateByBo(TenderSupplierInputBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除供应商入库信息
|
||||
|
||||
@ -125,7 +125,7 @@ public class TenderSupplierInputServiceImpl extends ServiceImpl<TenderSupplierIn
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(TenderSupplierInputBo bo,MultipartFile file) {
|
||||
public Boolean updateByBo(TenderSupplierInputBo bo) {
|
||||
if (bo.getId() == null) {
|
||||
throw new ServiceException("id不能为空");
|
||||
}
|
||||
@ -136,14 +136,14 @@ public class TenderSupplierInputServiceImpl extends ServiceImpl<TenderSupplierIn
|
||||
}
|
||||
validEntityBeforeSave(update);
|
||||
|
||||
if (file != null) {
|
||||
if (byId.getFileId() != null) {
|
||||
ossService.deleteWithValidByIds(List.of(byId.getFileId()), false);
|
||||
}
|
||||
SysOssVo sysOssUploadVo = ossService.upload(file, ossService.minioFileName(SupplierInput, file));
|
||||
update.setInputFile(sysOssUploadVo.getUrl());
|
||||
update.setFileId(sysOssUploadVo.getOssId());
|
||||
}
|
||||
// if (file != null) {
|
||||
// if (byId.getFileId() != null) {
|
||||
// ossService.deleteWithValidByIds(List.of(byId.getFileId()), false);
|
||||
// }
|
||||
// SysOssVo sysOssUploadVo = ossService.upload(file, ossService.minioFileName(SupplierInput, file));
|
||||
// update.setInputFile(sysOssUploadVo.getUrl());
|
||||
// update.setFileId(sysOssUploadVo.getOssId());
|
||||
// }
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user