Browse Source

up

master
mahao 1 year ago
parent
commit
12fce6aaef
  1. 71
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs

71
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs

@ -126,7 +126,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
RealPartCode = t.RealPartCode, RealPartCode = t.RealPartCode,
Seq = t.Seq, Seq = t.Seq,
UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode, UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode,
VinCode = t.VinCode, VinCode = t.PN,
Version = GetVersionByBillTimeAsync(t.BillTime.Value, value),//加区间字段 Version = GetVersionByBillTimeAsync(t.BillTime.Value, value),//加区间字段
factory = t.BusinessType.ToString() factory = t.BusinessType.ToString()
}).ToList(); }).ToList();
@ -167,8 +167,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
ReMark = t.Remark, ReMark = t.Remark,
RealPartCode = t.PartCode, RealPartCode = t.PartCode,
VinCode = t.PN, VinCode = t.PN,
Version=GetVersionByBillTimeAsync(t.BillTime.Value,value),//加区间字段 Version = GetVersionByBillTimeAsync(t.BillTime.Value, value),//加区间字段
factory=t.BusinessType.ToString() factory = t.BusinessType.ToString()
}).ToList(); }).ToList();
var returnVmiLogList = returnSeDetails.Select(t => new VmiLog var returnVmiLogList = returnSeDetails.Select(t => new VmiLog
@ -189,6 +189,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
Qty = -t.Qty, Qty = -t.Qty,
ReMark = t.Remark, ReMark = t.Remark,
RealPartCode = t.PartCode, RealPartCode = t.PartCode,
VinCode = t.PN,
Version = GetVersionByBillTimeAsync(t.BillTime.Value, value),//加区间字段 Version = GetVersionByBillTimeAsync(t.BillTime.Value, value),//加区间字段
factory = t.BusinessType.ToString() factory = t.BusinessType.ToString()
@ -219,50 +220,50 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
} }
public int GetVersionByBillTimeAsync(DateTime p_billtime,string p_day) public int GetVersionByBillTimeAsync(DateTime p_billtime, string p_day)
{ {
var before = p_billtime.Year; var before = p_billtime.Year;
var last = before - 1; var last = before - 1;
DateTime lastYear = DateTime.ParseExact(string.Format("{0}-12-{1} 08:00:00", last,p_day), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);//上期时间 DateTime lastYear = DateTime.ParseExact(string.Format("{0}-12-{1} 08:00:00", last, p_day), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);//上期时间
DateTime beforeYear = DateTime.ParseExact(string.Format("{0}-12-{1} 07:59:59", before,p_day), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);//这期时间 DateTime beforeYear = DateTime.ParseExact(string.Format("{0}-12-{1} 07:59:59", before, p_day), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);//这期时间
//var result = seDetails //var result = seDetails
// .Select(log => // .Select(log =>
// { // {
string version = null; string version = null;
if (p_billtime >= lastYear && p_billtime <= lastYear.AddMonths(1)) if (p_billtime >= lastYear && p_billtime <= lastYear.AddMonths(1))
{ {
version = $"{before.ToString()}01"; version = $"{before.ToString()}01";
} }
else if (p_billtime >= lastYear.AddMonths(1) && p_billtime <= lastYear.AddMonths(2)) else if (p_billtime >= lastYear.AddMonths(1) && p_billtime <= lastYear.AddMonths(2))
{ version = $"{before.ToString()}02"; } { version = $"{before.ToString()}02"; }
else if (p_billtime >= lastYear.AddMonths(2) && p_billtime <= lastYear.AddMonths(3)) else if (p_billtime >= lastYear.AddMonths(2) && p_billtime <= lastYear.AddMonths(3))
{ version = $"{before.ToString()}03"; } { version = $"{before.ToString()}03"; }
else if (p_billtime >= lastYear.AddMonths(3) && p_billtime <= lastYear.AddMonths(4)) else if (p_billtime >= lastYear.AddMonths(3) && p_billtime <= lastYear.AddMonths(4))
{ version = $"{before.ToString()}04"; } { version = $"{before.ToString()}04"; }
else if (p_billtime >= lastYear.AddMonths(4) && p_billtime <= lastYear.AddMonths(5)) else if (p_billtime >= lastYear.AddMonths(4) && p_billtime <= lastYear.AddMonths(5))
{ version = $"{before.ToString()}05"; } { version = $"{before.ToString()}05"; }
else if (p_billtime >= lastYear.AddMonths(5) && p_billtime <= lastYear.AddMonths(6)) else if (p_billtime >= lastYear.AddMonths(5) && p_billtime <= lastYear.AddMonths(6))
{ version = $"{before.ToString()}06"; } { version = $"{before.ToString()}06"; }
else if (p_billtime >= lastYear.AddMonths(6) && p_billtime <= lastYear.AddMonths(7)) else if (p_billtime >= lastYear.AddMonths(6) && p_billtime <= lastYear.AddMonths(7))
{ version = $"{before.ToString()}07"; } { version = $"{before.ToString()}07"; }
else if (p_billtime >= lastYear.AddMonths(7) && p_billtime <= lastYear.AddMonths(8)) else if (p_billtime >= lastYear.AddMonths(7) && p_billtime <= lastYear.AddMonths(8))
{ version = $"{before.ToString()}08"; } { version = $"{before.ToString()}08"; }
else if (p_billtime >= lastYear.AddMonths(8) && p_billtime <= lastYear.AddMonths(9)) else if (p_billtime >= lastYear.AddMonths(8) && p_billtime <= lastYear.AddMonths(9))
{ version = $"{before.ToString()}09"; } { version = $"{before.ToString()}09"; }
else if (p_billtime >= lastYear.AddMonths(9) && p_billtime <= lastYear.AddMonths(10)) else if (p_billtime >= lastYear.AddMonths(9) && p_billtime <= lastYear.AddMonths(10))
{ version = $"{before.ToString()}10"; } { version = $"{before.ToString()}10"; }
else if (p_billtime >= lastYear.AddMonths(10) && p_billtime <= lastYear.AddMonths(11)) else if (p_billtime >= lastYear.AddMonths(10) && p_billtime <= lastYear.AddMonths(11))
{ version = $"{before.ToString()}11"; } { version = $"{before.ToString()}11"; }
else if (p_billtime >= lastYear.AddMonths(11) && p_billtime <= beforeYear) else if (p_billtime >= lastYear.AddMonths(11) && p_billtime <= beforeYear)
{ version = $"{before.ToString()}12"; } { version = $"{before.ToString()}12"; }
if (string.IsNullOrEmpty(version)) if (string.IsNullOrEmpty(version))
{ {
return 200802 ;//找不到的数据默认写到这个区间 return 200802;//找不到的数据默认写到这个区间
} }
return int.Parse(version); return int.Parse(version);

Loading…
Cancel
Save