Commit b28766d9 by 阳浪

消息优化

parent 3dd0cc27
......@@ -24,6 +24,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
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;
......@@ -54,6 +55,9 @@ public class ExportResearch2 {
private ResearchReportClient researchReportClient;
@Value("${pc.host.url}")
String pcHostUrl;
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
@ApiOperation (value = "导出调研参与人员统计", notes = "导出调研参与人员统计")
......@@ -106,8 +110,9 @@ public class ExportResearch2 {
String serialNo = "USER-EXPORT-" + taskId.toString();
paramsVo.setSerialNo(serialNo);
String result = statisticsResearchClient.reportResearchAccounts(paramsVo);
return Response.ok("导出成功," + " " + "任务名称:" + taskName);
statisticsResearchClient.reportResearchAccounts(paramsVo);
String fileUril = pcHostUrl+"/api/v1/buckets/upload/objects/download/?preview=true&prefix="+taskName+".xlsx";
return Response.ok(fileUril);
} catch (Exception e) {
LOGGER.error("", e);
return Response.fail(ReturnCode.SERVICE_UNAVAILABLE.getCode(),ReturnCode.SERVICE_UNAVAILABLE.getMsg());
......@@ -179,8 +184,9 @@ public class ExportResearch2 {
}
paramsVo.setTrResearchQuestions(statisticsQuestionsList);
String result = statisticsResearchClient.reportResearchDetails(paramsVo);
return Response.ok("导出成功," + " " + "任务名称:" + taskName);
statisticsResearchClient.reportResearchDetails(paramsVo);
String fileUril = pcHostUrl+"/api/v1/buckets/upload/objects/download/?preview=true&prefix="+taskName+".xlsx";
return Response.ok(fileUril);
} catch (Exception e) {
LOGGER.error("", e);
return Response.fail(ReturnCode.SERVICE_UNAVAILABLE.getCode(),ReturnCode.SERVICE_UNAVAILABLE.getMsg());
......@@ -238,8 +244,9 @@ public class ExportResearch2 {
paramsVo.setTaskId(taskId);
paramsVo.setTaskName(taskName);
paramsVo.setSerialNo(serialNo);
String result = statisticsResearchClient.reportResearchanalyze(paramsVo);
return Response.ok("导出成功," + " " + "任务名称:" + taskName);
statisticsResearchClient.reportResearchanalyze(paramsVo);
String fileUril = pcHostUrl+"/api/v1/buckets/upload/objects/download/?preview=true&prefix="+taskName+".xlsx";
return Response.ok(fileUril);
} catch (Exception e) {
LOGGER.error("", e);
return Response.fail(ReturnCode.SERVICE_UNAVAILABLE.getCode(),ReturnCode.SERVICE_UNAVAILABLE.getMsg());
......@@ -269,8 +276,9 @@ public class ExportResearch2 {
paramsVo.setSerialNo(serialNo);
paramsVo.setContext(context);
String result = researchReportClient.reportResearchDetails(paramsVo);
return Response.ok("导出成功," + " " + "任务名称:" + taskName);
researchReportClient.reportResearchDetails(paramsVo);
String fileUril = pcHostUrl+"/api/v1/buckets/upload/objects/download/?preview=true&prefix="+taskName+".xlsx";
return Response.ok(fileUril);
} catch (Exception e) {
LOGGER.error("", e);
return Response.fail(ReturnCode.SERVICE_UNAVAILABLE.getCode(),ReturnCode.SERVICE_UNAVAILABLE.getMsg());
......@@ -301,8 +309,9 @@ public class ExportResearch2 {
paramsVo.setTaskName(taskName);
paramsVo.setSerialNo(serialNo);
paramsVo.setContext(context);
String result = researchReportClient.reportResearchanalyze(paramsVo);
return Response.ok("导出成功," + " " + "任务名称:" + taskName);
researchReportClient.reportResearchanalyze(paramsVo);
String fileUril = pcHostUrl+"/api/v1/buckets/upload/objects/download/?preview=true&prefix="+taskName+".xlsx";
return Response.ok(fileUril);
} catch (Exception e) {
LOGGER.error("", e);
return Response.fail(ReturnCode.SERVICE_UNAVAILABLE.getCode(),ReturnCode.SERVICE_UNAVAILABLE.getMsg());
......
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