diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFKanbanAppService.cs index 01719f78..dbb4006c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFKanbanAppService.cs @@ -204,12 +204,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts // _lst.Add(_entity); // } - + // } - + // var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version && p.Kanban==string.Empty).ToListAsync(); - + // await _wmsRepository.GetDbContext().BulkInsertAsync(_lst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); // int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum); // if (_count == 0) @@ -225,7 +225,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts // await _job.UpdateAsync(job); // } // } - + // return ApplicationConsts.SuccessStr; ; //} @@ -254,18 +254,18 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts var _list = _excelHelper.ExcelToList(); foreach (var itm in _list) { - itm.SetData(GuidGenerator.Create(),string.Empty,!string.IsNullOrEmpty(itm.WmsBillNum)? itm.WmsBillNum:string.Empty,input.Version,GuidGenerator.Create()); + itm.SetData(GuidGenerator.Create(), string.Empty, !string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : string.Empty, input.Version, GuidGenerator.Create()); } _lst.AddRange(_list.ToArray()); } - + var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version).ToListAsync(); var error = from itm1 in outPutDetail join itm2 in _lst on - new { itm1.MaterialCode, itm1.Kanban,itm1.PoLine } + new { itm1.MaterialCode, itm1.Kanban, itm1.PoLine } equals - new { itm2.MaterialCode, itm2.Kanban,itm2.PoLine } + new { itm2.MaterialCode, itm2.Kanban, itm2.PoLine } select itm1; var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) }); if (errList.Count() == 0) @@ -319,7 +319,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { _billNum = string.Empty; } - return ApplicationConsts.SuccessStr; ; + return ApplicationConsts.SuccessStr; ; } /// /// 出库界面功能,核准出库功能 @@ -380,7 +380,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( sql ); - } return true; diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFSharePartAppService .cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFSharePartAppService .cs index c79c9bda..523d76f6 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFSharePartAppService .cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFSharePartAppService .cs @@ -170,7 +170,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts itm.TaskId, itm.Remark, itm.Qty, - tm1 == null ? 0 : tm1.Qty + tm1 == null ? 0 : tm1.Qty, + itm.OutPutQty ); return new PagedResultDto(totalCount, entities); } @@ -236,7 +237,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts GuidGenerator.Create(), string.Empty, p.Qty, - p.StockQty + p.StockQty, + p.Qty )); _lst.AddRange(_lsAry.ToArray()); } @@ -296,7 +298,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts "SELECT 'Return Value' = @return_value"; await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( - string.Format(sql, input.BillNum,input.AccountDate)); + string.Format(sql, input.BillNum,input.AccountDate.ToShortDateString())); } } @@ -329,7 +331,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts " @accountdate = N'{2}'\n" + "SELECT 'Return Value' = @return_value"; - sql = string.Format(sql, str, input.BillNum, input.AccountDate); + sql = string.Format(sql, str, input.BillNum, input.AccountDate.ToShortDateString()); await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( sql @@ -337,6 +339,32 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts } return true; } + + /// + /// 任务明细标记已确认 + /// + /// 上传的文件(前端已经限制只能上传一个附件) + /// + [HttpPost] + [Route("WmsSharePartOutPutModify")] + [DisableRequestSizeLimit] + + public async Task WmsSharePartUpdate(WmsHQHSharePartOutPutDetial 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; + + } + + [HttpPost] [Route("ExcelImport")] [DisableRequestSizeLimit] @@ -370,6 +398,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts , string.Empty , itm.Qty ,0 + ,itm.Qty ); _lsCopy.Add(_detail); } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs index 8bad8cf5..623ddb50 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs @@ -339,7 +339,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts " @date = N'{1}'\n" + "SELECT 'Return Value' = @return_value"; await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( - string.Format(sql, input.BillNum, input.AccountDate) + string.Format(sql, input.BillNum, input.AccountDate.ToShortDateString()) ); @@ -375,7 +375,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts " @accountdate = N'{2}'\n" + "SELECT 'Return Value' = @return_value"; - sql = string.Format(sql, str, input.BillNum, input.AccountDate); + sql = string.Format(sql, str, input.BillNum, input.AccountDate.ToShortDateString()); await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( sql diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHSharePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHSharePartAppService.cs index 1275f699..cd7a76d9 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHSharePartAppService.cs @@ -170,7 +170,8 @@ into temp1 itm.TaskId, itm.Remark, itm.Qty, - tm1==null?0:tm1.Qty + tm1==null?0:tm1.Qty, + itm.OutPutQty ); @@ -198,6 +199,35 @@ into temp1 return true; } + + /// + /// 任务明细标记已确认 + /// + /// 上传的文件(前端已经限制只能上传一个附件) + /// + [HttpPost] + [Route("WmsSharePartOutPutModify")] + [DisableRequestSizeLimit] + + public async Task WmsSharePartUpdate(WmsHQHSharePartOutPutDetial 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; + + } + + + + + /// /// 选择任务,生成出库单,只包含已确认的单据 /// @@ -240,7 +270,8 @@ into temp1 GuidGenerator.Create(), string.Empty, p.Qty, - p.StockQty + p.StockQty, + p.Qty )); _lst.AddRange(_lsAry.ToArray()); } @@ -319,8 +350,7 @@ into temp1 " @date = N'{1}',\n"+ "SELECT 'Return Value' = @return_value"; await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( - string.Format(sql, input.BillNum,input.AccountDate)); - + string.Format(sql, input.BillNum,input.AccountDate.ToShortDateString())); } } return true; @@ -352,7 +382,7 @@ into temp1 " @accountdate = N'{2}'\n" + "SELECT 'Return Value' = @return_value"; - sql = string.Format(sql, str, input.BillNum, input.AccountDate); + sql = string.Format(sql, str, input.BillNum, input.AccountDate.ToShortDateString()); await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( sql @@ -393,6 +423,7 @@ into temp1 , string.Empty , itm.Qty ,0 + ,itm.Qty ); _lsCopy.Add(_detail); } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs index 2f1c518a..8f46a36f 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs @@ -417,7 +417,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts " @date = N'{1}'\n"+ "SELECT 'Return Value' = @return_value"; await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( - string.Format(sql,input.BillNum,input.AccountDate) + string.Format(sql,input.BillNum,input.AccountDate.ToShortDateString()) ); @@ -455,7 +455,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts " @accountdate = N'{2}'\n" + "SELECT 'Return Value' = @return_value"; - sql= string.Format(sql, str, input.BillNum, input.AccountDate); + sql= string.Format(sql, str, input.BillNum, input.AccountDate.ToShortDateString()); await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( sql diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs index 5321400a..8ec6484d 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs @@ -395,7 +395,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts " @date = N'{1}'\n" + "SELECT 'Return Value' = @return_value"; await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( - string.Format(sql, input.BillNum)); + string.Format(sql, input.BillNum,input.AccountDate.ToShortDateString())); } } @@ -429,7 +429,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts " @accountdate = N'{2}'\n" + "SELECT 'Return Value' = @return_value"; - sql = string.Format(sql, str, input.BillNum, input.AccountDate); + sql = string.Format(sql, str, input.BillNum, input.AccountDate.ToShortDateString()); await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( sql 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 42322920..8b6c68a8 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs @@ -319,7 +319,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts " @date = N'{1}'\n" + "SELECT 'Return Value' = @return_value"; await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( - string.Format(sql, input.BillNum)); + string.Format(sql, input.BillNum,input.AccountDate.ToShortDateString())); } } @@ -353,7 +353,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts " @accountdate = N'{2}'\n" + "SELECT 'Return Value' = @return_value"; - sql = string.Format(sql, str, input.BillNum, input.AccountDate); + sql = string.Format(sql, str, input.BillNum, input.AccountDate.ToShortDateString()); await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( sql diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMKanbanAppService.cs index cb908030..dc22e08c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMKanbanAppService.cs @@ -257,7 +257,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS " @date = N'{1}'\n" + "SELECT 'Return Value' = @return_value"; await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( - string.Format(sql, input.BillNum, input.AccountDate) + string.Format(sql, input.BillNum, input.AccountDate.ToShortDateString()) ); @@ -293,7 +293,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS " @accountdate = N'{2}'\n" + "SELECT 'Return Value' = @return_value"; - sql = string.Format(sql, str, input.BillNum, input.AccountDate); + sql = string.Format(sql, str, input.BillNum, input.AccountDate.ToShortDateString()); await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( sql diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMSharePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMSharePartAppService.cs index 6abc5f0b..b8301eca 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMSharePartAppService.cs @@ -150,6 +150,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS itm.Remark, itm.Qty, tm1 == null ? 0 : tm1.Qty + ,itm.OutPutQty ); @@ -219,7 +220,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS GuidGenerator.Create(), string.Empty, p.Qty, - p.StockQty + p.StockQty, + p.Qty + )); _lst.AddRange(_lsAry.ToArray()); } @@ -298,12 +301,38 @@ namespace Win.Sfs.SettleAccount.Entities.WMS " @date = N'{1}',\n" + "SELECT 'Return Value' = @return_value"; await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( - string.Format(sql, input.BillNum,input.AccountDate)); + string.Format(sql, input.BillNum,input.AccountDate.ToShortDateString())); } } return true; } + + /// + /// 任务明细标记已确认 + /// + /// 上传的文件(前端已经限制只能上传一个附件) + /// + [HttpPost] + [Route("WmsSharePartOutPutModify")] + [DisableRequestSizeLimit] + + public async Task WmsSharePartUpdate(WmsHQHSharePartOutPutDetial 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; + + } + + /// ///出库界面功能, 撤销核准出库 /// @@ -331,7 +360,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS " @accountdate = N'{2}'\n" + "SELECT 'Return Value' = @return_value"; - sql = string.Format(sql, str, input.BillNum, input.AccountDate); + sql = string.Format(sql, str, input.BillNum, input.AccountDate.ToShortDateString()); await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( sql @@ -372,6 +401,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS , string.Empty , itm.Qty , 0 + ,itm.Qty ); _lsCopy.Add(_detail); } 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 377cba79..a895191a 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -33,7 +33,7 @@ using Win.Sfs.SettleAccount.Reports.ReportRequestDto; namespace Win.Sfs.SettleAccount.Reports.ReportServices { [Authorize(SettleAccountPermissions.Reports.Default)] - //[AllowAnonymous] + [Route("api/settleaccount/ReportMakeService")] public class ReportService : ApplicationService { diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml index 10c756f9..3e4dd54c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml @@ -1805,6 +1805,13 @@ + + + 任务明细标记已确认 + + 上传的文件(前端已经限制只能上传一个附件) + + 红旗H平台准时化-出库 @@ -1901,6 +1908,13 @@ 上传的文件(前端已经限制只能上传一个附件) + + + 任务明细标记已确认 + + 上传的文件(前端已经限制只能上传一个附件) + + 选择任务,生成出库单,只包含已确认的单据 @@ -2851,6 +2865,13 @@ + + + 任务明细标记已确认 + + 上传的文件(前端已经限制只能上传一个附件) + + 出库界面功能, 撤销核准出库 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 957b78e9..b5ea8dac 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs @@ -470,7 +470,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS public WmsHQMSharePartOutPutDetial() { } - public WmsHQMSharePartOutPutDetial(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) + public WmsHQMSharePartOutPutDetial(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; @@ -490,6 +490,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS Remark = remark; Qty = qty; StockQty = stockQty; + OutPutQty = outputQty; } public void SetId(Guid id) { @@ -545,6 +546,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS public string BillNum { set; get; } [ImporterHeader(Name = "任务ID", IsIgnore = true)] public Guid TaskId { set; get; } + [ImporterHeader(Name = "出库数量", IsIgnore = true)] + public decimal OutPutQty { set; get; } } #endregion @@ -824,7 +827,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS public WmsHQFSharePartOutPutDetial() { } - public WmsHQFSharePartOutPutDetial(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) + public WmsHQFSharePartOutPutDetial(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; @@ -844,6 +847,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS Remark = remark; Qty = qty; StockQty = stockQty; + OutPutQty = outPutQty; + } public void SetId(Guid id) { @@ -899,6 +904,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS public string BillNum { set; get; } [ImporterHeader(Name = "任务ID", IsIgnore = true)] public Guid TaskId { set; get; } + + [ImporterHeader(Name = "出库数量", IsIgnore = true)] + public decimal OutPutQty { set; get; } } @@ -1054,7 +1062,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS public WmsHQHSharePartOutPutDetial() { } - public WmsHQHSharePartOutPutDetial(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) + public WmsHQHSharePartOutPutDetial(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; @@ -1074,6 +1082,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS Remark = remark; Qty = qty; StockQty = stockQty; + OutPutQty = outputQty; } public void SetId(Guid id) { @@ -1129,6 +1138,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS public string BillNum { set; get; } [ImporterHeader(Name = "任务ID", IsIgnore = true)] public Guid TaskId { set; get; } + [ImporterHeader(Name = "出库数量", IsIgnore = true)] + public decimal OutPutQty { set; get; } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs index 109c8236..058f503b 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs @@ -70,13 +70,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public override decimal Price { set; get; } [ExporterHeader(DisplayName = "金额") ] public override decimal Amt { set; get; } - - //发运数量 [ExporterHeader(DisplayName = "M100数量")] public decimal Qty { set; get; } - - //结算数量 [ExporterHeader(DisplayName = "结算数量")] public decimal SettledQty { set; get; } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs index 5af42774..5f7f141f 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs @@ -106,24 +106,24 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount try { DbContext.Database.SetCommandTimeout(1200); - List _insertls = new List(); - if (list.Count > 0) - { - var _version = list.FirstOrDefault().Version; - var _ls= GetQueryable().Where(p => p.Version == _version).Select(p=>new { MaterialCode=p.MaterialCode, ChassisNumber=p.ChassisNumber }).ToList(); - var _query = from r1 in list join r2 in _ls on new { r1.ChassisNumber, r1.MaterialCode } equals new { r2.ChassisNumber, r2.MaterialCode } - into temp from t in temp.DefaultIfEmpty() - where t==null - select r1 ; - foreach (var s in _query.ToList()) - { - _insertls.Add(s); - } - } + //List _insertls = new List(); + //if (list.Count > 0) + //{ + // var _version = list.FirstOrDefault().Version; + // var _ls= GetQueryable().Where(p => p.Version == _version).Select(p=>new { MaterialCode=p.MaterialCode, ChassisNumber=p.ChassisNumber }).ToList(); + // var _query = from r1 in list join r2 in _ls on new { r1.ChassisNumber, r1.MaterialCode } equals new { r2.ChassisNumber, r2.MaterialCode } + // into temp from t in temp.DefaultIfEmpty() + // where t==null + // select r1 ; + // foreach (var s in _query.ToList()) + // { + // _insertls.Add(s); + // } + //} - BulkConfig cfg = new BulkConfig() { BulkCopyTimeout=0, BatchSize=2000}; - DbContext.BulkInsert(_insertls,cfg); + BulkConfig cfg = new BulkConfig() { BulkCopyTimeout=0, BatchSize=100000, }; + DbContext.BulkInsert(list,cfg); } catch (Exception e) { diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs index e8faaf57..dc7876b4 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs @@ -59,73 +59,73 @@ namespace TaskJob.Services { var filePath = fileSavePath + itm;//获取到导入的excel var exten = Path.GetExtension(fileSavePath); - List _errorList = new List(); - var checkList = new List(); - //var _chList = await _relrepository.GetAllAsync(GuidGenerator.Create(), true); - //var _chls = _chList.Select(p => p.SettleMaterialCode).Distinct(); - List _precodeList = new List();// - if (exten.ToUpper() == ".TXT") - { - using (TextReader textReader = new StreamReader(filePath)) - { - int i = 0; - while (true) - { - string str = textReader.ReadLine(); - if (string.IsNullOrEmpty(str)) - { - break; - } - else - { - try - { - var _lst = str.Split(new char[] { '|' }).ToList(); - string _settleyear = _lst[1].Trim(); - string _kENNCode = _lst[2].Trim(); - string _chassisNumber = _lst[3].Trim(); - string _model = _lst[4].Trim(); - DateTime _cP5A = DateTime.Parse(_lst[5].Trim()); - DateTime _cP7 = DateTime.Parse(_lst[6].Trim()); - string _materialCode = _lst[7].Trim(); - decimal _qty = decimal.Parse(_lst[8].Trim()); - string _settlementID = _lst[9].Trim(); - string _settlementSupplier = _lst[10].Trim(); - _setls.Add(new Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount( - Guid.NewGuid(), - Guid.NewGuid(), - _settleyear, - _kENNCode, - _chassisNumber, - _model, - _cP5A, - _cP7, - _materialCode, - _qty, - _settlementID, - _settlementSupplier, - DateTime.Now.Year.ToString(), - DateTime.Now.Month.ToString(), - _id, - version, - DateTime.Now, - Guid.NewGuid() - )); - } - catch - { + //List _errorList = new List(); + //var checkList = new List(); + ////var _chList = await _relrepository.GetAllAsync(GuidGenerator.Create(), true); + ////var _chls = _chList.Select(p => p.SettleMaterialCode).Distinct(); + //List _precodeList = new List();// + //if (exten.ToUpper() == ".TXT") + //{ + // using (TextReader textReader = new StreamReader(filePath)) + // { + // int i = 0; + // while (true) + // { + // string str = textReader.ReadLine(); + // if (string.IsNullOrEmpty(str)) + // { + // break; + // } + // else + // { + // try + // { + // var _lst = str.Split(new char[] { '|' }).ToList(); + // string _settleyear = _lst[1].Trim(); + // string _kENNCode = _lst[2].Trim(); + // string _chassisNumber = _lst[3].Trim(); + // string _model = _lst[4].Trim(); + // DateTime _cP5A = DateTime.Parse(_lst[5].Trim()); + // DateTime _cP7 = DateTime.Parse(_lst[6].Trim()); + // string _materialCode = _lst[7].Trim(); + // decimal _qty = decimal.Parse(_lst[8].Trim()); + // string _settlementID = _lst[9].Trim(); + // string _settlementSupplier = _lst[10].Trim(); + // _setls.Add(new Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount( + // Guid.NewGuid(), + // Guid.NewGuid(), + // _settleyear, + // _kENNCode, + // _chassisNumber, + // _model, + // _cP5A, + // _cP7, + // _materialCode, + // _qty, + // _settlementID, + // _settlementSupplier, + // DateTime.Now.Year.ToString(), + // DateTime.Now.Month.ToString(), + // _id, + // version, + // DateTime.Now, + // Guid.NewGuid() + // )); + // } + // catch + // { - } - } - i++; - } - textReader.Close(); - } - } - else - { - // _setls= _inputService.Input(filePath); - var errorlist = new List(); + // } + // } + // i++; + // } + // textReader.Close(); + // } + //} + //else + //{ + // _setls= _inputService.Input(filePath); + var errorlist = new List(); var dtoList = _inputService.Input(filePath, null, errorlist); foreach (var dto in dtoList) { @@ -139,7 +139,7 @@ namespace TaskJob.Services DateTime.Now.Month.ToString(), dto.SettleYear, _id, version, DateTime.Now, Guid.NewGuid()); _setls.Add(_settleaccount); } - } + //} #region //var errorFileName = "错误文件.xlsx"; //checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}底盘号 {1}有重复", "11111111111", "22222222222"), string.Empty));