diff --git a/hyp-admin/src/main/java/com/hyp/web/controller/manager/FileRelationManager.java b/hyp-admin/src/main/java/com/hyp/web/controller/manager/FileRelationManager.java index 7107cce..7820aa0 100644 --- a/hyp-admin/src/main/java/com/hyp/web/controller/manager/FileRelationManager.java +++ b/hyp-admin/src/main/java/com/hyp/web/controller/manager/FileRelationManager.java @@ -1,11 +1,14 @@ package com.hyp.web.controller.manager; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.io.FileUtil; +import com.hyp.common.core.domain.AjaxResult; import com.hyp.common.exception.ServiceException; import com.hyp.system.domain.RewFileRelation; import com.hyp.system.service.RewFileRelationService; import org.springframework.stereotype.Component; import javax.annotation.Resource; +import java.util.List; import java.util.Objects; /** @@ -55,6 +58,27 @@ public class FileRelationManager { } + /** + * + * 验证文件是否审查 + * @param applyId + * @return com.hyp.common.core.domain.AjaxResult + */ + + public AjaxResult checkFile(String applyId){ + List list = fileRelationService.lambdaQuery() + .eq(RewFileRelation::getApplyId, applyId) + .list(); + if(CollUtil.isNotEmpty(list)){ + for(RewFileRelation rewFileRelation : list){ + if(Objects.equals(rewFileRelation.getFileState(),2)){ + return AjaxResult.error("材料存在未通过情况,请检查"); + } + } + } + return AjaxResult.success(); + } + diff --git a/hyp-admin/src/main/java/com/hyp/web/controller/reward/FileRelationController.java b/hyp-admin/src/main/java/com/hyp/web/controller/reward/FileRelationController.java index edd453c..4acde06 100644 --- a/hyp-admin/src/main/java/com/hyp/web/controller/reward/FileRelationController.java +++ b/hyp-admin/src/main/java/com/hyp/web/controller/reward/FileRelationController.java @@ -44,6 +44,13 @@ public class FileRelationController extends BaseController { } + @ApiOperation("材料校验") + @GetMapping("/checkFile/{applyId}") + public AjaxResult checkFile(@PathVariable String applyId){ + return fileRelationManager.checkFile(applyId); + } + +