feat: 新增按材料id排序趋势数据

This commit is contained in:
han0
2024-07-11 11:32:57 +08:00
parent 227499d541
commit 89c9ffd213
3 changed files with 4 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ import java.util.List;
@RestController
@RequestMapping("/price-publish")
public class PricePublishController {
// todo-1 系统日志
@Resource
PricePublishService pricePublishService;
@@ -47,6 +47,7 @@ public class PricePublishController {
throw new NcHttpException(HttpErrorResponseEnum.PRICE_PUBLISH_YEAR_MONTH_NEEDED);
}
var query = pricePublishService.getQuery(year, month, materialId, name, spec, type);
query.orderByAsc(PricePublish::getMaterialId);
var result = pricePublishService.list(query);
return FuHttpResponse.Builder().dataResponse(result).build();

View File

@@ -45,6 +45,7 @@ public class PriceResultController {
throw new NcHttpException(HttpErrorResponseEnum.PRICE_RESULT_YEAR_MONTH_NEEDED);
}
var query = priceResultService.getQuery(year, month, materialId, name);
query.orderByAsc(PriceResult::getMaterialId);
var result = priceResultService.list(query);
return FuHttpResponse.Builder().dataResponse(result).build();

View File

@@ -14,7 +14,7 @@ import java.util.stream.Collectors;
@Service
public class PricePublishService extends ServiceImpl<BaseMapper<PricePublish>, PricePublish> {
public LambdaQueryWrapper getQuery(Integer year, Integer month, String materialId, String name, String spec, Integer type) {
public LambdaQueryWrapper<PricePublish> getQuery(Integer year, Integer month, String materialId, String name, String spec, Integer type) {
var query = new LambdaQueryWrapper<PricePublish>();
if (year != null) {
query = query.eq(PricePublish::getYear, year);