Commit b28766d9 by 阳浪

消息优化

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