diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/DQBomApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/DQBomApi.java index 26144656..aa3acb8d 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/DQBomApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/DQBomApi.java @@ -259,4 +259,15 @@ public class DQBomApi extends BaseApi { public ResultVO> queryMaterials(@Valid @RequestBody @NotEmpty List query) { return ResultVO.success(dQBomService.queryMaterials(query)); } + + /** + * 查询物料信息 + * @param query 查询条件 + * @return + */ + @PostMapping("queryMaterial") + @ApiOperation("查询物料信息") + public ResultVO queryMaterial(@Valid @RequestBody @NotEmpty QueryMaterialsQuery query) { + return ResultVO.success(dQBomService.queryMaterial(query)); + } } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java index a9f69cce..7ac05094 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java @@ -685,4 +685,17 @@ public class DQBomService { } return Convert.toList(QueryMaterialsVO.class, datas); } + + public QueryMaterialsVO queryMaterial(QueryMaterialsQuery query) { + List vos = null; + if (StrUtil.isNotBlank(query.getMaterialNo())) { + vos = SpringUtil.getBean(MaterialMainMapper.class).getMaterialBaseInfo(Collections.singletonList(query.getMaterialNo())); + } else if (StrUtil.isNotBlank(query.getDrawingNo())) { + vos = SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(Collections.singletonList(query.getDrawingNo())); + } + if (CollUtil.isNotEmpty(vos)) { + return Convert.convert(QueryMaterialsVO.class, vos.get(0)); + } + return null; + } }