using AngleSharp.Dom;
|
using Mapster;
|
using Masuit.Tools;
|
using SqlSugar;
|
using System.Collections.Generic;
|
using System.Drawing.Printing;
|
using System.Linq.Expressions;
|
using WIDESEA.Common;
|
using WIDESEA_Common;
|
using WIDESEA_Core;
|
|
namespace WIDESEA_StorageBasicService;
|
|
public class Dt_CheckResultService : ServiceBase<Dt_CheckResult, IDt_CheckResultRepository>, IDt_CheckResultService
|
{
|
public Dt_CheckResultService(IDt_CheckResultRepository BaseDal) : base(BaseDal)
|
{
|
}
|
|
public static string ZY_CheckResultInterface = "http://172.21.1.117/barcode/Webservice/WebService_ZY/Service_EQP.asmx";
|
|
public WebResponseContent HandUploadData(int id)
|
{
|
WebResponseContent content = new WebResponseContent();
|
try
|
{
|
Dt_CheckResult checkResult = BaseDal.QueryFirst(x => x.ID == id);
|
if (checkResult != null)
|
{
|
string ipaddress = ZY_CheckResultInterface + "/ReportToSCE";
|
|
var dic = checkResult.ToDictionary();
|
dic.Remove("ID");
|
dic.Remove("IsUploadMES");
|
|
RequestReportToSCE_ZY Info = new RequestReportToSCE_ZY { s_eqptno = "CL", s_source = JsonConvert.SerializeObject(dic) };
|
|
var infos = Info.ToDictionary();
|
|
var responStr = HttpsClient.PostXml(ipaddress, infos);
|
|
Basic_ZY result = XMLSerializationTool.DeserializeXmlToObject<Basic_ZY>(responStr);
|
|
if (result.FLAG != "S") throw new Exception($"上传信息失败:智粤接口返回失败:{result.ERROR}");
|
|
checkResult.IsUploadMES = true;
|
if (BaseDal.UpdateData(checkResult))
|
{
|
content.OK();
|
}
|
else
|
{
|
content.Error();
|
}
|
}
|
return content;
|
}
|
catch (Exception ex)
|
{
|
return content.Error(ex.Message);
|
}
|
}
|
}
|