This commit is contained in:
admin
2021-02-02 10:33:46 +08:00
parent 6ca5454a22
commit ad0b20f20a
9 changed files with 64 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ 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; }

View File

@@ -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>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net35" />
</packages>

View File

@@ -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" />

View 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;
}
}
}

View File

@@ -15,12 +15,12 @@ namespace NX.ERP.U8.Purchase
B.Autoid as id,b.ID as ArrivalID, B.Autoid as id,b.ID as ArrivalID,
b.cInvCode AS MaterialCode, b.cInvCode AS MaterialCode,
b.cBatch AS BatchNo, b.cBatch AS BatchNo,
b.fRealQuantity as RealQuantity, b.fRefuseQuantity as RealQuantity,
b.cUnitID AS UnitCode,b.ioricost as oricost,b.ioritaxcost as oritaxcost ,b.icost as cost,b.iorimoney as orimoney,b.ioritaxprice as oritaxprice,b.iorisum as orisum, b.cUnitID AS UnitCode,b.ioricost as oricost,b.ioritaxcost as oritaxcost ,b.icost as cost,b.iorimoney as orimoney,b.ioritaxprice as oritaxprice,b.iorisum as orisum,
B.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid from B.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid from
pu_ArrHead as a pu_ArrHead as a
left join pu_arrbody as b on a.id=b.id left join pu_arrbody as b on a.id=b.id
Left Join PO_Podetails C WITH (NOLOCK) ON B.iPOsID = C.ID where ISNULL( a.cverifier,'')<>'' and a.id in (select id from PO_Podetails where fRealQuantity<>iQuantity ) "; Left Join PO_Podetails C WITH (NOLOCK) ON B.iPOsID = C.ID where ISNULL( a.cverifier,'')<>'' and a.id in (select id from PO_Podetails where isnull( fRefuseQuantity,0)<>isnull( iQuantity,0) ) ";
if (!string.IsNullOrEmpty(strWhere)) if (!string.IsNullOrEmpty(strWhere))
{ {
strSQL += $" and {strWhere} "; strSQL += $" and {strWhere} ";

View File

@@ -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,
//小驼峰命名法 //小驼峰命名法

View File

@@ -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