初始化仓库
This commit is contained in:
407
.gitignore
vendored
Normal file
407
.gitignore
vendored
Normal file
@@ -0,0 +1,407 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.tlog
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
|
||||
*.vbp
|
||||
|
||||
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
|
||||
*.dsw
|
||||
*.dsp
|
||||
|
||||
# Visual Studio 6 technical files
|
||||
*.ncb
|
||||
*.aps
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# Visual Studio History (VSHistory) files
|
||||
.vshistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
|
||||
# VS Code files for those working on multiple tools
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
# Windows Installer files from build outputs
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# JetBrains Rider
|
||||
*.sln.iml
|
||||
.idea/
|
||||
|
||||
# Log files
|
||||
log/
|
||||
*.log
|
||||
|
||||
# Application specific
|
||||
appsettings.Development.json
|
||||
appsettings.Local.json
|
||||
25
SHK3CloudWebAPI.sln
Normal file
25
SHK3CloudWebAPI.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35327.3
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SHK3CloudWebAPI", "SHK3CloudWebAPI\SHK3CloudWebAPI.csproj", "{DC5DCF4E-9E67-4497-9CB5-03C627B3DAD7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DC5DCF4E-9E67-4497-9CB5-03C627B3DAD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DC5DCF4E-9E67-4497-9CB5-03C627B3DAD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DC5DCF4E-9E67-4497-9CB5-03C627B3DAD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DC5DCF4E-9E67-4497-9CB5-03C627B3DAD7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {1C3FCF6F-D360-4801-B597-5197D81B8C33}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
13
SHK3CloudWebAPI/.config/dotnet-tools.json
Normal file
13
SHK3CloudWebAPI/.config/dotnet-tools.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "9.0.0",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
],
|
||||
"rollForward": false
|
||||
}
|
||||
}
|
||||
}
|
||||
14
SHK3CloudWebAPI/Common/ApiVersions.cs
Normal file
14
SHK3CloudWebAPI/Common/ApiVersions.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace SHK3CloudWebAPI
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum ApiVersions
|
||||
{
|
||||
/// <summary>
|
||||
/// 接口
|
||||
/// </summary>
|
||||
接口=0,
|
||||
|
||||
}
|
||||
}
|
||||
60
SHK3CloudWebAPI/Common/CommonHelper.cs
Normal file
60
SHK3CloudWebAPI/Common/CommonHelper.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SHK3CloudWebAPI.Common
|
||||
{
|
||||
public class CommonHelper
|
||||
{
|
||||
public static string SerializeToXml<T>(T obj)
|
||||
{
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(T));
|
||||
using (StringWriter textWriter = new StringWriter())
|
||||
{
|
||||
serializer.Serialize(textWriter, obj);
|
||||
return textWriter.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static T DeserializeFromXml<T>(string xml)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(xml))
|
||||
{
|
||||
throw new ArgumentException("XML内容为空,无法反序列化", nameof(xml));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(T));
|
||||
using (StringReader reader = new StringReader(xml))
|
||||
{
|
||||
return (T)serializer.Deserialize(reader);
|
||||
}
|
||||
}
|
||||
catch (InvalidOperationException ex) when (ex.InnerException is System.Xml.XmlException)
|
||||
{
|
||||
// XML格式错误
|
||||
throw new FormatException("XML格式不正确,无法反序列化为 " + typeof(T).Name, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static string OigNumber(string HQID)
|
||||
{
|
||||
//1318586 205 新中冠智能科技股份有限公司
|
||||
//1945324 203 深圳市高飞易科技有限公司
|
||||
//3415228 202 厦门鑫亚宝宇信息技术有限公司
|
||||
//693465 201 北京方正易通科技有限公司
|
||||
//3860141 204 深圳市金文网络科技有限公司
|
||||
//3311308 103 皓诺
|
||||
|
||||
string oidnumber = "";
|
||||
|
||||
switch (HQID)
|
||||
{
|
||||
case "3311308":
|
||||
oidnumber = "103";
|
||||
break;
|
||||
}
|
||||
return oidnumber;
|
||||
}
|
||||
}
|
||||
}
|
||||
272
SHK3CloudWebAPI/Common/InvokeHelper.cs
Normal file
272
SHK3CloudWebAPI/Common/InvokeHelper.cs
Normal file
@@ -0,0 +1,272 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RestSharp;
|
||||
|
||||
namespace SHK3CloudWebAPI
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class InvokeHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// url
|
||||
/// </summary>
|
||||
public string _CloudUrl;
|
||||
/// <summary>
|
||||
/// 帐套标识
|
||||
/// </summary>
|
||||
public string _KDType;
|
||||
/// <summary>
|
||||
/// 用户
|
||||
/// </summary>
|
||||
public string _KDUser;
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
public string _KDPwd;
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public InvokeHelper()
|
||||
{
|
||||
|
||||
// 创建配置构建器
|
||||
var configurationBuilder = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
|
||||
|
||||
// 构建配置
|
||||
var configuration = configurationBuilder.Build();
|
||||
|
||||
// 读取配置参数
|
||||
_CloudUrl = configuration["AppSettings:CloudUrl"].ToString();
|
||||
_KDType = configuration.GetValue<string>("AppSettings:KDType").ToString();
|
||||
_KDUser = configuration.GetValue<string>("AppSettings:KDUser").ToString();
|
||||
_KDPwd = configuration.GetValue<string>("AppSettings:KDPwd").ToString();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 登录验证
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Login()
|
||||
{
|
||||
var httpClient = new RestClient(_CloudUrl);
|
||||
|
||||
var request = new RestRequest("Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc", Method.Post);
|
||||
|
||||
request.AddHeader("Accept", "*/*");
|
||||
request.AddHeader("Accept-Encoding", "gzip, deflate, br");
|
||||
request.AddHeader("User-Agent", "PostmanRuntime-ApipostRuntime/1.1.0");
|
||||
request.AddHeader("Connection", "keep-alive");
|
||||
request.AddHeader("Content-Type", "application/json");
|
||||
|
||||
loginParameter loginData = new loginParameter();
|
||||
loginData.acctID = _KDType;
|
||||
loginData.username = _KDUser;
|
||||
loginData.password = _KDPwd;
|
||||
loginData.lcid = "2052";
|
||||
|
||||
var login = JsonConvert.SerializeObject(loginData);
|
||||
|
||||
request.AddParameter("application/json", login, ParameterType.RequestBody);
|
||||
|
||||
var response = httpClient.Execute(request);
|
||||
|
||||
return response.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="formId">单据标识</param>
|
||||
/// <param name="content">JSON</param>
|
||||
/// <param name="cookie">登录的kdservice-sessionid</param>
|
||||
/// <returns></returns>
|
||||
public string Save(string formId, string content, string cookie)
|
||||
{
|
||||
var httpClient = new RestClient(_CloudUrl);
|
||||
|
||||
var request = new RestRequest("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc", Method.Post);
|
||||
|
||||
request.AddHeader("Accept", "*/*");
|
||||
request.AddHeader("Accept-Encoding", "gzip, deflate, br");
|
||||
request.AddHeader("User-Agent", "PostmanRuntime-ApipostRuntime/1.1.0");
|
||||
request.AddHeader("Connection", "keep-alive");
|
||||
request.AddHeader("Content-Type", "application/json");
|
||||
request.AddHeader("Cookie", string.Format("kdservice-sessionid={0}", cookie));
|
||||
|
||||
List<object> Parameters = new List<object>();
|
||||
//业务对象Id
|
||||
Parameters.Add(formId);
|
||||
//Json字串
|
||||
Parameters.Add(content);
|
||||
|
||||
var push = JsonConvert.SerializeObject(Parameters);
|
||||
|
||||
JObject jsonRoot = new JObject();
|
||||
jsonRoot.Add("parameters", push);
|
||||
|
||||
request.AddParameter("application/json", jsonRoot.ToString(), ParameterType.RequestBody);
|
||||
|
||||
var response = httpClient.Execute(request);
|
||||
|
||||
return response.Content;
|
||||
}
|
||||
/// <summary>
|
||||
/// 整单关闭
|
||||
/// </summary>
|
||||
/// <param name="formId">单据标识</param>
|
||||
/// <param name="content">JSON</param>
|
||||
/// <param name="cookie">登录的kdservice-sessionid</param>
|
||||
/// <returns></returns>
|
||||
public string BillClose(string formId, string content, string cookie)
|
||||
{
|
||||
var httpClient = new RestClient(_CloudUrl);
|
||||
|
||||
var request = new RestRequest("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExcuteOperation.common.kdsvc", Method.Post);
|
||||
|
||||
request.AddHeader("Accept", "*/*");
|
||||
request.AddHeader("Accept-Encoding", "gzip, deflate, br");
|
||||
request.AddHeader("User-Agent", "PostmanRuntime-ApipostRuntime/1.1.0");
|
||||
request.AddHeader("Connection", "keep-alive");
|
||||
request.AddHeader("Content-Type", "application/json");
|
||||
request.AddHeader("Cookie", string.Format("kdservice-sessionid={0}", cookie));
|
||||
|
||||
List<object> Parameters = new List<object>();
|
||||
//业务对象Id
|
||||
Parameters.Add(formId);
|
||||
//业务操作 整单关闭
|
||||
Parameters.Add("BillClose");
|
||||
//Json字串
|
||||
Parameters.Add(content);
|
||||
|
||||
var push = JsonConvert.SerializeObject(Parameters);
|
||||
|
||||
JObject jsonRoot = new JObject();
|
||||
jsonRoot.Add("parameters", push);
|
||||
|
||||
request.AddParameter("application/json", jsonRoot.ToString(), ParameterType.RequestBody);
|
||||
|
||||
var response = httpClient.Execute(request);
|
||||
|
||||
return response.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 列表查询JSON
|
||||
/// </summary>
|
||||
/// <param name="content"></param>
|
||||
/// <param name="cookie"></param>
|
||||
/// <returns></returns>
|
||||
public string BillQuery(string content, string cookie)
|
||||
{
|
||||
|
||||
var httpClient = new RestClient(_CloudUrl);
|
||||
|
||||
var request = new RestRequest("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc", Method.Post);
|
||||
|
||||
request.AddHeader("Accept", "*/*");
|
||||
request.AddHeader("Accept-Encoding", "gzip, deflate, br");
|
||||
request.AddHeader("User-Agent", "PostmanRuntime-ApipostRuntime/1.1.0");
|
||||
request.AddHeader("Connection", "keep-alive");
|
||||
request.AddHeader("Content-Type", "application/json");
|
||||
request.AddHeader("Cookie", string.Format("kdservice-sessionid={0}", cookie));
|
||||
|
||||
List<object> Parameters = new List<object>();
|
||||
//Json字串
|
||||
Parameters.Add(content);
|
||||
|
||||
var billQuery = JsonConvert.SerializeObject(Parameters);
|
||||
|
||||
JObject jsonRoot = new JObject();
|
||||
jsonRoot.Add("parameters", billQuery);
|
||||
|
||||
request.AddParameter("application/json", jsonRoot.ToString(), ParameterType.RequestBody);
|
||||
|
||||
var response = httpClient.Execute(request);
|
||||
|
||||
return response.Content;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 列表查询
|
||||
/// </summary>
|
||||
/// <param name="content"></param>
|
||||
/// /// <param name="cookie"></param>
|
||||
/// <returns></returns>
|
||||
public string ExecuteBillQuery(string content, string cookie)
|
||||
{
|
||||
var httpClient = new RestClient(_CloudUrl);
|
||||
|
||||
var request = new RestRequest("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc", Method.Post);
|
||||
|
||||
|
||||
request.AddHeader("Accept", "*/*");
|
||||
request.AddHeader("Accept-Encoding", "gzip, deflate, br");
|
||||
request.AddHeader("User-Agent", "PostmanRuntime-ApipostRuntime/1.1.0");
|
||||
request.AddHeader("Connection", "keep-alive");
|
||||
request.AddHeader("Content-Type", "application/json");
|
||||
request.AddHeader("Cookie", string.Format("kdservice-sessionid={0}", cookie));
|
||||
|
||||
List<object> Parameters = new List<object>();
|
||||
//Json字串
|
||||
Parameters.Add(content);
|
||||
|
||||
|
||||
var billQuery = JsonConvert.SerializeObject(Parameters);
|
||||
JObject jsonRoot = new JObject();
|
||||
jsonRoot.Add("parameters", billQuery);
|
||||
|
||||
request.AddParameter("application/json", jsonRoot.ToString(), ParameterType.RequestBody);
|
||||
|
||||
var response = httpClient.Execute(request);
|
||||
|
||||
return response.Content;
|
||||
}
|
||||
/// <summary>
|
||||
///单据操作
|
||||
/// </summary>
|
||||
/// <param name="formId">单据标识</param>
|
||||
/// <param name="content">JSON</param> "BillClose"
|
||||
/// <param name="cookie">登录的kdservice-sessionid</param>
|
||||
/// <returns></returns>
|
||||
public string BillOperation(string formId, string content, string cookie, string strOperation)
|
||||
{
|
||||
var httpClient = new RestClient(_CloudUrl);
|
||||
|
||||
var request = new RestRequest("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExcuteOperation.common.kdsvc", Method.Post);
|
||||
|
||||
request.AddHeader("Accept", "*/*");
|
||||
request.AddHeader("Accept-Encoding", "gzip, deflate, br");
|
||||
request.AddHeader("User-Agent", "PostmanRuntime-ApipostRuntime/1.1.0");
|
||||
request.AddHeader("Connection", "keep-alive");
|
||||
request.AddHeader("Content-Type", "application/json");
|
||||
request.AddHeader("Cookie", string.Format("kdservice-sessionid={0}", cookie));
|
||||
|
||||
List<object> Parameters = new List<object>();
|
||||
//业务对象Id
|
||||
Parameters.Add(formId);
|
||||
//业务操作 整单关闭
|
||||
Parameters.Add(strOperation);
|
||||
//Json字串
|
||||
Parameters.Add(content);
|
||||
|
||||
var push = JsonConvert.SerializeObject(Parameters);
|
||||
|
||||
JObject jsonRoot = new JObject();
|
||||
jsonRoot.Add("parameters", push);
|
||||
|
||||
request.AddParameter("application/json", jsonRoot.ToString(), ParameterType.RequestBody);
|
||||
|
||||
var response = httpClient.Execute(request);
|
||||
|
||||
return response.Content;
|
||||
}
|
||||
}
|
||||
}
|
||||
88
SHK3CloudWebAPI/Common/RequestLoggingMiddleware.cs
Normal file
88
SHK3CloudWebAPI/Common/RequestLoggingMiddleware.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SHK3CloudWebAPI.Common
|
||||
{
|
||||
public class RequestLoggingMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
|
||||
public RequestLoggingMiddleware(RequestDelegate next)
|
||||
{
|
||||
_next = next;
|
||||
}
|
||||
|
||||
public async Task InvokeAsync(HttpContext context)
|
||||
{
|
||||
// 获取请求信息
|
||||
var method = context.Request.Method;
|
||||
var path = context.Request.Path;
|
||||
var query = context.Request.QueryString.ToString();
|
||||
var ipAddress = context.Connection.RemoteIpAddress?.ToString();
|
||||
|
||||
// 获取 AppKey 和 AppSecret(如果存在)
|
||||
context.Request.Headers.TryGetValue("AppKey", out var appKey);
|
||||
context.Request.Headers.TryGetValue("AppSecret", out var appSecret);
|
||||
|
||||
// 读取请求体
|
||||
var originalBodyStream = context.Request.Body;
|
||||
using (var memoryStream = new MemoryStream())
|
||||
{
|
||||
await originalBodyStream.CopyToAsync(memoryStream);
|
||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
var body = await new StreamReader(memoryStream).ReadToEndAsync();
|
||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||
context.Request.Body = memoryStream;
|
||||
|
||||
var originalResponseBodyStream = context.Response.Body;
|
||||
using (var responseBodyStream = new MemoryStream())
|
||||
{
|
||||
context.Response.Body = responseBodyStream;
|
||||
|
||||
await _next(context);
|
||||
|
||||
responseBodyStream.Seek(0, SeekOrigin.Begin);
|
||||
var responseBody = await new StreamReader(responseBodyStream).ReadToEndAsync();
|
||||
responseBodyStream.Seek(0, SeekOrigin.Begin);
|
||||
await responseBodyStream.CopyToAsync(originalResponseBodyStream);
|
||||
|
||||
// 日志记录路径
|
||||
var currentDate = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
var folderPath = Path.Combine("C:\\log", currentDate);
|
||||
if (!Directory.Exists(folderPath))
|
||||
{
|
||||
Directory.CreateDirectory(folderPath);
|
||||
}
|
||||
|
||||
var filePath = Path.Combine(folderPath, $"{currentDate}.txt");
|
||||
|
||||
// 构建日志内容
|
||||
var logMessage = new StringBuilder();
|
||||
logMessage.AppendLine($"Timestamp: {DateTime.Now:yyyy-MM-dd HH:mm:ss}");
|
||||
logMessage.AppendLine($"IP Address: {ipAddress}");
|
||||
logMessage.AppendLine($"Method: {method}");
|
||||
logMessage.AppendLine($"Path: {path}");
|
||||
logMessage.AppendLine($"QueryString: {query}");
|
||||
logMessage.AppendLine($"AppKey: {appKey}");
|
||||
logMessage.AppendLine($"AppSecret: {appSecret}");
|
||||
|
||||
logMessage.AppendLine("Headers:");
|
||||
foreach (var header in context.Request.Headers)
|
||||
{
|
||||
logMessage.AppendLine($"{header.Key}: {header.Value}");
|
||||
}
|
||||
|
||||
logMessage.AppendLine($"Request Body: {body}");
|
||||
logMessage.AppendLine($"Response Body: {responseBody}");
|
||||
logMessage.AppendLine(new string('-', 80));
|
||||
|
||||
await File.AppendAllTextAsync(filePath, logMessage.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
111
SHK3CloudWebAPI/Common/WarehouseMapper.cs
Normal file
111
SHK3CloudWebAPI/Common/WarehouseMapper.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SHK3CloudWebAPI
|
||||
{
|
||||
public static class WarehouseMapper
|
||||
{
|
||||
// 定义一个字典存储 whCode 和 FNumber 的映射关系
|
||||
//2025年修改,原本是 12234-XMBT01 有对应关系 后来移除掉了 太多地方引用过,所以直接修改了映射关系
|
||||
private static readonly Dictionary<string, string> whCodeToFNumberMap = new Dictionary<string, string>
|
||||
{
|
||||
{ "3655708-XMBT01", "XMBT01" },
|
||||
{ "3655708-XMBT02", "XMBT02" },
|
||||
{ "3655708-XMBT03", "XMBT03" },
|
||||
{ "3655708-XMBT04", "XMBT04" },
|
||||
{ "3655708-XMBT05", "XMBT05" },
|
||||
{ "3655708-XMBT06", "XMBT06" },
|
||||
{ "3655708-XMBT07", "XMBT07" },
|
||||
{ "3655708-XMBT08", "XMBT08" },
|
||||
{ "3655708-XMBT09", "XMBT09" },
|
||||
{ "3655708-XMBT10", "XMBT10" },
|
||||
{ "3655708-XMBT11", "XMBT11" },
|
||||
{ "3655708-XMBT12", "XMBT12" },
|
||||
{ "3655708-XMBT13", "XMBT13" },
|
||||
{ "3655708-XMBT14", "XMBT14" },
|
||||
{ "3655708-XMBT15", "XMBT15" },
|
||||
{ "3655708-XMBT16", "XMBT16" },
|
||||
{ "3655708-XMBT17", "XMBT17" },
|
||||
{ "3655708-XMBT18", "XMBT18" },
|
||||
{ "3655708-XMBT19", "XMBT19" },
|
||||
{ "3655708-XMBT20", "XMBT20" },
|
||||
{ "3655708-XMBT21", "XMBT21" },
|
||||
{ "3655708-XMBT22", "XMBT22" },
|
||||
{ "3655708-XMBT23", "XMBT23" },
|
||||
{ "3655708-XMBT24", "XMBT24" },
|
||||
{ "3655708-XMBT25", "XMBT25" },
|
||||
{ "3655708-XMBT26", "XMBT26" },
|
||||
{ "3655708-XMBT27", "XMBT27" },
|
||||
{ "3655708-XMBT28", "XMBT28" },
|
||||
{ "3655708-XMBT29", "XMBT29" },
|
||||
{ "3655708-XMBT30", "XMBT30" },
|
||||
{ "3655708-XMBT31", "XMBT31" },
|
||||
{ "3655708-XMBT32", "XMBT32" },
|
||||
{ "3655708-XMBT33", "XMBT33" },
|
||||
{ "3655708-XMBT34", "XMBT34" },
|
||||
{ "3655708-XMBT35", "XMBT35" },
|
||||
{ "3655708-XMBT36", "XMBT36" },
|
||||
{ "3655708-XMBT37", "XMBT37" },
|
||||
{ "3655708-XMBT38", "XMBT38" },
|
||||
{ "3655708-XMBT39", "XMBT39" },
|
||||
{ "3655708-XMBT40", "XMBT40" },
|
||||
{ "3655708-XMBT41", "XMBT41" },
|
||||
{ "3655708-XMBT42", "XMBT42" },
|
||||
{ "3655708-XMBT43", "XMBT43" },
|
||||
{ "3655708-XMBT44", "XMBT44" },
|
||||
{ "3655708-XMBT45", "XMBT45" },
|
||||
{ "3655708-XMBT46", "XMBT46" },
|
||||
{ "3655708-XMBT47", "XMBT47" },
|
||||
{ "3655708-XMBT48", "XMBT48" },
|
||||
{ "3655708-XMBT49", "XMBT49" },
|
||||
{ "3655708-XMBT50", "XMBT50" },
|
||||
{ "3655708-XMBT51", "XMBT51" },
|
||||
{ "3655708-XMBT52", "XMBT52" },
|
||||
{ "3655708-XMBT53", "XMBT53" },
|
||||
{ "3655708-XMBT54", "XMBT54" },
|
||||
{ "3655708-XMBT55", "XMBT55" },
|
||||
{ "3655708-XMBT56", "XMBT56" },
|
||||
{ "3655708-XMBT57", "XMBT57" },
|
||||
{ "3655708-XMBT58", "XMBT58" },
|
||||
{ "3655708-XMBT59", "XMBT59" },
|
||||
{ "3655708-XMBT60", "XMBT60" },
|
||||
{ "3655708-XMBT61", "XMBT61" },
|
||||
{ "3655708-XMBT62", "XMBT62" },
|
||||
{ "3655708-XMBT63", "XMBT63" },
|
||||
{ "3655708-XMBT64", "XMBT64" },
|
||||
{ "3655708-XMBT65", "XMBT65" },
|
||||
{ "3655708-XMBT66", "XMBT66" },
|
||||
{ "3655708-XMBT67", "XMBT67" },
|
||||
{ "3655708-XMBT68", "XMBT68" },
|
||||
{ "3655708-XMBT69", "XMBT69" },
|
||||
{ "3655708-XMBT70", "XMBT70" },
|
||||
{ "3655708-XMBT71", "XMBT71" },
|
||||
{ "3655708-XMBT72", "XMBT72" },
|
||||
{ "3655708-XMBT73", "XMBT73" },
|
||||
{ "3655708-XMBT74", "XMBT74" },
|
||||
{ "3655708-XMBT75", "XMBT75" },
|
||||
{ "3655708-XMBT76", "XMBT76" },
|
||||
{ "3655708-XMBT77", "XMBT77" },
|
||||
// 添加其他映射关系
|
||||
{ "2974108-BJ01", "2974108-BJ01" },
|
||||
{ "2974108-BJ03", "CK002" },
|
||||
{ "2974108-BJ02", "CK028" }
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 根据 whCode 获取对应的 FNumber
|
||||
/// </summary>
|
||||
/// <param name="whCode">传入的仓库编码</param>
|
||||
/// <returns>返回对应的 FNumber,如果找不到返回 null 或者一个默认值</returns>
|
||||
public static string? GetFNumber(string? whCode)
|
||||
{
|
||||
if (whCode == null) return null;
|
||||
|
||||
// 从字典中查找,如果找不到可以返回一个默认值
|
||||
return whCodeToFNumberMap.TryGetValue(whCode, out var fNumber) ? fNumber : null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
355
SHK3CloudWebAPI/Controllers/StkController.cs
Normal file
355
SHK3CloudWebAPI/Controllers/StkController.cs
Normal file
@@ -0,0 +1,355 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SHK3CloudWebAPI.Models;
|
||||
using SHK3CloudWebAPI.Models.ERPModels;
|
||||
|
||||
namespace SHK3CloudWebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 出入库业务
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("3pl-wms-adapter/2bApi")]
|
||||
public class StkController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 入库接口(采购入库、销售退货、分步式调入)
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
[ApiExplorerSettings(GroupName = "接口")]
|
||||
[HttpPost("notifyInboundTransaction")]
|
||||
public ActionResult<BillOutput> NotifyInboundTransaction(InParameter parameter)
|
||||
{
|
||||
var billOutput = new BillOutput();
|
||||
List<ErpBillData> erpBillDatas = new List<ErpBillData>();
|
||||
|
||||
#region 通过单据号去查对应的ERP单据上有没有,并且确认是什么单据
|
||||
dynamic receive = BillQueryService.ReceiveBillQuery("FBillNo='" + parameter.inboundNo + "'");
|
||||
|
||||
if (receive.Count > 0)
|
||||
{
|
||||
//收料通知
|
||||
ErpBillData erpBillData = new ErpBillData();
|
||||
erpBillData.BillType = "Receive";
|
||||
erpBillDatas.Add(erpBillData);
|
||||
}
|
||||
|
||||
dynamic returnNotice = BillQueryService.ReturnNoticeBillQuery("FBillNo='" + parameter.inboundNo + "'");
|
||||
|
||||
if (returnNotice.Count > 0)
|
||||
{
|
||||
//退库通知
|
||||
ErpBillData erpBillData = new ErpBillData();
|
||||
erpBillData.BillType = "ReturnNotice";
|
||||
erpBillDatas.Add(erpBillData);
|
||||
}
|
||||
|
||||
dynamic transferOut = BillQueryService.TransferOutBillQuery("FBillNo='" + parameter.inboundNo + "'");
|
||||
|
||||
if (transferOut.Count > 0)
|
||||
{
|
||||
//分布式调出
|
||||
ErpBillData erpBillData = new ErpBillData();
|
||||
erpBillData.BillType = "TransferOut";
|
||||
erpBillDatas.Add(erpBillData);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
if (erpBillDatas.Count > 1)
|
||||
{
|
||||
billOutput = new BillOutput
|
||||
{
|
||||
result = 0,
|
||||
errorCode = "999",
|
||||
errorMsg = "单据号" + parameter.inboundNo + "在ERP中不唯一"
|
||||
};
|
||||
|
||||
}
|
||||
else if (erpBillDatas.Count == 0)
|
||||
{
|
||||
billOutput = new BillOutput
|
||||
{
|
||||
result = 0,
|
||||
errorCode = "999",
|
||||
errorMsg = "单据号" + parameter.inboundNo + "在ERP中不存在"
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
if (erpBillDatas[0].BillType == "Receive")
|
||||
{
|
||||
billOutput = InService.InStock(parameter);
|
||||
|
||||
}
|
||||
else if (erpBillDatas[0].BillType == "ReturnNotice")
|
||||
{
|
||||
billOutput = InService.ReturnStock(parameter);
|
||||
}
|
||||
else if (erpBillDatas[0].BillType == "TransferOut")
|
||||
{
|
||||
billOutput = InService.TransferIn(parameter);
|
||||
}
|
||||
}
|
||||
|
||||
return billOutput;
|
||||
}
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 出库接口(销售出库、采购退料、分步式调出)
|
||||
///// </summary>
|
||||
///// <param name="parameter"></param>
|
||||
///// <returns></returns>
|
||||
//[ApiExplorerSettings(GroupName = "接口")]
|
||||
//[HttpGet("XXXX")]
|
||||
//public string XXXX()
|
||||
//{
|
||||
// return "11";
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 出库接口(销售出库、采购退料、分步式调出)
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
[ApiExplorerSettings(GroupName = "接口")]
|
||||
[HttpPost("notifyOutboundTransaction")]
|
||||
public ActionResult<BillOutput> notifyOutboundTransaction([FromBody] OutParameter parameter)
|
||||
{
|
||||
var billOutput = new BillOutput();
|
||||
List<ErpBillData> erpBillDatas = new List<ErpBillData>();
|
||||
|
||||
#region 通过单据号去查对应的ERP单据上有没有,并且确认是什么单据
|
||||
dynamic deliveryNotice = BillQueryService.DeliveryNoticeBillQuery("FBillNo='" + parameter.outboundNo + "'");
|
||||
|
||||
if (deliveryNotice.Count > 0)
|
||||
{
|
||||
//发货通知
|
||||
ErpBillData erpBillData = new ErpBillData();
|
||||
erpBillData.BillType = "DeliveryNotice";
|
||||
erpBillDatas.Add(erpBillData);
|
||||
}
|
||||
|
||||
dynamic mrapp = BillQueryService.MrappBillQuery("FBillNo='" + parameter.outboundNo + "'");
|
||||
|
||||
if (mrapp.Count > 0)
|
||||
{
|
||||
//退料申请
|
||||
ErpBillData erpBillData = new ErpBillData();
|
||||
erpBillData.BillType = "Mrapp";
|
||||
erpBillDatas.Add(erpBillData);
|
||||
}
|
||||
|
||||
dynamic transferApply = BillQueryService.TransferApplyBillQuery("FBillNo='" + parameter.outboundNo + "'");
|
||||
|
||||
if (transferApply.Count > 0)
|
||||
{
|
||||
//调拨申请
|
||||
ErpBillData erpBillData = new ErpBillData();
|
||||
erpBillData.BillType = "TransferApply";
|
||||
erpBillDatas.Add(erpBillData);
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (erpBillDatas.Count > 1)
|
||||
{
|
||||
billOutput = new BillOutput
|
||||
{
|
||||
result = 0,
|
||||
errorCode = "999",
|
||||
errorMsg = "单据号" + parameter.outboundNo + "在ERP中不唯一"
|
||||
};
|
||||
|
||||
}
|
||||
else if (erpBillDatas.Count == 0)
|
||||
{
|
||||
billOutput = new BillOutput
|
||||
{
|
||||
result = 0,
|
||||
errorCode = "999",
|
||||
errorMsg = "单据号" + parameter.outboundNo + "在ERP中不存在"
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
if (erpBillDatas[0].BillType == "DeliveryNotice")
|
||||
{
|
||||
billOutput = OutService.OutStock(parameter);
|
||||
|
||||
}
|
||||
else if (erpBillDatas[0].BillType == "Mrapp")
|
||||
{
|
||||
billOutput = OutService.PurMRB(parameter);
|
||||
}
|
||||
else if (erpBillDatas[0].BillType == "TransferApply")
|
||||
{
|
||||
billOutput = OutService.TRANSFEROUT(parameter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return billOutput;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 入库反馈接口
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
[ApiExplorerSettings(GroupName = "接口")]
|
||||
[HttpPost("notifyOrderCreated")]
|
||||
public ActionResult<BillOutput> notifyOrderCreated(InFinsihParameter parameter)
|
||||
{
|
||||
var billOutput = new BillOutput();
|
||||
billOutput = new BillOutput
|
||||
{
|
||||
result = 0,
|
||||
errorCode = "",
|
||||
errorMsg = "未知的wms类型: inbound_order3655708-XMBT13"
|
||||
};
|
||||
|
||||
return billOutput;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 出库反馈接口
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
[ApiExplorerSettings(GroupName = "接口")]
|
||||
[HttpPost("notifyInboundFinsih")]
|
||||
public ActionResult<BillOutput> notifyInboundFinsih(OutFinsihParameter parameter)
|
||||
{
|
||||
var billOutput = new BillOutput();
|
||||
billOutput = new BillOutput
|
||||
{
|
||||
result = 1,
|
||||
errorCode = "",
|
||||
errorMsg = ""
|
||||
};
|
||||
|
||||
return billOutput;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 2c销售退货接口
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
[ApiExplorerSettings(GroupName = "接口")]
|
||||
[HttpPost("ReturnNotice")]
|
||||
public ActionResult<BillOutput> ReturnNotice(InB2CParameter parameter)
|
||||
{
|
||||
var billOutput = new BillOutput();
|
||||
List<ErpBillData> erpBillDatas = new List<ErpBillData>();
|
||||
|
||||
#region 通过单据号去查对应的ERP单据上有没有,并且确认是什么单据
|
||||
|
||||
|
||||
ReturnNoticeBill returnNotice = BillQueryService.ReturnNoticeBillQuery("FBillNo='" + parameter.inBoundOrderConfirm[0].orderCode + "'");
|
||||
|
||||
if (returnNotice != null)
|
||||
{
|
||||
//退库通知
|
||||
ErpBillData erpBillData = new ErpBillData();
|
||||
erpBillData.BillType = "ReturnNotice";
|
||||
erpBillDatas.Add(erpBillData);
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (erpBillDatas.Count > 1)
|
||||
{
|
||||
billOutput = new BillOutput
|
||||
{
|
||||
result = 0,
|
||||
errorCode = "999",
|
||||
errorMsg = "单据号" + parameter.inBoundOrderConfirm[0].orderCode + "在ERP中不唯一"
|
||||
};
|
||||
|
||||
}
|
||||
else if (erpBillDatas.Count == 0)
|
||||
{
|
||||
billOutput = new BillOutput
|
||||
{
|
||||
result = 0,
|
||||
errorCode = "999",
|
||||
errorMsg = "单据号" + parameter.inBoundOrderConfirm[0].orderCode + "在ERP中不存在"
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (erpBillDatas[0].BillType == "ReturnNotice")
|
||||
{
|
||||
billOutput = InService.ReturnStock2c(parameter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return billOutput;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 2c销售出库接口
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
[ApiExplorerSettings(GroupName = "接口")]
|
||||
[HttpPost("DeliveryNotice")]
|
||||
public ActionResult<BillOutput> DeliveryNotice(OutB2CParameter parameter)
|
||||
{
|
||||
var billOutput = new BillOutput();
|
||||
List<ErpBillData> erpBillDatas = new List<ErpBillData>();
|
||||
|
||||
#region 通过单据号去查对应的ERP单据上有没有,并且确认是什么单据
|
||||
List<DeliveryNoticeBill> deliveryNotice = BillQueryService.DeliveryNoticeBillQuery("FBillNo='" + parameter.outBoundConfirm[0].orderCode + "'");
|
||||
|
||||
if (deliveryNotice.Count > 0)
|
||||
{
|
||||
//发货通知
|
||||
ErpBillData erpBillData = new ErpBillData();
|
||||
erpBillData.BillType = "DeliveryNotice";
|
||||
erpBillDatas.Add(erpBillData);
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (erpBillDatas.Count > 1)
|
||||
{
|
||||
billOutput = new BillOutput
|
||||
{
|
||||
result = 0,
|
||||
errorCode = "999",
|
||||
errorMsg = "单据号" + parameter.outBoundConfirm[0].orderCode + "在ERP中不唯一"
|
||||
};
|
||||
|
||||
}
|
||||
else if (erpBillDatas.Count == 0)
|
||||
{
|
||||
billOutput = new BillOutput
|
||||
{
|
||||
result = 0,
|
||||
errorCode = "999",
|
||||
errorMsg = "单据号" + parameter.outBoundConfirm[0].orderCode + "在ERP中不存在"
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
if (erpBillDatas[0].BillType == "DeliveryNotice")
|
||||
{
|
||||
billOutput = OutService.OutStock2c(parameter);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return billOutput;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
108
SHK3CloudWebAPI/Controllers/XmlToSHController.cs
Normal file
108
SHK3CloudWebAPI/Controllers/XmlToSHController.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SHK3CloudWebAPI;
|
||||
using SHK3CloudWebAPI.Common;
|
||||
using SHK3CloudWebAPI.Models;
|
||||
using SHK3CloudWebAPI.Models.ERPModels;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
|
||||
namespace SHB2CK3CloudWebAPI.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class XmlToSHController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// E27采购单同步(采购订单)
|
||||
/// </summary>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
[ApiExplorerSettings(GroupName = "接口")]
|
||||
[HttpPost("PurchaseOrderData")]
|
||||
[Consumes("application/json")]
|
||||
[Produces("application/json")]
|
||||
public ActionResult<BillOutput> PurchaseOrderData([FromBody] PurchaseOrderData parameter)
|
||||
{
|
||||
var billOutput = new BillOutput();
|
||||
List<ErpBillData> erpBillDatas = new List<ErpBillData>();
|
||||
|
||||
billOutput = InService.PurchaseOrder(parameter);
|
||||
|
||||
return billOutput;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// E01 入库通知单(收料通知单 | 采购入库单)
|
||||
/// </summary>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
[ApiExplorerSettings(GroupName = "接口")]
|
||||
[HttpPost("InboundOrders")]
|
||||
[Consumes("application/json")]
|
||||
[Produces("application/json")]
|
||||
public ActionResult<BillOutput> InboundOrders([FromBody] InboundOrders parameter)
|
||||
{
|
||||
var billOutput = new BillOutput();
|
||||
List<ErpBillData> erpBillDatas = new List<ErpBillData>();
|
||||
|
||||
if (parameter.InboundOrder.PoType == "10")//采购入库
|
||||
{
|
||||
|
||||
billOutput = InService.ReceiveBill(parameter);
|
||||
}
|
||||
if (parameter.InboundOrder.PoType == "24")//采退差异
|
||||
{
|
||||
billOutput = InService.InStock3PP(parameter);
|
||||
}
|
||||
|
||||
return billOutput;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// E03 采退出库通知单(退料申请单)
|
||||
/// </summary>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
[ApiExplorerSettings(GroupName = "接口")]
|
||||
[HttpPost("OutboundOrders")]
|
||||
[Consumes("application/json")]
|
||||
[Produces("application/json")]
|
||||
public ActionResult<BillOutput> OutboundOrders([FromBody] OutboundOrders parameter)
|
||||
{
|
||||
var billOutput = new BillOutput();
|
||||
List<ErpBillData> erpBillDatas = new List<ErpBillData>();
|
||||
|
||||
billOutput = InService.MRAPP(parameter);
|
||||
|
||||
return billOutput;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料同步接口
|
||||
/// </summary>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
[ApiExplorerSettings(GroupName = "接口")]
|
||||
[HttpPost("MaterialData")]
|
||||
[Consumes("application/json")]
|
||||
[Produces("application/json")]
|
||||
public ActionResult<BillOutput> MaterialData([FromBody] ProductMasterDataParameter parameter)
|
||||
{
|
||||
var billOutput = new BillOutput();
|
||||
List<ErpBillData> erpBillDatas = new List<ErpBillData>();
|
||||
string outJson = JsonConvert.SerializeObject(parameter);
|
||||
List<BD_MATERIALBILL> deliveryNotice = BillQueryService.BD_MATERIALBillQuery("FNumber='" + parameter.Variants[0].PartNumber + "' and FUSEORGID.FNumber='100'");
|
||||
if (deliveryNotice.Count>0)
|
||||
{
|
||||
billOutput = InService.BD_MATERIAL(parameter, deliveryNotice[0].FMATERIALID, deliveryNotice[0].FDOCUMENTSTATUS, "100");
|
||||
}
|
||||
else
|
||||
{
|
||||
billOutput = InService.BD_MATERIAL(parameter, "0", "", "100");
|
||||
}
|
||||
|
||||
|
||||
return billOutput;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
SHK3CloudWebAPI/Models/BillOutput.cs
Normal file
23
SHK3CloudWebAPI/Models/BillOutput.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace SHK3CloudWebAPI
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回参数
|
||||
/// </summary>
|
||||
public class BillOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据接收状态,0失败,1单据创建成功,2待回调告知单据创建完成
|
||||
/// </summary>
|
||||
public int result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误编码
|
||||
/// </summary>
|
||||
public string errorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误原因
|
||||
/// </summary>
|
||||
public string errorMsg { get; set; }
|
||||
}
|
||||
}
|
||||
37
SHK3CloudWebAPI/Models/BillQuery.cs
Normal file
37
SHK3CloudWebAPI/Models/BillQuery.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
namespace SHK3CloudWebAPI
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
public class BillQuery
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string FormId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int TopRowCount { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int Limit { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int StartRow { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string FilterString { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string OrderString { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string FieldKeys { get; set; }
|
||||
}
|
||||
}
|
||||
26
SHK3CloudWebAPI/Models/DeliveryNoticeBill.cs
Normal file
26
SHK3CloudWebAPI/Models/DeliveryNoticeBill.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
public class DeliveryNoticeBill
|
||||
{
|
||||
public int FID { get; set; }
|
||||
|
||||
public string FBillNo { get; set; }
|
||||
|
||||
public string FDeliveryOrgIDNumber { get; set; }
|
||||
|
||||
public string FCustomerIDNumber { get; set; }
|
||||
|
||||
public int FEntity_FEntryId { get; set; }
|
||||
|
||||
public int FEntity_FSEQ { get; set; }
|
||||
|
||||
public string FMaterialIdNumber { get; set; }
|
||||
|
||||
public string FUnitIdFNumber { get; set; }
|
||||
|
||||
public bool F_UNW_IsSNTrue { get; set; }
|
||||
|
||||
public string FLABEL { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
9
SHK3CloudWebAPI/Models/ERPModels/BD_MATERIALBILL.cs
Normal file
9
SHK3CloudWebAPI/Models/ERPModels/BD_MATERIALBILL.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace SHK3CloudWebAPI.Models.ERPModels
|
||||
{
|
||||
public class BD_MATERIALBILL
|
||||
{
|
||||
public string FNumber { get; set; }
|
||||
public string FMATERIALID { get; set; }
|
||||
public string FDOCUMENTSTATUS { get; set; }
|
||||
}
|
||||
}
|
||||
25
SHK3CloudWebAPI/Models/ERPModels/MrappBill.cs
Normal file
25
SHK3CloudWebAPI/Models/ERPModels/MrappBill.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace SHK3CloudWebAPI.Models.ERPModels
|
||||
{
|
||||
public class MrappBill
|
||||
{
|
||||
public int FID { get; set; }
|
||||
|
||||
public string FBillNo { get; set; }
|
||||
|
||||
public int FEntity_FEntryId { get; set; }
|
||||
|
||||
public int FEntity_FSEQ { get; set; }
|
||||
|
||||
public string FPURCHASEORGIDNumber { get; set; }
|
||||
|
||||
public string FSUPPLIERIDNumber { get; set; }
|
||||
|
||||
public string FMATERIALIDNumber { get; set; }
|
||||
|
||||
public string FUnitIDNumber { get; set; }
|
||||
|
||||
public string FORDERNO { get; set; }
|
||||
|
||||
public int FPOORDERENTRYID { get; set; }
|
||||
}
|
||||
}
|
||||
15
SHK3CloudWebAPI/Models/ERPModels/PurchaseOrderBill.cs
Normal file
15
SHK3CloudWebAPI/Models/ERPModels/PurchaseOrderBill.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace SHK3CloudWebAPI.Models.ERPModels
|
||||
{
|
||||
public class PurchaseOrderBill
|
||||
{
|
||||
public int FID { get; set; }
|
||||
|
||||
public string FBillNo { get; set; }
|
||||
|
||||
public int FDetailEntity_FEntryId { get; set; }
|
||||
|
||||
//public int FDetailEntity_FSEQ { get; set; }
|
||||
|
||||
public string FMaterialIdNumber { get; set; }
|
||||
}
|
||||
}
|
||||
25
SHK3CloudWebAPI/Models/ERPModels/ReceiveBill.cs
Normal file
25
SHK3CloudWebAPI/Models/ERPModels/ReceiveBill.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace SHK3CloudWebAPI.Models.ERPModels
|
||||
{
|
||||
public class ReceiveBill
|
||||
{
|
||||
public int FID { get; set; }
|
||||
|
||||
public string FBillNo { get; set; }
|
||||
|
||||
public string FStockOrgIdNumber { get; set; }
|
||||
|
||||
public string FSupplierIdNumber { get; set; }
|
||||
|
||||
public string FOrderBillNo { get; set; }
|
||||
|
||||
public int FPOORDERENTRYID { get; set; }
|
||||
|
||||
public int FDetailEntity_FEntryId { get; set; }
|
||||
|
||||
public int FDetailEntity_FSEQ { get; set; }
|
||||
|
||||
public string FMaterialIdNumber { get; set; }
|
||||
|
||||
public string FUnitIdFNumber { get; set; }
|
||||
}
|
||||
}
|
||||
15
SHK3CloudWebAPI/Models/ERPModels/ReturnNoticeBill.cs
Normal file
15
SHK3CloudWebAPI/Models/ERPModels/ReturnNoticeBill.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace SHK3CloudWebAPI.Models.ERPModels
|
||||
{
|
||||
public class ReturnNoticeBill
|
||||
{
|
||||
public int FID { get; set; }
|
||||
|
||||
public string FBillNo { get; set; }
|
||||
|
||||
public string FOwnerNumber { get; set; }
|
||||
|
||||
public string FSaleOrgIdNumber { get; set; }
|
||||
|
||||
public string FRetcustIdNumber { get; set; }
|
||||
}
|
||||
}
|
||||
23
SHK3CloudWebAPI/Models/ERPModels/ReturnNoticeBillDets.cs
Normal file
23
SHK3CloudWebAPI/Models/ERPModels/ReturnNoticeBillDets.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace SHK3CloudWebAPI.Models.ERPModels
|
||||
{
|
||||
public class ReturnNoticeBillDets
|
||||
{
|
||||
public int? FID { get; set; }
|
||||
|
||||
public string? FBillNo { get; set; }
|
||||
|
||||
public string? FOwnerNumber { get; set; }
|
||||
|
||||
public string? FSaleOrgIdNumber { get; set; }
|
||||
|
||||
public string? FRetcustIdNumber { get; set; }
|
||||
|
||||
public string? FMaterialIdNumber { get; set; }
|
||||
|
||||
public string? FUnitIDNumber { get; set; }
|
||||
|
||||
public int? FEntity_FEntryId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
11
SHK3CloudWebAPI/Models/ERPModels/SerialMainFileBill.cs
Normal file
11
SHK3CloudWebAPI/Models/ERPModels/SerialMainFileBill.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SHK3CloudWebAPI.Models.ERPModels
|
||||
{
|
||||
public class SerialMainFileBill
|
||||
{
|
||||
public string FNUMBER { get; set; }
|
||||
|
||||
public string FIMEI1 { get; set; }
|
||||
|
||||
public string FIMEI2 { get; set; }
|
||||
}
|
||||
}
|
||||
23
SHK3CloudWebAPI/Models/ERPModels/TransferApplyBill.cs
Normal file
23
SHK3CloudWebAPI/Models/ERPModels/TransferApplyBill.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace SHK3CloudWebAPI.Models.ERPModels
|
||||
{
|
||||
public class TransferApplyBill
|
||||
{
|
||||
|
||||
public int FID { get; set; }
|
||||
|
||||
public string FBillNo { get; set; }
|
||||
|
||||
public int FEntity_FEntryId { get; set; }
|
||||
|
||||
public string FAPPORGIDNumber { get; set; }
|
||||
|
||||
public string FMATERIALIDNumber { get; set; }
|
||||
|
||||
public string FUNITIDNumber { get; set; }
|
||||
|
||||
public string FStockInIdNumber { get; set; }
|
||||
|
||||
public string FSrcStockIDNumber { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
27
SHK3CloudWebAPI/Models/ERPModels/TransferOutBill.cs
Normal file
27
SHK3CloudWebAPI/Models/ERPModels/TransferOutBill.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace SHK3CloudWebAPI.Models.ERPModels
|
||||
{
|
||||
public class TransferOutBill
|
||||
{
|
||||
public int FID { get; set; }
|
||||
|
||||
public string FBillNo { get; set; }
|
||||
|
||||
public int FSTKTRSOUTENTRY_FEntryId { get; set; }
|
||||
|
||||
public string FStockOrgIDNumber { get; set; }
|
||||
|
||||
public string FStockInOrgIDNumber { get; set; }
|
||||
|
||||
public string FMaterialIDNumber { get; set; }
|
||||
|
||||
public string FSrcStockIDNumber { get; set; }
|
||||
|
||||
public string FUnitIDNumber { get; set; }
|
||||
|
||||
public string FVESTONWAY { get; set; }
|
||||
|
||||
public string FDestStockStatusIDNumber { get; set; }
|
||||
|
||||
public string FSrcBillNo { get; set; }
|
||||
}
|
||||
}
|
||||
8
SHK3CloudWebAPI/Models/ErpBillData.cs
Normal file
8
SHK3CloudWebAPI/Models/ErpBillData.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
public class ErpBillData
|
||||
{
|
||||
public string BillType { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
312
SHK3CloudWebAPI/Models/InB2CParameter.cs
Normal file
312
SHK3CloudWebAPI/Models/InB2CParameter.cs
Normal file
@@ -0,0 +1,312 @@
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 入库单批量反馈
|
||||
/// </summary>
|
||||
public class InB2CParameter
|
||||
{
|
||||
/// <summary>
|
||||
/// 退货订单入库反馈信息
|
||||
/// </summary>
|
||||
public List<InBoundOrderConfirmItem> inBoundOrderConfirm { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退货订单入库反馈库存明细
|
||||
/// </summary>
|
||||
public class InBoundInvLineConfirmItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 实际数量
|
||||
/// </summary>
|
||||
public decimal qtyActual { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string origin { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string invStatus { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string isSellable { get; set; }
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
/// </summary>
|
||||
public string batchNo { get; set; }
|
||||
/// <summary>
|
||||
/// 入库批次号
|
||||
/// </summary>
|
||||
public string inboundBatchNo { get; set; }
|
||||
/// <summary>
|
||||
/// 生产日期
|
||||
/// </summary>
|
||||
public DateTime? productDate { get; set; }
|
||||
/// <summary>
|
||||
/// 过期日期
|
||||
/// </summary>
|
||||
public DateTime? expireDate { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extMemo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string isIqc { get; set; }
|
||||
/// <summary>
|
||||
/// SN信息
|
||||
/// </summary>
|
||||
public List<SkuSnInfoItem> skuSnInfo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<SkuDefectInfoItem> skuDefectInfo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string subpackageDate { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退货订单入库反馈明细信息
|
||||
/// </summary>
|
||||
public class InBoundLineConfirmItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 行号
|
||||
/// </summary>
|
||||
public string lineNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string storeCode { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库code
|
||||
/// </summary>
|
||||
public string warehouseCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string skuCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extCode { get; set; }
|
||||
/// <summary>
|
||||
/// erp物料编码
|
||||
/// </summary>
|
||||
public string upc { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extCode3 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string barCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string color { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string size { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string supplierCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string comboCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string isGift { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string cartonNo { get; set; }
|
||||
/// <summary>
|
||||
/// 计划数量
|
||||
/// </summary>
|
||||
public decimal qtyPlan { get; set; }
|
||||
/// <summary>
|
||||
/// 退货订单入库反馈库存明细
|
||||
/// </summary>
|
||||
public List<InBoundInvLineConfirmItem> inBoundInvLineConfirm { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int length { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int width { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int height { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int weight { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string remark { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extProps { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退货订单入库反馈信息
|
||||
/// </summary>
|
||||
public class InBoundOrderConfirmItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string orderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string preOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string platformOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string platformRaCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string preSourceOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string preSourcePlatformOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string preSourceWmsOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string customerOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string storeCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string platformSource { get; set; }
|
||||
/// <summary>
|
||||
/// 客户编码
|
||||
/// </summary>
|
||||
public string customerCode { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库编码
|
||||
/// </summary>
|
||||
public string whCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string poType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extOrderType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string fromLocation { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string toLocation { get; set; }
|
||||
/// <summary>
|
||||
/// 实际入库时间
|
||||
/// </summary>
|
||||
public string inboundTime { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string packRegistrationTime { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string isIqc { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string qualityInspectionNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int ctnPlanned { get; set; }
|
||||
/// <summary>
|
||||
/// 计划数量
|
||||
/// </summary>
|
||||
public decimal ctnActual { get; set; }
|
||||
/// <summary>
|
||||
/// 实际数量
|
||||
/// </summary>
|
||||
public decimal qtyPlanned { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int qtyActual { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int totalLine { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string dataSource { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string transCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string transNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extMemo { get; set; }
|
||||
/// <summary>
|
||||
/// 退货订单入库反馈明细信息
|
||||
/// </summary>
|
||||
public List<InBoundLineConfirmItem> inBoundLineConfirm { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extProps { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string remark { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int feedbackType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string @operator { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
23
SHK3CloudWebAPI/Models/InFinsihParameter.cs
Normal file
23
SHK3CloudWebAPI/Models/InFinsihParameter.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 入库反馈
|
||||
/// </summary>
|
||||
public class InFinsihParameter
|
||||
{
|
||||
/// <summary>
|
||||
/// 仓库code
|
||||
/// </summary>
|
||||
public string? whCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ERP订单号
|
||||
/// </summary>
|
||||
public string? orderCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单据类型, 5001 2C拒收退货入库,5002 采购入库,5003 仓间调入,5004 退货到仓,5006 差异调入,5007 盘点入库,5008 一步调入,5009 品质变更,6001 海关退货,6009 其他入库类型
|
||||
/// </summary>
|
||||
public string? preOrderType { get; set; }
|
||||
}
|
||||
}
|
||||
104
SHK3CloudWebAPI/Models/InParameter.cs
Normal file
104
SHK3CloudWebAPI/Models/InParameter.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
namespace SHK3CloudWebAPI
|
||||
{
|
||||
/// <summary>
|
||||
/// 入库反馈库存明细
|
||||
/// </summary>
|
||||
|
||||
public class InboundInvLineConfirmItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 实际收货数量
|
||||
/// </summary>
|
||||
public decimal qtyReceived { get; set; }
|
||||
/// <summary>
|
||||
/// 库存状态1-1:良品,1-2:良品不可售(样机),2-1:残次品-不可翻新A:轻微盒损,机器无问题,2-2:残次品-不可翻新B:盒损严重,机器无问题,
|
||||
/// 2-3:残次品-不可翻新C:盒损严重,机器有使用痕迹,2-4:残次品-不可翻新D:机器有问题,2-5:退货机,3:串货回购机
|
||||
/// </summary>
|
||||
public string? invStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 入库SN号信息
|
||||
/// </summary>
|
||||
public List<string>? sns { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 入库反馈库存明细
|
||||
/// </summary>
|
||||
public class InboundInvLineConfirms
|
||||
{
|
||||
/// <summary>
|
||||
/// 入库反馈库存明细
|
||||
/// </summary>
|
||||
public List<InboundInvLineConfirmItem>? inboundInvLineConfirm { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 入库反馈行信息
|
||||
/// </summary>
|
||||
public class InboundConfirmLineItem
|
||||
{
|
||||
/// <summary>
|
||||
/// MPN
|
||||
/// </summary>
|
||||
public string? extCode { get; set; }
|
||||
/// <summary>
|
||||
/// 行号
|
||||
/// </summary>
|
||||
public string? lineNo { get; set; }
|
||||
/// <summary>
|
||||
/// 入库反馈库存明细
|
||||
/// </summary>
|
||||
public InboundInvLineConfirms? inboundInvLineConfirms { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 入库反馈行信息
|
||||
/// </summary>
|
||||
public class InboundConfirmLines
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<InboundConfirmLineItem>? inboundConfirmLine { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// wms反馈erp入库单已入库请求
|
||||
/// </summary>
|
||||
public class InParameter
|
||||
{
|
||||
/// <summary>
|
||||
/// 消息ID
|
||||
/// </summary>
|
||||
public string? uuid { get; set; }
|
||||
/// <summary>
|
||||
/// 数据来源
|
||||
/// </summary>
|
||||
public string? dataSource { get; set; }
|
||||
/// <summary>
|
||||
/// erp单号
|
||||
/// </summary>
|
||||
public string? inboundNo { get; set; }
|
||||
/// <summary>
|
||||
/// 货主
|
||||
/// </summary>
|
||||
public string? owner { get; set; }
|
||||
/// <summary>
|
||||
/// 收货地编码
|
||||
/// </summary>
|
||||
public string? toLocation { get; set; }
|
||||
/// <summary>
|
||||
/// 实际入库时间
|
||||
/// </summary>
|
||||
public DateTime? inboundTime { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库编码
|
||||
/// </summary>
|
||||
public string? whCode { get; set; }
|
||||
/// <summary>
|
||||
/// 入库反馈行信息
|
||||
/// </summary>
|
||||
public InboundConfirmLines? inboundConfirmLines { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
98
SHK3CloudWebAPI/Models/InboundOrders.cs
Normal file
98
SHK3CloudWebAPI/Models/InboundOrders.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
public class SnLines
|
||||
{
|
||||
[XmlText]
|
||||
public string? Sn { get; set; }
|
||||
}
|
||||
|
||||
|
||||
[XmlRoot("InboundOrders")]
|
||||
public class InboundOrders
|
||||
{
|
||||
[XmlElement("sourceMarkCode")]
|
||||
public string? SourceMarkCode { get; set; }
|
||||
|
||||
[XmlElement("msgId")]
|
||||
public string? MsgId { get; set; }
|
||||
|
||||
[XmlElement("InboundOrder")]
|
||||
public InboundOrder? InboundOrder { get; set; }
|
||||
}
|
||||
|
||||
public class InboundOrder
|
||||
{
|
||||
[XmlElement("UUID")]
|
||||
public string? Uuid { get; set; }
|
||||
|
||||
[XmlElement("InboundNo")]
|
||||
public string? InboundNo { get; set; }
|
||||
|
||||
[XmlElement("supplier")]
|
||||
public string? Supplier { get; set; }
|
||||
|
||||
[XmlElement("PreOrderType")]
|
||||
public string? PreOrderType { get; set; }
|
||||
|
||||
[XmlElement("PoType")]
|
||||
public string? PoType { get; set; }
|
||||
|
||||
[XmlElement("Owner")]
|
||||
public string? Owner { get; set; }
|
||||
|
||||
[XmlElement("FromLocation")]
|
||||
public string? FromLocation { get; set; }
|
||||
|
||||
[XmlElement("WhCode")]
|
||||
public string? WhCode { get; set; }
|
||||
|
||||
[XmlElement("PlanQuantity")]
|
||||
public int? PlanQuantity { get; set; }
|
||||
|
||||
[XmlElement("PlanCartonQty")]
|
||||
public int? PlanCartonQty { get; set; }
|
||||
|
||||
// 多行商品列表
|
||||
[XmlElement("InboundOrderLines")]
|
||||
public InboundOrderLinese? InboundOrderLines { get; set; }
|
||||
}
|
||||
public class InboundOrderLinese
|
||||
{
|
||||
[XmlElement("InboundOrderLine")]
|
||||
public List<InboundOrderLinee> InboundOrderLinee { get; set; }
|
||||
}
|
||||
public class InboundOrderLinee
|
||||
{
|
||||
[XmlElement("Upc")]
|
||||
public string? Upc { get; set; }
|
||||
|
||||
[XmlElement("Mpn")]
|
||||
public string? Mpn { get; set; }
|
||||
|
||||
[XmlElement("Qty")]
|
||||
public string? Qty { get; set; }
|
||||
|
||||
[XmlElement("LineNo")]
|
||||
public string? LineNo { get; set; }
|
||||
|
||||
[XmlElement("CartonNo")]
|
||||
public string? CartonNo { get; set; }
|
||||
|
||||
[XmlArray("SnLines")]
|
||||
[XmlArrayItem("Sn")]
|
||||
public List<SnLines>? SnLines { get; set; }
|
||||
|
||||
[XmlElement("FSBillId")]
|
||||
public string? FSBillId { get; set; }
|
||||
|
||||
[XmlElement("FSId")]
|
||||
public string? FSId { get; set; }
|
||||
|
||||
[XmlElement("EcPoCode")]
|
||||
public string? EcPoCode { get; set; }
|
||||
}
|
||||
}
|
||||
856
SHK3CloudWebAPI/Models/OutB2CParameter.cs
Normal file
856
SHK3CloudWebAPI/Models/OutB2CParameter.cs
Normal file
@@ -0,0 +1,856 @@
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class OutB2CParameter
|
||||
{
|
||||
/// <summary>
|
||||
/// 销售订单出库反馈
|
||||
/// </summary>
|
||||
public List<OutBoundConfirmItem> outBoundConfirm { get; set; }
|
||||
}
|
||||
|
||||
public class SkuDefectInfos1Item
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string defectWareBarcode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string defectSource { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string defectType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string defectReasons { get; set; }
|
||||
}
|
||||
|
||||
public class SkuSnInfo1Item
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string sn { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extProps { get; set; }
|
||||
}
|
||||
|
||||
public class OutBoundPackagerLineItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string storeCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string lineNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string warehouseCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string skuCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string upc { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extCode3 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string barCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string preOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string skuName { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int unitPrice { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int actualPrice { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int qty { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int amountBfDiscount { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int lineAmt { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string ownerCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string invStatus { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string batchNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string inboundBatchNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<SkuDefectInfos1Item> skuDefectInfos1 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<SkuSnInfo1Item> skuSnInfo1 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int isCommon { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string productDate { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string expireDate { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string color { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string size { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string supplierCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string comboCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string origin { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string isGift { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string outboundItemLineNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int planQty { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int actualQty { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string remark { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extProps { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string platformLineNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string subpackageDate { get; set; }
|
||||
}
|
||||
|
||||
public class OutboundPackageItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string transCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string transName { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string trackingNumber { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int length { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int width { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int height { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int weight { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int volume { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string consumablesUpc { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int consumablesWeight { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string outboundBoxCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string cartonType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<OutBoundPackagerLineItem> outBoundPackagerLine { get; set; }
|
||||
}
|
||||
|
||||
public class Receiver
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string otherName { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string moblie { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string telephone { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string country { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string province { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string province1 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string city { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string city1 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string district { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string district1 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string town { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string town1 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string address { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string address1 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string zipcode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string remark { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extProps { get; set; }
|
||||
}
|
||||
|
||||
public class Sender
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string otherName { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string mobile { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string telephone { get; set; }
|
||||
/// <summary>
|
||||
/// 中国
|
||||
/// </summary>
|
||||
public string country { get; set; }
|
||||
/// <summary>
|
||||
/// 河南省
|
||||
/// </summary>
|
||||
public string province { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string province1 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string city { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string city1 { get; set; }
|
||||
/// <summary>
|
||||
/// 二七区
|
||||
/// </summary>
|
||||
public string district { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string district1 { get; set; }
|
||||
/// <summary>
|
||||
/// 新集镇
|
||||
/// </summary>
|
||||
public string town { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string town1 { get; set; }
|
||||
/// <summary>
|
||||
/// 郑州大学
|
||||
/// </summary>
|
||||
public string address { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string address1 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string zipcode { get; set; }
|
||||
}
|
||||
|
||||
public class SkuDefectInfoItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string defectWareBarcode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string defectSource { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string defectType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string defectReasons { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SN信息
|
||||
/// </summary>
|
||||
public class SkuSnInfoItem
|
||||
{
|
||||
/// <summary>
|
||||
/// SN号
|
||||
/// </summary>
|
||||
public string sn { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extProps { get; set; }
|
||||
}
|
||||
|
||||
public class RfidInfoItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string rfid { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string tid { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string qrCode { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售订单反馈明细
|
||||
/// </summary>
|
||||
public class OutBoundLineConfirmItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string storeCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string lineNo { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库code
|
||||
/// </summary>
|
||||
public string warehouseCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string skuCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extCode { get; set; }
|
||||
/// <summary>
|
||||
/// 传erp物料编码
|
||||
/// </summary>
|
||||
public string upc { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extCode3 { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string barCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string preOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string skuName { get; set; }
|
||||
/// <summary>
|
||||
/// 折前单价
|
||||
/// </summary>
|
||||
public decimal unitPrice { get; set; }
|
||||
/// <summary>
|
||||
/// 实际购买单价(折后)
|
||||
/// </summary>
|
||||
public decimal actualPrice { get; set; }
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public decimal qty { get; set; }
|
||||
/// <summary>
|
||||
/// 折前行总价
|
||||
/// </summary>
|
||||
public decimal amountBfDiscount { get; set; }
|
||||
/// <summary>
|
||||
/// 折后行总金额
|
||||
/// </summary>
|
||||
public decimal lineAmt { get; set; }
|
||||
/// <summary>
|
||||
/// 货主Code
|
||||
/// </summary>
|
||||
public string ownerCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string invStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
/// </summary>
|
||||
public string batchNo { get; set; }
|
||||
/// <summary>
|
||||
/// 入库批次号
|
||||
/// </summary>
|
||||
public string inboundBatchNo { get; set; }
|
||||
/// <summary>
|
||||
/// 残次信息
|
||||
/// </summary>
|
||||
public List<SkuDefectInfoItem> skuDefectInfo { get; set; }
|
||||
/// <summary>
|
||||
/// SN信息
|
||||
/// </summary>
|
||||
public List<SkuSnInfoItem> skuSnInfo { get; set; }
|
||||
/// <summary>
|
||||
/// 商品RFID信息
|
||||
/// </summary>
|
||||
public List<RfidInfoItem> rfidInfo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int isCommon { get; set; }
|
||||
/// <summary>
|
||||
/// 生产日期
|
||||
/// </summary>
|
||||
public DateTime? productDate { get; set; }
|
||||
/// <summary>
|
||||
/// 过期日期
|
||||
/// </summary>
|
||||
public DateTime? expireDate { get; set; }
|
||||
/// <summary>
|
||||
/// 颜色
|
||||
/// </summary>
|
||||
public string color { get; set; }
|
||||
/// <summary>
|
||||
/// 尺码
|
||||
/// </summary>
|
||||
public string size { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string supplierCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string comboCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string origin { get; set; }
|
||||
/// <summary>
|
||||
/// 是否是赠品
|
||||
/// </summary>
|
||||
public string isGift { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string outboundBoxCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string outboundItemLineNo { get; set; }
|
||||
/// <summary>
|
||||
/// 计划数量
|
||||
/// </summary>
|
||||
public decimal planQty { get; set; }
|
||||
/// <summary>
|
||||
/// 实际出库数量
|
||||
/// </summary>
|
||||
public decimal actualQty { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string trackingNumber { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string cancelType { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string remark { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extProps { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string platformLineNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string customStvle { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string customColorlD { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string customSize { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string subpackageDate { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string userDef2 { get; set; }
|
||||
}
|
||||
|
||||
public class OutBoundInvoiceLineItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string lineNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int qty { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int price { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int amount { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string itemCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string skuName { get; set; }
|
||||
}
|
||||
|
||||
public class OutboundInvoiceConfirmItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string invoiceCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string invoiceDate { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string payer { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int qty { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int actualPrice { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int amt { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string memo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string payee { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string drawer { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string company { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string identificationNumber { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string address { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string telephone { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<OutBoundInvoiceLineItem> outBoundInvoiceLine { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售订单出库反馈头信息
|
||||
/// </summary>
|
||||
public class OutBoundConfirmItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
/// </summary>
|
||||
public string batchNumber { get; set; }
|
||||
/// <summary>
|
||||
/// OMS订单号(唯一对接标识),放erp单号
|
||||
/// </summary>
|
||||
public string orderCode { get; set; }
|
||||
/// <summary>
|
||||
/// WMS订单号
|
||||
/// </summary>
|
||||
public string preOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string platformOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string preOmsOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string customerOrderCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string storeCode { get; set; }
|
||||
/// <summary>
|
||||
/// 客户编码
|
||||
/// </summary>
|
||||
public string customerCode { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库编码
|
||||
/// </summary>
|
||||
public string whCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extOrderType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int transtimeType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string expressTypeCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string specialDeliveryTypeCode { get; set; }
|
||||
/// <summary>
|
||||
/// 销售订单包装信息
|
||||
/// </summary>
|
||||
public List<OutboundPackageItem> outboundPackage { get; set; }
|
||||
/// <summary>
|
||||
/// 收货人信息
|
||||
/// </summary>
|
||||
public Receiver receiver { get; set; }
|
||||
/// <summary>
|
||||
/// 发件人信息
|
||||
/// </summary>
|
||||
public Sender sender { get; set; }
|
||||
/// <summary>
|
||||
/// 销售订单反馈明细
|
||||
/// </summary>
|
||||
public List<OutBoundLineConfirmItem> outBoundLineConfirm { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int wmsOdoStatus { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int outboundType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string o2oShopCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extStoreCode { get; set; }
|
||||
/// <summary>
|
||||
/// 销售订单反馈发票
|
||||
/// </summary>
|
||||
public List<OutboundInvoiceConfirmItem> outboundInvoiceConfirm { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string dataSource { get; set; }
|
||||
/// <summary>
|
||||
/// 出库时间
|
||||
/// </summary>
|
||||
public string outboundTime { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string remark { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string extProps { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string platformSource { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string orderSpecialType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string @operator { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string version { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string dataStatus { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
23
SHK3CloudWebAPI/Models/OutFinsihParameter.cs
Normal file
23
SHK3CloudWebAPI/Models/OutFinsihParameter.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 出库反馈
|
||||
/// </summary>
|
||||
public class OutFinsihParameter
|
||||
{
|
||||
/// <summary>
|
||||
/// 仓库code
|
||||
/// </summary>
|
||||
public string? whCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ERP订单号
|
||||
/// </summary>
|
||||
public string? orderCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态 0:创单失败 1:创单成功,示例值(1)
|
||||
/// </summary>
|
||||
public int status { get; set; }
|
||||
}
|
||||
}
|
||||
76
SHK3CloudWebAPI/Models/OutParameter.cs
Normal file
76
SHK3CloudWebAPI/Models/OutParameter.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
namespace SHK3CloudWebAPI
|
||||
{
|
||||
/// <summary>
|
||||
/// 出库反馈
|
||||
/// </summary>
|
||||
public class OutParameter
|
||||
{
|
||||
/// <summary>
|
||||
/// 消息ID
|
||||
/// </summary>
|
||||
public string? uuid { get; set; }
|
||||
/// <summary>
|
||||
/// ERP单号
|
||||
/// </summary>
|
||||
public string? outboundNo { get; set; }
|
||||
/// <summary>
|
||||
/// 上位系统单据类型1001 2C销售出库,1002 仓间调出,5003 仓间调入,1003 大仓分货,1004 退回工厂,1005 差异调出,1006 盘点出库,1007 礼品出库,1008 残次品处理
|
||||
/// </summary>
|
||||
public string? preOrderType { get; set; }
|
||||
/// <summary>
|
||||
/// 出库时间,format: yyyy-MM-dd HH:mm:ss
|
||||
/// </summary>
|
||||
public string? outboundTime { get; set; }
|
||||
/// <summary>
|
||||
/// 预计发货时间,format: yyyy-MM-dd HH:mm:ss
|
||||
/// </summary>
|
||||
public string? scheduleOutboundDate { get; set; }
|
||||
/// <summary>
|
||||
/// 货主 owner
|
||||
/// </summary>
|
||||
public string? owner { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库编码 Warehouse Code
|
||||
/// </summary>
|
||||
public string? whCode { get; set; }
|
||||
/// <summary>
|
||||
/// 数据来源 区分上位系统 Data source
|
||||
/// </summary>
|
||||
public string? dataSource { get; set; }
|
||||
/// <summary>
|
||||
/// 销售订单反馈明细
|
||||
/// </summary>
|
||||
public List<OutboundConfirmLinesItem>? outboundConfirmLines { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售订单反馈明细
|
||||
/// </summary>
|
||||
public class OutboundConfirmLinesItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单行号(唯一)OMS order line number(Unique)
|
||||
/// </summary>
|
||||
public string? lineNo { get; set; }
|
||||
/// <summary>
|
||||
/// MPN
|
||||
/// </summary>
|
||||
public string? extCode { get; set; }
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public decimal? qty { get; set; }
|
||||
/// <summary>
|
||||
/// 库存状态1-1:良品,1-2:良品不可售(样机),2-1:残次品-不可翻新A:轻微盒损,机器无问题,2-2:残次品-不可翻新B:盒损严重,机器无问题,
|
||||
/// 2-3:残次品-不可翻新C:盒损严重,机器有使用痕迹,2-4:残次品-不可翻新D:机器有问题,2-5:退货机,3:串货回购机
|
||||
/// </summary>
|
||||
public string? invStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 出库SN号信息
|
||||
/// </summary>
|
||||
public List<string>? sns { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
249
SHK3CloudWebAPI/Models/OutboundOrders.cs
Normal file
249
SHK3CloudWebAPI/Models/OutboundOrders.cs
Normal file
@@ -0,0 +1,249 @@
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
public class Receiver2
|
||||
{
|
||||
/// <summary>
|
||||
/// 收货人姓名
|
||||
/// </summary>
|
||||
[XmlElement("ReceiverName")]
|
||||
public string? ReceiverName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 收货人电话
|
||||
/// </summary>
|
||||
[XmlElement("ReceiverPhone")]
|
||||
public string? ReceiverPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 收货人手机号
|
||||
/// </summary>
|
||||
[XmlElement("ReceiverMobile")]
|
||||
public string? ReceiverMobile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 国家
|
||||
/// </summary>
|
||||
[XmlElement("Country")]
|
||||
public string? Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 省份
|
||||
/// </summary>
|
||||
[XmlElement("Province")]
|
||||
public string? Province { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
[XmlElement("City")]
|
||||
public string? City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 区县
|
||||
/// </summary>
|
||||
[XmlElement("District")]
|
||||
public string? District { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 街道
|
||||
/// </summary>
|
||||
[XmlElement("Address")]
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 详细地址
|
||||
/// </summary>
|
||||
[XmlElement("ExtMemo")]
|
||||
public string? ExtMemo { get; set; }
|
||||
}
|
||||
|
||||
public class OutboundLine
|
||||
{
|
||||
/// <summary>
|
||||
/// 电商采购单号
|
||||
/// </summary>
|
||||
[XmlElement("EcPoCode")]
|
||||
public string? EcPoCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 行号
|
||||
/// </summary>
|
||||
[XmlElement("LineNo")]
|
||||
public string? LineNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MPN编码
|
||||
/// </summary>
|
||||
[XmlElement("Mpn")]
|
||||
public string? Mpn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UPC编码
|
||||
/// </summary>
|
||||
[XmlElement("Upc")]
|
||||
public string? Upc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 实退价
|
||||
/// </summary>
|
||||
[XmlElement("LinePrice")]
|
||||
public string? LinePrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
[XmlElement("Qty")]
|
||||
public string? Qty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 库存状态
|
||||
/// </summary>
|
||||
[XmlElement("InvStatus")]
|
||||
public string? InvStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 源单内码
|
||||
/// </summary>
|
||||
[XmlElement("FSBillId")]
|
||||
public string? FSBillId { get; set; }
|
||||
/// <summary>
|
||||
/// 源单分录内码
|
||||
/// </summary>
|
||||
[XmlElement("FSId")]
|
||||
public string? FSId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class OutboundOrder
|
||||
{
|
||||
/// <summary>
|
||||
/// 采退出库单编号
|
||||
/// </summary>
|
||||
[XmlElement("OutboundNo")]
|
||||
public string? OutboundNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 原始采退申请编号
|
||||
/// </summary>
|
||||
[XmlElement("CustomerOrderCode")]
|
||||
public string? CustomerOrderCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货主(T2 HQID)
|
||||
/// </summary>
|
||||
[XmlElement("Owner")]
|
||||
public string? Owner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单据类型代码(采退为固定值 21)
|
||||
/// </summary>
|
||||
[XmlElement("OrderType")]
|
||||
public string? OrderType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单据创建时间
|
||||
/// </summary>
|
||||
[XmlElement("OrderCreateTime")]
|
||||
public string? OrderCreateRaw { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下单日期,解析为 DateTime?(通过 OrderTimeRaw 转换)
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public DateTime? OrderCreateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DateTime.TryParse(OrderCreateRaw, out var dt))
|
||||
return dt;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 出库数量
|
||||
/// </summary>
|
||||
[XmlElement("Qty")]
|
||||
public string? Qty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据来源
|
||||
/// </summary>
|
||||
[XmlElement("DataSource")]
|
||||
public string? DataSource { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出库仓库编码
|
||||
/// </summary>
|
||||
[XmlElement("WhCode")]
|
||||
public string? WhCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出库单目标仓库编码,即供应商编码
|
||||
/// </summary>
|
||||
[XmlElement("OutboundTargetWhcode")]
|
||||
public string? OutboundTargetWhcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最迟发货时间,格式:yyyy-MM-dd HH:mm:ss
|
||||
/// </summary>
|
||||
[XmlElement("LatestOutboundTime")]
|
||||
|
||||
public string? LatestOutboundTimeRaw { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下单日期,解析为 DateTime?(通过 OrderTimeRaw 转换)
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public DateTime? LatestOutboundTime
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DateTime.TryParse(LatestOutboundTimeRaw, out var dt))
|
||||
return dt;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 收货人地址信息
|
||||
/// </summary>
|
||||
[XmlElement("Receiver")]
|
||||
public Receiver2? Receiver { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出库行信息
|
||||
/// </summary>
|
||||
[XmlElement("OutboundLines")]
|
||||
public OutboundLines? OutboundLines { get; set; }
|
||||
// public List<OutboundLines>? OutboundLines { get; set; }
|
||||
}
|
||||
public class OutboundLines
|
||||
{
|
||||
[XmlElement("OutboundLine")]
|
||||
public List<OutboundLine>? OutboundLine { get; set; }
|
||||
}
|
||||
|
||||
[XmlRoot("OutboundOrders")]
|
||||
public class OutboundOrders
|
||||
{
|
||||
/// <summary>
|
||||
/// 标识源系统的唯一值
|
||||
/// </summary>
|
||||
[XmlElement("sourceMarkCode")]
|
||||
public string? SourceMarkCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息唯一标识
|
||||
/// </summary>
|
||||
[XmlElement("msgId")]
|
||||
public string? MsgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出库订单主信息
|
||||
/// </summary>
|
||||
[XmlElement("OutboundOrder")]
|
||||
public OutboundOrder? OutboundOrder { get; set; }
|
||||
}
|
||||
}
|
||||
90
SHK3CloudWebAPI/Models/ProductMasterDataParameter.cs
Normal file
90
SHK3CloudWebAPI/Models/ProductMasterDataParameter.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
public class ProductMasterDataParameter
|
||||
{
|
||||
[JsonProperty("sourceMarkCode")]
|
||||
public string? SourceMarkCode { get; set; }
|
||||
|
||||
[JsonProperty("variants")]
|
||||
public List<Variant>? Variants { get; set; }
|
||||
}
|
||||
public class Variant
|
||||
{
|
||||
[JsonProperty("高(mm)")]
|
||||
public string? HeightMm { get; set; }
|
||||
|
||||
[JsonProperty("SPU编码")]
|
||||
public string? SpuCode { get; set; }
|
||||
|
||||
[JsonProperty("Part Number")]
|
||||
public string? PartNumber { get; set; }
|
||||
|
||||
[JsonProperty("是否SN号管理")]
|
||||
public string? IsSnManaged { get; set; }
|
||||
//一级分类
|
||||
[JsonProperty("一级分类")]
|
||||
public string? CategoryLevel1 { get; set; }
|
||||
|
||||
[JsonProperty("sellerName")]
|
||||
public string? SellerName { get; set; }
|
||||
//二级分类
|
||||
[JsonProperty("二级分类")]
|
||||
public string? CategoryLevel2 { get; set; }
|
||||
|
||||
[JsonProperty("吊牌价/ListPrice(元)")]
|
||||
public string? ListPrice { get; set; }
|
||||
|
||||
[JsonProperty("商品税务编码")]
|
||||
public string? TaxCode { get; set; }
|
||||
//UPC编码(SKU唯一码)
|
||||
[JsonProperty("UPC编码(SKU唯一码)")]
|
||||
public string? Upc { get; set; }
|
||||
|
||||
[JsonProperty("productTypeEN")]
|
||||
public string? ProductTypeEN { get; set; }
|
||||
|
||||
[JsonProperty("productNameEN")]
|
||||
public string? ProductNameEN { get; set; }
|
||||
|
||||
[JsonProperty("productTypeCN")]
|
||||
public string? ProductTypeCN { get; set; }
|
||||
|
||||
[JsonProperty("销售属性(规格)")]
|
||||
public string? Spec { get; set; }
|
||||
|
||||
[JsonProperty("categoryEN")]
|
||||
public string? CategoryEN { get; set; }
|
||||
|
||||
[JsonProperty("品牌")]
|
||||
public string? Brand { get; set; }
|
||||
|
||||
[JsonProperty("宽(mm)")]
|
||||
public string? WidthMm { get; set; }
|
||||
|
||||
[JsonProperty("三级分类")]
|
||||
public string? CategoryLevel3 { get; set; }
|
||||
|
||||
[JsonProperty("重量(kg)")]
|
||||
public string? WeightKg { get; set; }
|
||||
|
||||
[JsonProperty("imgUrl")]
|
||||
public string? ImgUrl { get; set; }
|
||||
|
||||
[JsonProperty("商品名称")]
|
||||
public string? ProductNameCN { get; set; }
|
||||
|
||||
[JsonProperty("sellerID")]
|
||||
public string? SellerID { get; set; }
|
||||
//销售属性(颜色)
|
||||
[JsonProperty("销售属性(颜色)")]
|
||||
public string? Color { get; set; }
|
||||
|
||||
[JsonProperty("productShortNameCN")]
|
||||
public string? ProductShortNameCN { get; set; }
|
||||
|
||||
[JsonProperty("长(mm)")]
|
||||
public string? LengthMm { get; set; }
|
||||
}
|
||||
}
|
||||
162
SHK3CloudWebAPI/Models/PurchaseOrderData.cs
Normal file
162
SHK3CloudWebAPI/Models/PurchaseOrderData.cs
Normal file
@@ -0,0 +1,162 @@
|
||||
using System.Xml.Serialization;
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// XML 根节点:采购订单数据
|
||||
/// </summary>
|
||||
[XmlRoot("PurchaseOrderData", Namespace = "")]
|
||||
public class PurchaseOrderData
|
||||
{
|
||||
/// <summary>
|
||||
/// 消息唯一 ID
|
||||
/// </summary>
|
||||
[XmlElement("msgId")]
|
||||
public string? MsgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 路由编码(上下游系统约定在网关层的编码)
|
||||
/// </summary>
|
||||
[XmlElement("sourceMarkCode")]
|
||||
public string? SourceMarkCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 采购订单头
|
||||
/// </summary>
|
||||
[XmlElement("purchaseOrder")]
|
||||
public PurchaseOrder? PurchaseOrder { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 采购订单头信息
|
||||
/// </summary>
|
||||
public class PurchaseOrder
|
||||
{
|
||||
/// <summary>
|
||||
/// 采购订单唯一标识(部分 XML 没有这个字段)
|
||||
/// </summary>
|
||||
[XmlElement("uuid")]
|
||||
public string? UUID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MAP 采购单号
|
||||
/// </summary>
|
||||
[XmlElement("purchaseOrder")]
|
||||
public string? PurchaseOrderNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 币种,固定值 CNY
|
||||
/// </summary>
|
||||
[XmlElement("currency")]
|
||||
public string? Currency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 含税总金额
|
||||
/// </summary>
|
||||
[XmlElement("totalPriceWithTax")]
|
||||
public string? TotalPriceWithTax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商编码
|
||||
/// </summary>
|
||||
[XmlElement("vendorCode")]
|
||||
public string? VendorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注,允许自闭合标签 <remark />
|
||||
/// </summary>
|
||||
[XmlElement("remark", IsNullable = true)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下单日期,原始字符串(例如:2025-09-02 17:13:30)
|
||||
/// </summary>
|
||||
[XmlElement("orderTime")]
|
||||
public string? OrderTimeRaw { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下单日期,解析为 DateTime?(通过 OrderTimeRaw 转换)
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public DateTime? OrderTime
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DateTime.TryParse(OrderTimeRaw, out var dt))
|
||||
return dt;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 采购单状态:1 审核通过,3 已取消,5 已关闭
|
||||
/// </summary>
|
||||
[XmlElement("status")]
|
||||
public string? Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 采购商品行信息(可能有一个或多个)
|
||||
/// </summary>
|
||||
[XmlElement("purchaseOrderLines")]
|
||||
public List<PurchaseOrderLine>? PurchaseOrderLines { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 采购订单行信息
|
||||
/// </summary>
|
||||
public class PurchaseOrderLine
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品 UPC 编码
|
||||
/// </summary>
|
||||
[XmlElement("upc")]
|
||||
public string? Upc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品 MPN 编码
|
||||
/// </summary>
|
||||
[XmlElement("mpn")]
|
||||
public string? Mpn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 采购数量
|
||||
/// </summary>
|
||||
[XmlElement("qty")]
|
||||
public decimal Qty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 信用模式:1 现金结算,2 账期结算,3 铺货代销
|
||||
/// </summary>
|
||||
[XmlElement("creditType")]
|
||||
public int CreditType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 含税单价
|
||||
/// </summary>
|
||||
[XmlElement("priceWithTax")]
|
||||
public decimal PriceWithTax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 含税总金额
|
||||
/// </summary>
|
||||
[XmlElement("totalPriceWithTax")]
|
||||
public decimal TotalPriceWithTax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入库仓库,收货仓编码
|
||||
/// </summary>
|
||||
[XmlElement("warehouseCode")]
|
||||
public string? WarehouseCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入库库存主体,T2 HQID
|
||||
/// </summary>
|
||||
[XmlElement("ownerCode")]
|
||||
public string? OwnerCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 行号
|
||||
/// </summary>
|
||||
[XmlElement("lineno")]
|
||||
public string? LineNo { get; set; }
|
||||
}
|
||||
}
|
||||
15
SHK3CloudWebAPI/Models/ReturnNoticeBill.cs
Normal file
15
SHK3CloudWebAPI/Models/ReturnNoticeBill.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
public class ReturnNoticeBill
|
||||
{
|
||||
public int FID { get; set; }
|
||||
|
||||
public string FBillNo { get; set; }
|
||||
|
||||
public string FOwnerNumber { get; set; }
|
||||
|
||||
public string FSaleOrgIdNumber { get; set; }
|
||||
|
||||
public string FRetcustIdNumber { get; set; }
|
||||
}
|
||||
}
|
||||
23
SHK3CloudWebAPI/Models/ReturnNoticeBillDets.cs
Normal file
23
SHK3CloudWebAPI/Models/ReturnNoticeBillDets.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace SHK3CloudWebAPI.Models
|
||||
{
|
||||
public class ReturnNoticeBillDets
|
||||
{
|
||||
public int? FID { get; set; }
|
||||
|
||||
public string? FBillNo { get; set; }
|
||||
|
||||
public string? FOwnerNumber { get; set; }
|
||||
|
||||
public string? FSaleOrgIdNumber { get; set; }
|
||||
|
||||
public string? FRetcustIdNumber { get; set; }
|
||||
|
||||
public string? FMaterialIdNumber { get; set; }
|
||||
|
||||
public string? FUnitIDNumber { get; set; }
|
||||
|
||||
public int? FEntity_FEntryId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
65
SHK3CloudWebAPI/Models/Root.cs
Normal file
65
SHK3CloudWebAPI/Models/Root.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SHK3CloudWebAPI
|
||||
{
|
||||
public class ErrorsItem
|
||||
{
|
||||
|
||||
public string FieldName { get; set; }
|
||||
|
||||
public string Message { get; set; }
|
||||
|
||||
public int DIndex { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class SuccessEntityItem
|
||||
{
|
||||
|
||||
public string Number { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
public int DIndex { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class ResponseStatus
|
||||
{
|
||||
|
||||
public int ErrorCode { get; set; }
|
||||
|
||||
public Boolean IsSuccess { get; set; }
|
||||
|
||||
public List<ErrorsItem> Errors { get; set; }
|
||||
|
||||
public List<SuccessEntityItem> SuccessEntitys { get; set; }
|
||||
|
||||
public List<string> SuccessMessages { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class Result
|
||||
{
|
||||
|
||||
public ResponseStatus ResponseStatus { get; set; }
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class Root
|
||||
{
|
||||
|
||||
public Result Result { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
28
SHK3CloudWebAPI/Models/loginParameter.cs
Normal file
28
SHK3CloudWebAPI/Models/loginParameter.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace SHK3CloudWebAPI
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录
|
||||
/// </summary>
|
||||
public class loginParameter
|
||||
{
|
||||
/// <summary>
|
||||
/// 帐套标识
|
||||
/// </summary>
|
||||
public string acctID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户
|
||||
/// </summary>
|
||||
public string username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
public string password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 语言标识
|
||||
/// </summary>
|
||||
public string lcid { get; set; }
|
||||
}
|
||||
}
|
||||
60
SHK3CloudWebAPI/Program.cs
Normal file
60
SHK3CloudWebAPI/Program.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using SHK3CloudWebAPI;
|
||||
using SHK3CloudWebAPI.Common;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
//builder.Services.AddControllers();
|
||||
builder.Services.AddControllers().AddNewtonsoftJson(options =>
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿڷ<D3BF><DAB7><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʽ
|
||||
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
||||
});
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen(options => {
|
||||
var xmlfilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
||||
options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlfilename), true);
|
||||
options.OrderActionsBy(o => o.RelativePath);
|
||||
typeof(ApiVersions).GetEnumNames().ToList().ForEach(name =>
|
||||
{
|
||||
options.SwaggerDoc(name, new OpenApiInfo
|
||||
{
|
||||
Title = $"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿռ<C7BF><D5BC>ɽӿ<C9BD>",
|
||||
Version = name,
|
||||
Description = $"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿռ<C7BF><D5BC>ɽӿ<C9BD>:{name}"
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseMiddleware<RequestLoggingMiddleware>(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>־<EFBFBD>м<EFBFBD><D0BC><EFBFBD>
|
||||
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI(options =>
|
||||
{
|
||||
//options.SwaggerEndpoint($"/swagger/V1/swagger.json", $"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿռ<C7BF><D5BC>ɽӿ<C9BD>");
|
||||
typeof(ApiVersions).GetEnumNames().ToList().ForEach(version =>
|
||||
{
|
||||
options.SwaggerEndpoint($"/swagger/{version}/swagger.json", $"{version}");
|
||||
});
|
||||
//·<><C2B7>ǰ
|
||||
options.RoutePrefix = "";
|
||||
|
||||
});
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
31
SHK3CloudWebAPI/Properties/launchSettings.json
Normal file
31
SHK3CloudWebAPI/Properties/launchSettings.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:47195",
|
||||
"sslPort": 44316
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"SHK3CloudWebAPI": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "",
|
||||
"applicationUrl": "https://localhost:7155;http://localhost:5226",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
SHK3CloudWebAPI/SHK3CloudWebAPI.csproj
Normal file
23
SHK3CloudWebAPI/SHK3CloudWebAPI.csproj
Normal file
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<BaseOutputPath></BaseOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Models\ReturnNoticeBill.cs" />
|
||||
<Compile Remove="Models\ReturnNoticeBillDets.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.33" />
|
||||
<PackageReference Include="RestSharp" Version="112.1.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
632
SHK3CloudWebAPI/Service/BillQueryService.cs
Normal file
632
SHK3CloudWebAPI/Service/BillQueryService.cs
Normal file
@@ -0,0 +1,632 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using SHK3CloudWebAPI.Models.ERPModels;
|
||||
|
||||
namespace SHK3CloudWebAPI
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
public static class BillQueryService
|
||||
{
|
||||
/// <summary>
|
||||
/// 收料通知单查询
|
||||
/// </summary>
|
||||
/// <param name="strJson"></param>
|
||||
/// <returns></returns>
|
||||
public static dynamic ReceiveBillQuery(string strJson)
|
||||
{
|
||||
InvokeHelper invokeHelper = new InvokeHelper();
|
||||
dynamic resulted = null;
|
||||
var result = invokeHelper.Login();
|
||||
var iResult = JObject.Parse(result)["LoginResultType"].Value<int>();
|
||||
if (iResult == 1 || iResult == -5)
|
||||
{
|
||||
BillQuery billQuery = new BillQuery
|
||||
{
|
||||
FormId = "PUR_ReceiveBill",
|
||||
TopRowCount = 0,
|
||||
Limit = 0,
|
||||
StartRow = 0,
|
||||
FilterString = strJson,
|
||||
OrderString = "",
|
||||
FieldKeys = "FID,FBillNo,FStockOrgId.FNumber as FStockOrgIdNumber,FSupplierId.FNumber as FSupplierIdNumber,FOrderBillNo,FPOORDERENTRYID,FDetailEntity_FEntryId,FDetailEntity_FSEQ,FMaterialId.FNumber as FMaterialIdNumber,FUnitId.FNumber as FUnitIdFNumber"
|
||||
};
|
||||
var wrappedData = new
|
||||
{
|
||||
data = billQuery
|
||||
};
|
||||
string json = JsonConvert.SerializeObject(billQuery);
|
||||
string cookie = JObject.Parse(result)["KDSVCSessionId"].Value<string>();
|
||||
var relJson = invokeHelper.BillQuery(json.ToString(), cookie);
|
||||
|
||||
dynamic item = JsonConvert.DeserializeObject<dynamic>(relJson);
|
||||
|
||||
// 初始化返回结果
|
||||
var receive = new List<dynamic>();
|
||||
|
||||
// 检查 item 是否有数据
|
||||
if (item != null && item is JArray && item.Count > 0)
|
||||
{
|
||||
foreach (var entry in item)
|
||||
{
|
||||
// 检查当前 entry 是否包含足够的字段
|
||||
if (entry != null && entry.Count >= 10)
|
||||
{
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry[0],
|
||||
FBillNo = entry[1],
|
||||
FStockOrgIdNumber = entry[2],
|
||||
FSupplierIdNumber = entry[3],
|
||||
FOrderBillNo = entry[4],
|
||||
FPOORDERENTRYID = entry[5],
|
||||
FDetailEntity_FEntryId = entry[6],
|
||||
FDetailEntity_FSEQ = entry[7],
|
||||
FMaterialIdNumber = entry[8],
|
||||
FUnitIdFNumber = entry[9]
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果数据不完整,填充默认值
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry != null && entry.Count > 0 ? entry[0] : null,
|
||||
FBillNo = entry != null && entry.Count > 1 ? entry[1] : null,
|
||||
FStockOrgIdNumber = entry != null && entry.Count > 2 ? entry[2] : null,
|
||||
FSupplierIdNumber = entry != null && entry.Count > 3 ? entry[3] : null,
|
||||
FOrderBillNo = entry != null && entry.Count > 4 ? entry[4] : null,
|
||||
FPOORDERENTRYID = entry != null && entry.Count > 5 ? entry[5] : null,
|
||||
FDetailEntity_FEntryId = entry != null && entry.Count > 6 ? entry[6] : null,
|
||||
FDetailEntity_FSEQ = entry != null && entry.Count > 7 ? entry[7] : null,
|
||||
FMaterialIdNumber = entry != null && entry.Count > 8 ? entry[8] : null,
|
||||
FUnitIdFNumber = entry != null && entry.Count > 9 ? entry[9] : null
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resulted = receive;
|
||||
}
|
||||
|
||||
return resulted;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 发货通知单查询
|
||||
/// </summary>
|
||||
/// <param name="strJson"></param>
|
||||
/// <returns></returns>
|
||||
public static dynamic DeliveryNoticeBillQuery(string strJson)
|
||||
{
|
||||
InvokeHelper invokeHelper = new InvokeHelper();
|
||||
dynamic resulted = null;
|
||||
var result = invokeHelper.Login();
|
||||
var iResult = JObject.Parse(result)["LoginResultType"].Value<int>();
|
||||
if (iResult == 1 || iResult == -5)
|
||||
{
|
||||
BillQuery billQuery = new BillQuery
|
||||
{
|
||||
FormId = "SAL_DELIVERYNOTICE",
|
||||
TopRowCount = 0,
|
||||
Limit = 0,
|
||||
StartRow = 0,
|
||||
FilterString = strJson,
|
||||
OrderString = "",
|
||||
FieldKeys = "FID,FBillNo,FDeliveryOrgID.FNumber as FDeliveryOrgIDNumber,FCustomerID.FNumber as FCustomerIDNumber,FEntity_FEntryId,FEntity_FSEQ,FMaterialId.FNumber as FMaterialIdNumber,FUnitId.FNumber as FUnitIdFNumber,FORDERNO"
|
||||
};
|
||||
|
||||
string json = JsonConvert.SerializeObject(billQuery);
|
||||
string cookie = JObject.Parse(result)["KDSVCSessionId"].Value<string>();
|
||||
var relJson = invokeHelper.BillQuery(json.ToString(), cookie);
|
||||
|
||||
dynamic item = JsonConvert.DeserializeObject<dynamic>(relJson);
|
||||
|
||||
// 初始化返回结果
|
||||
var receive = new List<dynamic>();
|
||||
|
||||
// 检查 item 是否有数据
|
||||
if (item != null && item is JArray && item.Count > 0)
|
||||
{
|
||||
foreach (var entry in item)
|
||||
{
|
||||
// 检查当前 entry 是否包含足够的字段
|
||||
if (entry != null && entry.Count >= 10)
|
||||
{
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry[0],
|
||||
FBillNo = entry[1],
|
||||
FDeliveryOrgIDNumber = entry[2],
|
||||
FCustomerIDNumber = entry[3],
|
||||
FEntity_FEntryId = entry[4],
|
||||
FEntity_FSEQ = entry[5],
|
||||
FMaterialIdNumber = entry[6],
|
||||
FUnitIdFNumber = entry[7],
|
||||
FORDERNO = entry[8]
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果数据不完整,填充默认值
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry != null && entry.Count > 0 ? entry[0] : null,
|
||||
FBillNo = entry != null && entry.Count > 1 ? entry[1] : null,
|
||||
FDeliveryOrgIDNumber = entry != null && entry.Count > 2 ? entry[2] : null,
|
||||
FCustomerIDNumber = entry != null && entry.Count > 3 ? entry[3] : null,
|
||||
FEntity_FEntryId = entry != null && entry.Count > 4 ? entry[4] : null,
|
||||
FEntity_FSEQ = entry != null && entry.Count > 5 ? entry[5] : null,
|
||||
FMaterialIdNumber = entry != null && entry.Count > 6 ? entry[6] : null,
|
||||
FUnitIdFNumber = entry != null && entry.Count > 7 ? entry[7] : null,
|
||||
FORDERNO = entry != null && entry.Count > 8 ? entry[8] : null
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resulted = receive;
|
||||
}
|
||||
|
||||
return resulted;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 调拨申请
|
||||
/// </summary>
|
||||
/// <param name="strJson"></param>
|
||||
/// <returns></returns>
|
||||
public static dynamic TransferApplyBillQuery(string strJson)
|
||||
{
|
||||
InvokeHelper invokeHelper = new InvokeHelper();
|
||||
dynamic resulted = null;
|
||||
var result = invokeHelper.Login();
|
||||
var iResult = JObject.Parse(result)["LoginResultType"].Value<int>();
|
||||
if (iResult == 1 || iResult == -5)
|
||||
{
|
||||
BillQuery billQuery = new BillQuery
|
||||
{
|
||||
FormId = "STK_TRANSFERAPPLY",
|
||||
TopRowCount = 0,
|
||||
Limit = 0,
|
||||
StartRow = 0,
|
||||
FilterString = strJson,
|
||||
OrderString = "",
|
||||
FieldKeys = "FID,FBillNo,FEntity_FEntryId,FAPPORGID.FNumber as FAPPORGIDNumber,FMATERIALID.FNumber as FMATERIALIDNumber,FUNITID.FNumber as FUNITIDNumber,FStockInId.FNumber as FStockInIdNumber,FStockId.FNumber as FSrcStockIDNumber"
|
||||
};
|
||||
|
||||
string json = JsonConvert.SerializeObject(billQuery);
|
||||
string cookie = JObject.Parse(result)["KDSVCSessionId"].Value<string>();
|
||||
var relJson = invokeHelper.BillQuery(json.ToString(), cookie);
|
||||
|
||||
dynamic item = JsonConvert.DeserializeObject<dynamic>(relJson);
|
||||
|
||||
// 初始化返回结果
|
||||
var receive = new List<dynamic>();
|
||||
|
||||
// 检查 item 是否有数据
|
||||
if (item != null && item is JArray && item.Count > 0)
|
||||
{
|
||||
foreach (var entry in item)
|
||||
{
|
||||
// 检查当前 entry 是否包含足够的字段
|
||||
if (entry != null && entry.Count >= 10)
|
||||
{
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry[0],
|
||||
FBillNo = entry[1],
|
||||
FEntity_FEntryId = entry[2],
|
||||
FAPPORGIDNumber = entry[3],
|
||||
FMATERIALIDNumber = entry[4],
|
||||
FUNITIDNumber = entry[5],
|
||||
FStockInIdNumber = entry[6],
|
||||
FSrcStockIDNumber = entry[7]
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果数据不完整,填充默认值
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry != null && entry.Count > 0 ? entry[0] : null,
|
||||
FBillNo = entry != null && entry.Count > 1 ? entry[1] : null,
|
||||
FEntity_FEntryId = entry != null && entry.Count > 2 ? entry[2] : null,
|
||||
FAPPORGIDNumber = entry != null && entry.Count > 3 ? entry[3] : null,
|
||||
FMATERIALIDNumber = entry != null && entry.Count > 4 ? entry[4] : null,
|
||||
FUNITIDNumber = entry != null && entry.Count > 5 ? entry[5] : null,
|
||||
FStockInIdNumber = entry != null && entry.Count > 6 ? entry[6] : null,
|
||||
FSrcStockIDNumber = entry != null && entry.Count > 7 ? entry[7] : null
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resulted = receive;
|
||||
}
|
||||
|
||||
return resulted;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分布式调拨出库
|
||||
/// </summary>
|
||||
/// <param name="strJson"></param>
|
||||
/// <returns></returns>
|
||||
public static dynamic TransferOutBillQuery(string strJson)
|
||||
{
|
||||
InvokeHelper invokeHelper = new InvokeHelper();
|
||||
dynamic resulted = null;
|
||||
var result = invokeHelper.Login();
|
||||
var iResult = JObject.Parse(result)["LoginResultType"].Value<int>();
|
||||
if (iResult == 1 || iResult == -5)
|
||||
{
|
||||
BillQuery billQuery = new BillQuery
|
||||
{
|
||||
FormId = "STK_TRANSFEROUT",
|
||||
TopRowCount = 0,
|
||||
Limit = 0,
|
||||
StartRow = 0,
|
||||
FilterString = strJson,
|
||||
OrderString = "",
|
||||
FieldKeys = "FID,FBillNo,FSTKTRSOUTENTRY_FEntryId,FStockOrgID.FNumber as FStockOrgIDNumber,FStockInOrgID.FNumber as FStockInOrgIDNumber,FMaterialID.FNumber as FMaterialIDNumber,FSrcStockID.FNumber as FSrcStockIDNumber,FUnitID.FNumber as FUnitIDNumber,FVESTONWAY,FDestStockStatusID.FNumber as FDestStockStatusIDNumber"
|
||||
};
|
||||
|
||||
string json = JsonConvert.SerializeObject(billQuery);
|
||||
string cookie = JObject.Parse(result)["KDSVCSessionId"].Value<string>();
|
||||
var relJson = invokeHelper.BillQuery(json.ToString(), cookie);
|
||||
|
||||
dynamic item = JsonConvert.DeserializeObject<dynamic>(relJson);
|
||||
|
||||
// 初始化返回结果
|
||||
var receive = new List<dynamic>();
|
||||
|
||||
// 检查 item 是否有数据
|
||||
if (item != null && item is JArray && item.Count > 0)
|
||||
{
|
||||
foreach (var entry in item)
|
||||
{
|
||||
// 检查当前 entry 是否包含足够的字段
|
||||
if (entry != null && entry.Count >= 10)
|
||||
{
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry[0],
|
||||
FBillNo = entry[1],
|
||||
FSTKTRSOUTENTRY_FEntryId = entry[2],
|
||||
FStockOrgIDNumber = entry[3],
|
||||
FStockInOrgIDNumber = entry[4],
|
||||
FMaterialIDNumber = entry[5],
|
||||
FSrcStockIDNumber = entry[6],
|
||||
FUnitIDNumber = entry[7],
|
||||
FVESTONWAY = entry[8],
|
||||
FDestStockStatusIDNumber = entry[9]
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果数据不完整,填充默认值
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry != null && entry.Count > 0 ? entry[0] : null,
|
||||
FBillNo = entry != null && entry.Count > 1 ? entry[1] : null,
|
||||
FSTKTRSOUTENTRY_FEntryId = entry != null && entry.Count > 2 ? entry[2] : null,
|
||||
FStockOrgIDNumber = entry != null && entry.Count > 3 ? entry[3] : null,
|
||||
FStockInOrgIDNumber = entry != null && entry.Count > 4 ? entry[4] : null,
|
||||
FMaterialIDNumber = entry != null && entry.Count > 5 ? entry[5] : null,
|
||||
FSrcStockIDNumber = entry != null && entry.Count > 6 ? entry[6] : null,
|
||||
FUnitIDNumber = entry != null && entry.Count > 7 ? entry[7] : null,
|
||||
FVESTONWAY = entry != null && entry.Count > 8 ? entry[8] : null,
|
||||
FDestStockStatusIDNumber = entry != null && entry.Count > 9 ? entry[9] : null
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resulted = receive;
|
||||
}
|
||||
|
||||
return resulted;
|
||||
}
|
||||
/// <summary>
|
||||
/// 物料
|
||||
/// </summary>
|
||||
/// <param name="strJson"></param>
|
||||
/// <returns></returns>
|
||||
public static List<BD_MATERIALBILL> BD_MATERIALBillQuery(string strJson)
|
||||
{
|
||||
InvokeHelper invokeHelper = new InvokeHelper();
|
||||
List<BD_MATERIALBILL> resulted = new List<BD_MATERIALBILL>();
|
||||
var result = invokeHelper.Login();
|
||||
var iResult = JObject.Parse(result)["LoginResultType"].Value<int>();
|
||||
if (iResult == 1 || iResult == -5)
|
||||
{
|
||||
BillQuery billQuery = new BillQuery
|
||||
{
|
||||
FormId = "BD_MATERIAL",
|
||||
TopRowCount = 0,
|
||||
Limit = 0,
|
||||
StartRow = 0,
|
||||
FilterString = strJson,
|
||||
OrderString = "",
|
||||
FieldKeys = "FNumber,FMATERIALID,FDOCUMENTSTATUS "
|
||||
};
|
||||
|
||||
string json = JsonConvert.SerializeObject(billQuery);
|
||||
string cookie = JObject.Parse(result)["KDSVCSessionId"].Value<string>();
|
||||
var relJson = invokeHelper.ExecuteBillQuery(json.ToString(), cookie);
|
||||
|
||||
List<string[]> item = JsonConvert.DeserializeObject<List<string[]>>(relJson);
|
||||
|
||||
foreach (var row in item)
|
||||
{
|
||||
BD_MATERIALBILL returnNoticeBill = new BD_MATERIALBILL
|
||||
{
|
||||
FNumber = row[0],
|
||||
FMATERIALID = row[1],
|
||||
FDOCUMENTSTATUS = row[2]
|
||||
};
|
||||
|
||||
resulted.Add(returnNoticeBill);
|
||||
}
|
||||
}
|
||||
|
||||
return resulted;
|
||||
}
|
||||
/// <summary>
|
||||
/// 退料申请
|
||||
/// </summary>
|
||||
/// <param name="strJson"></param>
|
||||
/// <returns></returns>
|
||||
public static dynamic MrappBillQuery(string strJson)
|
||||
{
|
||||
InvokeHelper invokeHelper = new InvokeHelper();
|
||||
dynamic resulted = null;
|
||||
var result = invokeHelper.Login();
|
||||
var iResult = JObject.Parse(result)["LoginResultType"].Value<int>();
|
||||
if (iResult == 1 || iResult == -5)
|
||||
{
|
||||
BillQuery billQuery = new BillQuery
|
||||
{
|
||||
FormId = "PUR_MRAPP",
|
||||
TopRowCount = 0,
|
||||
Limit = 0,
|
||||
StartRow = 0,
|
||||
FilterString = strJson,
|
||||
OrderString = "",
|
||||
FieldKeys = "FID,FBillNo,FEntity_FEntryId,FEntity_FSEQ ,FPURCHASEORGID.FNumber as FPURCHASEORGIDNumber,FSUPPLIERID.FNumber as FSUPPLIERIDNumber,FMATERIALID.FNumber as FMATERIALIDNumber,FUnitID.FNumber as FUnitIDNumber,FORDERNO,FPOORDERENTRYID"
|
||||
};
|
||||
|
||||
string json = JsonConvert.SerializeObject(billQuery);
|
||||
string cookie = JObject.Parse(result)["KDSVCSessionId"].Value<string>();
|
||||
var relJson = invokeHelper.BillQuery(json.ToString(), cookie);
|
||||
|
||||
dynamic item = JsonConvert.DeserializeObject<dynamic>(relJson);
|
||||
|
||||
// 初始化返回结果
|
||||
var receive = new List<dynamic>();
|
||||
|
||||
// 检查 item 是否有数据
|
||||
if (item != null && item is JArray && item.Count > 0)
|
||||
{
|
||||
foreach (var entry in item)
|
||||
{
|
||||
// 检查当前 entry 是否包含足够的字段
|
||||
if (entry != null && entry.Count >= 10)
|
||||
{
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry[0],
|
||||
FBillNo = entry[1],
|
||||
FEntity_FEntryId = entry[2],
|
||||
FEntity_FSEQ = entry[3],
|
||||
FPURCHASEORGIDNumber = entry[4],
|
||||
FSUPPLIERIDNumber = entry[5],
|
||||
FMATERIALIDNumber = entry[6],
|
||||
FUnitIDNumber = entry[7],
|
||||
FORDERNO = entry[8],
|
||||
FPOORDERENTRYID = entry[9]
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果数据不完整,填充默认值
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry != null && entry.Count > 0 ? entry[0] : null,
|
||||
FBillNo = entry != null && entry.Count > 1 ? entry[1] : null,
|
||||
FEntity_FEntryId = entry != null && entry.Count > 2 ? entry[2] : null,
|
||||
FEntity_FSEQ = entry != null && entry.Count > 3 ? entry[3] : null,
|
||||
FPURCHASEORGIDNumber = entry != null && entry.Count > 4 ? entry[4] : null,
|
||||
FSUPPLIERIDNumber = entry != null && entry.Count > 5 ? entry[5] : null,
|
||||
FMATERIALIDNumber = entry != null && entry.Count > 6 ? entry[6] : null,
|
||||
FUnitIDNumber = entry != null && entry.Count > 7 ? entry[7] : null,
|
||||
FORDERNO = entry != null && entry.Count > 8 ? entry[8] : null,
|
||||
FPOORDERENTRYID = entry != null && entry.Count > 9 ? entry[9] : null
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resulted = receive;
|
||||
}
|
||||
|
||||
return resulted;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退货通知
|
||||
/// </summary>
|
||||
/// <param name="strJson"></param>
|
||||
/// <returns></returns>
|
||||
public static dynamic ReturnNoticeBillQuery(string strJson)
|
||||
{
|
||||
InvokeHelper invokeHelper = new InvokeHelper();
|
||||
dynamic resulted = null;
|
||||
var result = invokeHelper.Login();
|
||||
var iResult = JObject.Parse(result)["LoginResultType"].Value<int>();
|
||||
if (iResult == 1 || iResult == -5)
|
||||
{
|
||||
BillQuery billQuery = new BillQuery
|
||||
{
|
||||
FormId = "SAL_RETURNNOTICE",
|
||||
TopRowCount = 0,
|
||||
Limit = 0,
|
||||
StartRow = 0,
|
||||
FilterString = strJson,
|
||||
OrderString = "",
|
||||
FieldKeys = "FID,FBillNo,FSaleOrgId.FNumber as FSaleOrgIdNumber,FRetcustId.FNumber as FRetcustIdNumber, FMaterialId.FNumber as FMaterialIdNumber,FUnitID.FNumber as FUnitIDNumber,FEntity_FEntryId"
|
||||
};
|
||||
|
||||
string json = JsonConvert.SerializeObject(billQuery);
|
||||
string cookie = JObject.Parse(result)["KDSVCSessionId"].Value<string>();
|
||||
var relJson = invokeHelper.BillQuery(json.ToString(), cookie);
|
||||
|
||||
dynamic item = JsonConvert.DeserializeObject<dynamic>(relJson);
|
||||
|
||||
// 初始化返回结果
|
||||
var receive = new List<dynamic>();
|
||||
|
||||
// 检查 item 是否有数据
|
||||
if (item != null && item is JArray && item.Count > 0)
|
||||
{
|
||||
foreach (var entry in item)
|
||||
{
|
||||
// 检查当前 entry 是否包含足够的字段
|
||||
if (entry != null && entry.Count >= 10)
|
||||
{
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry[0],
|
||||
FBillNo = entry[1],
|
||||
FSaleOrgIdNumber = entry[2],
|
||||
FRetcustIdNumber = entry[3],
|
||||
FMaterialIdNumber = entry[4],
|
||||
FUnitIDNumber = entry[5],
|
||||
FEntity_FEntryId = entry[6]
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果数据不完整,填充默认值
|
||||
receive.Add(new
|
||||
{
|
||||
FID = entry != null && entry.Count > 0 ? entry[0] : null,
|
||||
FBillNo = entry != null && entry.Count > 1 ? entry[1] : null,
|
||||
FSaleOrgIdNumber = entry != null && entry.Count > 2 ? entry[2] : null,
|
||||
FRetcustIdNumber = entry != null && entry.Count > 3 ? entry[3] : null,
|
||||
FMaterialIdNumber = entry != null && entry.Count > 4 ? entry[4] : null,
|
||||
FUnitIDNumber = entry != null && entry.Count > 5 ? entry[5] : null,
|
||||
FEntity_FEntryId = entry != null && entry.Count > 6 ? entry[6] : null
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
resulted = receive;
|
||||
}
|
||||
|
||||
return resulted;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退货通知明细
|
||||
/// </summary>
|
||||
/// <param name="strJson"></param>
|
||||
/// <returns></returns>
|
||||
public static ReturnNoticeBillDets ReturnNoticeBillDetsQuery(string strJson)
|
||||
{
|
||||
InvokeHelper invokeHelper = new InvokeHelper();
|
||||
ReturnNoticeBillDets resulted = new ReturnNoticeBillDets();
|
||||
var result = invokeHelper.Login();
|
||||
var iResult = JObject.Parse(result)["LoginResultType"].Value<int>();
|
||||
if (iResult == 1 || iResult == -5)
|
||||
{
|
||||
BillQuery billQuery = new BillQuery
|
||||
{
|
||||
FormId = "SAL_RETURNNOTICE",
|
||||
TopRowCount = 0,
|
||||
Limit = 0,
|
||||
StartRow = 0,
|
||||
FilterString = strJson,
|
||||
OrderString = "",
|
||||
FieldKeys = "FID,FBillNo,FSaleOrgId.FNumber as FSaleOrgIdNumber,FRetcustId.FNumber as FRetcustIdNumber, FMaterialId.FNumber as FMaterialIdNumber,FUnitID.FNumber as FUnitIDNumber,FEntity_FEntryId,FOwnerID.FNumber as FOwnerNumber"
|
||||
};
|
||||
|
||||
string json = JsonConvert.SerializeObject(billQuery);
|
||||
string cookie = JObject.Parse(result)["KDSVCSessionId"].Value<string>();
|
||||
var relJson = invokeHelper.ExecuteBillQuery(json.ToString(), cookie);
|
||||
|
||||
var item = JsonConvert.DeserializeObject<string[]>(relJson);
|
||||
|
||||
ReturnNoticeBillDets returnNoticeBillDets = new ReturnNoticeBillDets
|
||||
{
|
||||
FID = int.Parse(item[0]),
|
||||
FBillNo = item[1],
|
||||
FSaleOrgIdNumber = item[2],
|
||||
FRetcustIdNumber = item[3],
|
||||
FMaterialIdNumber = item[4],
|
||||
FUnitIDNumber = item[5],
|
||||
FEntity_FEntryId = int.Parse(item[6]),
|
||||
FOwnerNumber = item[7],
|
||||
};
|
||||
|
||||
resulted = returnNoticeBillDets;
|
||||
}
|
||||
|
||||
return resulted;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 采购订单查询
|
||||
/// </summary>
|
||||
/// <param name="strJson"></param>
|
||||
/// <returns></returns>
|
||||
public static List<PurchaseOrderBill> PurchaseOrderQuery(string strJson)
|
||||
{
|
||||
InvokeHelper invokeHelper = new InvokeHelper();
|
||||
List<PurchaseOrderBill> resulted = new List<PurchaseOrderBill>();
|
||||
var result = invokeHelper.Login();
|
||||
var iResult = JObject.Parse(result)["LoginResultType"].Value<int>();
|
||||
if (iResult == 1 || iResult == -5)
|
||||
{
|
||||
BillQuery billQuery = new BillQuery
|
||||
{
|
||||
FormId = "PUR_PurchaseOrder",
|
||||
TopRowCount = 0,
|
||||
Limit = 0,
|
||||
StartRow = 0,
|
||||
FilterString = strJson,
|
||||
OrderString = "",
|
||||
FieldKeys = "FID,FBillNo,FPOOrderEntry_FEntryId,FMaterialId.FNumber as FMaterialIdNumber"
|
||||
};
|
||||
|
||||
string json = JsonConvert.SerializeObject(billQuery);
|
||||
string cookie = JObject.Parse(result)["KDSVCSessionId"].Value<string>();
|
||||
dynamic relJson = invokeHelper.ExecuteBillQuery(json.ToString(), cookie);
|
||||
List<string[]> item1 = JsonConvert.DeserializeObject<List<string[]>>(relJson);
|
||||
|
||||
foreach (var row in item1)
|
||||
{
|
||||
PurchaseOrderBill purchaseOrderBill = new PurchaseOrderBill
|
||||
{
|
||||
FID = int.Parse(row[0]),
|
||||
FBillNo = row[1],
|
||||
FDetailEntity_FEntryId = int.Parse(row[2]),
|
||||
FMaterialIdNumber = row[3]
|
||||
};
|
||||
|
||||
resulted.Add(purchaseOrderBill);
|
||||
}
|
||||
}
|
||||
|
||||
return resulted;
|
||||
}
|
||||
}
|
||||
}
|
||||
2052
SHK3CloudWebAPI/Service/InService.cs
Normal file
2052
SHK3CloudWebAPI/Service/InService.cs
Normal file
File diff suppressed because it is too large
Load Diff
1208
SHK3CloudWebAPI/Service/OutService.cs
Normal file
1208
SHK3CloudWebAPI/Service/OutService.cs
Normal file
File diff suppressed because it is too large
Load Diff
22
SHK3CloudWebAPI/appsettings.json
Normal file
22
SHK3CloudWebAPI/appsettings.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
//"AllowedHosts": "*",
|
||||
//"AppSettings": {
|
||||
// "CloudUrl": "http://47.95.40.103/K3Cloud/",
|
||||
// "KDType": "6758eb76b9ec73",
|
||||
// "KDUser": "Administrator",
|
||||
// "KDPwd": "1qaz2wsx"
|
||||
//}
|
||||
"AllowedHosts": "*",
|
||||
"AppSettings": {
|
||||
"CloudUrl": "http://123.56.29.156/K3Cloud/",
|
||||
"KDType": "5f23ccc5efaaf0",
|
||||
"KDUser": "Administrator",
|
||||
"KDPwd": "1qaz2wsx"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user