09-03-修复供应商入库修改
This commit is contained in:
@ -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.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;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
@ -122,11 +123,12 @@ public class TenderSupplierInputController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 修改供应商入库
|
* 修改供应商入库
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
@SaCheckPermission("supplierInput:supplierInput:edit")
|
@SaCheckPermission("supplierInput:supplierInput:edit")
|
||||||
@Log(title = "供应商入库", businessType = BusinessType.UPDATE)
|
@Log(title = "供应商入库", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@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));
|
return toAjax(tenderSupplierInputService.updateByBo(bo,file));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,11 +128,12 @@ public class TenderSupplierInputServiceImpl extends ServiceImpl<TenderSupplierIn
|
|||||||
public Boolean updateByBo(TenderSupplierInputBo bo,MultipartFile file) {
|
public Boolean updateByBo(TenderSupplierInputBo bo,MultipartFile file) {
|
||||||
TenderSupplierInput update = MapstructUtils.convert(bo, TenderSupplierInput.class);
|
TenderSupplierInput update = MapstructUtils.convert(bo, TenderSupplierInput.class);
|
||||||
TenderSupplierInput byId = getById(update.getId());
|
TenderSupplierInput byId = getById(update.getId());
|
||||||
ossService.deleteWithValidByIds(List.of(byId.getFileId()), false);
|
if (file != null) {
|
||||||
|
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(Long.valueOf(sysOssUploadVo.getOssId()));
|
update.setFileId(Long.valueOf(sysOssUploadVo.getOssId()));
|
||||||
|
}
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
return baseMapper.updateById(update) > 0;
|
return baseMapper.updateById(update) > 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user