fix: 变更公众网站历史数据
This commit is contained in:
@@ -154,10 +154,13 @@ public class BudgetController {
|
||||
return FuHttpResponse.Builder().dataResponse(budgetItemList).build();
|
||||
}
|
||||
|
||||
// todo-1 公众网站历史数据
|
||||
// todo-1 地图里程数据
|
||||
// todo-2 价格权重调整
|
||||
// todo-2 外省数据上传
|
||||
// todo-2 外省数据价格对比
|
||||
// todo-2 趋势表加入调查表数据
|
||||
// todo-3 趋势表加入调查表数据
|
||||
|
||||
// * 大件运输部署测试
|
||||
// * 材料管理系统-里程计算
|
||||
// * 证据管理系统-部署
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jgy.xxs.core.http.resp.HttpResponse;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -30,6 +31,7 @@ import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.io.Serializable;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.MessageFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -101,15 +103,15 @@ public class PublicController {
|
||||
@Resource
|
||||
DevFileService devFileService;
|
||||
|
||||
@ApiOperation("历史文件列表")
|
||||
@GetMapping("/history")
|
||||
public HttpResponse listHistoryFile () throws Exception {
|
||||
var query = new LambdaQueryWrapper<DevFile>();
|
||||
query.like(DevFile::getExtJson, "is_history_file");
|
||||
query.orderByDesc(DevFile::getName);
|
||||
var result = devFileService.page(new Page<>(1, 10), query);
|
||||
return FuHttpResponse.Builder().dataResponse(result.getRecords()).build();
|
||||
}
|
||||
// @ApiOperation("历史文件列表")
|
||||
// @GetMapping("/history")
|
||||
// public HttpResponse listHistoryFile () throws Exception {
|
||||
// var query = new LambdaQueryWrapper<DevFile>();
|
||||
// query.like(DevFile::getExtJson, "is_history_file");
|
||||
// query.orderByDesc(DevFile::getName);
|
||||
// var result = devFileService.page(new Page<>(1, 10), query);
|
||||
// return FuHttpResponse.Builder().dataResponse(result.getRecords()).build();
|
||||
// }
|
||||
|
||||
@Data
|
||||
class HistoryFileParam {
|
||||
@@ -143,6 +145,28 @@ public class PublicController {
|
||||
EasyExcel.write(response.getOutputStream(), PricePublish.class).sheet("sheet1").doWrite(result);
|
||||
}
|
||||
|
||||
@ApiOperation("历史文件列表")
|
||||
@GetMapping("/history")
|
||||
public HttpResponse<PricePublish> getHistory (
|
||||
@ApiParam(value = "每页数量") @RequestParam(name = "size", required = false, defaultValue = "10") Integer size,
|
||||
@ApiParam(value = "页码") @RequestParam(name = "current", required = false, defaultValue = "1") Integer current
|
||||
) throws Exception {
|
||||
var query = new QueryWrapper<PricePublish>();
|
||||
query.select("distinct year , month");
|
||||
query.lambda().eq(PricePublish::getType, PricePublishType.CURRENT);
|
||||
query.lambda().eq(PricePublish::getStatus, PricePublishStatus.DONE);
|
||||
query.lambda().orderByDesc(PricePublish::getYear, PricePublish::getMonth);
|
||||
var result = pricePublishService.page(new Page<>(current, size), query);
|
||||
var records = result.getRecords().stream().map(i->{
|
||||
var name = MessageFormat.format("{0,number,0}-{1,number,00} 福建省交通(公路、水运)工程各市主要材料含税价格信息", i.getYear(), i.getMonth());
|
||||
i.setName(name);
|
||||
return i;
|
||||
}).collect(Collectors.toList());
|
||||
result.setRecords(records);
|
||||
|
||||
return FuHttpResponse.Builder().dataResponse(result).build();
|
||||
}
|
||||
|
||||
@Data
|
||||
static public class PublicUpdateInfo implements Serializable {
|
||||
@ApiModelProperty("日期")
|
||||
|
Reference in New Issue
Block a user