Browse Source

大众备件0-90天数据调整发货(无采购订单号)

FoShanPG
44673626 3 years ago
parent
commit
330518ac9f
  1. 135
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWSparePart/SparePartAppService.cs
  2. 96
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs
  3. 7
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  4. 118
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  5. 51
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  6. 2
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs
  7. 176
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs
  8. 35
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
  9. 43
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs

135
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWSparePart/SparePartAppService.cs

@ -30,14 +30,14 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
/// 大众备件服务
/// </summary>
[Route("api/settleaccount/SparePart")]
[Authorize(SettleAccountPermissions.SparePart.Default)]
//[Authorize(SettleAccountPermissions.SparePart.Default)]
public class SparePartAppService : SettleAccountApplicationBase<SparePart>, ISparePartAppService
{
private readonly IGuidGenerator _guidGenerator;
private readonly IExcelImportAppService _excelImportService;
private readonly ISettleAccountBranchEfCoreRepository< SparePartVersion, Guid> _versionRepository;
private readonly ISettleAccountBranchEfCoreRepository<SparePartVersion, Guid> _versionRepository;
private readonly ISettleAccountBranchEfCoreRepository<SparePart, Guid> _repository;
/// <summary>
@ -47,7 +47,7 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
/// <param name="repository">仓储接口</param>
/// <param name="cache">缓存</param>
public SparePartAppService(IGuidGenerator guidGenerator,
ISettleAccountBranchEfCoreRepository< SparePartVersion, Guid> versionRepository,
ISettleAccountBranchEfCoreRepository<SparePartVersion, Guid> versionRepository,
ISettleAccountBranchEfCoreRepository<SparePart, Guid> repository,
IDistributedCache<SparePart> cache,
IExcelImportAppService excelImportService,
@ -78,17 +78,17 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
throw new BusinessException("版本不能空,必须传入!");
}
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport< SparePartImportDto>(files, _excelImportService);
var entityList = ObjectMapper.Map<List< SparePartImportDto>, List<SparePart>>(result);
var result = await _exportImporter.UploadExcelImport<SparePartImportDto>(files, _excelImportService);
var entityList = ObjectMapper.Map<List<SparePartImportDto>, List<SparePart>>(result);
//删除版本
var _versionQuery = _versionRepository.Where(p => p.Version == version);
await _versionQuery.BatchDeleteAsync();
//删除明细
var _query = _repository.Where(p => p.Version == version);
var _query = _repository.Where(p => p.Version == version && p.Extend != "is90");
await _query.BatchDeleteAsync();
//插入数据前检验
var checkList = new List<ErrorExportDto>();
var _group = entityList.GroupBy(x => new {x.LineNumber, x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), LineNumber= p.Key.LineNumber, MaterialCode = p.Key.MaterialCode });
var _group = entityList.GroupBy(x => new { x.LineNumber, x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), LineNumber = p.Key.LineNumber, MaterialCode = p.Key.MaterialCode });
foreach (var itm in _group)
{
if (string.IsNullOrEmpty(itm.MaterialCode))
@ -97,11 +97,11 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
}
}
var _id = GuidGenerator.Create();
var _bomList = new List< SparePartVersion>();
_bomList.Add(new SparePartVersion(_id, branchId, year, period, version, customerCode));
var _bomList = new List<SparePartVersion>();
_bomList.Add(new SparePartVersion(_id, branchId, year, period, version, customerCode));
foreach (var itm in entityList)
{
itm.SetValue(GuidGenerator.Create(), branchId, year, period, version,"not90");
itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, "not90");
}
if (checkList.Count > 0)
{
@ -115,7 +115,7 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
[HttpPost]
[Route("ExcelImport90")]
[DisableRequestSizeLimit]
[Authorize(SettleAccountPermissions.SettleAccounts.Create)]
//[Authorize(SettleAccountPermissions.SettleAccounts.Create)]
public async Task<string> SparePartUploadExcelImport90([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode)
{
if (string.IsNullOrEmpty(version))
@ -129,7 +129,7 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
var _versionQuery = _versionRepository.Where(p => p.Version == version);
await _versionQuery.BatchDeleteAsync();
//删除明细
var _query = _repository.Where(p => p.Version == version);
var _query = _repository.Where(p => p.Version == version && p.Extend == "is90");
await _query.BatchDeleteAsync();
//插入数据前检验
var checkList = new List<ErrorExportDto>();
@ -217,7 +217,56 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtoDetails = ObjectMapper.Map<List<SparePart>, List<SparePartExportDto>>(entities);
var dtoDetails = ObjectMapper.Map<List<SparePart>, List<SparePartExportDto>>(entities.Where(p => p.Extend == "not90").ToList());
string _fileName = string.Empty;
//声明导出容器
byte[] result = null;
switch (input.FileType)
{
case 0:
_fileName = string.Format("大众备件结算明细_{0}.csv", input.UserId.ToString());
result = await _csv.ExportAsByteArray(dtoDetails);
break;
case 1:
_fileName = string.Format("大众备件结算明细_{0}.xlsx", input.UserId.ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
break;
}
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
[HttpPost]
[Route("Export90")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<string> Export90Async(SparePartRequestDto input)
{
if (string.IsNullOrEmpty(input.Version))
{
throw new BusinessException("版本不能空,必须传入!");
}
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
if (!string.IsNullOrEmpty(input.Version))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtoDetails = ObjectMapper.Map<List<SparePart>, List<SparePartExportDto>>(entities.Where(p => p.Extend == "is90").ToList());
string _fileName = string.Empty;
//声明导出容器
@ -256,6 +305,36 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
//[HttpPost]
//[Route("list")]
////[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
//virtual public async Task<PagedResultDto<SparePartDto>> GetListAsync(SparePartRequestDto input)
//{
// if (!string.IsNullOrEmpty(input.Version))
// {
// input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
// }
// else
// {
// return new PagedResultDto<SparePartDto>(0, new List<SparePartDto>());
// }
// var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
// input.SkipCount, true);
// if (entities == null || entities.Count == 0)
// {
// return new PagedResultDto<SparePartDto>(0, null);
// }
// else
// {
// input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Extend", Logic = EnumFilterLogic.And, Value = "not90"});
// }
// var totalCount = await GetCountAsync(input);
// var dtos = ObjectMapper.Map<List<SparePart>, List<SparePartDto>>(entities.Where(p => p.Extend == "not90").ToList());
// return new PagedResultDto<SparePartDto>(totalCount, dtos);
//}
[HttpPost]
[Route("list")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
@ -279,6 +358,36 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
return new PagedResultDto<SparePartDto>(totalCount, dtos);
}
[HttpPost]
[Route("list90")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<SparePartDto>> GetList90Async(SparePartRequestDto input)
{
if (!string.IsNullOrEmpty(input.Version))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
}
else
{
return new PagedResultDto<SparePartDto>(0, new List<SparePartDto>());
}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
if (entities == null || entities.Count==0)
{
return new PagedResultDto<SparePartDto>(0, null);
}
else
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Extend", Logic = EnumFilterLogic.And, Value = "is90" });
}
var totalCount = await GetCountAsync(input);
var dtos = ObjectMapper.Map<List<SparePart>, List<SparePartDto>>(entities.Where(p=>p.Extend=="is90").ToList());
return new PagedResultDto<SparePartDto>(totalCount, dtos);
}
/// <summary>
/// 获取实体总数

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

@ -21,6 +21,7 @@ using Win.Sfs.SettleAccount.Entities.Wms;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.Repository;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
using Win.Sfs.Shared.Filter;
using WY.NewJit.Extends.PaiGe.WMS;
@ -29,11 +30,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[Route("api/settleaccount/wmsSharePart90output")]
[Authorize(SettleAccountPermissions.WMSJIT.Default)]
public class WMSSharePart90AppService :
SettleAccountApplicationBase<WmsSharePartOutPutDetial>
SettleAccountApplicationBase<WmsSharePart90OutPutDetial>
{
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePartOutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePartOutPut, Guid> _wmsVersionRepository;
private readonly WMSEfCoreRepository<WmsSharePartOutPutDetial> _wmsefRespository;
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePart90OutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePart90OutPut, Guid> _wmsVersionRepository;
private readonly WMSEfCoreRepository<WmsSharePart90OutPutDetial> _wmsefRespository;
private readonly WmsDapperRepository _wmsDapper;
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job;
@ -48,16 +50,22 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <param name="wmsVersionRepository"></param>
/// <param name="wmsefRespository"></param>
/// <param name="wmstbRespository"></param>
/// <param name="excelImportService"></param>
/// <param name="cache"></param>
/// <param name="snowflakeIdGenerator"></param>
/// <param name="wmsDapper"></param>
/// <param name="commonManager"></param>
public WMSSharePart90AppService(
ISettleAccountBranchEfCoreRepository<WmsSharePartOutPutDetial, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<WmsSharePart90OutPutDetial, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job,
ISettleAccountBranchEfCoreRepository<WmsSharePartOutPut, Guid> wmsVersionRepository,
WMSEfCoreRepository<WmsSharePartOutPutDetial> wmsefRespository,
ISettleAccountBranchEfCoreRepository<WmsSharePart90OutPut, Guid> wmsVersionRepository,
WMSEfCoreRepository<WmsSharePart90OutPutDetial> wmsefRespository,
WMSEfCoreRepository<TB_BILL> wmstbRespository,
IExcelImportAppService excelImportService,
IDistributedCache<WmsSharePartOutPutDetial> cache,
IDistributedCache<WmsSharePart90OutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator,
WmsDapperRepository wmsDapper,
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
@ -67,6 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
_wmsRepository = wmsRepository;
_wmsVersionRepository = wmsVersionRepository;
_wmsefRespository = wmsefRespository;
_wmsDapper = wmsDapper;
}
private async Task<long> GetCountAsync(WmsSharePartOutPutDetialRequestDto input)
@ -88,7 +97,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[HttpPost]
[Route("WmsSharePartList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsSharePartOutPut>> GetListAsync(WmsSharePartOutPutRequestDto input)
virtual public async Task<PagedResultDto<WmsSharePart90OutPut>> GetListAsync(WmsSharePartOutPutRequestDto input)
{
var entities = await _wmsVersionRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
@ -97,7 +106,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
var totalCount = await GetCountAsync(input);
return new PagedResultDto<WmsSharePartOutPut>(totalCount, entities);
return new PagedResultDto<WmsSharePart90OutPut>(totalCount, entities);
}
/// <summary>
@ -108,14 +117,45 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[HttpPost]
[Route("WmsSharePartDetailList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsSharePartOutPutDetial>> GetListAsync(WmsSharePartOutPutDetialRequestDto input)
virtual public async Task<PagedResultDto<WmsSharePart90OutPutDetial>> GetListAsync(WmsSharePartOutPutDetialRequestDto input)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
return new PagedResultDto<WmsSharePartOutPutDetial>(totalCount, entities);
var stockList = _wmsDapper.GetSalesStock();
var query = from itm in entities
join itm1 in stockList on itm.MaterialCode equals itm1.SapCode
into temp1
from tm1 in temp1.DefaultIfEmpty()
select new WmsSharePart90OutPutDetial(//少加个发货,由于零件有重复
itm.Id,
itm.WmsBillNum,
itm.OrderBillNum,
itm.MaterialCode,
itm.MaterialDesc,
itm.MaterialGroup,
itm.OutPut,
itm.InPut,
itm.State,
itm.Extend1,
itm.Extend2,
itm.Version,
itm.ParentMaterialCode,
itm.BillNum,
itm.TaskId,
itm.Remark,
itm.Qty,
tm1 == null ? 0 : tm1.Qty,
itm.OutPutQty
);
return new PagedResultDto<WmsSharePart90OutPutDetial>(totalCount, entities);
}
/// <summary>
/// 任务明细标记已确认
@ -151,16 +191,16 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
if (_joblist.Count() > 0)
{
var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();
List<WmsSharePart90OutPutDetial> _lst = new List<WmsSharePart90OutPutDetial>();
foreach (var filename in fileList)
{
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
ExcelHelper _excelHelper = new ExcelHelper(fileSavePath);
var _list = _excelHelper.ExcelToList<WmsSharePartOutPutDetial>();
var _list = _excelHelper.ExcelToList<WmsSharePart90OutPutDetial>();
if (_list.Count() > 0)
{
var _lsAry = _list.Select(p => new
WmsSharePartOutPutDetial(
WmsSharePart90OutPutDetial(
GuidGenerator.Create(),
p.WmsBillNum,
p.OrderBillNum,
@ -178,7 +218,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
_billNum,
GuidGenerator.Create(),
string.Empty,
p.Qty
p.Qty,
p.StockQty,
p.Qty
));
_lst.AddRange(_list.ToArray());
}
@ -206,7 +248,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
select itm1;
var _wmslst = query.ToList();
_wmslst = _wmslst.Select(p => new
WmsSharePartOutPutDetial(
WmsSharePart90OutPutDetial(
GuidGenerator.Create(),
p.WmsBillNum,
p.OrderBillNum,
@ -223,13 +265,15 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
_billNum,
GuidGenerator.Create(),
string.Empty,
p.Qty
p.Qty,
p.StockQty,
p.Qty
)).ToList();
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
if (_wmslst.Count() > 0 && _count == 0)
{
var _version = new WmsSharePartOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
var _version = new WmsSharePart90OutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
foreach (var job in _joblist)
@ -273,7 +317,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
{
if (input.Guids != null)
{
List<WmsSharePartOutPutDetial> _ls = new List<WmsSharePartOutPutDetial>();
List<WmsSharePart90OutPutDetial> _ls = new List<WmsSharePart90OutPutDetial>();
if (input.Guids.Count() > 0)
{
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
@ -375,13 +419,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
{
var _billNum = "B" + DateTime.Now.ToString("yyyyMMddhhmmss");
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsSharePartOutPutDetial>(files, _excelImportService);
List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();
var result = await _exportImporter.ExtendExcelImport<WmsSharePart90OutPutDetial>(files, _excelImportService);
List<WmsSharePart90OutPutDetial> _lst = new List<WmsSharePart90OutPutDetial>();
var _lsCopy = new List<WmsSharePartOutPutDetial>();
var _lsCopy = new List<WmsSharePart90OutPutDetial>();
foreach (var itm in result)
{
WmsSharePartOutPutDetial _detail = new WmsSharePartOutPutDetial(
WmsSharePart90OutPutDetial _detail = new WmsSharePart90OutPutDetial(
GuidGenerator.Create(),
itm.WmsBillNum,
itm.OrderBillNum,
@ -400,6 +444,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
GuidGenerator.Create()
, string.Empty
, itm.Qty
, 0
, itm.Qty
);
_lsCopy.Add(_detail);
}
@ -444,7 +490,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
if (_count == 0 && _wmslst.Count() > 0)
{
var _version = new WmsSharePartOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
var _version = new WmsSharePart90OutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
return ApplicationConsts.SuccessStr;

7
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -3043,7 +3043,7 @@
<param name="p_list"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WMSSharePart90AppService.#ctor(Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPutDetial},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{WY.NewJit.Extends.PaiGe.WMS.TB_BILL},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager)">
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WMSSharePart90AppService.#ctor(Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePart90OutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePart90OutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePart90OutPutDetial},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{WY.NewJit.Extends.PaiGe.WMS.TB_BILL},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePart90OutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.WmsDapperRepository,Win.Sfs.SettleAccount.CommonManagers.ICommonManager)">
<summary>
</summary>
@ -3052,6 +3052,11 @@
<param name="wmsVersionRepository"></param>
<param name="wmsefRespository"></param>
<param name="wmstbRespository"></param>
<param name="excelImportService"></param>
<param name="cache"></param>
<param name="snowflakeIdGenerator"></param>
<param name="wmsDapper"></param>
<param name="commonManager"></param>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WMSSharePart90AppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsSharePartOutPutRequestDto)">
<summary>

118
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs

@ -1499,7 +1499,125 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
public class WmsSharePart90OutPut : FullAuditedAggregateRootBase<Guid>
{
public WmsSharePart90OutPut()
{
}
public WmsSharePart90OutPut(Guid id, string version, string billNum, string creator) : base(id)
{
Id = id;
Version = version;
BillNum = billNum;
Creator = creator;
}
public string Version { set; get; }
public string BillNum { set; get; }
public string Creator { set; get; }
}
public class WmsSharePart90OutPutDetial : FullAuditedAggregateRootBase<Guid>
{
public WmsSharePart90OutPutDetial()
{
}
public WmsSharePart90OutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty, decimal stockQty, decimal outputQty)
{
Id = id;
WmsBillNum = wmsBillNum;
OrderBillNum = orderBillNum;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
MaterialGroup = materialGroup;
OutPut = outPut;
InPut = inPut;
State = state;
Extend1 = extend1;
Extend2 = extend2;
Version = extend3;
ParentMaterialCode = parentMaterialCode;
BillNum = billNum;
TaskId = taskId;
Remark = remark;
Qty = qty;
}
public void SetId(Guid id)
{
Id = id;
}
// 期间 交货单号 发货日期 采购订单号 SAP编码 物料代码 物料描述 物料组 开票单价 数量差异 发货数量 开票数量 定价 单价差异
[ImporterHeader(Name = "寄销库数量", IsIgnore = true)]
public decimal StockQty { set; get; }
[ImporterHeader(Name = "出库数量", IsIgnore = true)]
public decimal OutPutQty { set; get; }
[ImporterHeader(Name = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
public string WmsBillNum { set; get; }
[ImporterHeader(Name = "采购订单号")]
//KENN号
public string OrderBillNum { set; get; }
[ImporterHeader(Name = "SAP编码")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "物料代码")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ImporterHeader(Name = "扩展字段2", IsIgnore = true)]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ImporterHeader(Name = "开票数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "数量", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "任务代码", IsIgnore = true)]
public Guid TaskId { set; get; }
}

51
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -332,12 +332,16 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureWmsKanbanOutPutVersion(options);
builder.ConfigureWmsKanbanOutPutDetail(options);
//大众看板
builder.ConfigureWmsWithOutKanbanOutPutVersion(options);
builder.ConfigureWmsWithOutKanbanOutPutDetail(options);
//大众备件-正常出库(有采购订单号)
builder.ConfigureWmsSharePartOutPutDetail(options);
builder.ConfigureWmsSharePartOutPutVersion(options);
//大众备件-数据调整(无采购订单号)
builder.ConfigureWmsSharePart90OutPutDetail(options);
builder.ConfigureWmsSharePart90OutPutVersion(options);
builder.ConfigureHQFKanban(options);
builder.ConfigureHQMKanban(options);
builder.ConfigureHQHKanban(options);
@ -1437,6 +1441,49 @@ namespace Win.Sfs.SettleAccount
}
/// <summary>
/// 大众备件0-90数据调整(无采购订单号)
/// </summary>
/// <param name="builder"></param>
/// <param name="options"></param>
private static void ConfigureWmsSharePart90OutPutDetail(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsSharePart90OutPutDetial>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsSharePart90OutPutDetial", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.WmsBillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.OutPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.InPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.OrderBillNum).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.ParentMaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend1).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend2).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.MaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.BillNum });
});
}
private static void ConfigureWmsSharePart90OutPutVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsSharePart90OutPut>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsSharePart90OutPut", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.BillNum });
});
}
private static void ConfigureWmsHQFKanbanOutPutVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{

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

@ -64,7 +64,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" FROM\n" +
" Set_KanBanSettle AS a\n" +
" LEFT JOIN Set_material AS b ON a.MaterialCode= b.CustomerPartCode\n" +
" INNER JOIN Set_WMSKanBanSettle c ON a.Kanban= c.Kanban \n" +
" LEFT JOIN Set_WMSKanBanSettle c ON a.Kanban= c.Kanban \n" +
" AND a.MaterialCode= c.MaterialCode\n" +
" LEFT JOIN ( SELECT SUM ( amt ) / SUM ( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '{0}' GROUP BY materialcode ) d ON a.MaterialCode= d.MaterialCode where a.VERSION='{0}'\n" +
" ) TEMP1\n" +

176
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs

@ -47,7 +47,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" b.WMSDeliveryNote AS 交货单号,\n" +
" b.SpareDate AS 发货日期,\n" +
" b.PurchaseOrderNo AS 采购订单号,\n" +
" c.MaterialCode AS SAP编码,\n" +
" b.SapCode AS SAP编码,\n" +
" b.MaterialCode AS 物料代码,\n" +
" c.MaterialDesc AS 物料描述,\n" +
" c.EstimateTypeDesc AS 物料组,\n" +
@ -57,29 +57,39 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ISNULL( b.ReceiptQty, 0 ) AS 开票数量 \n" +
" FROM\n" +
" (\n" +
" SELECT SUM\n" +
" ( ReceiptQty ) AS ReceiptQty,\n" +
" PurchaseOrderNo,\n" +
" MaterialCode,\n" +
" Version,\n" +
" PurchasePriceNoTax \n" +
" SELECT\n" +
" t.ReceiptQty,\n" +
" t.PurchaseOrderNo,\n" +
" t.Version,\n" +
" t.PurchasePriceNoTax,\n" +
" ( SELECT MaterialCode FROM Set_material WHERE CustomerPartCode = t.MaterialCode ) AS SapCode \n" +
" FROM\n" +
" Set_SparePart \n" +
" WHERE\n" +
" Extend = 'is90' \n" +
" GROUP BY\n" +
" PurchaseOrderNo,\n" +
" MaterialCode,\n" +
" Version,\n" +
" PurchasePriceNoTax \n" +
" (\n" +
" SELECT SUM\n" +
" ( ReceiptQty ) AS ReceiptQty,\n" +
" PurchaseOrderNo,\n" +
" MaterialCode,\n" +
" Version,\n" +
" PurchasePriceNoTax \n" +
" FROM\n" +
" Set_SparePart \n" +
" WHERE\n" +
" Extend = 'is90' \n" +
" GROUP BY\n" +
" PurchaseOrderNo,\n" +
" MaterialCode,\n" +
" Version,\n" +
" PurchasePriceNoTax \n" +
" ) t \n" +
" ) AS a\n" +
" LEFT OUTER JOIN (\n" +
" INNER JOIN (\n" +
" SELECT\n" +
" WMSDeliveryNote,\n" +
" SpareDate,\n" +
" MaterialCode,\n" +
" ReceiptQty,\n" +
" PurchaseOrderNo \n" +
" PurchaseOrderNo,\n" +
" SapCode \n" +
" FROM\n" +
" Set_WMSSparePart \n" +
" WHERE\n" +
@ -87,12 +97,82 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" AND PurchaseOrderNo LIKE '%D30%' \n" +
" OR PurchaseOrderNo LIKE '%D60%' \n" +
" OR PurchaseOrderNo LIKE '%D90%' \n" +
" ) AS b ON a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) AS b ON a.SapCode = b.SapCode\n" +
" LEFT OUTER JOIN ( SELECT MAX ( Id ) Id, MaterialCode, MaterialDesc, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc ) AS c ON b.SapCode = c.MaterialCode \n" +
" WHERE\n" +
" ( a.Version = '{0}' ) \n" +
" ( a.Version = '202112' ) \n" +
" ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode";
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" +
"ORDER BY\n" +
" temp1.采购订单号";
//"SELECT\n" +
//" temp1.期间,\n" +
//" temp1.交货单号,\n" +
//" temp1.发货日期,\n" +
//" temp1.采购订单号,\n" +
//" temp1.SAP编码,\n" +
//" temp1.物料代码,\n" +
//" temp1.物料描述,\n" +
//" temp1.物料组,\n" +
//" temp1.开票单价,\n" +
//" temp1.数量差异,\n" +
//" temp1.发货数量,\n" +
//" temp1.开票数量,\n" +
//" ISNULL( TEMP2.Price, 0 ) AS 定价,\n" +
//" temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" a.Version AS 期间,\n" +
//" b.WMSDeliveryNote AS 交货单号,\n" +
//" b.SpareDate AS 发货日期,\n" +
//" b.PurchaseOrderNo AS 采购订单号,\n" +
//" c.MaterialCode AS SAP编码,\n" +
//" b.MaterialCode AS 物料代码,\n" +
//" c.MaterialDesc AS 物料描述,\n" +
//" c.EstimateTypeDesc AS 物料组,\n" +
//" a.PurchasePriceNoTax AS 开票单价,\n" +
//" 0 AS 数量差异,\n" +
//" ISNULL( b.ReceiptQty, 0 ) AS 发货数量,\n" +
//" ISNULL( b.ReceiptQty, 0 ) AS 开票数量 \n" +
//" FROM\n" +
//" (\n" +
//" SELECT SUM\n" +
//" ( ReceiptQty ) AS ReceiptQty,\n" +
//" PurchaseOrderNo,\n" +
//" MaterialCode,\n" +
//" Version,\n" +
//" PurchasePriceNoTax \n" +
//" FROM\n" +
//" Set_SparePart \n" +
//" WHERE\n" +
//" Extend = 'is90' \n" +
//" GROUP BY\n" +
//" PurchaseOrderNo,\n" +
//" MaterialCode,\n" +
//" Version,\n" +
//" PurchasePriceNoTax \n" +
//" ) AS a\n" +
//" LEFT OUTER JOIN (\n" +
//" SELECT\n" +
//" WMSDeliveryNote,\n" +
//" SpareDate,\n" +
//" MaterialCode,\n" +
//" ReceiptQty,\n" +
//" PurchaseOrderNo \n" +
//" FROM\n" +
//" Set_WMSSparePart \n" +
//" WHERE\n" +
//" PurchaseOrderNo != 'BM' \n" +
//" AND PurchaseOrderNo LIKE '%D30%' \n" +
//" OR PurchaseOrderNo LIKE '%D60%' \n" +
//" OR PurchaseOrderNo LIKE '%D90%' \n" +
//" ) AS b ON a.MaterialCode = b.MaterialCode\n" +
//" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
//" WHERE\n" +
//" ( a.Version = '{0}' ) \n" +
//" ) AS temp1\n" +
//" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode ORDER BY temp1.采购订单号";
string addwhere = string.Empty;
string addSqlStr = string.Format(sqlString, version);
@ -109,10 +189,50 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
string sqlString = "SELECT\n" +
" ISNULL( A.ReceiptQty - ISNULL( B.ReceiptQty, 0 ), 0 ) 数量差异,\n" +
" a.PurchaseOrderNo 订单号,\n" +
" a.MaterialCode 物料号 \n" +
" a.SapCode 厂内物料号 \n" +
"FROM\n" +
" ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Version = '{0}' GROUP BY PurchaseOrderNo, MaterialCode ) A\n" +
" LEFT JOIN ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_WMSSparePart GROUP BY PurchaseOrderNo, MaterialCode ) B ON A.MaterialCode = B.MaterialCode";
" (\n" +
" SELECT\n" +
" t.ReceiptQty,\n" +
" t.PurchaseOrderNo,\n" +
" t.Version,\n" +
" t.PurchasePriceNoTax,\n" +
" ( SELECT MaterialCode FROM Set_material WHERE CustomerPartCode = t.MaterialCode ) AS SapCode \n" +
" FROM\n" +
" (\n" +
" SELECT SUM\n" +
" ( ReceiptQty ) AS ReceiptQty,\n" +
" PurchaseOrderNo,\n" +
" MaterialCode,\n" +
" Version,\n" +
" PurchasePriceNoTax \n" +
" FROM\n" +
" Set_SparePart \n" +
" WHERE\n" +
" Extend = 'is90' \n" +
" GROUP BY\n" +
" PurchaseOrderNo,\n" +
" MaterialCode,\n" +
" Version,\n" +
" PurchasePriceNoTax \n" +
" ) t \n" +
" ) A\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" WMSDeliveryNote,\n" +
" SpareDate,\n" +
" MaterialCode,\n" +
" ReceiptQty,\n" +
" PurchaseOrderNo,\n" +
" SapCode \n" +
" FROM\n" +
" Set_WMSSparePart \n" +
" WHERE\n" +
" PurchaseOrderNo != 'BM' \n" +
" AND PurchaseOrderNo LIKE '%D30%' \n" +
" OR PurchaseOrderNo LIKE '%D60%' \n" +
" OR PurchaseOrderNo LIKE '%D90%' \n" +
" ) B ON A.SapCode = B.SapCode WHERE (A.ReceiptQty - ISNULL( B.ReceiptQty, 0 )) <> 0";
string addwhere = string.Empty;
string addSqlStr = string.Format(sqlString, version);
@ -143,7 +263,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
public decimal { set; get; }
public string { set; get; }
public string { set; get; }
public string { set; get; }
}
@ -188,5 +308,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "单价差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "寄售库数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "出库数量")]
public decimal { set; get; }
}
}

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

@ -26,7 +26,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
string begintime, string endtime)
{
string sqlString =
" SELECT\n" +
"SELECT\n" +
" temp1.期间,\n" +
" temp1.交货单号,\n" +
" temp1.发货日期,\n" +
@ -41,7 +41,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.开票数量,\n" +
" ISNULL( TEMP2.Price, 0 ) AS 定价,\n" +
" temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 \n" +
" FROM\n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" a.Version AS 期间,\n" +
@ -57,21 +57,30 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ISNULL( b.ReceiptQty, 0 ) AS 发货数量,\n" +
" ISNULL( b.ReceiptQty, 0 ) AS 开票数量 \n" +
" FROM\n" +
" (SELECT SUM( ReceiptQty ) AS ReceiptQty, PurchaseOrderNo, MaterialCode, Version, PurchasePriceNoTax FROM Set_SparePart GROUP BY PurchaseOrderNo, MaterialCode, Version, PurchasePriceNoTax ) AS a\n" +
" (\n" +
" SELECT SUM\n" +
" ( ReceiptQty ) AS ReceiptQty,\n" +
" PurchaseOrderNo,\n" +
" MaterialCode,\n" +
" Version,\n" +
" PurchasePriceNoTax \n" +
" FROM\n" +
" Set_SparePart \n" +
" WHERE\n" +
" Extend = 'not90' \n" +
" GROUP BY\n" +
" PurchaseOrderNo,\n" +
" MaterialCode,\n" +
" Version,\n" +
" PurchasePriceNoTax \n" +
" ) AS a\n" +
" LEFT OUTER JOIN Set_WMSSparePart AS b ON a.PurchaseOrderNo = b.PurchaseOrderNo \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" ( a.Version = '{0}' )) AS temp1\n" +
" LEFT OUTER JOIN (\n" +
" SELECT\n" +
" Price,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_PriceList \n" +
" WHERE\n" +
" (\n" +
" Version = ( SELECT MAX(Version) AS Expr1 FROM Set_PriceList ))) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode";
" ( a.Version = '{0}' ) \n" +
" ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode ORDER BY temp1.采购订单号";
string addwhere = string.Empty;
string addSqlStr = string.Format(sqlString, version);
//if (!string.IsNullOrEmpty(purchaseOrderNo))

43
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs

@ -34,20 +34,21 @@ namespace SettleAccount.Job.Services.Report
var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value;
var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var _ls = _dapper.GetSettleSparePart90ReportList(purchaseOrderNo, version, sapCode, matialCode, beginTime, endTime);
//var diffList = _dapper.GetSettleSparePart90SumQtyDiff(version);
//if (diffList != null)
//{
// foreach (var itm in diffList)
// {
// var _first = _ls.FirstOrDefault(p => p.物料代码 == itm.物料号);
// if (_first != null)
// {
// _first.开票数量 = _first.发货数量 + itm.数量差异;//开票数量(结算数量+差异)
// _first.数量差异 = itm.数量差异;
// }
// }
//}
var diffList = _dapper.GetSettleSparePart90SumQtyDiff(version);
if (diffList != null)
{
foreach (var itm in diffList)
{
var _first = _ls.FirstOrDefault(p => p.SAP编码 == itm.);
if (_first != null)
{
_first. = _first. + itm.;//开票数量(结算数量+差异)
_first. = itm.;
}
}
}
//if (!string.IsNullOrEmpty(materialGroup))
//{
@ -65,14 +66,14 @@ namespace SettleAccount.Job.Services.Report
_ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList();
}
}
if (!string.IsNullOrEmpty(matialCode))
{
var _groupList = matialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
//if (!string.IsNullOrEmpty(matialCode))
//{
// var _groupList = matialCode.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.物料代码)).ToList();
// }
//}
//if (!string.IsNullOrEmpty(purchaseOrderNo))
//{
// var _groupList = purchaseOrderNo.Split(new char[] { '\n' }).Distinct().ToList();

Loading…
Cancel
Save