看板后端(旧版不需要了)
王 垚
2022-09-06 ef207546d2ccc247f2af1aa74118ee9442655bbc
优化
6个文件已修改
105 ■■■■ 已修改文件
MyWebApi/Controllers/LoadDataController.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MyWebApi/DLL/BLL/LoadDataBLL.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MyWebApi/DLL/DAL/LoadDataDAL.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MyWebApi/MyWebApi.csproj 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MyWebApi/Web.config 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MyWebApi/packages.config 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MyWebApi/Controllers/LoadDataController.cs
@@ -107,11 +107,50 @@
        }
        #endregion
        #region 设备看板
        [Route(template: "EquipMentData")]
        [HttpGet]
        public HttpResponseMessage EquipMentData(string CallHouseCode, int limit, int offset)
        {
            List<CallTopTable> list = new List<CallTopTable>();
            list = LoadDataBLL.EquipMentData();
            Dictionary<object, object> dList = new Dictionary<object, object>();
            dList.Add("total", 1);
            dList.Add("rows", list);
            //HttpResponseMessage response = Request.CreateResponse();
            //response.StatusCode = HttpStatusCode.OK;
            //response.Content = new StringContent(JsonConvert.SerializeObject(new { code = 200, data = dList }), System.Text.Encoding.UTF8);
            //return response;
            var timeConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd" };
            HttpResponseMessage response = Request.CreateResponse();
            response.StatusCode = HttpStatusCode.OK;
            response.Content = new StringContent(JsonConvert.SerializeObject(dList, Formatting.Indented, timeConverter));
            return response;
        }
        #endregion
        //public static List<CallTopTable> EquipMentData()
        //{
        //    //执行存储过程@lineCodeList
        //    // 存储过程名称
        //    string strProcName = "select 20 as HICMOBillNO , '60%' as HNUMBER ,12 as HNAME, 4 HMODEL ,2 as HQTY ,1 as HLEFT  ,1 as HSTATUS";
        //    //创建参数
        //    //parameters[0].Direction = ParameterDirection.Output;
        //    DataTable dt = DBHelper.GetTable(strProcName);
        //    if (dt != null && dt.Rows.Count > 0)
        //    {
        //        return dt.AsEnumerable().Select(t => new CallTopTable(t)).ToList();
        //    }
        //    return new List<CallTopTable>();
        //}
        #region[叫料看板上列表数据]
        [Route(template: "CallTableTopData")]
        [HttpGet]
        public HttpResponseMessage CallTableTopData(int limit, int offset)
        public HttpResponseMessage CallTableTopData(string CallHouseCode, int limit, int offset)
        {
            int count = 0;
            int pageSize = limit;     //页码大小
MyWebApi/DLL/BLL/LoadDataBLL.cs
@@ -39,6 +39,13 @@
        }
        #endregion
        #region[设备看板数据]
        public static List<CallTopTable> EquipMentData()
        {
            return LoadDataDAL.EquipMentData();
        }
        #endregion
        #region[叫料看板上列表数据]
        public static List<CallTopTable> CallTableTopData(string CallHouseCode, int startNum, int endNum, out int count)
        {
MyWebApi/DLL/DAL/LoadDataDAL.cs
@@ -81,6 +81,22 @@
        }
        #endregion
        public static List<CallTopTable> EquipMentData()
        {
            //执行存储过程@lineCodeList
            // 存储过程名称
            string strProcName = "select 20 as HICMOBillNO , '60%' as HNUMBER ,12 as HNAME, 4 HMODEL ,2 as HQTY ,1 as HLEFT  ,1 as HSTATUS";
            //创建参数
            //parameters[0].Direction = ParameterDirection.Output;
            DataTable dt = DBHelper.GetTable(strProcName);
            if (dt != null && dt.Rows.Count > 0)
            {
                return dt.AsEnumerable().Select(t => new CallTopTable(t)).ToList();
            }
            return new List<CallTopTable>();
        }
        #region[叫料看板上列表数据]
        public static List<CallTopTable> CallTableTopData(string CallHouseCode, int startNum, int endNum, out int count)
        {
MyWebApi/MyWebApi.csproj
@@ -1,5 +1,4 @@
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -109,7 +108,9 @@
    <Reference Include="System.Web.Http.Cors, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\packages\Microsoft.AspNet.WebApi.Cors.5.2.7\lib\net45\System.Web.Http.Cors.dll</HintPath>
    </Reference>
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Xml.Linq">
      <Private>True</Private>
    </Reference>
    <Reference Include="System.Drawing" />
    <Reference Include="System.Web" />
    <Reference Include="System.Xml" />
@@ -141,9 +142,6 @@
    </Reference>
    <Reference Include="System.Web.Http.WebHost">
      <HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
      <HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
    </Reference>
  </ItemGroup>
  <ItemGroup>
@@ -235,12 +233,6 @@
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
    <PropertyGroup>
      <ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
    </PropertyGroup>
    <Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
  </Target>
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
MyWebApi/Web.config
@@ -6,17 +6,17 @@
<configuration>
  <appSettings>
    <!--王永波本地数据库连接-->
    <add key="DBServer" value="Data Source=.;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER; Password=lc@841022;" />
    <add key="DBServer" value="Data Source=47.96.97.237,15127;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER; Password=lc@841022;" />
    <!--杨露本地数据库连接-->
      <!--<add key="DBServer" value="Data Source=LAPTOP-SE03PLUR;Initial Catalog=dsmAIS20201023121341;Integrated Security=True" />-->
      <!--流水线编码-->
      <add key="LineCode" value="509" />
      <!--流水线看板今日全部流水线编码:产线1、产线2、产线3、产线4、产线5、产线6-->
      <add key="LineCodeList" value="'509','510','511','512','513','514'" />
      <!--仓库看板编码-->
      <add key="HouseCode" value="509" />
      <!--叫料看板仓库编码-->
      <add key="CallHouseCode" value="01" />
    <!--<add key="DBServer" value="Data Source=LAPTOP-SE03PLUR;Initial Catalog=dsmAIS20201023121341;Integrated Security=True" />-->
    <!--流水线编码-->
    <add key="LineCode" value="509" />
    <!--流水线看板今日全部流水线编码:产线1、产线2、产线3、产线4、产线5、产线6-->
    <add key="LineCodeList" value="'509','510','511','512','513','514'" />
    <!--仓库看板编码-->
    <add key="HouseCode" value="509" />
    <!--叫料看板仓库编码-->
    <add key="CallHouseCode" value="01" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.7.2" />
@@ -66,10 +66,4 @@
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
</configuration>
MyWebApi/packages.config
@@ -13,7 +13,6 @@
  <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.7" targetFramework="net472" />
  <package id="Microsoft.AspNet.WebApi.WebHost.zh-Hans" version="5.2.7" targetFramework="net472" />
  <package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.0" targetFramework="net472" />
  <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net472" />
  <package id="Microsoft.CSharp" version="4.5.0" targetFramework="net472" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net472" />
  <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net472" />