1
This commit is contained in:
83
Reportapi/MyCode.Project.Services/K3CloudHelp.cs
Normal file
83
Reportapi/MyCode.Project.Services/K3CloudHelp.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using Kingdee.CDP.WebApi.SDK;
|
||||
using MyCode.Project.Domain.Config;
|
||||
using MyCode.Project.Domain.Message.Response.User;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MyCode.Project.Services
|
||||
{
|
||||
public static class K3CloudHelp
|
||||
{
|
||||
private static K3CloudApi k3CloudApi;
|
||||
|
||||
public static K3CloudApi GetK3CloudApiInstance()
|
||||
{
|
||||
K3CloudOption k3CloudOption = new K3CloudOption()
|
||||
{
|
||||
AcctID = K3CloudConfig.AcctID,
|
||||
AppID = K3CloudConfig.AppID,
|
||||
AppSec = K3CloudConfig.AppSec,
|
||||
LCID = Convert.ToInt32(K3CloudConfig.LCID),
|
||||
ServerUrl = K3CloudConfig.ServerUrl,
|
||||
UserName = K3CloudConfig.UserName,
|
||||
OrgNumber = K3CloudConfig.OrgNumber
|
||||
};
|
||||
if (k3CloudApi == null)
|
||||
{
|
||||
k3CloudApi = new K3CloudApi(k3CloudOption.ServerUrl, 30);
|
||||
}
|
||||
k3CloudApi.InitClient(
|
||||
k3CloudOption.AcctID,
|
||||
k3CloudOption.AppID,
|
||||
k3CloudOption.AppSec,
|
||||
k3CloudOption.UserName,
|
||||
k3CloudOption.LCID,
|
||||
k3CloudOption.OrgNumber,
|
||||
k3CloudOption.ServerUrl
|
||||
);
|
||||
|
||||
return k3CloudApi;
|
||||
}
|
||||
|
||||
public static K3CloudApi CreateDefaultK3CloudApi()
|
||||
{
|
||||
|
||||
return k3CloudApi;
|
||||
}
|
||||
|
||||
private class K3CloudOption
|
||||
{
|
||||
/// <summary>
|
||||
/// DBID
|
||||
/// </summary>
|
||||
public string AcctID { get; set; }
|
||||
/// <summary>
|
||||
/// 应用ID
|
||||
/// </summary>
|
||||
public string AppID { get; set; }
|
||||
/// <summary>
|
||||
/// 应用密钥
|
||||
/// </summary>
|
||||
public string AppSec { get; set; }
|
||||
/// <summary>
|
||||
/// 服务器地址
|
||||
/// </summary>
|
||||
public string ServerUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 默认语言ID
|
||||
/// </summary>
|
||||
public int LCID { get; set; }
|
||||
/// <summary>
|
||||
/// 默认用户名称
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
/// <summary>
|
||||
/// 默认组织ID
|
||||
/// </summary>
|
||||
public string OrgNumber { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,9 @@
|
||||
<HintPath>..\packages\AutoMapper.6.1.1\lib\net45\AutoMapper.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.CDP.WebApi.SDK">
|
||||
<HintPath>..\Lib\Kingdee.CDP.WebApi.SDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@@ -115,28 +118,22 @@
|
||||
<Compile Include="BLL\WebSocketBLL.cs" />
|
||||
<Compile Include="Implementation\AnsyDataProcessService.cs" />
|
||||
<Compile Include="Implementation\ApiLogService.cs" />
|
||||
|
||||
<Compile Include="Implementation\PurOrderService.cs" />
|
||||
|
||||
<Compile Include="Implementation\PrdOrderService.cs" />
|
||||
|
||||
<Compile Include="Implementation\YuyuboService.cs" />
|
||||
<Compile Include="Implementation\ReportService.cs" />
|
||||
<Compile Include="Implementation\QueueProcessService.cs" />
|
||||
<Compile Include="Implementation\WebSocketService.cs" />
|
||||
<Compile Include="IServices\IAnsyDataProcessService.cs" />
|
||||
|
||||
<Compile Include="IServices\IPurOrderService.cs" />
|
||||
|
||||
|
||||
<Compile Include="IServices\IPrdOrderService.cs" />
|
||||
|
||||
<Compile Include="IServices\IYuyuboService.cs" />
|
||||
<Compile Include="IServices\IApiLogService.cs" />
|
||||
<Compile Include="IServices\IItemListService.cs" />
|
||||
<Compile Include="IServices\IQueueProcessService.cs" />
|
||||
<Compile Include="IServices\IReportService.cs" />
|
||||
<Compile Include="IServices\IWebSocketService.cs" />
|
||||
<Compile Include="K3CloudHelp.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ServiceBase.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user