refactor(ai-analytic-center-biz): 优化 ClaimVerificationServiceImpl 中的 getJsonObjectToNewBie 方法
- 重新调整了 JSON 对象的处理逻辑,提高了代码的可读性和维护性 -移除了不必要的字符串转义和解析操作,简化了数据处理流程- 优化了变量命名,提高了代码的可理解性
This commit is contained in:
@@ -245,16 +245,15 @@ public class ClaimVerificationServiceImpl implements ClaimVerificationService {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static JSONObject getJsonObjectToNewBie(JSONObject diFyObject, ClaimVerificationFileDTO claimVerificationFileAnalysisDTO, String aiAnalysisRequestId) {
|
private static JSONObject getJsonObjectToNewBie(JSONObject diFyObject, ClaimVerificationFileDTO claimVerificationFileAnalysisDTO, String aiAnalysisRequestId) {
|
||||||
if (diFyObject.containsKey("answer") && !diFyObject.getJSONObject("answer").isEmpty()) {
|
JSONObject warrantyAuditReport = diFyObject.getJSONObject("warrantyAuditReport");
|
||||||
diFyObject = diFyObject.getJSONObject("answer");
|
if (warrantyAuditReport.containsKey("answer") && !warrantyAuditReport.getJSONObject("answer").isEmpty()) {
|
||||||
|
warrantyAuditReport = warrantyAuditReport.getJSONObject("answer");
|
||||||
}
|
}
|
||||||
String warrantyAuditReport = diFyObject.getString("warrantyAuditReport");
|
|
||||||
warrantyAuditReport = StringEscapeUtils.unescapeJava(warrantyAuditReport);
|
|
||||||
JSONObject audiResToAfter = JSON.parseObject(warrantyAuditReport);
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("newBieAfterSalesId", claimVerificationFileAnalysisDTO.getNewBieAfterSalesId());
|
data.put("newBieAfterSalesId", claimVerificationFileAnalysisDTO.getNewBieAfterSalesId());
|
||||||
data.put("businessType", claimVerificationFileAnalysisDTO.getBusinessType());
|
data.put("businessType", claimVerificationFileAnalysisDTO.getBusinessType());
|
||||||
data.put("warrantyAuditReport", audiResToAfter);
|
data.put("warrantyAuditReport", warrantyAuditReport);
|
||||||
data.put("aiAnalysisRequestId", aiAnalysisRequestId);
|
data.put("aiAnalysisRequestId", aiAnalysisRequestId);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user