schangxiang@126.com
2025-09-17 ab9d9126ced7d6dac0e14c3ede5a49fdb7fc94df
代码初次提交
已添加2个文件
已修改5个文件
已删除1个文件
123 ■■■■■ 文件已修改
DEmon/WebWIPAPI/Controllers/MesIntegrController.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/WebWIPAPI/Global.asax.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/WebWIPAPI/Utils/ClassHelper.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/WebWIPAPI/Web.config 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/WebWIPAPI/WebWIPAPI.csproj 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/WebWIPAPI/packages.config 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/iWareCommon/Utils/ClassHelper.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/iWareCommon/iWareCommon.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DEmon/WebWIPAPI/Controllers/MesIntegrController.cs
@@ -1,4 +1,5 @@
using iWareCommon.Common.Entity;
using AutoMapper;
using iWareCommon.Common.Entity;
using iWareCommon.Utils;
using iWareDataCore.BASE.Entity;
using iWareDataCore.BASE.Service;
@@ -10,6 +11,7 @@
using System.Web.Mvc;
using WebWIPAPI.Models;
using WebWIPAPI.Properties;
using WebWIPAPI.Utils;
using LogTextHelper = WebWIPAPI.Utils.LogTextHelper;
namespace WebWIPAPI.Controllers
@@ -86,7 +88,10 @@
                //第一步:先新增到物料基础表
                List<MaterialViewEntity> materials = new List<MaterialViewEntity>();
                materials = ClassHelper.RotationMapping<List<MaterialViewEntity>, List<MaterialViewForMesEntity>>(importMaterials);
                materials = ClassHelper.RotationMapping_Json<List<MaterialViewEntity>, List<MaterialViewForMesEntity>>(importMaterials);
                MaterialViewService.GetInstance().ImportExcelFromMes(materials, out msg);
                if (!string.IsNullOrEmpty(msg))
                {
@@ -104,7 +109,7 @@
                    string typeName = "入库";
                    List<InputMaterialEntity> inputmaterials = new List<InputMaterialEntity>();
                    inputmaterials = ClassHelper.RotationMapping<List<InputMaterialEntity>, List<MaterialViewForMesEntity>>(importMaterials);
                    inputmaterials = ClassHelper.RotationMapping_Json<List<InputMaterialEntity>, List<MaterialViewForMesEntity>>(importMaterials);
                    handler_importOutOrder(typeName, inputmaterials, out msg);
                    #endregion
DEmon/WebWIPAPI/Global.asax.cs
@@ -1,4 +1,5 @@
using System;
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
@@ -19,6 +20,8 @@
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
    }
}
DEmon/WebWIPAPI/Utils/ClassHelper.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
using Newtonsoft.Json;
namespace WebWIPAPI.Utils
{
    public class ClassHelper
    {
        ///// <summary>
        ///// å®žä½“互转
        ///// </summary>
        ///// <typeparam name="T">新转换的实体</typeparam>
        ///// <typeparam name="S">要转换的实体</typeparam>
        ///// <param name="s"></param>
        ///// <returns></returns>
        //public static T RotationMapping<T, S>(S s)
        //{
        //    T target = Activator.CreateInstance<T>();
        //    var originalObj = s.GetType();
        //    var targetObj = typeof(T);
        //    foreach (PropertyInfo original in originalObj.GetProperties())
        //    {
        //        foreach (PropertyInfo t in targetObj.GetProperties())
        //        {
        //            if (t.Name == original.Name)
        //            {
        //                t.SetValue(target, original.GetValue(s, null), null);
        //            }
        //        }
        //    }
        //    return target;
        //}
        public static T RotationMapping_Json<T, S>(S s)
        {
            var oldStr = JsonConvert.SerializeObject(s);
            return JsonConvert.DeserializeObject<T>(oldStr);
        }
    }
}
DEmon/WebWIPAPI/Web.config
@@ -40,4 +40,14 @@
    <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>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.8.1.0" newVersion="4.8.1.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
DEmon/WebWIPAPI/WebWIPAPI.csproj
@@ -41,6 +41,9 @@
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="AutoMapper, Version=6.2.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
      <HintPath>..\packages\AutoMapper.6.2.0\lib\net45\AutoMapper.dll</HintPath>
    </Reference>
    <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\dll\EntityFramework.dll</HintPath>
@@ -49,9 +52,14 @@
      <HintPath>..\dll\EntityFramework.SqlServer.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.Web.DynamicData" />
    <Reference Include="System.Web.Entity" />
    <Reference Include="System.Web.ApplicationServices" />
@@ -70,9 +78,6 @@
    <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <Private>True</Private>
      <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
    </Reference>
    <Reference Include="Newtonsoft.Json">
      <HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
    </Reference>
    <Reference Include="System.Net.Http">
    </Reference>
@@ -127,6 +132,7 @@
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="Utils\ClassHelper.cs" />
    <Compile Include="Utils\LogTextHelper.cs" />
  </ItemGroup>
  <ItemGroup>
@@ -165,6 +171,9 @@
      <Name>iWareDataCore</Name>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <None Include="packages.config" />
  </ItemGroup>
  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
DEmon/WebWIPAPI/packages.config
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="AutoMapper" version="6.2.0" targetFramework="net45" />
</packages>
DEmon/iWareCommon/Utils/ClassHelper.cs
ÎļþÒÑɾ³ý
DEmon/iWareCommon/iWareCommon.csproj
@@ -106,7 +106,6 @@
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="Utils\Base64Helper.cs" />
    <Compile Include="Utils\ClassHelper.cs" />
    <Compile Include="Utils\DESHelper.cs" />
    <Compile Include="Utils\EntityPropHelper.cs" />
    <Compile Include="Utils\FileHelper.cs" />