using Aborlen.Model;
|
|
using FrameWork.Log;
|
|
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
|
|
{
|
|
/// <summary>
|
|
/// 允许保存
|
|
/// </summary>
|
|
/// <param name="stationCode"></param>
|
|
/// <param name="value"></param>
|
|
/// <param name="triggerTime"></param>
|
|
public void AllowReadDate(string stationCode, object value, DateTime triggerTime)
|
|
{
|
|
try
|
|
{
|
|
|
|
if (Convert.ToByte(value) == 1)
|
|
{
|
|
//读取质量数据
|
|
|
|
//判断合格标志 是否存在不合格、
|
|
|
|
|
|
|
|
string sql = $"update Deploy_Data set ";
|
|
|
|
foreach (var qualityTag in QualityOpcTagInfos)
|
|
{
|
|
if (qualityTag.ColName.Length > 0)
|
|
{
|
|
sql = sql + $" {qualityTag.ColName}='{ Read(qualityTag.TagId, triggerTime).ToString() }' ,";
|
|
}
|
|
}
|
|
sql = sql.Remove(sql.Length - 1, 1);
|
|
sql = sql + $",op90_time='{DateTime.Now}' where tuopan_id='{Read(2180, triggerTime)}'and process_state=1 and plan_id='{PresentOrder.plan_id}'";
|
|
SqlSugarAdo.ExecuteCommand(sql);
|
|
|
|
//回写保存完成
|
|
Write(1120, (byte)1);
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.WriteLog(LogHelper.GetMethodInfo(), ex);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|