using Newtonsoft.Json.Serialization;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.APIEnum;
using WIDESEA_Core.Helper;
using WIDESEA_Core;
using WIDESEA_DTO;
using WIDESEA_DTO.MES;
using WIDESEA_Model.Models;
namespace WIDESEA_TaskInfoService
{
public partial class TaskService
{
static object lock_solder = new object();
public MesResponseContent SolderMaskOutNotice()
{
//锁
lock (lock_solder)
{
MesResponseContent responseContent = new MesResponseContent();
try
{
}
catch (Exception ex)
{
responseContent.Error(ex.Message);
}
return responseContent;
}
}
///
/// 防焊立库入库后调用MES接口获取批次信息
///
///
///
public MesSolderModel? GetProductByLot(string LotNo)
{
WebResponseContent content = new WebResponseContent();
try
{
Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMS_MES_GetProductByLot.ToString());
string requestApi = apiInfo.ApiAddress + "?lotNo=" + LotNo;
string response = HttpMesHelper.Post(requestApi);
MesResponseContent mesResponseContent = response.DeserializeObject();
//调用接口
if (mesResponseContent.BSucc == true)
{
MesSolderModel? mesSolder= mesResponseContent.Content.ToString()?.DeserializeObject();
return mesSolder;
}
else
{
throw new Exception(mesResponseContent.StrMsg);
}
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
}
}