From 6e9181408092a06b648d0dfdfac4404824e73eec Mon Sep 17 00:00:00 2001
From: yuyubo <1870149533@qq.com>
Date: Fri, 16 May 2025 18:37:51 +0800
Subject: [PATCH] 222
---
.../IKingDeeService.cs | 4 ++--
.../Implementation/KingDeeService.cs | 19 +++++++++++--------
.../IServices/IPurchaseOrderService.cs | 2 +-
.../PurchaseOrder/PurchaseOrderService.cs | 10 ++++++----
4 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/MyCode.Project.OutSideService/IKingDeeService.cs b/MyCode.Project.OutSideService/IKingDeeService.cs
index 5893087..9cfec47 100644
--- a/MyCode.Project.OutSideService/IKingDeeService.cs
+++ b/MyCode.Project.OutSideService/IKingDeeService.cs
@@ -15,7 +15,7 @@ namespace MyCode.Project.OutSideService
/// 获取一个K3客户端
///
///
- K3CloudApi GetK3CloudClient();
+ K3CloudApi GetK3CloudClient(string yuYan = "");
///
/// 获取供应商
@@ -29,7 +29,7 @@ namespace MyCode.Project.OutSideService
///
string GetFPurchaseOrgList();
- string QueryList(BillQuery queryParam);
+ string QueryList(BillQuery queryParam,string yuYan="");
///
/// 保存一个订单对象
diff --git a/MyCode.Project.OutSideService/Implementation/KingDeeService.cs b/MyCode.Project.OutSideService/Implementation/KingDeeService.cs
index 5a85c9f..d5c6962 100644
--- a/MyCode.Project.OutSideService/Implementation/KingDeeService.cs
+++ b/MyCode.Project.OutSideService/Implementation/KingDeeService.cs
@@ -33,7 +33,7 @@ namespace MyCode.Project.OutSideService.Implementation
/// 获取一个K3客户端
///
///
- public K3CloudApi GetK3CloudClient()
+ public K3CloudApi GetK3CloudClient(string yuYan = "")
{
/***
@@ -54,12 +54,13 @@ namespace MyCode.Project.OutSideService.Implementation
// 时间
"Timestamp": 30
}
-}
+}
+ 语言ID,中文2052(默认),英文1033,繁体3076;
*
*
* */
- 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",
diff --git a/MyCode.Project.Services/IServices/IPurchaseOrderService.cs b/MyCode.Project.Services/IServices/IPurchaseOrderService.cs
index fb5521a..154b2ff 100644
--- a/MyCode.Project.Services/IServices/IPurchaseOrderService.cs
+++ b/MyCode.Project.Services/IServices/IPurchaseOrderService.cs
@@ -33,7 +33,7 @@ namespace MyCode.Project.Services
/// 采购订单列表
///
///
- string QueryList(DateTime begin, DateTime end, string FSupplierId);
+ string QueryList(DateTime begin, DateTime end, string FSupplierId, string yuYan = "");
///
/// 采购单分页列表
diff --git a/MyCode.Project.Services/Implementation/PurchaseOrder/PurchaseOrderService.cs b/MyCode.Project.Services/Implementation/PurchaseOrder/PurchaseOrderService.cs
index ec11ae9..0737ddd 100644
--- a/MyCode.Project.Services/Implementation/PurchaseOrder/PurchaseOrderService.cs
+++ b/MyCode.Project.Services/Implementation/PurchaseOrder/PurchaseOrderService.cs
@@ -144,7 +144,7 @@ namespace MyCode.Project.Services.Implementation
/// 采购订单列表
///
///
- 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> keyValuePairs = new Dictionary>();
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());