|
|
@@ -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
|
|
|
{
|