From 330518ac9f5dc781efcf0e8785b753a18b130195 Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Wed, 26 Jan 2022 11:34:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E4=BC=97=E5=A4=87=E4=BB=B60-90?= =?UTF-8?q?=E5=A4=A9=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=EF=BC=88=E6=97=A0=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E5=8F=B7?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VWSparePart/SparePartAppService.cs | 135 ++++++++++++-- .../Entities/WMS/WMSSharePart90AppService.cs | 96 +++++++--- .../SettleAccount.Application.xml | 7 +- .../Entities/WMS/TaskList.cs | 118 ++++++++++++ ...AccountDbContextModelCreatingExtensions.cs | 51 ++++- .../SettleKBWithCodeDapperReportRepository.cs | 2 +- ...SettleSparePart90DapperReportRepository.cs | 176 +++++++++++++++--- .../SettleSparePartDapperReportRepository.cs | 35 ++-- .../Report/SettleSparePart90ExportService.cs | 43 ++--- 9 files changed, 562 insertions(+), 101 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWSparePart/SparePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWSparePart/SparePartAppService.cs index 48745ce2..06da9081 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWSparePart/SparePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWSparePart/SparePartAppService.cs @@ -30,14 +30,14 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart /// 大众备件服务 /// [Route("api/settleaccount/SparePart")] - [Authorize(SettleAccountPermissions.SparePart.Default)] + //[Authorize(SettleAccountPermissions.SparePart.Default)] public class SparePartAppService : SettleAccountApplicationBase, ISparePartAppService { private readonly IGuidGenerator _guidGenerator; private readonly IExcelImportAppService _excelImportService; - private readonly ISettleAccountBranchEfCoreRepository< SparePartVersion, Guid> _versionRepository; + private readonly ISettleAccountBranchEfCoreRepository _versionRepository; private readonly ISettleAccountBranchEfCoreRepository _repository; /// @@ -47,7 +47,7 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart /// 仓储接口 /// 缓存 public SparePartAppService(IGuidGenerator guidGenerator, - ISettleAccountBranchEfCoreRepository< SparePartVersion, Guid> versionRepository, + ISettleAccountBranchEfCoreRepository versionRepository, ISettleAccountBranchEfCoreRepository repository, IDistributedCache 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>(result); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + var entityList = ObjectMapper.Map, List>(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(); - 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(); + _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 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(); @@ -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>(entities); + var dtoDetails = ObjectMapper.Map, List>(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 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>(entities.Where(p => p.Extend == "is90").ToList()); string _fileName = string.Empty; //声明导出容器 @@ -256,6 +305,36 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart /// /// 请求条件 /// 实体DTO列表 + //[HttpPost] + //[Route("list")] + ////[Authorize(SettleAccountPermissions.SettleAccounts.Default)] + //virtual public async Task> 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(0, new List()); + // } + + // 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(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>(entities.Where(p => p.Extend == "not90").ToList()); + + // return new PagedResultDto(totalCount, dtos); + //} + [HttpPost] [Route("list")] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] @@ -279,6 +358,36 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart return new PagedResultDto(totalCount, dtos); } + [HttpPost] + [Route("list90")] + //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] + virtual public async Task> 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(0, new List()); + } + + 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(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>(entities.Where(p=>p.Extend=="is90").ToList()); + + return new PagedResultDto(totalCount, dtos); + } + /// /// 获取实体总数 diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs index f8b296e4..9836266f 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs +++ b/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 + SettleAccountApplicationBase { - private readonly ISettleAccountBranchEfCoreRepository _wmsRepository; - private readonly ISettleAccountBranchEfCoreRepository _wmsVersionRepository; - private readonly WMSEfCoreRepository _wmsefRespository; + private readonly ISettleAccountBranchEfCoreRepository _wmsRepository; + private readonly ISettleAccountBranchEfCoreRepository _wmsVersionRepository; + private readonly WMSEfCoreRepository _wmsefRespository; + private readonly WmsDapperRepository _wmsDapper; private readonly WMSEfCoreRepository _wmstbRespository; private readonly ISettleAccountBranchEfCoreRepository _job; @@ -48,16 +50,22 @@ namespace Win.Sfs.SettleAccount.Entities.WMS /// /// /// + /// + /// + /// + /// + /// public WMSSharePart90AppService( - ISettleAccountBranchEfCoreRepository wmsRepository, + ISettleAccountBranchEfCoreRepository wmsRepository, ISettleAccountBranchEfCoreRepository job, - ISettleAccountBranchEfCoreRepository wmsVersionRepository, - WMSEfCoreRepository wmsefRespository, + ISettleAccountBranchEfCoreRepository wmsVersionRepository, + WMSEfCoreRepository wmsefRespository, WMSEfCoreRepository wmstbRespository, IExcelImportAppService excelImportService, - IDistributedCache cache, + IDistributedCache 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 GetCountAsync(WmsSharePartOutPutDetialRequestDto input) @@ -88,7 +97,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS [HttpPost] [Route("WmsSharePartList")] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] - virtual public async Task> GetListAsync(WmsSharePartOutPutRequestDto input) + virtual public async Task> 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(totalCount, entities); + return new PagedResultDto(totalCount, entities); } /// @@ -108,14 +117,45 @@ namespace Win.Sfs.SettleAccount.Entities.WMS [HttpPost] [Route("WmsSharePartDetailList")] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] - virtual public async Task> GetListAsync(WmsSharePartOutPutDetialRequestDto input) + virtual public async Task> 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(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(totalCount, entities); } /// /// 任务明细标记已确认 @@ -151,16 +191,16 @@ namespace Win.Sfs.SettleAccount.Entities.WMS if (_joblist.Count() > 0) { var fileList = _joblist.Select(p => p.RealDownFileName).ToList(); - List _lst = new List(); + List _lst = new List(); 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(); + var _list = _excelHelper.ExcelToList(); 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 _ls = new List(); + List _ls = new List(); 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(files, _excelImportService); - List _lst = new List(); + var result = await _exportImporter.ExtendExcelImport(files, _excelImportService); + List _lst = new List(); - var _lsCopy = new List(); + var _lsCopy = new List(); 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; diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml index 40f6f87f..ef9223be 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml @@ -3043,7 +3043,7 @@ - + @@ -3052,6 +3052,11 @@ + + + + + diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs index 3999f98f..b83ec30c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs @@ -1499,7 +1499,125 @@ namespace Win.Sfs.SettleAccount.Entities.WMS } + public class WmsSharePart90OutPut : FullAuditedAggregateRootBase + { + 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 + { + 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 = "物料代码")] + /// + /// 扩展字段1 + /// + public string Extend1 { set; get; } + /// + /// 扩展字段2 + /// + [ImporterHeader(Name = "扩展字段2", IsIgnore = true)] + public string Extend2 { set; get; } + /// + /// 扩展字段3 + /// + [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; } + + + } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index 7d2e346f..937e6644 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/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 } + /// + /// 大众备件0-90数据调整(无采购订单号) + /// + /// + /// + private static void ConfigureWmsSharePart90OutPutDetail(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) + { + + builder.Entity(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(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) { diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs index 4a4f914a..cb9e6501 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs +++ b/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" + diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs index 7ef28488..2a583636 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs +++ b/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; } + } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs index a2043ae0..b811f6a1 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs +++ b/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)) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs index 24ec5b54..b9c9dcee 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs +++ b/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();