This commit is contained in:
余宇波 2025-05-16 18:37:51 +08:00
parent 0ecbc73c0b
commit 6e91814080
4 changed files with 20 additions and 15 deletions

View File

@ -15,7 +15,7 @@ namespace MyCode.Project.OutSideService
/// 获取一个K3客户端
/// </summary>
/// <param name="content"></param>
K3CloudApi GetK3CloudClient();
K3CloudApi GetK3CloudClient(string yuYan = "");
/// <summary>
/// 获取供应商
@ -29,7 +29,7 @@ namespace MyCode.Project.OutSideService
/// <returns></returns>
string GetFPurchaseOrgList();
string QueryList(BillQuery queryParam);
string QueryList(BillQuery queryParam,string yuYan="");
/// <summary>
/// 保存一个订单对象

View File

@ -33,7 +33,7 @@ namespace MyCode.Project.OutSideService.Implementation
/// 获取一个K3客户端
/// </summary>
/// <returns></returns>
public K3CloudApi GetK3CloudClient()
public K3CloudApi GetK3CloudClient(string yuYan = "")
{
/***
@ -54,12 +54,13 @@ namespace MyCode.Project.OutSideService.Implementation
// 时间
"Timestamp": 30
}
}
}
ID205210333076;
*
*
* */
if (staClient == null || DateTime.Now>timeOut)
if (staClient == null || DateTime.Now>timeOut ||1==1)
{
string AppID = ConfigurationManager.AppSettings.Get("X-KDApi-AppID");
@ -67,11 +68,13 @@ namespace MyCode.Project.OutSideService.Implementation
string AcctID = ConfigurationManager.AppSettings.Get("X-KDApi-AcctID");
string AppSec = ConfigurationManager.AppSettings.Get("X-KDApi-AppSec");
string LCID = ConfigurationManager.AppSettings.Get("X-KDApi-LCID");
if (yuYan != "")
LCID = yuYan;
string ServerUrl = ConfigurationManager.AppSettings.Get("X-KDApi-ServerUrl");
staClient = new K3CloudApi(ServerUrl);
//staClient = new K3CloudApi(ServerUrl);
timeOut = DateTime.Now.AddMinutes(5);
//staClient.InitClient(AcctID, AppID, AppSec, UserName,int.Parse(LCID), "100", ServerUrl);
staClient = new K3CloudApi();
staClient.InitClient(AcctID, AppID, AppSec, UserName, int.Parse(LCID), "100", ServerUrl);
//staClient.InitClient("65edc24ab975db", "302967_20fp7YsL2kpWR9VG5Y3LSbUHzv3/SDmv", "5e38f16711514126ae1511ca4ead3232", "ERP1", 2052, "100", "http://8.138.110.197/k3cloud/");
}
return staClient;
@ -138,9 +141,9 @@ namespace MyCode.Project.OutSideService.Implementation
#endregion
public string QueryList(BillQuery queryParam)
public string QueryList(BillQuery queryParam,string yuYan="")
{
staClient = GetK3CloudClient();
staClient = GetK3CloudClient(yuYan);
//staClient.InitClient("65edc24ab975db", "302967_20fp7YsL2kpWR9VG5Y3LSbUHzv3/SDmv", "5e38f16711514126ae1511ca4ead3232", "ERP1", 2052, "100", "http://8.138.110.197/k3cloud/");
//BillQuery billQuery = new BillQuery();
//FieldKeys = "FID,FBillNo,FDate,FBILLTYPEID,FSUPPLIERID,FName,FSupplierId,FModifyDate,FPurchaserId,FMaterialId,FQty,FEntryNote,FBillAllAmount_LC",

View File

@ -33,7 +33,7 @@ namespace MyCode.Project.Services
/// 采购订单列表
/// </summary>
/// <returns></returns>
string QueryList(DateTime begin, DateTime end, string FSupplierId);
string QueryList(DateTime begin, DateTime end, string FSupplierId, string yuYan = "");
/// <summary>
/// 采购单分页列表

View File

@ -144,7 +144,7 @@ namespace MyCode.Project.Services.Implementation
/// 采购订单列表
/// </summary>
/// <returns></returns>
public string QueryList(DateTime begin, DateTime end, string FSupplierId)
public string QueryList(DateTime begin, DateTime end, string FSupplierId, string yuYan = "")
{
BillQuery queryParam = new BillQuery();
queryParam = new BillQuery()
@ -175,7 +175,7 @@ namespace MyCode.Project.Services.Implementation
//.AddFilterItem(FCancelStatusItem4)
.AddFilterItem(FCancelStatusItem2).AddFilterItem(FCancelStatusItem3);
queryParam.FilterString = filterString.GetFilterString();
var result = _kingDeeService.QueryList(queryParam);
var result = _kingDeeService.QueryList(queryParam, yuYan);
return result;
}
@ -493,14 +493,16 @@ namespace MyCode.Project.Services.Implementation
{
begin = maxDate.Value.Date;
}
string yuyan = "";
if (t.IfForeign == 1)
yuyan = "1033"; //语言ID中文2052默认英文1033繁体3076;
DateTime end = begin.AddMonths(1);
bool stop = false;
Dictionary<int, List<int>> keyValuePairs = new Dictionary<int, List<int>>();
while (end < DateTime.Now || stop == false)
{
end = begin.AddMonths(1);
var result = QueryList(begin, end, t.SupplierId);
var result = QueryList(begin, end, t.SupplierId, yuyan);
if (t.SupplierId == "9999.1")
{
LogHelper.Info(t.SupplierName + "的采购订单数据" + begin.ToString() + "-----" + end.ToString());