using AngleSharp.Common;
using Masuit.Tools;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common;
using WIDESEA_Common.MES;
using WIDESEA_Common.MES.Request;
using WIDESEA_Core;
using WIDESEA_Core.Const;
using WIDESEA_Core.Helper;
using WIDESEAWCS_BasicInfoService;
using WIDESEAWCS_Model.Models;
namespace WIDESEA_StoragIntegrationServices
{
///
/// 车身绑定工单(焊装直通涂装)
///
public partial class MESService
{
public WebResponseContent pullLock(object jsondata)
{
WebResponseContent content = new WebResponseContent();
try
{
if (string.IsNullOrEmpty(jsondata.ToString())) throw new Exception("请求参数为空");
var result = JsonConvert.DeserializeObject(jsondata.ToString());
foreach (var item in result.data)
{
if (!string.IsNullOrEmpty(item.pvi))
{
var carInfo = _palletStockInfoRepository.QueryFirst(x => x.PVI == item.pvi && x.pbMaterial == item.pbMaterial);
if (carInfo == null)
{
throw new Exception("未知车身");
}
}
var carinfo = _palletStockInfoRepository.QueryData(x => x.pbMaterial == item.pbMaterial).OrderBy(x => x.CreateDate);
}
LogFactory.GetLog("MES拉动锁车").Info(true, $"\r\r--------------------------------------");
LogFactory.GetLog("MES拉动锁车").Info(true, jsondata.ToJsonString());
return content;
}
catch (Exception ex)
{
return content.Error(ex.Message);
}
}
}
}