This commit is contained in:
2025-07-03 20:00:21 +08:00
parent b8c92f9ee5
commit 6ffade6e6d
4 changed files with 170 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ using Kingdee.CDP.WebApi.SDK.DataEntify;
using MyCode.Project.Domain.Config;
using MyCode.Project.Domain.Message.Act.PurchaseOrder;
using MyCode.Project.Domain.Message.Request.KingDee;
using MyCode.Project.Domain.Message.Response.KingDee;
using MyCode.Project.Infrastructure.Common;
using MyCode.Project.Infrastructure.Exceptions;
using MyCode.Project.Infrastructure.WebPost;
@@ -161,7 +162,19 @@ namespace MyCode.Project.OutSideService.Implementation
{
LogHelper.Error("金蝶云接口调用失败,请检查");
LogHelper.Error(resultString);
throw new Exception("单据在云星空已锁定,请联系采购员");
string Message = "";
try
{
ErrorResponse errorResponse = JsonHelper.ToObject<ErrorResponse>(resultString);
Message = string.Join(",", errorResponse.Result.ResponseStatus.Errors.Select(t => t.Message).ToList());
}
catch (Exception ex)
{
string ds = ex.Message;
throw new Exception("2云星空接口调用失败请联系管理员,错误信息:" + resultString);
}
throw new Exception("1云星空接口调用失败请联系管理员,错误信息:" + Message);
}
//List<dynamic> result = JsonSerializer.Deserialize<List<dynamic>>(resultString);
//var total = this.GetTotal(queryParam);
@@ -187,7 +200,20 @@ namespace MyCode.Project.OutSideService.Implementation
{
LogHelper.Error("金蝶云接口调用失败,请检查");
LogHelper.Error(resultString);
throw new Exception("单据在云星空已锁定,请联系采购员");
//throw new Exception("单据在云星空已锁定,请联系采购员");
string Message = "";
try
{
ErrorResponse errorResponse = JsonHelper.ToObject<ErrorResponse>(resultString);
Message = string.Join(",", errorResponse.Result.ResponseStatus.Errors.Select(t => t.Message).ToList());
}
catch (Exception ex)
{
string ds = ex.Message;
throw new Exception("2云星空接口调用失败请联系管理员,错误信息:" + resultString);
}
throw new Exception("1云星空接口调用失败请联系管理员,错误信息:" + Message);
}
var result = JsonHelper.ToObject<Dictionary<string, Dictionary<string, dynamic>>>(resultString);
var data = result["Result"]["ResponseStatus"];
@@ -213,7 +239,19 @@ namespace MyCode.Project.OutSideService.Implementation
{
LogHelper.Error("金蝶云接口调用失败,请检查");
LogHelper.Error(resultString);
throw new Exception("单据在云星空已锁定,请联系采购员");
string Message = "";
try
{
ErrorResponse errorResponse = JsonHelper.ToObject<ErrorResponse>(resultString);
Message =string.Join(",", errorResponse.Result.ResponseStatus.Errors.Select(t => t.Message).ToList());
}
catch(Exception ex)
{
string ds = ex.Message;
throw new Exception("2云星空接口调用失败请联系管理员,错误信息:" + resultString);
}
throw new Exception("1云星空接口调用失败请联系管理员,错误信息:" + Message);
}
var result = JsonHelper.ToObject<dynamic>(resultString);
var data = result["Result"]["ResponseStatus"]["SuccessEntitys"];
@@ -264,7 +302,19 @@ namespace MyCode.Project.OutSideService.Implementation
{
LogHelper.Error("金蝶云接口调用失败,请检查");
LogHelper.Error(result["msg"]);
throw new BaseException("金蝶云接口调用失败,请检查"+ result["msg"]);
string Message = "";
try
{
ErrorResponse errorResponse = JsonHelper.ToObject<ErrorResponse>(resultString);
Message = string.Join(",", errorResponse.Result.ResponseStatus.Errors.Select(t => t.Message).ToList());
}
catch (Exception ex)
{
string ds = ex.Message;
throw new Exception("2云星空接口调用失败请联系管理员,错误信息:" + resultString);
}
throw new Exception("1云星空接口调用失败请联系管理员,错误信息:" + Message);
}
//if (resultString.Contains("ErrorCode"))
//{
@@ -306,7 +356,19 @@ namespace MyCode.Project.OutSideService.Implementation
{
LogHelper.Error("金蝶云接口调用失败,请检查");
LogHelper.Error(resultString);
throw new Exception("单据在云星空已锁定,请联系采购员");
string Message = "";
try
{
ErrorResponse errorResponse = JsonHelper.ToObject<ErrorResponse>(resultString);
Message = string.Join(",", errorResponse.Result.ResponseStatus.Errors.Select(t => t.Message).ToList());
}
catch (Exception ex)
{
string ds = ex.Message;
throw new Exception("2云星空接口调用失败请联系管理员,错误信息:" + resultString);
}
throw new Exception("1云星空接口调用失败请联系管理员,错误信息:" + Message);
}
var result = JsonHelper.ToObject<dynamic>(resultString);
var data = result["Result"]["ResponseStatus"]["SuccessEntitys"];