diff --git a/MDM/Controllers/Material/MaterialListController.cs b/MDM/Controllers/Material/MaterialListController.cs index 55307ab..ee38df3 100644 --- a/MDM/Controllers/Material/MaterialListController.cs +++ b/MDM/Controllers/Material/MaterialListController.cs @@ -23,7 +23,7 @@ namespace MDM.Controllers.Material /// /// 物料清单 /// - [Verify] + [AllowAnonymous] [Route("MasterDataManagement/Material/MaterialList")] public class MaterialListController : BaseController { @@ -117,7 +117,7 @@ namespace MDM.Controllers.Material //TODO 导出模板 [HttpGet("importTemplate")] - [Log(Title = "物料类型模板", BusinessType = BusinessType.EXPORT, IsSaveRequestData = true, IsSaveResponseData = false)] + [Log(Title = "物料清单模板", BusinessType = BusinessType.EXPORT, IsSaveRequestData = true, IsSaveResponseData = false)] [AllowAnonymous] public IActionResult ImportTemplateExcel() { @@ -132,7 +132,7 @@ namespace MDM.Controllers.Material //TODO 导入excel [HttpPost("importData")] - [Log(Title = "物料类型导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = true)] + [Log(Title = "物料清单导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = true)] [AllowAnonymous] public IActionResult ImportData([FromForm(Name = "file")] IFormFile formFile) { @@ -148,7 +148,7 @@ namespace MDM.Controllers.Material //TODO 导出excel [HttpGet("exportData")] - [Log(Title = "物料类型导出", BusinessType = BusinessType.EXPORT, IsSaveRequestData = true, IsSaveResponseData = false)] + [Log(Title = "物料清单导出", BusinessType = BusinessType.EXPORT, IsSaveRequestData = true, IsSaveResponseData = false)] [AllowAnonymous] public IActionResult ExportData() { @@ -164,6 +164,13 @@ namespace MDM.Controllers.Material } + [HttpGet("getMaterialTypePullDown")] + public ApiResult GetMaterialTypePullDown() + { + var response = _MaterialListService.GetMaterialTypePullDown(); + + return response; + } diff --git a/MDM/Services/Material/IService/IMaterialListService.cs b/MDM/Services/Material/IService/IMaterialListService.cs index 33f4eb1..68ec92f 100644 --- a/MDM/Services/Material/IService/IMaterialListService.cs +++ b/MDM/Services/Material/IService/IMaterialListService.cs @@ -1,3 +1,4 @@ +using Infrastructure.Model; using MDM.Model; using MDM.Model.Material; using MDM.Model.Material.Dto; @@ -22,6 +23,6 @@ namespace MDM.Services.IMaterialService byte[] ExportData(); - + ApiResult GetMaterialTypePullDown(); } } diff --git a/MDM/Services/Material/MaterialListService.cs b/MDM/Services/Material/MaterialListService.cs index 889606a..f0c64b9 100644 --- a/MDM/Services/Material/MaterialListService.cs +++ b/MDM/Services/Material/MaterialListService.cs @@ -1,5 +1,6 @@ using Infrastructure; using Infrastructure.Attribute; +using Infrastructure.Model; using MDM.Model; using MDM.Model.Material; using MDM.Model.Material.Dto; @@ -283,6 +284,25 @@ namespace MDM.Services.Material } + public ApiResult GetMaterialTypePullDown() + { + try + { + var materialTypeList = Context.Queryable() + .Select(it => new + { + Value = it.Code, // 下拉框的取值(如选中时传递的Id) + Label = it.Name // 下拉框的显示文本(如物料类型名称) + }) + .ToList(); // 执行查询并转为列表 + // 2. 返回成功结果,包含下拉列表数据 + return ApiResult.Success(materialTypeList); + } + catch (Exception ex) + { + return ApiResult.Error($"无数据"); + } + } } } \ No newline at end of file diff --git a/RIZO.Admin.WebApi/appsettings.Development.json b/RIZO.Admin.WebApi/appsettings.Development.json index 35ce4f9..2dd0cfe 100644 --- a/RIZO.Admin.WebApi/appsettings.Development.json +++ b/RIZO.Admin.WebApi/appsettings.Development.json @@ -2,12 +2,8 @@ "dbConfigs": [ { //"Conn": "Data Source=139.224.232.211;User ID=root;Password=RIZOtech123;Initial Catalog=ay2509055-guiyang-fluorescence-lmes;Port=3308;", -<<<<<<< HEAD //"Conn": "Data Source=118.25.48.201;User ID=root;Password=123456;Initial Catalog=valeo_line_mes;Port=3306;", "Conn": "Data Source=127.0.0.1;User ID=root;Password=123456;Initial Catalog=valeo_lmes;Port=3306;", -======= - "Conn": "Data Source=43.142.238.124;User ID=root;Password=mysql_3AMPxs;Initial Catalog=valeo_lmes;Port=3308;", ->>>>>>> e273bf9761971202b3d866d374265a0f342d2a6f "DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4 "ConfigId": "0", //多租户唯一标识 "IsAutoCloseConnection": true @@ -19,11 +15,7 @@ //代码生成连接字符串,注意{dbName}为固定格式,不要填写数据库名 //"Conn": "Data Source=139.224.232.211;User ID=root;Password=RIZOtech123;Initial Catalog={dbName};Port=3308;", //"Conn": "Data Source=192.168.1.48;User ID=root;Password=123456;Initial Catalog={dbName};Port=3306;", -<<<<<<< HEAD "Conn": "Data Source=127.0.0.1;User ID=root;Password=123456;Initial Catalog={dbName};Port=3306;", -======= - "Conn": "Data Source=43.142.238.124;User ID=root;Password=mysql_3AMPxs;Initial Catalog=valeo_lmes;Port=3308;", ->>>>>>> e273bf9761971202b3d866d374265a0f342d2a6f "IsAutoCloseConnection": true, "DbName": "valeo_lmes" //代码生成默认连接数据库,Oracle库是实例的名称 }