From 5a04ca9d590482565430ed6702ff407e6fd6d66d Mon Sep 17 00:00:00 2001 From: zhougf Date: Sun, 31 Aug 2025 15:57:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=A5=E5=BA=8F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=20=E4=BF=AE=E6=94=B9=E5=85=A5=E5=BA=93=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E4=BB=BB=E5=8A=A1=E5=AE=8C=E6=88=90=EF=BC=8C?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E9=A1=B5=E9=9D=A2=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HHWMS.Web/Areas/Api/IWCSController.cs | 143 ++++++++++- .../Controllers/ContainerController.cs | 16 +- .../Configs/Controllers/MaterialController.cs | 11 + .../Controllers/MaterialProcessController.cs | 16 ++ .../Controllers/ProcessConfigController.cs | 238 ++++++++++++++++++ .../ContainerVMs/ContainerListVM.cs | 8 + .../ContainerVMs/ContainerSearcher.cs | 7 + .../ViewModels/LocationVMs/LocationListVM.cs | 1 + .../ViewModels/LocationVMs/LocationVM.cs | 6 +- .../ProcessConfigVMs/ProcessConfigBatchVM.cs | 35 +++ .../ProcessConfigVMs/ProcessConfigImportVM.cs | 41 +++ .../ProcessConfigVMs/ProcessConfigListVM.cs | 97 +++++++ .../ProcessConfigVMs/ProcessConfigSearcher.cs | 35 +++ .../ProcessConfigVMs/ProcessConfigVM.cs | 50 ++++ .../Configs/Views/Container/Index.cshtml | 2 +- .../Areas/Configs/Views/Material/Edit.cshtml | 4 +- .../Configs/Views/MaterialProcess/Edit.cshtml | 2 +- .../Views/ProcessConfig/BatchDelete.cshtml | 12 + .../Views/ProcessConfig/BatchEdit.cshtml | 14 ++ .../Configs/Views/ProcessConfig/Create.cshtml | 18 ++ .../Configs/Views/ProcessConfig/Delete.cshtml | 20 ++ .../Views/ProcessConfig/Details.cshtml | 17 ++ .../Configs/Views/ProcessConfig/Edit.cshtml | 19 ++ .../Configs/Views/ProcessConfig/Import.cshtml | 14 ++ .../Configs/Views/ProcessConfig/Index.cshtml | 12 + .../Controllers/InventoryController.cs | 62 +++-- .../InventoryVMs/InventoryListVM.cs | 23 +- .../Inventory/Views/Inventory/InvOut.cshtml | 2 +- .../Controllers/ReceiptInController.cs | 115 +++++++-- .../Controllers/SimpleReceiptInController.cs | 8 +- .../Receipt/Views/ReceiptIn/Index.cshtml | 88 ++++++- .../WCS/Controllers/WCSTaskController.cs | 2 +- HHWMS.Web/DataContext.cs | 1 + HHWMS.Web/Models/Configs/Container.cs | 4 + HHWMS.Web/Models/Configs/Customer.cs | 2 + HHWMS.Web/Models/Configs/Material.cs | 5 +- HHWMS.Web/Models/Configs/MaterialProcess.cs | 15 +- HHWMS.Web/Models/Configs/ProcessConfig.cs | 49 ++++ HHWMS.Web/Program.cs | 2 + HHWMS.Web/Resources/Program.zh.resx | 17 +- HHWMS.Web/appsettings.json | 2 +- 41 files changed, 1151 insertions(+), 84 deletions(-) create mode 100644 HHWMS.Web/Areas/Configs/Controllers/ProcessConfigController.cs create mode 100644 HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigBatchVM.cs create mode 100644 HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigImportVM.cs create mode 100644 HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigListVM.cs create mode 100644 HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigSearcher.cs create mode 100644 HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigVM.cs create mode 100644 HHWMS.Web/Areas/Configs/Views/ProcessConfig/BatchDelete.cshtml create mode 100644 HHWMS.Web/Areas/Configs/Views/ProcessConfig/BatchEdit.cshtml create mode 100644 HHWMS.Web/Areas/Configs/Views/ProcessConfig/Create.cshtml create mode 100644 HHWMS.Web/Areas/Configs/Views/ProcessConfig/Delete.cshtml create mode 100644 HHWMS.Web/Areas/Configs/Views/ProcessConfig/Details.cshtml create mode 100644 HHWMS.Web/Areas/Configs/Views/ProcessConfig/Edit.cshtml create mode 100644 HHWMS.Web/Areas/Configs/Views/ProcessConfig/Import.cshtml create mode 100644 HHWMS.Web/Areas/Configs/Views/ProcessConfig/Index.cshtml create mode 100644 HHWMS.Web/Models/Configs/ProcessConfig.cs diff --git a/HHWMS.Web/Areas/Api/IWCSController.cs b/HHWMS.Web/Areas/Api/IWCSController.cs index fc7aa49..62ba465 100644 --- a/HHWMS.Web/Areas/Api/IWCSController.cs +++ b/HHWMS.Web/Areas/Api/IWCSController.cs @@ -32,8 +32,6 @@ namespace HHWMS.Web private readonly IMapper _mapper; private readonly IMemoryCache _cache; private const int DEBOUNCE_INTERVAL_MS = 1000; // 防抖间隔1秒 - private int ContainerWeight = 500; - private int SmallContainerWeight = 50; public IWCSController(IUnitWork unitWork, IMapper mapper, IMemoryCache cache) { @@ -95,16 +93,14 @@ namespace HHWMS.Web public IActionResult FullIn(WcsRequest request) { var task = _unitWork.FindSingle(x => x.TaskNo == request.TaskNo - && x.Status != TaskStatusEnum.完成); + && x.Status != TaskStatusEnum.完成 + && x.TaskType != TaskTypeEnum.出库); if (task == null) { return ApiResultError(msg: "未找到任务!"); } - //查找新仓位 - var locationVm = Wtm.CreateVM(); - // 更新旧仓位 var oldLoc = _unitWork.FindSingle(x => x.Code == task.ToLocation); oldLoc.ContainerCode = "FullIn"; @@ -112,7 +108,31 @@ namespace HHWMS.Web oldLoc.UpdateTime = DateTime.Now; _unitWork.Update(oldLoc); - return ApiResult(); + //查找新仓位 + var locationVm = Wtm.CreateVM(); + var res = locationVm.GetMoveLocation(oldLoc); + if (res.Status) + { + string code = res.Data.LocationCode; + var newLoc = _unitWork.FindSingle(x => x.Code == code); + newLoc.ContainerCode = task.ContainerCode; + newLoc.Status = oldLoc.Status; + newLoc.ContainerStatus = oldLoc.ContainerStatus; + newLoc.Status = LocationStatusEnum.锁定; + newLoc.UpdateTime = DateTime.Now; + _unitWork.Update(newLoc); + + task.ToLocation = newLoc.Code; + task.UpdateBy = "FullIn"; + task.UpdateTime = DateTime.Now; + _unitWork.Update(task); + + return ApiResult(new { LocationCode = res.Data.LocationCode }); + } + else + { + return ApiResultError(msg:res.Message); + } } @@ -129,10 +149,101 @@ namespace HHWMS.Web { return ApiResultError(msg: "未找到任务!"); } + //1. 更新容器 + var container = _unitWork.FindSingle(x => x.Code == task.ContainerCode); + container.UpdateBy = "EmptyOut"; + container.UpdateTime = DateTime.Now; + _unitWork.Update(container); + + //2. 更新库位 + var location = _unitWork.FindSingle(x => x.Code == task.FromLocation); + location.UpdateBy = "EmptyOut"; + location.UpdateTime = DateTime.Now; + location.ContainerStatus = LocationStatus.空仓位; + _unitWork.Update(location); + + //3. 更新任务 + task.UpdateBy = "EmptyOut"; + task.UpdateTime = DateTime.Now; + task.ErrorMsg = "空出"; + + + var taskHistory = _mapper.Map(task); + _unitWork.Add(taskHistory); + _unitWork.Delete(task); + //4. 更新库存 + _unitWork.BatchUpdate(x => x.ContainerCode == task.ContainerCode,x => new Inventory() + { + LocationCode = "空出", + UpdateBy = "EmptyOut", + UpdateTime = DateTime.Now + }); return ApiResult(); } + + /// + /// 取货错处理 + /// + [HttpPost] + public IActionResult PickError(WcsRequest request) + { + var task = _unitWork.FindSingle(x => x.TaskNo == request.TaskNo + && x.Status != TaskStatusEnum.完成); + + if (task == null) + { + return ApiResultError(msg: "未找到任务!"); + } + var outLoc = _unitWork.FindSingle(x => x.Code == task.FromLocation); + var outTask = _unitWork.FindSingle(x => x.FromLocation == outLoc.ContiguousCode); + if (outTask != null) + { + return ApiResultError(msg: $"外侧仓位 {outLoc.Code} 已有出库任务!"); + } + + // 生成外侧仓位的移库任务 + var locationVm = Wtm.CreateVM(); + var moveLocRes = locationVm.GetMoveLocation(outLoc); + if (moveLocRes.Status) + { + var taskHeader = new TaskHeader() + { + ZoneId = task.ZoneId, + TaskNo = _unitWork.GetSerialNumber("Move"), + TaskType = TaskTypeEnum.移库, + ContainerCode = outLoc.ContainerCode, + RoadWay = 2, + FromLocation = outLoc.Code, + ToLocation = moveLocRes.Data.LocationCode, + Status = TaskStatusEnum.新建, + CreateBy = "PickError", + CreateTime = DateTime.Now, + }; + + var sendTaskRes = locationVm.SendWcsTask(taskHeader); + if (sendTaskRes.Status) + { + string code = sendTaskRes.Data.LocationCode; + var moveLoc = _unitWork.FindSingle(x => x.Code == code); + moveLoc.Status = LocationStatusEnum.锁定; + moveLoc.UpdateBy = "PickError"; + moveLoc.UpdateTime = DateTime.Now; + _unitWork.Update(moveLoc); + } + else + { + return ApiResultError(msg: sendTaskRes.Message); + } + } + else + { + return ApiResultError(msg: moveLocRes.Message); + } + + return ApiResult(); + } /// /// 状态返回(带防抖) /// @@ -269,9 +380,15 @@ namespace HHWMS.Web { if (task.TaskType == TaskTypeEnum.入库) { + var containerconfig = _unitWork.Find(x => x.DictType == "ContainerConfig") + .ToList(); + int ContainerWeight = int.Parse(containerconfig.FirstOrDefault(x => x.DictLabelUs.ToLower() == "container")?.DictValue); + int SmallContainerWeight = int.Parse(containerconfig.FirstOrDefault(x => x.ID == inventory.Flag)?.DictValue); + var material = _unitWork.FindSingle(x => x.MaterialCode == inventory.MaterialCode); - inventory.Qty = (request.Weight - ContainerWeight - inventory.TaskQty * SmallContainerWeight) / (material.Qty ?? 5); + inventory.Qty = (request.Weight * 100 - ContainerWeight - inventory.TaskQty * SmallContainerWeight) / (material.Qty ?? 1); + inventory.Qty = inventory.Qty > 0 ? inventory.Qty : 0; } if (task.TaskType != TaskTypeEnum.移库) @@ -333,8 +450,16 @@ namespace HHWMS.Web { _unitWork.BatchAdd(invTrans); } - _unitWork.BatchUpdate(inventories); + if (task.TaskType == TaskTypeEnum.出库 && task.ZoneId == 1027) + { + // 线边库出库删掉库存 + _unitWork.BatchDelete(inventories); + } + else + { + _unitWork.BatchUpdate(inventories); + } // 更新容器状态 var container = _unitWork.FindSingle(x => x.Code == task.ContainerCode); diff --git a/HHWMS.Web/Areas/Configs/Controllers/ContainerController.cs b/HHWMS.Web/Areas/Configs/Controllers/ContainerController.cs index 5a702bc..3acac15 100644 --- a/HHWMS.Web/Areas/Configs/Controllers/ContainerController.cs +++ b/HHWMS.Web/Areas/Configs/Controllers/ContainerController.cs @@ -249,6 +249,13 @@ namespace HHWMS.Web.Controllers return PartialView(vm); } + [HttpPost] + [ActionDescription("Sys.Print")] + public ActionResult Print(ContainerVM vm) + { + return Ok(); + } + [HttpPost] [ActionDescription("Container.AddContainer")] public ActionResult AddContainer(ContainerVM vm) @@ -265,8 +272,10 @@ namespace HHWMS.Web.Controllers vm.MSD.AddModelError(vm.Entity.BatchError, "数量和类型必填,且数量要大于0!"); return PartialView(vm); } - var maxContainer = _unitwork.Find(x => x.Type == vm.Entity.Type).ToList().MaxBy(x => x.Code); - int maxNum = 1; + + var zoneid = _unitwork.FindSingle(x => x.ZoneCode == vm.Entity.Type).ID; + var maxContainer = _unitwork.Find(x => x.Type == vm.Entity.Type).ToList().MaxBy(x => x.ID); + int maxNum = 0; if (maxContainer != null) int.TryParse(maxContainer?.Code.Substring(1, 4), out maxNum); // 查询已有的最大托盘值 在此基础上累加 @@ -281,7 +290,8 @@ namespace HHWMS.Web.Controllers Status = ContainerStatus.空, Length = vm.Entity.Length, Width = vm.Entity.Width, - Height = vm.Entity.Height + Height = vm.Entity.Height, + ZoneId = zoneid }); } _unitwork.BatchAdd(containerList.ToArray()); diff --git a/HHWMS.Web/Areas/Configs/Controllers/MaterialController.cs b/HHWMS.Web/Areas/Configs/Controllers/MaterialController.cs index a758414..12fd00d 100644 --- a/HHWMS.Web/Areas/Configs/Controllers/MaterialController.cs +++ b/HHWMS.Web/Areas/Configs/Controllers/MaterialController.cs @@ -1,10 +1,12 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System; +using System.Linq; using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Mvc; using WalkingTec.Mvvm.Core.Extensions; using HHWMS.Web; +using HHWMS.Web.Models; namespace HHWMS.Web.Controllers { @@ -63,6 +65,15 @@ namespace HHWMS.Web.Controllers } else { + if (DC.Set().Any(x => x.MaterialCode == vm.Entity.MaterialCode)) + { + return FFResult().Alert($"已存在 物料编码 为{vm.Entity.MaterialCode}的数据"); + } + if (DC.Set().Any(x => x.MaterialType == vm.Entity.MaterialType)) + { + return FFResult().Alert($"已存在 图号 为{vm.Entity.MaterialType}的数据"); + } + vm.DoAdd(); if (!ModelState.IsValid) { diff --git a/HHWMS.Web/Areas/Configs/Controllers/MaterialProcessController.cs b/HHWMS.Web/Areas/Configs/Controllers/MaterialProcessController.cs index 4116353..75c7881 100644 --- a/HHWMS.Web/Areas/Configs/Controllers/MaterialProcessController.cs +++ b/HHWMS.Web/Areas/Configs/Controllers/MaterialProcessController.cs @@ -1,10 +1,12 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System; +using System.Linq; using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Mvc; using WalkingTec.Mvvm.Core.Extensions; using HHWMS.Web; +using HHWMS.Web.Models; namespace HHWMS.Web.Controllers { @@ -63,6 +65,20 @@ namespace HHWMS.Web.Controllers } else { + if (!DC.Set().Any(x => x.MaterialCode == vm.Entity.MaterialCode)) + { + return FFResult().Alert($"物料编码 为{vm.Entity.MaterialCode}的物料基础数据不存在!请先添加物料基础数据!"); + } + if (DC.Set().Any(x => x.MaterialCode == vm.Entity.MaterialCode + && x.ProcessOrder == vm.Entity.ProcessOrder)) + { + return FFResult().Alert($"已存在 工序顺序 为{vm.Entity.ProcessOrder}的数据!"); + } + if (DC.Set().Any(x => x.MaterialCode == vm.Entity.MaterialCode + && x.ProcessCode == vm.Entity.ProcessCode)) + { + return FFResult().Alert($"已存在 工序编码 为{vm.Entity.ProcessCode}的数据!"); + } vm.DoAdd(); if (!ModelState.IsValid) { diff --git a/HHWMS.Web/Areas/Configs/Controllers/ProcessConfigController.cs b/HHWMS.Web/Areas/Configs/Controllers/ProcessConfigController.cs new file mode 100644 index 0000000..b402a99 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Controllers/ProcessConfigController.cs @@ -0,0 +1,238 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Linq; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Mvc; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web; +using HHWMS.Web.Models; + +namespace HHWMS.Web.Controllers +{ + [Area("configs")] + [ActionDescription("工序配置")] + public partial class ProcessConfigController : BaseController + { + private readonly IUnitWork _unitWork; + + public ProcessConfigController(IUnitWork unitWork) + { + _unitWork = unitWork; + } + + #region Search + [ActionDescription("Sys.Search")] + public ActionResult Index() + { + var vm = Wtm.CreateVM(); + return PartialView(vm); + } + + [ActionDescription("Sys.Search")] + [HttpPost] + public string Search(ProcessConfigSearcher searcher) + { + var vm = Wtm.CreateVM(passInit: true); + if (ModelState.IsValid) + { + vm.Searcher = searcher; + return vm.GetJson(false); + } + else + { + return vm.GetError(); + } + } + + #endregion + + #region Create + [ActionDescription("Sys.Create")] + public ActionResult Create() + { + var vm = Wtm.CreateVM(); + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.Create")] + public ActionResult Create(ProcessConfigVM vm) + { + if (!ModelState.IsValid) + { + return PartialView(vm); + } + else + { + if (DC.Set().Any(x => x.Code == vm.Entity.Code)) + { + return FFResult().Alert($"已存在 工序编码 为{vm.Entity.Code}的数据"); + } + if (DC.Set().Any(x => x.Name == vm.Entity.Name)) + { + return FFResult().Alert($"已存在 工序名称 为{vm.Entity.Name}的数据"); + } + vm.DoAdd(); + if (!ModelState.IsValid) + { + vm.DoReInit(); + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid(); + } + } + } + #endregion + + #region Edit + [ActionDescription("Sys.Edit")] + public ActionResult Edit(string id) + { + var vm = Wtm.CreateVM(id); + return PartialView(vm); + } + + [ActionDescription("Sys.Edit")] + [HttpPost] + [ValidateFormItemOnly] + public ActionResult Edit(ProcessConfigVM vm) + { + if (!ModelState.IsValid) + { + return PartialView(vm); + } + else + { + vm.DoEdit(); + if (!ModelState.IsValid) + { + vm.DoReInit(); + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID); + } + } + } + #endregion + + #region Delete + [ActionDescription("Sys.Delete")] + public ActionResult Delete(string id) + { + var vm = Wtm.CreateVM(id); + return PartialView(vm); + } + + [ActionDescription("Sys.Delete")] + [HttpPost] + public ActionResult Delete(string id, IFormCollection nouse) + { + var vm = Wtm.CreateVM(id); + vm.DoDelete(); + if (!ModelState.IsValid) + { + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid(); + } + } + #endregion + + #region Details + [ActionDescription("Sys.Details")] + public ActionResult Details(string id) + { + var vm = Wtm.CreateVM(id); + return PartialView(vm); + } + #endregion + + #region BatchEdit + [HttpPost] + [ActionDescription("Sys.BatchEdit")] + public ActionResult BatchEdit(string[] IDs) + { + var vm = Wtm.CreateVM(Ids: IDs); + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.BatchEdit")] + public ActionResult DoBatchEdit(ProcessConfigBatchVM vm, IFormCollection nouse) + { + if (!ModelState.IsValid || !vm.DoBatchEdit()) + { + return PartialView("BatchEdit",vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchEditSuccess", vm.Ids.Length]); + } + } + #endregion + + #region BatchDelete + [HttpPost] + [ActionDescription("Sys.BatchDelete")] + public ActionResult BatchDelete(string[] IDs) + { + var vm = Wtm.CreateVM(Ids: IDs); + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.BatchDelete")] + public ActionResult DoBatchDelete(ProcessConfigBatchVM vm, IFormCollection nouse) + { + if (!ModelState.IsValid || !vm.DoBatchDelete()) + { + return PartialView("BatchDelete",vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchDeleteSuccess", vm.Ids.Length]); + } + } + #endregion + + #region Import + [ActionDescription("Sys.Import")] + public ActionResult Import() + { + var vm = Wtm.CreateVM(); + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.Import")] + public ActionResult Import(ProcessConfigImportVM vm, IFormCollection nouse) + { + if (vm.ErrorListVM.EntityList.Count > 0 || !vm.BatchSaveData()) + { + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.ImportSuccess", vm.EntityList.Count.ToString()]); + } + } + #endregion + + #region Export + [ActionDescription("Sys.Export")] + [HttpPost] + public IActionResult ExportExcel(ProcessConfigListVM vm) + { + return vm.GetExportData(); + } + #endregion + + } +} diff --git a/HHWMS.Web/Areas/Configs/ViewModels/ContainerVMs/ContainerListVM.cs b/HHWMS.Web/Areas/Configs/ViewModels/ContainerVMs/ContainerListVM.cs index 5c657cc..3d09f6d 100644 --- a/HHWMS.Web/Areas/Configs/ViewModels/ContainerVMs/ContainerListVM.cs +++ b/HHWMS.Web/Areas/Configs/ViewModels/ContainerVMs/ContainerListVM.cs @@ -1,4 +1,6 @@ +using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; using HHWMS.Web.Models; using WalkingTec.Mvvm.Core; @@ -40,6 +42,7 @@ namespace HHWMS.Web { InitVM(); return new List>{ + this.MakeGridHeader(x => x.Name_view).SetWidth(80), this.MakeGridHeader(x => x.Code), this.MakeGridHeader(x => x.Type) .SetFormat((a, b) => @@ -65,6 +68,7 @@ namespace HHWMS.Web public override IOrderedQueryable GetSearchQuery() { var query = DC.Set() + .CheckEqual(Searcher.ZoneId, x=>x.ZoneId) .CheckContain(Searcher.Code, x => x.Code) .CheckContain(Searcher.Type, x => x.Type) .CheckEqual(Searcher.IsLock, x => x.IsLock) @@ -73,8 +77,10 @@ namespace HHWMS.Web .CheckEqual(Searcher.Length, x => x.Length) .CheckEqual(Searcher.Width, x => x.Width) .CheckEqual(Searcher.Height, x => x.Height) + .DPWhere(Wtm,x => x.ZoneId) .Select(x => new Container_View { + Name_view = x.Zone.Name, ID = x.ID, Code = x.Code, Type = x.Type, @@ -92,5 +98,7 @@ namespace HHWMS.Web public class Container_View : Container { + [Display(Name = "Location.ZoneName")] + public String Name_view { get; set; } } } diff --git a/HHWMS.Web/Areas/Configs/ViewModels/ContainerVMs/ContainerSearcher.cs b/HHWMS.Web/Areas/Configs/ViewModels/ContainerVMs/ContainerSearcher.cs index 79e499b..640a1a3 100644 --- a/HHWMS.Web/Areas/Configs/ViewModels/ContainerVMs/ContainerSearcher.cs +++ b/HHWMS.Web/Areas/Configs/ViewModels/ContainerVMs/ContainerSearcher.cs @@ -1,12 +1,18 @@ using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using HHWMS.Web.Models; using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; namespace HHWMS.Web { public partial class ContainerSearcher : BaseSearcher { + public List AllZones { get; set; } + [Display(Name = "Location.ZoneCode")] + public int? ZoneId { get; set; } + [Display(Name = "Container.Code")] public String Code { get; set; } @@ -33,6 +39,7 @@ namespace HHWMS.Web protected override void InitVM() { + AllZones = DC.Set().GetSelectListItems(Wtm, y => y.Name); } } } diff --git a/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationListVM.cs b/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationListVM.cs index 5901846..9811ee1 100644 --- a/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationListVM.cs +++ b/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationListVM.cs @@ -65,6 +65,7 @@ namespace HHWMS.Web .CheckEqual(Searcher.RowFlag, x=>x.RowFlag) .CheckContain(Searcher.ContainerCode, x=>x.ContainerCode) .CheckEqual(Searcher.IsStop, x=>x.IsStop) + .DPWhere(Wtm,x => x.ZoneId) .Select(x => new Location_View { ID = x.ID, diff --git a/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationVM.cs b/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationVM.cs index 2f36afb..b29fe14 100644 --- a/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationVM.cs +++ b/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationVM.cs @@ -461,6 +461,10 @@ namespace HHWMS.Web return moveloc; } } + else if (outter != null && outter.Status == LocationStatusEnum.锁定) + { + return ResponseResult.Error("外侧仓位已被锁定!请稍后再尝试!"); + } } } @@ -532,7 +536,7 @@ namespace HHWMS.Web && l.ContainerStatus == LocationStatus.空仓位 && locationPairs.TryGetValue(l.ContiguousCode, out var outer) && outer.ContainerStatus == LocationStatus.空仓位) - .OrderBy(l => l.Height) + .OrderBy(l => Math.Abs((decimal)outter.Height - (decimal)l.Height)) .ThenBy(l => Math.Abs(outter.RoadWay - l.RoadWay)) .ThenBy(l => Math.Abs(outter.Line - l.Line)) .ThenBy(l => l.Layer) diff --git a/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigBatchVM.cs b/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigBatchVM.cs new file mode 100644 index 0000000..98dbea1 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigBatchVM.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class ProcessConfigBatchVM : BaseBatchVM + { + public ProcessConfigBatchVM() + { + ListVM = new ProcessConfigListVM(); + LinkedVM = new ProcessConfig_BatchEdit(); + } + + } + + /// + /// Class to define batch edit fields + /// + public class ProcessConfig_BatchEdit : BaseVM + { + + protected override void InitVM() + { + } + + } + +} diff --git a/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigImportVM.cs b/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigImportVM.cs new file mode 100644 index 0000000..915dea4 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigImportVM.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class ProcessConfigTemplateVM : BaseTemplateVM + { + [Display(Name = "Process.Code")] + public ExcelPropety Code_Excel = ExcelPropety.CreateProperty(x => x.Code); + [Display(Name = "Process.Name")] + public ExcelPropety Name_Excel = ExcelPropety.CreateProperty(x => x.Name); + [Display(Name = "Process.Zone")] + public ExcelPropety Zone_Excel = ExcelPropety.CreateProperty(x => x.Zone); + [Display(Name = "Process.Port")] + public ExcelPropety Port_Excel = ExcelPropety.CreateProperty(x => x.Port); + [Display(Name = "Sys.spare")] + public ExcelPropety Spare1_Excel = ExcelPropety.CreateProperty(x => x.Spare1); + [Display(Name = "Sys.spare")] + public ExcelPropety Spare2_Excel = ExcelPropety.CreateProperty(x => x.Spare2); + [Display(Name = "Sys.spare")] + public ExcelPropety Spare3_Excel = ExcelPropety.CreateProperty(x => x.Spare3); + + protected override void InitVM() + { + } + + } + + public class ProcessConfigImportVM : BaseImportVM + { + + } + +} diff --git a/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigListVM.cs b/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigListVM.cs new file mode 100644 index 0000000..8f312ef --- /dev/null +++ b/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigListVM.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class ProcessConfigListVM : BasePagedListVM + { + public List AllZones { get; set; } + public List AllOutPorts { get; set; } + + protected override void InitVM() + { + var vm = Wtm.CreateVM(); + AllZones = vm.AllZones; + AllOutPorts = vm.AllOutPorts; + } + + protected override List InitGridAction() + { + return new List + { + this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"configs", dialogWidth: 800), + this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "configs", dialogWidth: 800), + this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "configs", dialogWidth: 800), + this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "configs", dialogWidth: 800), + this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "configs", dialogWidth: 800), + this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "configs", dialogWidth: 800), + this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800), + this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"), + }; + } + + + protected override IEnumerable> InitGridHeader() + { + InitVM(); + return new List>{ + this.MakeGridHeader(x => x.Code), + this.MakeGridHeader(x => x.Name), + this.MakeGridHeader(x => x.Zone) + .SetFormat((a, b) => + { + var data = AllZones.FirstOrDefault(x => x.Value.ToString() == a.Zone); + return data?.Text ?? a.Zone; + }), + this.MakeGridHeader(x => x.Port) + .SetFormat((a, b) => + { + var data = AllOutPorts.FirstOrDefault(x => x.Value.ToString() == a.Port); + return data?.Text ?? a.Port; + }), + this.MakeGridHeader(x => x.Spare1).SetHide(), + this.MakeGridHeader(x => x.Spare2).SetHide(), + this.MakeGridHeader(x => x.Spare3).SetHide(), + this.MakeGridHeaderAction(width: 200) + }; + } + + public override IOrderedQueryable GetSearchQuery() + { + var query = DC.Set() + .CheckContain(Searcher.Code, x=>x.Code) + .CheckContain(Searcher.Name, x=>x.Name) + .CheckContain(Searcher.Zone, x=>x.Zone) + .CheckContain(Searcher.Port, x=>x.Port) + .CheckContain(Searcher.Spare1, x=>x.Spare1) + .CheckContain(Searcher.Spare2, x=>x.Spare2) + .CheckContain(Searcher.Spare3, x=>x.Spare3) + .Select(x => new ProcessConfig_View + { + ID = x.ID, + Code = x.Code, + Name = x.Name, + Zone = x.Zone, + Port = x.Port, + Spare1 = x.Spare1, + Spare2 = x.Spare2, + Spare3 = x.Spare3, + }) + .OrderBy(x => x.ID); + return query; + } + + } + + public class ProcessConfig_View : ProcessConfig{ + + } +} diff --git a/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigSearcher.cs b/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigSearcher.cs new file mode 100644 index 0000000..6c858f8 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigSearcher.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class ProcessConfigSearcher : BaseSearcher + { + [Display(Name = "Process.Code")] + public String Code { get; set; } + [Display(Name = "Process.Name")] + public String Name { get; set; } + [Display(Name = "Process.Zone")] + public String Zone { get; set; } + [Display(Name = "Process.Port")] + public String Port { get; set; } + [Display(Name = "Sys.Spare")] + public String Spare1 { get; set; } + [Display(Name = "Sys.Spare")] + public String Spare2 { get; set; } + [Display(Name = "Sys.Spare")] + public String Spare3 { get; set; } + + protected override void InitVM() + { + } + + } +} diff --git a/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigVM.cs b/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigVM.cs new file mode 100644 index 0000000..2433f94 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/ViewModels/ProcessConfigVMs/ProcessConfigVM.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class ProcessConfigVM : BaseCRUDVM + { + + public List AllZones { get; set; } + public List AllOutPorts { get; set; } + + public ProcessConfigVM() + { + } + + protected override void InitVM() + { + var vm = Wtm.CreateVM(); + AllZones = new List + { + new ComboSelectListItem { Text = "区域1", Value = "Zone1" }, + new ComboSelectListItem { Text = "区域2", Value = "Zone2" }, + new ComboSelectListItem { Text = "区域3", Value = "Zone3" }, + }; + AllOutPorts = vm.AllOutPorts; + } + + public override void DoAdd() + { + base.DoAdd(); + } + + public override void DoEdit(bool updateAllFields = false) + { + base.DoEdit(updateAllFields); + } + + public override void DoDelete() + { + base.DoDelete(); + } + } +} diff --git a/HHWMS.Web/Areas/Configs/Views/Container/Index.cshtml b/HHWMS.Web/Areas/Configs/Views/Container/Index.cshtml index 986262b..a61fea1 100644 --- a/HHWMS.Web/Areas/Configs/Views/Container/Index.cshtml +++ b/HHWMS.Web/Areas/Configs/Views/Container/Index.cshtml @@ -3,6 +3,7 @@ + @@ -22,7 +23,6 @@ let printData = []; function print(ids, datas) { - console.log(datas) datas.forEach(function (value, index, arr) { printData.push({code: value.Code}) }); diff --git a/HHWMS.Web/Areas/Configs/Views/Material/Edit.cshtml b/HHWMS.Web/Areas/Configs/Views/Material/Edit.cshtml index 2770d08..c3b3448 100644 --- a/HHWMS.Web/Areas/Configs/Views/Material/Edit.cshtml +++ b/HHWMS.Web/Areas/Configs/Views/Material/Edit.cshtml @@ -3,8 +3,8 @@ - - + + diff --git a/HHWMS.Web/Areas/Configs/Views/MaterialProcess/Edit.cshtml b/HHWMS.Web/Areas/Configs/Views/MaterialProcess/Edit.cshtml index 7fde79d..9cb87e0 100644 --- a/HHWMS.Web/Areas/Configs/Views/MaterialProcess/Edit.cshtml +++ b/HHWMS.Web/Areas/Configs/Views/MaterialProcess/Edit.cshtml @@ -3,7 +3,7 @@ - + diff --git a/HHWMS.Web/Areas/Configs/Views/ProcessConfig/BatchDelete.cshtml b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/BatchDelete.cshtml new file mode 100644 index 0000000..be4e71e --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/BatchDelete.cshtml @@ -0,0 +1,12 @@ +@model HHWMS.Web.ProcessConfigBatchVM +@inject IStringLocalizer Localizer; + + + @Localizer["Sys.BatchDeleteConfirm"] + + + + + + + diff --git a/HHWMS.Web/Areas/Configs/Views/ProcessConfig/BatchEdit.cshtml b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/BatchEdit.cshtml new file mode 100644 index 0000000..d302918 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/BatchEdit.cshtml @@ -0,0 +1,14 @@ +@model HHWMS.Web.ProcessConfigBatchVM +@inject IStringLocalizer Localizer; + + +
@Localizer["Sys.BatchEditConfirm"]
+ + + + + + + + +
diff --git a/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Create.cshtml b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Create.cshtml new file mode 100644 index 0000000..66f1543 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Create.cshtml @@ -0,0 +1,18 @@ +@model HHWMS.Web.ProcessConfigVM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Delete.cshtml b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Delete.cshtml new file mode 100644 index 0000000..cc209a9 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Delete.cshtml @@ -0,0 +1,20 @@ +@model HHWMS.Web.ProcessConfigVM +@inject IStringLocalizer Localizer; + + + @Localizer["Sys.DeleteConfirm"] + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Details.cshtml b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Details.cshtml new file mode 100644 index 0000000..ed873f0 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Details.cshtml @@ -0,0 +1,17 @@ +@model HHWMS.Web.ProcessConfigVM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Edit.cshtml b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Edit.cshtml new file mode 100644 index 0000000..495c3b9 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Edit.cshtml @@ -0,0 +1,19 @@ +@model HHWMS.Web.ProcessConfigVM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Import.cshtml b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Import.cshtml new file mode 100644 index 0000000..8f81f61 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Import.cshtml @@ -0,0 +1,14 @@ +@model HHWMS.Web.ProcessConfigImportVM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Index.cshtml b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Index.cshtml new file mode 100644 index 0000000..33fbcd4 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Views/ProcessConfig/Index.cshtml @@ -0,0 +1,12 @@ +@model HHWMS.Web.ProcessConfigListVM +@inject IStringLocalizer Localizer; + + + + + + + + + + diff --git a/HHWMS.Web/Areas/Inventory/Controllers/InventoryController.cs b/HHWMS.Web/Areas/Inventory/Controllers/InventoryController.cs index b1c5e64..9fcbaea 100644 --- a/HHWMS.Web/Areas/Inventory/Controllers/InventoryController.cs +++ b/HHWMS.Web/Areas/Inventory/Controllers/InventoryController.cs @@ -226,7 +226,7 @@ namespace HHWMS.Web.Controllers #endregion #region InvOut 出库 - [ActionDescription("TaskType.Out")] + /*[ActionDescription("TaskType.Out")] public ActionResult InvOut(string id) { var vm = Wtm.CreateVM(id); @@ -234,54 +234,67 @@ namespace HHWMS.Web.Controllers { return FFResult().Alert("所选库存已被锁定!,请检查后重试!").RefreshGrid(); } - return PartialView(vm); - } - - [HttpPost] - [ActionDescription("TaskType.Out")] - public ActionResult InvOut(InventoryVM vm) - { - var id = vm.Entity.ID; - // 校验参数 - if (string.IsNullOrWhiteSpace(vm.OutPort)) + // 判断是否存在出口配置 + var processConfig = _unitWork.FindSingle(m => + m.Name == vm.Entity.Lot); + if (processConfig == null) { - return FFResult().Alert("出口必选,请选择后重试!"); + return FFResult().Alert("所选库存下道工序出口未配置!,请检查后重试!").RefreshGrid(); } + return PartialView(vm); + }*/ + + [ActionDescription("TaskType.Out")] + public ActionResult InvOut(string id) + { + // var vm = Wtm.CreateVM(id); + // 校验参数 + // if (string.IsNullOrWhiteSpace(vm.OutPort)) + // { + // return FFResult().Alert("出口必选,请选择后重试!"); + // } // 校验库存 - var inv = _unitWork.FindSingle(x => x.ID == id); + var inv = _unitWork.FindSingle(x => x.ID == int.Parse(id)); if (inv == null) { - return FFResult().CloseDialog().Alert("所选库存不存在,请检查后重试!").RefreshGrid(); + return FFResult().Alert("所选库存不存在,请检查后重试!").RefreshGrid(); } if (inv.TaskStatus == InventoryTaskStatusEnum.Locked) { - return FFResult().CloseDialog().Alert("所选库存已被锁定!,请检查后重试!").RefreshGrid(); + return FFResult().Alert("所选库存已被锁定!,请检查后重试!").RefreshGrid(); } // 校验容器 var container = _unitWork.FindSingle(x => x.Code == inv.ContainerCode); if (container == null) { - return FFResult().CloseDialog().Alert("所选库存的容器不存在,请检查后重试!").RefreshGrid(); + return FFResult().Alert("所选库存的容器不存在,请检查后重试!").RefreshGrid(); } if (container.IsLock == ContainerLockEnum.任务锁) { - return FFResult().CloseDialog().Alert("库存所在容器已被锁定!,请检查后重试!").RefreshGrid(); + return FFResult().Alert("库存所在容器已被锁定!,请检查后重试!").RefreshGrid(); } // 校验库位 var location = _unitWork.FindSingle(x => x.Code == inv.LocationCode); if (location == null) { - return FFResult().CloseDialog().Alert("所选库存不在库内,请检查后重试!").RefreshGrid(); + return FFResult().Alert("所选库存不在库内,请检查后重试!").RefreshGrid(); } if (location.Status == LocationStatusEnum.锁定) { - return FFResult().CloseDialog().Alert("库存所在仓位已被锁定!,请检查后重试!").RefreshGrid(); + return FFResult().Alert("库存所在仓位已被锁定!,请检查后重试!").RefreshGrid(); } + // 判断是否存在出口配置 + var processConfig = _unitWork.FindSingle(m => + m.Name == inv.Lot); + if (processConfig == null) + { + return FFResult().Alert("所选库存下道工序出口未配置!,请检查后重试!").RefreshGrid(); + } // 创建任务 var task = new TaskHeader() { @@ -289,7 +302,7 @@ namespace HHWMS.Web.Controllers ZoneId = inv.ZoneId, TaskType = TaskTypeEnum.出库, FromLocation = inv.LocationCode, - ToLocation = vm.OutPort, + ToLocation = processConfig.Port, ContainerCode = inv.ContainerCode, RoadWay = 1, Status = TaskStatusEnum.新建, @@ -335,12 +348,12 @@ namespace HHWMS.Web.Controllers location.UpdateTime = DateTime.Now; _unitWork.Update(location); - return FFResult().CloseDialog().Message("出库任务创建成功").RefreshGrid(); + return FFResult().Message("出库任务创建成功").RefreshGrid(); } else { // WCS任务下发失败 - return FFResult().CloseDialog().Message(wcsResult?.Msg ?? "WCS任务下发失败").RefreshGrid(); + return FFResult().Message(wcsResult?.Msg ?? "WCS任务下发失败").RefreshGrid(); } } @@ -358,6 +371,11 @@ namespace HHWMS.Web.Controllers return PartialView(vm); } + /// + /// 成品出库 + /// + /// + /// [HttpPost] [ActionDescription("TaskType.Out")] public ActionResult InvOut2(InventoryVM vm) diff --git a/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventoryListVM.cs b/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventoryListVM.cs index d9ec9e0..ecd48fd 100644 --- a/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventoryListVM.cs +++ b/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventoryListVM.cs @@ -26,7 +26,8 @@ namespace HHWMS.Web this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "inventory", dialogWidth: 800), this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "inventory"), this.MakeAction("Inventory","InvOut",Localizer["TaskType.Out"],"",GridActionParameterTypesEnum.SingleId,"inventory") - .SetSize(500,400), + .SetSize(500,400) + .SetShowDialog(false), this.MakeAction("Inventory","InvOut2",Localizer["TaskType.Out1"],"",GridActionParameterTypesEnum.SingleId,"inventory") .SetSize(500,400), }; @@ -42,6 +43,16 @@ namespace HHWMS.Web this.MakeGridHeader(x => x.MaterialCode).SetWidth(90), this.MakeGridHeader(x => x.MaterialType).SetWidth(100), this.MakeGridHeader(x => x.SupplierCode).SetWidth(100), + this.MakeGridHeader(x => x.Batch).SetWidth(100), + this.MakeGridHeader(x => x.Lot).SetWidth(100), + this.MakeGridHeader(x => x.TaskStatus).SetWidth(100) + .SetBackGroundFunc((a)=>{ + if(a.TaskStatus == InventoryTaskStatusEnum.Locked ) + { + return "#FF0000"; + } + return ""; + }), this.MakeGridHeader(x => x.MaterialName).SetWidth(100), this.MakeGridHeader(x => x.CompanyCode).SetWidth(150), this.MakeGridHeader(x => x.SourceCode).SetWidth(150), @@ -53,21 +64,11 @@ namespace HHWMS.Web { return (int?)a.Qty ?? 0; }), - this.MakeGridHeader(x => x.Batch).SetWidth(100), - this.MakeGridHeader(x => x.Lot).SetHide(), this.MakeGridHeader(x => x.ManufactureDate).SetHide(), this.MakeGridHeader(x => x.ExpirationDate).SetHide(), this.MakeGridHeader(x => x.ReceiptCode).SetHide(), this.MakeGridHeader(x => x.ReceiptDetailId).SetHide(), this.MakeGridHeader(x => x.Status).SetWidth(100), - this.MakeGridHeader(x => x.TaskStatus).SetWidth(100) - .SetBackGroundFunc((a)=>{ - if(a.TaskStatus == InventoryTaskStatusEnum.Locked ) - { - return "#FF0000"; - } - return ""; - }), this.MakeGridHeaderAction(width: 200) }; } diff --git a/HHWMS.Web/Areas/Inventory/Views/Inventory/InvOut.cshtml b/HHWMS.Web/Areas/Inventory/Views/Inventory/InvOut.cshtml index 9653b1f..abc44a5 100644 --- a/HHWMS.Web/Areas/Inventory/Views/Inventory/InvOut.cshtml +++ b/HHWMS.Web/Areas/Inventory/Views/Inventory/InvOut.cshtml @@ -5,7 +5,7 @@ - + diff --git a/HHWMS.Web/Areas/Receipt/Controllers/ReceiptInController.cs b/HHWMS.Web/Areas/Receipt/Controllers/ReceiptInController.cs index 611f828..c9d6500 100644 --- a/HHWMS.Web/Areas/Receipt/Controllers/ReceiptInController.cs +++ b/HHWMS.Web/Areas/Receipt/Controllers/ReceiptInController.cs @@ -24,9 +24,9 @@ namespace HHWMS.Web.Controllers _unitWork = unitwork; _materialZones = new Dictionary { - { "zone1", new LineRange { BeginLine = 1, EndLine = 25 } }, - { "zone2", new LineRange { BeginLine = 26, EndLine = 57 } }, - { "zone3", new LineRange { BeginLine = 58, EndLine = 96 } }, + { "Zone1", new LineRange { BeginLine = 1, EndLine = 25 } }, + { "Zone2", new LineRange { BeginLine = 26, EndLine = 57 } }, + { "Zone3", new LineRange { BeginLine = 58, EndLine = 96 } }, }; } @@ -121,6 +121,21 @@ namespace HHWMS.Web.Controllers return Json(new { Code = 200, Data = orders }); } + [Public] + [HttpGet] + public IActionResult GetTrayTypes() + { + var containerconfig = _unitWork.Find(x => x.DictType == "ContainerConfig" + && x.DictLabelUs.ToLower() != "container") + .Select(x => new + { + value = x.ID, + label = x.DictLabel, + }) + .ToList(); + return Json(new { Code = 200, Data = containerconfig }); + } + [HttpPost] public IActionResult SubmitReceipt([FromBody] ReceiptInModel model) { @@ -141,15 +156,28 @@ namespace HHWMS.Web.Controllers { return Json(new { Code = 500, Msg = "容器不存在" }); } + var materialProcessList = _unitWork.Find(m => m.MaterialCode == material.MaterialCode); + var materialProcess = _unitWork.FindSingle(m => m.ID == model.ProcessId); if (materialProcess == null) { - return Json(new { Code = 500, Msg = "未找到此工序配置" }); + return Json(new { Code = 500, Msg = "未找到此物料工序配置" }); } + // 下一道工序 + var nextProcess = materialProcessList + // 筛选同一物料 + .Where(p => p.MaterialCode == material.MaterialCode) + // 筛选顺序大于当前工序的工序 + .Where(p => p.ProcessOrder > materialProcess.ProcessOrder) + // 按工序顺序升序排列(取最小的一个,即下一道) + .OrderBy(p => p.ProcessOrder) + // 取第一个(下一道工序) + .FirstOrDefault(); + // 从字典查询工序对应的区域 - var zoneName = _unitWork.FindSingle(x => x.DictType == "ProcessZone" - && x.DictLabel == materialProcess.ProcessCode)?.DictValue; + var zoneName = _unitWork.FindSingle(x => + x.Code == nextProcess.ProcessCode)?.Zone; if (string.IsNullOrEmpty(zoneName)) { @@ -180,7 +208,7 @@ namespace HHWMS.Web.Controllers TaskType = TaskTypeEnum.入库, FromLocation = "", ToLocation = locationCode, - ContainerCode = model.PalletCode, + ContainerCode = container.Code, RoadWay = 1, Status = TaskStatusEnum.新建, CreateBy = model.OperatorId, @@ -193,18 +221,21 @@ namespace HHWMS.Web.Controllers var inventory = new Inventory { ZoneId = zone.ID, - ContainerCode = model.PalletCode, + ContainerCode = taskHeader.ContainerCode, LocationCode = locationCode, MaterialCode = model.MaterialCode, MaterialType = material.MaterialType, MaterialName = material.MaterialName, MaterialSpec = material.MaterialSpec, MaterialUnit = material.MaterialUnit, + SupplierCode = material.SupplierCode, + SourceCode = model.SourceCode, Batch = materialProcess.ProcessName, - Lot = materialProcess.ProcessCode, + Lot = nextProcess?.ProcessName, Status = model.IsQualified ? "合格" : "不合格", TaskStatus = InventoryTaskStatusEnum.Locked, - TaskQty = model.Qty, + TaskQty = model.Qty,//小托盘数量 + Flag = model.Type,//小托盘类型 CreateBy = model.OperatorId, ReceiptCode = model.OperatorInfo, //校验员 CreateTime = DateTime.Now @@ -226,7 +257,7 @@ namespace HHWMS.Web.Controllers { Status = LocationStatusEnum.锁定, ContainerStatus = LocationStatus.有货, - ContainerCode = model.PalletCode, + ContainerCode = taskHeader.ContainerCode, UpdateTime = DateTime.Now, UpdateBy = "WMS", Version = Guid.NewGuid() @@ -243,7 +274,7 @@ namespace HHWMS.Web.Controllers var wcsTaskModel = new WCSTaskModel { TaskNo = taskNo, - PalletNo = model.PalletCode, + PalletNo = taskHeader.ContainerCode, FromLocation = "", // 入库任务起始位置为空 ToLocation = locationCode, }; @@ -295,7 +326,7 @@ namespace HHWMS.Web.Controllers // 1. 查找可用库位信息 var locationVm = Wtm.CreateVM(); - var locationCode = locationVm.GetEmptyLocationFromXb(_materialZones["zone1"].BeginLine, _materialZones["zone1"].EndLine); + var locationCode = locationVm.GetEmptyLocationFromXb(_materialZones["Zone1"].BeginLine, _materialZones["Zone1"].EndLine); if (string.IsNullOrWhiteSpace(locationCode)) { @@ -317,7 +348,7 @@ namespace HHWMS.Web.Controllers TaskType = TaskTypeEnum.入库, FromLocation = "", ToLocation = locationCode, - ContainerCode = model.PalletCode, + ContainerCode = container.Code, RoadWay = 1, Status = TaskStatusEnum.新建, CreateBy = model.OperatorId, @@ -358,7 +389,7 @@ namespace HHWMS.Web.Controllers var wcsTaskModel = new WCSTaskModel { TaskNo = taskNo, - PalletNo = model.PalletCode, + PalletNo = taskHeader.ContainerCode, FromLocation = "", // 入库任务起始位置为空 ToLocation = locationCode, }; @@ -387,6 +418,58 @@ namespace HHWMS.Web.Controllers } }} + /// + /// 空托盘出库 + /// + /// + [HttpPost] + public IActionResult EmptyPalletOut() + { + var container = _unitWork.FindSingle(x => x.Status == ContainerStatus.空 + && x.IsLock == ContainerLockEnum.未锁 + && !string.IsNullOrEmpty(x.LocationCode)); + if (container == null) + { + return Json(new { Code = 500, Msg = "库内不存在可用空容器!"} ); + } + + //创建出库任务 + var location = _unitWork.FindSingle(x => x.Code == container.LocationCode); + + var outPort = _unitWork.FindSingle(x => x.Code == "00")?.Port; + if (string.IsNullOrEmpty(outPort)) + { + return Json(new { Code = 500, Msg = "未配置空托盘出库口,请配置后重新呼叫出库任务!"} ); + } + + var task = new TaskHeader() + { + ZoneId = location.ZoneId, + TaskNo = _unitWork.GetSerialNumber("Out", 6), + TaskType = TaskTypeEnum.出库, + ContainerCode = container.Code, + FromLocation = container.LocationCode, + ToLocation = outPort, + Status = TaskStatusEnum.新建 + }; + + var vm = Wtm.CreateVM(); + var result = vm.SendWcsTask(task); + if (!result.Status) + { + return Json(new { Code = 500, Msg =result.Message}); + } + + location.Status = LocationStatusEnum.锁定; + location.UpdateTime = DateTime.Now; + _unitWork.Update(location); + + container.IsLock = ContainerLockEnum.任务锁; + container.UpdateTime = DateTime.Now; + _unitWork.Update(container); + return Json(new { Code = 200, Msg = "提交成功" }); + } + /// /// 搜索物料 /// @@ -425,11 +508,13 @@ namespace HHWMS.Web.Controllers public class ReceiptInModel { public string PalletCode { get; set; } + public string SourceCode { get; set; } public string MaterialCode { get; set; } public string OrderId { get; set; } public string OperatorId { get; set; } public int ProcessId { get; set; } public string ProcessName { get; set; } + public int Type { get; set; } public int Qty { get; set; } public bool IsQualified { get; set; } public string OperatorInfo { get; set; } diff --git a/HHWMS.Web/Areas/Receipt/Controllers/SimpleReceiptInController.cs b/HHWMS.Web/Areas/Receipt/Controllers/SimpleReceiptInController.cs index 39e6e17..4175c74 100644 --- a/HHWMS.Web/Areas/Receipt/Controllers/SimpleReceiptInController.cs +++ b/HHWMS.Web/Areas/Receipt/Controllers/SimpleReceiptInController.cs @@ -163,7 +163,7 @@ namespace HHWMS.Web.Controllers var inventory = new Inventory() { ZoneId = zone.ID, - ContainerCode = containerCode, + ContainerCode = container.Code, MaterialCode = material.MaterialCode, MaterialName = material.MaterialName, MaterialType = material.MaterialType, @@ -186,7 +186,7 @@ namespace HHWMS.Web.Controllers MaterialCode = material.MaterialCode, MaterialName = material.MaterialName, MaterialUnit = material.MaterialUnit, - ContainerCode = containerCode, + ContainerCode = container.Code, CompanyCode = inventory.CompanyCode, SourceCode = inventory.SourceCode, SupplierCode = inventory.SupplierCode, @@ -249,7 +249,7 @@ namespace HHWMS.Web.Controllers TaskNo = _unitWork.GetSerialNumber("In"), TaskType = TaskTypeEnum.入库, RoadWay = 2, - ContainerCode = containerCode, + ContainerCode = container.Code, FromLocation = "Enter_0000", ToLocation = "", Status = TaskStatusEnum.待下发, @@ -452,7 +452,7 @@ namespace HHWMS.Web.Controllers TaskNo = _unitWork.GetSerialNumber("In"), TaskType = TaskTypeEnum.入库, RoadWay = 2, - ContainerCode = containerCode, + ContainerCode = container.Code, FromLocation = "Enter_0000", ToLocation = "", Status = TaskStatusEnum.待下发, diff --git a/HHWMS.Web/Areas/Receipt/Views/ReceiptIn/Index.cshtml b/HHWMS.Web/Areas/Receipt/Views/ReceiptIn/Index.cshtml index 2831c98..b303f29 100644 --- a/HHWMS.Web/Areas/Receipt/Views/ReceiptIn/Index.cshtml +++ b/HHWMS.Web/Areas/Receipt/Views/ReceiptIn/Index.cshtml @@ -39,6 +39,21 @@ + + + + + + + + {{ item.label }} + + + + @@ -57,9 +72,10 @@ - 上架入库 - 空托盘入库 - 重置 + 上架入库 + 空托盘入库 + 空托盘出库 + 重置 @@ -79,13 +95,16 @@ const palletCodeRef = ref(null); const materialCodeRef = ref(null); + const sourceCodeRef = ref(null); const numInput = ref(null); const operatorIdRef = ref(null); const operatorInfoRef = ref(null); + const trayTypeOptions = ref([]); const inputRefs = { palletCodeRef, materialCodeRef, + sourceCodeRef, numInput, operatorIdRef, operatorInfoRef @@ -101,11 +120,13 @@ const form = reactive({ palletCode: '', materialCode: '', + sourceCode:'', orderId: '', operatorId: '', processId: '', processName:'', name:'', + type:'', qty:null, isQualified: true, operatorInfo: '' @@ -157,7 +178,7 @@ const processSelect = (value) => { form.processName = processOptions.value.find(item => item.value === value).processName; - focusNext('numInput'); + focusNext('sourceCodeRef'); } // 加载工序列表 @@ -358,6 +379,35 @@ }); }; + // 呼叫空托盘出库 + const emptyPalletOut = () => { + loading.value = true; + + $.ajax({ + type: "post", + dataType: "json", + contentType: "application/json", + url: "/receipt/ReceiptIn/EmptyPalletOut", + success: (json) => { + if (json.Code == 200) { + Message.success('空托盘出库任务创建成功!'); + resetForm(); + } else { + Message.error({ + content: json.Msg || '空托盘出库任务创建失败!', + duration: 5000 + }); + } + }, + error: (xhr, status, error) => { + Message.error('提交失败:' + error); + }, + complete: () => { + loading.value = false; + } + }); + }; + // 重置表单 const resetForm = () => { formRef.value.resetFields(); @@ -369,6 +419,29 @@ }, 100); }; + // 从后端获取托盘类型列表 + const loadTrayTypes = () => { + // 调用后端接口获取数据 + axios.get('/receipt/ReceiptIn/GetTrayTypes') + .then(response => { + const result = response.data; + console.log(result) + if (result.Code == 200) { + // 假设后端返回格式:[{value: 'mini', label: 'Mini'}, ...] + trayTypeOptions.value = result.Data; + + // 可选:设置默认值(取第一个选项) + if (trayTypeOptions.value.length > 0) { + form.type = trayTypeOptions.value[0].value; + } + } else { + Message.error('获取托盘类型失败:' + result.Msg); + } + }) + .catch(error => { + Message.error('请求失败:' + error.message); + }); + }; // 生命周期钩子 onMounted(() => { @@ -378,6 +451,8 @@ palletCodeRef.value.focus(); } }, 100); + + loadTrayTypes(); }); return { @@ -391,19 +466,22 @@ scanMaterial, submitForm, submitEmptyPallet, + emptyPalletOut, resetForm, materialOptions, handleMaterialSearch, handleMaterialSelect, palletCodeRef, materialCodeRef, + sourceCodeRef, numInput, operatorIdRef, operatorInfoRef, focusNext, loadProcesses, loadProcessesByMaterial, - processSelect + processSelect, + trayTypeOptions }; } }); diff --git a/HHWMS.Web/Areas/WCS/Controllers/WCSTaskController.cs b/HHWMS.Web/Areas/WCS/Controllers/WCSTaskController.cs index e7b264d..19f296d 100644 --- a/HHWMS.Web/Areas/WCS/Controllers/WCSTaskController.cs +++ b/HHWMS.Web/Areas/WCS/Controllers/WCSTaskController.cs @@ -28,7 +28,7 @@ namespace HHWMS.Web.Controllers /// 提交WCS任务 /// [HttpPost] - public async Task SubmitTask([FromBody] WCSTaskModel model) + public IActionResult SubmitTask([FromBody] WCSTaskModel model) { try { diff --git a/HHWMS.Web/DataContext.cs b/HHWMS.Web/DataContext.cs index 7288fb3..19b1892 100644 --- a/HHWMS.Web/DataContext.cs +++ b/HHWMS.Web/DataContext.cs @@ -57,6 +57,7 @@ namespace HHWMS.Web public DbSet PrintConfigs { get; set; } public DbSet LocationZones { get; set; } public DbSet Customers { get; set; } + public DbSet ProcessConfigs { get; set; } public override async Task DataInit(object allModules, bool IsSpa) { var state = await base.DataInit(allModules, IsSpa); diff --git a/HHWMS.Web/Models/Configs/Container.cs b/HHWMS.Web/Models/Configs/Container.cs index 86d9150..34a597b 100644 --- a/HHWMS.Web/Models/Configs/Container.cs +++ b/HHWMS.Web/Models/Configs/Container.cs @@ -11,6 +11,10 @@ namespace HHWMS.Web.Models [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public new int ID { get; set; } + public LocationZone Zone { get; set; } + [Display(Name = "Location.ZoneCode", Description = "库区")] + public int ZoneId { get; set; } + [Display(Name = "Container.Code", Description = "容器编码")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string Code { get; set; } diff --git a/HHWMS.Web/Models/Configs/Customer.cs b/HHWMS.Web/Models/Configs/Customer.cs index bba154b..c0bb8d1 100644 --- a/HHWMS.Web/Models/Configs/Customer.cs +++ b/HHWMS.Web/Models/Configs/Customer.cs @@ -12,6 +12,7 @@ namespace HHWMS.Web.Models [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public new int ID { get; set; } + [Required(ErrorMessage = "Validate.{0}required")] [Display(Name = "Customer.Code", Description = "编码")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string Code { get; set; } @@ -20,6 +21,7 @@ namespace HHWMS.Web.Models [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string Type { get; set; } + [Required(ErrorMessage = "Validate.{0}required")] [Display(Name = "Customer.Name", Description = "名称")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string Name { get; set; } diff --git a/HHWMS.Web/Models/Configs/Material.cs b/HHWMS.Web/Models/Configs/Material.cs index 3c85b26..64e6959 100644 --- a/HHWMS.Web/Models/Configs/Material.cs +++ b/HHWMS.Web/Models/Configs/Material.cs @@ -13,10 +13,12 @@ namespace HHWMS.Web.Models [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public new int ID { get; set; } + [Required(ErrorMessage = "Validate.{0}required")] [Display(Name = "Inventory.MaterialCode", Description = "物料编码")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string MaterialCode { get; set; } + [Required(ErrorMessage = "Validate.{0}required")] [Display(Name = "Inventory.MaterialType", Description = "物料类型")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string MaterialType { get; set; } @@ -48,7 +50,8 @@ namespace HHWMS.Web.Models [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")] public string SupplierCode { get; set; } - [Display(Name = "Inventory.Qty", Description = "数量")] + [Required(ErrorMessage = "Validate.{0}required")] + [Display(Name = "MaterialProcess.Weight", Description = "数量")] [Column(TypeName = "decimal(12,4)")] public decimal? Qty { get; set; } } diff --git a/HHWMS.Web/Models/Configs/MaterialProcess.cs b/HHWMS.Web/Models/Configs/MaterialProcess.cs index 60c591d..5d8f1a2 100644 --- a/HHWMS.Web/Models/Configs/MaterialProcess.cs +++ b/HHWMS.Web/Models/Configs/MaterialProcess.cs @@ -12,20 +12,25 @@ namespace HHWMS.Web.Models [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public new int ID { get; set; } + [Required(ErrorMessage = "Validate.{0}required")] [Display(Name = "MaterialProcess.MaterialCode", Description = "物料编码")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string MaterialCode { get; set; } - [Display(Name = "MaterialProcess.ProcessOrder", Description = "工序顺序")] - public int ProcessOrder { get; set; } + [Required(ErrorMessage = "Validate.{0}required")] + [RegularExpression("[0-9]{2}", ErrorMessage = "{0}必须是2位数字")] + [Display(Name = "MaterialProcess.ProcessCode", Description = "工序编码")] + [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] + public string ProcessCode { get; set; } + [Required(ErrorMessage = "Validate.{0}required")] [Display(Name = "MaterialProcess.ProcessName", Description = "工序名称")] [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")] public string ProcessName { get; set; } - [Display(Name = "MaterialProcess.ProcessCode", Description = "工序编码")] - [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] - public string ProcessCode { get; set; } + [Required(ErrorMessage = "Validate.{0}required")] + [Display(Name = "MaterialProcess.ProcessOrder", Description = "工序顺序")] + public int ProcessOrder { get; set; } [Display(Name = "MaterialProcess.Weight", Description = "毛重")] [Required] diff --git a/HHWMS.Web/Models/Configs/ProcessConfig.cs b/HHWMS.Web/Models/Configs/ProcessConfig.cs new file mode 100644 index 0000000..fe4be41 --- /dev/null +++ b/HHWMS.Web/Models/Configs/ProcessConfig.cs @@ -0,0 +1,49 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; +using WalkingTec.Mvvm.Core; + +namespace HHWMS.Web.Models +{ + [Table("ProcessConfig")] + public class ProcessConfig : BasePoco + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public new int ID { get; set; } + [Display(Name = "Process.Code", Description = "工序编码")] + [Required(ErrorMessage = "Validate.{0}required")] + [RegularExpression("[0-9]{2}", ErrorMessage = "{0}必须是2位数字")] + [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] + + public string Code { get; set; } + + [Display(Name = "Process.Name", Description = "工序名称")] + [Required(ErrorMessage = "Validate.{0}required")] + [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] + public string Name { get; set; } + + [Display(Name = "Process.Zone", Description = "存放区域")] + [Required(ErrorMessage = "Validate.{0}required")] + [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] + public string Zone { get; set; } + + [Display(Name = "Process.Port", Description = "出口")] + [Required(ErrorMessage = "Validate.{0}required")] + [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] + public string Port { get; set; } + + [Display(Name = "Sys.Spare", Description = "备用1")] + [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] + public string Spare1 { get; set; } + + [Display(Name = "Sys.Spare", Description = "备用2")] + [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] + public string Spare2 { get; set; } + + [Display(Name = "Sys.Spare", Description = "备用3")] + [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] + public string Spare3 { get; set; } + } +} diff --git a/HHWMS.Web/Program.cs b/HHWMS.Web/Program.cs index b6a463c..91b8985 100644 --- a/HHWMS.Web/Program.cs +++ b/HHWMS.Web/Program.cs @@ -41,7 +41,9 @@ builder.Services.AddMvc(options => options.UseWtmMvcOptions(); }) .AddJsonOptions(options => { + // 禁用 Unicode 转义(确保中文正常显示) options.UseWtmJsonOptions(); + options.JsonSerializerOptions.Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping; }) .ConfigureApiBehaviorOptions(options => { diff --git a/HHWMS.Web/Resources/Program.zh.resx b/HHWMS.Web/Resources/Program.zh.resx index 364b2fe..e2f6b54 100644 --- a/HHWMS.Web/Resources/Program.zh.resx +++ b/HHWMS.Web/Resources/Program.zh.resx @@ -1219,7 +1219,7 @@ 工序 - 格 + 下道工序 生产日期 @@ -1479,4 +1479,19 @@ 名称 + + 工序编码 + + + 工序名称 + + + 存放区域 + + + 出库口 + + + 备用 + diff --git a/HHWMS.Web/appsettings.json b/HHWMS.Web/appsettings.json index 825d7a2..2357f82 100644 --- a/HHWMS.Web/appsettings.json +++ b/HHWMS.Web/appsettings.json @@ -29,7 +29,7 @@ } ], "CookiePre": "HHWMS", //cookie前缀 - "IsQuickDebug": true, //是否启用debug模式 + "IsQuickDebug": false, //是否启用debug模式 "EnableTenant": false, //是否启动多租户 "SyncDb": true, //是否自动同步数据库 "EncryptKey": "", //加密密钥