接口请求体属性名小写
This commit is contained in:
@@ -45,6 +45,10 @@
|
||||
<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" />
|
||||
</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>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
||||
@@ -13,11 +13,11 @@ TCP_IP=192.168.2.253
|
||||
TCP_Port=1030
|
||||
|
||||
[MES配置]
|
||||
siteCode=18J
|
||||
lineCode=18J-BZ-181
|
||||
equipCode=EVEDL18BZWGJ02
|
||||
materialCode=81035332
|
||||
productType=test
|
||||
siteCode=17J
|
||||
lineCode=PW-174
|
||||
equipCode=174VIM02
|
||||
materialCode=
|
||||
productType=LF324
|
||||
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
|
||||
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.Utility;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -91,7 +92,7 @@ namespace JY.Inspection.Mes
|
||||
materiallotCodeList = new List<string>() { BarCode }
|
||||
};
|
||||
|
||||
string p = JsonConvert.SerializeObject(gradingParam);
|
||||
string p = JsonHelper.Serialize(gradingParam);
|
||||
|
||||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
@@ -219,8 +220,8 @@ namespace JY.Inspection.Mes
|
||||
//多个
|
||||
|
||||
pl.tagDataVOList = tdvls;
|
||||
prp.payload = JsonConvert.SerializeObject(pl);
|
||||
string p = JsonConvert.SerializeObject(prp);
|
||||
prp.payload = JsonHelper.Serialize(pl);
|
||||
string p = JsonHelper.Serialize(prp);
|
||||
|
||||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
@@ -262,7 +263,7 @@ namespace JY.Inspection.Mes
|
||||
|
||||
try
|
||||
{
|
||||
string reqJsonStr = JsonConvert.SerializeObject(req);
|
||||
string reqJsonStr = JsonHelper.Serialize(req);
|
||||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string mesRes = MESApiHelper.HttpPostJsonAPI(
|
||||
@@ -298,7 +299,7 @@ namespace JY.Inspection.Mes
|
||||
|
||||
try
|
||||
{
|
||||
string reqJsonStr = JsonConvert.SerializeObject(req);
|
||||
string reqJsonStr = JsonHelper.Serialize(req);
|
||||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string mesRes = MESApiHelper.HttpPostJsonAPI(
|
||||
@@ -310,7 +311,7 @@ namespace JY.Inspection.Mes
|
||||
|
||||
resp = JsonConvert.DeserializeObject<RespExitStation>(mesRes);
|
||||
|
||||
new MesLog().LogArrivalStation(currentTime, reqJsonStr, mesRes, sw.ElapsedMilliseconds);
|
||||
new MesLog().LogExitStation(currentTime, reqJsonStr, mesRes, sw.ElapsedMilliseconds);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -335,7 +336,7 @@ namespace JY.Inspection.Mes
|
||||
|
||||
try
|
||||
{
|
||||
string reqJsonStr = JsonConvert.SerializeObject(req);
|
||||
string reqJsonStr = JsonHelper.Serialize(req);
|
||||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string mesRes = MESApiHelper.HttpPostJsonAPI(
|
||||
|
||||
@@ -40,6 +40,18 @@ namespace JY.MES.MES
|
||||
/// 行信息
|
||||
/// </summary>
|
||||
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
|
||||
|
||||
@@ -53,6 +53,9 @@
|
||||
<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>
|
||||
</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">
|
||||
<HintPath>..\packages\NPOI.2.5.5\lib\net45\NPOI.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -113,6 +116,7 @@
|
||||
<Compile Include="EPPlusExcelHelper.cs" />
|
||||
<Compile Include="ExcelImporter.cs" />
|
||||
<Compile Include="IniFileHelper.cs" />
|
||||
<Compile Include="JsonHelper.cs" />
|
||||
<Compile Include="LogHelper.cs" />
|
||||
<Compile Include="OpenOfficeXML.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.CSharp" version="4.3.0" targetFramework="net472" />
|
||||
<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="Portable.BouncyCastle" version="1.8.9" targetFramework="net452" />
|
||||
<package id="SharpZipLib" version="1.4.2" targetFramework="net48" />
|
||||
|
||||
Reference in New Issue
Block a user