Browse Source

添加备件协议编号输出,修改待扣减正向结算和反向结算

master
学 赵 1 year ago
parent
commit
63d3cd23d4
  1. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
  2. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  3. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  4. 17
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
  5. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs
  6. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  7. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs
  8. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs

@ -136,6 +136,12 @@ namespace Win.Sfs.SettleAccount.Bases
[UnitOfWork(false)] [UnitOfWork(false)]
public virtual async Task<string> ApprovalPassed(List<string> p_list) public virtual async Task<string> ApprovalPassed(List<string> p_list)
{ {
var bussinessType=p_list.FirstOrDefault();
return await InvokePD(p_list, _service); return await InvokePD(p_list, _service);
} }
[HttpPost] [HttpPost]

5
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

@ -432,6 +432,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
bj.Extend1 = itm.Extend1;//合同号 bj.Extend1 = itm.Extend1;//合同号
bj.VendorCode = itm.GetProperty("VendorCode", "");//供应商代码 bj.VendorCode = itm.GetProperty("VendorCode", "");//供应商代码
bj.VendorName = itm.GetProperty("VendorName", "");//供应商名称 bj.VendorName = itm.GetProperty("VendorName", "");//供应商名称
bj.ContractID = itm.GetProperty("ContractDocID", "");//协议编号
bj.DeliveryNumber = itm.GetProperty("DeliveryNumber", "");//交货号; bj.DeliveryNumber = itm.GetProperty("DeliveryNumber", "");//交货号;
bj.PN = itm.GetProperty("PN", "");// bj.PN = itm.GetProperty("PN", "");//
bj.PO = itm.GetProperty("PO", ""); bj.PO = itm.GetProperty("PO", "");
@ -483,7 +484,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
TaxAmt = itm.TaxAmt, TaxAmt = itm.TaxAmt,
SettleDate = itm.SettleDate, SettleDate = itm.SettleDate,
ProductionGroup = itm.ProductionGroup, ProductionGroup = itm.ProductionGroup,
LineCode = itm.LineCode LineCode = itm.LineCode,
ContractID=itm.ContractID
}; };
entity.INVOICE_WAIT_DETAIL_BJ = bjquery.OrderBy(p => p.LineCode).ToList(); entity.INVOICE_WAIT_DETAIL_BJ = bjquery.OrderBy(p => p.LineCode).ToList();

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs

@ -80,7 +80,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单 var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单
foreach (var itm in priceListbj) foreach (var itm in priceListbj)
{ {
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price ,ClientCode="1049"}); priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price ,ClientCode="1049", ContractNo=itm.ContractNo});
} }
} }
else else
@ -119,7 +119,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Qty = d.Qty, Qty = d.Qty,
GroupNum = d.GroupNum, GroupNum = d.GroupNum,
Amt = Math.Round(d.Qty * p.Price, 2), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "no", ContractDocID = (d.BusinessType != EnumBusinessType.BeiJian) ? string.Empty : p.ContractNo,
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime, EndDate = p.EndTime,
PartCode = d.PartCode,//客户零件号 PartCode = d.PartCode,//客户零件号

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

@ -129,8 +129,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
itm.Extend2 = "CC017"; itm.Extend2 = "CC017";
} }
} }
if(detailist.Count>0)
{
Sync(detailist, EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); Sync(detailist, EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false);
var mdetail = _dbcontext.Set<HBPO_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianHBPO);//买单件 }
var mdetail = _dbcontext.Set<HBPO_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianHBPO).ToList();//买单件
foreach (var itm in mdetail) foreach (var itm in mdetail)
{ {
if (string.IsNullOrEmpty(itm.Extend2)) if (string.IsNullOrEmpty(itm.Extend2))
@ -138,7 +142,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
itm.Extend2 = "CC017"; itm.Extend2 = "CC017";
} }
} }
if (mdetail.Count > 0)
{
Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false);
}
var detailist1 = _dbcontext.Set<PUB_PD_DETAIL>().Where(p => list.Contains(p.BillNum)).ToList(); var detailist1 = _dbcontext.Set<PUB_PD_DETAIL>().Where(p => list.Contains(p.BillNum)).ToList();
var zgbbaclist = detailist1.Where(p => p.BusinessType == EnumBusinessType.ZhiGongJianHBPO).ToList(); var zgbbaclist = detailist1.Where(p => p.BusinessType == EnumBusinessType.ZhiGongJianHBPO).ToList();
foreach (var itm in zgbbaclist) foreach (var itm in zgbbaclist)
@ -148,7 +156,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
itm.Extend2 = "CC017"; itm.Extend2 = "CC017";
} }
} }
Sync(detailist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); if (zgbbaclist.Count > 0)
{
Sync(zgbbaclist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false);
}
} }
return id.ToString(); return id.ToString();
} }

1
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs

@ -120,7 +120,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <exception cref="BusinessException"></exception> /// <exception cref="BusinessException"></exception>
public virtual async Task<bool> SetBackwardState(string p_billNum, SettleBillState state) public virtual async Task<bool> SetBackwardState(string p_billNum, SettleBillState state)
{ {
var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList();
if (ls == null && ls.Count == 0) if (ls == null && ls.Count == 0)
{ {

9
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -348,6 +348,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// </summary> /// </summary>
/// <param name="p_billNum"></param> /// <param name="p_billNum"></param>
/// <returns></returns> /// <returns></returns>
[UnitOfWork(false)]
public virtual async Task<List<INVOICE_GRP>> GetInvoiceListAsync(List<string> invs) public virtual async Task<List<INVOICE_GRP>> GetInvoiceListAsync(List<string> invs)
{ {
return await _repository.Where(p => invs.Contains(p.InvbillNum)).ToListAsync().ConfigureAwait(false); return await _repository.Where(p => invs.Contains(p.InvbillNum)).ToListAsync().ConfigureAwait(false);
@ -611,7 +612,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
partcode: itm.PartCode); partcode: itm.PartCode);
entity.ErpLoc = itm.ErpLoc;//补字段库位 entity.ErpLoc = itm.ErpLoc;//补字段库位
entity.PartCode = itm.RealPartCode;//真实零件号 entity.PartCode = itm.RealPartCode;//真实零件号
entityDetail.Add(entity); entityDetail.Add(entity);
} }
} }
@ -809,8 +809,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
bbacDetail.Add(entity bbacDetail.Add(entity
); );
} }
await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false); await _repository.DbContext.BulkInsertAsync(bbacmainlist);
await _repository.DbContext.BulkInsertAsync(bbacDetail).ConfigureAwait(false); await _repository.DbContext.BulkInsertAsync(bbacDetail);
foreach (var itm in invList) foreach (var itm in invList)
{ {
@ -2249,6 +2249,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
BeginDate = dto1.BeginDate, BeginDate = dto1.BeginDate,
EndDate = dto1.EndDate, EndDate = dto1.EndDate,
LineCode = dto1.LineCode, LineCode = dto1.LineCode,
ContractDocID = dto1.ContractDocID,
DeliveryNumber = inv1.GetProperty("DeliveryNumber", ""),//交货号 DeliveryNumber = inv1.GetProperty("DeliveryNumber", ""),//交货号
InvoiceNumber = inv1.GetProperty("InvoiceNumber", ""),//发票号 InvoiceNumber = inv1.GetProperty("InvoiceNumber", ""),//发票号
VendorCode = inv1.GetProperty("VendorCode", ""),//供应商代码 VendorCode = inv1.GetProperty("VendorCode", ""),//供应商代码
@ -2302,6 +2303,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
endDate: detail.EndDate, endDate: detail.EndDate,
partcode: detail.PartCode); partcode: detail.PartCode);
entity.LineCode = detail.LineCode; entity.LineCode = detail.LineCode;
entity.SetProperty("ContractDocID", detail.ContractDocID);//交货号
entity.SetProperty("DeliveryNumber", detail.DeliveryNumber);//交货号 entity.SetProperty("DeliveryNumber", detail.DeliveryNumber);//交货号
entity.SetProperty("VendorCode", detail.VendorCode);//供应商代码 entity.SetProperty("VendorCode", detail.VendorCode);//供应商代码
entity.SetProperty("VendorName", detail.VendorName);//供应商名称 entity.SetProperty("VendorName", detail.VendorName);//供应商名称

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs

@ -186,7 +186,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
break; break;
} }
await _repository.UpdateAsync(p_entiy).ConfigureAwait(false); await _repository.DbContext.BulkUpdateAsync(new List<PUB_CAN_SA> { p_entiy }).ConfigureAwait(false);
return true; return true;
} }
return false; return false;

3
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs

@ -41,8 +41,7 @@ namespace SettleAccount.Domain.BQ
/// <summary> /// <summary>
/// 1、JIT 2、买单件 3、备件 3、印度件 /// 1、JIT 2、买单件 3、备件 3、印度件
/// </summary> /// </summary>
[Display(Name = "业务类别")]
public EnumBusinessType BusinessType { get; set; }
//[Display(Name = "发票分组号")] //[Display(Name = "发票分组号")]
//public string InvGroupNum { get; set; } = null!; //public string InvGroupNum { get; set; } = null!;

Loading…
Cancel
Save