接口请求体属性名小写
This commit is contained in:
@@ -45,6 +45,10 @@
|
|||||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
|
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-10.0.0.9" newVersion="10.0.0.9" />
|
||||||
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ TCP_IP=192.168.2.253
|
|||||||
TCP_Port=1030
|
TCP_Port=1030
|
||||||
|
|
||||||
[MES配置]
|
[MES配置]
|
||||||
siteCode=18J
|
siteCode=17J
|
||||||
lineCode=18J-BZ-181
|
lineCode=PW-174
|
||||||
equipCode=EVEDL18BZWGJ02
|
equipCode=174VIM02
|
||||||
materialCode=81035332
|
materialCode=
|
||||||
productType=test
|
productType=LF324
|
||||||
GradingMesUrl=http://10.22.167.141/core/api/public/eve/pm/eqm/new/grading
|
GradingMesUrl=http://10.22.167.141/core/api/public/eve/pm/eqm/new/grading
|
||||||
ResultProcessMesUrl=http://10.22.167.2/core/api/public/product/process/param/new/result
|
ResultProcessMesUrl=http://10.22.167.2/core/api/public/product/process/param/new/result
|
||||||
StationArrivalUrl=http://10.22.167.2/core/api/public/formation/section/arrival/bz
|
StationArrivalUrl=http://10.22.167.2/core/api/public/formation/section/arrival/bz
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using JY.MES.MES;
|
|||||||
using JY.Model;
|
using JY.Model;
|
||||||
using JY.Utility;
|
using JY.Utility;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Serialization;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -91,7 +92,7 @@ namespace JY.Inspection.Mes
|
|||||||
materiallotCodeList = new List<string>() { BarCode }
|
materiallotCodeList = new List<string>() { BarCode }
|
||||||
};
|
};
|
||||||
|
|
||||||
string p = JsonConvert.SerializeObject(gradingParam);
|
string p = JsonHelper.Serialize(gradingParam);
|
||||||
|
|
||||||
var sw = new Stopwatch();
|
var sw = new Stopwatch();
|
||||||
sw.Start();
|
sw.Start();
|
||||||
@@ -219,8 +220,8 @@ namespace JY.Inspection.Mes
|
|||||||
//多个
|
//多个
|
||||||
|
|
||||||
pl.tagDataVOList = tdvls;
|
pl.tagDataVOList = tdvls;
|
||||||
prp.payload = JsonConvert.SerializeObject(pl);
|
prp.payload = JsonHelper.Serialize(pl);
|
||||||
string p = JsonConvert.SerializeObject(prp);
|
string p = JsonHelper.Serialize(prp);
|
||||||
|
|
||||||
var sw = new Stopwatch();
|
var sw = new Stopwatch();
|
||||||
sw.Start();
|
sw.Start();
|
||||||
@@ -262,7 +263,7 @@ namespace JY.Inspection.Mes
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string reqJsonStr = JsonConvert.SerializeObject(req);
|
string reqJsonStr = JsonHelper.Serialize(req);
|
||||||
var sw = new Stopwatch();
|
var sw = new Stopwatch();
|
||||||
sw.Start();
|
sw.Start();
|
||||||
string mesRes = MESApiHelper.HttpPostJsonAPI(
|
string mesRes = MESApiHelper.HttpPostJsonAPI(
|
||||||
@@ -298,7 +299,7 @@ namespace JY.Inspection.Mes
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string reqJsonStr = JsonConvert.SerializeObject(req);
|
string reqJsonStr = JsonHelper.Serialize(req);
|
||||||
var sw = new Stopwatch();
|
var sw = new Stopwatch();
|
||||||
sw.Start();
|
sw.Start();
|
||||||
string mesRes = MESApiHelper.HttpPostJsonAPI(
|
string mesRes = MESApiHelper.HttpPostJsonAPI(
|
||||||
@@ -310,7 +311,7 @@ namespace JY.Inspection.Mes
|
|||||||
|
|
||||||
resp = JsonConvert.DeserializeObject<RespExitStation>(mesRes);
|
resp = JsonConvert.DeserializeObject<RespExitStation>(mesRes);
|
||||||
|
|
||||||
new MesLog().LogArrivalStation(currentTime, reqJsonStr, mesRes, sw.ElapsedMilliseconds);
|
new MesLog().LogExitStation(currentTime, reqJsonStr, mesRes, sw.ElapsedMilliseconds);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -335,7 +336,7 @@ namespace JY.Inspection.Mes
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string reqJsonStr = JsonConvert.SerializeObject(req);
|
string reqJsonStr = JsonHelper.Serialize(req);
|
||||||
var sw = new Stopwatch();
|
var sw = new Stopwatch();
|
||||||
sw.Start();
|
sw.Start();
|
||||||
string mesRes = MESApiHelper.HttpPostJsonAPI(
|
string mesRes = MESApiHelper.HttpPostJsonAPI(
|
||||||
|
|||||||
@@ -40,6 +40,18 @@ namespace JY.MES.MES
|
|||||||
/// 行信息
|
/// 行信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<AssembleLine> AssembleLineList { get; set; }
|
public List<AssembleLine> AssembleLineList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 没什么用,只是为了凑json格式
|
||||||
|
/// </summary>
|
||||||
|
public MaterialLot[] MaterialLotList { get; set; } = new MaterialLot[] { new MaterialLot() };
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MaterialLot
|
||||||
|
{
|
||||||
|
public string MaterialLotCode { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string MaterialLotCodeLocator { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AssembleLine
|
public class AssembleLine
|
||||||
|
|||||||
@@ -53,6 +53,9 @@
|
|||||||
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.IO.RecyclableMemoryStream.3.0.1\lib\netstandard2.0\Microsoft.IO.RecyclableMemoryStream.dll</HintPath>
|
<HintPath>..\packages\Microsoft.IO.RecyclableMemoryStream.3.0.1\lib\netstandard2.0\Microsoft.IO.RecyclableMemoryStream.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="NPOI, Version=2.5.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
<Reference Include="NPOI, Version=2.5.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NPOI.2.5.5\lib\net45\NPOI.dll</HintPath>
|
<HintPath>..\packages\NPOI.2.5.5\lib\net45\NPOI.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -113,6 +116,7 @@
|
|||||||
<Compile Include="EPPlusExcelHelper.cs" />
|
<Compile Include="EPPlusExcelHelper.cs" />
|
||||||
<Compile Include="ExcelImporter.cs" />
|
<Compile Include="ExcelImporter.cs" />
|
||||||
<Compile Include="IniFileHelper.cs" />
|
<Compile Include="IniFileHelper.cs" />
|
||||||
|
<Compile Include="JsonHelper.cs" />
|
||||||
<Compile Include="LogHelper.cs" />
|
<Compile Include="LogHelper.cs" />
|
||||||
<Compile Include="OpenOfficeXML.cs" />
|
<Compile Include="OpenOfficeXML.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Serialization;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace JY.Utility
|
||||||
|
{
|
||||||
|
public static class JsonHelper
|
||||||
|
{
|
||||||
|
private static readonly JsonSerializerSettings _settings = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
||||||
|
};
|
||||||
|
|
||||||
|
public static string Serialize(object obj)
|
||||||
|
{
|
||||||
|
return JsonConvert.SerializeObject(obj, _settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static T Deserialize<T>(string json)
|
||||||
|
{
|
||||||
|
return JsonConvert.DeserializeObject<T>(json, _settings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
<package id="Microsoft.Bcl.HashCode" version="1.0.0" targetFramework="net472" />
|
<package id="Microsoft.Bcl.HashCode" version="1.0.0" targetFramework="net472" />
|
||||||
<package id="Microsoft.CSharp" version="4.3.0" targetFramework="net472" />
|
<package id="Microsoft.CSharp" version="4.3.0" targetFramework="net472" />
|
||||||
<package id="Microsoft.IO.RecyclableMemoryStream" version="3.0.1" targetFramework="net48" />
|
<package id="Microsoft.IO.RecyclableMemoryStream" version="3.0.1" targetFramework="net48" />
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
|
||||||
<package id="NPOI" version="2.5.5" targetFramework="net452" />
|
<package id="NPOI" version="2.5.5" targetFramework="net452" />
|
||||||
<package id="Portable.BouncyCastle" version="1.8.9" targetFramework="net452" />
|
<package id="Portable.BouncyCastle" version="1.8.9" targetFramework="net452" />
|
||||||
<package id="SharpZipLib" version="1.4.2" targetFramework="net48" />
|
<package id="SharpZipLib" version="1.4.2" targetFramework="net48" />
|
||||||
|
|||||||
Reference in New Issue
Block a user