处理空值

This commit is contained in:
jie.lu
2025-08-15 14:07:26 +08:00
parent 9d2ae2d599
commit f34ac3c9ee

View File

@@ -315,7 +315,7 @@ public class ClaimVerificationServiceImpl implements ClaimVerificationService {
private String getPartHoursList(JSONObject warrantyJson) {
if (warrantyJson == null || !warrantyJson.containsKey("warrantyReport")) {
return null;
return " ";
}
// 获取warrantyReport对象
@@ -323,11 +323,11 @@ public class ClaimVerificationServiceImpl implements ClaimVerificationService {
// 检查partItems是否存在且是数组
if (!warrantyReport.containsKey("partItems")) {
return null;
return " ";
} else {
Object value = warrantyReport.get("partItems");
if (!(value instanceof JSONArray)) {
return null;
return " ";
}
}
@@ -345,11 +345,11 @@ public class ClaimVerificationServiceImpl implements ClaimVerificationService {
}
}
if (partNoList.isEmpty()) {
return null;
return " ";
}
List<ClaimVerificationPartHoursDTO> result = tmClaimVerificationPartHoursMappingMapper.queryConfigByPartId(partNoList);
if (result.isEmpty()) {
return null;
return " ";
}
return JSONObject.toJSONString(result);
}