diff --git a/Admin.Core.Api/Admin.Core.Api.xml b/Admin.Core.Api/Admin.Core.Api.xml
index 543a23c..3ba0122 100644
--- a/Admin.Core.Api/Admin.Core.Api.xml
+++ b/Admin.Core.Api/Admin.Core.Api.xml
@@ -325,6 +325,12 @@
+
+
+ 小料同步MES物料信息
+
+
+
溶剂称量 PDA接口
diff --git a/Admin.Core.Api/Controllers/Business/MaterialController.cs b/Admin.Core.Api/Controllers/Business/MaterialController.cs
index 948847a..b936c58 100644
--- a/Admin.Core.Api/Controllers/Business/MaterialController.cs
+++ b/Admin.Core.Api/Controllers/Business/MaterialController.cs
@@ -11,6 +11,7 @@ using System.Linq;
using S71500.Impl;
using Admin.Core.Model.ViewModels;
using log4net;
+using Npgsql.TypeHandlers;
namespace Admin.Core.Api
{
@@ -240,5 +241,27 @@ namespace Admin.Core.Api
return message;
}
#endregion
+
+ ///
+ /// 小料同步MES物料信息
+ ///
+ ///
+ [HttpGet]
+ public async Task> xlDownLoadMateralInfo(string materialCode, string materialName)
+ {
+ try
+ {
+ var result = await _xl_materialService.xlInsertMaterial(materialCode, materialName);
+ if (result)
+ {
+ return Success(result);
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ return Failed("执行失败!");
+ }
}
}
\ No newline at end of file
diff --git a/Admin.Core.Api/Properties/launchSettings.json b/Admin.Core.Api/Properties/launchSettings.json
index 70fe2ba..692d901 100644
--- a/Admin.Core.Api/Properties/launchSettings.json
+++ b/Admin.Core.Api/Properties/launchSettings.json
@@ -24,8 +24,8 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": "true",
- //"applicationUrl": "http://localhost:5001;http://localhost:5000"
- "applicationUrl": "http://192.168.137.1:5001;http://192.168.137.1:5000"
+ "applicationUrl": "http://localhost:5001;http://localhost:5000"
+ //"applicationUrl": "http://192.168.137.1:5001;http://192.168.137.1:5000"
}
}
diff --git a/Admin.Core.IService/IService_New/Ixl_materialServices.cs b/Admin.Core.IService/IService_New/Ixl_materialServices.cs
index b5755e2..9c70dfc 100644
--- a/Admin.Core.IService/IService_New/Ixl_materialServices.cs
+++ b/Admin.Core.IService/IService_New/Ixl_materialServices.cs
@@ -2,6 +2,7 @@
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.ViewModels;
+using System;
using System.Threading.Tasks;
namespace Admin.Core.IService
@@ -29,5 +30,7 @@ namespace Admin.Core.IService
Task BindBarrel(string code);
Task> MaterialVerification(string barCode);
+
+ Task xlInsertMaterial(string materialCode, string materialName);
}
}
\ No newline at end of file
diff --git a/Admin.Core.Service/Service_New/xl_materialServices.cs b/Admin.Core.Service/Service_New/xl_materialServices.cs
index 3dc53e7..86f4626 100644
--- a/Admin.Core.Service/Service_New/xl_materialServices.cs
+++ b/Admin.Core.Service/Service_New/xl_materialServices.cs
@@ -684,5 +684,48 @@ namespace Admin.Core.Service
}
#endregion
+ ///
+ /// 小料上位机同步插入物料信息
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public async Task xlInsertMaterial(string materialCode, string materialName)
+ {
+ try
+ {
+ xl_material xl_m = new xl_material()
+ {
+ ID = Guid.NewGuid().ToString("N"),
+ Material_code = materialCode,
+ Material_name = materialName,
+ CreateDateTime = DateTime.Now,
+ Remark = null,
+ Batch_number = null,
+ Barcode1 = null,
+ Barcode2 = null,
+ Barcode3 = null,
+ IsEnable = "是"
+ };
+
+ var result = await _xl_materialRepository.Add(xl_m);
+ if (result == 1)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ catch (Exception ex)
+ {
+ return false;
+ }
+ }
+
+
}
}
\ No newline at end of file