From f1ec2a5d2706710ef8accc696d91fadd7955ea92 Mon Sep 17 00:00:00 2001 From: zhaoy <137053305@qq.com> Date: Wed, 31 Jan 2024 15:26:04 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AD=97=E5=85=B8=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BPA.SAAS.Manage.Application/System/Services/DictDataService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BPA.SAAS.Manage.Application/System/Services/DictDataService.cs b/BPA.SAAS.Manage.Application/System/Services/DictDataService.cs index 4cf3687..2f9fa39 100644 --- a/BPA.SAAS.Manage.Application/System/Services/DictDataService.cs +++ b/BPA.SAAS.Manage.Application/System/Services/DictDataService.cs @@ -135,7 +135,7 @@ namespace BPA.SAAS.Manage.Application resEntity.Value = dto.Value; resEntity.Code = dto.Code; resEntity.Remark = dto.Remark; - resEntity.Status = (CommonStatus)Enum.ToObject(typeof(CommonStatus), int.Parse(dto.Status)); + //resEntity.Status = (CommonStatus)Enum.ToObject(typeof(CommonStatus), int.Parse(dto.Status)); var res =await _db.Updateable(resEntity).ExecuteCommandAsync(); return res > 0; } From c1a499c5ea40c2ba778bc065a7a80530be885c5c Mon Sep 17 00:00:00 2001 From: zhaoy <137053305@qq.com> Date: Wed, 31 Jan 2024 15:41:24 +0800 Subject: [PATCH 2/3] z --- .../System/Services/MenuService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BPA.SAAS.Manage.Application/System/Services/MenuService.cs b/BPA.SAAS.Manage.Application/System/Services/MenuService.cs index 883efeb..7abe8f4 100644 --- a/BPA.SAAS.Manage.Application/System/Services/MenuService.cs +++ b/BPA.SAAS.Manage.Application/System/Services/MenuService.cs @@ -131,10 +131,10 @@ namespace BPA.SAAS.Manage.Application.System.Services public async Task Add(MenuDtoInput input) { var dicttypes = _db.Queryable().Where(a => a.Code == input.Code).ToList(); - //if (dicttypes.Count() > 0) - //{ - // throw Oops.Oh("编码已存在"); - //} + if (dicttypes.Count() > 0) + { + throw Oops.Oh("编码已存在"); + } if (input.Name.Length > 20) { throw Oops.Oh("菜单名称过长"); From 8c06cf86443f2de26ae665bd65151b9f9f4f0cd9 Mon Sep 17 00:00:00 2001 From: zhaoy <137053305@qq.com> Date: Wed, 31 Jan 2024 18:20:47 +0800 Subject: [PATCH 3/3] xiugai bug --- .../Device/Services/ProductService.cs | 5 ++++- .../Org/Dtos/Organize/OrgOutput.cs | 1 + .../Org/Services/CompanyService.cs | 14 +++++++------- .../System/Services/MenuService.cs | 2 +- BPA.SAAS.Manage.Web.Entry/appsettings.json | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/BPA.SAAS.Manage.Application/Device/Services/ProductService.cs b/BPA.SAAS.Manage.Application/Device/Services/ProductService.cs index bb26cdc..5849608 100644 --- a/BPA.SAAS.Manage.Application/Device/Services/ProductService.cs +++ b/BPA.SAAS.Manage.Application/Device/Services/ProductService.cs @@ -61,6 +61,8 @@ namespace BPA.SAAS.Manage.Application.Device.Services public async Task AddProduct(ProductBaseDto inputDto) { var count=_db.Queryable().Count(); + var check=_db.Queryable().Where(x => x.Name == inputDto.Name || x.Code == inputDto.Code).Any(); + if (check) throw Oops.Oh("产品名称和标识不能重复"); var res = await _db.Insertable(new BPA_Product { Name = inputDto.Name, @@ -91,7 +93,8 @@ namespace BPA.SAAS.Manage.Application.Device.Services public async Task UpdateProduct(ProductBaseDto inputDto) { var data = await _db.Queryable().Where(x => x.Id == inputDto.Id).FirstAsync(); - + var check = _db.Queryable().Where(x => x.Name == inputDto.Name || x.Code == inputDto.Code).Any(); + if (check) throw Oops.Oh("产品名称和标识不能重复"); if (data != null) { var res = _db.Updateable() diff --git a/BPA.SAAS.Manage.Application/Org/Dtos/Organize/OrgOutput.cs b/BPA.SAAS.Manage.Application/Org/Dtos/Organize/OrgOutput.cs index 1a34bf9..46a5a9c 100644 --- a/BPA.SAAS.Manage.Application/Org/Dtos/Organize/OrgOutput.cs +++ b/BPA.SAAS.Manage.Application/Org/Dtos/Organize/OrgOutput.cs @@ -47,5 +47,6 @@ namespace BPA.SAAS.Manage.Application.Org.Dtos.Organize /// public string GroupId { get; set; } public DateTime CreateAt { get; set; } + public int Sort { get; set; } } } diff --git a/BPA.SAAS.Manage.Application/Org/Services/CompanyService.cs b/BPA.SAAS.Manage.Application/Org/Services/CompanyService.cs index 824647b..fe494d9 100644 --- a/BPA.SAAS.Manage.Application/Org/Services/CompanyService.cs +++ b/BPA.SAAS.Manage.Application/Org/Services/CompanyService.cs @@ -32,16 +32,16 @@ namespace BPA.SAAS.Manage.Application.Org.Services public async Task CompanyPage(CompanyDtoPageInput input) { RefAsync total = 0; - var data =await _db.Queryable((a, b) => new JoinQueryInfos(JoinType.Inner, a.Id == b.GroupId)) - .Where((a, b) => a.IsDeleted == 0) - .WhereIF(!input.Name.IsNullOrEmpty(), (a, b) => a.Name.Contains(input.Name)) - .WhereIF(!input.AdminName.IsNullOrEmpty(), (a, b) => a.AdminName.Contains(input.AdminName)) - .WhereIF(!input.Email.IsNullOrEmpty(), (a, b) => a.Email.Contains(input.Email)) + var data =await _db.Queryable() + .Where((a) => a.IsDeleted == 0) + .WhereIF(!input.Name.IsNullOrEmpty(), (a) => a.Name.Contains(input.Name)) + .WhereIF(!input.AdminName.IsNullOrEmpty(), (a) => a.AdminName.Contains(input.AdminName)) + .WhereIF(!input.Email.IsNullOrEmpty(), (a) => a.Email.Contains(input.Email)) .Filter(null, true) - .Select((a, b) => new CompanyDtoInput + .Select((a) => new CompanyDtoInput { Id = a.Id.SelectAll(), - SysRoleId = b.Id + SysRoleId =SqlFunc.Subqueryable< BPA_Roles>().Where(x=>x.GroupId == a.Id).Select(x => x.Id), }) .OrderBy(a => a.CreateAt, OrderByType.Desc) .ToPageListAsync(input.Current, input.PageSize, total); diff --git a/BPA.SAAS.Manage.Application/System/Services/MenuService.cs b/BPA.SAAS.Manage.Application/System/Services/MenuService.cs index 7abe8f4..48aadf4 100644 --- a/BPA.SAAS.Manage.Application/System/Services/MenuService.cs +++ b/BPA.SAAS.Manage.Application/System/Services/MenuService.cs @@ -324,7 +324,7 @@ namespace BPA.SAAS.Manage.Application.System.Services } else { - var AllMenus = _db.Queryable().Where(t => (t.Type.Contains(type) || t.Type.Contains("3")) && t.IsAdmin == 0).OrderBy(t => t.Sort).ToList(); + var AllMenus = _db.Queryable().Where(t => t.IsAdmin == 0).OrderBy(t => t.Sort).ToList(); var data = AllMenus.Where((t => t.Pid == null || t.Pid == "")).Select(t => new MenuTreeOutput { Key = t.Id, diff --git a/BPA.SAAS.Manage.Web.Entry/appsettings.json b/BPA.SAAS.Manage.Web.Entry/appsettings.json index e88ddbe..3be042f 100644 --- a/BPA.SAAS.Manage.Web.Entry/appsettings.json +++ b/BPA.SAAS.Manage.Web.Entry/appsettings.json @@ -10,7 +10,7 @@ "AllowedHosts": "*", "ConnectionConfigs": [ { - "ConnectionString": "server=10.2.1.21;Database=bpa_kitchen_kitchenmanage;Uid=root;Pwd=cygadmin;Allow Zero Datetime=True;Convert Zero Datetime=True;", + "ConnectionString": "server=10.2.1.21;Database=bpa_kitchen_kitchenbasemanage;Uid=root;Pwd=cygadmin;Allow Zero Datetime=True;Convert Zero Datetime=True;", "DbType": "Mysql", "IsAutoCloseConnection": true }