|
|
@ -53,26 +53,33 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
|
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; |
|
|
|
itm.Extend3 = "有结无发"; |
|
|
|
} |
|
|
|
else |
|
|
|
|
|
|
|
if (itm.Site == "1046" && string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; |
|
|
|
itm.Extend3 = "有结无发"; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
Sync(jisdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); |
|
|
|
} |
|
|
|
var mdetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianBBAC);//买单件
|
|
|
|
if (mdetail != null && mdetail.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in jisdetail) |
|
|
|
foreach (var itm in mdetail) |
|
|
|
{ |
|
|
|
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; |
|
|
|
itm.Extend3 = "有结无发"; |
|
|
|
} |
|
|
|
else |
|
|
|
|
|
|
|
if (itm.Site == "1046" && string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; |
|
|
|
itm.Extend3 = "有结无发"; |
|
|
|
} |
|
|
|
} |
|
|
|
Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); |
|
|
@ -85,22 +92,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
|
{ |
|
|
|
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "ZhiGongJianBBAC").Description; |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; |
|
|
|
itm.Extend3 = "有结算无发运"; |
|
|
|
} |
|
|
|
else |
|
|
|
if (itm.Site == "1046" && string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "ZhiGongJianBBAC顺义").Description; |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; |
|
|
|
itm.Extend3 = "有结算无发运"; |
|
|
|
} |
|
|
|
} |
|
|
|
Sync(zgbbaclist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); |
|
|
|
var ydlist = detailist1.Where(p => p.BusinessType == EnumBusinessType.YinDuJian).ToList(); |
|
|
|
if (ydlist.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in zgbbaclist) |
|
|
|
foreach (var itm in ydlist) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "YinDuJian").Description; |
|
|
|
itm.Extend3 = "有结算无发运"; |
|
|
|
} |
|
|
|
} |
|
|
|
Sync(ydlist, EnumDeliverBjBmpBillType.印度件, email, isout == "out" ? true : false); |
|
|
@ -113,6 +123,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
|
if (string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "BeiJian").Description; |
|
|
|
itm.Extend3 = "有结算无发运"; |
|
|
|
} |
|
|
|
} |
|
|
|
Sync(bjlist, EnumDeliverBjBmpBillType.北汽4S备件, email, isout == "out" ? true : false); |
|
|
@ -127,6 +138,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
|
if (string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = "CC017"; |
|
|
|
itm.Extend3 = "有结算无发运"; |
|
|
|
} |
|
|
|
} |
|
|
|
if(detailist.Count>0) |
|
|
@ -140,6 +152,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
|
if (string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = "CC017"; |
|
|
|
itm.Extend3 = "有结算无发运"; |
|
|
|
} |
|
|
|
} |
|
|
|
if (mdetail.Count > 0) |
|
|
@ -154,6 +167,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
|
if (string.IsNullOrEmpty(itm.Extend2)) |
|
|
|
{ |
|
|
|
itm.Extend2 = "CC017"; |
|
|
|
itm.Extend3 = "有结算无发运"; |
|
|
|
} |
|
|
|
} |
|
|
|
if (zgbbaclist.Count > 0) |
|
|
@ -186,25 +200,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
|
var query = from itm in p_ls |
|
|
|
select new VmiLog() |
|
|
|
{ |
|
|
|
|
|
|
|
CodeType = string.Empty, |
|
|
|
BillTime = DateTime.Now, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
RealPartCode = itm.RELU,//替换件 结算数据 RealPartCode->RELU
|
|
|
|
RealCode = itm.RELU, |
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = (flag == true) ? -itm.Qty : itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
//SubBillType = EnumDeliverSubBillType.小件BBAC,
|
|
|
|
//BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
CustPartCode = itm.LU, |
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
DeliverBillType = bussinessType, |
|
|
|
VinCode = itm.PN, |
|
|
|
OrderNum = itm.GroupNum, |
|
|
|
ErpToLoc = itm.Extend2, //寄售库
|
|
|
|
}; |
|
|
|
CodeType = string.Empty, |
|
|
|
BillTime = DateTime.Now, |
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
Qty = itm.Qty, |
|
|
|
RealPartCode = itm.RELU,//替换件 结算数据 RealPartCode->RELU
|
|
|
|
RealCode = itm.RELU, |
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
ChangedQty = (flag == true) ? -itm.Qty : itm.Qty, |
|
|
|
ChangedType = VmiType.Out, |
|
|
|
//SubBillType = EnumDeliverSubBillType.小件BBAC,
|
|
|
|
//BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
CustPartCode = itm.LU, |
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
DeliverBillType = bussinessType, |
|
|
|
VinCode = itm.PN, |
|
|
|
OrderNum = itm.GroupNum, |
|
|
|
ErpToLoc = itm.Extend2, //寄售库
|
|
|
|
ReMark = itm.Extend3 |
|
|
|
}; |
|
|
|
var ls = query.ToList(); |
|
|
|
foreach (var itm in ls) |
|
|
|
{ |
|
|
@ -234,8 +248,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
|
var pdList = _dbcontext.Set<PUB_PD>().Where(p => billList.Contains(p.BillNum)).ToList();//扣减单内容
|
|
|
|
var pdinvList = _dbcontext.Set<INVOICE_GRP>().Where(p => billList.Contains(p.InvbillNum)).ToList(); |
|
|
|
var pddetail = _dbcontext.Set<PUB_PD_DETAIL>().Where(p => billList.Contains(p.BillNum)).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
if (pdList.Count > 0) |
|
|
|
{ |
|
|
|
if (flag == true) |
|
|
@ -352,7 +364,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
|
_dbcontext.BulkDelete(hbpoList); |
|
|
|
_dbcontext.BulkDelete(hbpoDetail); |
|
|
|
_dbcontext.BulkUpdate(hbpoinvList); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|