fix(public): 新增 parent_id 参数

This commit is contained in:
han0
2023-12-26 11:19:13 +08:00
parent d2d1780caf
commit 7d2bb62e4b

View File

@@ -43,7 +43,8 @@ public class PublicController {
@ApiParam(value = "月份") @RequestParam(value="month") Integer month, @ApiParam(value = "月份") @RequestParam(value="month") Integer month,
@ApiParam(value = "关键字") @RequestParam(value="keyword", required = false) String keyword, @ApiParam(value = "关键字") @RequestParam(value="keyword", required = false) String keyword,
@ApiParam(value = "名称") @RequestParam(value="name", required = false) String name, @ApiParam(value = "名称") @RequestParam(value="name", required = false) String name,
@ApiParam(value = "规格") @RequestParam(value="spec", required = false) String spec @ApiParam(value = "规格") @RequestParam(value="spec", required = false) String spec,
@ApiParam(value = "父id") @RequestParam(value="parent_id", required = false) String parentId
) throws Exception { ) throws Exception {
LambdaQueryWrapper<PricePublish> query = pricePublishService.getQuery(year, month, null, name, spec, PricePublishType.CURRENT); LambdaQueryWrapper<PricePublish> query = pricePublishService.getQuery(year, month, null, name, spec, PricePublishType.CURRENT);
if (keyword != null && ObjectUtil.isNotEmpty(keyword)) { if (keyword != null && ObjectUtil.isNotEmpty(keyword)) {
@@ -52,6 +53,11 @@ public class PublicController {
.like(PricePublish::getSpec, keyword) .like(PricePublish::getSpec, keyword)
); );
} }
if (ObjectUtil.isNotEmpty(parentId)) {
var materialParentId = parentId.replace(".00", "");
query.likeRight(PricePublish::getMaterialId, materialParentId);
}
var currentData = pricePublishService.list(query); var currentData = pricePublishService.list(query);
LambdaQueryWrapper<PricePublish> queryPrevious = pricePublishService.getQuery(year - 1, month, null, name, spec, PricePublishType.CURRENT); LambdaQueryWrapper<PricePublish> queryPrevious = pricePublishService.getQuery(year - 1, month, null, name, spec, PricePublishType.CURRENT);