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获取最后一次审核记录 *