Browse Source

更新版本

FoShanPG
Administrator 2 years ago
parent
commit
ac58e9a43c
  1. 5
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Materials/MaterialDtoBase.cs
  2. 82
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErrorListBill/ErrorBillAppService.cs
  3. 5
      src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  4. 11
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ErrorBillNum/ErrorBillNum.cs
  5. 20
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs
  6. 74
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs
  7. 22
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs
  8. 39
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs

5
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Materials/MaterialDtoBase.cs

@ -54,18 +54,21 @@ namespace Win.Sfs.SettleAccount.Entities.Errors
public class ErrorBillExportDto
{
/// <summary>
///错误单据
///底盘或看板
/// </summary>
[ExporterHeader(DisplayName = "底盘|看板号|订单号", IsBold = true)]
public string BillNum { get; protected set; }
/// <summary>
/// 物料号
/// </summary>
[ExporterHeader(DisplayName = "物料号", IsBold = true)]
public string MaterialCode { set; get; }
/// <summary>
/// 发货单号
/// </summary>
[ExporterHeader(DisplayName = "交货单号", IsBold = true)]
public string WmsBillNum { set; get; }
}

82
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErrorListBill/ErrorBillAppService.cs

@ -35,8 +35,7 @@ using Win.Sfs.SettleAccount.Errors;
using Win.Sfs.SettleAccount.EstimatedInventories;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.Reports;
using Win.Sfs.Shared.CacheBase;
using Win.Utils;
namespace Win.Sfs.SettleAccount.Entities.ErrorBills
@ -102,22 +101,32 @@ namespace Win.Sfs.SettleAccount.Entities.ErrorBills
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
//[HttpPost]
//[Route("ExcelImport")]
//[DisableRequestSizeLimit]
public async Task<string> ErrorBillUploadExcelImportMap([FromForm] IFormFileCollection files,string version)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<ErrorBill>(files, _excelImportService);
return ApplicationConsts.SuccessStr;
}
//public async Task<string> ErrorBillUploadExcelImportMap([FromForm] IFormFileCollection files,string version)
//{
// ExportImporter _exportImporter = new ExportImporter();
// var result = await _exportImporter.ExtendExcelImport<ErrorBill>(files, _excelImportService);
// return ApplicationConsts.SuccessStr;
//}
public List<T> RemoveError<T>(List<T> p_list) where T : ReportDetailBase, new ()
{
return p_list;
}
/// <summary>
@ -137,45 +146,18 @@ namespace Win.Sfs.SettleAccount.Entities.ErrorBills
var checkList = new List<ErrorExportDto>();
foreach (var itm in _ls)
{
//var _first = await _repository.FirstOrDefaultAsync(p => p.ErrorBillCode == itm.ErrorBillCode);
//if (_first == null)
//{
//var entity = new ErrorBill(
// GuidGenerator.Create(),
// GuidGenerator.Create(),
// itm.Factory,
// itm.ErrorBillCode,
// itm.ErrorBillDesc,
// itm.Unit,
// itm.EstimateType,
// itm.EstimateTypeDesc
// );
// await _repository.InsertAsync(entity);
//}
//else
//{
//_first.Update(itm.ErrorBillDesc, itm.Unit, itm.EstimateType, itm.EstimateTypeDesc, itm.Factory
// );
//await _repository.UpdateAsync(_first);
//}
//var _f = await _relationshipRepository.FirstOrDefaultAsync(p => p.ErpErrorBillCode == itm.ErrorBillCode);
//if (_f != null)
//{
// _f.Update(itm.ErrorBillDesc, _f.ErrorBillProperty, _f.SettleErrorBillCode, _f.ShipMaterailCode);
// await _relationshipRepository.UpdateAsync(_f);
//}
//else
//{
// var _r = new ErrorBillRelationship(GuidGenerator.Create(), GuidGenerator.Create(), itm.ErrorBillCode, itm.ErrorBillDesc, string.Empty, string.Empty, string.Empty, itm.EstimateType);
// await _relationshipRepository.InsertAsync(_r);
//}
var _first = await _repository.FirstOrDefaultAsync(p => p.BillNum == itm.BillNum && p.MaterialCode==itm.MaterialCode && p.WmsBillNum==itm.WmsBillNum);
if (_first == null)
{
var entity = new ErrorBill(
GuidGenerator.Create(),
GuidGenerator.Create(),
itm.BillNum,
itm.MaterialCode,
itm.WmsBillNum
);
await _repository.InsertAsync(entity);
}
}
return ApplicationConsts.SuccessStr;
}

5
src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs

@ -482,7 +482,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
[HttpPost]
[Route("InvoiceSettledDetailDiff-Make")]
[DisableRequestSizeLimit]
[UnitOfWork(false)]
public async Task<string> InvoiceSettledDetailDiffMake(
BaseRequestDto request
)
@ -515,7 +515,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
[HttpPost]
[Route("UnInvoiceSettledDetailDiff-Make")]
[DisableRequestSizeLimit]
[UnitOfWork(false)]
public async Task<string> UnInvoiceSettledDetailDiffMake(
BaseRequestDto request
)
@ -549,6 +549,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
[HttpPost]
[Route("UnsettledDetailReportService-Make")]
[DisableRequestSizeLimit]
[UnitOfWork(false)]
public async Task<string> UnsettledDetailReportServiceMake(
BaseRequestDto input

11
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ErrorBillNum/ErrorBillNum.cs

@ -11,6 +11,17 @@ namespace Win.Sfs.SettleAccount.Errors
/// </summary>
public class ErrorBill : FullAuditedAggregateRootBase<Guid>
{
public ErrorBill(
Guid id,
Guid branchId,
string billNum, string materialCode, string wmsBillNum):base(id)
{
BranchId = branchId;
BillNum = billNum;
MaterialCode = materialCode;
WmsBillNum = wmsBillNum;
}
/// <summary>
///错误单据号
/// </summary>

20
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs

@ -6,6 +6,8 @@ using System.Threading.Tasks;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Errors;
using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs;
using Win.Sfs.SettleAccount.Repository.SettleAccount;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob;
@ -21,12 +23,12 @@ namespace SettleAccount.Job.Services
private readonly InvoiceSettledDetailDiffDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public InvoiceSettledDetailDiffExportService(
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository,
ErpPartDapperRepository erpdapperRepository,
InvoiceSettledDetailDiffDapperRepository dapperRepository,
OutputService outputService,
@ -39,6 +41,7 @@ namespace SettleAccount.Job.Services
//_repository = repository;
//_versionRepository = versionRepository;
_dapperRepository =dapperRepository;
_errorListRepository=errorListRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
@ -187,7 +190,18 @@ namespace SettleAccount.Job.Services
_ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList();
}
_outputService.Export<InvoiceSettledDetailDiff>(id, _filename, _ls);
var _checkList = _errorListRepository.ToList();
var query = 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;
_outputService.Export<InvoiceSettledDetailDiff>(id, _filename, query.ToList());
return id.ToString();
}

74
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs

@ -11,6 +11,8 @@ using TaskJob.Interfaces;
using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Errors;
using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs;
using Win.Sfs.SettleAccount.Repository.SettleAccount;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob;
@ -52,7 +54,7 @@ namespace SettleAccount.Job.Services
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
@ -63,7 +65,9 @@ namespace SettleAccount.Job.Services
InvoiceSettledDetailDiffDapperRepository dapperRepository1,
OutputService outputService,
InputService inputService,
UnSettledDetailDapperRepository dapperRepository2
UnSettledDetailDapperRepository dapperRepository2,
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository
)
{
_fileContainer = fileContainer;
@ -75,6 +79,7 @@ namespace SettleAccount.Job.Services
_dapperRepository =dapperRepository;
_dapperRepository1 = dapperRepository1;
_dapperRepository2 = dapperRepository2;
_errorListRepository = errorListRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
@ -147,6 +152,20 @@ namespace SettleAccount.Job.Services
}
var _checkList = _errorListRepository.ToList();
var query = 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=query.ToList();
var _lsSum=_ls.GroupBy(p => new { p.MaterialCode, p.SapMaterialCode, p.MaterialGroup,p.InvoicePrice }).Select(p => new UnInvoiceSettledDetailSum
{
MaterialCode = p.Key.MaterialCode,
@ -328,11 +347,26 @@ namespace SettleAccount.Job.Services
}
var _checkList = _errorListRepository.ToList();
var query = 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 = query.ToList();
//.Select(p => p.FirstOrDefault());
_ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList();
}
return _ls;
}
public List<SettleDoorPanelSumExport> LSettleSum(Guid id, List<string> exportName, List<CustomCondition> p_list)
@ -360,16 +394,7 @@ namespace SettleAccount.Job.Services
var _list = _dapperRepository2.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, "", version,"", materialGroup, sapCode);
var _ls = _list.Where(p => p.Flag == "L").Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList();
//var _lst = _erpDapper.GetSapList(_ls, version, false);
//_lst.ForEach(p =>
//{
// p.Qty = 1;
// p.DiffAMT = Math.Round(p.Qty * p.Price, 2);
// p.DiffQty = 1;
//}
//);
//_list.AddRange(_lst);
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
@ -402,14 +427,23 @@ namespace SettleAccount.Job.Services
_list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
}
}
//if (!string.IsNullOrEmpty(materailCode))
//{
// var _groupList = materailCode.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
// }
//}
var _checkList = _errorListRepository.ToList();
var query = from itm in _list
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;
_list = query.ToList();
_list = _list.OrderBy(p => p.ChassisNumber).ThenBy(p => p.SapMaterialCode).ThenBy(p => p.Flag).ToList();
var report2List = _ls.Where(p=>p.UnSettleVersion==version).Select(p => new { p.MaterialGroup, DiffAmt = p.Price * p.Qty }).GroupBy(p => new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version });

22
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs

@ -12,6 +12,8 @@ using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Uow;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Errors;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report
@ -56,6 +58,7 @@ namespace SettleAccount.Job.Services.Report
private readonly OutputService _outputService;
private readonly ErpPartDapperRepository _erpDapper;
private readonly SettleSparePartDapperReportRepository _sparepartdapper;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
private readonly IBlobContainer<MyFileContainer> _fileContainer;
public UnSettledSumService(
HQHSettledDetailDapperRepository hqkanbanDapper,
@ -65,7 +68,8 @@ namespace SettleAccount.Job.Services.Report
ErpPartDapperRepository erpDapper,
WmsDapperRepository wmsDapper,
SettleSparePartDapperReportRepository sparepartdapper,
IBlobContainer<MyFileContainer> fileContainer
IBlobContainer<MyFileContainer> fileContainer,
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository
)
{
_wmsDapper = wmsDapper;
@ -76,6 +80,7 @@ namespace SettleAccount.Job.Services.Report
_erpDapper = erpDapper;
_sparepartdapper = sparepartdapper;
_fileContainer = fileContainer;
_errorListRepository = errorListRepository;
}
[UnitOfWork(false)]
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
@ -186,6 +191,21 @@ namespace SettleAccount.Job.Services.Report
_list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
}
}
var _checkList = _errorListRepository.ToList();
var query = from itm in _list
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;
_list = query.ToList();
var _fislist =_list.GroupBy(p => new { p.SapMaterialCode, p.MaterialDesc, p.MaterialGroup, p.MaterialCode })
.Select(p => new UnSettledSum
{

39
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs

@ -6,7 +6,9 @@ using System.Threading.Tasks;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.UnSettle;
using Win.Sfs.SettleAccount.Errors;
using Win.Sfs.SettleAccount.FISes;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.ExportDto;
@ -18,15 +20,19 @@ namespace SettleAccount.Job.Services.Report
private readonly UnSettledDetailDapperRepository _dapper;
private readonly OutputService _outputService;
private readonly ErpPartDapperRepository _erpDapper;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
public UnsettledDetailReportService(
UnSettledDetailDapperRepository dapper,
OutputService outputService,
ErpPartDapperRepository erpDapper
ErpPartDapperRepository erpDapper,
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository
)
{
_dapper = dapper;
_outputService = outputService;
_erpDapper = erpDapper;
_errorListRepository = errorListRepository;
}
@ -101,16 +107,31 @@ namespace SettleAccount.Job.Services.Report
_list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
}
}
var removeList= _dapper.GetRemoveDetail();
var _query= from itm in _list
join itm1 in removeList on new { itm.ChassisNumber, itm.SapMaterialCode }
equals new { itm1.ChassisNumber, itm1.SapMaterialCode } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_list=_query.ToList();
var _checkList = _errorListRepository.ToList();
var query = 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;
_list = query.ToList();
// var removeList= _dapper.GetRemoveDetail();
// var _query= from itm in _list
// join itm1 in removeList on new { itm.ChassisNumber, itm.SapMaterialCode }
//equals new { itm1.ChassisNumber, itm1.SapMaterialCode } into temp1
// from tm1 in temp1.DefaultIfEmpty()
// where tm1 == null
// select itm;
_list = _list.OrderBy(p => p.SapMaterialCode).ThenBy(p => p.ChassisNumber).ThenBy(p => p.Flag).ToList();
_outputService.Export<UnSettleDetailReport>(id, _first, _list);

Loading…
Cancel
Save