Browse Source

更新版本

master
学 赵 1 year ago
parent
commit
916ee19624
  1. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  2. 103
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

14
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs

@ -605,6 +605,20 @@ namespace Win.Sfs.SettleAccount.Bases
errors.Add(new ERR_EXP_DTO() { Message = $"零件号{itm.LU},标识号(生产码){itm.PN}有重复数据!" });
}
return errors;
}

103
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
@ -300,36 +301,91 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
if (adjlist != null && adjlist.Count > 0)
{
var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList();
var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault());
var errors = await CheckAdJRules(adjlist, relist.ToList(), inv.BusinessType);
if (errors.Count > 0)
{
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errors).ConfigureAwait(false) });
}
if (inv.BusinessType == EnumBusinessType.BeiJian)
{
var dfirst = publist.FirstOrDefault();
foreach (var itm in adjlist)
{
foreach (var itm in adjlist)
//{ "ContractDocID":"2200674763",
// "DeliveryNumber":"180054628",
// "VendorCode":"15663496",
// "VendorName":"",
// "PO":"4500028814",
// "DeliveryIndexNumber":
// "5600153638",
// "PartName":"\u9970\u4EF6",
// "PartGroup":"EXT",
// "PN":"15663496_231237",
// "SettleDate":"06/01/2023 00:00:00"
// }
var entity = new PUB_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: itm.Price,
businessType: dfirst.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: inv.InvGroupNum,
invbillnum: string.Empty,
partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode,
pobillnum: string.Empty
);
entity.SetProperty("DeliveryNumber", "");
entity.SetProperty("VendorCode", dfirst.GetProperty("VendorCode", string.Empty));
entity.SetProperty("VendorName", "");
entity.SetProperty("PO", "");
entity.SetProperty("DeliveryIndexNumber", "");
entity.SetProperty("PartName", "");
entity.SetProperty("PartGroup", "EXT");
entity.SetProperty("PN", "");
entity.SetProperty("SettleDate", itm.SettleDate);
publist.Add(entity);
}
}
else
{
publist.Add(new PUB_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: itm.Price,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: inv.InvGroupNum,
invbillnum: string.Empty,
partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode,
pobillnum: string.Empty
));
var dfirst = publist.FirstOrDefault();
foreach (var itm in adjlist)
{
var entity = new PUB_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: dfirst.Site,
qty: itm.Qty,
price: itm.Price,
businessType:dfirst.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: inv.InvGroupNum,
invbillnum: string.Empty,
partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode,
pobillnum: string.Empty
);
publist.Add(entity);
}
}
}
var entitys = publist;//合并库存调整单和就发票可结算明细数据
@ -360,7 +416,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
break;
}
var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false);
if (errorList.Count > 0)
{
@ -397,6 +453,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{
if (invbillnum.Substring(0, 3) == "INV")//一次开票重开
{
await ReissueFirstInvoice(publist, adjlist, dtos, version, invbillnum).ConfigureAwait(false);
}
else//二次开票

Loading…
Cancel
Save