From ad932a7050f1e77c45c6f1970586dca46e639589 Mon Sep 17 00:00:00 2001 From: zhougf Date: Tue, 5 Nov 2024 23:27:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 +- HHWMS.Web/.config/dotnet-tools.json | 2 +- HHWMS.Web/Areas/Api/IWCSController.cs | 43 +--- .../Controllers/PrintConfigController.cs | 12 ++ .../PrintConfigVMs/PrintConfigListVM.cs | 10 +- .../Configs/Views/PrintConfig/Design.cshtml | 202 ++++++++++++++++++ .../Configs/Views/PrintConfig/Index.cshtml | 22 +- .../Receipt/Views/ReceiptHeader/Design.cshtml | 10 + HHWMS.Web/Controllers/HomeController.cs | 25 +-- HHWMS.Web/DataContext.cs | 2 +- HHWMS.Web/HHWMS.Web.csproj | 50 +---- HHWMS.Web/Program.cs | 7 +- HHWMS.Web/Properties/launchSettings.json | 2 +- HHWMS.Web/Views/Home/Index.cshtml | 3 +- HHWMS.Web/appsettings.json | 6 - 15 files changed, 283 insertions(+), 120 deletions(-) create mode 100644 HHWMS.Web/Areas/Configs/Views/PrintConfig/Design.cshtml create mode 100644 HHWMS.Web/Areas/Receipt/Views/ReceiptHeader/Design.cshtml diff --git a/.gitignore b/.gitignore index 1e6d0ad..10b8683 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,8 @@ bld/ # Visual Studio 2015 cache/options directory .vs/ +.rider/ +.idea/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ @@ -279,4 +281,7 @@ __pycache__/ /nuget.exe /demo/WalkingTec.Mvvm.VueDemo/ClientApp/yarn.lock *.lock -*.DS_Store +.DS_Store + +[core] + autocrlf = input diff --git a/HHWMS.Web/.config/dotnet-tools.json b/HHWMS.Web/.config/dotnet-tools.json index 4ab9494..7fc188e 100644 --- a/HHWMS.Web/.config/dotnet-tools.json +++ b/HHWMS.Web/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-ef": { - "version": "5.0.2", + "version": "6.0.11", "commands": [ "dotnet-ef" ] diff --git a/HHWMS.Web/Areas/Api/IWCSController.cs b/HHWMS.Web/Areas/Api/IWCSController.cs index 7dbc6bb..888314a 100644 --- a/HHWMS.Web/Areas/Api/IWCSController.cs +++ b/HHWMS.Web/Areas/Api/IWCSController.cs @@ -9,7 +9,7 @@ using WalkingTec.Mvvm.Core; namespace HHWMS.Web { /// - /// WCS接口 + /// 提供给WCS调用接口 /// 调用方向 WCS --> WMS /// [Public] @@ -34,46 +34,6 @@ namespace HHWMS.Web [HttpPost] public IActionResult RequestIn(WcsRequest request) { - //var inv = new List(); - //for (int i = 0; i < 10; i++) - // inv.Add(new Inventory - // { - // ContainerCode = "test" + i - // }); - //_unitwork.BatchAdd(inv); - //_unitwork.DeleteById(1441); - //_unitwork.BatchUpdate(x => x.ID > 1030, x=>new Inventory { Batch = "test"}); - - // 测试 删除数据 保存到历史表 主子表数据 - /*var receipt = _unitwork.Find(x => x.ID == 3) - .FirstOrDefault(); - - var details = _unitwork.Find(x => x.HeaderId == 3) - .ToArray(); - var his = _mapper.Map(receipt); - var his2 = _mapper.Map>(details); - _unitwork.Add(his); - _unitwork.BatchAdd(his2);*/ - - /*var receipt = _unitwork.Find(x => x.ID == 3) - .FirstOrDefault(); - - var details = _unitwork.Find(x => x.HeaderId == 3) - .ToArray(); - var his = _mapper.Map(receipt); - var his2 = _mapper.Map>(details); - _unitwork.Add(his); - _unitwork.BatchAdd(his2);*/ - - var receipt = _unitwork.Find(x => 1==1) - .FirstOrDefault(); - - var details = _unitwork.Find(x => x.HeaderId == receipt.ID) - .ToArray(); - var his = _mapper.Map(receipt); - var his2 = _mapper.Map>(details); - _unitwork.Add(his); - _unitwork.BatchAdd(his2); return ApiResult(); } @@ -86,6 +46,5 @@ namespace HHWMS.Web { return ApiResult(); } - } } diff --git a/HHWMS.Web/Areas/Configs/Controllers/PrintConfigController.cs b/HHWMS.Web/Areas/Configs/Controllers/PrintConfigController.cs index 90069e6..03a1e42 100644 --- a/HHWMS.Web/Areas/Configs/Controllers/PrintConfigController.cs +++ b/HHWMS.Web/Areas/Configs/Controllers/PrintConfigController.cs @@ -5,6 +5,8 @@ using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Mvc; using WalkingTec.Mvvm.Core.Extensions; using HHWMS.Web; +using System.DirectoryServices.Protocols; +using System.Web; namespace HHWMS.Web.Controllers { @@ -96,6 +98,9 @@ namespace HHWMS.Web.Controllers } else { + //替换 " + vm.Entity.Template = HttpUtility.HtmlDecode(vm.Entity.Template); + vm.DoEdit(); if (!ModelState.IsValid) { @@ -224,5 +229,12 @@ namespace HHWMS.Web.Controllers } #endregion + + [ActionDescription("Sys.Print")] + public ActionResult Design(string id) + { + var vm = Wtm.CreateVM(id); + return PartialView(vm); + } } } diff --git a/HHWMS.Web/Areas/Configs/ViewModels/PrintConfigVMs/PrintConfigListVM.cs b/HHWMS.Web/Areas/Configs/ViewModels/PrintConfigVMs/PrintConfigListVM.cs index 0041482..0b28ad2 100644 --- a/HHWMS.Web/Areas/Configs/ViewModels/PrintConfigVMs/PrintConfigListVM.cs +++ b/HHWMS.Web/Areas/Configs/ViewModels/PrintConfigVMs/PrintConfigListVM.cs @@ -25,6 +25,14 @@ namespace HHWMS.Web this.MakeStandardAction("PrintConfig", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "configs", dialogWidth: 800), this.MakeStandardAction("PrintConfig", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800), this.MakeStandardAction("PrintConfig", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"), + // 打印模板设计 + this.MakeAction("PrintConfig","Design",Localizer["Sys.Design"],Localizer["Sys.Design"],GridActionParameterTypesEnum.SingleId,"configs") + .SetShowDialog(true) + .SetMax(), + // 打印预览 + this.MakeAction("PrintConfig","PrintPreview",Localizer["Sys.Print"],Localizer["Sys.Print"],GridActionParameterTypesEnum.SingleId,"configs") + .SetShowDialog(false) + .SetOnClickScript("print"), }; } @@ -35,7 +43,7 @@ namespace HHWMS.Web this.MakeGridHeader(x => x.Name), this.MakeGridHeader(x => x.Template), this.MakeGridHeader(x => x.TestData), - this.MakeGridHeaderAction(width: 200) + this.MakeGridHeaderAction(width: 300) }; } diff --git a/HHWMS.Web/Areas/Configs/Views/PrintConfig/Design.cshtml b/HHWMS.Web/Areas/Configs/Views/PrintConfig/Design.cshtml new file mode 100644 index 0000000..e391de7 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Views/PrintConfig/Design.cshtml @@ -0,0 +1,202 @@ +@model HHWMS.Web.PrintConfigVM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + +
+
+ +
+
+ +
+ +
+
+ +
+ +
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/HHWMS.Web/Areas/Configs/Views/PrintConfig/Index.cshtml b/HHWMS.Web/Areas/Configs/Views/PrintConfig/Index.cshtml index a203a0b..d563b0d 100644 --- a/HHWMS.Web/Areas/Configs/Views/PrintConfig/Index.cshtml +++ b/HHWMS.Web/Areas/Configs/Views/PrintConfig/Index.cshtml @@ -6,4 +6,24 @@ - + + + \ No newline at end of file diff --git a/HHWMS.Web/Areas/Receipt/Views/ReceiptHeader/Design.cshtml b/HHWMS.Web/Areas/Receipt/Views/ReceiptHeader/Design.cshtml new file mode 100644 index 0000000..95bd297 --- /dev/null +++ b/HHWMS.Web/Areas/Receipt/Views/ReceiptHeader/Design.cshtml @@ -0,0 +1,10 @@ +@model HHWMS.Web.PrintConfigVM +@inject IStringLocalizer Localizer; + + \ No newline at end of file diff --git a/HHWMS.Web/Controllers/HomeController.cs b/HHWMS.Web/Controllers/HomeController.cs index a734c2f..bfa625e 100644 --- a/HHWMS.Web/Controllers/HomeController.cs +++ b/HHWMS.Web/Controllers/HomeController.cs @@ -29,7 +29,6 @@ namespace HHWMS.Web.Controllers return View(); } - [AllowAnonymous] public IActionResult PIndex() { @@ -43,8 +42,8 @@ namespace HHWMS.Web.Controllers return PartialView(); } + [AllowAnonymous] - public IActionResult GetActionChart() { var areas = GlobaInfo.AllModule.Select(x => x.Area).Distinct(); @@ -69,6 +68,7 @@ namespace HHWMS.Web.Controllers var rv = data.ToChartData(); return Json(rv); } + [AllowAnonymous] public IActionResult GetModelChart() { @@ -100,6 +100,7 @@ namespace HHWMS.Web.Controllers var rv = data.ToChartData(); return Json(rv); } + [AllowAnonymous] public IActionResult GetSampleChart() { @@ -166,27 +167,7 @@ namespace HHWMS.Web.Controllers { return JsonMore(UserSessionManager.AllSignined().ToList()); } - //[AllowAnonymous] - //public github GetGithubInfo() - //{ - // var rv = Wtm.ReadFromCache("githubinfo", () => - // { - // var s = Wtm.CallAPI("github", "repos/dotnetcore/wtm", 60).Result; - // return s.Data; - // }, 1800); - - // return rv; - //} - - //public class github - //{ - // public int stargazers_count { get; set; } - // public int forks_count { get; set; } - // public int subscribers_count { get; set; } - // public int open_issues_count { get; set; } - //} } - } diff --git a/HHWMS.Web/DataContext.cs b/HHWMS.Web/DataContext.cs index fb0faa2..9dbe0e6 100644 --- a/HHWMS.Web/DataContext.cs +++ b/HHWMS.Web/DataContext.cs @@ -138,7 +138,7 @@ namespace HHWMS.Web { public DataContext CreateDbContext(string[] args) { - return new DataContext("Server=(localdb)\\mssqllocaldb;Database=HHWMS;Trusted_Connection=True;MultipleActiveResultSets=true", DBTypeEnum.SqlServer); + return new DataContext("Server=127.0.0.1;Port=3306;Database=WMS;Uid=root;Password=abc123*;Character Set=utf8mb4;", DBTypeEnum.MySql); } } } diff --git a/HHWMS.Web/HHWMS.Web.csproj b/HHWMS.Web/HHWMS.Web.csproj index cf7aa1f..972e31b 100644 --- a/HHWMS.Web/HHWMS.Web.csproj +++ b/HHWMS.Web/HHWMS.Web.csproj @@ -1,5 +1,4 @@ - net6.0 HHWMS @@ -8,52 +7,18 @@ InProcess b42c99ff-8994-49cd-9a66-5b513ed15a0a HHWMS - Copyright © WeiHai.com 2024 + Copyright © TaoLian.com 2024 - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - @@ -76,8 +41,9 @@ - - - - - + + + + + + \ No newline at end of file diff --git a/HHWMS.Web/Program.cs b/HHWMS.Web/Program.cs index 2ac92c6..ffda785 100644 --- a/HHWMS.Web/Program.cs +++ b/HHWMS.Web/Program.cs @@ -99,7 +99,12 @@ app.UseEndpoints(endpoints => pattern: "{controller=Home}/{action=Index}/{id?}"); endpoints.MapHub("/stocks"); }); - +// 添加以下代码以确保响应是UTF-8编码 +app.Use(async (context, next) => +{ + context.Response.ContentType = "text/html; charset=utf-8"; + await next.Invoke(); +}); app.UseWtmContext(); // Configure the HTTP request pipeline. diff --git a/HHWMS.Web/Properties/launchSettings.json b/HHWMS.Web/Properties/launchSettings.json index f5eff02..3682a7e 100644 --- a/HHWMS.Web/Properties/launchSettings.json +++ b/HHWMS.Web/Properties/launchSettings.json @@ -18,7 +18,7 @@ }, "HHWMS.Web": { "commandName": "Project", - "launchBrowser": true, + "launchBrowser": false, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" diff --git a/HHWMS.Web/Views/Home/Index.cshtml b/HHWMS.Web/Views/Home/Index.cshtml index 92f48a8..ffce289 100644 --- a/HHWMS.Web/Views/Home/Index.cshtml +++ b/HHWMS.Web/Views/Home/Index.cshtml @@ -19,10 +19,11 @@ }); } +/* // 存储定时器ID var timerId = setInterval(function() { // 你的代码逻辑 isTokenExpired(); }, 10000); // 每10000毫秒执行一次 - + */ \ No newline at end of file diff --git a/HHWMS.Web/appsettings.json b/HHWMS.Web/appsettings.json index d3f6eb2..2cf5e05 100644 --- a/HHWMS.Web/appsettings.json +++ b/HHWMS.Web/appsettings.json @@ -104,12 +104,6 @@ "LoginPath": "/Login/Login" }, "Domains": { - "github": { - "Address": "https://api.github.com" - }, - "github2": { - "Address": "https://api.github.com" - }, "WCS": { "Address": "http://10.18.97.205:1111/api/WcsWebApi/" }