物料类型下拉
This commit is contained in:
parent
6ea2d596f4
commit
f7313f37f2
@ -23,7 +23,7 @@ namespace MDM.Controllers.Material
|
||||
/// <summary>
|
||||
/// 物料清单
|
||||
/// </summary>
|
||||
[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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<MaterialType>()
|
||||
.Select(it => new
|
||||
{
|
||||
Value = it.Code, // 下拉框的取值(如选中时传递的Id)
|
||||
Label = it.Name // 下拉框的显示文本(如物料类型名称)
|
||||
})
|
||||
.ToList(); // 执行查询并转为列表
|
||||
|
||||
// 2. 返回成功结果,包含下拉列表数据
|
||||
return ApiResult.Success(materialTypeList);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ApiResult.Error($"无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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库是实例的名称
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user