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

View File

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

View File

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