Compare commits

...

3 Commits

Author SHA1 Message Date
quowingwang
6ea2d596f4 Bom修改 2026-01-15 14:51:20 +08:00
quowingwang
e570e4164b Bom修改 2026-01-15 14:51:04 +08:00
quowingwang
5bf4c28df6 物料Bom 2026-01-15 14:48:48 +08:00
5 changed files with 24 additions and 14 deletions

View File

@ -151,7 +151,7 @@ namespace MDM.Controllers.Material
//TODO 导入excel
[HttpPost("importData")]
[Log(Title = "物料类型导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = true)]
[Log(Title = "BOM导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = true)]
[AllowAnonymous]
public IActionResult ImportData([FromForm(Name = "file")] IFormFile formFile)
{

View File

@ -53,7 +53,7 @@ namespace MDM.Model.Plant.Dto
public string? FunctionGroupName { get; set; }
public int IsReplaceable { get; set; }
public int? IsReplaceable { get; set; }
public string? CreatedBy { get; set; }

View File

@ -156,6 +156,10 @@ namespace MDM.Services.Material
for (int row = 1; row <= sheet.LastRowNum; row++)
{
IRow currentRow = sheet.GetRow(row);
//目前没加物料是否正确校验
if (currentRow != null && currentRow.GetCell(0) != null) // 确保行不为空
{
MaterialBom item = new MaterialBom();
@ -163,26 +167,23 @@ namespace MDM.Services.Material
if (currentRow.GetCell(0) != null && currentRow.GetCell(0).CellType == CellType.String)
item.InvCode = currentRow.GetCell(0).ToString();
//母件名称
if (currentRow.GetCell(1) != null && currentRow.GetCell(1).CellType == CellType.String)
item.InvName = currentRow.GetCell(1).ToString();
//母件名称
if (currentRow.GetCell(1) != null && currentRow.GetCell(1).CellType == CellType.String)
item.InvName = currentRow.GetCell(1).ToString();
//子件编码
if (currentRow.GetCell(1) != null && currentRow.GetCell(1).CellType == CellType.String)
item.SubInvCode = currentRow.GetCell(1).ToString();
if (currentRow.GetCell(2) != null && currentRow.GetCell(2).CellType == CellType.String)
item.SubInvCode = currentRow.GetCell(2).ToString();
//子件名称
if (currentRow.GetCell(1) != null && currentRow.GetCell(1).CellType == CellType.String)
item.SubInvName = currentRow.GetCell(1).ToString();
if (currentRow.GetCell(3) != null && currentRow.GetCell(3).CellType == CellType.String)
item.SubInvName = currentRow.GetCell(3).ToString();
//使用数量
if (currentRow.GetCell(1) != null && currentRow.GetCell(1).CellType == CellType.String)
item.Iusequantity = currentRow.GetCell(1).ToString();
if (currentRow.GetCell(4) != null && currentRow.GetCell(4).CellType == CellType.String)
item.Iusequantity = currentRow.GetCell(4).ToString();
//BOM版本号
if (currentRow.GetCell(1) != null && currentRow.GetCell(1).CellType == CellType.String)
item.BOMVersion = currentRow.GetCell(1).ToString();
if (currentRow.GetCell(5) != null && currentRow.GetCell(5).CellType == CellType.String)
item.BOMVersion = currentRow.GetCell(5).ToString();
materialBoms.Add(item);

View File

@ -31,7 +31,7 @@ namespace MDM.Services.Material
.AndIF(!string.IsNullOrEmpty(parm.Name),it=>it.Name.Contains(parm.Name))
.AndIF(!string.IsNullOrEmpty(parm.Code),it=>it.Code.Contains(parm.Code))
.AndIF(!string.IsNullOrEmpty(parm.ParentCode),it=>it.ParentCode.Contains(parm.ParentCode))
.AndIF(parm.Status!=null,it=>it.Status==parm.Status)
//.AndIF(parm.Status!=null,it=>it.Status==parm.Status)
;
var response = Queryable()

View File

@ -2,7 +2,12 @@
"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 = 3PgSql = 4
"ConfigId": "0", //
"IsAutoCloseConnection": true
@ -14,7 +19,11 @@
//{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
}