callm 1 сар өмнө
parent
commit
19a0ee1b87

+ 15 - 11
UAS_MES_HYSX/PublicMethod/HttpServer.cs

@@ -158,11 +158,13 @@ namespace UAS_MES_NEW.PublicMethod
         public static void SendBoxData(string iBox)
         {
             string sn = dh.getFieldDataByCondition("packagedetail", "replace(wm_concat(pd_barcode),',','-')", "pd_outboxcode='" + iBox + "'").ToString();
-            DataTable dt = (DataTable)dh.ExecuteSql("select pr_custmachinetype from makeserial left join product on ms_prodcode=pr_code where ms_outboxcode ='" + iBox + "' order by ms_id desc", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select pr_custmachinetype,ms_makecode from makeserial left join product on ms_prodcode=pr_code where ms_outboxcode ='" + iBox + "' order by ms_id desc", "select");
             string pr_custmachinetype = "";
+            string makecode = "";
             if (dt.Rows.Count > 0)
             {
                 pr_custmachinetype = dt.Rows[0]["pr_custmachinetype"].ToString();
+                makecode = dt.Rows[0]["ms_makecode"].ToString();
             }
             var root = new RootObject
             {
@@ -170,7 +172,7 @@ namespace UAS_MES_NEW.PublicMethod
                 ProductMainClass = "固网_CPE",
                 ProductMediumClass = "CPE",
                 ProductSubClass = pr_custmachinetype,
-                Task = "2025070006",
+                Task = makecode,
                 ProcessType = "生产过程",
                 UserId = User.UserName,
                 BindList = new List<BindItem>()
@@ -224,22 +226,24 @@ namespace UAS_MES_NEW.PublicMethod
         public static void GetOutBoxInfo(string iBox)
         {
             dynamic obj = new ExpandoObject();
-            obj.request = "Q_wai_xiang";
-            obj.packing_num = 20;
-            obj.User = "mes";
-            obj.po_sn = "250908001001";
-            obj.password = "258456";
-            obj.tool_name = "zte";
-            obj.noType = 0;
-
             var expandoDict = obj as IDictionary<string, object>;
-            DataTable dt = (DataTable)dh.ExecuteSql("select pd_barcode from packagedetail where pd_outboxcode='" + iBox + "'", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select pd_barcode,pd_makecode from packagedetail where pd_outboxcode='" + iBox + "'", "select");
+            string makecode = "";
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 string enNoKey = $"en_no{i}";
                 string enNoValue = dt.Rows[i]["pd_barcode"].ToString();
                 expandoDict[enNoKey] = enNoValue;
+                makecode = dt.Rows[i]["pd_makecode"].ToString();
             }
+            obj.request = "Q_wai_xiang";
+            obj.packing_num = 20;
+            obj.User = "mes";
+            obj.po_sn = makecode;
+            obj.password = "258456";
+            obj.tool_name = "zte";
+            obj.noType = 0;
+
 
             string json = JsonConvert.SerializeObject(obj, Formatting.Indented);
             string returnstr = SendData(json);