|
@@ -24,7 +24,7 @@ import java.util.*;
|
|
public class AccuracyPassRateController {
|
|
public class AccuracyPassRateController {
|
|
private final AccuracyPassRateService accuracyPassRateService;
|
|
private final AccuracyPassRateService accuracyPassRateService;
|
|
|
|
|
|
- private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
+ private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
|
|
|
|
|
@GetMapping("/getByTimeBetweenAndForecastTypeAndDataSourcesAndForecastModelAndStationCode")
|
|
@GetMapping("/getByTimeBetweenAndForecastTypeAndDataSourcesAndForecastModelAndStationCode")
|
|
public R getByTimeBetweenAndForecastTypeAndDataSourcesAndForecastModelAndStationCode(Long startTime, Long endTime, ForecastTypeEnum forecastType, DataSourcesEnum dataSources, Integer ago, String forecastModel, String stationCode) {
|
|
public R getByTimeBetweenAndForecastTypeAndDataSourcesAndForecastModelAndStationCode(Long startTime, Long endTime, ForecastTypeEnum forecastType, DataSourcesEnum dataSources, Integer ago, String forecastModel, String stationCode) {
|
|
@@ -79,9 +79,14 @@ public class AccuracyPassRateController {
|
|
templateContent.append(header);
|
|
templateContent.append(header);
|
|
|
|
|
|
templateContent.append(content.toString());
|
|
templateContent.append(content.toString());
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
|
|
- String fileName = sdf.format(startTime) + "模型准确率" + ".csv";
|
|
|
|
|
|
+ String fileName = "";
|
|
|
|
+ if (sdf.format(startTime).equals(sdf.format(endTime))){
|
|
|
|
+ fileName = sdf.format(startTime) + "模型准确率" + ".csv";
|
|
|
|
+ }else {
|
|
|
|
+ fileName = sdf.format(startTime) +"至"+sdf.format(endTime)+ "模型准确率" + ".csv";
|
|
|
|
+ }
|
|
|
|
+
|
|
response.setContentType("application/x-msdownload;charset=UTF-8");
|
|
response.setContentType("application/x-msdownload;charset=UTF-8");
|
|
response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
|
response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
|
byte[] templateContentBytes = templateContent.toString().getBytes("UTF-8");
|
|
byte[] templateContentBytes = templateContent.toString().getBytes("UTF-8");
|