using Aborlen.Model;
|
|
using FrameWork.Log;
|
|
using Monitor.FrameWork;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using WorkStationBase;
|
|
|
|
namespace Aborlen.WorkStation
|
|
{
|
|
public partial class WorkStation04 : StationBase
|
|
{
|
|
|
|
|
|
|
|
public override void ViewInit()
|
|
{
|
|
try
|
|
{
|
|
//查询在线数量
|
|
|
|
//获取订单信息
|
|
View_OP40.PalletCode = PalletCode;
|
|
View_OP40.PlanStartTime = PresentOrder.set_time;
|
|
View_OP40.ProductTypeCode = PresentOrder.product_id ;
|
|
View_OP40.ProductType = PresentOrder.product_name;
|
|
View_OP40.OkNum = PresentOrder.ok_account;
|
|
View_OP40.Barcodes_OP30 = Barcodes_OP30;
|
|
View_OP40.StationCode = ProductType_Op30;
|
|
View_OP40.CycleTime = PalletCode_Op30;
|
|
|
|
View_OP40.NokNum = ProductAccount_Op30;
|
|
View_OP40.OrderNum = OrderNum_OP30;
|
|
View_OP40.PlanNum = PlanCount_Op30;
|
|
View_OP40.OkNum = Deploy_Data.Query().Where(p => p.plan_id == PresentOrder.plan_id && p.op40_time != null).Count();
|
|
// Op20View.ProductCode = OnLineCount.ToString();
|
|
//Op40View.CycleTime = CycleTime;
|
|
|
|
//查询工步信息
|
|
|
|
List<WorkStepInfo> stepInfos = WorkStepInfo.Query(). Where(p => p.StationCode == StationInfo.StationCode&&p.PieceTypeCode== ProductTypeCode).ToList();
|
|
View_OP40.StepList.Clear();
|
|
foreach (var item in stepInfos)
|
|
{
|
|
WorkStepClass workStepClass = new WorkStepClass();
|
|
workStepClass.Id = item.SerialId;
|
|
workStepClass.StepId = item.PlcStepId;
|
|
workStepClass.StepContent = item.StepContent;
|
|
workStepClass.TechRequirement = item.TechRequirement;
|
|
workStepClass.PictureName = item.PictureName;
|
|
workStepClass.GifPosition_X = item.GifPosition_X;
|
|
workStepClass.GifPosition_Y = item.GifPosition_Y;
|
|
View_OP40.StepList.Add(workStepClass);
|
|
|
|
|
|
|
|
}
|
|
|
|
//查询条码信息 判断当前产品是否需要扫码
|
|
|
|
|
|
|
|
View_OP40.Barcodes.Clear();
|
|
|
|
|
|
if (PresentOrder.ecu_enable == 1)
|
|
{
|
|
|
|
ProductInfo productInfo = ProductInfo.Query().Where(p => p.product_id == ProductTypeCode).First();
|
|
|
|
BarCodeClass barCodeClass = new BarCodeClass();
|
|
barCodeClass.Id = 1;
|
|
barCodeClass.PartName = "ECU_ID";
|
|
barCodeClass.PartCodeRule = PresentOrder.ecu_rule;
|
|
barCodeClass.PartCount = "1";
|
|
View_OP40.Barcodes.Add(barCodeClass);
|
|
|
|
//向前端发送界面
|
|
}
|
|
|
|
View_OP40.Qualities.Clear();
|
|
|
|
SendMsg.SendMsgToStation(StationInfo.StationCode, null, View_OP40);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.WriteLog(LogHelper.GetMethodInfo(), ex);
|
|
}
|
|
|
|
}
|
|
|
|
public override void OdsStep(string stationCode, object value, DateTime triggerTime)
|
|
{
|
|
int stepNo = Convert.ToInt32(value);
|
|
//查询产品型号
|
|
if (PresentOrder != null)
|
|
{
|
|
|
|
List<WorkStepInfo> workStepInfos = WorkStepInfo.Query().Where(p => p.PlcStepId == stepNo && p.StationCode == stationCode && p.PieceTypeCode == PresentOrder.product_id).ToList();
|
|
|
|
if (workStepInfos.Count > 0)
|
|
{
|
|
View_OP40.StepNo = workStepInfos.First().SerialId - 1;
|
|
SendMsg.SendMsgToStation(stationCode, $"StepList.#{ View_OP40.StepNo}.#selected", true);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|