|
@ -11,7 +11,9 @@ using TaskJob.Interfaces; |
|
|
using Volo.Abp.BlobStoring; |
|
|
using Volo.Abp.BlobStoring; |
|
|
using Volo.Abp.DependencyInjection; |
|
|
using Volo.Abp.DependencyInjection; |
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
|
|
|
|
using Win.Sfs.SettleAccount; |
|
|
using Win.Sfs.SettleAccount.Entities.UnSettle; |
|
|
using Win.Sfs.SettleAccount.Entities.UnSettle; |
|
|
|
|
|
using Win.Sfs.SettleAccount.Errors; |
|
|
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; |
|
|
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; |
|
|
|
|
|
|
|
|
namespace SettleAccount.Job.Services.Report |
|
|
namespace SettleAccount.Job.Services.Report |
|
@ -51,12 +53,13 @@ namespace SettleAccount.Job.Services.Report |
|
|
private readonly ErpPartDapperRepository _erpdapperRepository; |
|
|
private readonly ErpPartDapperRepository _erpdapperRepository; |
|
|
private readonly UnSettledDetailDapperRepository _dapper1; |
|
|
private readonly UnSettledDetailDapperRepository _dapper1; |
|
|
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
|
|
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
|
|
|
|
|
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository; |
|
|
public UnSettleDiffExportService(UnSettleDiffDapperRepository dapper, OutputService outputService, |
|
|
public UnSettleDiffExportService(UnSettleDiffDapperRepository dapper, OutputService outputService, |
|
|
UnSettledDetailDapperRepository dapper1, |
|
|
UnSettledDetailDapperRepository dapper1, |
|
|
ErpPartDapperRepository erpdapperRepository, |
|
|
ErpPartDapperRepository erpdapperRepository, |
|
|
IBlobContainer<MyFileContainer> fileContainer, |
|
|
IBlobContainer<MyFileContainer> fileContainer, |
|
|
UnSettledDetailDapperRepository dapper2 |
|
|
UnSettledDetailDapperRepository dapper2, |
|
|
|
|
|
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository |
|
|
) |
|
|
) |
|
|
{ |
|
|
{ |
|
|
_erpdapperRepository = erpdapperRepository; |
|
|
_erpdapperRepository = erpdapperRepository; |
|
@ -65,6 +68,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
_dapper1 = dapper1; |
|
|
_dapper1 = dapper1; |
|
|
_fileContainer = fileContainer; |
|
|
_fileContainer = fileContainer; |
|
|
_dapper2 = dapper2; |
|
|
_dapper2 = dapper2; |
|
|
|
|
|
_errorListRepository = errorListRepository; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list) |
|
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list) |
|
@ -83,6 +87,21 @@ namespace SettleAccount.Job.Services.Report |
|
|
var _ls = new List<UnSettleDiff>(); |
|
|
var _ls = new List<UnSettleDiff>(); |
|
|
_ls = _dapper.GetDiffReport1(0,begin,end, materialCode,kenncode,chassisNumber,version); |
|
|
_ls = _dapper.GetDiffReport1(0,begin,end, materialCode,kenncode,chassisNumber,version); |
|
|
|
|
|
|
|
|
|
|
|
var _checkList = _errorListRepository.ToList(); |
|
|
|
|
|
|
|
|
|
|
|
var q = from itm in _ls |
|
|
|
|
|
join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } |
|
|
|
|
|
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 |
|
|
|
|
|
from tm1 in temp1.DefaultIfEmpty() |
|
|
|
|
|
where tm1 == null |
|
|
|
|
|
select itm; |
|
|
|
|
|
|
|
|
|
|
|
_ls = q.ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//foreach (var itm in _ls)
|
|
|
//foreach (var itm in _ls)
|
|
|
//{
|
|
|
//{
|
|
|
// if (itm.KENNCode.Length > 8)
|
|
|
// if (itm.KENNCode.Length > 8)
|
|
@ -331,20 +350,15 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _checkList = _errorListRepository.ToList(); |
|
|
|
|
|
|
|
|
//foreach (var itm in _list)
|
|
|
var q= from itm in _list |
|
|
//{
|
|
|
join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } |
|
|
// if (itm.UnSettleQty > 0)
|
|
|
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 |
|
|
// {
|
|
|
from tm1 in temp1.DefaultIfEmpty() |
|
|
// itm.UnSettleQty = 1;
|
|
|
where tm1 == null |
|
|
// }
|
|
|
select itm; |
|
|
// itm.DiffQty = itm.Qty - itm.UnSettleQty;
|
|
|
_list = q.ToList(); |
|
|
// if (itm.DiffQty == 0)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// itm.DiffAMT = 0;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _ls = _list.Where(p => p.Flag != "L" ).Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).Where(p => !p.ParentSapMaterialCode.Contains(",")).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); |
|
|
var _ls = _list.Where(p => p.Flag != "L" ).Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).Where(p => !p.ParentSapMaterialCode.Contains(",")).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); |
|
|
var _compareLs = _ls.Where(p => p.DiffQty == 0).Select(p => new { p.ChassisNumber, p.KENNCode, p.ParentSapMaterialCode }); |
|
|
var _compareLs = _ls.Where(p => p.DiffQty == 0).Select(p => new { p.ChassisNumber, p.KENNCode, p.ParentSapMaterialCode }); |
|
@ -378,14 +392,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
|
|
|
|
|
rangeList = query.ToList(); |
|
|
rangeList = query.ToList(); |
|
|
|
|
|
|
|
|
//_lst.ForEach(p =>
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
|
|
// p.Qty = 1;
|
|
|
|
|
|
// p.DiffAMT = 0;
|
|
|
|
|
|
// p.DiffQty = 1;
|
|
|
|
|
|
//}
|
|
|
|
|
|
//);
|
|
|
|
|
|
_list.AddRange(rangeList); |
|
|
_list.AddRange(rangeList); |
|
|
if (!string.IsNullOrEmpty(materialGroup)) |
|
|
if (!string.IsNullOrEmpty(materialGroup)) |
|
|
{ |
|
|
{ |
|
|