From 95b8162943a9efea925a5e305a5edb2e4bec8584 Mon Sep 17 00:00:00 2001 From: funny <834502597@qq.com> Date: Wed, 27 May 2026 10:01:15 +0800 Subject: [PATCH] =?UTF-8?q?PQC=E4=BB=BB=E5=8A=A1=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QmsPqcInspectionRuleController.java | 9 +-- ...QmsPqcInspectionRuleControllerService.java | 7 +- ...qcInspectionRuleControllerServiceImpl.java | 67 +++++++++++++++---- .../vo/QmsPqcInspectionPointItemListVO.java | 28 ++++++++ .../QmsPqcInspectionPointItemsGroupedVO.java | 30 +++++++++ 5 files changed, 121 insertions(+), 20 deletions(-) create mode 100644 nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcInspectionPointItemListVO.java create mode 100644 nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcInspectionPointItemsGroupedVO.java diff --git a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/controller/QmsPqcInspectionRuleController.java b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/controller/QmsPqcInspectionRuleController.java index eab41f9d..47a26436 100644 --- a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/controller/QmsPqcInspectionRuleController.java +++ b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/controller/QmsPqcInspectionRuleController.java @@ -4,7 +4,6 @@ import com.nflg.qms.admin.pojo.qo.PqcInspectionRuleAddQO; import com.nflg.qms.admin.pojo.qo.PqcInspectionRuleAuditQO; import com.nflg.qms.admin.pojo.qo.PqcInspectionRuleEditQO; import com.nflg.qms.admin.pojo.qo.PqcInspectionRuleSearchQO; -import com.nflg.qms.admin.pojo.vo.PqcInspectionPointItemListVO; import com.nflg.qms.admin.pojo.vo.PqcInspectionPointListVO; import com.nflg.qms.admin.pojo.vo.PqcInspectionRuleDetailVO; import com.nflg.qms.admin.pojo.vo.PqcInspectionRuleVO; @@ -12,6 +11,7 @@ import com.nflg.qms.admin.service.QmsPqcInspectionRuleControllerService; import com.nflg.wms.common.constant.Constant; import com.nflg.wms.common.pojo.ApiResult; import com.nflg.wms.common.pojo.PageData; +import com.nflg.wms.common.pojo.vo.QmsPqcInspectionPointItemsGroupedVO; import com.nflg.wms.common.util.MultilingualUtil; import com.nflg.wms.repository.entity.DictionaryItem; import com.nflg.wms.repository.service.IDictionaryItemService; @@ -62,11 +62,12 @@ public class QmsPqcInspectionRuleController extends BaseController { } /** - * 根据检查点ID查询对应的检测项列表 + * 根据检查点ID查询对应的检测项列表(分组返回) + * 返回三类:关键物料拍照类、工序检查-自检复核类、工序检查-QC检测类 */ @GetMapping("/items") - public ApiResult> listItemsByInspectionPointId(@NotNull Long inspectionPointId) { - return ApiResult.success(ruleControllerService.listItemsByInspectionPointId(inspectionPointId)); + public ApiResult listItemsByInspectionPointId(@NotNull Long inspectionPointId) { + return ApiResult.success(ruleControllerService.listItemsByInspectionPointIdGrouped(inspectionPointId)); } /** diff --git a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsPqcInspectionRuleControllerService.java b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsPqcInspectionRuleControllerService.java index fa13bcd9..eed86a0f 100644 --- a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsPqcInspectionRuleControllerService.java +++ b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsPqcInspectionRuleControllerService.java @@ -5,11 +5,11 @@ import com.nflg.qms.admin.pojo.qo.PqcInspectionRuleAddQO; import com.nflg.qms.admin.pojo.qo.PqcInspectionRuleAuditQO; import com.nflg.qms.admin.pojo.qo.PqcInspectionRuleEditQO; import com.nflg.qms.admin.pojo.qo.PqcInspectionRuleSearchQO; -import com.nflg.qms.admin.pojo.vo.PqcInspectionPointItemListVO; import com.nflg.qms.admin.pojo.vo.PqcInspectionPointListVO; import com.nflg.qms.admin.pojo.vo.PqcInspectionRuleDetailVO; import com.nflg.qms.admin.pojo.vo.PqcInspectionRuleVO; import com.nflg.wms.common.pojo.PageData; +import com.nflg.wms.common.pojo.vo.QmsPqcInspectionPointItemsGroupedVO; import java.util.List; @@ -60,5 +60,8 @@ public interface QmsPqcInspectionRuleControllerService { List listPointsByModelNo(String modelNo); - List listItemsByInspectionPointId(Long inspectionPointId); + /** + * 根据检查点ID查询检测项列表(分组返回) + */ + QmsPqcInspectionPointItemsGroupedVO listItemsByInspectionPointIdGrouped(Long inspectionPointId); } diff --git a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/impl/QmsPqcInspectionRuleControllerServiceImpl.java b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/impl/QmsPqcInspectionRuleControllerServiceImpl.java index cd835e50..78240453 100644 --- a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/impl/QmsPqcInspectionRuleControllerServiceImpl.java +++ b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/impl/QmsPqcInspectionRuleControllerServiceImpl.java @@ -18,6 +18,8 @@ import com.nflg.qms.admin.service.QmsPqcInspectionRuleControllerService; import com.nflg.wms.common.constant.STATE; import com.nflg.wms.common.exception.NflgException; import com.nflg.wms.common.pojo.PageData; +import com.nflg.wms.common.pojo.vo.QmsPqcInspectionPointItemListVO; +import com.nflg.wms.common.pojo.vo.QmsPqcInspectionPointItemsGroupedVO; import com.nflg.wms.common.util.PageUtil; import com.nflg.wms.common.util.UserUtil; import com.nflg.wms.repository.entity.QmsPqcInspectionPoint; @@ -365,22 +367,59 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti } @Override - public List listItemsByInspectionPointId(Long inspectionPointId) { - return itemsService.lambdaQuery() + public QmsPqcInspectionPointItemsGroupedVO listItemsByInspectionPointIdGrouped(Long inspectionPointId) { + // 查询所有检测项 + List allItems = itemsService.lambdaQuery() .eq(QmsPqcInspectionPointItems::getInspectionCodeId, inspectionPointId) .orderByAsc(QmsPqcInspectionPointItems::getSort) - .list() - .stream() - .map(item -> new PqcInspectionPointItemListVO() - .setId(item.getId()) - .setInspectionCodeId(item.getInspectionCodeId()) - .setSort(item.getSort()) - .setInspectionContent(item.getInspectionContent()) - .setInspectionType(item.getInspectionType()) - .setInspectionMethods(item.getInspectionMethods()) - .setInspectionImgUrl(item.getInspectionImgUrl()) - .setInspectionLevel(item.getInspectionLevel())) - .collect(Collectors.toList()); + .list(); + + // 初始化三个分类列表 + List materialItems = new ArrayList<>(); // 第1类:关键物料拍照 + List selfReviewItems = new ArrayList<>(); // 第2类:工序检查-自检复核 + List qcItems = new ArrayList<>(); // 第3类:工序检查-QC检测 + + // 分类逻辑 + for (QmsPqcInspectionPointItems item : allItems) { + QmsPqcInspectionPointItemListVO vo = new QmsPqcInspectionPointItemListVO() + .setId(item.getId()) + .setInspectionCodeId(item.getInspectionCodeId()) + .setSort(item.getSort()) + .setInspectionContent(item.getInspectionContent()) + .setInspectionType(item.getInspectionType()) + .setInspectionMethods(item.getInspectionMethods()) + .setInspectionImgUrl(item.getInspectionImgUrl()) + .setInspectionLevel(item.getInspectionLevel()); + + Integer type = item.getInspectionType(); + Integer level = item.getInspectionLevel(); + + // 第1类:关键物料拍照类 + // 包含:inspectionType = 0(所有)+ inspectionType = 2(所有) + if (type == 0 || type == 2) { + materialItems.add(vo); + } + + // 第2类和第3类:工序检查(按类型和星级分) + // 包含:inspectionType = 1 或 2 + if (type == 1 || type == 2) { + if (level == 1 || level == 2) { + // 星级1或2 → 自检复核类 + selfReviewItems.add(vo); + } else if (level == 3) { + // 星级3 → QC检测类 + qcItems.add(vo); + } + } + } + + // 组装返回结果 + QmsPqcInspectionPointItemsGroupedVO groupedVO = new QmsPqcInspectionPointItemsGroupedVO(); + groupedVO.setMaterialItems(materialItems); + groupedVO.setSelfReviewItems(selfReviewItems); + groupedVO.setQcItems(qcItems); + + return groupedVO; } private void savePointsAndItems(Long ruleId, List points, diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcInspectionPointItemListVO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcInspectionPointItemListVO.java new file mode 100644 index 00000000..910fbb60 --- /dev/null +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcInspectionPointItemListVO.java @@ -0,0 +1,28 @@ +package com.nflg.wms.common.pojo.vo; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * PQC检测项列表返回对象 + */ +@Data +@Accessors(chain = true) +public class QmsPqcInspectionPointItemListVO { + + private Long id; + + private Long inspectionCodeId; + + private Integer sort; + + private String inspectionContent; + + private Integer inspectionType; + + private Integer inspectionMethods; + + private String inspectionImgUrl; + + private Integer inspectionLevel; +} diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcInspectionPointItemsGroupedVO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcInspectionPointItemsGroupedVO.java new file mode 100644 index 00000000..8a4e8aea --- /dev/null +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcInspectionPointItemsGroupedVO.java @@ -0,0 +1,30 @@ +package com.nflg.wms.common.pojo.vo; + +import lombok.Data; + +import java.util.List; + +/** + * PQC检测点检测项分组VO + */ +@Data +public class QmsPqcInspectionPointItemsGroupedVO { + + /** + * 第1类:关键物料拍照类 + * 包含:inspectionType = 0(所有)+ inspectionType = 2(所有) + */ + private List materialItems; + + /** + * 第2类:工序检查-自检复核类 + * 包含:inspectionType = 1且星级=1或2 + inspectionType = 2且星级=1或2 + */ + private List selfReviewItems; + + /** + * 第3类:工序检查-QC检测类 + * 包含:inspectionType = 1且星级=3 + inspectionType = 2且星级=3 + */ + private List qcItems; +}