Commit 229a2ca0 by 阳浪

活动导出

parent abe80017
...@@ -32,6 +32,7 @@ import io.swagger.annotations.ApiParam; ...@@ -32,6 +32,7 @@ import io.swagger.annotations.ApiParam;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -66,6 +67,9 @@ public class TpPlanActivityController { ...@@ -66,6 +67,9 @@ public class TpPlanActivityController {
private CertificateClient certificateClient; private CertificateClient certificateClient;
@Autowired @Autowired
private TpPlanClient tpPlanClient; private TpPlanClient tpPlanClient;
@Value("${pc.host.url}")
String pcHostUrl;
@GetMapping("/all/list") @GetMapping("/all/list")
@ApiOperation(value = "查询培训活动列表", response = TpPlanActivityVo.class) @ApiOperation(value = "查询培训活动列表", response = TpPlanActivityVo.class)
...@@ -283,7 +287,8 @@ public class TpPlanActivityController { ...@@ -283,7 +287,8 @@ public class TpPlanActivityController {
map.put("trainingProject", one); map.put("trainingProject", one);
tpPlanActivityClient.activitiesExport(map); tpPlanActivityClient.activitiesExport(map);
return Response.ok("任务名称:" + taskName + ",任务序号:" + serialNo); String fileUril = pcHostUrl+"/api/v1/buckets/upload/objects/download/?preview=true&prefix="+taskName+".xlsx";
return Response.ok(fileUril);
} }
} }
......
...@@ -33,6 +33,7 @@ import io.swagger.annotations.ApiParam; ...@@ -33,6 +33,7 @@ import io.swagger.annotations.ApiParam;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -83,6 +84,9 @@ public class TrainingProjectController { ...@@ -83,6 +84,9 @@ public class TrainingProjectController {
@Autowired @Autowired
private PortalManagePCFeignClients portalManagePCFeignClient; private PortalManagePCFeignClients portalManagePCFeignClient;
@Value("${pc.host.url}")
String pcHostUrl;
@GetMapping(value = "/list") @GetMapping(value = "/list")
@ApiOperation(value = "培训项目分页列表", notes = "返回带分页的项目列表", response = TrainingProjectVo.class) @ApiOperation(value = "培训项目分页列表", notes = "返回带分页的项目列表", response = TrainingProjectVo.class)
...@@ -544,6 +548,12 @@ public class TrainingProjectController { ...@@ -544,6 +548,12 @@ public class TrainingProjectController {
@GetMapping("/exportSignRecord") @GetMapping("/exportSignRecord")
public Response<String> exportSignRecord(@ApiParam(name = "trainingProjectId", required = true) @RequestParam(name = "trainingProjectId") Long trainingProjectId) { public Response<String> exportSignRecord(@ApiParam(name = "trainingProjectId", required = true) @RequestParam(name = "trainingProjectId") Long trainingProjectId) {
String serialNo = signRecordApiClient.exportSignRecord(trainingProjectId); String serialNo = signRecordApiClient.exportSignRecord(trainingProjectId);
return Response.ok("导出成功," + " " + "编号:" + serialNo);
TrainingProjectVo vo = trainingProjectClient.getOne(trainingProjectId);
String fileName = vo.getName() + "签到记录明细表" + serialNo + ".xlsx";
String fileUril = pcHostUrl+"/api/v1/buckets/upload/objects/download/?preview=true&prefix="+fileName;
return Response.ok(fileUril);
} }
} }
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