From 215cd8f05f4de1da31a611649bc21a26ec829115 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 16 9月 2025 15:31:28 +0800
Subject: [PATCH] 增加外部api
---
DEmon/WebWIPAPI/WebWIPAPI.csproj | 28 +++++++-
DEmon/dll/EntityFramework.SqlServer.dll | 0
DEmon/iWareDataCore/BASE/Entity/MaterialViewEntity.cs | 2
DEmon/WebWIPAPI/Web.config | 8 ++
DEmon/WebWIPAPI/Models/ApiResponse.cs | 35 +++++++++++
DEmon/dll/EntityFramework.dll | 0
DEmon/WebWIPAPI/Controllers/MesIntegrController.cs | 51 +++++++++++++++++
DEmon/iWareDataCore/ORM/BASEInputMaterial.cs | 3 +
8 files changed, 121 insertions(+), 6 deletions(-)
diff --git a/DEmon/WebWIPAPI/Controllers/MesIntegrController.cs b/DEmon/WebWIPAPI/Controllers/MesIntegrController.cs
new file mode 100644
index 0000000..1c2a566
--- /dev/null
+++ b/DEmon/WebWIPAPI/Controllers/MesIntegrController.cs
@@ -0,0 +1,51 @@
+锘縰sing iWareDataCore.BASE.Entity;
+using iWareDataCore.BASE.Service;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Web.Mvc;
+using WebWIPAPI.Models;
+using WebWIPAPI.Properties;
+using WebWIPAPI.Utils;
+
+
+namespace WebWIPAPI.Controllers
+{
+ /// <summary>
+ /// MES瀵规帴鎺ュ彛
+ /// </summary>
+ public class MesIntegrController : Controller
+ {
+
+ /// <summary>
+ /// 鍚屾绔嬪簱鐨勭墿鏂欎俊鎭�
+ /// WCS>>WIP:姣忓ぉ瀹氭椂WCS鎺ㄩ�佺珛搴撻噷鐨勭墿鏂欎俊鎭�
+ /// </summary>
+ /// <param name="sysCode"></param>
+ /// <param name="wareHouseInfo"></param>
+ /// <param name="processCardNumber"></param>
+ /// <param name="wareHouseId"></param>
+ /// <param name="timestamp"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public ActionResult syncMaterialInfo()
+ {
+ var msg = "";
+ var datalist = PlaceMaterialViewService.GetInstance().GetPlacePreview(out msg);
+
+ var responseMessage = new ApiResponse<List<PlaceMaterialViewEntity>>()
+ {
+ Code = 200,
+ Success = true,
+ Message = "鎴愬姛",
+ Data = datalist,
+ };
+
+ //灏嗗璞¤浆鍖栦负json鏍煎紡
+ var responseStr = JsonConvert.SerializeObject(responseMessage);
+ LogTextHelper.WriteLine(Resources.LogDir, "WIPAPI:{0},{1}, {2}", "syncMaterialInfo", "璇锋眰鍙傛暟锛�" + "", "鍝嶅簲淇℃伅;" + responseStr);
+ return Json(responseMessage, JsonRequestBehavior.DenyGet);
+ }
+
+
+ }
+}
diff --git a/DEmon/WebWIPAPI/Models/ApiResponse.cs b/DEmon/WebWIPAPI/Models/ApiResponse.cs
new file mode 100644
index 0000000..9123266
--- /dev/null
+++ b/DEmon/WebWIPAPI/Models/ApiResponse.cs
@@ -0,0 +1,35 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WebWIPAPI.Models
+{
+ /// <summary>
+ /// 閫氱敤娉涘瀷鎺ュ彛鍝嶅簲妯″瀷
+ /// </summary>
+ /// <typeparam name="T">Data 瀛楁鐨勭被鍨嬶紝鍙互鏄换鎰忕被鍨嬶紝濡� string銆乮nt銆佽嚜瀹氫箟绫荤瓑</typeparam>
+ public class ApiResponse<T>
+ {
+ /// <summary>
+ /// 鐘舵�佺爜锛屼緥濡� 200 琛ㄧず鎴愬姛
+ /// </summary>
+ public int Code { get; set; }
+
+ /// <summary>
+ /// 鏄惁鎴愬姛锛宼rue 琛ㄧず鎴愬姛锛宖alse 琛ㄧず澶辫触
+ /// </summary>
+ public bool Success { get; set; }
+
+ /// <summary>
+ /// 杩斿洖娑堟伅锛屼緥濡傦細"鎴愬姛" 鎴栭敊璇俊鎭�
+ /// </summary>
+ public string Message { get; set; }
+
+ /// <summary>
+ /// 杩斿洖鐨勬暟鎹唴瀹癸紝绫诲瀷涓烘硾鍨� T
+ /// </summary>
+ public T Data { get; set; }
+ }
+}
diff --git a/DEmon/WebWIPAPI/Web.config b/DEmon/WebWIPAPI/Web.config
index fe0834f..0c4d843 100644
--- a/DEmon/WebWIPAPI/Web.config
+++ b/DEmon/WebWIPAPI/Web.config
@@ -2,6 +2,9 @@
<configuration>
+ <configSections>
+ <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+ </configSections>
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
@@ -32,4 +35,9 @@
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
+ <connectionStrings>
+ <add name="DbModelExcel" connectionString="data source=.;initial catalog=WGQ_WB19011_EXCEL;persist security info=True;user id=sa;password=123abc.com;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
+ <add name="DbModelLog" connectionString="data source=.;initial catalog=WGQ_WB19011_LOG;user id=sa;password=123abc.com;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
+ <add name="DbModelCore" connectionString="data source=.;initial catalog=WGQ_WB19011_CORE;user id=sa;password=123abc.com;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
+ </connectionStrings>
</configuration>
diff --git a/DEmon/WebWIPAPI/WebWIPAPI.csproj b/DEmon/WebWIPAPI/WebWIPAPI.csproj
index 0cf0e74..ee35335 100644
--- a/DEmon/WebWIPAPI/WebWIPAPI.csproj
+++ b/DEmon/WebWIPAPI/WebWIPAPI.csproj
@@ -20,6 +20,8 @@
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
+ <Use64BitIISExpress />
+ <UseGlobalApplicationHostFile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -39,6 +41,13 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\dll\EntityFramework.dll</HintPath>
+ </Reference>
+ <Reference Include="EntityFramework.SqlServer">
+ <HintPath>..\dll\EntityFramework.SqlServer.dll</HintPath>
+ </Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Data" />
@@ -106,10 +115,12 @@
<ItemGroup>
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\TaskExecController.cs" />
+ <Compile Include="Controllers\MesIntegrController.cs" />
<Compile Include="Controllers\WcsIntegrController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
+ <Compile Include="Models\ApiResponse.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
@@ -134,7 +145,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
- <Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Home\Index.cshtml" />
@@ -144,6 +154,16 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\iWareCommon\iWareCommon.csproj">
+ <Project>{a9859d3c-ea37-497c-ba93-43cec47f5798}</Project>
+ <Name>iWareCommon</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\iWareDataCore\iWareDataCore.csproj">
+ <Project>{714d8b00-61ad-4cee-b062-add15f4962b7}</Project>
+ <Name>iWareDataCore</Name>
+ </ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
@@ -159,13 +179,11 @@
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
- <UseIIS>False</UseIIS>
+ <UseIIS>True</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort>47533</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
- <IISUrl>http://127.0.0.1:8085/wip</IISUrl>
- <OverrideIISAppRootUrl>True</OverrideIISAppRootUrl>
- <IISAppRootUrl>http://127.0.0.1:8085/wip</IISAppRootUrl>
+ <IISUrl>http://localhost:47533/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
diff --git a/DEmon/dll/EntityFramework.SqlServer.dll b/DEmon/dll/EntityFramework.SqlServer.dll
new file mode 100644
index 0000000..9a9c5e9
--- /dev/null
+++ b/DEmon/dll/EntityFramework.SqlServer.dll
Binary files differ
diff --git a/DEmon/dll/EntityFramework.dll b/DEmon/dll/EntityFramework.dll
new file mode 100644
index 0000000..9275df6
--- /dev/null
+++ b/DEmon/dll/EntityFramework.dll
Binary files differ
diff --git a/DEmon/iWareDataCore/BASE/Entity/MaterialViewEntity.cs b/DEmon/iWareDataCore/BASE/Entity/MaterialViewEntity.cs
index 6705b77..c810747 100644
--- a/DEmon/iWareDataCore/BASE/Entity/MaterialViewEntity.cs
+++ b/DEmon/iWareDataCore/BASE/Entity/MaterialViewEntity.cs
@@ -71,7 +71,7 @@
public string ClassificationSociety { get; set; }
/// <summary>
- /// 12瑙勬牸鍨嬪彿
+ /// 12鍒嗘鍙�
/// </summary>
public string SerialNo { get; set; }
diff --git a/DEmon/iWareDataCore/ORM/BASEInputMaterial.cs b/DEmon/iWareDataCore/ORM/BASEInputMaterial.cs
index a303ff8..f1e8c3f 100644
--- a/DEmon/iWareDataCore/ORM/BASEInputMaterial.cs
+++ b/DEmon/iWareDataCore/ORM/BASEInputMaterial.cs
@@ -6,6 +6,9 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Spatial;
+ /// <summary>
+ /// 出入库单物料导入表
+ /// </summary>
[Table("BASEInputMaterial")]
public partial class BASEInputMaterial
{
--
Gitblit v1.9.3