feat: 新增按材料id排序趋势数据
This commit is contained in:
@@ -29,7 +29,7 @@ import java.util.List;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/price-publish")
|
@RequestMapping("/price-publish")
|
||||||
public class PricePublishController {
|
public class PricePublishController {
|
||||||
|
// todo-1 系统日志
|
||||||
@Resource
|
@Resource
|
||||||
PricePublishService pricePublishService;
|
PricePublishService pricePublishService;
|
||||||
|
|
||||||
@@ -47,6 +47,7 @@ public class PricePublishController {
|
|||||||
throw new NcHttpException(HttpErrorResponseEnum.PRICE_PUBLISH_YEAR_MONTH_NEEDED);
|
throw new NcHttpException(HttpErrorResponseEnum.PRICE_PUBLISH_YEAR_MONTH_NEEDED);
|
||||||
}
|
}
|
||||||
var query = pricePublishService.getQuery(year, month, materialId, name, spec, type);
|
var query = pricePublishService.getQuery(year, month, materialId, name, spec, type);
|
||||||
|
query.orderByAsc(PricePublish::getMaterialId);
|
||||||
var result = pricePublishService.list(query);
|
var result = pricePublishService.list(query);
|
||||||
|
|
||||||
return FuHttpResponse.Builder().dataResponse(result).build();
|
return FuHttpResponse.Builder().dataResponse(result).build();
|
||||||
|
@@ -45,6 +45,7 @@ public class PriceResultController {
|
|||||||
throw new NcHttpException(HttpErrorResponseEnum.PRICE_RESULT_YEAR_MONTH_NEEDED);
|
throw new NcHttpException(HttpErrorResponseEnum.PRICE_RESULT_YEAR_MONTH_NEEDED);
|
||||||
}
|
}
|
||||||
var query = priceResultService.getQuery(year, month, materialId, name);
|
var query = priceResultService.getQuery(year, month, materialId, name);
|
||||||
|
query.orderByAsc(PriceResult::getMaterialId);
|
||||||
var result = priceResultService.list(query);
|
var result = priceResultService.list(query);
|
||||||
|
|
||||||
return FuHttpResponse.Builder().dataResponse(result).build();
|
return FuHttpResponse.Builder().dataResponse(result).build();
|
||||||
|
@@ -14,7 +14,7 @@ import java.util.stream.Collectors;
|
|||||||
@Service
|
@Service
|
||||||
public class PricePublishService extends ServiceImpl<BaseMapper<PricePublish>, PricePublish> {
|
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>();
|
var query = new LambdaQueryWrapper<PricePublish>();
|
||||||
if (year != null) {
|
if (year != null) {
|
||||||
query = query.eq(PricePublish::getYear, year);
|
query = query.eq(PricePublish::getYear, year);
|
||||||
|
Reference in New Issue
Block a user