Browse Source

更新版本

master
学 赵 1 year ago
parent
commit
0fe577bd45
  1. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  2. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  3. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  4. 413
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
  5. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
  6. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs
  7. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD_DETAIL.cs
  8. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs
  9. 47
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  10. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs
  11. 6
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/PendingDeduction/PendingDeductionDapperRepository.cs

6
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs

@ -436,13 +436,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// <summary>
///可结算零件号
/// </summary>
[Display(Name = "可结算零件号")]
[Display(Name = "零件号")]
public string LU { get; set; }
/// <summary>
///不可结算零件号
/// </summary>
[Display(Name = "不可结算零件号")]
public string LU1 { get; set; }
[Display(Name = "状态")]
public string Extend1 { get; set; }

13
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs

@ -23,6 +23,7 @@ using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Volo.Abp.ObjectMapping;
using Volo.Abp.TenantManagement.EntityFrameworkCore;
using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
@ -153,7 +154,7 @@ namespace Win.Sfs.SettleAccount.Bases
var dtos = ObjectMapper.Map<List<TEntity>, List<TEntityDto>>(entitys);
return new PagedResultDto<TEntityDto>(totalCount, dtos);
}
[UnitOfWork(false)]
/// <summary>
/// hbpo、jit、备件等
/// </summary>
@ -192,19 +193,16 @@ namespace Win.Sfs.SettleAccount.Bases
case EnumBusinessType.YinDuJian:
invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, new List<TEMP_NOT_SA_DETAIL>(), p_version, p_InvGroupNum, string.Empty, businessType, true);//重开可以变多张发票
break;
}
//var ls= await _invmng.SecInvoice(p_list,p_adjlist,p_tmplist,p_version, p_InvGroupNum, p_parentInvBillNum, businessType);
if (invlist.Count > 0)
{
return true;
}
throw new BusinessException("8989", "生成失败,请检可结算单明细数据是否结算分组存在");
}
[UnitOfWork(false)]
/// <summary>
/// 第一次开票
/// </summary>
@ -217,13 +215,11 @@ namespace Win.Sfs.SettleAccount.Bases
/// <returns></returns>
protected async Task<bool> FirstInvoice<TDetail>(List<TDetail> p_list,List<PUB_ADJ_DETAIL> p_adjlist ,List<TEMP_CAN_SA_DETAIL> dtos, List<TEMP_NOT_SA_DETAIL> p_notlist, int p_version, string p_invGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) where TDetail : SA_CAN_BASE
{
List<string> invlist = new List<string>();
switch (businessType)
{
case EnumBusinessType.MaiDanJianHBPO:
invlist = await _invmng. MakeInvoice(p_list, p_adjlist, dtos, p_version, p_invGroupNum, string.Empty, businessType, true);
invlist = await _invmng.MakeInvoice(p_list, p_adjlist, dtos, p_version, p_invGroupNum, string.Empty, businessType, true);
break;
case EnumBusinessType.MaiDanJianBBAC:
invlist = await _invmng.MakeInvoice(p_list, p_adjlist, dtos, p_version, p_invGroupNum, string.Empty, businessType, true);
@ -252,7 +248,6 @@ namespace Win.Sfs.SettleAccount.Bases
return true;
}
throw new BusinessException("8989", "生成失败,请检可结算单明细数据是否结算分组存在");
}
/// <summary>

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

@ -209,16 +209,23 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
foreach (var itm in entities)
{
var invlist = detail.Where(p => p.InvbillNum == itm.InvbillNum).ToList();
var mgroup =m.Where(p => p.InvbillNum == itm.InvbillNum).ToList();
var adjp = adj.Where(p => p.InvBillNum == itm.InvbillNum).ToList();
var nolist = not.Where(p => p.InvBillNum == itm.InvbillNum).ToList();
_excel.Append(invlist, "发票号" + itm.InvbillNum).SeparateBySheet();
_excel.Append(mgroup, "发票结算分组对应" + itm.InvbillNum).SeparateBySheet();
_excel.Append(adj, "发票调整数据" + itm.InvbillNum).SeparateBySheet();
_excel.Append(adjp, "发票调整数据" + itm.InvbillNum).SeparateBySheet();
_excel.Append(nolist, "结算分组零件");
}
_excel.Append(not, "发票分组未结对应结算分组");
var result = _excel.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制

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

@ -3,9 +3,12 @@ using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Channels;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Nito.AsyncEx;
using SettleAccount.Bases;
using SettleAccount.Domain.BQ;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
@ -26,6 +29,7 @@ public class PendingDeductionService : ITransientDependency, IExportJob
protected readonly INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> _hbpoRepository;
protected readonly INormalEfCoreRepository<PUB_PD_DETAIL, Guid> _pubRepository;
protected readonly INormalEfCoreRepository<CodeSetting, Guid> _codesetRepository;
protected readonly INormalEfCoreRepository<VmiLog, Guid> _vmiRepository;
public PendingDeductionService(
INormalEfCoreRepository<BBAC_SEC_DETAIL, Guid> bbacSecRepository,
@ -35,6 +39,7 @@ public class PendingDeductionService : ITransientDependency, IExportJob
INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> hbpoRepository,
INormalEfCoreRepository<PUB_PD_DETAIL, Guid> pubRepository,
INormalEfCoreRepository<CodeSetting, Guid> codesetRepository,
INormalEfCoreRepository<VmiLog, Guid> vmiRepository,
VmiAppService vimservice
)
{
@ -46,368 +51,138 @@ public class PendingDeductionService : ITransientDependency, IExportJob
_pubSecRepository= pubSecRepository;
_vimservice =vimservice;
_codesetRepository = codesetRepository;
_vmiRepository = vmiRepository;
}
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 list=billList.Split(",");
var projectList=_codesetRepository.Where(p => p.Project == "库位");
var list = billList.Split(",");
var projectList = _codesetRepository.Where(p => p.Project == "库位");
if (type == "JisBBAC")
{
var jisdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan==false);
var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan ==true);
var query = from itm in jisdetail
select
new
{
BillTime = DateTime.Now,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
//SubBillType = EnumDeliverSubBillType.小件BBAC,
//BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
//ErpToLoc = string.IsNullOrEmpty()
};
var ls=query.ToList();
if (ls != null && ls.Count > 0)
{
foreach (var itm in ls)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.BillTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
AssembleData = itm.BillTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
//SubBillType = EnumDeliverSubBillType.小件BBAC,
//BillType = EnumDeliverBjBmpBillType.JIS件,
RealPartCode = itm.PartCode,
SettlementVinCode = itm.VinCode,
//PartCode2 = itm.PartCode2,
CustPartCode = itm.CustomerPartCode,
VinCode = itm.VinCode,
//OrderNum = itm.OrderNum,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
var query1 = from itm in mdetail
select new
{
BillTime = DateTime.Now,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
//SubBillType = EnumDeliverSubBillType.小件BBAC,
//BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
};
var ls1 = query1.ToList();
if (ls1 != null && ls1.Count > 0)
{
foreach (var itm in ls1)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.BillTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
//SubBillType = EnumDeliverSubBillType.小件BBAC,
//BillType = EnumDeliverBjBmpBillType.JIS件,
SettlementVinCode = itm.VinCode,
VinCode = itm.VinCode,
//OrderNum = itm.OrderNum,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
var jisdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisBBAC);//jis
Sync(jisdetail.ToList());
var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianBBAC);//买单件
Sync(mdetail.ToList());
}
else if (type == "JisHBPO")
{
var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum)).ToList();
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
CustPartCode = itm.LU,
VinCode = itm.PN,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum) && p.BusinessType== EnumBusinessType.JisHBPO).ToList();
Sync(detailist);
var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianHBPO);//买单件
Sync(mdetail.ToList());
}
else
{
var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum)).ToList();
switch (type)
{
case "ZhiGongJianBBAC":
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
// DeliverTime = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.PN,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
Sync(detailist);
////switch (type)
////{
//// case "ZhiGongJianBBAC":
//// if (detailist != null && detailist.Count > 0)
//// {
//// }
//// break;
//// case "ZhiGongJianHBPO":
//// if (detailist != null && detailist.Count > 0)
//// {
//// }
//// break;
//// case "MaiDanJianBBAC":
//// if (detailist != null && detailist.Count > 0)
//// {
//// }
//// break;
//// case "MaiDanJianHBPO":
//// if (detailist != null && detailist.Count > 0)
//// {
//// }
//// break;
//// case "BeiJian":
//// if (detailist != null && detailist.Count > 0)
//// {
//// }
//// break;
//// case "YinDuJian":
//// if (detailist != null && detailist.Count > 0)
//// {
//// }
//// break;
////}
//if (detailist != null && detailist.Count > 0)
//{
// foreach (var itm in detailist)
// {
// }
//}
}
return id.ToString();
}
break;
case "ZhiGongJianHBPO":
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
public List<T> GetPagedData<T>(List<T> dataList, int pageNumber, int pageSize)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
// DeliverTime = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.PN,// 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
break;
case "MaiDanJianBBAC":
int startIndex = (pageNumber - 1) * pageSize;
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
// DeliverTime = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
return dataList.Skip(startIndex).Take(pageSize).ToList();
}
break;
case "MaiDanJianHBPO":
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
public int CalculatePageCount(int totalCount, int pageSize)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
int pageCount = totalCount / pageSize;
if (totalCount % pageSize != 0)
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
// DeliverTime = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
pageCount += 1;
}
return pageCount;
}
break;
case "BeiJian":
if (detailist != null && detailist.Count > 0)
public void Sync<T>(List<T> p_ls) where T : PD_BASE,new()
{
foreach (var itm in detailist)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
// DeliverTime = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
break;
case "YinDuJian":
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
var query = from itm in p_ls
select new
{
BillTime = itm.CreationTime,
BillTime = DateTime.Now,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
// DeliverTime = ,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
RealPartCode = itm.LU,//客户
//SubBillType = EnumDeliverSubBillType.小件BBAC,
//BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
PartCode2 = itm.LU,
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
OrderNum = itm.GroupNum,
ErpToLoc = itm.Extend2,
break;
}
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
};
var ls = query.ToList();
if (ls != null && ls.Count > 0)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
var count = CalculatePageCount(ls.Count, 2000);
for (int pagenumber = 0; pagenumber < count; pagenumber++)
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
AssembleData = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
DeliverSubBillType = EnumDeliverSubBillType.BBAC,
DeliverBillType = EnumDeliverBjBmpBillType.JIS件,
RealPartCode = itm.LU,
SettlementVinCode = itm.PN,
//PartCode2 = itm.LU,
CustPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
ls = GetPagedData(ls, pagenumber, 2000);
_vmiRepository.DbContext.BulkInsert(ls);
Task.Delay(500);
}
}
}
return id.ToString();
}
}

5
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs

@ -619,6 +619,11 @@ namespace SettleAccount.Bases
/// 结算分组号
/// </summary>
public string GroupNum { set; get; }
public EnumBusinessType BusinessType { set; get; }
/// <summary>
/// LU(零件号)
/// </summary>

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs

@ -1,7 +1,7 @@
using SettleAccount.Bases;
using System;
using System.ComponentModel.DataAnnotations;
using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "BBAC待扣减实体")]
@ -50,9 +50,9 @@ public class BBAC_PD_DETAIL:PD_BASE
public bool IsMaiDan { get; set; }
public BBAC_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string groupNum
,string extend1,string extend2,string extend3,string extend4
,string extend1,string extend2,string extend3,string extend4,EnumBusinessType p_businessType)
)
{
Id = guid;
KeyCode = keyCode;
@ -72,6 +72,8 @@ public class BBAC_PD_DETAIL:PD_BASE
Extend2 = extend2;
Extend3 = extend3;
Extend4 = extend4;
BusinessType = p_businessType;
}
public BBAC_PD_DETAIL()

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD_DETAIL.cs

@ -1,8 +1,7 @@
using SettleAccount.Bases;
using System;
using System.ComponentModel.DataAnnotations;
using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "HBPO待扣减实体")]
@ -46,7 +45,7 @@ public class HBPO_PD_DETAIL :PD_BASE
//public string GroupNum { get; set; } = null!;
public HBPO_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum,
DateTime settleDate, string groupNum, string extend1, string extend2, string extend3, string extend4
DateTime settleDate, string groupNum, string extend1, string extend2, string extend3, string extend4,EnumBusinessType p_businessType
)
{
Id = guid;
@ -67,6 +66,7 @@ public class HBPO_PD_DETAIL :PD_BASE
Extend2 = extend2;
Extend3 = extend3;
Extend4 = extend4;
BusinessType= p_businessType;
}

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

@ -121,7 +121,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
}
break;
}
await _repository.UpdateAsync(first);
await _repository.DbContext.BulkUpdateAsync(new List<BBAC_CAN_SA>{ first});
return true;

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

@ -546,7 +546,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
extend1: string.Empty,
extend2: string.Empty,
extend3: string.Empty,
extend4: itm.PartCode);//厂内实际零件号
extend4: itm.PartCode,
p_businessType:itm.BusinessType
);//厂内实际零件号
detail.RELU = itm.RealPartCode;//厂内替换零件号
detail.Extend2 = itm.ErpLoc;//ERP库位
@ -691,7 +694,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
extend1: string.Empty,
extend2: string.Empty,
extend3: string.Empty,
extend4: itm.PartCode
extend4: itm.PartCode,
p_businessType:itm.BusinessType
);
entity.RELU = itm.RealPartCode;//厂内替换零件号
entity.Extend2 = itm.ErpLoc;//ERP库位
@ -842,6 +849,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
extend2: string.Empty,
extend3: string.Empty,
extend4: itm.PartCode
);
entity.RELU = itm.RealPartCode;//厂内替换零件号
entity.Extend2 = itm.ErpLoc;//ERP库位
@ -1016,6 +1025,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <param name="p_version">版本号</param>
/// <param name="p_InvGroupNum">发票分组</param>
/// <param name="p_parentInvBillNum">原发票号</param>
[UnitOfWork(false)]
public async Task<List<string>> SecInvoice<TDetail>(List<TDetail> p_list, List<PUB_ADJ_DETAIL> p_ajdlist, List<TEMP_CAN_SA_DETAIL> dtos, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType)
where TDetail : SA_CAN_BASE
@ -1229,7 +1239,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
return _invls;
}
[UnitOfWork(false)]
public async Task<List<string>> FirstInvoice<TDetail>(List<TDetail> p_list, List<PUB_ADJ_DETAIL> p_adjlist, List<TEMP_CAN_SA_DETAIL> dtos, List<TEMP_NOT_SA_DETAIL> p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType)
where TDetail : SA_CAN_BASE
{
@ -1381,12 +1391,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
settleGroupNum: sitm.GroupNum,
lU: sitm.LU,
lU1: sitm.LU,
extend1: string.Empty,
extend1: "可结算",
extend2: string.Empty,
qty: sitm.Qty,
p_invbillnum: itm.Key
));
}
if (innotls.Count > 0)
{
notDetialList.AddRange(innotls);
}
if (p_notlist != null && p_notlist.Count > 0)
{
var groupnum = itm.Value;
@ -1401,7 +1415,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
settleGroupNum: nitm.GroupNum,
lU: nitm.LU,
lU1: nitm.LU,
extend1: string.Empty,
extend1: "不可结算",
extend2: string.Empty,
qty: nitm.Qty,
p_invbillnum: itm.Key
@ -1435,17 +1449,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
if (salist.Count > 0)
{
foreach (var itm in invoiceMap)//分组影响和
{
var key = itm.Key;//发票票号
var ls = itm.Value;//结算分组号列表
//foreach (var itm in invoiceMap)//分组影响和
//{
// var key = itm.Key;//发票票号
// var ls = itm.Value;//结算分组号列表
string str = $" EXEC [p_Invoice_generation_change] @invbillnum = {"'" + key + "'"},@groupNum = {"'" + string.Join(",", ls) + "'"},@businessType = NULL";
await _repository.DbContext.Database.ExecuteSqlRawAsync(str);
}
// await _repository.DbContext.BulkUpdateAsync(salist,new BulkConfig() { BatchSize=10000 });
// string str = $" EXEC [p_Invoice_generation_change] @invbillnum = {"'" + key + "'"},@groupNum = {"'" + string.Join(",", ls) + "'"},@businessType = NULL";
// await _repository.DbContext.Database.ExecuteSqlRawAsync(str);
//}
await _repository.DbContext.BulkUpdateAsync(salist,new BulkConfig() { BatchSize=10000 });
}
@ -1993,12 +2007,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
return false;
}
//foreach (var adj in p_adjlist)
//{
// adj.InvBillNum = string.Join(",", invlist);//调整单更新发票信息
//}
//_repository.DbContext.BulkUpdate(p_adjlist);
_repository.DbContext.BulkUpdate(new List<INVOICE_GRP> { inv });
return true;
@ -2157,7 +2166,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
groupList.AddRange(mapList);
}
List<INVOICE_WAIT_DETAIL> _entityDetailList = new List<INVOICE_WAIT_DETAIL>();
//var txt= JsonSerializer.Serialize(query.ToList());
foreach (var detail in query.ToList())
{

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

@ -80,6 +80,7 @@ public class PUB_PD_DETAIL :PD_BASE
Extend4 = extend4;
}
public PUB_PD_DETAIL()

6
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/PendingDeduction/PendingDeductionDapperRepository.cs

@ -176,7 +176,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
extend1: string.Empty,
extend2: string.Empty,
extend3: string.Empty,
extend4: string.Empty
extend4: string.Empty,
p_businessType:itm.BusinessType
);
var bbacDetail = query.ToList();
@ -286,7 +287,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
extend1: string.Empty,
extend2: string.Empty,
extend3: string.Empty,
extend4: string.Empty
extend4: string.Empty,
p_businessType:itm.BusinessType
);
var bbacDetail = query.ToList();

Loading…
Cancel
Save