diff --git a/AMESCoreStudio.Web/Controllers/QRSController.cs b/AMESCoreStudio.Web/Controllers/QRSController.cs
index 0751ab63..d36e57e4 100644
--- a/AMESCoreStudio.Web/Controllers/QRSController.cs
+++ b/AMESCoreStudio.Web/Controllers/QRSController.cs
@@ -1501,8 +1501,16 @@ namespace AMESCoreStudio.Web.Controllers
string kp_name = jp[i].Name.Replace("kP_", "");
if (kp_name.IndexOf("_") > 0)
{
- int idx = kp_name.IndexOf("_");
- kpDataList = kpDataList + "
" + kp_name.Substring(0, idx) + " | ";
+ if (kp_name.StartsWith("MB") && kp_name.IndexOf("MAC") > 0)
+ {
+
+ kpDataList = kpDataList + " " + kp_name + " | ";
+ }
+ else
+ {
+ int idx = kp_name.IndexOf("_");
+ kpDataList = kpDataList + " " + kp_name.Substring(0, idx) + " | ";
+ }
}
else
{
diff --git a/AMESCoreStudio.WebApi/AMESCoreStudio.WebApi.csproj b/AMESCoreStudio.WebApi/AMESCoreStudio.WebApi.csproj
index 4716d647..bcfbce75 100644
--- a/AMESCoreStudio.WebApi/AMESCoreStudio.WebApi.csproj
+++ b/AMESCoreStudio.WebApi/AMESCoreStudio.WebApi.csproj
@@ -32,6 +32,7 @@
+
all
diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs
index 412ddcfe..adeb0e5c 100644
--- a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs
+++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs
@@ -470,20 +470,24 @@ and b.item_no = '{0}' and a.barcode_no = '{1}'", kp_no, barcode_no);
dtBarcode.AcceptChanges();
- if (kp_no == "MB")
+ try
{
- ESUNContext _esun_context = new ESUNContext();
-
- //读取MAC
- DbConnection esun_conn = _esun_context.Database.GetDbConnection();
- if (esun_conn.State != ConnectionState.Open)
+ if (kp_no == "MB")
{
- await esun_conn.OpenAsync();
- }
+ ESUNContext _esun_context = new ESUNContext();
+
+ //读取MAC
+ DbConnection esun_conn = _esun_context.Database.GetDbConnection();
+ if (esun_conn.State != ConnectionState.Open)
+ {
+ await esun_conn.OpenAsync();
+ }
+
+ bool createMacCol = true;
- bool createMacCol = true;
+ part_no = "91000237320038";
- string mac_sql = string.Format(@"select distinct a.工單編號 as mo_id,e.客戶工單編號 as customer_moid,a.工單序號 as product_sn,
+ string mac_sql = string.Format(@"select distinct a.工單編號 as mo_id,e.客戶工單編號 as customer_moid,a.工單序號 as product_sn,
case substring(f.avalue_kp_typeid, 1, 3) when 'MAC' then isnull(z.item_prefix,'')+b.SUB_ITEM_SN else b.SUB_ITEM_SN end as part_barcode,
f.avalue_kp_typeid as class,c.material_id,d.r_stn as routeid,'' as workerid,rtrim(g.sn_date) + ' ' + rtrim(g.sn_time) as create_date
from or_sn_story a
@@ -498,44 +502,46 @@ and b.item_no = '{0}' and a.barcode_no = '{1}'", kp_no, barcode_no);
AND a.工單序號 = '{0}'
AND c.material_id LIKE 'MAC%'", part_no);
- using (var esun_cmd = esun_conn.CreateCommand())
- {
- esun_cmd.CommandText = mac_sql;
-
- using (var esun_reader = await esun_cmd.ExecuteReaderAsync())
+ using (var esun_cmd = esun_conn.CreateCommand())
{
- if (esun_reader.HasRows)
+ esun_cmd.CommandText = mac_sql;
+
+ using (var esun_reader = await esun_cmd.ExecuteReaderAsync())
{
- List esun_list = new List();
- DataTable esun_table = new DataTable();
+ if (esun_reader.HasRows)
+ {
+ List esun_list = new List();
+ DataTable esun_table = new DataTable();
- esun_table = DataReaderToDataTable(esun_reader);
+ esun_table = DataReaderToDataTable(esun_reader);
- if (esun_table.Rows.Count > 0)
- {
- if (createMacCol)
+ if (esun_table.Rows.Count > 0)
{
- for (int m = 0; m < esun_table.Rows.Count; m++)
+ if (createMacCol)
{
- dtBarcode.Columns.Add("KP_MB" + k.ToString() + "_MAC" + (m + 1).ToString());
+ for (int m = 0; m < esun_table.Rows.Count; m++)
+ {
+ dtBarcode.Columns.Add("KP_MB" + (k + 1).ToString() + "_MAC" + (m + 1).ToString());
+ }
+ dtBarcode.AcceptChanges();
+ createMacCol = false;
}
- dtBarcode.AcceptChanges();
- createMacCol = false;
- }
- string mac = "";
- for (int m = 0; m < esun_table.Rows.Count; m++)
- {
- mac = esun_table.Rows[m]["part_barcode"].ToString().Trim();
- dtBarcode.Rows[k]["KP_MB" + k.ToString() + "_MAC" + (m + 1).ToString()] = mac;
- dtBarcode.AcceptChanges();
+ string mac = "";
+ for (int m = 0; m < esun_table.Rows.Count; m++)
+ {
+ mac = esun_table.Rows[m]["part_barcode"].ToString().Trim();
+ dtBarcode.Rows[k]["KP_MB" + (k + 1).ToString() + "_MAC" + (m + 1).ToString()] = mac;
+ dtBarcode.AcceptChanges();
+ }
}
}
}
}
- }
+ }
}
+ catch { }
}
dtBarcode.AcceptChanges();
}
diff --git a/AMESCoreStudio.WebApi/appsettings.json b/AMESCoreStudio.WebApi/appsettings.json
index 2512ee5b..1e1d4cbc 100644
--- a/AMESCoreStudio.WebApi/appsettings.json
+++ b/AMESCoreStudio.WebApi/appsettings.json
@@ -8,7 +8,7 @@
},
"ConnectionStrings": {
"AMESContext2": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=gdb)));User Id=JHAMES;Password=AMES666;",
- "ESUNContext": "Data Source=.;Initial Catalog=SFIS_ESUN;User Id=sa;Password=20000123;",
+ "ESUNContext": "Data Source=.;Initial Catalog=SFIS_ESUN;User Id=sa;Password=20000123;Encrypt=True;TrustServerCertificate=True;",
"AMESContext": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=61.216.68.18)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=jhdb)));User Id=JHSYS;Password=ASYS666;"
//"AMESContext": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=61.216.68.18)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=jhdb)));User Id=system;Password=admin;"
//"AMESContextO": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=61.216.68.18)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=cpadb)));User Id=JHSYS;Password=ASYS666;"