Browse Source

更新版本

master
学 赵 1 year ago
parent
commit
41fcd25c30
  1. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  2. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
  3. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  4. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_WAIT_DETAIL.cs
  5. 21
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

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

@ -288,7 +288,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public class INVOICE_WAIT_DETAIL_BJ_DTO public class INVOICE_WAIT_DETAIL_BJ_DTO
{ {
///// <summary>
/////期间
///// </summary>
//[Display(Name = "行号")]
//public int LineCode { get; set; }
/// <summary> /// <summary>
///期间 ///期间
/// </summary> /// </summary>

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

@ -164,12 +164,12 @@ namespace Win.Sfs.SettleAccount.Bases
{ {
return ApplicationConsts.SuccessStr; return ApplicationConsts.SuccessStr;
} }
public virtual async Task<TEntity> GetMainAsync([FromBody] string billNum) protected virtual async Task<TEntity> GetMainAsync([FromBody] string billNum)
{ {
return await _repository.Where(p=>p.InvGroupNum == billNum).FirstOrDefaultAsync(); return await _repository.Where(p=>p.InvGroupNum == billNum).FirstOrDefaultAsync();
} }
public virtual async Task<List<TEntityDetail>> GetDetailAsync([FromBody] string billNum) protected virtual async Task<List<TEntityDetail>> GetDetailAsync([FromBody] string billNum)
{ {
return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync(); return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync();
} }

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

@ -316,17 +316,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
SettleGroupNum = p.FirstOrDefault().SettleGroupNum, SettleGroupNum = p.FirstOrDefault().SettleGroupNum,
} }
); );
var all= entity.INVOICE_NOT_SETTLE.Select(p => p.SettleGroupNum).Distinct().ToList();//全部分组号 var all= entity.INVOICE_NOT_SETTLE.Select(p => p.SettleGroupNum).Distinct().ToList();//全部分组号
var part = mquery.ToList().Select(p => p.SettleGroupNum).Distinct().ToList();//发票对应分组号 var part = mquery.ToList().Select(p => p.SettleGroupNum).Distinct().ToList();//发票对应分组号
var unsettled= all.Where(p => !part.Contains(p));//排除发票对应分组号,都为不可结 var unsettled= all.Where(p => !part.Contains(p));//排除发票对应分组号,都为不可结
var unsettledList= entity.INVOICE_NOT_SETTLE.Where(p => unsettled.Contains(p.SettleGroupNum)) var unsettledList= entity.INVOICE_NOT_SETTLE.Where(p => unsettled.Contains(p.SettleGroupNum))
.GroupBy(p => new { p.LU, p.SettleGroupNum }) .GroupBy(p => new { p.LU, p.SettleGroupNum })
.Select(p => new UNSETTLED_DETAIL_DTO { LU = p.Key.LU, GroupNum = p.Key.SettleGroupNum, Qty = p.Sum(itm => itm.Qty.Value) }); .Select(p => new UNSETTLED_DETAIL_DTO { LU = p.Key.LU, GroupNum = p.Key.SettleGroupNum, Qty = p.Sum(itm => itm.Qty.Value) });
entity.UNSETTLED_DETAIL = unsettledList.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList(); entity.UNSETTLED_DETAIL = unsettledList.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList();
entity.INVOICE_MAP_GROUP = lscompare.ToList().OrderBy(p => p.SettleGroupNum).ToList();//包含不可结结算分组号 entity.INVOICE_MAP_GROUP = lscompare.ToList().OrderBy(p => p.SettleGroupNum).ToList();//包含不可结结算分组号
entity.ADJ_DETAIL = adjQuery.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList(); entity.ADJ_DETAIL = adjQuery.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList();
return entity; return entity;
@ -336,7 +332,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
IExporter _csv = new CsvExporter(); IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter(); IExporter _excel = new ExcelExporter();
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXP_DTO>>(entities); var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXP_DTO>>(entities);
foreach (var itm in dtoDetails) foreach (var itm in dtoDetails)
@ -404,6 +399,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
} }
else if (entities.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) else if (entities.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian)
{ {
_excel.Append(bj, "发票明细"); _excel.Append(bj, "发票明细");
} }
else else
@ -413,8 +409,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_excel.Append(m, "发票结算分组对应");//发票分组对应结算号 _excel.Append(m, "发票结算分组对应");//发票分组对应结算号
if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC || first.BusinessType == EnumBusinessType.ZhiGongJianHBPO) if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC || first.BusinessType == EnumBusinessType.ZhiGongJianHBPO)
{ {
_excel.Append(unsettle, "未结零件分组汇总"); _excel.Append(unsettle, "未结零件结算汇总");
} }
foreach (var itm in entities) foreach (var itm in entities)
{ {
var mgroup =m.Where(p => p.InvbillNum == itm.InvbillNum).ToList(); var mgroup =m.Where(p => p.InvbillNum == itm.InvbillNum).ToList();
@ -428,7 +428,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
p.InvDate, p.InvDate,
p.InvBillNum, p.InvBillNum,
p.InvGroupNum, p.InvGroupNum,
}).Select(p => new INVOICE_NOT_SETTLE_DTO() { }).Select(p => new INVOICE_NOT_SETTLE_DTO() {
LU =p.Key.LU, LU =p.Key.LU,
RealInvBillNum =p.Key.RealInvBillNum, RealInvBillNum =p.Key.RealInvBillNum,
@ -505,8 +504,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
_excel.Append(ls, "结算分组零件" + itm.InvbillNum); _excel.Append(ls, "结算分组零件" + itm.InvbillNum);
} }
_excel.Append(adjp, "发票调整数据" + itm.InvbillNum).SeparateBySheet(); _excel.Append(adjp, "发票调整数据" + itm.InvbillNum).SeparateBySheet();
} }

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_WAIT_DETAIL.cs

@ -51,6 +51,8 @@ public class INVOICE_WAIT_DETAIL :FullAuditedAggregateRoot<Guid>
public DateTime BeginDate { get; set; } public DateTime BeginDate { get; set; }
[Display(Name = "价格结束日期")] [Display(Name = "价格结束日期")]
public DateTime EndDate { get; set; } public DateTime EndDate { get; set; }
[Display(Name = "行号")]
public int LineCode { get; set; }

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

@ -773,7 +773,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var involdList = invList.Where(p => oldinvs.Contains(p.ParentInvbillNum)).ToList(); var involdList = invList.Where(p => oldinvs.Contains(p.ParentInvbillNum)).ToList();
var involdname = involdList.Select(p => p.InvbillNum); var involdname = involdList.Select(p => p.InvbillNum);
var adjlist = _adjRepository.Where(p => involdname.Contains(p.InvBillNum)); var adjlist = _adjRepository.Where(p => involdname.Contains(p.InvBillNum));
if (adjlist != null && adjlist.Count() > 0) if (adjlist != null && adjlist.Count() > 0)
{ {
foreach (var itm in adjlist) foreach (var itm in adjlist)
@ -799,7 +798,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
); );
detail.RealPartCode = itm.RealPartCode;//厂内替换零件号 detail.RealPartCode = itm.RealPartCode;//厂内替换零件号
detail.ErpLoc = itm.ErpLoc;//ERP库位 detail.ErpLoc = itm.ErpLoc;//ERP库位
entityList.Add(detail); entityList.Add(detail);
} }
} }
@ -878,7 +876,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
extend3: string.Empty, extend3: string.Empty,
extend4: itm.PartCode extend4: itm.PartCode
); );
entity.RELU =string.IsNullOrEmpty(itm.RealPartCode)?itm.PartCode:itm.RealPartCode;//厂内替换零件号 entity.RELU =string.IsNullOrEmpty(itm.RealPartCode)?itm.PartCode:itm.RealPartCode;//厂内替换零件号
entity.Extend2 = itm.ErpLoc;//ERP库位 entity.Extend2 = itm.ErpLoc;//ERP库位
@ -1353,8 +1350,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var invlist = new List<INVOICE_GRP>(); var invlist = new List<INVOICE_GRP>();
var salist = new List<TDetail>(); var salist = new List<TDetail>();
var adjlist = new List<PUB_ADJ_DETAIL>(); var adjlist = new List<PUB_ADJ_DETAIL>();
List<string> lsby = new List<string>(); List<string> lsby = new List<string>();
var grouplist = p_list.Select(p => p.GroupNum).Distinct().ToList();//可结分组 var grouplist = p_list.Select(p => p.GroupNum).Distinct().ToList();//可结分组
lsby.AddRange(grouplist); lsby.AddRange(grouplist);
@ -1721,7 +1716,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
adjlist.Add(itm); adjlist.Add(itm);
} }
} }
List<INVOICE_WAIT_DETAIL> _entityDetailList = new List<INVOICE_WAIT_DETAIL>(); List<INVOICE_WAIT_DETAIL> _entityDetailList = new List<INVOICE_WAIT_DETAIL>();
foreach (var detail in ls) foreach (var detail in ls)
{ {
@ -1741,7 +1735,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
beginDate: detail.BeginDate, beginDate: detail.BeginDate,
endDate: detail.EndDate, endDate: detail.EndDate,
partcode: detail.PartCode partcode: detail.PartCode
)); ));
} }
if (_entityDetailList.Count > 0) if (_entityDetailList.Count > 0)
@ -1954,10 +1947,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
detailList.AddRange(_entityDetailList); detailList.AddRange(_entityDetailList);
} }
string site = dtos.FirstOrDefault().Site; string site = dtos.FirstOrDefault().Site;
string clientCode = string.Empty; string clientCode = string.Empty;
switch (site) switch (site)
{ {
case "1040": case "1040":
@ -1993,11 +1984,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invbill.CreationTime = DateTime.Now; invbill.CreationTime = DateTime.Now;
invlist.Add(invbill); invlist.Add(invbill);
} }
await _repository.DbContext.BulkInsertAsync(invlist); await _repository.DbContext.BulkInsertAsync(invlist);
await _repository.DbContext.BulkInsertAsync(groupList); await _repository.DbContext.BulkInsertAsync(groupList);
await _repository.DbContext.BulkInsertAsync(detailList); await _repository.DbContext.BulkInsertAsync(detailList);
if(salist.Count>0) if(salist.Count>0)
{ {
await _repository.DbContext.BulkUpdateAsync(salist); await _repository.DbContext.BulkUpdateAsync(salist);
@ -2008,17 +1997,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
if(p_notlist.Count > 0) if(p_notlist.Count > 0)
{ {
var innotls = new List<INVOICE_NOT_SETTLE>(); var innotls = new List<INVOICE_NOT_SETTLE>();
var notls = p_notlist.GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); var notls = p_notlist.GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) });
foreach (var nitm in notls) foreach (var nitm in notls)
{ {
innotls.Add(new INVOICE_NOT_SETTLE( innotls.Add(new INVOICE_NOT_SETTLE(
guid: GuidGenerator.Create(), guid: GuidGenerator.Create(),
version: p_version, version: p_version,
invGroupNum: p_InvGroupNum, invGroupNum: p_InvGroupNum,
settleGroupNum: nitm.GroupNum, settleGroupNum: nitm.GroupNum,
lU: string.Empty, lU: nitm.LU,
lU1: nitm.LU, lU1: nitm.LU,
extend1: string.Empty, extend1: string.Empty,
extend2: string.Empty, extend2: string.Empty,
@ -2031,7 +2020,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
_invls = invlist.Select(p => p.InvbillNum).ToList(); _invls = invlist.Select(p => p.InvbillNum).ToList();
} }
return _invls; return _invls;
} }
@ -2099,9 +2087,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
return false; return false;
} }
_repository.DbContext.BulkUpdate(new List<INVOICE_GRP> { inv }); _repository.DbContext.BulkUpdate(new List<INVOICE_GRP> { inv });
return true; return true;
} }
@ -2198,7 +2183,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
adjdetails.Add(detail); adjdetails.Add(detail);
} }
} }
var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }) var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID })
.Select(itm => new .Select(itm => new
{ {
@ -2213,7 +2197,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
EndDate = itm.Key.EndDate EndDate = itm.Key.EndDate
}) })
.ToList(); .ToList();
var query = from inv1 in invdetails var query = from inv1 in invdetails
join dto1 in dtos on join dto1 in dtos on
new { inv1.LU,inv1.PartCode, inv1.PN,inv1.Id } equals new { dto1.LU,dto1.PartCode, dto1.PN ,dto1.Id new { inv1.LU,inv1.PartCode, inv1.PN,inv1.Id } equals new { dto1.LU,dto1.PartCode, dto1.PN ,dto1.Id

Loading…
Cancel
Save