搭建基础接口,新增采购入库单、采购订单接口
This commit is contained in:
@@ -209,12 +209,26 @@ namespace Gatedge.K3Cloud.Utils
|
||||
var jsonData = viewBill.ToString();
|
||||
var resultString = _cloudApi.View(formId, jsonData);
|
||||
var result = JsonSerializer.Deserialize<KingdeeResult>(resultString);
|
||||
if (result?.Result?.ResponseStatus?.IsSuccess != true)
|
||||
// SB云星空 v7和v8的响应信息格式不同,导致无法使用统一的处理方式
|
||||
if (viewBill.Version >= 8)
|
||||
{
|
||||
var responseStatus = result?.Result?.ResponseStatus;
|
||||
Exception error = new K3CloudException("查看单据出错", responseStatus);
|
||||
throw error;
|
||||
if (result?.Result?.ResponseStatus?.IsSuccess != true)
|
||||
{
|
||||
var responseStatus = result?.Result?.ResponseStatus;
|
||||
Exception error = new K3CloudException("查看单据出错", responseStatus);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (result?.Result?.ResponseStatus != null)
|
||||
{
|
||||
var responseStatus = result?.Result?.ResponseStatus;
|
||||
Exception error = new K3CloudException("查看单据出错", responseStatus);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
var data = result?.Result?.Result;
|
||||
return data;
|
||||
}
|
||||
@@ -231,11 +245,23 @@ namespace Gatedge.K3Cloud.Utils
|
||||
var jsonData = viewBill.ToString();
|
||||
var resultString = _cloudApi.View(formId, jsonData);
|
||||
var result = JsonSerializer.Deserialize<KingdeeResult>(resultString);
|
||||
if (result?.Result?.ResponseStatus?.IsSuccess != true)
|
||||
if (viewBill.Version >= 8)
|
||||
{
|
||||
var responseStatus = result?.Result?.ResponseStatus;
|
||||
Exception error = new K3CloudException("查看单据出错", responseStatus);
|
||||
throw error;
|
||||
if (result?.Result?.ResponseStatus?.IsSuccess != true)
|
||||
{
|
||||
var responseStatus = result?.Result?.ResponseStatus;
|
||||
Exception error = new K3CloudException("查看单据出错", responseStatus);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (result?.Result?.ResponseStatus != null)
|
||||
{
|
||||
var responseStatus = result?.Result?.ResponseStatus;
|
||||
Exception error = new K3CloudException("查看单据出错", responseStatus);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
var data = result?.Result?.Result;
|
||||
var dataString = JsonSerializer.Serialize(data);
|
||||
|
||||
13
Gatedge.K3Cloud.Utils/Model/K3Request/BaseRequest.cs
Normal file
13
Gatedge.K3Cloud.Utils/Model/K3Request/BaseRequest.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Gatedge.K3Cloud.Utils.Model.K3Request
|
||||
{
|
||||
public class BaseRequest
|
||||
{
|
||||
public int Version { get; set; } = 7;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace Gatedge.K3Cloud.Utils.Model.K3Request
|
||||
/// <summary>
|
||||
/// 单据查询条件类
|
||||
/// </summary>
|
||||
public class View
|
||||
public class View : BaseRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 单据内码
|
||||
@@ -22,12 +22,6 @@ namespace Gatedge.K3Cloud.Utils.Model.K3Request
|
||||
/// 单据编码
|
||||
/// </summary>
|
||||
public string? Number { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单据体是否按序号排序
|
||||
/// </summary>
|
||||
public bool IsSortBySeq { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 重写ToString方法
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user