From 502cf943030e75d8daa404a57229df26c8b6c1f7 Mon Sep 17 00:00:00 2001 From: ddmte32 Date: Wed, 3 Sep 2025 15:02:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E5=8A=9F=E8=83=BDbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ApprovalServiceImpl.java | 20 +++++++++---------- .../service/impl/NewDatasetServiceImpl.java | 10 ++++++++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ApprovalServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ApprovalServiceImpl.java index 545f4688..d3cc77ed 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ApprovalServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ApprovalServiceImpl.java @@ -55,18 +55,18 @@ public class ApprovalServiceImpl implements ApprovalService { //推送消息给申请人 NewSysNotificationParamsVo newSysNotificationParamsVo = new NewSysNotificationParamsVo(); - String applyContentTemplate="发布的{}\"{}\"{}审核已通过"; + String applyContentTemplate="您发布的{}\"{}\"审核已通过"; String appContentFormat = StrUtil.format(applyContentTemplate,ApprovalType.getDescription(info.getType()) ,getModelNameByType(info.getContent(),info.getType())); - String contentTemplate="{}发布的{}\"{}\"审核已通过"; + String contentTemplate="{}发布的{}\"{}\"审核已通过"; String contentFormat = StrUtil.format(contentTemplate,info.getApplicantName(),ApprovalType.getDescription(info.getType()) ,getModelNameByType(info.getContent(),info.getType())); newSysNotificationParamsVo.setType(2); - newSysNotificationParamsVo.setSender(info.getApplicantId()); + newSysNotificationParamsVo.setSender(info.getApproverId()); newSysNotificationParamsVo.setNotification_url(info.getUrl()); - newSysNotificationParamsVo.setReceivers(info.getApproverId().toString()); + newSysNotificationParamsVo.setReceivers(info.getApplicantId().toString()); newSysNotificationParamsVo.setContent(appContentFormat); infoPublishService.pushSysInfo(newSysNotificationParamsVo); @@ -77,7 +77,7 @@ public class ApprovalServiceImpl implements ApprovalService { approveParamsVo.setContent(contentFormat); approveParamsVo.setSender(info.getApproverId()); approveParamsVo.setNotification_url(info.getUrl()); - approveParamsVo.setReceivers(info.getApplicantId().toString()); + approveParamsVo.setReceivers(info.getApproverId().toString()); infoPublishService.pushSysInfo(newSysNotificationParamsVo); //审批通过,更改状态 @@ -94,18 +94,18 @@ public class ApprovalServiceImpl implements ApprovalService { //推送消息给申请人 NewSysNotificationParamsVo newSysNotificationParamsVo = new NewSysNotificationParamsVo(); - String applyContentTemplate="发布的{}\"{}\"{}审核未通过"; + String applyContentTemplate="您发布的{}\"{}\"{}审核未通过"; String appContentFormat = StrUtil.format(applyContentTemplate,ApprovalType.getDescription(info.getType()) ,getModelNameByType(info.getContent(),info.getType())); - String contentTemplate="{}发布的{}\"{}\"审核未通过"; + String contentTemplate="{}发布的{}\"{}\"审核未通过"; String contentFormat = StrUtil.format(contentTemplate,info.getApplicantName(),ApprovalType.getDescription(info.getType()) ,getModelNameByType(info.getContent(),info.getType())); newSysNotificationParamsVo.setType(2); - newSysNotificationParamsVo.setSender(info.getApplicantId()); + newSysNotificationParamsVo.setSender(info.getApproverId()); newSysNotificationParamsVo.setNotification_url(info.getUrl()); - newSysNotificationParamsVo.setReceivers(info.getApproverId().toString()); + newSysNotificationParamsVo.setReceivers(info.getApplicantId().toString()); newSysNotificationParamsVo.setContent(appContentFormat); infoPublishService.pushSysInfo(newSysNotificationParamsVo); @@ -116,7 +116,7 @@ public class ApprovalServiceImpl implements ApprovalService { approveParamsVo.setContent(contentFormat); approveParamsVo.setSender(info.getApproverId()); approveParamsVo.setNotification_url(info.getUrl()); - approveParamsVo.setReceivers(info.getApplicantId().toString()); + approveParamsVo.setReceivers(info.getApproverId().toString()); infoPublishService.pushSysInfo(newSysNotificationParamsVo); } diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java index fdf6a9d8..6b0d44c3 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java @@ -717,6 +717,12 @@ public class NewDatasetServiceImpl implements NewDatasetService { @Override public String publish(NewDatasetVo datasetVo, LoginUser loginUser) throws Exception { + Set roles = loginUser.getRoles(); + if (roles.contains("admin")) { + //无需审批,直接通过 + return "发布成功"; + } + NewDatasetVo newDatasetDesc = getNewDatasetDesc(datasetVo.getId(), datasetVo.getName(), datasetVo.getIdentifier(), datasetVo.getOwner(), null, false); String username = loginUser.getUsername(); Long userid = loginUser.getUserid(); @@ -727,7 +733,7 @@ public class NewDatasetServiceImpl implements NewDatasetService { approvalRequest.setApproverId(1L); approvalRequest.setStatus(ApprovalStatus.PENDING.getCode()); - String titleTemplate = "{}发布的数据集\"{}\"需要审核,请查看"; + String titleTemplate = "{}发布的数据集\"{}\"需要审核,请查看"; String urlTemplate = "/dataset/dataset/info/{}?name={}&owner={}&identifier={}&is_public={}"; String titleFormat = StrUtil.format(titleTemplate, username, newDatasetDesc.getName()); @@ -746,7 +752,7 @@ public class NewDatasetServiceImpl implements NewDatasetService { paramsVo.setNotification_url("/system/approval"); remoteInfoPublishService.pushSysInfo(paramsVo); - return "发布成功"; + return "发布成功,待管理员审核"; } /**