callm 2 недель назад
Родитель
Сommit
69c701009a

+ 2 - 2
UAS_MES_HYSX/FunctionCode/Packing/Packing_PackageCollectionYS.cs

@@ -364,7 +364,7 @@ namespace UAS_MES_NEW.Packing
                                 //如果勾选了自动生成箱号,在封箱或者首次
                                 if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == "" || pa_status.Text == "0"))
                                 {
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCodeYS("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
                                     if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                                     {
                                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已生成,不允许重复使用\n", Color.Red, sn_code);
@@ -472,7 +472,7 @@ namespace UAS_MES_NEW.Packing
                                     pa_outboxcode.Text = "";
                                     pa_status.Text = "0";
                                     BaseUtil.CleanDGVData(PackageDetail);
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCodeYS("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
                                     if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                                     {
                                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已生成,不允许重复使用\n", Color.Red, sn_code);

+ 5 - 1
UAS_MES_HYSX/PublicMethod/HttpServer.cs

@@ -1038,6 +1038,8 @@ namespace UAS_MES_NEW.PublicMethod
         public static async void SendBoxDataYS(string iBox)
         {
             DataTable dt = (DataTable)dh.ExecuteSql("select ma_custpo,ma_custpodetno,ZD_BIG_BOX_NO,pr_code,PRODUCT_MODE,ms_makecode,po_sn from makeserial left join product on ms_prodcode=pr_code left join make on ma_code=ms_makecode left join zte_order on ma_custpo=batch_no left join ztedata on ZD_DEV_EN_NO=ms_sncode and zd_makecode=ms_makecode where ms_outboxcode ='" + iBox + "' and zd_type='BOX' order by ms_id desc", "select");
+            string username = "WST_HYSX";
+            string password = "c5e^4{RSt}";
             var root = new RootObjectYS
             {
                 nub = iBox,
@@ -1062,6 +1064,9 @@ namespace UAS_MES_NEW.PublicMethod
 
             using (var client = new HttpClient(httpClientHandler))
             {
+                var authString = $"{username}:{password}";
+                var base64Auth = Convert.ToBase64String(Encoding.UTF8.GetBytes(authString));
+                client.DefaultRequestHeaders.Authorization =new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", base64Auth);
                 StringBuilder sbText = new StringBuilder();
                 string json = JsonConvert.SerializeObject(root, Formatting.Indented);
                 var content = new StringContent(json, Encoding.UTF8, "application/json");
@@ -1079,7 +1084,6 @@ namespace UAS_MES_NEW.PublicMethod
                         {
                             dh.ExecuteSql("update packagedetail set pd_issuccess=-1 where pd_outboxcode='" + iBox + "'", "update");
                             dh.ExecuteSql("update package set pa_issuccess=-1 where pa_outboxcode='" + iBox + "'", "update");
-                            //MessageBox.Show(ZD_BIG_BOX_NO + "上传星云成功");
                         }
                         else
                         {

+ 8 - 0
UAS_MES_HYSX/PublicMethod/LogicHandler.cs

@@ -1280,6 +1280,14 @@ namespace UAS_MES_NEW.PublicMethod
             return param[4];
         }
 
+        public static string GetOutBoxCodeYS(string Caller, string iMakeCode, string iProdCode, string iUserCode)
+        {
+            string BoxCode = "";
+            string[] param = new string[] { Caller, iMakeCode, iProdCode, iUserCode, BoxCode };
+            dh.CallProcedure("SP_GETPACKORPALLETCODE_YS", ref param);
+            return param[4];
+        }
+
         public static string GetOutBoxCodeYLF(string Caller, string iMakeCode, string iProdCode, string iUserCode)
         {
             string BoxCode = "";