diff --git a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleAddQO.java b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleAddQO.java index 3f5fd71f..14406d1b 100644 --- a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleAddQO.java +++ b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleAddQO.java @@ -18,11 +18,6 @@ public class PqcInspectionRuleAddQO { @NotBlank(message = "机型编号不能为空") private String modelNo; - /** - * 质检员id - */ - private Long inspectorId; - /** * 规则编号(可选,后端自动生成) */ diff --git a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleEditQO.java b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleEditQO.java index a210a5e0..3c4325f0 100644 --- a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleEditQO.java +++ b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleEditQO.java @@ -25,11 +25,6 @@ public class PqcInspectionRuleEditQO { @NotBlank(message = "机型编号不能为空") private String modelNo; - /** - * 质检员id - */ - private Long inspectorId; - /** * 检查点列表 */ diff --git a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleSearchQO.java b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleSearchQO.java index b76dbd6c..56096554 100644 --- a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleSearchQO.java +++ b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/qo/PqcInspectionRuleSearchQO.java @@ -23,11 +23,6 @@ public class PqcInspectionRuleSearchQO extends PageQO { */ private String pqcRuleCode; - /** - * 质检员id - */ - private Long inspectorId; - /** * 启用状态:true=启用,false=禁用 */ diff --git a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/vo/PqcInspectionRuleDetailVO.java b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/vo/PqcInspectionRuleDetailVO.java index 9cedc10f..3cd84bf1 100644 --- a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/vo/PqcInspectionRuleDetailVO.java +++ b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/vo/PqcInspectionRuleDetailVO.java @@ -23,11 +23,6 @@ public class PqcInspectionRuleDetailVO { */ private String modelNo; - /** - * 质检员id - */ - private Long inspectorId; - /** * 规则编号 */ diff --git a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/vo/PqcInspectionRuleVO.java b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/vo/PqcInspectionRuleVO.java index 9f485b80..4f8d5c62 100644 --- a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/vo/PqcInspectionRuleVO.java +++ b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/pojo/vo/PqcInspectionRuleVO.java @@ -22,11 +22,6 @@ public class PqcInspectionRuleVO { */ private String modelNo; - /** - * 质检员id - */ - private Long inspectorId; - /** * 规则编号 */ diff --git a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsPqcTaskRecordControllerService.java b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsPqcTaskRecordControllerService.java index 80482857..f8ac7cc0 100644 --- a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsPqcTaskRecordControllerService.java +++ b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsPqcTaskRecordControllerService.java @@ -85,10 +85,6 @@ public class QmsPqcTaskRecordControllerService { VUtil.trueThrowBusinessError(latestRule == null) .throwMessage("未找到机型[" + modelNo + "]的检验规则"); - - User inspector = latestRule.getInspectorId() == null ? null : userService.getById(latestRule.getInspectorId()); - String inspectorName = inspector == null ? null : inspector.getUserName(); - // 2. 生成任务编号(单号生成ID=42) String taskNo = basdeSerialNumberControllerService.generateSerialNumber(42); @@ -99,8 +95,6 @@ public class QmsPqcTaskRecordControllerService { .setModelNo(modelNo) .setNo(no) .setInspectionPointId(inspectionPointId) - .setReviewerId(latestRule.getInspectorId()) - .setReviewerName(inspectorName) .setStatus((short) 0) // 0=自检中 .setEnable(true) .setCreateTime(LocalDateTime.now()); @@ -1037,13 +1031,6 @@ public class QmsPqcTaskRecordControllerService { } pqcTaskRecordService.updateById(taskRecord); - - // 5. 自检提交后推送给所有QC人员 - if (!hasReviewContent) { - // 推送给所有QC人员(推送编码:PQCReviewTask) - sendTodoMessageToAllQC(taskRecord.getId(), currentUserId, currentUserName, now); - } - // 6. 同步生成工单;仅当任务总体不合格时才额外生成重检任务 Map detailIdMap = getTaskDetailIdMap(taskRecord.getId()); List unqualifiedItems = buildUnqualifiedItems(request, detailIdMap); @@ -1647,29 +1634,6 @@ public class QmsPqcTaskRecordControllerService { sendMessageServices.forEach(service -> service.sendSystemMessage(todoItem)); } - /** - * 推送给所有QC人员 - */ - private void sendTodoMessageToAllQC(Long taskId, Long createUserId, String createUserName, LocalDateTime now) { - // 查询消息类型ID - Long reviewTypeId = dictionaryItemService.getIdByCode("MessageType", "PQCReviewTask"); - VUtil.trueThrowBusinessError(reviewTypeId == null).throwMessage("消息类型PQCReviewTask不存在"); - - // TODO: 根据实际业务获取所有QC人员列表 - // 这里需要根据角色或用户组查询所有QC人员 - // 示例:List qcUsers = userService.getUsersByRole("QC"); - - // 临时实现:推送给任务的复核人(如果有) - QmsPqcTaskRecord taskRecord = pqcTaskRecordService.getById(taskId); - if (taskRecord != null && taskRecord.getReviewerId() != null) { - sendTodoMessage(taskRecord.getTaskNo(),taskRecord.getReviewerId(), taskRecord.getReviewerName(), - taskId, reviewTypeId, createUserId, createUserName, now); - } - } - - /** - * 生成检查点合并键 - */ private String buildStepKey(QmsPqcInspectionPoint point) { String stepName = StrUtil.blankToDefault(point.getStepName(), ""); String stepDicItemId = point.getStepDicItemId() == null ? "" : point.getStepDicItemId().toString(); 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 ddc66266..a1017bb8 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 @@ -192,7 +192,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti // 查询条件 queryWrapper.like(StrUtil.isNotBlank(qo.getModelNo()), QmsPqcInspectionRule::getModelNo, qo.getModelNo()) .like(StrUtil.isNotBlank(qo.getPqcRuleCode()), QmsPqcInspectionRule::getPqcRuleCode, qo.getPqcRuleCode()) - .eq(Objects.nonNull(qo.getInspectorId()), QmsPqcInspectionRule::getInspectorId, qo.getInspectorId()) .eq(Objects.nonNull(qo.getIsDisabled()), QmsPqcInspectionRule::getIsDisabled, qo.getIsDisabled()) .eq(Objects.nonNull(qo.getAuditStatus()), QmsPqcInspectionRule::getAuditStatus, qo.getAuditStatus()) .ge(Objects.nonNull(qo.getCreateTimeStart()), QmsPqcInspectionRule::getCreateTime, qo.getCreateTimeStart() == null ? null : qo.getCreateTimeStart().atStartOfDay()) @@ -276,7 +275,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti // 创建规则主表 QmsPqcInspectionRule rule = new QmsPqcInspectionRule(); rule.setModelNo(qo.getModelNo()); - rule.setInspectorId(qo.getInspectorId()); // 规则编号为空时自动生成 rule.setPqcRuleCode(StrUtil.isNotBlank(qo.getPqcRuleCode()) @@ -319,7 +317,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti } existRule.setModelNo(qo.getModelNo()); - existRule.setInspectorId(qo.getInspectorId()); existRule.setUpdateBy(operatorId); existRule.setUpdateName(operator); existRule.setUpdateTime(now); @@ -376,7 +373,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti // 创建新规则 QmsPqcInspectionRule newRule = new QmsPqcInspectionRule(); newRule.setModelNo(existRule.getModelNo()); - newRule.setInspectorId(existRule.getInspectorId()); newRule.setPqcRuleCode(serialNumberControllerService.generateSerialNumber(40)); newRule.setRuleVersion(getNextRuleVersion(existRule.getModelNo())); newRule.setIsDisabled(true); @@ -549,7 +545,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti QmsPqcInspectionRule newRule = new QmsPqcInspectionRule(); newRule.setModelNo(existRule.getModelNo()); - newRule.setInspectorId(existRule.getInspectorId()); newRule.setPqcRuleCode(serialNumberControllerService.generateSerialNumber(40)); newRule.setRuleVersion(existRule.getRuleVersion() == null ? 1 : existRule.getRuleVersion() + 1); newRule.setIsDisabled(existRule.getIsDisabled()); @@ -749,22 +744,8 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti StrUtil.isBlank(dto.getInspectionMethodsText()) && StrUtil.isBlank(dto.getInspectionLevelText()) && StrUtil.isBlank(dto.getInspectionImage()) && - Objects.isNull(dto.getInspectorId()) && Objects.isNull(dto.getSort())); } - - private Long resolveImportInspectorId(List rows) { - List inspectorIds = rows.stream() - .map(PqcInspectionRuleImportDTO::getInspectorId) - .filter(Objects::nonNull) - .distinct() - .collect(Collectors.toList()); - if (inspectorIds.size() > 1) { - throw new NflgException(STATE.BusinessError, "同一机型编号只能填写一个质检员ID"); - } - return inspectorIds.isEmpty() ? null : inspectorIds.get(0); - } - @Override @Transactional public void importFromExcel(MultipartFile file, String importMode) throws Exception { @@ -846,7 +827,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti for (Map.Entry> entry : modelNoGroups.entrySet()) { String modelNo = entry.getKey(); List modelRows = entry.getValue(); - Long importInspectorId = resolveImportInspectorId(modelRows); // 查找该机型编号的最高版本规则 QmsPqcInspectionRule highestRule = ruleService.lambdaQuery() @@ -861,7 +841,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti // 该机型无规则,新建 QmsPqcInspectionRule newRule = new QmsPqcInspectionRule(); newRule.setModelNo(modelNo); - newRule.setInspectorId(importInspectorId); newRule.setPqcRuleCode(serialNumberControllerService.generateSerialNumber(40)); newRule.setRuleVersion(1); newRule.setIsDisabled(true); @@ -882,16 +861,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti targetRuleId = highestRule.getId(); } - if (importInspectorId != null) { - ruleService.lambdaUpdate() - .eq(QmsPqcInspectionRule::getId, targetRuleId) - .set(QmsPqcInspectionRule::getInspectorId, importInspectorId) - .set(QmsPqcInspectionRule::getUpdateBy, operatorId) - .set(QmsPqcInspectionRule::getUpdateName, operator) - .set(QmsPqcInspectionRule::getUpdateTime, now) - .update(); - } - // 按 (步装名称 + 检查点编号) 分组,构建检查点和检查项的层级结构 // 使用 "stepName|inspectionPointCode" 作为分组key Map> pointGroups = modelRows.stream() @@ -1180,7 +1149,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.like(StrUtil.isNotBlank(qo.getModelNo()), QmsPqcInspectionRule::getModelNo, qo.getModelNo()) .like(StrUtil.isNotBlank(qo.getPqcRuleCode()), QmsPqcInspectionRule::getPqcRuleCode, qo.getPqcRuleCode()) - .eq(Objects.nonNull(qo.getInspectorId()), QmsPqcInspectionRule::getInspectorId, qo.getInspectorId()) .eq(Objects.nonNull(qo.getIsDisabled()), QmsPqcInspectionRule::getIsDisabled, qo.getIsDisabled()) .eq(Objects.nonNull(qo.getAuditStatus()), QmsPqcInspectionRule::getAuditStatus, qo.getAuditStatus()) .ge(StrUtil.isNotBlank(qo.getCreateTimeStart()), QmsPqcInspectionRule::getCreateTime, qo.getCreateTimeStart()) @@ -1207,7 +1175,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti for (QmsPqcInspectionPointItems item : items) { PqcInspectionRuleExportDTO dto = new PqcInspectionRuleExportDTO(); dto.setModelNo(rule.getModelNo()); - dto.setInspectorId(rule.getInspectorId()); dto.setStepName(point.getStepName()); dto.setInspectionPointCode(point.getInspectionPointCode()); dto.setInspectionPointName(point.getInspectionPointName()); @@ -1256,7 +1223,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti public void downloadTemplate(HttpServletResponse response) throws IOException { PqcInspectionRuleImportTemplateDTO example = new PqcInspectionRuleImportTemplateDTO() .setModelNo("示例机型编号") - .setInspectorId(1L) .setStepName("示例步装名称") .setInspectionPointCode("示例检查点编号") .setInspectionPointName("示例检查点名称") diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleExportDTO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleExportDTO.java index 9228a364..ff78d773 100644 --- a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleExportDTO.java +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleExportDTO.java @@ -23,7 +23,6 @@ public class PqcInspectionRuleExportDTO { * 质检员ID */ @ExcelColumn("质检员ID") - private Long inspectorId; /** * 步装名称 diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleImportDTO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleImportDTO.java index 00030512..237de009 100644 --- a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleImportDTO.java +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleImportDTO.java @@ -22,7 +22,6 @@ public class PqcInspectionRuleImportDTO { * 质检员ID */ @ExcelColumn("质检员ID") - private Long inspectorId; /** * 步装名称(必填) diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleImportTemplateDTO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleImportTemplateDTO.java index 173c1632..085920e4 100644 --- a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleImportTemplateDTO.java +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/dto/PqcInspectionRuleImportTemplateDTO.java @@ -15,7 +15,6 @@ public class PqcInspectionRuleImportTemplateDTO { private String modelNo; @ExcelColumn("质检员ID") - private Long inspectorId; @ExcelColumn("步装名称*") private String stepName; diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/qo/PqcInspectionRuleExportQO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/qo/PqcInspectionRuleExportQO.java index 62c6c5b8..696315b1 100644 --- a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/qo/PqcInspectionRuleExportQO.java +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/qo/PqcInspectionRuleExportQO.java @@ -22,8 +22,6 @@ public class PqcInspectionRuleExportQO { private String pqcRuleCode; - private Long inspectorId; - private Boolean isDisabled; private Integer auditStatus; diff --git a/nflg-wms-repository/src/main/java/com/nflg/wms/repository/entity/QmsPqcInspectionRule.java b/nflg-wms-repository/src/main/java/com/nflg/wms/repository/entity/QmsPqcInspectionRule.java index 9b7c8c6e..a41d0558 100644 --- a/nflg-wms-repository/src/main/java/com/nflg/wms/repository/entity/QmsPqcInspectionRule.java +++ b/nflg-wms-repository/src/main/java/com/nflg/wms/repository/entity/QmsPqcInspectionRule.java @@ -35,12 +35,6 @@ public class QmsPqcInspectionRule implements Serializable { * 机型编号 */ private String modelNo; - - /** - * 质检员id - */ - private Long inspectorId; - /** * 规则编号 */ diff --git a/nflg-wms-repository/src/main/java/com/nflg/wms/repository/service/impl/QmsQualityInspectorServiceImpl.java b/nflg-wms-repository/src/main/java/com/nflg/wms/repository/service/impl/QmsQualityInspectorServiceImpl.java index 6afdccac..54ff0205 100644 --- a/nflg-wms-repository/src/main/java/com/nflg/wms/repository/service/impl/QmsQualityInspectorServiceImpl.java +++ b/nflg-wms-repository/src/main/java/com/nflg/wms/repository/service/impl/QmsQualityInspectorServiceImpl.java @@ -17,7 +17,6 @@ import com.nflg.wms.common.pojo.vo.*; import com.nflg.wms.common.util.UserUtil; import com.nflg.wms.repository.entity.QmsInspectorMaterialCategoryItem; import com.nflg.wms.repository.entity.QmsInspectorMaterialItem; -import com.nflg.wms.repository.entity.QmsPqcInspectionRule; import com.nflg.wms.repository.entity.QmsQcMaterialCategory; import com.nflg.wms.repository.entity.QmsQualityInspector; import com.nflg.wms.repository.entity.User; @@ -32,7 +31,6 @@ import com.nflg.wms.repository.service.IPositionService; import com.nflg.wms.repository.service.IUserInteriorService; import com.nflg.wms.repository.service.IQmsQcMaterialCategoryService; import com.nflg.wms.repository.service.IQmsQualityInspectorService; -import com.nflg.wms.repository.service.IQmsPqcInspectionRuleService; import com.nflg.wms.repository.service.IUserService; import jakarta.annotation.Resource; import org.springframework.stereotype.Service; @@ -75,10 +73,6 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl normalizeModelNos(List modelNos) { - if (CollectionUtils.isEmpty(modelNos)) { - return Collections.emptyList(); - } - return modelNos.stream() - .filter(Objects::nonNull) - .map(String::trim) - .filter(modelNo -> !modelNo.isEmpty()) - .distinct() - .collect(Collectors.toList()); - } - - private void savePqcModelBindings(Long inspectorId, List modelNos) { - List normalizedModelNos = normalizeModelNos(modelNos); - if (!normalizedModelNos.isEmpty()) { - List existingModelNos = pqcInspectionRuleService.lambdaQuery() - .in(QmsPqcInspectionRule::getModelNo, normalizedModelNos) - .list() - .stream() - .map(QmsPqcInspectionRule::getModelNo) - .filter(Objects::nonNull) - .distinct() - .collect(Collectors.toList()); - if (existingModelNos.size() != normalizedModelNos.size()) { - List missingModelNos = normalizedModelNos.stream() - .filter(modelNo -> !existingModelNos.contains(modelNo)) - .collect(Collectors.toList()); - throw new NflgException(STATE.BusinessError, "PQC机型规则不存在:" + String.join(",", missingModelNos)); - } - } - - pqcInspectionRuleService.lambdaUpdate() - .eq(QmsPqcInspectionRule::getInspectorId, inspectorId) - .set(QmsPqcInspectionRule::getInspectorId, null) - .update(); - - if (normalizedModelNos.isEmpty()) { - return; - } - - pqcInspectionRuleService.lambdaUpdate() - .in(QmsPqcInspectionRule::getModelNo, normalizedModelNos) - .set(QmsPqcInspectionRule::getInspectorId, inspectorId) - .set(QmsPqcInspectionRule::getUpdateBy, UserUtil.getUserId()) - .set(QmsPqcInspectionRule::getUpdateName, UserUtil.getUserName()) - .set(QmsPqcInspectionRule::getUpdateTime, LocalDateTime.now()) - .update(); - } - - private List getPqcModelsByInspectorId(Long inspectorId) { - if (inspectorId == null) { - return Collections.emptyList(); - } - return pqcInspectionRuleService.lambdaQuery() - .eq(QmsPqcInspectionRule::getInspectorId, inspectorId) - .orderByAsc(QmsPqcInspectionRule::getModelNo) - .list() - .stream() - .map(rule -> { - QmsQualityInspectorPqcModelVO vo = new QmsQualityInspectorPqcModelVO(); - vo.setPqcRuleId(rule.getId()); - vo.setModelNo(rule.getModelNo()); - vo.setPqcRuleCode(rule.getPqcRuleCode()); - vo.setRuleVersion(rule.getRuleVersion()); - return vo; - }) - .collect(Collectors.toList()); - } - - private void fillPqcModelNos(List records) { - if (CollectionUtils.isEmpty(records)) { - return; - } - List inspectorIds = records.stream() - .filter(vo -> Objects.equals(vo.getInspectionType(), 2)) - .map(QmsQualityInspectorVO::getId) - .filter(Objects::nonNull) - .distinct() - .collect(Collectors.toList()); - if (inspectorIds.isEmpty()) { - return; - } - Map> modelNoMap = pqcInspectionRuleService.lambdaQuery() - .in(QmsPqcInspectionRule::getInspectorId, inspectorIds) - .list() - .stream() - .collect(Collectors.groupingBy( - QmsPqcInspectionRule::getInspectorId, - Collectors.mapping(QmsPqcInspectionRule::getModelNo, - Collectors.collectingAndThen(Collectors.toList(), modelNos -> modelNos.stream() - .filter(Objects::nonNull) - .distinct() - .collect(Collectors.toList()))) - )); - records.forEach(vo -> { - if (Objects.equals(vo.getInspectionType(), 2)) { - vo.setPqcModelNos(modelNoMap.getOrDefault(vo.getId(), Collections.emptyList())); - } - }); - } - private QmsQualityInspector getPqcInspector(Long id) { QmsQualityInspector inspector = getById(id); if (Objects.isNull(inspector)) { @@ -339,8 +231,6 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl search(QmsQualityInspectorSearchQO request) { IPage page = baseMapper.searchPage(request, new Page<>(request.getPage(), request.getPageSize())); - fillPqcModelNos(page.getRecords()); return page; } @@ -571,7 +453,7 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl - - AND EXISTS ( - SELECT 1 - FROM qms_pqc_inspection_rule pir - WHERE pir.inspector_id = qi.id - AND pir.model_no ilike concat('%', #{request.pqcModelNo}, '%') - ) - AND qi.inspection_type = #{request.inspectionType}