Merge remote-tracking branch '惠信/qms/develop' into qms/develop

This commit is contained in:
曹鹏飞 2026-05-09 14:01:21 +08:00
commit 69c071e0c7
2 changed files with 16 additions and 27 deletions

View File

@ -385,22 +385,6 @@ public class QmsIssueTicketControllerService {
.setUpdateTime(now);
issueTicketService.save(entity);
// 按处理人分组异步新增工单处理记录并推送待办
Map<Long, List<Long>> handlerToResultsMap = request.getHandlers().stream()
.collect(Collectors.groupingBy(
QmsIssueTicketPdiAddQO.HandlerItem::getHandlerUserId,
Collectors.mapping(QmsIssueTicketPdiAddQO.HandlerItem::getTaskResultId, Collectors.toList())
));
for (Map.Entry<Long, List<Long>> entry : handlerToResultsMap.entrySet()) {
issueTicketProcessControllerService.addAsync(
entity.getId(),
entry.getKey(),
entry.getValue(),
ticketNo
);
}
}
/**

View File

@ -214,22 +214,27 @@ public class QmsPdiInspectionResultsControllerService {
throw new NflgException(STATE.BusinessError, "还有" + unfilledImages + "项装车前检测未上传图片,无法提交");
}
// 4. 将整体判定结果存入 task_record
boolean overallResult = request.getOverallResult() != null && request.getOverallResult();
taskRecordService.lambdaUpdate()
.eq(QmsPdiTaskRecord::getId, taskRecord.getId())
.set(QmsPdiTaskRecord::getInspectionInspection, overallResult)
.update();
// 5. 查询不合格检测项type=0/1/3
// 4. 查询不合格检测项type=0/1/3装车前不计入
List<QmsPdiInspectionResults> failedItems = inspectionResultsService.lambdaQuery()
.eq(QmsPdiInspectionResults::getTaskId, request.getTaskId())
.ne(QmsPdiInspectionResults::getInspectionItemType, 2)
.eq(QmsPdiInspectionResults::getInspectionItemResults, false)
.list();
// 6. 根据整体判定+检测项结果设置状态有不合格则=3待流转全合格则=2已完成
boolean hasDefect = !overallResult || !failedItems.isEmpty();
// 5. 校验如果所有检测项都合格总体判定不能为不合格
boolean hasDefect = !failedItems.isEmpty();
if (!hasDefect && !request.getOverallResult()) {
throw new NflgException(STATE.BusinessError, "所有检测项均为合格,总体判定不能为不合格");
}
// 6. 将整体判定结果存入 task_record
boolean overallResult = request.getOverallResult() != null && request.getOverallResult();
taskRecordService.lambdaUpdate()
.eq(QmsPdiTaskRecord::getId, taskRecord.getId())
.set(QmsPdiTaskRecord::getInspectionInspection, overallResult)
.update();
// 7. 根据总体判定+检测项结果设置状态有不合格则=3待流转全合格则=2已完成
// 校验 overdue 字段无值时根据完成时间与要求完成时间比较设置有值则保持原值
Boolean overdueValue = taskRecord.getOverdue();
@ -245,7 +250,7 @@ public class QmsPdiInspectionResultsControllerService {
.set(QmsPdiTaskRecord::getInspectionEnable, hasDefect ? 3 : 2)
.update();
// 7. 返回不合格项转换为VO图片改为List格式
// 8. 返回不合格项转换为VO图片改为List格式
return buildInspectionResultVOList(failedItems);
}