Compare commits
3 Commits
e273bf9761
...
6ea2d596f4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ea2d596f4 | ||
|
|
e570e4164b | ||
|
|
5bf4c28df6 |
@ -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)
|
||||
{
|
||||
|
||||
@ -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; }
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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 = 3,PgSql = 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库是实例的名称
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user