|
|
@ -6,6 +6,7 @@ import com.keyware.shandan.bianmu.entity.DirectoryVo; |
|
|
|
import com.keyware.shandan.bianmu.entity.MetadataBasicVo; |
|
|
|
import com.keyware.shandan.bianmu.entity.MetadataBasicVo; |
|
|
|
import com.keyware.shandan.bianmu.entity.ReviewRecordVo; |
|
|
|
import com.keyware.shandan.bianmu.entity.ReviewRecordVo; |
|
|
|
import com.keyware.shandan.bianmu.enums.ReviewStatus; |
|
|
|
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.DirectoryService; |
|
|
|
import com.keyware.shandan.bianmu.service.MetadataService; |
|
|
|
import com.keyware.shandan.bianmu.service.MetadataService; |
|
|
|
import com.keyware.shandan.bianmu.service.ReviewRecordService; |
|
|
|
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.controller.BaseController; |
|
|
|
import com.keyware.shandan.common.entity.Result; |
|
|
|
import com.keyware.shandan.common.entity.Result; |
|
|
|
import com.keyware.shandan.common.util.StringUtils; |
|
|
|
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.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -40,14 +44,23 @@ public class ReviewRecordController extends BaseController<ReviewRecordService, |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private DirectoryService directoryService; |
|
|
|
private DirectoryService directoryService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DirPermissionService dirPermissionService; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 目录审核页面 |
|
|
|
* 目录审核页面 |
|
|
|
* |
|
|
|
* |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/directory") |
|
|
|
@GetMapping("/directory") |
|
|
|
public ModelAndView directoryReview() { |
|
|
|
public ModelAndView directoryReview(ModelAndView modelAndView) { |
|
|
|
return new ModelAndView("review/directoryReview"); |
|
|
|
modelAndView.setViewName("review/directoryReview"); |
|
|
|
|
|
|
|
SysUser user = SecurityUtil.getLoginSysUser(); |
|
|
|
|
|
|
|
dirPermissionService.refreshCache(); |
|
|
|
|
|
|
|
modelAndView.addObject("readDirIds", dirPermissionService.getByReadPermis(user)); |
|
|
|
|
|
|
|
modelAndView.addObject("writeDirIds", dirPermissionService.getByWritePermis(user)); |
|
|
|
|
|
|
|
return modelAndView; |
|
|
|
|
|
|
|
//return new ModelAndView("review/directoryReview");
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -149,6 +162,42 @@ public class ReviewRecordController extends BaseController<ReviewRecordService, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 资源目录文件提交审核 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param ids 主键 |
|
|
|
|
|
|
|
* @param status 要变更的审核状态 |
|
|
|
|
|
|
|
* @param opinion 审核意见 |
|
|
|
|
|
|
|
* @param sendNotice 是否发送通知 |
|
|
|
|
|
|
|
* @return 请求结果 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* xiongcl 20240412 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@PostMapping("/directory/file/change") |
|
|
|
|
|
|
|
public Result<Object> 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获取最后一次审核记录 |
|
|
|
* 根据数据实体ID获取最后一次审核记录 |
|
|
|
* |
|
|
|
* |
|
|
|