张陶陈 发表于 2023-5-7 14:19:57

abp(net core)+easyui+efcore实现仓储管理系统——供应商管理升级之下(六十

abp(net core)+easyui+efcore实现仓储管理系统目录abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一)abp(net core)+easyui+efcore实现仓储管理系统——解决方案介绍(二)abp(net core)+easyui+efcore实现仓储管理系统——领域层创建实体(三) abp(net core)+easyui+efcore实现仓储管理系统——定义仓储并实现 (四)abp(net core)+easyui+efcore实现仓储管理系统——创建应用服务(五)abp(net core)+easyui+efcore实现仓储管理系统——使用 WEBAPI实现CURD (十一)abp(net core)+easyui+efcore实现仓储管理系统——EasyUI之货物管理一 (十九)abp(net core)+easyui+efcore实现仓储管理系统——ABP WebAPI与EasyUI结合增删改查之一(二十七)abp(net core)+easyui+efcore实现仓储管理系统——入库管理之一(三十七)abp(net core)+easyui+efcore实现仓储管理系统——出库管理之一(四十九)abp(net core)+easyui+efcore实现仓储管理系统——ABP升级7.3上(五十八)       承接上文(abp(net core)+easyui+efcore实现仓储管理系统——供应商管理升级之上(六十三))我们对供应商管理这个模块进行升级,并对升级过程中涉及到一些问题进行解决。 9.在Visual Studio 2022中按F5运行应用程序。在浏览器将呈现登录页面,然后输入管理员用户名进行登录。浏览器跳转到首页面。
10.在主界面的菜单中,选择“Business->供应商管理”菜单项,浏览器中呈现一个供应商信息列表页面,css起作用了,样式好看了。如下图。
 
11然后点击供应商列表页面中的新增(Add)按钮,填写内容,然后点击“保存”按钮。如下图。

 
12. 在“Create New Supplier”页面中我们输入完信息之后,点击“Save”按钮。应用程序报了一个错误。如下图。

13.Supplier的增删改查,我们是调用的WebApi来实现保存到数据库与查询数据的操作,那么问题就可能出在WebAPI这一个项目中。在Visual Studio 2022的解决方案资源管理器中,选中“ABP.TPLMS.Web.Host”项目,然后单击鼠标右键,在弹出菜单中选中“设为启动项目”。按F5运行应用程序,程序报错。
14. 在Visual Studio 2022的解决方案资源管理器中,“ABP.TPLMS.Web.Host”项目的App_Data\Log目录下找到log.txt文件,这是一个日志文件。在文件中我找到如下,错误信息。
AspNetCore.Server.IIS.Core.IISHttpServer - Connection ID "18230571335350747201", <br>Request ID "40000042-000a-fd00-b63f-84710c7967bb": An unhandled exception was thrown by the application.
Microsoft.AspNetCore.Routing.Matching.AmbiguousMatchException: The request matched multiple endpoints. Matches:
ABP.TPLMS.Suppliers.SupplierAppService.CreateAsync (ABP.TPLMS.Application)

ABP.TPLMS.Suppliers.SupplierAppService.Create (ABP.TPLMS.Application)

   at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ReportAmbiguity(CandidateState[] candidateState)
   at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ProcessFinalCandidates<br>(HttpContext httpContext, CandidateState[] candidateState)
   at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.Select(HttpContext httpContext,<br> CandidateState[] candidateState)
   at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.MatchAsync(HttpContext httpContext)

   at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)

   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)15. 在Visual Studio 2022的解决方案资源管理器中,“ABP.TPLMS.Applicationt”项目的Suppliers目录下找到SupplierAppService.cs文件。在文件中有两个Create方法,代码如下: using Abp.Application.Services;
using Abp.Domain.Repositories;
using ABP.TPLMS.Entitys;
using ABP.TPLMS.Suppliers.Dto;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ABP.TPLMS.Suppliers
{
   public class SupplierAppService :AsyncCrudAppService<Supplier, SupplierDto, int,<br> PagedSupplierResultRequestDto, CreateUpdateSupplierDto, CreateUpdateSupplierDto>,<br>ISupplierAppService   
    {
      public SupplierAppService(IRepository<Supplier, int> repository)
            : base(repository)
    {            
    }
      public Task<SupplierDto> Create(CreateUpdateSupplierDto input)
      {
            return CreateAsync(input);
      }

      public override Task<SupplierDto> CreateAsync(CreateUpdateSupplierDto input)
      {
            var sin = input;
            return base.CreateAsync(input);
      }
    }

16. 在Visual Studio 2022的解决方案资源管理器中,使用鼠标双击打开 SupplierAppService.cs文件。将Create方法注释。按F5运行应用程序。登录之后,点击“Supplier”目录,我们可以看到供应商列表页面。然后点击供应商列表页面中的Add按钮。
 
17. 在“Create New Supplier”页面中我们输入完信息之后,点击“Save”按钮。数据保存到数据库,应用会刷新供应商列表页面。如下图。

 
 
 

来源:https://www.cnblogs.com/chillsrc/archive/2023/05/07/17379054.html
免责声明:由于采集信息均来自互联网,如果侵犯了您的权益,请联系我们【E-Mail:cb@itdo.tech】 我们会及时删除侵权内容,谢谢合作!
页: [1]
查看完整版本: abp(net core)+easyui+efcore实现仓储管理系统——供应商管理升级之下(六十