diff --git a/src/main/java/mjkf/xinke/main/controller/PublicController.java b/src/main/java/mjkf/xinke/main/controller/PublicController.java index 731fbb4..779f81a 100644 --- a/src/main/java/mjkf/xinke/main/controller/PublicController.java +++ b/src/main/java/mjkf/xinke/main/controller/PublicController.java @@ -43,7 +43,8 @@ public class PublicController { @ApiParam(value = "月份") @RequestParam(value="month") Integer month, @ApiParam(value = "关键字") @RequestParam(value="keyword", required = false) String keyword, @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 { LambdaQueryWrapper query = pricePublishService.getQuery(year, month, null, name, spec, PricePublishType.CURRENT); if (keyword != null && ObjectUtil.isNotEmpty(keyword)) { @@ -52,6 +53,11 @@ public class PublicController { .like(PricePublish::getSpec, keyword) ); } + if (ObjectUtil.isNotEmpty(parentId)) { + var materialParentId = parentId.replace(".00", ""); + query.likeRight(PricePublish::getMaterialId, materialParentId); + } + var currentData = pricePublishService.list(query); LambdaQueryWrapper queryPrevious = pricePublishService.getQuery(year - 1, month, null, name, spec, PricePublishType.CURRENT);