From 898e34981ca3b678f9dd2de1f24453c1f8876512 Mon Sep 17 00:00:00 2001 From: JiilingLee <462362@qq.com> Date: Wed, 18 Oct 2023 11:18:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E8=AE=A1=E5=87=AD=E8=AF=81=E6=9B=B4?= =?UTF-8?q?=E6=96=B0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/voucher/VoucherController.java | 2 +- .../accounting/service/voucher/VoucherService.java | 7 +++++++ .../service/voucher/VoucherServiceImpl.java | 12 ++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java index dc98c86c..2f74b637 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java @@ -88,7 +88,7 @@ public class VoucherController { @Operation(summary = "更新会计凭证") @PreAuthorize("@ss.hasPermission('accounting:voucher:update')") public CommonResult updateVoucher(@Valid @RequestBody VoucherUpdateReqVO updateReqVO) { - voucherService.updateVoucher(updateReqVO); + voucherService.updateVoucherPositon(updateReqVO); return success(true); } diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherService.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherService.java index 9c441896..a1c1894c 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherService.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherService.java @@ -28,6 +28,13 @@ public interface VoucherService { */ void updateVoucher(@Valid VoucherUpdateReqVO updateReqVO); + /** + * 更新会计凭证带位置 + * + * @param updateReqVO 更新信息 + */ + void updateVoucherPositon(@Valid VoucherUpdateReqVO updateReqVO); + /** * 删除会计凭证 * diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherServiceImpl.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherServiceImpl.java index 59114180..95f6e544 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherServiceImpl.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherServiceImpl.java @@ -51,7 +51,7 @@ public class VoucherServiceImpl implements VoucherService { DepotCabinetDO depotCabinetDO = depotCabinetMapper.selectById(cabinetId); String position=""; if (organizationDO != null){ - position=position+"/"+organizationDO.getOrganizationName(); + position=position+organizationDO.getOrganizationName(); if (depotDO != null){ position=position+"/"+depotDO.getName(); if (depotCabinetDO != null){ @@ -70,7 +70,7 @@ public class VoucherServiceImpl implements VoucherService { } @Override - public void updateVoucher(VoucherUpdateReqVO updateReqVO) { + public void updateVoucherPositon(VoucherUpdateReqVO updateReqVO) { // 校验存在 validateVoucherExists(updateReqVO.getId()); // 更新 @@ -98,6 +98,14 @@ public class VoucherServiceImpl implements VoucherService { updateObj.setPosition(position); voucherMapper.updateById(updateObj); } + @Override + public void updateVoucher(VoucherUpdateReqVO updateReqVO) { + // 校验存在 + validateVoucherExists(updateReqVO.getId()); + // 更新 + VoucherDO updateObj = VoucherConvert.INSTANCE.convert(updateReqVO); + voucherMapper.updateById(updateObj); + } @Override public void deleteVoucher(Long id) {