|
@ -1,10 +1,12 @@ |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
|
|
|
using System.Text.Json; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using EFCore.BulkExtensions; |
|
|
using EFCore.BulkExtensions; |
|
|
using Microsoft.EntityFrameworkCore; |
|
|
using Microsoft.EntityFrameworkCore; |
|
|
using NPOI.SS.Formula.Functions; |
|
|
using NPOI.SS.Formula.Functions; |
|
|
|
|
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
|
|
using SettleAccount.Bases; |
|
|
using SettleAccount.Bases; |
|
|
using SettleAccount.Domain.BQ; |
|
|
using SettleAccount.Domain.BQ; |
|
|
using Volo.Abp; |
|
|
using Volo.Abp; |
|
@ -532,6 +534,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
detail.Extend2 = itm.ErpLoc;//ERP库位
|
|
|
detail.Extend2 = itm.ErpLoc;//ERP库位
|
|
|
bbacDetail.Add(detail); |
|
|
bbacDetail.Add(detail); |
|
|
} |
|
|
} |
|
|
|
|
|
var main = invList.FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var itm in bbacDetail) |
|
|
foreach (var itm in bbacDetail) |
|
|
{ |
|
|
{ |
|
|
if (string.IsNullOrEmpty(itm.RELU)) |
|
|
if (string.IsNullOrEmpty(itm.RELU)) |
|
@ -543,6 +548,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
var relist = relationList.Where(p => p.BusinessType == itm.BusinessType).ToList(); |
|
|
var relist = relationList.Where(p => p.BusinessType == itm.BusinessType).ToList(); |
|
|
var material = relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU); |
|
|
var material = relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU); |
|
|
itm.RELU = material.ErpMaterialCode; |
|
|
itm.RELU = material.ErpMaterialCode; |
|
|
|
|
|
itm.Site = main.Site; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false); |
|
|
await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false); |
|
@ -646,13 +652,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
entityList.AddRange(entityDetail); |
|
|
entityList.AddRange(entityDetail); |
|
|
} |
|
|
} |
|
|
var bbacmainlist = new List<HBPO_PD>(); |
|
|
var bbacmainlist = new List<HBPO_PD>(); |
|
|
|
|
|
var main = invList.FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var itm in invList) |
|
|
foreach (var itm in invList) |
|
|
{ |
|
|
{ |
|
|
var bbac = new HBPO_PD( |
|
|
var bbac = new HBPO_PD( |
|
@ -706,7 +706,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
} |
|
|
} |
|
|
var relist = relationList.Where(p => p.BusinessType == itm.BusinessType).ToList(); |
|
|
var relist = relationList.Where(p => p.BusinessType == itm.BusinessType).ToList(); |
|
|
var material = relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU); |
|
|
var material = relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU); |
|
|
itm.RELU = material.ErpMaterialCode; |
|
|
itm.BusinessType = main.BusinessType; |
|
|
|
|
|
itm.Site = main.Site; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false); |
|
|
await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false); |
|
@ -812,6 +813,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
} |
|
|
} |
|
|
entityList.AddRange(entityDetail); |
|
|
entityList.AddRange(entityDetail); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var bbacmainlist = new List<PUB_PD>(); |
|
|
var bbacmainlist = new List<PUB_PD>(); |
|
|
foreach (var itm in invList) |
|
|
foreach (var itm in invList) |
|
|
{ |
|
|
{ |
|
@ -868,6 +870,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
var material = relist.FirstOrDefault(p => p.SettleMaterialCode.Replace(" ","") == itm.LU.Replace(" ", "")); |
|
|
var material = relist.FirstOrDefault(p => p.SettleMaterialCode.Replace(" ","") == itm.LU.Replace(" ", "")); |
|
|
itm.RELU = material.ErpMaterialCode; |
|
|
itm.RELU = material.ErpMaterialCode; |
|
|
itm.BusinessType= main.BusinessType; |
|
|
itm.BusinessType= main.BusinessType; |
|
|
|
|
|
itm.Site = main.Site; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
await _repository.DbContext.BulkInsertAsync(bbacmainlist); |
|
|
await _repository.DbContext.BulkInsertAsync(bbacmainlist); |
|
@ -2208,6 +2211,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
public async Task<List<string>> BJInvoice<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, bool p_first = true) |
|
|
public async Task<List<string>> BJInvoice<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, bool p_first = true) |
|
|
where TDetail : SA_CAN_BASE |
|
|
where TDetail : SA_CAN_BASE |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
foreach (var itm in p_list) |
|
|
|
|
|
{ |
|
|
|
|
|
if (itm.Qty < 0) |
|
|
|
|
|
{ |
|
|
|
|
|
var str = itm.PartCode; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<string> _invls = new List<string>(); |
|
|
List<string> _invls = new List<string>(); |
|
|
var _query = dtos.GroupBy(p => new { p.GroupNum }).Select(p => new { GroupNum = p.Key.GroupNum, Amt = p.Sum(itm => itm.Amt) }); |
|
|
var _query = dtos.GroupBy(p => new { p.GroupNum }).Select(p => new { GroupNum = p.Key.GroupNum, Amt = p.Sum(itm => itm.Amt) }); |
|
|
Dictionary<string, decimal> dic = new Dictionary<string, decimal>();//原本
|
|
|
Dictionary<string, decimal> dic = new Dictionary<string, decimal>();//原本
|
|
|