From 48c63bb15d1320ffb78b7a8f45f1036af1ba8523 Mon Sep 17 00:00:00 2001 From: zhougf Date: Sat, 27 Sep 2025 23:10:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E6=89=B9=E6=AC=A1=E5=92=8CLot=E6=9F=A5=E8=AF=A2=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96=E5=85=A5=E5=BA=93=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=92=8C=E6=8A=A5=E8=A1=A8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor: 重构SimpleReceiptIn界面,增加历史记录和自动完成功能 fix: 修复报表参数处理和SQL解码问题 perf: 优化WCS接口调用和库存计算逻辑 style: 清理无用代码和调整格式 chore: 更新数据库连接配置和调试模式设置 --- HHWMS.Web/Areas/Api/IWCSController.cs | 11 +- .../Configs/Views/Container/Index.cshtml | 4 +- .../InventoryVMs/InventoryListVM.cs | 34 +- .../InventoryVMs/InventorySearcher.cs | 2 + .../Inventory/Views/Inventory/Index.cshtml | 5 +- .../Controllers/SimpleReceiptInController.cs | 21 +- .../Views/SimpleReceiptIn/Index.cshtml | 426 +++++++++++------- .../Controllers/ReportDesignController.cs | 6 +- .../ReportDesignVMs/ReportDesignVM.cs | 7 +- .../Report/Views/ReportDesign/Index.cshtml | 3 +- .../Report/Views/ReportView/Index.cshtml | 35 +- HHWMS.Web/DataContext.cs | 2 +- HHWMS.Web/appsettings.json | 4 +- 13 files changed, 361 insertions(+), 199 deletions(-) diff --git a/HHWMS.Web/Areas/Api/IWCSController.cs b/HHWMS.Web/Areas/Api/IWCSController.cs index 62ba465..becc378 100644 --- a/HHWMS.Web/Areas/Api/IWCSController.cs +++ b/HHWMS.Web/Areas/Api/IWCSController.cs @@ -387,7 +387,7 @@ namespace HHWMS.Web var material = _unitWork.FindSingle(x => x.MaterialCode == inventory.MaterialCode); - inventory.Qty = (request.Weight * 100 - ContainerWeight - inventory.TaskQty * SmallContainerWeight) / (material.Qty ?? 1); + inventory.Qty = (int)((request.Weight * 100 - ContainerWeight - inventory.TaskQty * SmallContainerWeight) / (material.Qty ?? 1)); inventory.Qty = inventory.Qty > 0 ? inventory.Qty : 0; } @@ -402,10 +402,13 @@ namespace HHWMS.Web ContainerCode = task.ContainerCode, LocationCode = task.ToLocation, MaterialCode = inventory.MaterialCode, + MaterialType = inventory.MaterialType, MaterialName = inventory.MaterialName, MaterialSpec = inventory.MaterialSpec, MaterialUnit = inventory.MaterialUnit, + Batch = inventory.Batch, Qty = inventory.Qty, + Status = inventory.Status, CreateTime = DateTime.Now }; invTrans.Add(invTransaction); @@ -422,7 +425,10 @@ namespace HHWMS.Web MaterialName = inventory.MaterialName, MaterialSpec = inventory.MaterialSpec, MaterialUnit = inventory.MaterialUnit, + MaterialType = inventory.MaterialType, + Batch = inventory.Batch, Qty = inventory.Qty, + Status = inventory.Status, CreateTime = DateTime.Now }; invTrans.Add(invTransaction); @@ -436,7 +442,10 @@ namespace HHWMS.Web MaterialName = inventory.MaterialName, MaterialSpec = inventory.MaterialSpec, MaterialUnit = inventory.MaterialUnit, + MaterialType = inventory.MaterialType, + Batch = inventory.Batch, Qty = inventory.Qty, + Status = inventory.Status, CreateTime = DateTime.Now }; invTrans.Add(invTransaction2); diff --git a/HHWMS.Web/Areas/Configs/Views/Container/Index.cshtml b/HHWMS.Web/Areas/Configs/Views/Container/Index.cshtml index a61fea1..cff1814 100644 --- a/HHWMS.Web/Areas/Configs/Views/Container/Index.cshtml +++ b/HHWMS.Web/Areas/Configs/Views/Container/Index.cshtml @@ -18,8 +18,8 @@ - diff --git a/HHWMS.Web/Areas/Report/Controllers/ReportDesignController.cs b/HHWMS.Web/Areas/Report/Controllers/ReportDesignController.cs index b07a748..4dc9a5d 100644 --- a/HHWMS.Web/Areas/Report/Controllers/ReportDesignController.cs +++ b/HHWMS.Web/Areas/Report/Controllers/ReportDesignController.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System; +using System.Web; using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Mvc; using WalkingTec.Mvvm.Core.Extensions; @@ -56,7 +57,8 @@ namespace HHWMS.Web.Controllers [ActionDescription("Sys.Create")] public ActionResult Create(ReportDesignVM vm) { - vm.Entity.Params = vm.Entity.Params.Replace(""", "\""); + vm.Entity.Params = HttpUtility.HtmlDecode(vm.Entity.Params.Replace("\\t","" ).Replace("\\n","")); + vm.Entity.Sql = HttpUtility.HtmlDecode(vm.Entity.Sql.Replace("\\t","" ).Replace("\\n","")); if (!ModelState.IsValid) { return PartialView(vm); @@ -96,6 +98,8 @@ namespace HHWMS.Web.Controllers } else { + vm.Entity.Params = HttpUtility.HtmlDecode(vm.Entity.Params.Replace("\\t","" ).Replace("\\n","")); + vm.Entity.Sql = HttpUtility.HtmlDecode(vm.Entity.Sql.Replace("\\t","" ).Replace("\\n","")); vm.DoEdit(); if (!ModelState.IsValid) { diff --git a/HHWMS.Web/Areas/Report/ViewModels/ReportDesignVMs/ReportDesignVM.cs b/HHWMS.Web/Areas/Report/ViewModels/ReportDesignVMs/ReportDesignVM.cs index bed82fb..8c630c5 100644 --- a/HHWMS.Web/Areas/Report/ViewModels/ReportDesignVMs/ReportDesignVM.cs +++ b/HHWMS.Web/Areas/Report/ViewModels/ReportDesignVMs/ReportDesignVM.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Data; using System.Linq; +using System.Web; using HHWMS.Web; using HHWMS.Web.Models; using Newtonsoft.Json.Linq; @@ -52,6 +53,7 @@ namespace HHWMS.Web // 组装查询条件 if (!string.IsNullOrEmpty(sFilter)) { + sFilter = HttpUtility.HtmlDecode(sFilter); if (string.IsNullOrEmpty(filter)) { return ResponseResult.Error("请填写查询条件!"); @@ -66,7 +68,7 @@ namespace HHWMS.Web return ResponseResult.Error("查询条件不正确!"); } } - + sql = HttpUtility.HtmlDecode(sql.Replace("\\t","" ).Replace("\\n","")); foreach (var item in json) { sql = sql.Replace(item.Key, item.Value.ToString()); @@ -84,7 +86,8 @@ namespace HHWMS.Web } result.Add(colList); // 添加列表 - result.Add(data.Rows[0].Table); + if(data.Rows.Count > 0) + result.Add(data.Rows[0].Table); return ResponseResult.Success(result); } diff --git a/HHWMS.Web/Areas/Report/Views/ReportDesign/Index.cshtml b/HHWMS.Web/Areas/Report/Views/ReportDesign/Index.cshtml index 90af17f..decd73a 100644 --- a/HHWMS.Web/Areas/Report/Views/ReportDesign/Index.cshtml +++ b/HHWMS.Web/Areas/Report/Views/ReportDesign/Index.cshtml @@ -8,5 +8,4 @@ - + diff --git a/HHWMS.Web/Areas/Report/Views/ReportView/Index.cshtml b/HHWMS.Web/Areas/Report/Views/ReportView/Index.cshtml index ea72d2a..200b08e 100644 --- a/HHWMS.Web/Areas/Report/Views/ReportView/Index.cshtml +++ b/HHWMS.Web/Areas/Report/Views/ReportView/Index.cshtml @@ -11,7 +11,7 @@
-