分档类型变更
This commit is contained in:
@@ -108,6 +108,54 @@ namespace JinYuan.ControlCenters
|
||||
|
||||
#endregion
|
||||
|
||||
#region 11、安全装置状态
|
||||
/// <summary>
|
||||
/// 安全装置状态
|
||||
/// </summary>
|
||||
/// <param name="strStatus"></param>
|
||||
/// <returns></returns>
|
||||
public static string SafeEqptAlarm(string StartDate, List<SafeEqptCode> safeEqptCodeLists = null)
|
||||
{
|
||||
var nowTime = DateTime.Now;
|
||||
string resJson = "";
|
||||
string josnTxtMsg = string.Empty;
|
||||
string Date = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
|
||||
try
|
||||
{
|
||||
//SafeEqptStatusParam statusParam = new SafeEqptStatusParam();
|
||||
//statusParam.siteCode = CommonMethods.mesConfig.siteCode;
|
||||
//statusParam.lineCode = CommonMethods.mesConfig.lineCode;
|
||||
//statusParam.equipNum = CommonMethods.mesConfig.equipNum;
|
||||
//statusParam.userName = CommonMethods.mesConfig.mesUserName;
|
||||
//statusParam.seatId = "";
|
||||
//statusParam.recordDate = StartDate;
|
||||
//statusParam.uploadTime = Date;
|
||||
//statusParam.safeEqptCodeList = safeEqptCodeLists;
|
||||
//string SendJosn = JsonConvert.SerializeObject(statusParam);
|
||||
|
||||
var sw = new Stopwatch();
|
||||
|
||||
for (int i = 0; i < safeEqptCodeLists.Count; i++)
|
||||
{
|
||||
string SendJosn = JsonConvert.SerializeObject(safeEqptCodeLists[i]);
|
||||
sw.Start();
|
||||
resJson = MESApiHelper.HttpPostJsonAPI(CommonMethods.mesConfig.SafeEqptStatusMesUrl, SendJosn);
|
||||
sw.Stop();
|
||||
josnTxtMsg = $"{nowTime.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用MES安全设备运行状态接口:{CommonMethods.mesConfig.SafeEqptStatusMesUrl},请求数据为:{SendJosn},\n{nowTime.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resJson}";
|
||||
TxtHelper.WriteTxt($@"{CommonMethods.strMesLogspath}\{nowTime.ToString("yyyyMMdd")}\设备运行状态\{nowTime.ToString("HH")}.txt", josnTxtMsg);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LoggerHelp.WriteEX("调用MES安全设备运行状态接口", ex);
|
||||
}
|
||||
return resJson;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user