From ba5137899f8d07c7dd053464d8363970cb5d2bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Thu, 2 Apr 2026 14:22:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=98=AF=E5=90=A6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AD=97=E6=AE=B5;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExpenseAccountApplicationService.java | 62 ++++++++++++++++++- .../expenseAccount/ExpenseAccountApi.java | 24 ++++++- 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/expenseAccount/ExpenseAccountApplicationService.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/expenseAccount/ExpenseAccountApplicationService.java index 86c222c1f..6b9c350ac 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/expenseAccount/ExpenseAccountApplicationService.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/expenseAccount/ExpenseAccountApplicationService.java @@ -408,6 +408,66 @@ public class ExpenseAccountApplicationService { expenseAccountDO.setUpdateByName(loginUser.getUsername()); return expenseAccountDomainService.update(expenseAccountDO); } + + /** + * 修改创建订单是否固定显示 0-否 1-是 + * @param expenseAccountDTO + * @return + */ + public boolean changeInOrderDisplay(ExpenseAccountDTO expenseAccountDTO) { + //获取登录用户信息 + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //根据id修改启用状态停用状态 + if(expenseAccountDTO.getExpenseAccountId() == null){ + throw new ServiceException("费用科目id不能为空"); + } + if(expenseAccountDTO.getInOrderDisplay() == null){ + throw new ServiceException("状态不能为空"); + } + if(expenseAccountDTO.getInOrderDisplay() != 0 && expenseAccountDTO.getInOrderDisplay()!=1){ + throw new ServiceException("状态错误"); + } + ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO(); + expenseAccountDO.setExpenseAccountId(expenseAccountDTO.getExpenseAccountId()); + expenseAccountDO.setInOrderDisplay(expenseAccountDTO.getInOrderDisplay()); + expenseAccountDO.setUpdateBy(loginUser.getUserid()); + expenseAccountDO.setUpdateTime(new Date()); + expenseAccountDO.setUpdateByName(loginUser.getUsername()); + return expenseAccountDomainService.update(expenseAccountDO); + } + + /** + * 修改创建订单是否固定显示 0-否 1-是 + * @param expenseAccountDTO + * @return + */ + public boolean changeOutOrderDisplay(ExpenseAccountDTO expenseAccountDTO) { + //获取登录用户信息 + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //根据id修改启用状态停用状态 + if(expenseAccountDTO.getExpenseAccountId() == null){ + throw new ServiceException("费用科目id不能为空"); + } + if(expenseAccountDTO.getOutOrderDisplay() == null){ + throw new ServiceException("状态不能为空"); + } + if(expenseAccountDTO.getOutOrderDisplay() != 0 && expenseAccountDTO.getOutOrderDisplay()!=1){ + throw new ServiceException("状态错误"); + } + ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO(); + expenseAccountDO.setExpenseAccountId(expenseAccountDTO.getExpenseAccountId()); + expenseAccountDO.setOutOrderDisplay(expenseAccountDTO.getOutOrderDisplay()); + expenseAccountDO.setUpdateBy(loginUser.getUserid()); + expenseAccountDO.setUpdateTime(new Date()); + expenseAccountDO.setUpdateByName(loginUser.getUsername()); + return expenseAccountDomainService.update(expenseAccountDO); + } /** * 根据编码查询费用科目信息 */ @@ -470,4 +530,4 @@ public class ExpenseAccountApplicationService { public List selectSocialVehicleExpenseAccount(){ return expenseAccountDomainService.selectSocialVehicleExpenseAccount(); } -} +} \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/expenseAccount/ExpenseAccountApi.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/expenseAccount/ExpenseAccountApi.java index 3679d7509..5c39ccc49 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/expenseAccount/ExpenseAccountApi.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/expenseAccount/ExpenseAccountApi.java @@ -271,6 +271,28 @@ public class ExpenseAccountApi extends BaseController{ } } + @ApiOperation("修改创建订单默认显示设置") + @PostMapping("/changeInOrderDisplay") + public AjaxResult changeInOrderDisplay(@RequestBody ExpenseAccountDTO expenseAccountDTO) + { + try { + return toAjax(expenseAccountApplicationService.changeInOrderDisplay(expenseAccountDTO)); + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } + } + + @ApiOperation("修改创建订单默认显示设置") + @PostMapping("/changeOutOrderDisplay") + public AjaxResult changeOutOrderDisplay(@RequestBody ExpenseAccountDTO expenseAccountDTO) + { + try { + return toAjax(expenseAccountApplicationService.changeOutOrderDisplay(expenseAccountDTO)); + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } + } + @ApiOperation("根据code获取费用科目") @GetMapping(value = "/getInfoByCode") public AjaxResult getInfoByCode(@RequestParam("subjectCode") String subjectCode) @@ -288,4 +310,4 @@ public class ExpenseAccountApi extends BaseController{ } -} +} \ No newline at end of file