diff --git a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsIssueTicketProcessMeasureControllerService.java b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsIssueTicketProcessMeasureControllerService.java index aec76401..181f764a 100644 --- a/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsIssueTicketProcessMeasureControllerService.java +++ b/nflg-qms-admin/src/main/java/com/nflg/qms/admin/service/QmsIssueTicketProcessMeasureControllerService.java @@ -256,7 +256,7 @@ public class QmsIssueTicketProcessMeasureControllerService { return false; } if (StrUtil.isBlank(item.getChargeUser())) { - throw new NflgException(STATE.BusinessError, "措施负责人不能为空"); + item.setChargeUser(currentUserName); } return StrUtil.equals(item.getChargeUser(), currentUserName); } 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 933b4469..371ef8c8 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 @@ -308,6 +308,7 @@ public class QmsPqcTaskRecordControllerService { vo.setSelfTesterName(record.getSelfTesterName()); vo.setReviewerId(record.getReviewerId()); vo.setReviewerName(record.getReviewerName()); + vo.setCurrentHandlerName(getPqcCurrentHandlerName(record)); vo.setStatus(record.getStatus()); vo.setCreateTime(record.getCreateTime()); @@ -408,6 +409,7 @@ public class QmsPqcTaskRecordControllerService { vo.setModelNo(record.getModelNo()); vo.setAufnr(record.getAufnr()); vo.setCreateTime(record.getCreateTime()); + vo.setCurrentHandlerName(getPqcCurrentHandlerName(record)); QmsPqcInspectionPoint point = finalPointMap.get(record.getInspectionPointId()); if (point != null) { @@ -432,6 +434,20 @@ public class QmsPqcTaskRecordControllerService { /** * 3. 查询PQC任务详情(PC端) */ + private String getPqcCurrentHandlerName(QmsPqcTaskRecord record) { + if (record == null || record.getStatus() == null) { + return null; + } + if (Objects.equals(record.getStatus(), (short) 0)) { + return record.getSelfTesterName(); + } + if (Objects.equals(record.getStatus(), (short) 1) + || Objects.equals(record.getStatus(), (short) 2)) { + return record.getReviewerName(); + } + return null; + } + public QmsPqcTaskRecordDetailVO getPqcTaskDetail(Long taskId) { QmsPqcTaskRecord taskRecord = pqcTaskRecordService.getById(taskId); VUtil.trueThrowBusinessError(taskRecord == null).throwMessage("任务不存在"); diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsIncomingInspectionTaskVO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsIncomingInspectionTaskVO.java index b06935b4..c692209b 100644 --- a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsIncomingInspectionTaskVO.java +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsIncomingInspectionTaskVO.java @@ -176,6 +176,8 @@ public class QmsIncomingInspectionTaskVO { */ private String agentName; + private String currentHandlerName; + /** * 送检时间 */ diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiInspectionResultsPageVO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiInspectionResultsPageVO.java index fdc869e6..07c9984f 100644 --- a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiInspectionResultsPageVO.java +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiInspectionResultsPageVO.java @@ -55,6 +55,8 @@ public class QmsPdiInspectionResultsPageVO { */ private Integer inspectionEnable; + private String currentHandlerName; + /** * 是否超期 */ diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiTaskRecordDefectPageVO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiTaskRecordDefectPageVO.java index b260633f..3790d879 100644 --- a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiTaskRecordDefectPageVO.java +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiTaskRecordDefectPageVO.java @@ -85,6 +85,8 @@ public class QmsPdiTaskRecordDefectPageVO { */ private Long assistantId; + private String currentHandlerName; + /** * 质检时间(开始检测时间) */ diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiTaskRecordPageVO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiTaskRecordPageVO.java index 6a216a6c..0a28d22b 100644 --- a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiTaskRecordPageVO.java +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPdiTaskRecordPageVO.java @@ -75,6 +75,8 @@ public class QmsPdiTaskRecordPageVO { */ private String assistantName; + private String currentHandlerName; + /** * 质检时间(开始检测时间) */ diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcTaskRecordPageVO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcTaskRecordPageVO.java index 51a94e87..31ebc5eb 100644 --- a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcTaskRecordPageVO.java +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcTaskRecordPageVO.java @@ -85,6 +85,8 @@ public class QmsPqcTaskRecordPageVO { */ private String reviewerName; + private String currentHandlerName; + /** * 检验状态:0为自检中,1为待复核,2为复核中,3为已复核 */ diff --git a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcTaskRecordTabletPageVO.java b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcTaskRecordTabletPageVO.java index 801eb6a6..49eb3db0 100644 --- a/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcTaskRecordTabletPageVO.java +++ b/nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/QmsPqcTaskRecordTabletPageVO.java @@ -45,6 +45,8 @@ public class QmsPqcTaskRecordTabletPageVO { */ private Short status; + private String currentHandlerName; + /** * 创建时间 */ diff --git a/nflg-wms-repository/src/main/resources/mapper/QmsIncomingInspectionTaskMapper.xml b/nflg-wms-repository/src/main/resources/mapper/QmsIncomingInspectionTaskMapper.xml index e0b63451..37443638 100644 --- a/nflg-wms-repository/src/main/resources/mapper/QmsIncomingInspectionTaskMapper.xml +++ b/nflg-wms-repository/src/main/resources/mapper/QmsIncomingInspectionTaskMapper.xml @@ -30,6 +30,11 @@ t.inspector_name, t.agent_id, t.agent_name, + CASE + WHEN t.agent_name IS NOT NULL AND t.inspector_name IS NOT NULL AND t.agent_name != t.inspector_name + THEN t.agent_name || ';' || t.inspector_name + ELSE COALESCE(t.agent_name, t.inspector_name) + END AS current_handler_name, t.submit_time, t.inspection_start_time, t.inspection_finish_time, @@ -133,6 +138,11 @@ t.inspector_name, t.agent_id, t.agent_name, + CASE + WHEN t.agent_name IS NOT NULL AND t.inspector_name IS NOT NULL AND t.agent_name != t.inspector_name + THEN t.agent_name || ';' || t.inspector_name + ELSE COALESCE(t.agent_name, t.inspector_name) + END AS current_handler_name, t.submit_time, t.inspection_start_time, t.inspection_finish_time, @@ -198,6 +208,11 @@ t.inspector_name, t.agent_id, t.agent_name, + CASE + WHEN t.agent_name IS NOT NULL AND t.inspector_name IS NOT NULL AND t.agent_name != t.inspector_name + THEN t.agent_name || ';' || t.inspector_name + ELSE COALESCE(t.agent_name, t.inspector_name) + END AS current_handler_name, t.submit_time, t.inspection_start_time, t.inspection_finish_time, diff --git a/nflg-wms-repository/src/main/resources/mapper/QmsPdiInspectionResultsMapper.xml b/nflg-wms-repository/src/main/resources/mapper/QmsPdiInspectionResultsMapper.xml index 8b6c8af1..24f163e7 100644 --- a/nflg-wms-repository/src/main/resources/mapper/QmsPdiInspectionResultsMapper.xml +++ b/nflg-wms-repository/src/main/resources/mapper/QmsPdiInspectionResultsMapper.xml @@ -14,9 +14,16 @@ t.submission_time AS submissionTime, t.required_completion_time AS requiredCompletionTime, t.inspection_enable AS inspectionEnable, + CASE + WHEN ua.user_name IS NOT NULL AND ui.user_name IS NOT NULL AND ua.user_name != ui.user_name + THEN ua.user_name || ';' || ui.user_name + ELSE COALESCE(ua.user_name, ui.user_name) + END AS currentHandlerName, t.overdue FROM qms_pdi_task_record t LEFT JOIN qms_pdi_detection_rules r ON r.id = t.detection_rules_id + LEFT JOIN "user" ui ON ui.id = r.inspector_id + LEFT JOIN "user" ua ON ua.id = t.assistant_id @@ -54,9 +61,16 @@ t.submission_time AS submissionTime, t.required_completion_time AS requiredCompletionTime, t.inspection_enable AS inspectionEnable, + CASE + WHEN ua.user_name IS NOT NULL AND ui.user_name IS NOT NULL AND ua.user_name != ui.user_name + THEN ua.user_name || ';' || ui.user_name + ELSE COALESCE(ua.user_name, ui.user_name) + END AS currentHandlerName, t.overdue FROM qms_pdi_task_record t LEFT JOIN qms_pdi_detection_rules r ON r.id = t.detection_rules_id + LEFT JOIN "user" ui ON ui.id = r.inspector_id + LEFT JOIN "user" ua ON ua.id = t.assistant_id AND (t.assistant_id = #{request.userId} OR r.inspector_id = #{request.userId}) diff --git a/nflg-wms-repository/src/main/resources/mapper/QmsPdiTaskRecordMapper.xml b/nflg-wms-repository/src/main/resources/mapper/QmsPdiTaskRecordMapper.xml index 02112562..9cd6cec6 100644 --- a/nflg-wms-repository/src/main/resources/mapper/QmsPdiTaskRecordMapper.xml +++ b/nflg-wms-repository/src/main/resources/mapper/QmsPdiTaskRecordMapper.xml @@ -17,6 +17,11 @@ t.inspection_inspection AS inspectionInspection, ui.user_name AS inspectorName, ua.user_name AS assistantName, + CASE + WHEN ua.user_name IS NOT NULL AND ui.user_name IS NOT NULL AND ua.user_name != ui.user_name + THEN ua.user_name || ';' || ui.user_name + ELSE COALESCE(ua.user_name, ui.user_name) + END AS currentHandlerName, t.start_detection_time AS startDetectionTime, t.submission_time AS submissionTime, t.required_completion_time AS requiredCompletionTime, @@ -82,6 +87,11 @@ r.inspector_id AS inspectorId, ua.user_name AS assistantName, t.assistant_id AS assistantId, + CASE + WHEN ua.user_name IS NOT NULL AND ui.user_name IS NOT NULL AND ua.user_name != ui.user_name + THEN ua.user_name || ';' || ui.user_name + ELSE COALESCE(ua.user_name, ui.user_name) + END AS currentHandlerName, t.start_detection_time AS startDetectionTime, t.submission_time AS submissionTime, t.required_completion_time AS requiredCompletionTime,