commit
This commit is contained in:
@@ -5,9 +5,10 @@ using System.Text;
|
|||||||
|
|
||||||
namespace NX.ERP.BLL.Model
|
namespace NX.ERP.BLL.Model
|
||||||
{
|
{
|
||||||
public class Inbound:NX.ERP.Model.BaseModel
|
public class Inbound : NX.ERP.Model.BaseModel
|
||||||
{
|
{
|
||||||
public string InboundNo { get; set; }
|
public string InboundNo { get; set; }
|
||||||
|
//[Newtonsoft.Json.JsonConverter(typeof(NX.ERP.Model.TimestampConverter))]
|
||||||
public DateTime InboundDate { get; set; }
|
public DateTime InboundDate { get; set; }
|
||||||
|
|
||||||
public InboundType InboundType { get; set; }
|
public InboundType InboundType { get; set; }
|
||||||
|
|||||||
@@ -31,6 +31,9 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
@@ -61,5 +64,8 @@
|
|||||||
<Name>NX.ERP.U8</Name>
|
<Name>NX.ERP.U8</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
4
NX.ERP.BLL/packages.config
Normal file
4
NX.ERP.BLL/packages.config
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net35" />
|
||||||
|
</packages>
|
||||||
@@ -61,6 +61,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="BaseModel.cs" />
|
<Compile Include="BaseModel.cs" />
|
||||||
|
<Compile Include="TimestampConverter.cs" />
|
||||||
<Compile Include="Request\Arrival.cs" />
|
<Compile Include="Request\Arrival.cs" />
|
||||||
<Compile Include="Request\Bin.cs" />
|
<Compile Include="Request\Bin.cs" />
|
||||||
<Compile Include="Request\Customer.cs" />
|
<Compile Include="Request\Customer.cs" />
|
||||||
|
|||||||
36
NX.ERP.Model/TimestampConverter.cs
Normal file
36
NX.ERP.Model/TimestampConverter.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace NX.ERP.Model
|
||||||
|
{
|
||||||
|
public class TimestampConverter : JsonConverter
|
||||||
|
{
|
||||||
|
public override bool CanConvert(Type objectType)
|
||||||
|
{
|
||||||
|
return objectType == typeof(DateTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||||
|
{
|
||||||
|
return ConvertIntDateTime(int.Parse(reader.Value.ToString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||||
|
{
|
||||||
|
writer.WriteValue(ConvertDateTimeInt((DateTime)value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DateTime ConvertIntDateTime(int aSeconds)
|
||||||
|
{
|
||||||
|
return new DateTime(1970, 1, 1).AddSeconds(aSeconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int ConvertDateTimeInt(DateTime aDT)
|
||||||
|
{
|
||||||
|
return (int)(aDT - new DateTime(1970, 1, 1)).TotalSeconds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -55,6 +55,8 @@ namespace NX.ERP.WebAPi
|
|||||||
{
|
{
|
||||||
//忽略循环引用,如果设置为Error,则遇到循环引用的时候报错
|
//忽略循环引用,如果设置为Error,则遇到循环引用的时候报错
|
||||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
|
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
|
||||||
|
DateTimeZoneHandling=DateTimeZoneHandling.Local,
|
||||||
|
|
||||||
//NullValueHandling = NullValueHandling.Ignore,
|
//NullValueHandling = NullValueHandling.Ignore,
|
||||||
//Formatting = Newtonsoft.Json.Formatting.Indented,
|
//Formatting = Newtonsoft.Json.Formatting.Indented,
|
||||||
//小驼峰命名法
|
//小驼峰命名法
|
||||||
@@ -64,7 +66,7 @@ namespace NX.ERP.WebAPi
|
|||||||
NamingStrategy = new SnakeCaseNamingStrategy()
|
NamingStrategy = new SnakeCaseNamingStrategy()
|
||||||
}
|
}
|
||||||
//格式化日期时间
|
//格式化日期时间
|
||||||
|
|
||||||
//空值处理
|
//空值处理
|
||||||
//NullValueHandling = NullValueHandling.Ignore
|
//NullValueHandling = NullValueHandling.Ignore
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
## U8API
|
## U8API
|
||||||
|
|
||||||
##HTTP 错误 500.21 - Internal Server Error
|
### HTTP 错误 500.21 - Internal Server Error
|
||||||
处理程序“ExtensionlessUrlHandler-Integrated-4.0”在其模块列表中有一个错误模块“ManagedPipelineHandler”
|
处理程序“ExtensionlessUrlHandler-Integrated-4.0”在其模块列表中有一个错误模块“ManagedPipelineHandler”
|
||||||
| C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
|
| C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
|
||||||
|
### 时间不一致问题
|
||||||
|
注册表 搜索sShortDate 全改为 yyyy-MM-dd
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user