From ed8202891f39e1614cd4a71b399b875e610a0a92 Mon Sep 17 00:00:00 2001 From: gssong <1742057357@qq.com> Date: 星期四, 21 三月 2024 21:48:44 +0800 Subject: [PATCH] update 调整请假申请返回值,我的发起查询 --- ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/TestLeaveServiceImpl.java | 28 ++++++++++++---------------- 1 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/TestLeaveServiceImpl.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/TestLeaveServiceImpl.java index 276cafe..8d00869 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/TestLeaveServiceImpl.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/TestLeaveServiceImpl.java @@ -43,7 +43,7 @@ @Override public TestLeaveVo queryById(Long id) { TestLeaveVo testLeaveVo = baseMapper.selectVoById(id); - WorkflowUtils.setProcessInstanceVo(testLeaveVo,String.valueOf(id)); + WorkflowUtils.setProcessInstanceVo(testLeaveVo, String.valueOf(id)); return testLeaveVo; } @@ -75,8 +75,8 @@ private LambdaQueryWrapper<TestLeave> buildQueryWrapper(TestLeaveBo bo) { LambdaQueryWrapper<TestLeave> lqw = Wrappers.lambdaQuery(); lqw.eq(StringUtils.isNotBlank(bo.getLeaveType()), TestLeave::getLeaveType, bo.getLeaveType()); - lqw.ge(bo.getStartLeaveDays() != null,TestLeave::getLeaveDays, bo.getStartLeaveDays()); - lqw.le(bo.getEndLeaveDays() != null,TestLeave::getLeaveDays, bo.getEndLeaveDays()); + lqw.ge(bo.getStartLeaveDays() != null, TestLeave::getLeaveDays, bo.getStartLeaveDays()); + lqw.le(bo.getEndLeaveDays() != null, TestLeave::getLeaveDays, bo.getEndLeaveDays()); lqw.orderByDesc(BaseEntity::getCreateTime); return lqw; } @@ -85,31 +85,27 @@ * 鏂板璇峰亣 */ @Override - public TestLeave insertByBo(TestLeaveBo bo) { + public TestLeaveVo insertByBo(TestLeaveBo bo) { TestLeave add = MapstructUtils.convert(bo, TestLeave.class); - validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; if (flag) { bo.setId(add.getId()); } - return add; + TestLeaveVo testLeaveVo = MapstructUtils.convert(add, TestLeaveVo.class); + WorkflowUtils.setProcessInstanceVo(testLeaveVo, String.valueOf(add.getId())); + return testLeaveVo; } /** * 淇敼璇峰亣 */ @Override - public TestLeave updateByBo(TestLeaveBo bo) { + public TestLeaveVo updateByBo(TestLeaveBo bo) { TestLeave update = MapstructUtils.convert(bo, TestLeave.class); - validEntityBeforeSave(update); - return baseMapper.updateById(update) > 0 ? update : null; - } - - /** - * 淇濆瓨鍓嶇殑鏁版嵁鏍¢獙 - */ - private void validEntityBeforeSave(TestLeave entity) { - //TODO 鍋氫竴浜涙暟鎹牎楠�,濡傚敮涓�绾︽潫 + baseMapper.updateById(update); + TestLeaveVo testLeaveVo = MapstructUtils.convert(update, TestLeaveVo.class); + WorkflowUtils.setProcessInstanceVo(testLeaveVo, String.valueOf(update.getId())); + return testLeaveVo; } /** -- Gitblit v1.9.3