Browse Source

修改发票导出,作废和在用一起导出问题

master
学 赵 1 year ago
parent
commit
ea35afdeb4
  1. 9
      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

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

@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using DocumentFormat.OpenXml.Spreadsheet;
using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Csv;
@ -31,6 +32,7 @@ using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.Filter;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
@ -152,12 +154,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public virtual async Task<INVOICE_GRP_DETAIL_DTO> DetailQueryAsync(INVOICE_GRP_REQ_DTO input)
{
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 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 mdtos = ObjectMapper.Map<List<INVOICE_MAP_GROUP>, List<INVOICE_MAP_GROUP_DTO>>(m);
var first = invs.FirstOrDefault();
if (invs.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC)
{
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,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
invGroupNum: inv.InvGroupNum,
invbillnum: string.Empty,
partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode,
pobillnum: string.Empty
@ -569,7 +569,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
invGroupNum: inv.InvGroupNum,
invbillnum: string.Empty,
partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode,
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;
}
[UnitOfWork(false)]
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")
[UnitOfWork(false)]
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{
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))
{
itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description;
}
else
foreach (var itm in jisdetail)
{
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)
{
foreach (var itm in jisdetail)
var mdetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianBBAC);//买单件
if (mdetail != null && mdetail.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(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();
if (detailist1.Count > 0)
@ -151,9 +150,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
}
Sync(detailist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false);
}
return id.ToString();
}
//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; // 所有价格时间都连续
}
/// <summary>
///
/// </summary>
/// <param name="range1"></param>
/// <param name="range2"></param>
/// <returns></returns>
public static bool IsTimeOverlap(PriceList range1, PriceList range2)
{
return range1.BeginTime <= range2.EndTime && range1.EndTime >= range2.BeginTime;

Loading…
Cancel
Save