533c702ee6602a45a7090324e66f4c8e892af6c2..215cd8f05f4de1da31a611649bc21a26ec829115
2025-09-16 schangxiang@126.com
增加外部api
215cd8 对比 | 目录
2025-09-16 schangxiang@126.com
22
750194 对比 | 目录
已添加6个文件
已修改4个文件
127 ■■■■■ 文件已修改
DEmon/WebWIPAPI/Controllers/MesIntegrController.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/WebWIPAPI/Models/ApiResponse.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/WebWIPAPI/Web.config 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/WebWIPAPI/WebWIPAPI.csproj 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/dll/EntityFramework.SqlServer.dll 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/dll/EntityFramework.dll 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/iWareDataCore/BASE/Entity/MaterialViewEntity.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/iWareDataCore/ORM/BASEInputMaterial.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
导入模板/出入库单物料明细.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
导入模板/物料信息.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/WebWIPAPI/Controllers/MesIntegrController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,51 @@
using 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);
        }
    }
}
DEmon/WebWIPAPI/Models/ApiResponse.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
using 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、int、自定义类等</typeparam>
    public class ApiResponse<T>
    {
        /// <summary>
        /// çŠ¶æ€ç ï¼Œä¾‹å¦‚ 200 è¡¨ç¤ºæˆåŠŸ
        /// </summary>
        public int Code { get; set; }
        /// <summary>
        /// æ˜¯å¦æˆåŠŸï¼Œtrue è¡¨ç¤ºæˆåŠŸï¼Œfalse è¡¨ç¤ºå¤±è´¥
        /// </summary>
        public bool Success { get; set; }
        /// <summary>
        /// è¿”回消息,例如:"成功" æˆ–错误信息
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// è¿”回的数据内容,类型为泛型 T
        /// </summary>
        public T Data { get; set; }
    }
}
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>
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>
DEmon/dll/EntityFramework.SqlServer.dll
Binary files differ
DEmon/dll/EntityFramework.dll
Binary files differ
DEmon/iWareDataCore/BASE/Entity/MaterialViewEntity.cs
@@ -71,7 +71,7 @@
        public string ClassificationSociety { get; set; }
        /// <summary>
        /// 12规格型号
        /// 12分段号
        /// </summary>
        public string SerialNo { get; set; }
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
    {
µ¼ÈëÄ£°å/³öÈë¿âµ¥ÎïÁÏÃ÷ϸ.xlsx
Binary files differ
µ¼ÈëÄ£°å/ÎïÁÏÐÅÏ¢.xlsx
Binary files differ