Administrator 2 years ago
parent
commit
accd2c1fe6
  1. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Materials/MaterialDtoBase.cs
  2. 22
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs
  3. 13
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs
  4. 21
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs
  5. 25
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanExtendAppService.cs
  6. 18
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs
  7. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  8. 1
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs
  9. 74
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
  10. 2
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs
  11. 15
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs
  12. 17
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs
  13. 17
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs
  14. 19
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs
  15. 19
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs
  16. 18
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleUnSparePartExportService.cs
  17. 45
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SyncFisService.cs
  18. 36
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs

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

@ -13,7 +13,7 @@ using Win.Sfs.Shared.DtoBase;
namespace Win.Sfs.SettleAccount.Entities.Errors namespace Win.Sfs.SettleAccount.Entities.Errors
{ {
public class ErrorBillDto public class ErrorBillDto : AuditedEntityDtoBase<Guid>
{ {
/// <summary> /// <summary>
///错误单据号 ///错误单据号

22
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs

@ -16,6 +16,7 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.Guids; using Volo.Abp.Guids;
using Volo.Abp.Uow;
using Win.Abp.Snowflakes; using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.CommonManagers;
@ -23,6 +24,7 @@ using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.HQ_M; using Win.Sfs.SettleAccount.Entities.HQ_M;
using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.HQ_H namespace Win.Sfs.SettleAccount.Entities.HQ_H
@ -47,6 +49,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
private readonly ISettleAccountBranchEfCoreRepository<HQ_M_PlatformVersion, Guid> _versionMRepository; private readonly ISettleAccountBranchEfCoreRepository<HQ_M_PlatformVersion, Guid> _versionMRepository;
private readonly ISettleAccountBranchEfCoreRepository<HQ_M_Platform, Guid> _repositoryM; private readonly ISettleAccountBranchEfCoreRepository<HQ_M_Platform, Guid> _repositoryM;
private readonly ErpPartDapperRepository _erpdapperRepository;
/// <summary> /// <summary>
/// 构建方法 /// 构建方法
/// </summary> /// </summary>
@ -59,6 +62,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
IDistributedCache<HQ_H_Platform> cache, IDistributedCache<HQ_H_Platform> cache,
IExcelImportAppService excelImportService, IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
ErpPartDapperRepository erpdapperRepository,
ICommonManager commonManager, ICommonManager commonManager,
ISettleAccountBranchEfCoreRepository<HQ_M_PlatformVersion, Guid> versionMRepository, ISettleAccountBranchEfCoreRepository<HQ_M_PlatformVersion, Guid> versionMRepository,
ISettleAccountBranchEfCoreRepository<HQ_M_Platform, Guid> repositoryM ISettleAccountBranchEfCoreRepository<HQ_M_Platform, Guid> repositoryM
@ -70,6 +74,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
_repository = repository; _repository = repository;
_versionMRepository = versionMRepository; _versionMRepository = versionMRepository;
_repositoryM = repositoryM; _repositoryM = repositoryM;
_erpdapperRepository = erpdapperRepository;
} }
/// <summary> /// <summary>
@ -85,10 +90,12 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
[HttpPost] [HttpPost]
[Route("ExcelImport")] [Route("ExcelImport")]
[DisableRequestSizeLimit] [DisableRequestSizeLimit]
[UnitOfWork(false)]
[Authorize(SettleAccountPermissions.HQ_HPlatform.Create)] [Authorize(SettleAccountPermissions.HQ_HPlatform.Create)]
public async Task<string> HQ_H_PlatformUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode) public async Task<string> HQ_H_PlatformUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode)
{ {
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var checkList = new List<ErrorExportDto>();
var result = await _exportImporter.UploadExcelImport<HQ_H_PlatformImportDto>(files, _excelImportService); var result = await _exportImporter.UploadExcelImport<HQ_H_PlatformImportDto>(files, _excelImportService);
if (result == null || result.Count == 0) if (result == null || result.Count == 0)
@ -97,6 +104,21 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
} }
var entityList = ObjectMapper.Map<List<HQ_H_PlatformImportDto>, List<HQ_H_Platform>>(result); var entityList = ObjectMapper.Map<List<HQ_H_PlatformImportDto>, List<HQ_H_Platform>>(result);
//和物料主数据中SAP物料号检验是否存在
foreach (var itm in entityList)
{
if (!_erpdapperRepository.GetMaterialList().Any(p => p.CustomerPartCode == itm.MaterialCode))
{
checkList.Add(new ErrorExportDto(version, "红旗结算导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty));
}
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
//删除版本 //删除版本
var _versionQuery = _versionRepository.Where(p => p.Version == version); var _versionQuery = _versionRepository.Where(p => p.Version == version);
await _versionQuery.BatchDeleteAsync(); await _versionQuery.BatchDeleteAsync();

13
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs

@ -69,6 +69,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository; private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job; private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job;
private readonly IExcelImportAppService _excelImportService; private readonly IExcelImportAppService _excelImportService;
//private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly TaskJobService _service; private readonly TaskJobService _service;
@ -92,6 +93,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
WMSEfCoreRepository<TB_BILL> wmstbRespository, WMSEfCoreRepository<TB_BILL> wmstbRespository,
IDistributedCache<WmsHQHKanbanOutPutDetial> cache, IDistributedCache<WmsHQHKanbanOutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
//ErpPartDapperRepository erpdapperRepository,
ICommonManager commonManager ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{ {
@ -101,6 +103,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
_wmsVersionRepository = wmsVersionRepository; _wmsVersionRepository = wmsVersionRepository;
_wmsefRespository = wmsefRespository; _wmsefRespository = wmsefRespository;
_excelImportService = excelImportService; _excelImportService = excelImportService;
//_erpdapperRepository = erpdapperRepository;
} }
private async Task<long> GetCountAsync(WmsKanbanOutPutDetialRequestDto input) private async Task<long> GetCountAsync(WmsKanbanOutPutDetialRequestDto input)
@ -446,6 +449,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[HttpPost] [HttpPost]
[Route("ExcelImport")] [Route("ExcelImport")]
[DisableRequestSizeLimit] [DisableRequestSizeLimit]
//[UnitOfWork(false)]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version) public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{ {
@ -480,6 +484,15 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
} }
} }
////和物料主数据中SAP物料号检验是否存在
//foreach (var itm in filteResult)
//{
// if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode))
// {
// checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty));
// }
//}
if (checkList.Count > 0) if (checkList.Count > 0)
{ {

21
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs

@ -78,6 +78,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
private readonly TaskJobService _service; private readonly TaskJobService _service;
private readonly WmsDapperRepository _wmsDapper; private readonly WmsDapperRepository _wmsDapper;
// private readonly ErpPartDapperRepository _erpdapperRepository;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -99,6 +101,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
WMSEfCoreRepository<TB_BILL> wmstbRespository, WMSEfCoreRepository<TB_BILL> wmstbRespository,
IDistributedCache<WmsKanbanOutPutDetial> cache, IDistributedCache<WmsKanbanOutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
// ErpPartDapperRepository erpdapperRepository,
ICommonManager commonManager, ICommonManager commonManager,
WmsDapperRepository wmsDapper WmsDapperRepository wmsDapper
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
@ -110,6 +113,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
_wmsefRespository = wmsefRespository; _wmsefRespository = wmsefRespository;
_excelImportService = excelImportService; _excelImportService = excelImportService;
_dapper = dapper; _dapper = dapper;
// _erpdapperRepository = erpdapperRepository;
_wmsDapper = wmsDapper; _wmsDapper = wmsDapper;
} }
@ -752,6 +756,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[HttpPost] [HttpPost]
[Route("ExcelImport")] [Route("ExcelImport")]
[DisableRequestSizeLimit] [DisableRequestSizeLimit]
//[UnitOfWork(false)]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version) public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{ {
@ -776,6 +781,22 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
checkList.Add(new ErrorExportDto(version, "大众看板出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中看板号{0}的结算数量为0,影响出库请检查!", itm.Kanban), string.Empty)); checkList.Add(new ErrorExportDto(version, "大众看板出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中看板号{0}的结算数量为0,影响出库请检查!", itm.Kanban), string.Empty));
} }
} }
////和物料主数据中SAP物料号检验是否存在
//foreach (var itm in filteResult)
//{
// if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode))
// {
// checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty));
// }
//}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
//发现导入模板中存在空行,直接过滤掉 //发现导入模板中存在空行,直接过滤掉
var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.Kanban)); var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.Kanban));

25
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanExtendAppService.cs

@ -51,7 +51,9 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace Win.Sfs.SettleAccount.Entities.WMS namespace Win.Sfs.SettleAccount.Entities.WMS
{ {
/// <summary>
/// 大众无条码看板出库单
/// </summary>
[Route("api/settleaccount/wmskanbanoutputextend")] [Route("api/settleaccount/wmskanbanoutputextend")]
//[AllowAnonymous] //[AllowAnonymous]
[Authorize(SettleAccountPermissions.WMSJIT.Default)] [Authorize(SettleAccountPermissions.WMSJIT.Default)]
@ -70,6 +72,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository; private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job; private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job;
private readonly IExcelImportAppService _excelImportService; private readonly IExcelImportAppService _excelImportService;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly TaskJobService _service; private readonly TaskJobService _service;
@ -94,6 +97,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
KanbanUnSettledDapperRepository dapper, KanbanUnSettledDapperRepository dapper,
WMSEfCoreRepository<TB_BILL> wmstbRespository, WMSEfCoreRepository<TB_BILL> wmstbRespository,
IDistributedCache<WmsWithOutKanbanOutPutDetial> cache, IDistributedCache<WmsWithOutKanbanOutPutDetial> cache,
//ErpPartDapperRepository erpdapperRepository,
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager, ICommonManager commonManager,
WmsDapperRepository wmsDapper WmsDapperRepository wmsDapper
@ -107,6 +111,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
_excelImportService = excelImportService; _excelImportService = excelImportService;
_dapper = dapper; _dapper = dapper;
_wmsDapper = wmsDapper; _wmsDapper = wmsDapper;
// _erpdapperRepository = erpdapperRepository;
} }
private async Task<long> GetCountAsync(WmsKanbanOutPutDetialRequestDto input) private async Task<long> GetCountAsync(WmsKanbanOutPutDetialRequestDto input)
@ -237,6 +242,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[HttpPost] [HttpPost]
[Route("ExcelImportWithOutKanban")] [Route("ExcelImportWithOutKanban")]
[DisableRequestSizeLimit] [DisableRequestSizeLimit]
//[UnitOfWork(false)]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImportWithOutKanban([FromForm] IFormFileCollection files, string version) public async Task<string> ExcelImportWithOutKanban([FromForm] IFormFileCollection files, string version)
{ {
@ -310,13 +316,26 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
// _billNum, // _billNum,
// 0, // 0,
// itm. // itm.
// ); // );
// _lsCopy.Add(_detail); // _lsCopy.Add(_detail);
//} //}
//_lst.AddRange(_lsCopy.ToArray()); //_lst.AddRange(_lsCopy.ToArray());
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsWithOutKanbanOutPutDetial>(files, _excelImportService); var result = await _exportImporter.ExtendExcelImport<WmsWithOutKanbanOutPutDetial>(files, _excelImportService);
////和物料主数据中SAP物料号检验是否存在
//foreach (var itm in result)
//{
// if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode))
// {
// checkList.Add(new ErrorExportDto(version, "大众无条码看板出库单导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty));
// }
//}
//if (checkList.Count > 0)
//{
// return await ExportErrorReportAsync(checkList);
//}
List<WmsWithOutKanbanOutPutDetial> _lst = new List<WmsWithOutKanbanOutPutDetial>(); List<WmsWithOutKanbanOutPutDetial> _lst = new List<WmsWithOutKanbanOutPutDetial>();
var _lsCopy = new List<WmsWithOutKanbanOutPutDetial>(); var _lsCopy = new List<WmsWithOutKanbanOutPutDetial>();
foreach (var itm in result) foreach (var itm in result)
@ -354,7 +373,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
select itm1; select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) }); var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList) foreach (var itm in errList)
{ {
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) }); checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });

18
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs

@ -44,6 +44,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository; private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job; private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job;
private readonly IExcelImportAppService _excelImportService; private readonly IExcelImportAppService _excelImportService;
//private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly TaskJobService _service; private readonly TaskJobService _service;
/// <summary> /// <summary>
@ -69,6 +70,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
IExcelImportAppService excelImportService, IExcelImportAppService excelImportService,
IDistributedCache<WmsSharePart90OutPutDetial> cache, IDistributedCache<WmsSharePart90OutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
// ErpPartDapperRepository erpdapperRepository,
WmsDapperRepository wmsDapper, WmsDapperRepository wmsDapper,
ICommonManager commonManager ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
@ -80,6 +82,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
_wmsVersionRepository = wmsVersionRepository; _wmsVersionRepository = wmsVersionRepository;
_wmsefRespository = wmsefRespository; _wmsefRespository = wmsefRespository;
_wmsDapper = wmsDapper; _wmsDapper = wmsDapper;
// _erpdapperRepository = erpdapperRepository;
} }
private async Task<long> GetCountAsync(WmsSharePartOutPutDetialRequestDto input) private async Task<long> GetCountAsync(WmsSharePartOutPutDetialRequestDto input)
@ -480,6 +483,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[HttpPost] [HttpPost]
[Route("ExcelImport")] [Route("ExcelImport")]
[DisableRequestSizeLimit] [DisableRequestSizeLimit]
//[UnitOfWork(false)]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version) public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{ {
@ -507,6 +511,20 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中订单号{0}结算数量为0,影响出库请检查!", itm.OrderBillNum), string.Empty)); checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中订单号{0}结算数量为0,影响出库请检查!", itm.OrderBillNum), string.Empty));
} }
} }
//和物料主数据中SAP物料号检验是否存在
//foreach (var itm in filteResult)
//{
// if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode))
// {
// checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty));
// }
//}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
List<WmsSharePart90OutPutDetial> _lst = new List<WmsSharePart90OutPutDetial>(); List<WmsSharePart90OutPutDetial> _lst = new List<WmsSharePart90OutPutDetial>();
var _lsCopy = new List<WmsSharePart90OutPutDetial>(); var _lsCopy = new List<WmsSharePart90OutPutDetial>();

2
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -282,7 +282,7 @@ namespace Win.Sfs.SettleAccount
{ {
CreateMap<ErrorBill, ErrorBillDto>().ReverseMap(); CreateMap<ErrorBill, ErrorBillDto>().ReverseMap();
CreateMap<ErrorBill, ErrorBillRequestDto>().ReverseMap(); CreateMap<ErrorBill, ErrorBillRequestDto>().ReverseMap();
CreateMap<ErrorBill, ErrorBillImportDto>().ReverseMap(); CreateMap<ErrorBillImportDto, ErrorBill>().ReverseMap();
CreateMap<ErrorBill, ErrorBillExportDto>().ReverseMap(); CreateMap<ErrorBill, ErrorBillExportDto>().ReverseMap();
} }

1
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs

@ -244,6 +244,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
} }
return _lst; return _lst;
} }

74
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs

@ -165,7 +165,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.发货数量,\n" + " temp1.发货数量,\n" +
" temp1.发货与开票差异,\n" + " temp1.发货与开票差异,\n" +
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 实际交货数量,\n" + " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 实际交货数量,\n" +
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) - ISNULL( temp3.Qty, 0 ) AS 实际交货与开票差异,\n" + " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) - ISNULL( temp3.Qty, 0 )-ISNULL( TEMP5.Qty, 0 ) AS 实际交货与开票差异,\n" +
" ISNULL( temp3.Qty, 0 ) 退货数量,\n" + " ISNULL( temp3.Qty, 0 ) 退货数量,\n" +
" ISNULL( TEMP5.Qty, 0 ) 往期已结 \n" + " ISNULL( TEMP5.Qty, 0 ) 往期已结 \n" +
" FROM\n" + " FROM\n" +
@ -378,7 +378,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
var list11 = DbConnection.Query<CompareExtend1>(string.Format(sql10, version)); var list11 = DbConnection.Query<CompareExtend1>(string.Format(sql10, version));
@ -422,6 +422,43 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
var list12 = DbConnection.Query<CompareExtend1>(string.Format(sql11, version)); var list12 = DbConnection.Query<CompareExtend1>(string.Format(sql11, version));
//看板号为空的情况下,取外部单号的值
// var sql12 = " SELECT DISTINCT \n" +
//" t1.* \n" +
//" FROM \n" +
//" ( \n" +
//" SELECT \n" +
//" a.ExternalKanbanNumber AS ExternalKanbanNumber, \n" +
//" a.KanbanNumber AS KanbanNumber, \n" +
//" CONVERT ( VARCHAR ( 100 ), a.AcceptanceDate, 23 ) AS AcceptanceDate, \n" +
//" HQHKanBan, \n" +
//" b2.MaterialCode \n" +
//" FROM \n" +
//" Set_UnHQSettleAccount a \n" +
//" LEFT JOIN Set_material b2 ON a.MaterialCode = b2.CustomerPartCode \n" +
//" WHERE \n" +
//" Version = '{0}' \n" +
//" AND HQHKanBan is null \n" +
//" ) t1 \n" +
//" LEFT JOIN ( \n" +
//" SELECT \n" +
//" HQHKanBan, \n" +
//" MaterialCode \n" +
//" FROM \n" +
//" Set_UnHQSettleAccount a \n" +
//" WHERE \n" +
//" Version = '{0}' \n" +
//" AND HQHKanBan is null \n" +
//" GROUP BY \n" +
//" HQHKanBan, \n" +
//" MaterialCode \n" +
//" HAVING \n" +
//" COUNT ( * ) > 1 \n" +
//" ) t2 ON t1.HQHKanBan = t2.HQHKanBan \n" +
//" AND t1.MaterialCode = t2.MaterialCode ";
// var list13 = DbConnection.Query<CompareExtend1>(string.Format(sql12, version));
List<CompareExtend1> _lscopy = new List<CompareExtend1>(); List<CompareExtend1> _lscopy = new List<CompareExtend1>();
@ -753,7 +790,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
/// <summary> /// <summary>
/// 大众备件未结(带单号),包含有发货有结算(条件:发货数量大于结算数据)也整合到大众备件未结中 /// 大众备件未结(带单号),包含有发货有结算(条件:发货数量大于结算数据)也整合到大众备件未结中
/// 用于--寄售未结比对WMS库存 /// 用于--寄售未结比对WMS库存(因为日期传参问题,单独拿出)
/// </summary> /// </summary>
/// <param name="purchaseOrderNo"></param> /// <param name="purchaseOrderNo"></param>
/// <param name="version"></param> /// <param name="version"></param>
@ -1203,6 +1240,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
/// <summary> /// <summary>
/// 大众备件未结(带单号),包含有发货有结算(条件:发货数量大于结算数据)也整合到大众备件未结中 /// 大众备件未结(带单号),包含有发货有结算(条件:发货数量大于结算数据)也整合到大众备件未结中
/// 用于备件未结统计
/// </summary> /// </summary>
/// <param name="purchaseOrderNo"></param> /// <param name="purchaseOrderNo"></param>
/// <param name="version"></param> /// <param name="version"></param>
@ -1250,13 +1288,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料代码,\n" + " temp1.物料代码,\n" +
" temp1.物料描述,\n" + " temp1.物料描述,\n" +
" temp1.发货数量,\n" + " temp1.发货数量,\n" +
" temp1.开票数量,\n" + " temp1.已结数量,\n" +
" temp1.收货与交货差异,\n" + " temp1.收货与交货差异,\n" +
" ISNULL( temp3.Qty, 0 ) 退货数量,\n" + " ISNULL( temp3.Qty, 0 ) 退货数量,\n" +
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 未结数量,\n" + " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 未结数量,\n" +
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) 实际发货数量,\n" + " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) 实际发货数量,\n" +
" ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" +
" ISNULL( TEMP2.Price, 0 ) * ( ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) ) 实际发货总金额 \n" + " ISNULL( TEMP2.Price, 0 ) * ( ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) ) 实际发货总金额 \n" +
" FROM\n" + " FROM\n" +
" (\n" + " (\n" +
" SELECT\n" + " SELECT\n" +
@ -1264,11 +1302,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" NULL AS 交货日期,\n" + " NULL AS 交货日期,\n" +
" a.PurchaseOrderNo AS 采购订单号,\n" + " a.PurchaseOrderNo AS 采购订单号,\n" +
" c.MaterialCode AS SAP编码,\n" + " c.MaterialCode AS SAP编码,\n" +
" c.CustomerPartCode AS 物料代码,\n" + " a.MaterialCode AS 物料代码,\n" +
" c.MaterialDesc AS 物料描述,\n" + " c.MaterialDesc AS 物料描述,\n" +
" c.EstimateTypeDesc AS 物料组,\n" + " c.EstimateTypeDesc AS 物料组,\n" +
" ISNULL( a.ReceiptQty, 0 ) AS 发货数量,\n" + " ISNULL( a.ReceiptQty, 0 ) AS 发货数量,\n" +
" ISNULL( b.Qty, 0 ) AS 开票数量,\n" + " ISNULL( b.Qty, 0 ) AS 已结数量,\n" +
" ( ISNULL( a.ReceiptQty, 0 ) - ISNULL( b.Qty, 0 ) ) AS 收货与交货差异 \n" + " ( ISNULL( a.ReceiptQty, 0 ) - ISNULL( b.Qty, 0 ) ) AS 收货与交货差异 \n" +
" FROM\n" + " FROM\n" +
" (\n" + " (\n" +
@ -1308,13 +1346,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料代码,\n" + " temp1.物料代码,\n" +
" temp1.物料描述,\n" + " temp1.物料描述,\n" +
" temp1.发货数量,\n" + " temp1.发货数量,\n" +
" temp1.开票数量,\n" + " temp1.已结数量,\n" +
" temp1.收货与交货差异,\n" + " temp1.收货与交货差异,\n" +
" ISNULL( temp3.Qty, 0 ) 退货数量,\n" + " ISNULL( temp3.Qty, 0 ) 退货数量,\n" +
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 未结数量,\n" + " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 未结数量,\n" +
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) 实际发货数量,\n" + " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) 实际发货数量,\n" +
" ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" +
" ISNULL( TEMP2.Price, 0 ) * (ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) ) 实际发货总金额 \n" + " ISNULL( TEMP2.Price, 0 ) * (ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) ) 实际发货总金额 \n" +
" FROM\n" + " FROM\n" +
" (\n" + " (\n" +
" SELECT\n" + " SELECT\n" +
@ -1322,11 +1360,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" NULL AS 交货日期,\n" + " NULL AS 交货日期,\n" +
" a.PurchaseOrderNo AS 采购订单号,\n" + " a.PurchaseOrderNo AS 采购订单号,\n" +
" c.MaterialCode AS SAP编码,\n" + " c.MaterialCode AS SAP编码,\n" +
" c.CustomerPartCode AS 物料代码,\n" + " a.MaterialCode AS 物料代码,\n" +
" c.MaterialDesc AS 物料描述,\n" + " c.MaterialDesc AS 物料描述,\n" +
" c.EstimateTypeDesc AS 物料组,\n" + " c.EstimateTypeDesc AS 物料组,\n" +
" ISNULL( a.ReceiptQty, 0 ) AS 发货数量,\n" + " ISNULL( a.ReceiptQty, 0 ) AS 发货数量,\n" +
" ISNULL( b.ReceiptQty, 0 ) AS 开票数量,\n" + " ISNULL( b.ReceiptQty, 0 ) AS 已结数量,\n" +
" ( ISNULL( b.ReceiptQty, 0 ) - ISNULL( a.ReceiptQty, 0 ) ) AS 收货与交货差异 \n" + " ( ISNULL( b.ReceiptQty, 0 ) - ISNULL( a.ReceiptQty, 0 ) ) AS 收货与交货差异 \n" +
" FROM\n" + " FROM\n" +
" (\n" + " (\n" +
@ -1652,7 +1690,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "发货数量")] [ExporterHeader(DisplayName = "发货数量")]
public decimal { set; get; } public decimal { set; get; }
[ExporterHeader(DisplayName = "往期已结")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "开票数量")] [ExporterHeader(DisplayName = "开票数量")]
public decimal { set; get; } public decimal { set; get; }
@ -1719,9 +1759,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "发货数量")] [ExporterHeader(DisplayName = "发货数量")]
public decimal { set; get; } public decimal { set; get; }
[ExporterHeader(DisplayName = "开票数量", IsIgnore = true)] [ExporterHeader(DisplayName = "已结数量")]
public decimal { set; get; } public decimal { set; get; }
[ExporterHeader(DisplayName = "收货与交货差异", IsIgnore = true)] [ExporterHeader(DisplayName = "收货与交货差异", IsIgnore = true)]
public decimal { set; get; } public decimal { set; get; }

2
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs

@ -125,7 +125,7 @@ namespace SettleAccount.Job.Services.Report
ExcelExporter _exporter = new ExcelExporter();//导出Excel ExcelExporter _exporter = new ExcelExporter();//导出Excel
var result = _exporter.Append(_ls.ToList(), "红旗系统未对比对红旗主机厂未结") var result = _exporter.Append(_ls.ToList(), "红旗系统未对比对红旗主机厂未结")
.SeparateBySheet() .SeparateBySheet()
.Append(_ls_reversal.ToList(), "红旗主机厂未结比对红旗系统未") .Append(_ls_reversal.ToList(), "红旗主机厂未结比对红旗系统未")
.ExportAppendDataAsByteArray(); .ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();
_fileContainer.SaveAsync(_filename, result.Result, true); _fileContainer.SaveAsync(_filename, result.Result, true);

15
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs

@ -11,6 +11,8 @@ using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
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
@ -24,6 +26,7 @@ namespace SettleAccount.Job.Services.Report
private readonly HQHSettledDetailDapperRepository _dapperRepository; private readonly HQHSettledDetailDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository; private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly IBlobContainer<MyFileContainer> _fileContainer; private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
private readonly OutputService _outputService; private readonly OutputService _outputService;
private readonly InputService _inputService; private readonly InputService _inputService;
@ -32,7 +35,7 @@ namespace SettleAccount.Job.Services.Report
ErpPartDapperRepository erpdapperRepository, ErpPartDapperRepository erpdapperRepository,
HQHSettledDetailDapperRepository dapperRepository, HQHSettledDetailDapperRepository dapperRepository,
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository,
OutputService outputService, OutputService outputService,
InputService inputService InputService inputService
, IBlobContainer<MyFileContainer> fileContainer , IBlobContainer<MyFileContainer> fileContainer
@ -43,6 +46,7 @@ namespace SettleAccount.Job.Services.Report
_erpdapperRepository = erpdapperRepository; _erpdapperRepository = erpdapperRepository;
_fileContainer = fileContainer; _fileContainer = fileContainer;
_dapperRepository = dapperRepository; _dapperRepository = dapperRepository;
_errorListRepository = errorListRepository;
} }
[UnitOfWork(false)] [UnitOfWork(false)]
@ -136,7 +140,16 @@ namespace SettleAccount.Job.Services.Report
} }
} }
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _ls
join itm1 in _checkList on new { ChassisNumber = itm., MaterialCode = itm., WmsBillNum = itm. }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_ls = query.ToList();
//_outputService.Export<HQHSettledDetailDiff>(id, _filename, _ls); //_outputService.Export<HQHSettledDetailDiff>(id, _filename, _ls);

17
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs

@ -10,6 +10,8 @@ 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.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
@ -26,12 +28,13 @@ namespace SettleAccount.Job.Services.Report
private readonly OutputService _outputService; private readonly OutputService _outputService;
private readonly InputService _inputService; private readonly InputService _inputService;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
public HQHUnSettledDetailDiffExportService( public HQHUnSettledDetailDiffExportService(
ErpPartDapperRepository erpdapperRepository, ErpPartDapperRepository erpdapperRepository,
HQHSettledDetailDapperRepository dapperRepository, HQHSettledDetailDapperRepository dapperRepository,
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository,
OutputService outputService, OutputService outputService,
InputService inputService InputService inputService
, IBlobContainer<MyFileContainer> fileContainer , IBlobContainer<MyFileContainer> fileContainer
@ -42,6 +45,7 @@ namespace SettleAccount.Job.Services.Report
_erpdapperRepository = erpdapperRepository; _erpdapperRepository = erpdapperRepository;
_fileContainer = fileContainer; _fileContainer = fileContainer;
_dapperRepository = dapperRepository; _dapperRepository = dapperRepository;
_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)
@ -79,8 +83,17 @@ namespace SettleAccount.Job.Services.Report
} }
} }
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _ls
join itm1 in _checkList on new { ChassisNumber = itm., MaterialCode = itm., WmsBillNum = itm. }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_ls = query.ToList();
ExcelExporter _exporter = new ExcelExporter();//导出Excel ExcelExporter _exporter = new ExcelExporter();//导出Excel
var result = _exporter.Append(_ls.ToList(), "红旗看板未结明细") var result = _exporter.Append(_ls.ToList(), "红旗看板未结明细")

17
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs

@ -10,6 +10,8 @@ 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.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
@ -20,8 +22,11 @@ namespace SettleAccount.Job.Services.Report
private readonly OutputService _outputService; private readonly OutputService _outputService;
KanbanUnSettledDapperRepository _dapper; KanbanUnSettledDapperRepository _dapper;
private readonly IBlobContainer<MyFileContainer> _fileContainer; private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
public KanBanUnSettledExport(KanbanUnSettledDapperRepository dapper, OutputService outputService, public KanBanUnSettledExport(KanbanUnSettledDapperRepository dapper,
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository,
OutputService outputService,
IBlobContainer<MyFileContainer> fileContainer IBlobContainer<MyFileContainer> fileContainer
) )
@ -31,6 +36,7 @@ namespace SettleAccount.Job.Services.Report
_outputService = outputService; _outputService = outputService;
_fileContainer = fileContainer; _fileContainer = fileContainer;
_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)
@ -93,7 +99,16 @@ namespace SettleAccount.Job.Services.Report
} }
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _ls
join itm1 in _checkList on new { ChassisNumber = itm.Kanban, MaterialCode = itm.CustomerPartCode, WmsBillNum = itm.WmsBillNum }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_ls = query.ToList();
//if (!string.IsNullOrEmpty(materialCode)) //if (!string.IsNullOrEmpty(materialCode))

19
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs

@ -6,23 +6,31 @@ using System.Threading.Tasks;
using TaskJob.EventArgs; using TaskJob.EventArgs;
using TaskJob.Interfaces; using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount;
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
{ {
/// <summary>
/// 大众看板结算输出
/// </summary>
public class SettleKBWithCodeExportService : ITransientDependency, IExportJob public class SettleKBWithCodeExportService : ITransientDependency, IExportJob
{ {
private readonly SettleKBWithCodeDapperReportRepository _dapper; private readonly SettleKBWithCodeDapperReportRepository _dapper;
private readonly OutputService _outputService; private readonly OutputService _outputService;
private readonly ErpPartDapperRepository _erpdapperRepository; private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
public SettleKBWithCodeExportService(SettleKBWithCodeDapperReportRepository dapper, public SettleKBWithCodeExportService(SettleKBWithCodeDapperReportRepository dapper,
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository,
OutputService outputService, OutputService outputService,
ErpPartDapperRepository erpdapperRepository) ErpPartDapperRepository erpdapperRepository)
{ {
_dapper = dapper; _dapper = dapper;
_outputService = outputService; _outputService = outputService;
_erpdapperRepository = erpdapperRepository; _erpdapperRepository = erpdapperRepository;
_errorListRepository = errorListRepository;
} }
@ -103,9 +111,18 @@ namespace SettleAccount.Job.Services.Report
} }
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _list
join itm1 in _checkList on new { ChassisNumber = itm.Kanban, MaterialCode = itm.CustomerPartCode, WmsBillNum = itm.WMSDeliveryNote }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_list = query.ToList();
_outputService.Export<SettleKBWithCode>(id, _filename, _list); _outputService.Export<SettleKBWithCode>(id, _filename, _list.ToList());
return id.ToString(); return id.ToString();
} }

19
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs

@ -10,6 +10,8 @@ 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.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
@ -22,8 +24,12 @@ namespace SettleAccount.Job.Services.Report
private readonly IBlobContainer<MyFileContainer> _fileContainer; private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly WmsDapperRepository _wmsDapper; private readonly WmsDapperRepository _wmsDapper;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
public SettleSparePartExportService(SettleSparePartDapperReportRepository dapper, ErpPartDapperRepository erpdapperRepository, OutputService outputService
public SettleSparePartExportService(SettleSparePartDapperReportRepository dapper,
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository,
ErpPartDapperRepository erpdapperRepository, OutputService outputService
, WmsDapperRepository wmsDapper , WmsDapperRepository wmsDapper
, IBlobContainer<MyFileContainer> fileContainer) , IBlobContainer<MyFileContainer> fileContainer)
{ {
@ -32,6 +38,7 @@ namespace SettleAccount.Job.Services.Report
_erpdapperRepository = erpdapperRepository; _erpdapperRepository = erpdapperRepository;
_fileContainer = fileContainer; _fileContainer = fileContainer;
_wmsDapper = wmsDapper; _wmsDapper = wmsDapper;
_errorListRepository = errorListRepository;
} }
@ -135,6 +142,16 @@ namespace SettleAccount.Job.Services.Report
// _outputService.Export<SettleSparePartExport>(id, fileName, _ls); // _outputService.Export<SettleSparePartExport>(id, fileName, _ls);
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _ls
join itm1 in _checkList on new { ChassisNumber = itm., MaterialCode = itm., WmsBillNum = itm. }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_ls = query.ToList();
ExcelExporter _exporter = new ExcelExporter();//导出Excel ExcelExporter _exporter = new ExcelExporter();//导出Excel

18
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleUnSparePartExportService.cs

@ -10,6 +10,8 @@ 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.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
@ -21,9 +23,12 @@ namespace SettleAccount.Job.Services.Report
private readonly ErpPartDapperRepository _erpdapperRepository; private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly IBlobContainer<MyFileContainer> _fileContainer; private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly WmsDapperRepository _wmsDapper; private readonly WmsDapperRepository _wmsDapper;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
public SettleUnSparePartExportService(SettleSparePartDapperReportRepository dapper, ErpPartDapperRepository erpdapperRepository, OutputService outputService public SettleUnSparePartExportService(SettleSparePartDapperReportRepository dapper,
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository,
ErpPartDapperRepository erpdapperRepository, OutputService outputService
, WmsDapperRepository wmsDapper , WmsDapperRepository wmsDapper
, IBlobContainer<MyFileContainer> fileContainer) , IBlobContainer<MyFileContainer> fileContainer)
{ {
@ -32,6 +37,7 @@ namespace SettleAccount.Job.Services.Report
_erpdapperRepository = erpdapperRepository; _erpdapperRepository = erpdapperRepository;
_fileContainer = fileContainer; _fileContainer = fileContainer;
_wmsDapper = wmsDapper; _wmsDapper = wmsDapper;
_errorListRepository = errorListRepository;
} }
@ -123,6 +129,16 @@ namespace SettleAccount.Job.Services.Report
} }
} }
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _reversels_withcode
join itm1 in _checkList on new { ChassisNumber = itm., MaterialCode = itm., WmsBillNum = itm. }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_reversels_withcode = query.ToList();
ExcelExporter _exporter = new ExcelExporter();//导出Excel ExcelExporter _exporter = new ExcelExporter();//导出Excel
var result = _exporter.Append(_reversels_withcode.ToList(), "大众备件未结明细") var result = _exporter.Append(_reversels_withcode.ToList(), "大众备件未结明细")

45
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SyncFisService.cs

@ -12,6 +12,8 @@ using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
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
@ -28,6 +30,7 @@ namespace SettleAccount.Job.Services.Report
private readonly ErpPartDapperRepository _erpDapper; private readonly ErpPartDapperRepository _erpDapper;
private readonly SettleSparePartDapperReportRepository _sparepartdapper; private readonly SettleSparePartDapperReportRepository _sparepartdapper;
private readonly IBlobContainer<MyFileContainer> _fileContainer; private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
public SyncFisService( public SyncFisService(
HQHSettledDetailDapperRepository hqkanbanDapper, HQHSettledDetailDapperRepository hqkanbanDapper,
KanbanUnSettledDapperRepository kanbanDapper, KanbanUnSettledDapperRepository kanbanDapper,
@ -36,6 +39,7 @@ namespace SettleAccount.Job.Services.Report
ErpPartDapperRepository erpDapper, ErpPartDapperRepository erpDapper,
WmsDapperRepository wmsDapper, WmsDapperRepository wmsDapper,
SettleSparePartDapperReportRepository sparepartdapper, SettleSparePartDapperReportRepository sparepartdapper,
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository,
IBlobContainer<MyFileContainer> fileContainer IBlobContainer<MyFileContainer> fileContainer
) )
{ {
@ -46,7 +50,8 @@ namespace SettleAccount.Job.Services.Report
_outputService = outputService; _outputService = outputService;
_erpDapper = erpDapper; _erpDapper = erpDapper;
_sparepartdapper = sparepartdapper; _sparepartdapper = sparepartdapper;
_fileContainer = fileContainer; _fileContainer = fileContainer;
_errorListRepository = errorListRepository;
} }
[UnitOfWork(false)] [UnitOfWork(false)]
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list) public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
@ -237,6 +242,17 @@ namespace SettleAccount.Job.Services.Report
} }
} }
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _ls
join itm1 in _checkList on new { ChassisNumber = itm.Kanban, MaterialCode = itm.CustomerPartCode, WmsBillNum = itm.WmsBillNum }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_ls = query.ToList();
//DiffQty 为实际发货数量=发货数量-结算数量-退货数量 财务要求 //DiffQty 为实际发货数量=发货数量-结算数量-退货数量 财务要求
var kanbanList = _ls.GroupBy(p => new { p.SapCode, p.MaterialDesc, p.MaterialGroup, p.CustomerPartCode }) var kanbanList = _ls.GroupBy(p => new { p.SapCode, p.MaterialDesc, p.MaterialGroup, p.CustomerPartCode })
@ -295,6 +311,17 @@ namespace SettleAccount.Job.Services.Report
} }
} }
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _ls
join itm1 in _checkList on new { ChassisNumber = itm., MaterialCode = itm., WmsBillNum = itm. }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_ls = query.ToList();
var kanbanList = _ls.GroupBy(p => new { p.Sap编码, p., p., p. }) var kanbanList = _ls.GroupBy(p => new { p.Sap编码, p., p., p. })
.Select(p => new UnSettledSum .Select(p => new UnSettledSum
{ {
@ -342,6 +369,22 @@ namespace SettleAccount.Job.Services.Report
_ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList(); _ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList();
} }
} }
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _ls
join itm1 in _checkList on new { ChassisNumber = itm., MaterialCode = itm., WmsBillNum = itm. }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_ls = query.ToList();
//说明 为实际发货数量=发货数量-结算数量-退货数量 财务要求 //说明 为实际发货数量=发货数量-结算数量-退货数量 财务要求
var kanbanList = _ls.GroupBy(p => new { p.SAP编码, p., p. }) var kanbanList = _ls.GroupBy(p => new { p.SAP编码, p., p. })
.Select(p => new UnSettledSum .Select(p => new UnSettledSum

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

@ -286,6 +286,17 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms
} }
} }
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _ls
join itm1 in _checkList on new { ChassisNumber = itm.Kanban, MaterialCode = itm.CustomerPartCode, WmsBillNum = itm.WmsBillNum }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_ls = query.ToList();
//DiffQty 为实际发货数量=发货数量-结算数量-退货数量 财务要求 //DiffQty 为实际发货数量=发货数量-结算数量-退货数量 财务要求
var kanbanList = _ls.GroupBy(p => new { p.SapCode, p.MaterialDesc, p.MaterialGroup, p.CustomerPartCode }) var kanbanList = _ls.GroupBy(p => new { p.SapCode, p.MaterialDesc, p.MaterialGroup, p.CustomerPartCode })
@ -344,6 +355,17 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms
} }
} }
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _ls
join itm1 in _checkList on new { ChassisNumber = itm., MaterialCode = itm., WmsBillNum = itm. }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_ls = query.ToList();
var kanbanList = _ls.GroupBy(p => new { p.Sap编码, p., p., p. }) var kanbanList = _ls.GroupBy(p => new { p.Sap编码, p., p., p. })
.Select(p => new UnSettledSum .Select(p => new UnSettledSum
{ {
@ -391,6 +413,20 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms
_ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList(); _ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList();
} }
} }
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _errorListRepository.ToList();
var query = from itm in _ls
join itm1 in _checkList on new { ChassisNumber = itm., MaterialCode = itm., WmsBillNum = itm. }
equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
_ls = query.ToList();
//说明 为实际发货数量=发货数量-结算数量-退货数量 财务要求 //说明 为实际发货数量=发货数量-结算数量-退货数量 财务要求
var kanbanList = _ls.GroupBy(p => new { p.SAP编码, p., p. }) var kanbanList = _ls.GroupBy(p => new { p.SAP编码, p., p. })
.Select(p => new UnSettledSum .Select(p => new UnSettledSum

Loading…
Cancel
Save