Commit 4b2fe8c0 by 阳浪

导出可见范围

parent 65ae7aad
......@@ -2,16 +2,22 @@ package com.yizhi.application.rangeExport;
import com.yizhi.application.customProject.contoller.ExperiencePoolRangeExport;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.exam.application.feign.ExamAuthorizeClient;
import com.yizhi.research.application.feign.ResearchAuthorizeClient;
import com.yizhi.research.application.vo.VisibleRangeExport;
import com.yizhi.util.application.domain.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -47,6 +53,10 @@ public class RangeExportController {
@Autowired
private TrainingProjectVisibleRangeExport trainingProjectVisibleRangeExport;
@Autowired
private ResearchAuthorizeClient researchAuthorizeClient;
@Autowired
private ExamAuthorizeClient examAuthorizeClient;
// @Autowired
// private VoteVisibleRangeExport voteVisibleRangeExport;
......@@ -57,6 +67,9 @@ public class RangeExportController {
@Autowired
private CaseLibraryRangeExport caseLibraryRangeExport;
@Value("${pc.host.url}")
String pcHostUrl;
@ApiOperation(value="作业可见范围导出",notes="作业可见范围导出1")
@GetMapping("/assignment")
......@@ -81,7 +94,11 @@ public class RangeExportController {
map.put("examId", examId);
map.put("context", ContextHolder.get());
String result=(String)examVisibleRangeExport.execute(map, false);
return Response.ok(result);
com.yizhi.exam.application.vo.exam.VisibleRangeExport visibleRangeExport=examAuthorizeClient.exportVisibleRange(examId);
String fileNamePattern = visibleRangeExport.getBizName().replaceAll("/", ".") + "-可见范围导出";
fileNamePattern = fileNamePattern + DateFormatUtils.format(new Date(), "yyyyMMdd") + ".xls";
fileNamePattern = pcHostUrl+"/api/v1/buckets/upload/objects/download/?preview=true&prefix="+fileNamePattern;
return Response.ok(fileNamePattern);
}
......@@ -107,7 +124,11 @@ public class RangeExportController {
map.put("researchId", researchId);
map.put("context", ContextHolder.get());
String result=(String)researchVisibleRangeExport.execute(map, false);
return Response.ok(result);
VisibleRangeExport visibleRangeExport=researchAuthorizeClient.exportVisibleRange(researchId);
String fileNamePattern = visibleRangeExport.getBizName().replaceAll("/", ".") + "-可见范围导出";
fileNamePattern = fileNamePattern + DateFormatUtils.format(new Date(), "yyyyMMdd") + ".xls";
fileNamePattern = pcHostUrl+"/api/v1/buckets/upload/objects/download/?preview=true&prefix="+fileNamePattern;
return Response.ok(fileNamePattern);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment