From 2f5cd8334ace01424c5cf603d5bc89dc750258ca Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Fri, 28 Jan 2022 14:55:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/WMS/WMSSharePart90AppService.cs | 6 ++-- .../Entities/WMS/WMSSharePartAppService.cs | 29 +++++++++++++++++-- .../Entities/WMS/TaskList.cs | 10 ++++++- 3 files changed, 39 insertions(+), 6 deletions(-) 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 fd58c5ee..981d3533 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs @@ -355,7 +355,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS var sql = "DECLARE @return_value int\n" + "EXEC @return_value = [dbo].[p_wms_output]\n" + " @billnum = N'{0}',\n" + - " @type = 2,\n" + + " @type = 10,\n" + " @date = N'{1}'\n" + "SELECT 'Return Value' = @return_value"; await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( @@ -389,7 +389,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS "EXEC @return_value = [dbo].[p_wms_output_cancel]\n" + " @Guids ='{0}', \n" + " @billnum = N'{1}',\n" + - " @type = 2,\n" + + " @type = 10,\n" + " @accountdate = N'{2}'\n" + "SELECT 'Return Value' = @return_value"; @@ -423,7 +423,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS var sql = "DECLARE @return_value int\n" + "EXEC @return_value = [dbo].[p_wms_output_cancel_all]\n" + " @billnum = N'{0}',\n" + - " @type = 2\n" + + " @type = 10\n" + "SELECT 'Return Value' = @return_value"; await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( string.Format(sql, input.BillNum) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs index 96157c57..3973b4be 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs @@ -207,7 +207,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts _billNum, GuidGenerator.Create(), string.Empty, - p.Qty + p.Qty, + p.StockQty, + p.Qty )); _lst.AddRange(_list.ToArray()); } @@ -252,7 +254,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts _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); @@ -326,6 +330,25 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts } return true; } + + + [HttpPost] + [Route("WmsSharePartOutPutModify")] + [DisableRequestSizeLimit] + public async Task WmsSharePartUpdate(WmsSharePartOutPutDetial detial) + { + var _entityList = _wmsRepository.Where(p => p.Id == detial.Id).ToList(); + if (_entityList.Count() > 0) + { + foreach (var itm in _entityList) + { + itm.OutPutQty = detial.OutPutQty; + await _wmsRepository.UpdateAsync(itm); + } + } + return true; + + } /// ///出库界面功能, 撤销核准出库 /// @@ -429,6 +452,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts GuidGenerator.Create() , string.Empty , itm.Qty + , 0 + , itm.Qty ); _lsCopy.Add(_detail); } 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 f43361bd..6b107b77 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs @@ -1386,7 +1386,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS { } - public WmsSharePartOutPutDetial(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) + public WmsSharePartOutPutDetial(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; @@ -1405,6 +1405,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS TaskId = taskId; Remark = remark; Qty = qty; + StockQty = stockQty; + OutPutQty = outputQty; } @@ -1466,6 +1468,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS [ImporterHeader(Name = "任务代码", IsIgnore = true)] public Guid TaskId { set; get; } + [ImporterHeader(Name = "寄销库数量", IsIgnore = true)] + public decimal StockQty { set; get; } + + [ImporterHeader(Name = "出库数量", IsIgnore = true)] + public decimal OutPutQty { set; get; } + } From 34679552120fa0a97d33f22cb2c8821dec5cb8ac Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Fri, 28 Jan 2022 19:04:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A4=87=E4=BB=B6-=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E8=B0=83=E6=95=B4=20WMS=E5=BA=93=E5=AD=98=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/WMS/WMSSharePartAppService.cs | 45 ++++++++++++++++--- .../ReportServices/ReportMakeService.cs | 2 +- .../SettleAccount.Application.xml | 2 +- .../SettleSparePartDapperReportRepository.cs | 2 +- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs index 3973b4be..401548ba 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs @@ -47,6 +47,7 @@ using Win.Sfs.SettleAccount.Entities.WMS; using Win.Sfs.SettleAccount.Entities.Wms; using Win.Sfs.SettleAccount.Repository; using WY.NewJit.Extends.PaiGe.WMS; +using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { @@ -54,16 +55,16 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// wms出库 /// - //[AllowAnonymous] + [AllowAnonymous] [Route("api/settleaccount/wmsSharePartoutput")] - [Authorize(SettleAccountPermissions.WMSJIT.Default)] + //[Authorize(SettleAccountPermissions.WMSJIT.Default)] public class WMSSharePartAppService : SettleAccountApplicationBase { private readonly ISettleAccountBranchEfCoreRepository _wmsRepository; private readonly ISettleAccountBranchEfCoreRepository _wmsVersionRepository; private readonly WMSEfCoreRepository _wmsefRespository; - + private readonly WmsDapperRepository _wmsDapper; private readonly WMSEfCoreRepository _wmstbRespository; private readonly ISettleAccountBranchEfCoreRepository _job; private readonly IExcelImportAppService _excelImportService; @@ -87,7 +88,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts IExcelImportAppService excelImportService, IDistributedCache cache, ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager + ICommonManager commonManager, + WmsDapperRepository wmsDapper ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { _excelImportService = excelImportService; @@ -95,6 +97,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts _wmstbRespository = wmstbRespository; _wmsRepository = wmsRepository; _wmsVersionRepository = wmsVersionRepository; + _wmsDapper = wmsDapper; _wmsefRespository = wmsefRespository; } @@ -136,15 +139,43 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// [HttpPost] [Route("WmsSharePartDetailList")] + [UnitOfWork(false)] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] 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 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 WmsSharePartOutPutDetial(//少加个发货,由于零件有重复 + 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 + ); + var totalCount = await GetCountAsync(input); - return new PagedResultDto(totalCount, entities); + return new PagedResultDto(totalCount, query.ToList()); } /// /// 任务明细标记已确认 @@ -248,8 +279,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts string.Empty, 0, string.Empty, - input.Version, string.Empty, + input.Version, p.MaterialCode, _billNum, GuidGenerator.Create(), @@ -337,7 +368,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts [DisableRequestSizeLimit] public async Task WmsSharePartUpdate(WmsSharePartOutPutDetial detial) { - var _entityList = _wmsRepository.Where(p => p.Id == detial.Id).ToList(); + var _entityList = _wmsRepository.Where(p => p.Id == detial.BranchId).ToList(); if (_entityList.Count() > 0) { foreach (var itm in _entityList) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs index a9f7692e..748fcb72 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -247,7 +247,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() }); customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() }); - var _taskid = await _service.ExportEnqueueAsync("大众备件正常结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) => + var _taskid = await _service.ExportEnqueueAsync("大众备件结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) => { }); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml index 8e7a6251..a30a9fd5 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml @@ -2202,7 +2202,7 @@ wms出库 - + 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 0a0b5588..c9d02495 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 @@ -95,7 +95,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " AmountNoTax \n" + " ) t \n" + " ) AS a\n" + - " LEFT OUTER JOIN (\n" + + " INNER JOIN (\n" + " SELECT SUM\n" + " ( ReceiptQty ) AS ReceiptQty,\n" + " PurchaseOrderNo,\n" +