- 优化OA待办日志

s
This commit is contained in:
weiyunlong 2025-05-07 10:14:59 +08:00
parent d2ad38a107
commit b90b472a2e
1 changed files with 18 additions and 10 deletions

View File

@ -134,18 +134,26 @@ public class OAUtils {
* @param thirdPartyMap 第三方数据映射
*/
private static void handleResponse(JSONObject jsonObject, JSONObject pendingsBody, Map<String, Object> thirdPartyMap) {
JSONObject data = jsonObject.getJSONObject("data");
if (data == null || data.isEmpty()) {
logger.info("推送OA消息失败");
saveLog("待办:" + (thirdPartyMap.get("billno").toString()), pendingsBody, jsonObject, false);
return;
}
String operResult = data.getString("operResult");
String logMessage = Objects.equals(operResult, "1") ? "金蝶系统推送OA消息成功" : "金蝶系统推送OA消息失败";
String code = (String) jsonObject.get("code");
boolean isSuccess = false;
String logMessage = "";
if (!"0".equals(code)) {
logMessage = "推送OA消息失败";
} else {
JSONObject data = jsonObject.getJSONObject("data");
if (data == null || data.isEmpty()) {
logMessage = "推送OA消息失败";
} else {
String operResult = data.getString("operResult");
isSuccess = "1".equals(operResult);
logMessage = isSuccess ? "推送OA消息成功" : "推送OA消息失败";
}
}
// 记录日志
logger.info(logMessage);
saveLog("待办:" + (thirdPartyMap.get("billno").toString()), pendingsBody, jsonObject, true);
saveLog("待办:" + thirdPartyMap.get("billno").toString(), pendingsBody, jsonObject, isSuccess);
}
/**