@@ -0,0 +1,27 @@ | |||
-- 20240622 10:37 | |||
-- v1.3.0 | |||
use tuoheng_telecomumale; | |||
-- 问题审核记录表 | |||
-- 巡检问题审核结记录表 | |||
CREATE TABLE `th_inspection_file_check_record` ( | |||
`id` int unsigned NOT NULL AUTO_INCREMENT, | |||
`inspection_file_handle_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '巡检问题处理/审核结果id', | |||
`tenant_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '租户ID', | |||
`handler_user` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '处理人', | |||
`handler_image` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '处理后图片(多个图片逗号“,”分隔)', | |||
`handler_result` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '处理结果', | |||
`handler_time` datetime DEFAULT NULL COMMENT '处理完成时间', | |||
`inspection_file_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '巡检问题文件ID', | |||
`create_user` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '创建人', | |||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||
`update_user` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '更新人', | |||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |||
`mark` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '有效标记', | |||
`audit` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '审核状态:0未审核 1合适 2不合适', | |||
`audit_view` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '审核意见', | |||
`audit_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '审核时间', | |||
PRIMARY KEY (`id`) USING BTREE | |||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='巡检问题审核结记录表'; | |||
@@ -537,10 +537,13 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
BeanUtils.copyProperties(inspectionFileHandle, inspectionFileCheckRecord); | |||
inspectionFileCheckRecord.setId(null); | |||
inspectionFileCheckRecord.setInspectionFileHandleId(inspectionFileHandle.getId()); | |||
Boolean aBoolean = inspectionFileCheckRecordsService.insert(inspectionFileCheckRecord); | |||
if (!aBoolean){ | |||
log.info("新增审核记录失败,inspectionFileCheckRecord:{}", inspectionFileCheckRecord); | |||
return JsonResult.error(InspectionFileProcessingCodeEnum.PROCESSING_IS_FAILED.getCode(), InspectionFileProcessingCodeEnum.PROCESSING_IS_FAILED.getMsg()); | |||
//审核通过就不需要新增记录 | |||
if (inspectionFileCheckRecord.getAudit().equals(AuditEnum.TWO.getCode())){ | |||
Boolean aBoolean = inspectionFileCheckRecordsService.insert(inspectionFileCheckRecord); | |||
if (!aBoolean){ | |||
log.info("新增审核记录失败,inspectionFileCheckRecord:{}", inspectionFileCheckRecord); | |||
return JsonResult.error(InspectionFileProcessingCodeEnum.PROCESSING_IS_FAILED.getCode(), InspectionFileProcessingCodeEnum.PROCESSING_IS_FAILED.getMsg()); | |||
} | |||
} | |||
//判断处理工单的状态 | |||
JsonResult jsonResult = workOrderUpdateStatus(userId, request); |
@@ -162,11 +162,12 @@ public class QueryInspectionFilePageListByWorkOrderIdService { | |||
for (InspectionFileCheckRecord inspectionFileCheckRecord : list) { | |||
if (StringUtils.isNotEmpty(inspectionFileCheckRecord.getHandlerImage())){ | |||
String handlerImages = ""; | |||
handlerImages += CommonConfig.imageURL + inspectionFileCheckRecord.getHandlerImage() + ","; | |||
handlerImages = handlerImages.substring(0, handlerImages.length() - 1); | |||
if (StringUtils.isNotEmpty(handlerImages)) { | |||
inspectionFileCheckRecord.setHandlerImage(handlerImages); | |||
String[] arr = inspectionFileCheckRecord.getHandlerImage().split(","); | |||
List<String> imageList = Arrays.stream(arr).map(String::toString).collect(Collectors.toList()); | |||
for (String str : imageList) { | |||
handlerImages += CommonConfig.imageURL + str + ","; | |||
} | |||
inspectionFileCheckRecord.setHandlerImage(handlerImages); | |||
} | |||
} | |||
checkRecordMap = list.stream().collect(Collectors.groupingBy(InspectionFileCheckRecord::getInspectionFileId)); | |||
@@ -190,7 +191,10 @@ public class QueryInspectionFilePageListByWorkOrderIdService { | |||
} | |||
//处理明细表历史审核数据 | |||
if (!CollectionUtils.isEmpty(checkRecordMap) && !CollectionUtils.isEmpty( checkRecordMap.get(inspectionFile.getId()) )){ | |||
inspectionFileHandleVo.setList( checkRecordMap.get(inspectionFile.getId()) ); | |||
List<InspectionFileCheckRecord> inspectionFileCheckRecords = checkRecordMap.get(inspectionFile.getId()); | |||
List<InspectionFileCheckRecord> newList | |||
= inspectionFileCheckRecords.stream().sorted(Comparator.comparing(InspectionFileCheckRecord::getAuditTime, Comparator.reverseOrder())).collect(Collectors.toList());; | |||
inspectionFileHandleVo.setList( newList ); | |||
} | |||
inspectionFileHandleVo.setWorkOrderId(workOrderId); | |||
inspectionFileHandleVo.setInspectionFileId(inspectionFile.getId()); |
@@ -304,14 +304,17 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
for (InspectionFileCheckRecord inspectionFileCheckRecord : list) { | |||
if (StringUtils.isNotEmpty(inspectionFileCheckRecord.getHandlerImage())){ | |||
String handlerImages = ""; | |||
handlerImages += CommonConfig.imageURL + inspectionFileCheckRecord.getHandlerImage() + ","; | |||
handlerImages = handlerImages.substring(0, handlerImages.length() - 1); | |||
if (StringUtils.isNotEmpty(handlerImages)) { | |||
inspectionFileCheckRecord.setHandlerImage(handlerImages); | |||
String[] arr = inspectionFileCheckRecord.getHandlerImage().split(","); | |||
List<String> imageList = Arrays.stream(arr).map(String::toString).collect(Collectors.toList()); | |||
for (String str : imageList) { | |||
handlerImages += CommonConfig.imageURL + str + ","; | |||
} | |||
inspectionFileCheckRecord.setHandlerImage(handlerImages); | |||
} | |||
} | |||
vo.setList(list); | |||
List<InspectionFileCheckRecord> newList | |||
= list.stream().sorted(Comparator.comparing(InspectionFileCheckRecord::getAuditTime, Comparator.reverseOrder())).collect(Collectors.toList());; | |||
vo.setList(newList); | |||
} | |||
//对属性处理 |
@@ -443,11 +443,12 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO | |||
for (InspectionFileCheckRecord inspectionFileCheckRecord : inspectionFileCheckRecords) { | |||
if (StringUtils.isNotEmpty(inspectionFileCheckRecord.getHandlerImage())){ | |||
String handlerImages = ""; | |||
handlerImages += CommonConfig.imageURL + inspectionFileCheckRecord.getHandlerImage() + ","; | |||
handlerImages = handlerImages.substring(0, handlerImages.length() - 1); | |||
if (StringUtils.isNotEmpty(handlerImages)) { | |||
inspectionFileCheckRecord.setHandlerImage(handlerImages); | |||
String[] arr = inspectionFileCheckRecord.getHandlerImage().split(","); | |||
List<String> imageList = Arrays.stream(arr).map(String::toString).collect(Collectors.toList()); | |||
for (String str : imageList) { | |||
handlerImages += CommonConfig.imageURL + str + ","; | |||
} | |||
inspectionFileCheckRecord.setHandlerImage(handlerImages); | |||
} | |||
} | |||
} | |||
@@ -473,7 +474,9 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO | |||
List<InspectionFileCheckRecord> inspectionFileCheckRecordList = | |||
inspectionFileCheckRecords.stream().filter(item -> item.getInspectionFileId().equals(t.getId())).collect(Collectors.toList()); | |||
if (CollectionUtils.isNotEmpty(inspectionFileCheckRecordList)){ | |||
vo.setList(inspectionFileCheckRecordList); | |||
List<InspectionFileCheckRecord> newList | |||
= inspectionFileCheckRecordList.stream().sorted(Comparator.comparing(InspectionFileCheckRecord::getAuditTime, Comparator.reverseOrder())).collect(Collectors.toList());; | |||
vo.setList(newList); | |||
} | |||
} | |||
t.getId(); |