Browse Source

修改发运表名称

master
mahao 1 year ago
parent
commit
f81c9b8caa
  1. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  2. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  3. 74
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
  4. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs
  5. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs
  6. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs
  7. 136
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs

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

@ -7,6 +7,7 @@ using System.Linq;
using System.Reflection; using System.Reflection;
using System.Security.Policy; using System.Security.Policy;
using System.Threading.Tasks; using System.Threading.Tasks;
using DocumentFormat.OpenXml.Spreadsheet;
using DocumentFormat.OpenXml.Drawing; using DocumentFormat.OpenXml.Drawing;
using DocumentFormat.OpenXml.Wordprocessing; using DocumentFormat.OpenXml.Wordprocessing;
using EFCore.BulkExtensions; using EFCore.BulkExtensions;
@ -42,11 +43,10 @@ using Win.Sfs.SettleAccount.Entities.Invoices;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.Suppliers;
using Win.Sfs.Shared;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
using static Dm.parser.LVal; using static Dm.parser.LVal;
using static LinqToDB.Sql; using static LinqToDB.Sql;
using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
@ -297,12 +297,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public virtual async Task<INVOICE_GRP_DETAIL_DTO> DetailQueryAsync(INVOICE_GRP_REQ_DTO input) public virtual async Task<INVOICE_GRP_DETAIL_DTO> DetailQueryAsync(INVOICE_GRP_REQ_DTO input)
{ {
INVOICE_GRP_DETAIL_DTO entity = new INVOICE_GRP_DETAIL_DTO(); INVOICE_GRP_DETAIL_DTO entity = new INVOICE_GRP_DETAIL_DTO();
input.Filters.Add(new FilterCondition("InvoiceState", "1", EnumFilterAction.Equal, EnumFilterLogic.And));
var materialList = await _baseservice.GetMaterialList().ConfigureAwait(false); var materialList = await _baseservice.GetMaterialList().ConfigureAwait(false);
var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false);
var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false);
var mdtos = ObjectMapper.Map<List<INVOICE_MAP_GROUP>, List<INVOICE_MAP_GROUP_DTO>>(m); var mdtos = ObjectMapper.Map<List<INVOICE_MAP_GROUP>, List<INVOICE_MAP_GROUP_DTO>>(m);
var first = invs.FirstOrDefault(); var first = invs.FirstOrDefault();
if (invs.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC) if (invs.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC)
{ {
var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false);

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

@ -395,7 +395,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
businessType: itm.BusinessType, businessType: itm.BusinessType,
settleDate: itm.SettleDate, settleDate: itm.SettleDate,
groupNum: itm.GroupNum, groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum, invGroupNum: inv.InvGroupNum,
invbillnum: string.Empty, invbillnum: string.Empty,
partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode, partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode,
pobillnum: string.Empty pobillnum: string.Empty
@ -569,7 +569,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
businessType: itm.BusinessType, businessType: itm.BusinessType,
settleDate: itm.SettleDate, settleDate: itm.SettleDate,
groupNum: itm.GroupNum, groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum, invGroupNum: inv.InvGroupNum,
invbillnum: string.Empty, invbillnum: string.Empty,
partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode, partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode,
pobillnum: string.Empty pobillnum: string.Empty

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

@ -31,52 +31,51 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
_dbcontext = dbcontext; _dbcontext = dbcontext;
} }
[UnitOfWork(false)] [UnitOfWork(false)]
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{
var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value;
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value;
var isout = property.Where(p => p.Name == "IsOut").FirstOrDefault().Value;
var email = string.Empty;
// property.Where(p => p.Name == "CurrentUserEmail").FirstOrDefault().Value;
var list = billList.Split(",");
var projectList = _dbcontext.Set<CodeSetting>().Where(p => p.Project == "库位");
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) var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value;
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value;
var isout = property.Where(p => p.Name == "IsOut").FirstOrDefault().Value;
var email = string.Empty;
// property.Where(p => p.Name == "CurrentUserEmail").FirstOrDefault().Value;
var list = billList.Split(",");
var projectList = _dbcontext.Set<CodeSetting>().Where(p => p.Project == "库位");
if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type == "BeiJian")
{ {
foreach (var itm in jisdetail) var jisdetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisBBAC);//jis
if (jisdetail != null && jisdetail.Count() > 0)
{ {
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) foreach (var itm in jisdetail)
{
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description;
}
else
{ {
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2))
{
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description;
}
else
{
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description;
}
} }
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);//买单件
} if (mdetail != null && mdetail.Count() > 0)
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)
{ {
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) foreach (var itm in jisdetail)
{ {
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2))
} {
else itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description;
{ }
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; else
{
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description;
}
} }
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();
if (detailist1.Count > 0) if (detailist1.Count > 0)
@ -151,9 +150,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
} }
Sync(detailist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); Sync(detailist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false);
} }
return id.ToString(); return id.ToString();
} }
//public List<T> GetPagedData<T>(List<T> dataList, int pageNumber, int pageSize) //public List<T> GetPagedData<T>(List<T> dataList, int pageNumber, int pageSize)

7
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs

@ -215,7 +215,12 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices
} }
return prices; // 所有价格时间都连续 return prices; // 所有价格时间都连续
} }
/// <summary>
///
/// </summary>
/// <param name="range1"></param>
/// <param name="range2"></param>
/// <returns></returns>
public static bool IsTimeOverlap(PriceList range1, PriceList range2) public static bool IsTimeOverlap(PriceList range1, PriceList range2)
{ {
return range1.BeginTime <= range2.EndTime && range1.EndTime >= range2.BeginTime; return range1.BeginTime <= range2.EndTime && range1.EndTime >= range2.BeginTime;

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs

@ -61,6 +61,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
return errors; return errors;
} }
var site = first.Site;
var billNumber = OrderNumberGenerator.GenerateOrderNumber("N"); var billNumber = OrderNumberGenerator.GenerateOrderNumber("N");
var _entity = new BBAC_CAN_SA(); var _entity = new BBAC_CAN_SA();
_entity.SetId(Guid.NewGuid()); _entity.SetId(Guid.NewGuid());
@ -69,10 +71,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
_entity.Version = int.Parse(DateTime.Now.ToString("yyyyMM")); _entity.Version = int.Parse(DateTime.Now.ToString("yyyyMM"));
_entity.State = SettleBillState.; _entity.State = SettleBillState.;
_entity.SettleBillNum = string.Empty; _entity.SettleBillNum = string.Empty;
_entity.Site = first.Site; _entity.Site = site;
_entity.BusinessType = EnumBusinessType.JisBBAC; _entity.BusinessType = EnumBusinessType.JisBBAC;
var _entityList = new List<BBAC_CAN_SA_DETAIL>(); var _entityList = new List<BBAC_CAN_SA_DETAIL>();
var site = first.Site;
var pricelist = _priceRepository.Where(p => p.ClientCode == site && p.IsCancel == false).ToList(); var pricelist = _priceRepository.Where(p => p.ClientCode == site && p.IsCancel == false).ToList();
var query = from d in p_list var query = from d in p_list
join p in pricelist join p in pricelist

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs

@ -38,13 +38,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
INormalEfCoreRepository<HBPO_CAN_SA, Guid> repository, INormalEfCoreRepository<HBPO_CAN_SA, Guid> repository,
INormalEfCoreRepository<HBPO_CAN_SA_DETAIL, Guid> detailRepository, INormalEfCoreRepository<HBPO_CAN_SA_DETAIL, Guid> detailRepository,
INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> notRepository, INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> notRepository,
BaseDomainService service BaseDomainService service,
INormalEfCoreRepository<PriceList, Guid> priceRepository
) )
{ {
_repository = repository; _repository = repository;
_detailRepository = detailRepository; _detailRepository = detailRepository;
_notRepository = notRepository; _notRepository = notRepository;
_service = service; _service = service;
_priceRepository = priceRepository;
} }
public virtual async Task<List<string>> GenerateSettlementOrder(List<HBPO_NOT_SA_DETAIL> p_list) public virtual async Task<List<string>> GenerateSettlementOrder(List<HBPO_NOT_SA_DETAIL> p_list)
{ {

136
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs

@ -1,12 +1,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Security.Policy;
using System.Threading.Tasks; using System.Threading.Tasks;
using EFCore.BulkExtensions; using EFCore.BulkExtensions;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp.Data;
using Volo.Abp.Domain.Services; using Volo.Abp.Domain.Services;
using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Bases.DomainServices; using Win.Sfs.SettleAccount.Bases.DomainServices;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Managers namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
@ -26,6 +29,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
private readonly INormalEfCoreRepository<PUB_CAN_SA_DETAIL, Guid> _detailRepository; private readonly INormalEfCoreRepository<PUB_CAN_SA_DETAIL, Guid> _detailRepository;
private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notRepository; private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notRepository;
private readonly BaseDomainService _service; private readonly BaseDomainService _service;
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
private readonly INormalEfCoreRepository<PriceListBJ, Guid> _pricebjRepository;
public PUB_NOT_SA_MNG() public PUB_NOT_SA_MNG()
{ {
@ -36,9 +42,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
INormalEfCoreRepository<PUB_CAN_SA, Guid> repository, INormalEfCoreRepository<PUB_CAN_SA, Guid> repository,
INormalEfCoreRepository<PUB_CAN_SA_DETAIL, Guid> detailRepository, INormalEfCoreRepository<PUB_CAN_SA_DETAIL, Guid> detailRepository,
INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> notRepository, INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> notRepository,
BaseDomainService service BaseDomainService service,
INormalEfCoreRepository<PriceList, Guid> priceRepository,
INormalEfCoreRepository<PriceListBJ, Guid> pricebjRepository
) )
{ {
_priceRepository = priceRepository;
_pricebjRepository = pricebjRepository;
_service = service; _service = service;
_repository = repository; _repository = repository;
_detailRepository = detailRepository; _detailRepository = detailRepository;
@ -47,10 +59,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
public virtual async Task<List<string>> GenerateSettlementOrder(List<PUB_NOT_SA_DETAIL> p_list) public virtual async Task<List<string>> GenerateSettlementOrder(List<PUB_NOT_SA_DETAIL> p_list)
{ {
var first= p_list.FirstOrDefault(); var first= p_list.FirstOrDefault();
var site = first.Site;
List<string> errors = new List<string>(); List<string> errors = new List<string>();
var query = p_list.Select(p => p.BusinessType).Distinct().ToList(); var query = p_list.Select(p => p.BusinessType).Distinct().ToList();
@ -65,8 +77,23 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
return errors; return errors;
} }
} }
List<PriceList> priceList = new List<PriceList>();
if (first.BusinessType == EnumBusinessType.BeiJian)
{
var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单
foreach (var itm in priceListbj)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price});
}
}
else
{
priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode==site).ToList();//价格单
}
if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC
|| first.BusinessType == EnumBusinessType.BeiJian || first.BusinessType == EnumBusinessType.YinDuJian || first.BusinessType == EnumBusinessType.BeiJian || first.BusinessType == EnumBusinessType.YinDuJian
) )
@ -95,6 +122,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
return errors; return errors;
} }
var billNumber = OrderNumberGenerator.GenerateOrderNumber("N"); var billNumber = OrderNumberGenerator.GenerateOrderNumber("N");
var _entity = new PUB_CAN_SA(); var _entity = new PUB_CAN_SA();
_entity.SetId(Guid.NewGuid()); _entity.SetId(Guid.NewGuid());
@ -104,35 +134,81 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
_entity.State = SettleBillState.; _entity.State = SettleBillState.;
_entity.SettleBillNum = string.Empty; _entity.SettleBillNum = string.Empty;
_entity.BusinessType = first.BusinessType; _entity.BusinessType = first.BusinessType;
_entity.Site = first.Site; _entity.Site = site;
// var pricelist = _priceRepository.Where(p => p.ClientCode == site && p.IsCancel == false).ToList();
var _entityList = new List<PUB_CAN_SA_DETAIL>(); var _entityList = new List<PUB_CAN_SA_DETAIL>();
foreach (var itm in notlist) if (first.BusinessType == EnumBusinessType.BeiJian)
{ {
var _detailEntity = new PUB_CAN_SA_DETAIL( //var bjdetailList = new List<PUB_CAN_SA_DETAIL>();
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode, foreach (var itm in notlist)
version: itm.Version, {
billNum: billNumber, var _detailEntity = new PUB_CAN_SA_DETAIL(
settleBillNum: itm.SettleBillNum, guid: GuidGenerator.Create(),
lU: itm.LU, keyCode: itm.KeyCode,
pN: itm.PN, version: itm.Version,
site: itm.Site, billNum: billNumber,
qty: itm.Qty, settleBillNum: itm.SettleBillNum,
price: itm.Price, lU: itm.LU,
businessType: itm.BusinessType, pN: itm.PN,
settleDate: itm.SettleDate, site: itm.Site,
groupNum: itm.GroupNum, qty: itm.Qty,
invGroupNum: billNumber, price: itm.Price,
invbillnum: string.Empty, businessType: itm.BusinessType,
partcode: itm.PartCode, settleDate: itm.SettleDate,
pobillnum: string.Empty groupNum: itm.GroupNum,
); invGroupNum: billNumber,
_detailEntity.IndexNum = itm.IndexNum; invbillnum: string.Empty,
_detailEntity.RealPartCode = itm.RealPartCode; partcode: itm.PartCode,
pobillnum: string.Empty
_entityList.Add(_detailEntity); );
_detailEntity.IndexNum = itm.IndexNum;
_detailEntity.RealPartCode = itm.RealPartCode;
_detailEntity.Price = priceList.FirstOrDefault(p => itm.SettleDate >= p.BeginTime && itm.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == first.Site).Price;
_detailEntity.SetProperty("DeliveryNumber", itm.GetProperty("DeliveryNumber", ""));//交货号
_detailEntity.SetProperty("InvoiceNumber", itm.GetProperty("InvoiceNumber", ""));//发票号
_detailEntity.SetProperty("VendorCode", itm.GetProperty("VendorCode", ""));//供应商代码
_detailEntity.SetProperty("VendorName", itm.GetProperty("VendorName", ""));//供应商名称
_detailEntity.SetProperty("PO", itm.GetProperty("PO", ""));
_detailEntity.SetProperty("DeliveryIndexNumber", itm.GetProperty("DeliveryIndexNumber", ""));//交付索引号
_detailEntity.SetProperty("PartName", itm.GetProperty("PartName", ""));//零件名称
_detailEntity.SetProperty("PartGroup", itm.GetProperty("CommodityGroup", ""));
//_detailEntity.ExtraProperties = itm.ExtraProperties;
_entityList.Add(_detailEntity);
}
}
else
{
foreach (var itm in notlist)
{
var _detailEntity = new PUB_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: billNumber,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: priceList.FirstOrDefault(p => itm.SettleDate >= p.BeginTime && itm.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == first.Site).Price,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: billNumber,
invbillnum: string.Empty,
partcode: itm.PartCode,
pobillnum: string.Empty
);
_detailEntity.IndexNum = itm.IndexNum;
_detailEntity.RealPartCode = itm.RealPartCode;
_entityList.Add(_detailEntity);
}
} }
await _repository.DbContext.BulkDeleteAsync(p_list).ConfigureAwait(false); await _repository.DbContext.BulkDeleteAsync(p_list).ConfigureAwait(false);
await _repository.DbContext.BulkInsertAsync(new List<PUB_CAN_SA>() { _entity }).ConfigureAwait(false); await _repository.DbContext.BulkInsertAsync(new List<PUB_CAN_SA>() { _entity }).ConfigureAwait(false);
await _repository.DbContext.BulkInsertAsync(_entityList).ConfigureAwait(false); await _repository.DbContext.BulkInsertAsync(_entityList).ConfigureAwait(false);
@ -164,8 +240,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
pN: itm.PN, pN: itm.PN,
site: itm.Site, site: itm.Site,
qty: itm.Qty, qty: itm.Qty,
price: itm.Price, price: priceList.FirstOrDefault(p => itm.SettleDate >= p.BeginTime && itm.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == first.Site).Price,
businessType: itm.BusinessType, businessType: itm.BusinessType,
settleDate: itm.SettleDate, settleDate: itm.SettleDate,
groupNum: itm.GroupNum, groupNum: itm.GroupNum,
invGroupNum: billNumber, invGroupNum: billNumber,

Loading…
Cancel
Save