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.
 

64 lines
1.7 KiB

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 WorkStation10 : 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 + $",op100_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);
}
}
}
}