You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

52 lines
1.5 KiB

using Aborlen.Model;
using FrameWork.Log;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkStationBase;
namespace Aborlen.WorkStation
{
public partial class WorkStation09 : StationBase
{
public void PalletNum(string stationCode, object value, DateTime triggerTime)
{
try
{
LogHelper.WriteLog(stationCode + "到位托盘号" + Convert.ToInt32(value));
if (Convert.ToByte(value) != 0)
{
//托盘到达,更新条码验证规则 查询产品型号
//查询订单
var deploydata = Deploy_Data.Query().Where(p => p.tuopan_id == Convert.ToInt32(value) && p.process_state == 1).OrderBy(p => p.Id, SqlSugar.OrderByType.Desc);
if (deploydata.Count() > 0)
{
PresentOrder = ProductOrder.Query().Where(p => p.plan_id == deploydata.First().plan_id).First();
}
else
{
PresentOrder = ProductOrder.Query().OrderBy(p => p.id, OrderByType.Desc).First();
}
ProductTypeCode = Convert.ToInt32(PresentOrder.product_id);
}
}
catch (Exception ex)
{
LogHelper.WriteLog(LogHelper.GetMethodInfo(), ex);
}
}
}
}