Commit 454ad89d authored by suhuiguang's avatar suhuiguang

feat(综合搜索):空指针处理

1.空指针处理
parent f3c4426e
...@@ -67,8 +67,8 @@ public class EquipRefreshHandler implements IDataRefreshHandler { ...@@ -67,8 +67,8 @@ public class EquipRefreshHandler implements IDataRefreshHandler {
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = iIdxBizJgInspectionDetectionInfoService.queryNewestDetailByRecord(record); IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = iIdxBizJgInspectionDetectionInfoService.queryNewestDetailByRecord(record);
IdxBizJgMaintenanceRecordInfo lastMaintenanceRecordInfo = maintenanceRecordInfoService.queryNewestDetailByRecord(record); IdxBizJgMaintenanceRecordInfo lastMaintenanceRecordInfo = maintenanceRecordInfoService.queryNewestDetailByRecord(record);
try { try {
esEquipmentInfo.setINSPECT_DATE(inspectionDetectionInfo.getSequenceNbr() != null ? inspectionDetectionInfo.getInspectDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null); esEquipmentInfo.setINSPECT_DATE(inspectionDetectionInfo.getSequenceNbr() != null ? inspectionDetectionInfo.getInspectDate() != null ? inspectionDetectionInfo.getInspectDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null :null);
esEquipmentInfo.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getSequenceNbr() != null ? inspectionDetectionInfo.getNextInspectDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null); esEquipmentInfo.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getSequenceNbr() != null ? inspectionDetectionInfo.getNextInspectDate() != null ? inspectionDetectionInfo.getNextInspectDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null :null);
esEquipmentInfo.setCreateDate(useInfo.getCreateDate() != null ? useInfo.getCreateDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime() : null); esEquipmentInfo.setCreateDate(useInfo.getCreateDate() != null ? useInfo.getCreateDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime() : null);
} catch (Exception e) { } catch (Exception e) {
log.error("时区转换失败:{}", record, e); log.error("时区转换失败:{}", record, e);
......
...@@ -1522,8 +1522,8 @@ public class DataHandlerServiceImpl { ...@@ -1522,8 +1522,8 @@ public class DataHandlerServiceImpl {
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = iIdxBizJgInspectionDetectionInfoService.queryNewestDetailByRecord(record); IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = iIdxBizJgInspectionDetectionInfoService.queryNewestDetailByRecord(record);
IdxBizJgMaintenanceRecordInfo lastMaintenanceRecordInfo = maintenanceRecordInfoService.queryNewestDetailByRecord(record); IdxBizJgMaintenanceRecordInfo lastMaintenanceRecordInfo = maintenanceRecordInfoService.queryNewestDetailByRecord(record);
try { try {
esEquipmentInfo.setINSPECT_DATE(inspectionDetectionInfo.getSequenceNbr() != null ? inspectionDetectionInfo.getInspectDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null); esEquipmentInfo.setINSPECT_DATE(inspectionDetectionInfo.getSequenceNbr() != null ? inspectionDetectionInfo.getInspectDate() != null ? inspectionDetectionInfo.getInspectDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null :null);
esEquipmentInfo.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getSequenceNbr() != null ? inspectionDetectionInfo.getNextInspectDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null); esEquipmentInfo.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getSequenceNbr() != null ? inspectionDetectionInfo.getNextInspectDate() != null ? inspectionDetectionInfo.getNextInspectDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null :null);
esEquipmentInfo.setCreateDate(useInfo.getCreateDate() != null ? useInfo.getCreateDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime() : null); esEquipmentInfo.setCreateDate(useInfo.getCreateDate() != null ? useInfo.getCreateDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime() : null);
} catch (Exception e) { } catch (Exception e) {
log.error("时区转换失败:{}", record, e); log.error("时区转换失败:{}", record, e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment