Browse Source

更新版本

master
学 赵 1 year ago
parent
commit
5fb5df59d0
  1. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  2. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  3. 76
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

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

@ -159,9 +159,6 @@ namespace Win.Sfs.SettleAccount.Bases
var sdtos = ObjectMapper.Map<List<INVOICE_NOT_SETTLE>, List<INVOICE_NOT_SETTLE_DTO>>(s); var sdtos = ObjectMapper.Map<List<INVOICE_NOT_SETTLE>, List<INVOICE_NOT_SETTLE_DTO>>(s);
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); var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var AMap = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_BBAC_DTO>>(A); var AMap = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_BBAC_DTO>>(A);
var wquery = from itm in AMap var wquery = from itm in AMap
@ -199,7 +196,7 @@ namespace Win.Sfs.SettleAccount.Bases
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp
from tm in temp.DefaultIfEmpty() from tm in temp.DefaultIfEmpty()
select select
new INVOICE_WAIT_DETAIL_BJ_DTO() new INVOICE_WAIT_DETAIL_BJ_DTO()
{ {
PartDesc = tm == null ? string.Empty : itm.PartDesc, PartDesc = tm == null ? string.Empty : itm.PartDesc,
@ -228,7 +225,7 @@ namespace Win.Sfs.SettleAccount.Bases
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp
from tm in temp.DefaultIfEmpty() from tm in temp.DefaultIfEmpty()
select select
new INVOICE_WAIT_DETAIL_DTO() new INVOICE_WAIT_DETAIL_DTO()
{ {
PartDesc = tm == null ? string.Empty : itm.PartDesc, PartDesc = tm == null ? string.Empty : itm.PartDesc,
@ -291,7 +288,6 @@ namespace Win.Sfs.SettleAccount.Bases
KeyCode = itm.KeyCode, KeyCode = itm.KeyCode,
Price = itm.Price Price = itm.Price
}; };
entity.INVOICE_NOT_SETTLE = notquery.ToList(); entity.INVOICE_NOT_SETTLE = notquery.ToList();
entity.INVOICE_MAP_GROUP = mquery.ToList(); entity.INVOICE_MAP_GROUP = mquery.ToList();
entity.ADJ_DETAIL = adjQuery.ToList(); entity.ADJ_DETAIL = adjQuery.ToList();
@ -345,7 +341,6 @@ namespace Win.Sfs.SettleAccount.Bases
bool issuc= await _invMng.Reject(p_invGroupNum); bool issuc= await _invMng.Reject(p_invGroupNum);
if (issuc == true) if (issuc == true)
{ {
return new JsonResult(new { Code = 200, Message = "退回成功" }); return new JsonResult(new { Code = 200, Message = "退回成功" });
} }
@ -425,7 +420,6 @@ namespace Win.Sfs.SettleAccount.Bases
protected virtual async Task<INVOICE_GRP> GetInvoiceGroupByInvBillNum(string p_invbillNum) protected virtual async Task<INVOICE_GRP> GetInvoiceGroupByInvBillNum(string p_invbillNum)
{ {
List<FilterCondition> filters = new List<FilterCondition>(); List<FilterCondition> filters = new List<FilterCondition>();
filters.Add(new FilterCondition("InvBillNum", p_invbillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); filters.Add(new FilterCondition("InvBillNum", p_invbillNum, EnumFilterAction.Equal, EnumFilterLogic.And));
var ls = await _repository.GetListByFilterAsync(filters); var ls = await _repository.GetListByFilterAsync(filters);
if (ls != null && ls.Count() > 0) if (ls != null && ls.Count() > 0)

5
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs

@ -392,9 +392,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400");
} }
var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件
//var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细
if (adjlist != null && adjlist.Count() > 0) if (adjlist != null && adjlist.Count() > 0)
{ {
foreach (var itm in adjlist) foreach (var itm in adjlist)
@ -557,7 +556,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据
var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
var priceList = _priceRepository.ToList();//价格单 var priceList = _priceRepository.ToList();//价格单
var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys); var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s var q = from d in dto1s
join p in priceList on d.LU equals p.LU join p in priceList on d.LU equals p.LU
@ -617,7 +615,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum);
var ls = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities); var ls = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities);
var invlist = ls.Select(p => p.InvbillNum).Distinct(); var invlist = ls.Select(p => p.InvbillNum).Distinct();
foreach (var itm in invlist) foreach (var itm in invlist)
{ {

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

@ -14,6 +14,7 @@ using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Policy; using System.Security.Policy;
using System.Text; using System.Text;
using System.Text.Json; using System.Text.Json;
@ -1237,6 +1238,24 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
groupList.AddRange(group1); groupList.AddRange(group1);
} }
string site = dtos.FirstOrDefault().Site;
string clientCode = string.Empty;
switch (clientCode)
{
case "1040":
clientCode = "C001";
break;
case "1046":
clientCode = "C171";
break;
default:
clientCode = "C004";
break;
}
var invbill = new INVOICE_GRP var invbill = new INVOICE_GRP
(guid: GuidGenerator.Create(), (guid: GuidGenerator.Create(),
realnvBillNum: string.Empty, realnvBillNum: string.Empty,
@ -1248,16 +1267,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invGroupNum: p_InvGroupNum, invGroupNum: p_InvGroupNum,
state: SettleBillState., state: SettleBillState.,
invoiceBillState: InvoiceBillState., invoiceBillState: InvoiceBillState.,
tax: 0, tax: 0.13m,
parent: p_parentInvBillNum, parent: p_parentInvBillNum,
preTaxDiff: 0, preTaxDiff: 0,
taxDiff: 0, taxDiff: 0,
clientCode: string.Empty, clientCode: string.Empty,
realAmt: readAmt realAmt: readAmt
); );
invbill.ClientCode = clientCode;
invbill.Site = dtos.FirstOrDefault().Site; invbill.Site = dtos.FirstOrDefault().Site;
invlist.Add(invbill); invlist.Add(invbill);
} }
@ -1479,13 +1500,33 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invGroupNum: p_InvGroupNum, invGroupNum: p_InvGroupNum,
state: SettleBillState., state: SettleBillState.,
invoiceBillState: InvoiceBillState., invoiceBillState: InvoiceBillState.,
tax: 0, tax: 0.13m,
parent: string.Empty, parent: string.Empty,
preTaxDiff: 0, preTaxDiff: 0,
taxDiff: 0, taxDiff: 0,
clientCode: string.Empty, clientCode: string.Empty,
realAmt: realAmt realAmt: realAmt
); );
string site = dtos.FirstOrDefault().Site;
string clientCode = string.Empty;
switch(clientCode)
{
case "1040":
clientCode = "C001";
break;
case "1046":
clientCode = "C171";
break;
default:
clientCode = "C004";
break;
}
invbill.ClientCode = clientCode;
invbill.Site= dtos.FirstOrDefault().Site; invbill.Site= dtos.FirstOrDefault().Site;
invbill.CreationTime = DateTime.Now; invbill.CreationTime = DateTime.Now;
invlist.Add(invbill); invlist.Add(invbill);
@ -1748,7 +1789,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invGroupNum: p_InvGroupNum, invGroupNum: p_InvGroupNum,
state: SettleBillState., state: SettleBillState.,
invoiceBillState: InvoiceBillState., invoiceBillState: InvoiceBillState.,
tax: 0, tax: 0.13m,
parent: p_parentInvBillNum, parent: p_parentInvBillNum,
preTaxDiff:0, preTaxDiff:0,
taxDiff:0, taxDiff:0,
@ -1965,6 +2006,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
notDetialList.AddRange(innotls); notDetialList.AddRange(innotls);
} }
} }
string site = dtos.FirstOrDefault().Site;
string clientCode = string.Empty;
switch (clientCode)
{
case "1040":
clientCode = "C001";
break;
case "1046":
clientCode = "C171";
break;
default:
clientCode = "C004";
break;
}
var invbill = new INVOICE_GRP var invbill = new INVOICE_GRP
(guid: GuidGenerator.Create(), (guid: GuidGenerator.Create(),
realnvBillNum: string.Empty, realnvBillNum: string.Empty,
@ -1976,7 +2036,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invGroupNum: p_InvGroupNum, invGroupNum: p_InvGroupNum,
state: SettleBillState., state: SettleBillState.,
invoiceBillState: InvoiceBillState., invoiceBillState: InvoiceBillState.,
tax: 0, tax: 0.13m,
parent: string.Empty, parent: string.Empty,
preTaxDiff: 0, preTaxDiff: 0,
taxDiff: 0, taxDiff: 0,
@ -1984,6 +2044,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
realAmt: realAmt realAmt: realAmt
); );
invbill.Site = dtos.FirstOrDefault().Site; invbill.Site = dtos.FirstOrDefault().Site;
invbill.ClientCode = clientCode;
invbill.CreationTime = DateTime.Now; invbill.CreationTime = DateTime.Now;
invlist.Add(invbill); invlist.Add(invbill);
} }
@ -2309,7 +2370,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invGroupNum: p_InvGroupNum, invGroupNum: p_InvGroupNum,
state: SettleBillState., state: SettleBillState.,
invoiceBillState: InvoiceBillState., invoiceBillState: InvoiceBillState.,
tax: 0, tax: 0.13m,
parent: string.Empty, parent: string.Empty,
preTaxDiff: 0, preTaxDiff: 0,
taxDiff: 0, taxDiff: 0,
@ -2317,6 +2378,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
realAmt: 0 realAmt: 0
); );
invbill.CreationTime = DateTime.Now; invbill.CreationTime = DateTime.Now;
invbill.ClientCode = "C001";
invlist.Add(invbill); invlist.Add(invbill);
} }
await _repository.DbContext.BulkInsertAsync(invlist); await _repository.DbContext.BulkInsertAsync(invlist);

Loading…
Cancel
Save