This commit is contained in:
2025-09-01 13:58:20 +08:00
parent c7b9a44f8c
commit 465a5c91bf
7 changed files with 141 additions and 27 deletions

Binary file not shown.

View File

@@ -0,0 +1,23 @@
using MyCode.Project.Infrastructure.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyCode.Project.Domain.Config
{
/// <summary>
/// 金蝶云星空配置类
/// </summary>
public static class K3CloudConfig
{
public static string AcctID = WebConfigUtils.GetConnectionStringsInfo("AcctID");
public static string AppID = WebConfigUtils.GetConnectionStringsInfo("AppID");
public static string AppSec = WebConfigUtils.GetConnectionStringsInfo("AppSec");
public static string UserName = WebConfigUtils.GetConnectionStringsInfo("UserName");
public static string LCID = WebConfigUtils.GetConnectionStringsInfo("LCID");
public static string ServerUrl = WebConfigUtils.GetConnectionStringsInfo("ServerUrl");
public static string OrgNumber = WebConfigUtils.GetConnectionStringsInfo("OrgNumber");
}
}

View File

@@ -54,6 +54,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config\K3CloudConfig.cs" />
<Compile Include="Config\SystemConfig.cs" />
<Compile Include="Message\Act\Common\AnsyReportExportAct.cs" />
<Compile Include="Message\Act\Common\ChangeStatusAct.cs" />

View 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; }
}
}
}

View File

@@ -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>

View File

@@ -62,10 +62,19 @@
<!--服务器文件保存的路径这里调度用如果是webapi则不需要用这个-->
<add key="AppFilePath" value="D:\publish\LxmReportApi\api\App_File\" />
<!--<add key="AppFilePath" value="D:\App_File\" />-->
<add key="WebSocketUrl" value="ws://127.0.0.1:9798/" />
<!--以下是金蝶云星空配置文件-->
<add key="AcctID" value="68747e79734bbe" />
<add key="AppID" value="318675_R/0v2dFFVPD5RX1GT3XA1x0NUK7dRCsO" />
<add key="AppSec" value="61acac6135b34edf860046020e1fce8f" />
<add key="UserName" value="demo" />
<add key="LCID" value="2052" />
<add key="ServerUrl" value="http://desktop-d5fd5hr/K3Cloud" />
<add key="OrgNumber" value="100" />
</appSettings>
<!--
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。

View File

@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.33027.164
# Visual Studio Version 17
VisualStudioVersion = 17.14.36414.22 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Designs", "Designs", "{7DA7AF38-10EF-4157-B270-511E3A58DF6E}"
ProjectSection(SolutionItems) = preProject
@@ -33,6 +33,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lib", "Lib", "{EC2A682C-494
Lib\C5.dll = Lib\C5.dll
Lib\Common.Logging.dll = Lib\Common.Logging.dll
Lib\HtmlAgilityPack.dll = Lib\HtmlAgilityPack.dll
C:\Users\13243\Downloads\Compressed\SDK_.Net4_V9.2.0\.net4.0_sdk_v9.2.0\Kingdee.CDP.WebApi.SDK.Net4.0.V9.2.0\Kingdee.CDP.WebApi.SDK.dll = C:\Users\13243\Downloads\Compressed\SDK_.Net4_V9.2.0\.net4.0_sdk_v9.2.0\Kingdee.CDP.WebApi.SDK.Net4.0.V9.2.0\Kingdee.CDP.WebApi.SDK.dll
Lib\log4net.dll = Lib\log4net.dll
Lib\log4net.xml = Lib\log4net.xml
MyCode.Project.WebApi\bin\Microsoft.Owin.dll = MyCode.Project.WebApi\bin\Microsoft.Owin.dll
@@ -278,8 +279,8 @@ Global
{B0B592F9-E0B5-41B7-8908-036021468D87} = {8D2B010E-7C91-4375-B93D-511ADE541A2B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35;packages\Unity.Interception.2.1.505.0\lib\NET35;packages\EnterpriseLibrary.Common.5.0.505.0\lib\NET35;packages\EnterpriseLibrary.Caching.5.0.505.0\lib\NET35
EnterpriseLibraryConfigurationToolBinariesPathV6 = packages\EnterpriseLibrary.Common.6.0.1304.0\lib\NET45
SolutionGuid = {22616349-AE54-419A-A4A5-7503567F2279}
EnterpriseLibraryConfigurationToolBinariesPathV6 = packages\EnterpriseLibrary.Common.6.0.1304.0\lib\NET45
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35;packages\Unity.Interception.2.1.505.0\lib\NET35;packages\EnterpriseLibrary.Common.5.0.505.0\lib\NET35;packages\EnterpriseLibrary.Caching.5.0.505.0\lib\NET35
EndGlobalSection
EndGlobal