Browse Source

修改待扣减明细标识,标识那些有结算无法运,传给寄售库REMARK字段

master
学 赵 1 year ago
parent
commit
1c97c3b194
  1. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/GenerateJisInvoiceService.cs
  2. 33
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/GenerateJisInvoiceService.cs

@ -155,12 +155,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
PartCode = d.PartCode PartCode = d.PartCode
}; };
var dtos = q.ToList(); var dtos = q.ToList();
if (dtos != null && dtos.Count > 0) if (dtos != null && dtos.Count > 0)
{ {
if (billNum.Substring(0, 1) == "C")//一次开票 if (billNum.Substring(0, 1) == "C")//一次开票

33
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs

@ -53,26 +53,33 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2))
{ {
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").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 == "JisBBAC顺义").Description; itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description;
itm.Extend3 = "有结无发";
} }
} }
Sync(jisdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); 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);//买单件 var mdetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianBBAC);//买单件
if (mdetail != null && mdetail.Count() > 0) if (mdetail != null && mdetail.Count() > 0)
{ {
foreach (var itm in jisdetail) foreach (var itm in mdetail)
{ {
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2))
{ {
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").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 == "JisBBAC顺义").Description; itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description;
itm.Extend3 = "有结无发";
} }
} }
Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); 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)) 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); Sync(zgbbaclist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false);
var ydlist = detailist1.Where(p => p.BusinessType == EnumBusinessType.YinDuJian).ToList(); var ydlist = detailist1.Where(p => p.BusinessType == EnumBusinessType.YinDuJian).ToList();
if (ydlist.Count > 0) if (ydlist.Count > 0)
{ {
foreach (var itm in zgbbaclist) foreach (var itm in ydlist)
{ {
if (string.IsNullOrEmpty(itm.Extend2)) if (string.IsNullOrEmpty(itm.Extend2))
{ {
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "YinDuJian").Description; itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "YinDuJian").Description;
itm.Extend3 = "有结算无发运";
} }
} }
Sync(ydlist, EnumDeliverBjBmpBillType., email, isout == "out" ? true : false); Sync(ydlist, EnumDeliverBjBmpBillType., email, isout == "out" ? true : false);
@ -113,6 +123,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
if (string.IsNullOrEmpty(itm.Extend2)) if (string.IsNullOrEmpty(itm.Extend2))
{ {
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "BeiJian").Description; itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "BeiJian").Description;
itm.Extend3 = "有结算无发运";
} }
} }
Sync(bjlist, EnumDeliverBjBmpBillType.4S备件, email, isout == "out" ? true : false); 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)) if (string.IsNullOrEmpty(itm.Extend2))
{ {
itm.Extend2 = "CC017"; itm.Extend2 = "CC017";
itm.Extend3 = "有结算无发运";
} }
} }
if(detailist.Count>0) if(detailist.Count>0)
@ -140,6 +152,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
if (string.IsNullOrEmpty(itm.Extend2)) if (string.IsNullOrEmpty(itm.Extend2))
{ {
itm.Extend2 = "CC017"; itm.Extend2 = "CC017";
itm.Extend3 = "有结算无发运";
} }
} }
if (mdetail.Count > 0) if (mdetail.Count > 0)
@ -154,6 +167,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
if (string.IsNullOrEmpty(itm.Extend2)) if (string.IsNullOrEmpty(itm.Extend2))
{ {
itm.Extend2 = "CC017"; itm.Extend2 = "CC017";
itm.Extend3 = "有结算无发运";
} }
} }
if (zgbbaclist.Count > 0) if (zgbbaclist.Count > 0)
@ -186,7 +200,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
var query = from itm in p_ls var query = from itm in p_ls
select new VmiLog() select new VmiLog()
{ {
CodeType = string.Empty, CodeType = string.Empty,
BillTime = DateTime.Now, BillTime = DateTime.Now,
ChangedTime = DateTime.Now, ChangedTime = DateTime.Now,
@ -204,6 +217,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
VinCode = itm.PN, VinCode = itm.PN,
OrderNum = itm.GroupNum, OrderNum = itm.GroupNum,
ErpToLoc = itm.Extend2, //寄售库 ErpToLoc = itm.Extend2, //寄售库
ReMark = itm.Extend3
}; };
var ls = query.ToList(); var ls = query.ToList();
foreach (var itm in ls) 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 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 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(); var pddetail = _dbcontext.Set<PUB_PD_DETAIL>().Where(p => billList.Contains(p.BillNum)).ToList();
if (pdList.Count > 0) if (pdList.Count > 0)
{ {
if (flag == true) if (flag == true)
@ -352,7 +364,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
_dbcontext.BulkDelete(hbpoList); _dbcontext.BulkDelete(hbpoList);
_dbcontext.BulkDelete(hbpoDetail); _dbcontext.BulkDelete(hbpoDetail);
_dbcontext.BulkUpdate(hbpoinvList); _dbcontext.BulkUpdate(hbpoinvList);
} }
} }
} }

Loading…
Cancel
Save