|
|
@ -5,11 +5,13 @@ using System.ServiceModel.Channels; |
|
|
|
using System.Text; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using DocumentFormat.OpenXml.Office2010.Excel; |
|
|
|
using EFCore.BulkExtensions; |
|
|
|
using Microsoft.CodeAnalysis.CSharp.Syntax; |
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Conventions; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using Nito.AsyncEx; |
|
|
|
using NPOI.HSSF.Util; |
|
|
|
using NPOI.OpenXmlFormats; |
|
|
|
using NPOI.SS.Formula.Functions; |
|
|
|
using SettleAccount.Bases; |
|
|
@ -58,7 +60,7 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
|
//MaiDanJianHBPO
|
|
|
|
//BeiJian
|
|
|
|
//YinDuJian
|
|
|
|
if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" ) |
|
|
|
if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type== "BeiJian") |
|
|
|
{ |
|
|
|
var jisdetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisBBAC);//jis
|
|
|
|
if (jisdetail != null && jisdetail.Count() > 0) |
|
|
@ -123,6 +125,22 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
|
} |
|
|
|
Sync(ydlist, EnumDeliverBjBmpBillType.印度件, isout == "out" ? true : false); |
|
|
|
} |
|
|
|
var bjlist = detailist1.Where(p => p.BusinessType == EnumBusinessType.BeiJian).ToList(); |
|
|
|
if (bjlist.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in bjlist) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "BeiJian").Description; |
|
|
|
} |
|
|
|
} |
|
|
|
Sync(bjlist, EnumDeliverBjBmpBillType.北汽4S备件, isout == "out" ? true : false); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else if (type == "JisHBPO" || type == "ZhiGongJianHBPO" || type == "MaiDanJianHBPO") |
|
|
@ -179,7 +197,8 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
|
{ |
|
|
|
var query = from itm in p_ls |
|
|
|
select new VmiLog() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
CodeType=string.Empty, |
|
|
|
BillTime = DateTime.Now, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
@ -199,7 +218,12 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
|
ErpToLoc = itm.Extend2, //寄售库
|
|
|
|
}; |
|
|
|
var ls = query.ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var itm in ls) |
|
|
|
{ |
|
|
|
itm.SetId(GuidGenerator.Create()); |
|
|
|
} |
|
|
|
var _first= p_ls.FirstOrDefault(); |
|
|
|
using (var transaction =_dbcontext.Database.BeginTransaction()) |
|
|
|
{ |
|
|
@ -212,8 +236,7 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
|
|
|
|
|
var messagelist = new List<VmiMessage>(); |
|
|
|
|
|
|
|
_dbcontext.BulkInsert(ls); |
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in ls) |
|
|
|
{ |
|
|
|
var message = new VmiMessage |
|
|
|