From de2226e307a7298b09adf8f483b13f22e0b7d426 Mon Sep 17 00:00:00 2001 From: xiong_cl <140612616@qq.com> Date: Fri, 12 Apr 2024 15:04:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E6=95=B0=E6=8D=AE=E7=AE=A1=E6=8E=A7?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=B8=AD=E7=9B=AE=E5=BD=95=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E9=A9=B3=E5=9B=9E=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MetadataCommonController.java | 5 +- .../controller/ReviewRecordController.java | 53 ++++++++++++++++++- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/shandan-system/src/main/java/com/keyware/shandan/bianmu/controller/MetadataCommonController.java b/shandan-system/src/main/java/com/keyware/shandan/bianmu/controller/MetadataCommonController.java index e62a345..6080cee 100644 --- a/shandan-system/src/main/java/com/keyware/shandan/bianmu/controller/MetadataCommonController.java +++ b/shandan-system/src/main/java/com/keyware/shandan/bianmu/controller/MetadataCommonController.java @@ -121,12 +121,11 @@ public class MetadataCommonController { */ @GetMapping("/list/directory") @Transactional(readOnly = true) - public Result> listByDirectory(Page page, String directoryId, String resourceName, boolean allChild) { + public Result> listByDirectory(Page page, String directoryId, String resourceName, boolean allChild,String reviewStatus) { if (StringUtils.isBlank(directoryId)) { return Result.of(null, false, "参数不能为空"); } - - Page result = treeService.resourcePage(page, directoryId, resourceName, allChild); + Page result = treeService.resourcePage(page, directoryId, resourceName, allChild,reviewStatus); StreamUtil.as(result.getRecords()).peek(item -> { if (StringUtils.hasText(item.getDirectoryPath())) { int i = item.getDirectoryPath().lastIndexOf("/"); diff --git a/shandan-system/src/main/java/com/keyware/shandan/bianmu/controller/ReviewRecordController.java b/shandan-system/src/main/java/com/keyware/shandan/bianmu/controller/ReviewRecordController.java index 27f91de..5f18de3 100644 --- a/shandan-system/src/main/java/com/keyware/shandan/bianmu/controller/ReviewRecordController.java +++ b/shandan-system/src/main/java/com/keyware/shandan/bianmu/controller/ReviewRecordController.java @@ -6,6 +6,7 @@ import com.keyware.shandan.bianmu.entity.DirectoryVo; import com.keyware.shandan.bianmu.entity.MetadataBasicVo; import com.keyware.shandan.bianmu.entity.ReviewRecordVo; import com.keyware.shandan.bianmu.enums.ReviewStatus; +import com.keyware.shandan.bianmu.service.DirPermissionService; import com.keyware.shandan.bianmu.service.DirectoryService; import com.keyware.shandan.bianmu.service.MetadataService; import com.keyware.shandan.bianmu.service.ReviewRecordService; @@ -13,10 +14,13 @@ import com.keyware.shandan.common.constants.DirConstant; import com.keyware.shandan.common.controller.BaseController; import com.keyware.shandan.common.entity.Result; import com.keyware.shandan.common.util.StringUtils; +import com.keyware.shandan.frame.config.security.SecurityUtil; +import com.keyware.shandan.system.entity.SysUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; +import java.util.Arrays; import java.util.List; /** @@ -40,14 +44,23 @@ public class ReviewRecordController extends BaseController directoryFileSubmit(String ids, String status, String opinion, boolean sendNotice) { + if (StringUtils.isBlankAny(ids, status)) { + return Result.of(null, false, "参数错误"); + } + try { + ReviewStatus reviewStatus = ReviewStatus.valueOf(status); + Arrays.stream(ids.split(",")).forEach(id -> { + try { + reviewRecordService.directoryFileReview(id, reviewStatus, opinion, sendNotice); + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + return Result.of(true, true); + } catch (RuntimeException e) { + e.printStackTrace(); + return Result.of(false, false, e.getMessage()); + }catch (Exception e) { + e.printStackTrace(); + return Result.of(false, false, e.getMessage()); + } + + } + /** * 根据数据实体ID获取最后一次审核记录 *