3389 lines
171 KiB
C#
3389 lines
171 KiB
C#
using JinYuan.Helper;
|
||
using JinYuan.MES.Enums;
|
||
using JinYuan.MES.Models;
|
||
using JinYuan.Models;
|
||
using Newtonsoft.Json;
|
||
using Newtonsoft.Json.Linq;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Diagnostics;
|
||
using System.Linq;
|
||
using System.Reflection.Emit;
|
||
using System.Runtime.Remoting.Messaging;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace JinYuan.MES
|
||
{
|
||
public class MesDataProcess : IMes
|
||
{
|
||
#region 1、登录验证
|
||
/// <summary>
|
||
/// 登录MES验证
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="passWord"></param>
|
||
/// <param name="resJson"></param>
|
||
/// <returns></returns>
|
||
public bool LoginEnyity(string url, string siteCode, string lineCode, string equipNum, string userName, string passWord, string UserCardID, ref string Mesage)
|
||
{
|
||
bool res = false;
|
||
string resJson = "";
|
||
try
|
||
{
|
||
var webApi = new MESApiHelper();
|
||
var model = new LoginEnyity
|
||
{
|
||
siteCode = siteCode,
|
||
lineCode = lineCode,
|
||
equipNum = equipNum,
|
||
userName = userName,
|
||
passWord = passWord,
|
||
userCardID= UserCardID
|
||
};
|
||
|
||
var nowDate = DateTime.Now;
|
||
var postData = JsonConvert.SerializeObject(model);
|
||
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postData);
|
||
sw.Stop();
|
||
|
||
if (string.IsNullOrEmpty(result))
|
||
{
|
||
string resData = result == "" ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用员工权限校验接口:{url},请求数据为:{postData},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{result}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\员工权限校验\{nowDate.ToString("HH")}.txt", resJson);
|
||
return res;
|
||
}
|
||
var res1 = ReturnMesMsg<MesResponse>(result);
|
||
if (res1 == null || !res1.success || !string.IsNullOrEmpty(res1.code) || !string.IsNullOrEmpty(res1.message))
|
||
{
|
||
var resData = res1 == null ? "" : JsonConvert.SerializeObject(res1);
|
||
Mesage = res1.message;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用员工权限校验接口:{url},请求数据为:{postData}\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\员工权限校验\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
else
|
||
{
|
||
res = true;
|
||
Mesage = res1.message;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用员工权限校验接口:{url},请求数据为:{postData}\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{JsonConvert.SerializeObject(result)}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\员工权限校验\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"调用员工权限校验接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("调用员工权限校验接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
#endregion
|
||
|
||
#region 2、获取MES参数请求
|
||
/// <summary>
|
||
/// 获取MES参数请求
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="materialCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="resJson"></param>
|
||
/// <returns></returns>
|
||
public ParamReturnData GetParamSetRequest(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, ref string Mesage)
|
||
{
|
||
string resJson = "";
|
||
try
|
||
{
|
||
var model = new
|
||
{
|
||
siteCode = siteCode,
|
||
lineCode = lineCode,
|
||
equipNum = equipNum,
|
||
materialCode = materialCode,
|
||
userName = userName
|
||
};
|
||
|
||
var nowDate = DateTime.Now;
|
||
var postcontent = JsonConvert.SerializeObject(model);
|
||
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
if (string.IsNullOrEmpty(result))
|
||
{
|
||
string resData = result == "" ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用设备参数设定值请求接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\设备参数设定值请求\{nowDate.ToString("HH")}.txt", resJson);
|
||
return null;
|
||
}
|
||
|
||
var res1 = ReturnMesMsg<ParamReturnData>(result);
|
||
if (res1.success)
|
||
{
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用设备参数设定值请求接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{result}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\设备参数设定值请求\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
else
|
||
{
|
||
var resData = res1 == null ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用设备参数设定值请求接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\设备参数设定值请求\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
return res1;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"设备参数设定值请求接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("设备参数设定值请求接口", ex);
|
||
}
|
||
|
||
return null;
|
||
}
|
||
#endregion
|
||
|
||
#region 3、参数变更请求
|
||
/// <summary>
|
||
/// 参数变更请求
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="materialCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="paramChangeItems"></param>
|
||
/// <param name="Mesage"></param>
|
||
/// <returns></returns>
|
||
public bool ParamChange(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, List<TagListItem> paramChangeItems, ref string Mesage)
|
||
{
|
||
bool res = false;
|
||
string resJson = "";
|
||
try
|
||
{
|
||
var model = new ParamChange
|
||
{
|
||
siteCode = siteCode,
|
||
lineCode = lineCode,
|
||
equipNum = equipNum,
|
||
materialCode = materialCode,
|
||
userName = userName,
|
||
changeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
||
tagGroupCode = "",
|
||
tagGroupDescription = "",
|
||
};
|
||
|
||
model.tagList = new List<TagListItem>();
|
||
model.tagList.Add(new TagListItem
|
||
{
|
||
tagCode = "",
|
||
unitBefore = "",
|
||
});
|
||
|
||
var nowDate = DateTime.Now;
|
||
var postcontent = JsonConvert.SerializeObject(model);
|
||
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
|
||
|
||
var resData = result == "" ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用参数设定值变更接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\MesLogs\{nowDate.ToString("yyyyMMdd")}\参数设定值变更\{nowDate.ToString("HH")}.txt", resJson);
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"参数设定值变更接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("参数设定值变更接口", ex);
|
||
}
|
||
|
||
return res;
|
||
|
||
}
|
||
#endregion
|
||
|
||
#region 4、单个上传(只上传卷芯码,不上传托杯码)
|
||
/// <summary>
|
||
/// 单个上传(只上传卷芯码,不上传托杯码)
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="materialCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="BarCode"></param>
|
||
/// <param name="resJson"></param>
|
||
/// <param name="mesResType"></param>
|
||
/// <returns>{"rows":[{"code":null,"success":true,"message":null,"identification":"InsertAt20231218095755934","containerCode":null,"category":null}],"success":true,"total":1}
|
||
/// </returns>
|
||
public bool SingleCellInStation(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, string BarCode, ref string Mesage, ref MesResType mesResType)
|
||
{
|
||
bool res = false;
|
||
string resJson = "";
|
||
mesResType = MesResType.D;//默认为OK EVEDL14L2JECX01
|
||
try
|
||
{
|
||
var webApi = new MESApiHelper();
|
||
var model = new SingleCellInStation
|
||
{
|
||
siteCode = siteCode,
|
||
lineCode = lineCode,
|
||
equipNum = equipNum,
|
||
materialCode = materialCode,
|
||
userName = userName,
|
||
identification = BarCode,
|
||
productType ="OK"
|
||
};
|
||
|
||
|
||
|
||
var nowDate = DateTime.Now;
|
||
var postcontent = JsonConvert.SerializeObject(model);
|
||
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
|
||
long outTime = sw.ElapsedMilliseconds;
|
||
if (outTime > 1000)
|
||
{
|
||
LogHelper.Instance.WriteLog($"钢壳进站PC<=>MES上传耗时:{outTime}ms,钢壳码:{BarCode}", "MESTime");
|
||
}
|
||
|
||
if (string.IsNullOrEmpty(result))
|
||
{
|
||
string resData = result == "" ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品进站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
return res;
|
||
}
|
||
|
||
var res1 = ReturnMesMsg<MesResponseIn>(result);
|
||
if (res1.success)
|
||
{
|
||
res = true;
|
||
GetInMesResType(res1, BarCode, ref Mesage, ref mesResType);
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品进站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{result}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
else
|
||
{
|
||
var resData = res1 == null ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品进站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
|
||
Mesage = "调用进站接口超时或MES无返回信息!";
|
||
mesResType = MesResType.B;
|
||
resJson = $"产品进站信息(组装)接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("产品进站信息(组装)接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
#endregion
|
||
|
||
#region 5、复投单个上传(只上传条码,不上传卷芯码)
|
||
/// <summary>
|
||
/// 复投单个上传(只上传条码,不上传卷芯码)
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="materialCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="BarCode"></param>
|
||
/// <param name="resJson"></param>
|
||
/// <param name="mesResType"></param>
|
||
/// <returns></returns>
|
||
public bool SingleFTCellInStation(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, string BarCode, ref string Mesage, ref MesResType mesResType)
|
||
{
|
||
bool res = false;
|
||
string resJson = "";
|
||
try
|
||
{
|
||
var webApi = new MESApiHelper();
|
||
var model = new ManyCellInStation
|
||
{
|
||
siteCode = siteCode,
|
||
lineCode = lineCode,
|
||
equipNum = equipNum,
|
||
materialCode = materialCode,
|
||
userName = userName,
|
||
};
|
||
|
||
//电芯条码
|
||
model.identificationList = new List<string>();
|
||
model.identificationList.Add(BarCode);
|
||
|
||
|
||
//电芯托杯码
|
||
model.containerCodeList = new List<string>();
|
||
|
||
|
||
var nowDate = DateTime.Now;
|
||
var postcontent = JsonConvert.SerializeObject(model);
|
||
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
|
||
long outTime = sw.ElapsedMilliseconds;
|
||
if (outTime > 1000)
|
||
{
|
||
LogHelper.Instance.WriteLog($"钢壳进站PC<=>MES上传耗时:{outTime}ms,钢壳码:{BarCode}", "MESTime");
|
||
}
|
||
|
||
if (string.IsNullOrEmpty(result))
|
||
{
|
||
string resData = result == "" ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品进站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
return res;
|
||
}
|
||
|
||
var res1 = ReturnMesMsg<MesResponseIn>(result);
|
||
if (res1.success)
|
||
{
|
||
res = true;
|
||
GetInMesResType(res1, BarCode, ref Mesage, ref mesResType);
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品进站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{result}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
else
|
||
{
|
||
var resData = res1 == null ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品进站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"产品进站信息(组装)接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("产品进站信息(组装)接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
#endregion
|
||
|
||
#region 6、多个电池进站
|
||
/// <summary>
|
||
/// 多个电池进站
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="materialCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="listBar"></param>
|
||
/// <param name="MesMessage"></param>
|
||
/// <param name="mesResType"></param>
|
||
/// <returns></returns>
|
||
public bool ManyCellInStation(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, List<string> listBar, ref List<string> MesMessage, ref List<MesResType> mesResType)
|
||
{
|
||
bool res = false;
|
||
string resJson = "";
|
||
MesMessage = GetListString(listBar.Count, "进站失败");
|
||
mesResType = GetMesType(listBar.Count);
|
||
try
|
||
{
|
||
var model = new ManyCellInStation
|
||
{
|
||
siteCode = siteCode,
|
||
lineCode = lineCode,
|
||
equipNum = equipNum,
|
||
materialCode = materialCode,
|
||
userName = userName,
|
||
productType="OK",
|
||
};
|
||
|
||
//电芯条码
|
||
model.identificationList = new List<string>();
|
||
for (int i = 0; i < listBar.Count; i++)
|
||
{
|
||
model.identificationList.Add(listBar[i]);
|
||
}
|
||
|
||
var nowDate = DateTime.Now;
|
||
var postcontent = JsonConvert.SerializeObject(model);
|
||
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
|
||
long outTime = sw.ElapsedMilliseconds;
|
||
if (outTime > 1000)
|
||
{
|
||
LogHelper.Instance.WriteLog($"预焊进站PC<=>MES上传耗时:{outTime}ms,电芯码:{listBar[0]},{listBar[1]},{listBar[2]},{listBar[3]}", "MESTime");
|
||
}
|
||
|
||
if (string.IsNullOrEmpty(result))
|
||
{
|
||
string resData = result == "" ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品进站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
return res;
|
||
}
|
||
|
||
var res1 = ReturnMesMsg<MesResponseIn>(result);
|
||
bool temple = false;
|
||
if (res1!=null)
|
||
{
|
||
temple=true;
|
||
}
|
||
if (temple)
|
||
{
|
||
res = true;
|
||
GetInMesResType(res1, listBar, ref MesMessage, ref mesResType);
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品进站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{result}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
else
|
||
{
|
||
var resData = res1 == null ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品进站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"产品进站信息(组装)接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("产品进站信息(组装)接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
#endregion
|
||
|
||
#region 7、单个电池出站
|
||
/// <summary>
|
||
/// 单个电池出站
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="materialCode"></param>
|
||
/// <param name="m"></param>
|
||
/// <param name="type"></param>
|
||
/// <param name="mesage"></param>
|
||
/// <param name="mesResType"></param>
|
||
/// <returns></returns>
|
||
public bool SingleCellOutStation(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, BGearEntity m, int type, string materialLotCodeLocator, ref string mesage, ref MesResType mesResType)
|
||
{
|
||
bool res = false;
|
||
string resJson = "";
|
||
string[] ngCode = new string[1];
|
||
ngCode[0] = "";
|
||
try
|
||
{
|
||
JArray jaContainerCode = new JArray(); //containerCodeAndIdentificationList
|
||
|
||
JArray jaMaterialLotCodeList = new JArray(); //materialLotCodeList
|
||
JObject jo4 = new JObject();
|
||
jo4.Add("materialLotCode", "");
|
||
jo4.Add("materialLotCodeLocator", materialLotCodeLocator);
|
||
jaMaterialLotCodeList.Add(jo4);
|
||
|
||
|
||
JArray jaIdentiftyList = new JArray();//identiftyList
|
||
JObject jo3 = new JObject();
|
||
jo3.Add("identification", m.CSBYHCODEA); //卷心码
|
||
jo3.Add("qualityStatus", m.Result);
|
||
jo3.Add("qrCode", ""); //
|
||
jo3.Add("ngMessage", m.Remark);
|
||
jo3.Add("materialLotList", jaMaterialLotCodeList);
|
||
jaIdentiftyList.Add(jo3);
|
||
|
||
|
||
JObject jo2 = new JObject();
|
||
jo2.Add("containerCode", "");//托杯码
|
||
jo2.Add("identiftyList", jaIdentiftyList);
|
||
jaContainerCode.Add(jo2);
|
||
|
||
|
||
JObject jo1 = new JObject();
|
||
jo1.Add("siteCode", siteCode);
|
||
jo1.Add("lineCode", lineCode);
|
||
jo1.Add("equipNum", equipNum);
|
||
jo1.Add("userName", userName);
|
||
jo1.Add("productType", "");
|
||
jo1.Add("completeQty", "");
|
||
jo1.Add("type", 1); //追溯标识替换
|
||
jo1.Add("materialCode", materialCode);
|
||
jo1.Add("containerCodeAndIdentificationList", jaContainerCode);
|
||
|
||
|
||
|
||
var nowDate = DateTime.Now;
|
||
var postcontent = JsonConvert.SerializeObject(jo1);
|
||
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
|
||
|
||
long outTime = sw.ElapsedMilliseconds;
|
||
if (outTime > 1000)
|
||
{
|
||
LogHelper.Instance.WriteLog($"钢壳进出站PC<=>MES上传耗时:{outTime}ms,钢壳码:{m.CSBYHCODEA}", "MESTime");
|
||
}
|
||
|
||
if (string.IsNullOrEmpty(result))
|
||
{
|
||
string resData = result == "" ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品出站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品出站信息\{nowDate.ToString("HH")}.txt", resJson);
|
||
return res;
|
||
}
|
||
|
||
var res1 = ReturnMesMsg<MesResponseOut>(result);
|
||
if (res1.success)
|
||
{
|
||
res = true;
|
||
GetOutMesResType(res1, m.CSBYHCODEA, ref mesage, ref mesResType);
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品出站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{result}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品出站信息\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
else
|
||
{
|
||
var resData = res1 == null ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品出站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品出站信息\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"产品出站信息(组装)接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("产品出站信息(组装)接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
#endregion
|
||
|
||
#region 8、进出站一体模式(单电池)
|
||
/// <summary>
|
||
/// 进出站一体模式(单电池)
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="materialCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="m"></param>
|
||
/// <param name="type"></param>
|
||
/// <param name="materialLotCodeLocator"></param>
|
||
/// <param name="mesage"></param>
|
||
/// <param name="mesResType"></param>
|
||
/// <returns></returns>
|
||
public bool SingleCellInAndOutStation(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, BGearEntity m, int type, string materialLotCodeLocator, ref string mesage, ref MesResType mesResType)
|
||
{
|
||
bool res = false;
|
||
string resJson = "";
|
||
string[] ngCode = new string[1];
|
||
ngCode[0] = "";
|
||
try
|
||
{
|
||
JArray jaContainerCode = new JArray(); //containerCodeAndIdentificationList
|
||
|
||
JArray jaMaterialLotCodeList = new JArray(); //materialLotCodeList
|
||
JObject jo4 = new JObject();
|
||
jo4.Add("materialLotCode", "");
|
||
jo4.Add("materialLotCodeLocator", materialLotCodeLocator);
|
||
jaMaterialLotCodeList.Add(jo4);
|
||
|
||
|
||
JArray jaIdentiftyList = new JArray();//identiftyList
|
||
JObject jo3 = new JObject();
|
||
jo3.Add("identification", m.CSBYHCODEA); //卷心码
|
||
jo3.Add("qualityStatus", m.Result);
|
||
jo3.Add("qrCode", ""); //
|
||
jo3.Add("ngMessage", m.Remark);
|
||
jo3.Add("materialLotList", jaMaterialLotCodeList);
|
||
jaIdentiftyList.Add(jo3);
|
||
|
||
|
||
JObject jo2 = new JObject();
|
||
jo2.Add("containerCode", "");//托杯码
|
||
jo2.Add("identiftyList", jaIdentiftyList);
|
||
jaContainerCode.Add(jo2);
|
||
|
||
|
||
JObject jo1 = new JObject();
|
||
jo1.Add("siteCode", siteCode);
|
||
jo1.Add("lineCode", lineCode);
|
||
jo1.Add("equipNum", equipNum);
|
||
jo1.Add("userName", userName);
|
||
jo1.Add("productType", "");
|
||
jo1.Add("completeQty", "");
|
||
jo1.Add("type", 1); //追溯标识替换
|
||
jo1.Add("materialCode", materialCode);
|
||
jo1.Add("containerCodeAndIdentificationList", jaContainerCode);
|
||
|
||
|
||
|
||
var nowDate = DateTime.Now;
|
||
var postcontent = JsonConvert.SerializeObject(jo1);
|
||
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
|
||
|
||
long outTime = sw.ElapsedMilliseconds;
|
||
if (outTime > 1000)
|
||
{
|
||
LogHelper.Instance.WriteLog($"钢壳进出站PC<=>MES上传耗时:{outTime}ms,钢壳码:{m.CSBYHCODEA}", "MESTime");
|
||
}
|
||
|
||
if (string.IsNullOrEmpty(result))
|
||
{
|
||
string resData = result == "" ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用进出站一体信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进出站一体信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
return res;
|
||
}
|
||
|
||
var res1 = ReturnMesMsg<MesResponseOut>(result);
|
||
if (res1.success)
|
||
{
|
||
res = true;
|
||
GetOutMesResType(res1, m.CSBYHCODEA, ref mesage, ref mesResType);
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用进出站一体信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{result}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进出站一体信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
else
|
||
{
|
||
var resData = res1 == null ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用进出站一体信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品进出站一体信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"产品进出站一体信息(组装)接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("产品进出站一体信息(组装)接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// 多个电芯上传
|
||
/// </summary>
|
||
/// <param name="m"></param>
|
||
/// <returns></returns>
|
||
public bool OutboundInformations(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, List<BGearEntity> listBar, ref List<string> MesMessage, ref List<MesResType> mesResType)
|
||
{
|
||
//DateTime nowDate = DateTime.Now;
|
||
//string resJson = "";
|
||
//bool res = false;
|
||
//MesMessage = GetListString(listBar.Count, "MES出站失败");
|
||
//mesResType = GetMesType(listBar.Count);
|
||
//try
|
||
//{
|
||
// JArray jaContainerCode = new JArray(); //containerCodeAndIdentificationList
|
||
// foreach (BGearEntity m in listBar)
|
||
// {
|
||
|
||
|
||
// JArray jaMaterialLotCodeList = new JArray(); //materialLotCodeList
|
||
// JObject jo4 = new JObject();
|
||
// jo4.Add("materialLotCode","");
|
||
// jo4.Add("materialLotCodeLocator","");
|
||
// jaMaterialLotCodeList.Add(jo4);
|
||
|
||
|
||
// JArray jaIdentiftyList = new JArray();//identiftyList
|
||
// JObject jo3 = new JObject();
|
||
// jo3.Add("identification", m.BarCode); //电芯码
|
||
// jo3.Add("materialLotList", "");
|
||
// jo3.Add("materialLotCode", "");
|
||
// jo3.Add("materialLotCodeLocator", "");
|
||
// jo3.Add("qualityStatus", m.Result);
|
||
// jo3.Add("qrCode", ""); //
|
||
// jo3.Add("ngCode", m.ngCode);
|
||
// jo3.Add("ngMessage", m.Remark);
|
||
// jo3.Add("materialLotList",jaMaterialLotCodeList);
|
||
// jaIdentiftyList.Add(jo3);
|
||
// }
|
||
|
||
// JObject jo1 = new JObject();
|
||
// jo1.Add("siteCode", siteCode);//工厂代码
|
||
// jo1.Add("lineCode", lineCode);//产线编号
|
||
// jo1.Add("equipNum", equipNum);//设备编号
|
||
// jo1.Add("materialCode", materialCode);//物料编码
|
||
// jo1.Add("userName", userName);//员工账号
|
||
// jo1.Add("productType", "");//产品类型
|
||
// jo1.Add("completeQty", "");//完工数
|
||
// jo1.Add("containerCode", "");//托盘码
|
||
// jo1.Add("type", 1); //追溯标识替换
|
||
|
||
// jo1.Add("containerCodeAndIdentificationList", jaContainerCode);
|
||
|
||
|
||
// var postcontent = JsonConvert.SerializeObject(jo1);
|
||
|
||
bool res = false;
|
||
string resJson = "";
|
||
MesMessage = GetListString(listBar.Count, "出站失败");
|
||
mesResType = GetMesType(listBar.Count);
|
||
try
|
||
{
|
||
var model = new ManyCellOutStation
|
||
{
|
||
siteCode = siteCode,
|
||
lineCode = lineCode,
|
||
equipNum = equipNum,
|
||
materialCode = materialCode,
|
||
userName = userName,
|
||
productType = "OK",
|
||
completeQty = listBar.Count.ToString(),
|
||
containerCode = "",
|
||
type = 1
|
||
};
|
||
|
||
|
||
|
||
|
||
for (int i = 0; i <listBar.Count; i++)
|
||
{
|
||
|
||
model.identiftyList = new List<identiftyList>()
|
||
{
|
||
new identiftyList()
|
||
{
|
||
identification=listBar[i].CSBYHCODEA,
|
||
materialLotList=new List<string>{},
|
||
materialLotCode= "",
|
||
qualityStatus = listBar[i].Result.ToString(),
|
||
qrCode = "",
|
||
ngCode = new List<string>(),
|
||
ngMessage = "",
|
||
}
|
||
};
|
||
//cc.identification = listBar[i].BarCode;
|
||
//cc.materialLotList = GetListString(1, "");
|
||
//cc.materialLotCode = "";
|
||
//cc.materialLotCodeLocator = "";
|
||
//cc.qualityStatus = listBar[i].Result.ToString();
|
||
//cc.qrCode = "";
|
||
//cc.ngCode = GetListString(1, "");
|
||
//cc.
|
||
|
||
//model.containerCodeAndIdentificationList[i].identiftyList.Add(new IdentiftyListItems
|
||
//{
|
||
// identification = listBar[i].BarCode,
|
||
// qualityStatus ="OK" ,
|
||
// qrCode = "",
|
||
// ngMessage = listBar[i].Remark,
|
||
|
||
//});
|
||
//model.containerCodeAndIdentificationList[i].identiftyList[i].materialLotList = new List<MaterialLotListItems>();
|
||
//model.containerCodeAndIdentificationList[i].identiftyList[i].materialLotList.Add(new MaterialLotListItems
|
||
//{
|
||
// materialLotCode = "",
|
||
// materialLotCodeLocator = "",
|
||
//});
|
||
//model.containerCodeAndIdentificationList.Add(cc);
|
||
}
|
||
|
||
|
||
var nowDate = DateTime.Now;
|
||
var postcontent = JsonConvert.SerializeObject(model);
|
||
|
||
var sw = new Stopwatch();
|
||
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
long outTime = sw.ElapsedMilliseconds;
|
||
if (outTime > 1000)
|
||
{
|
||
LogHelper.Instance.WriteLog($"预焊出站PC<=>MES上传耗时:{outTime}ms,电芯码:{listBar[0].CSBYHCODEA},{listBar[1].CSBYHCODEA}", "MESTime");
|
||
}
|
||
|
||
if (string.IsNullOrEmpty(result))
|
||
{
|
||
string resData = result == "" ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品出站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品出站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
return res;
|
||
}
|
||
|
||
var res1 = ReturnMesMsg<MesResponseOut>(result);
|
||
bool temple = false;
|
||
if (res1!=null)
|
||
{
|
||
temple = true;
|
||
}
|
||
|
||
if (temple)
|
||
{
|
||
res = true;
|
||
GetOutMesResType(res1, listBar, ref MesMessage, ref mesResType);
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品出站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{result}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品出站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
else
|
||
{
|
||
var resData = res1 == null ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品出站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品出站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"产品出站信息(组装)接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("产品出站信息(组装)接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
|
||
|
||
//#region 9、多个电池出站
|
||
///// <summary>
|
||
///// 多个电池出站
|
||
///// </summary>
|
||
///// <param name="url"></param>
|
||
///// <param name="siteCode"></param>
|
||
///// <param name="userName"></param>
|
||
///// <param name="equipNum"></param>
|
||
///// <param name="lineCode"></param>
|
||
///// <param name="materialCode"></param>
|
||
///// <param name="listBar"></param>
|
||
///// <param name="type"></param>
|
||
///// <param name="resJson"></param>
|
||
///// <param name="mesResType"></param>
|
||
///// <returns></returns>
|
||
//public bool ManyCellOutStation(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, List<BGearEntity> list, int type, string materialLotCodeLocator, ref List<string> MesMessage, ref List<MesResType> mesResType)
|
||
//{
|
||
// DateTime nowDate = DateTime.Now;
|
||
// string resJson = "";
|
||
// bool res = false;
|
||
// MesMessage = GetListString(list.Count, "MES出站失败");
|
||
// mesResType = GetMesType(list.Count);
|
||
// try
|
||
// {
|
||
// JArray jaContainerCode = new JArray(); //containerCodeAndIdentificationList
|
||
// foreach (BGearEntity m in list)
|
||
// {
|
||
// JArray jaMaterialLotCodeList = new JArray(); //materialLotCodeList
|
||
// JObject jo4 = new JObject();
|
||
// jo4.Add("materialLotCode", "");
|
||
// jo4.Add("materialLotCodeLocator", materialLotCodeLocator);
|
||
// jaMaterialLotCodeList.Add(jo4);
|
||
|
||
|
||
// JArray jaIdentiftyList = new JArray();//identiftyList
|
||
// JObject jo3 = new JObject();
|
||
// jo3.Add("identification", m.BarCode); //电芯码
|
||
// jo3.Add("materialLotList", "");
|
||
// jo3.Add("materialLotCode", "");
|
||
// jo3.Add("materialLotCodeLocator", "");
|
||
// jo3.Add("qualityStatus", m.Result);
|
||
// jo3.Add("qrCode", ""); //
|
||
// jo3.Add("ngCode",m.ngCode);
|
||
// jo3.Add("ngMessage", m.Remark);
|
||
// jo3.Add("materialLotList", jaMaterialLotCodeList);
|
||
// jaIdentiftyList.Add(jo3);
|
||
// }
|
||
|
||
// JObject jo1 = new JObject();
|
||
// jo1.Add("siteCode", siteCode);//工厂代码
|
||
// jo1.Add("lineCode", lineCode);//产线编号
|
||
// jo1.Add("equipNum", equipNum);//设备编号
|
||
// jo1.Add("materialCode", materialCode);//物料编码
|
||
// jo1.Add("userName", userName);//员工账号
|
||
// jo1.Add("productType", "");//产品类型
|
||
// jo1.Add("completeQty", "");//完工数
|
||
// jo1.Add("containerCode", "");//托盘码
|
||
// jo1.Add("type", 1); //追溯标识替换
|
||
|
||
// jo1.Add("containerCodeAndIdentificationList", jaContainerCode);
|
||
|
||
|
||
// var postcontent = JsonConvert.SerializeObject(jo1);
|
||
// var sw = new Stopwatch();
|
||
// sw.Start();
|
||
// string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
// sw.Stop();
|
||
// long outTime = sw.ElapsedMilliseconds;
|
||
// if (outTime > 1000)
|
||
// {
|
||
// LogHelper.Instance.WriteLog($"预焊出站PC<=>MES上传耗时:{outTime}ms,电芯码:{list[0].BarCode},{list[1].BarCode},{list[2].BarCode},{list[3].BarCode},{list[4].BarCode},{list[5].BarCode},{list[6].BarCode},{list[7].BarCode}", "MESTime");
|
||
// }
|
||
|
||
// if (string.IsNullOrEmpty(result))
|
||
// {
|
||
// string resData = result == "" ? "" : result;
|
||
// resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品出站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
// TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品出站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
// return res;
|
||
// }
|
||
|
||
// var res1 = ReturnMesMsg<MesResponseOut>(result);
|
||
// if (res1.success)
|
||
// {
|
||
// res = true;
|
||
// GetOutMesResType(res1, list, ref MesMessage, ref mesResType);
|
||
// resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品出站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{result}";
|
||
// TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品出站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
// }
|
||
// else
|
||
// {
|
||
// var resData = res1 == null ? "" : result;
|
||
// resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品出站信息(组装)接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
// TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品出站信息(组装)\{nowDate.ToString("HH")}.txt", resJson);
|
||
// }
|
||
|
||
// }
|
||
// catch (Exception ex)
|
||
// {
|
||
// resJson = $"产品出站信息(组装)接口发生异常:{ex.Message}";
|
||
// LogHelper.Instance.WriteEX("产品出站信息(组装)接口", ex);
|
||
// }
|
||
|
||
// return res;
|
||
//}
|
||
//#endregion
|
||
|
||
#region 10、 过程数据上传
|
||
/// <summary>
|
||
/// 过程数据上传
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="materialCode"></param>
|
||
/// <param name="unloadType"></param>
|
||
/// <param name="productProcessParam"></param>
|
||
/// <param name="resJson"></param>
|
||
/// <returns></returns>
|
||
/// <exception cref="NotImplementedException"></exception>
|
||
public bool ProductProcessParam(string url, string siteCode, string userName, string equipNum, string lineCode, string materialCode, MesUploadType unloadType, List<ProductProcessParam> productProcessParam, ref string resJson)
|
||
{
|
||
throw new NotImplementedException();
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region 11、结果参数上传
|
||
/// <summary>
|
||
/// 结果参数上传
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="materialCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="m"></param>
|
||
/// <param name="unloadType"></param>
|
||
/// <param name="Mesage"></param>
|
||
/// <returns></returns>
|
||
public bool ProducResultParam(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, BGearEntity m, MesUploadType unloadType, ref string Mesage)
|
||
{
|
||
bool res = false;
|
||
string resJson = "";
|
||
try
|
||
{
|
||
var nowDate = DateTime.Now;
|
||
string sNowDate = nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||
|
||
var model = new ProductResultParameters
|
||
{
|
||
equipNum = equipNum,
|
||
type = unloadType.ToString(),
|
||
payload = ""
|
||
};
|
||
|
||
|
||
switch (unloadType)
|
||
{
|
||
case MesUploadType.DD:
|
||
var payload1 = new Payload1
|
||
{
|
||
siteCode = siteCode,
|
||
lineCode = lineCode,
|
||
userName = userName,
|
||
materialCode = materialCode,
|
||
carCode = "",
|
||
collection = "JS",
|
||
recordDate = sNowDate,
|
||
qty = 1,
|
||
containerCode ="",
|
||
|
||
};
|
||
payload1.identification = new IdentificationListItem
|
||
{
|
||
identification=m.CSBYHCODEA,
|
||
qualityStatus="Y"
|
||
};
|
||
|
||
|
||
payload1.tagDataVOList = new List<TagDataVOListItem>
|
||
{
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CODE_A",
|
||
tagValue = m.listBatCode[0],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包条码"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CODE_B",
|
||
tagValue = m.listBatCode[1],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包条码"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_A_SCANNING_TIME",
|
||
tagValue = m.ScanTime[0],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包扫码时间"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_A_SCANNING_TIME",
|
||
tagValue = m.ScanTime[1],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包扫码时间"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_WEIGHT_NO_A1",
|
||
tagValue = m.list_Data1[0, 0].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包称重1工位号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_WEIGHT_RESULT_A1",
|
||
tagValue = m.list_Data1[0, 1].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包重量1判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="",
|
||
tagValue = m.list_Data1[0, 2].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A环轨编号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_STATION_NO_A",
|
||
tagValue = m.list_Data1[0, 3].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包侧厚工位号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_JUDGE_RESULT_A",
|
||
tagValue = m.list_Data1[0, 4].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包侧厚判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_POLARITY_RESULT_A",
|
||
tagValue = m.list_Data1[0, 5].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包极性检测结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_TOOLNO_A",
|
||
tagValue = m.list_Data1[0, 6].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包治具号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_STATION_NO_A",
|
||
tagValue = m.list_Data1[0, 7].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊接工位号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELD_HEAD_COUNT_A",
|
||
tagValue = m.list_Data1[0, 8].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊头次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELD_BASE_COUNT_A",
|
||
tagValue = m.list_Data1[0, 9].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊座次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_STATION_NO_A",
|
||
tagValue = m.list_Data1[0, 10].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊接工位号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELD_HEAD_COUNT_A",
|
||
tagValue = m.list_Data1[0, 11].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊头次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELD_BASE_COUNT_A",
|
||
tagValue = m.list_Data1[0, 12].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊座次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUTABCUTTERCOUNTA",
|
||
tagValue = m.list_Data1[0, 13].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯铜极耳切刀使用次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_ALTABCUTTERCOUNTA",
|
||
tagValue = m.list_Data1[0, 14].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯铝极耳切刀使用次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUT_ADHESION_JUDGE_RESULT_A",
|
||
tagValue = m.list_Data1[0, 15].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯裁切粘连判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUT_BURR_JUDGE_RESULT_A",
|
||
tagValue = m.list_Data1[0, 16].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯裁切毛刺判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_SOLDER_JUDGE_RESULT_A",
|
||
tagValue = m.list_Data1[0, 17].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包焊印位置判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_FRONT_EAR_CRACKLE_JUDGE_RESULT_A",
|
||
tagValue = m.list_Data1[0, 18].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包正面极耳撕裂判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_BACK_EAR_CRACKLE_JUDGE_RESULT_A",
|
||
tagValue = m.list_Data1[0, 19].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包背面极耳撕裂判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_FRONT_EAR_FLODING_RESULT_A",
|
||
tagValue = m.list_Data1[0, 20].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包正面极耳翻折检测结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_BACK_EAR_FLODING_RESULT_A",
|
||
tagValue = m.list_Data1[0, 21].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包背面极耳翻折检测结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_OUT_STATION_JUDGMENT_RESULT",
|
||
tagValue = m.list_Data1[0, 22].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "出站判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUTABCUTTERNO_A",
|
||
tagValue = m.list_CutNO[0,0].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯铜极耳切刀编号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_ALTABCUTTERNO_A",
|
||
tagValue = m.list_CutNO[0,1].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯铝极耳切刀编号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_PROCESS_NAME",
|
||
tagValue = m.list_Process[0, 0],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "电芯A工序名"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_SCHEDULE",
|
||
tagValue = m.list_Process[0, 1],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "电芯A班次"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_IN_STATION_TIME",
|
||
tagValue = m.list_Process[0, 2],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "电芯A进站时间"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_OUT_STATION_TIME",
|
||
tagValue = m.list_Process[0, 3],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "电芯A出站时间"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_ABNORMAL_INFORMATION",
|
||
tagValue = m.list_Process[0, 4],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "电芯A异常反馈信息"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_WEIGHT_A1_MAX_SETTING",
|
||
tagValue = m.list_Data2[0, 0].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包重量1设定值最大值(g)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_WEIGHT_A1_MIN_SETTING",
|
||
tagValue = m.list_Data2[0, 1].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包重量1设定值最小值(g)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_WEIGHT_A1",
|
||
tagValue = m.list_Data2[0, 2].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包重量1(g)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_MAX_SETTING_A",
|
||
tagValue = m.list_Data2[0, 3].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包侧厚压力(Kg)设定最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_MIN_SETTING_A",
|
||
tagValue = m.list_Data2[0, 4].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包侧厚压力(Kg)设定最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_A",
|
||
tagValue = m.list_Data2[0, 5].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包侧厚压力实际值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_SIZE_A",
|
||
tagValue = m.list_Data2[0, 6].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包侧厚尺寸(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_MAX_SIZE_A",
|
||
tagValue = m.list_Data2[0, 7].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包侧厚最大尺寸(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_MIN_SIZE_A",
|
||
tagValue = m.list_Data2[0, 8].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包侧厚最小尺寸(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_PRESSURE_MAX_SETTING",
|
||
tagValue = m.list_Data2[0, 9].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接压力(Psi)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_PRESSURE_MIN_SETTING",
|
||
tagValue = m.list_Data2[0, 10].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接压力(Psi)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_POWER_MAX_SETTING",
|
||
tagValue = m.list_Data2[0, 11].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接功率(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_POWER_MIN_SETTING",
|
||
tagValue = m.list_Data2[0, 12].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接功率(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_ENERGY_MAX_SETTING",
|
||
tagValue = m.list_Data2[0, 13].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接能量(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_ENERGY_MIN_SETTING",
|
||
tagValue = m.list_Data2[0, 14].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接能量(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_AMPLITUDE_MAX_SETTING",
|
||
tagValue = m.list_Data2[0, 15].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接振幅(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_AMPLITUDE_MIN_SETTING",
|
||
tagValue = m.list_Data2[0, 16].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接振幅(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_PRESSURE_A1",
|
||
tagValue = m.list_Data2[0, 17].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接压力(Psi)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_POWER_A1",
|
||
tagValue = m.list_Data2[0, 18].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊接功率(W)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_ENERGY_A1",
|
||
tagValue = m.list_Data2[0, 19].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接能量(J)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_AMPLITUDE_A1",
|
||
tagValue = m.list_Data2[0, 20].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接振幅(%)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_TIME_A1",
|
||
tagValue = m.list_Data2[0, 21].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接时间(ms)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_PRESSURE_A2",
|
||
tagValue = m.list_Data2[0, 22].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接压力(Psi)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_POWER_A2",
|
||
tagValue = m.list_Data2[0, 23].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊接功率A(W)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_ENERGY_A2",
|
||
tagValue = m.list_Data2[0, 24].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接能量(J)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_AMPLITUDE_A2",
|
||
tagValue = m.list_Data2[0, 25].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接振幅(%)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_TIME_A2",
|
||
tagValue = m.list_Data2[0, 26].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接时间(ms)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_PRESSURE_A3",
|
||
tagValue = m.list_Data2[0, 27].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接压力(Psi)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_POWER_A3",
|
||
tagValue = m.list_Data2[0, 28].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊接功率A(W)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_ENERGY_A3",
|
||
tagValue = m.list_Data2[0, 29].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接能量(J)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_AMPLITUDE_A3",
|
||
tagValue = m.list_Data2[0, 30].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接振幅(%)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_TIME_A3",
|
||
tagValue = m.list_Data2[0, 31].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铜焊焊接时间(ms)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_PRESSURE_MAX_SETTING",
|
||
tagValue = m.list_Data2[0, 32].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接压力(Psi)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_PRESSURE_MIN_SETTING",
|
||
tagValue = m.list_Data2[0, 33].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接压力(Psi)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_POWER_MAX_SETTING",
|
||
tagValue = m.list_Data2[0, 34].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接功率(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_POWER_MIN_SETTING",
|
||
tagValue = m.list_Data2[0, 35].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接功率(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_ENERGY_MAX_SETTING",
|
||
tagValue = m.list_Data2[0, 36].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接能量(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_ENERGY_MIN_SETTING",
|
||
tagValue = m.list_Data2[0, 37].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接能量(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_AMPLITUDE_MAX_SETTING",
|
||
tagValue = m.list_Data2[0, 38].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接振幅(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_AMPLITUDE_MIN_SETTING",
|
||
tagValue = m.list_Data2[0, 39].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接振幅(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_PRESSURE_A1",
|
||
tagValue = m.list_Data2[0, 40].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接压力(Psi)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_POWER_A1",
|
||
tagValue = m.list_Data2[0, 41].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊接功率(W)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_ENERGY_A1",
|
||
tagValue = m.list_Data2[0, 42].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接能量(J)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_AMPLITUDE_A1",
|
||
tagValue = m.list_Data2[0, 43].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接振幅(%)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_TIME_A1",
|
||
tagValue = m.list_Data2[0, 44].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接时间(ms)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_PRESSURE_A2",
|
||
tagValue = m.list_Data2[0, 45].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接压力(Psi)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_POWER_A2",
|
||
tagValue = m.list_Data2[0, 46].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊接功率(W)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_ENERGY_A2",
|
||
tagValue = m.list_Data2[0, 47].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接能量(J)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_AMPLITUDE_A2",
|
||
tagValue = m.list_Data2[0, 48].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接振幅(%)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_TIME_A2",
|
||
tagValue = m.list_Data2[0, 49].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接时间(ms)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_PRESSURE_A3",
|
||
tagValue = m.list_Data2[0, 50].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接压力(Psi)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_POWER_A3",
|
||
tagValue = m.list_Data2[0, 51].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊接功率(W)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_ENERGY_A3",
|
||
tagValue = m.list_Data2[0, 52].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接能量(J)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_AMPLITUDE_A3",
|
||
tagValue = m.list_Data2[0, 53].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接振幅(%)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_TIME_A3",
|
||
tagValue = m.list_Data2[0, 54].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包铝焊焊接时间(ms)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUTABLENGTHA",
|
||
tagValue = m.list_Data2[0, 55].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯铜极极耳长度(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUTABWIDTHA",
|
||
tagValue = m.list_Data2[0, 56].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯铜极极耳宽度(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_ALTABLENGTHA",
|
||
tagValue = m.list_Data2[0, 57].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯铝极极耳长度(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_ALTABWIDTHA",
|
||
tagValue = m.list_Data2[0, 58].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯铝极极耳宽度(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUT_ADHESION_RESULT_A",
|
||
tagValue = m.list_Data2[0, 59].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯裁切粘连结果(mm2)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUT_BURR_RESULT_A",
|
||
tagValue = m.list_Data2[0, 60].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A电芯裁切毛刺结果(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_TOP_TO_SOLDER_DISTANCE_A",
|
||
tagValue = m.list_Data2[0, 61].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包顶部到焊印间距(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_SOLDER_TO_EAR_DISTANCE_A",
|
||
tagValue = m.list_Data2[0, 62].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包焊印边缘到极耳边缘间距(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_FRONT_EAR_CRACKLE_RESULT_A",
|
||
tagValue = m.list_Data2[0, 63].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包正面极耳撕裂裂纹检测结果(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_BACK_EAR_CRACKLE_RESULT_A",
|
||
tagValue = m.list_Data2[0, 64].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "A芯包背面极耳撕裂裂纹检测结果(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_WEIGHT_NO_B1",
|
||
tagValue = m.list_Data1[1, 0].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包称重1工位号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_WEIGHT_RESULT_B1",
|
||
tagValue = m.list_Data1[1, 1].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包重量1判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="",
|
||
tagValue = m.list_Data1[1, 2].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B环轨编号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_STATION_NO_B",
|
||
tagValue = m.list_Data1[1, 3].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包侧厚工位号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_JUDGE_RESULT_B",
|
||
tagValue = m.list_Data1[1, 4].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包侧厚判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_POLARITY_RESULT_B",
|
||
tagValue = m.list_Data1[1, 5].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包极性检测结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_TOOLNO_B",
|
||
tagValue = m.list_Data1[1, 6].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包治具号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CU_WELDING_STATION_NO_B",
|
||
tagValue = m.list_Data1[1, 7].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊接工位号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELD_HEAD_COUNT_B",
|
||
tagValue = m.list_Data1[1, 8].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊头次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELD_BASE_COUNT_B",
|
||
tagValue = m.list_Data1[1, 9].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊座次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="AL_WELDING_STATION_NO_B",
|
||
tagValue = m.list_Data1[1, 10].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊接工位号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELD_HEAD_COUNT_B",
|
||
tagValue = m.list_Data1[1, 11].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊头次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELD_BASE_COUNT_B",
|
||
tagValue = m.list_Data1[1, 12].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊座次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUTABCUTTERCOUNTB",
|
||
tagValue = m.list_Data1[1, 13].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯铜极耳切刀使用次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_ALTABCUTTERCOUNTB",
|
||
tagValue = m.list_Data1[1, 14].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯铝极耳切刀使用次数"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUT_ADHESION_JUDGE_RESULT_B",
|
||
tagValue = m.list_Data1[1, 15].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯裁切粘连判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUT_BURR_JUDGE_RESULT_B",
|
||
tagValue = m.list_Data1[1, 16].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯裁切毛刺判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_SOLDER_JUDGE_RESULT_B",
|
||
tagValue = m.list_Data1[1, 17].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包焊印位置判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_FRONT_EAR_CRACKLE_JUDGE_RESULT_B",
|
||
tagValue = m.list_Data1[1, 18].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包正面极耳撕裂判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_BACK_EAR_CRACKLE_JUDGE_RESULT_B",
|
||
tagValue = m.list_Data1[1, 19].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包背面极耳撕裂判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_FRONT_EAR_FLODING_RESULT_B",
|
||
tagValue = m.list_Data1[1, 20].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包正面极耳翻折检测结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_BACK_EAR_FLODING_RESULT_B",
|
||
tagValue = m.list_Data1[1, 21].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包背面极耳翻折检测结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_OUT_STATION_JUDGMENT_RESULT",
|
||
tagValue = m.list_Data1[1, 22].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "出站判定结果"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUTABCUTTERNO_B",
|
||
tagValue = m.list_CutNO[1,0].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯铜极耳切刀编号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_ALTABCUTTERNO_B",
|
||
tagValue = m.list_CutNO[1,1].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯铝极耳切刀编号"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_PROCESS_NAME",
|
||
tagValue = m.list_Process[1, 0],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "电芯B工序名"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_SCHEDULE",
|
||
tagValue = m.list_Process[1, 1],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "电芯B班次"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_IN_STATION_TIME",
|
||
tagValue = m.list_Process[1, 2],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "电芯B进站时间"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_OUT_STATION_TIME",
|
||
tagValue = m.list_Process[1, 3],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "电芯B出站时间"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_ABNORMAL_INFORMATION",
|
||
tagValue = m.list_Process[1, 4],
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "电芯B异常反馈信息"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_WEIGHT_B1_MAX_SETTING",
|
||
tagValue = m.list_Data2[1, 0].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包重量1设定值最大值(g)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_WEIGHT_B1_MIN_SETTING",
|
||
tagValue = m.list_Data2[1, 1].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包重量1设定值最小值(g)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_WEIGHT_B1",
|
||
tagValue = m.list_Data2[1, 2].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包重量1(g)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_MAX_SETTING_B",
|
||
tagValue = m.list_Data2[1, 3].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包侧厚压力(Kg)设定最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_MIN_SETTING_B",
|
||
tagValue = m.list_Data2[1, 4].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包侧厚压力(Kg)设定最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_B",
|
||
tagValue = m.list_Data2[1, 5].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包侧厚压力实际值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_SIZE_B",
|
||
tagValue = m.list_Data2[1, 6].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包侧厚尺寸(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_MAX_SIZE_B",
|
||
tagValue = m.list_Data2[1, 7].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包侧厚最大尺寸(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_THICKNESS_TEST_PRESSURE_MIN_SIZE_B",
|
||
tagValue = m.list_Data2[1, 8].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包侧厚最小尺寸(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_PRESSURE_MAX_SETTING",
|
||
tagValue = m.list_Data2[1, 9].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接压力(Psi)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_PRESSURE_MIN_SETTING",
|
||
tagValue = m.list_Data2[1, 10].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接压力(Psi)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_POWER_MAX_SETTING",
|
||
tagValue = m.list_Data2[1, 11].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接功率(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_POWER_MIN_SETTING",
|
||
tagValue = m.list_Data2[1, 12].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接功率(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_ENERGY_MAX_SETTING",
|
||
tagValue = m.list_Data2[1, 13].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接能量(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_ENERGY_MIN_SETTING",
|
||
tagValue = m.list_Data2[1, 14].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接能量(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_AMPLITUDE_MAX_SETTING",
|
||
tagValue = m.list_Data2[1, 15].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接振幅(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_WELDING_AMPLITUDE_MIN_SETTING",
|
||
tagValue = m.list_Data2[1, 16].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铜焊接振幅(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_PRESSURE_B1",
|
||
tagValue = m.list_Data2[1, 17].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接压力(Psi)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_POWER_B1",
|
||
tagValue = m.list_Data2[1, 18].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊接功率(W)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_ENERGY_B1",
|
||
tagValue = m.list_Data2[1, 19].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接能量(J)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_AMPLITUDE_B1",
|
||
tagValue = m.list_Data2[1, 20].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接振幅(%)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_TIME_B1",
|
||
tagValue = m.list_Data2[1, 21].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接时间(ms)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_PRESSURE_B2",
|
||
tagValue = m.list_Data2[1, 22].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接压力(Psi)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_POWER_B2",
|
||
tagValue = m.list_Data2[1, 23].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊接功率B(W)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_ENERGY_B2",
|
||
tagValue = m.list_Data2[1, 24].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接能量(J)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_AMPLITUDE_B2",
|
||
tagValue = m.list_Data2[1, 25].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接振幅(%)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_TIME_B2",
|
||
tagValue = m.list_Data2[1, 26].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接时间(ms)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_PRESSURE_B3",
|
||
tagValue = m.list_Data2[1, 27].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接压力(Psi)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_POWER_B3",
|
||
tagValue = m.list_Data2[1, 28].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊接功率A(W)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_ENERGY_B3",
|
||
tagValue = m.list_Data2[1, 29].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接能量(J)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_AMPLITUDE_B3",
|
||
tagValue = m.list_Data2[1, 30].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接振幅(%)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CU_TIME_B3",
|
||
tagValue = m.list_Data2[1, 31].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铜焊焊接时间(ms)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_PRESSURE_MAX_SETTING",
|
||
tagValue = m.list_Data2[1, 32].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接压力(Psi)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_PRESSURE_MIN_SETTING",
|
||
tagValue = m.list_Data2[1, 33].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接压力(Psi)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_POWER_MAX_SETTING",
|
||
tagValue = m.list_Data2[1, 34].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接功率(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_POWER_MIN_SETTING",
|
||
tagValue = m.list_Data2[1, 35].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接功率(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_ENERGY_MAX_SETTING",
|
||
tagValue = m.list_Data2[1, 36].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接能量(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_ENERGY_MIN_SETTING",
|
||
tagValue = m.list_Data2[1, 37].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接能量(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_AMPLITUDE_MAX_SETTING",
|
||
tagValue = m.list_Data2[1, 38].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接振幅(%)设定值最大值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_WELDING_AMPLITUDE_MIN_SETTING",
|
||
tagValue = m.list_Data2[1, 39].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "铝焊接振幅(%)设定值最小值"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_PRESSURE_B1",
|
||
tagValue = m.list_Data2[1, 40].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接压力(Psi)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_POWER_B1",
|
||
tagValue = m.list_Data2[1, 41].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊接功率(W)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_ENERGY_B1",
|
||
tagValue = m.list_Data2[1, 42].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接能量(J)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_AMPLITUDE_B1",
|
||
tagValue = m.list_Data2[1, 43].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接振幅(%)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_TIME_B1",
|
||
tagValue = m.list_Data2[1, 44].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接时间(ms)实际值1"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_PRESSURE_B2",
|
||
tagValue = m.list_Data2[1, 45].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接压力(Psi)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_POWER_B2",
|
||
tagValue = m.list_Data2[1, 46].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊接功率(W)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_ENERGY_B2",
|
||
tagValue = m.list_Data2[1, 47].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接能量(J)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_AMPLITUDE_B2",
|
||
tagValue = m.list_Data2[1, 48].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接振幅(%)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_TIME_B2",
|
||
tagValue = m.list_Data2[1, 49].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接时间(ms)实际值2"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_PRESSURE_B3",
|
||
tagValue = m.list_Data2[1, 50].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接压力(Psi)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_POWER_B3",
|
||
tagValue = m.list_Data2[1, 51].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊接功率(W)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_ENERGY_B3",
|
||
tagValue = m.list_Data2[1, 52].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接能量(J)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_AMPLITUDE_B3",
|
||
tagValue = m.list_Data2[1, 53].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接振幅(%)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_AL_TIME_B3",
|
||
tagValue = m.list_Data2[1, 54].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包铝焊焊接时间(ms)实际值3"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUTABLENGTHB",
|
||
tagValue = m.list_Data2[1, 55].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯铜极极耳长度(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUTABWIDTHB",
|
||
tagValue = m.list_Data2[1, 56].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯铜极极耳宽度(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_ALTABLENGTHB",
|
||
tagValue = m.list_Data2[1, 57].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯铝极极耳长度(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_ALTABWIDTHB",
|
||
tagValue = m.list_Data2[1, 58].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯铝极极耳宽度(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUT_ADHESION_RESULT_B",
|
||
tagValue = m.list_Data2[1, 59].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯裁切粘连结果(mm2)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_CUT_BURR_RESULT_B",
|
||
tagValue = m.list_Data2[1, 60].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B电芯裁切毛刺结果(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_TOP_TO_SOLDER_DISTANCE_B",
|
||
tagValue = m.list_Data2[1, 61].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包顶部到焊印间距(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_SOLDER_TO_EAR_DISTANCE_B",
|
||
tagValue = m.list_Data2[1, 62].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包焊印边缘到极耳边缘间距(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_FRONT_EAR_CRACKLE_RESULT_B",
|
||
tagValue = m.list_Data2[1, 63].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包正面极耳撕裂裂纹检测结果(mm)"
|
||
},
|
||
new TagDataVOListItem
|
||
{
|
||
tagCode="CSBYH_BACK_EAR_CRACKLE_RESULT_B",
|
||
tagValue = m.list_Data2[1, 64].ToString(),
|
||
tagTime = m.TestTime,
|
||
tagCalculateResult = "Y",
|
||
tagRemark = "B芯包背面极耳撕裂裂纹检测结果(mm)"
|
||
}
|
||
|
||
};
|
||
//参数列
|
||
//var tagDataVOList = new List<TagDataVOListItem>();
|
||
//tagDataVOList.AddRange(new List<TagDataVOListItem>
|
||
//{
|
||
// new TagDataVOListItem
|
||
// {
|
||
|
||
// }
|
||
//});
|
||
|
||
|
||
//tagDataVOList.AddRange(new List<TagDataVOListItem>
|
||
// {
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"weldPowerA11",
|
||
// tagValue = m.WeldPower.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊接功率"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"weldSpeedA11",
|
||
// tagValue = m.WeldSpeed.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊接速度"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"nitrogenflowA11",
|
||
// tagValue = m.Nitrogenflow.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult ="Y",
|
||
// tagRemark = "保护气(氮气)流量"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"antiDustAirSpeedA11",
|
||
// tagValue = m.AntiDustAirSpeed.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "除尘风速"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"defocusingDistanceA11",
|
||
// tagValue = m.DefocusingDistance.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "离焦量"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"lightTimeA11",
|
||
// tagValue = m.LightTime.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "出光时间"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"weldNumA11",
|
||
// tagValue = m.WeldNum.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊接点个数"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"weldStationA11",
|
||
// tagValue = m.WeldStation.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊接工位"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"weldingSeamLength1A11",
|
||
// tagValue = m.WeldingSeamLength_1.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊缝长度1"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"weldingSeamLength2A11",
|
||
// tagValue = m.WeldingSeamLength_2.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊缝长度2"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"weldingSeamLength3A11",
|
||
// tagValue = m.WeldingSeamLength_3.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊缝长度3"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"weldingSeamWidth1A11",
|
||
// tagValue = m.WeldingSeamWidth_1.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊缝宽度1"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"weldingSeamWidth2A11",
|
||
// tagValue = m.WeldingSeamWidth_2.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊缝宽度2"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"distanceA11",
|
||
// tagValue = $"{m.Distance_1}",
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊缝宽度3"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"lightTimeA11",
|
||
// tagValue = m.LightTime.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊缝距离钢壳顶部距离大小"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"offsetA11",
|
||
// tagValue = $"{m.Offset_1}",
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊缝偏移量"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"CCDResultA11",
|
||
// tagValue = m.CCDResult.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "CCD结果"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"comprehensiveResultA11",
|
||
// tagValue = m.Result.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "综合结果"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"badItemA11",
|
||
// tagValue = m.Remark.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "不良项"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"weldingTopShaftA11",
|
||
// tagValue = m.HanjieShang.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊接上轴"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"weldingBottomShaftA11",
|
||
// tagValue = m.HanjieXia.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊接下轴"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"focalLengthA11",
|
||
// tagValue = m.JiaoJu.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焦距"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"distance2A11",
|
||
// tagValue = m.Distance_2.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊缝距离钢壳顶部距离大小2"
|
||
// },
|
||
// new TagDataVOListItem
|
||
// {
|
||
// tagCode = $"distance3A11",
|
||
// tagValue = m.Distance_3.ToString(),
|
||
// tagTime = m.TestTime,
|
||
// tagCalculateResult = "Y",
|
||
// tagRemark = "焊缝距离钢壳顶部距离大小3"
|
||
// }
|
||
// });
|
||
|
||
//payload1.identificationList = new List<IdentificationListItem>();
|
||
//payload1.identificationList.Add(new IdentificationListItem
|
||
//{
|
||
// identification = m.BarCode,
|
||
// //qualityStatus = m.Result,
|
||
// tagDataVOList = tagDataVOList
|
||
//});
|
||
model.payload = JsonConvert.SerializeObject(payload1);
|
||
//payload1= JsonConvert.SerializeObject(payload1);
|
||
break;
|
||
|
||
}
|
||
|
||
|
||
var postcontent = JsonConvert.SerializeObject(model);
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
|
||
if (string.IsNullOrEmpty(result))
|
||
{
|
||
string resData = result == "" ? "" : result;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品结果加工参数接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品结果加工参数\{nowDate.ToString("HH")}.txt", resJson);
|
||
return res;
|
||
}
|
||
|
||
|
||
var res1 = ReturnMesMsg<MesResponse>(result);
|
||
if (!res1.success)
|
||
{
|
||
var resData = res1 == null ? "" : JsonConvert.SerializeObject(res1);
|
||
Mesage = res1.message;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品结果加工参数接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resData}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品结果加工参数\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
else
|
||
{
|
||
res = true;
|
||
Mesage = res1.message;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用产品结果加工参数接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{JsonConvert.SerializeObject(result)}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\产品结果加工参数\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"产品结果加工参数接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("产品结果加工参数接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
#endregion
|
||
|
||
#region 12、设备状态
|
||
/// <summary>
|
||
/// 设备状态
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="statusCode"></param>
|
||
/// <param name="materialCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="faultCodes"></param>
|
||
/// <param name="guid"></param>
|
||
/// <param name="resJson"></param>
|
||
/// <returns></returns>
|
||
public bool UploadEquStatus(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, string guid, string statusCode, List<FaultCodeList> faultCodes, ref string Mesage)
|
||
{
|
||
bool res = false;
|
||
string resJson = "";
|
||
try
|
||
{
|
||
DateTime nowDate = DateTime.Now;
|
||
string sNowDate = nowDate.ToString("yyyy-MM-dd HH:mm:ss");
|
||
var parameters = new EqpStatusParam
|
||
{
|
||
siteCode = siteCode,
|
||
lineCode = lineCode,
|
||
equipNum = equipNum,
|
||
materialCode = materialCode,
|
||
userName = userName,
|
||
seatId = "",
|
||
recordDate = sNowDate,
|
||
statusCode = statusCode.ToString(),
|
||
uploadTime = sNowDate,
|
||
guid = guid
|
||
};
|
||
|
||
|
||
if (faultCodes != null)
|
||
{
|
||
parameters.faultCodeList = faultCodes;
|
||
}
|
||
else
|
||
{
|
||
parameters.faultCodeList = null;
|
||
}
|
||
|
||
var postcontent = JsonConvert.SerializeObject(parameters);
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
|
||
|
||
|
||
res = true;
|
||
resJson = $"{sNowDate}:调用设备运行状态接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{JsonConvert.SerializeObject(result)}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\设备运行状态\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"设备运行状态接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("设备运行状态接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
#endregion
|
||
|
||
#region 13、设备报警上传接口
|
||
/// <summary>
|
||
/// 设备报警上传接口
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="materialCode"></param>
|
||
/// <param name="alarmObj"></param>
|
||
/// <param name="guid"></param>
|
||
/// <param name="resJson"></param>
|
||
/// <returns></returns>
|
||
public bool UploadEquAlarm(string url, string siteCode, string lineCode, string equipNum, string materialCode, string userName, List<AlarmData> alarmObj, string guid, ref string mesage)
|
||
{
|
||
bool res = false;
|
||
string resJson = "";
|
||
try
|
||
{
|
||
var nowDate = DateTime.Now;
|
||
if (alarmObj.Count > 0)
|
||
{
|
||
var model = new UploadAlarmParam
|
||
{
|
||
siteCode = siteCode,
|
||
lineCode = lineCode,
|
||
equipNum = equipNum,
|
||
materialCode = materialCode,
|
||
userName = userName,
|
||
recordDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
||
guid = guid,
|
||
seatId = ""
|
||
};
|
||
|
||
model.alarmLineList = new List<AlarmLineListItem>();
|
||
for (int j = 0; j < alarmObj.Count; j++)
|
||
{
|
||
AlarmLineListItem alarmList = new AlarmLineListItem();
|
||
alarmList.alarmEndTime = alarmObj[j].EndTime.ToString();
|
||
alarmList.alarmType = alarmObj[j].AlarmType;
|
||
alarmList.alarmName = alarmObj[j].AlarmContent;
|
||
alarmList.alarmStartTime = alarmObj[j].StartTime.ToString();
|
||
alarmList.faultCode = alarmObj[j].AlarmCode;
|
||
model.alarmLineList.Add(alarmList);
|
||
}
|
||
var postcontent = JsonConvert.SerializeObject(model);
|
||
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
|
||
|
||
res = true;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用设备报警信息接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{JsonConvert.SerializeObject(result)}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\报警信息\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"调用设备报警信息接口发生异常:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("调用设备报警信息接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
#endregion
|
||
|
||
#region 14、上传设备能耗数据
|
||
/// <summary>
|
||
/// 上传设备能耗数据
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="siteCode"></param>
|
||
/// <param name="lineCode"></param>
|
||
/// <param name="userName"></param>
|
||
/// <param name="electricMeterNum"></param>
|
||
/// <param name="wattrs"></param>
|
||
/// <param name="resJson"></param>
|
||
/// <returns></returns>
|
||
public bool UploadEquEnergy(string url, string siteCode, string lineCode, string equipNum, string userName, List<string> electricMeterNum, List<WattrMeter> wattrs, ref string resJson)
|
||
{
|
||
bool res = false;
|
||
|
||
try
|
||
{
|
||
var nowDate = DateTime.Now;
|
||
var postcontent = JsonConvert.SerializeObject(wattrs);
|
||
|
||
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
|
||
|
||
res = true;
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用设备能耗信息接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{JsonConvert.SerializeObject(result)}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\设备能耗信息\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"调用设备能耗信息接口:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("调用设备能耗信息接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
#endregion
|
||
|
||
#region 15、风速仪数据上传至MES
|
||
/// <summary>
|
||
/// 风速仪数据上传至MES
|
||
/// </summary>
|
||
/// <param name="url"></param>
|
||
/// <param name="equipNum"></param>
|
||
/// <param name="antiDustAirSpeedNum"></param>
|
||
/// <param name="collectData"></param>
|
||
/// <param name="resJson"></param>
|
||
/// <returns></returns>
|
||
public bool UploadDeviceCollectData(string url, string equipNum, List<string> antiDustAirSpeedNum, List<float> collectData, ref string mesage)
|
||
{
|
||
bool res = false;
|
||
string resJson = "";
|
||
try
|
||
{
|
||
if (collectData == null) { return false; }
|
||
UploadDeviceCollectData uploadDevice = new UploadDeviceCollectData();
|
||
uploadDevice.appid = "e1012966a936170c6fcab98e24042d10";
|
||
uploadDevice.device_code = equipNum;
|
||
uploadDevice.collect_time = GetUnixTimestamp();
|
||
|
||
List<Collect_code_value_list> list = new List<Collect_code_value_list>();
|
||
for (int i = 0; i < collectData.Count; i++)
|
||
{
|
||
Collect_code_value_list _Value_List = new Collect_code_value_list();
|
||
_Value_List.target_code = 5;
|
||
_Value_List.target_value = collectData[i].ToString();
|
||
_Value_List.target_value_tag = antiDustAirSpeedNum[i];
|
||
list.Add(_Value_List);
|
||
}
|
||
uploadDevice.collect_code_value_list = list;
|
||
|
||
var nowDate = DateTime.Now;
|
||
string postcontent = JsonConvert.SerializeObject(uploadDevice);
|
||
var sw = new Stopwatch();
|
||
sw.Start();
|
||
string result = MESApiHelper.WepPostAPIAsync(url, postcontent);
|
||
sw.Stop();
|
||
resJson = $"{nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用风速接口:{url},请求数据为:{postcontent},\n{nowDate.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{result}";
|
||
TxtHelper.WriteTxt($@"D:\APILog\Logs\MesLogs\{nowDate.ToString("yyyyMMdd")}\风速信息\{nowDate.ToString("HH")}.txt", resJson);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
resJson = $"调用风速接口:{ex.Message}";
|
||
LogHelper.Instance.WriteEX("调用风速接口", ex);
|
||
}
|
||
|
||
return res;
|
||
}
|
||
#endregion
|
||
|
||
#region 16、数据处理逻辑
|
||
/// <summary>
|
||
/// 单电池进站分类
|
||
/// </summary>
|
||
/// <param name="res1"></param>
|
||
/// <param name="BarCode"></param>
|
||
/// <param name="MesMessage"></param>
|
||
/// <param name="mesResType"></param>
|
||
private void GetInMesResType(MesResponseIn res1, string BarCode, ref string MesMessage, ref MesResType mesResType)
|
||
{
|
||
if (res1 != null && res1.rows != null)
|
||
{
|
||
if (res1.rows[0].success)
|
||
{
|
||
mesResType = MesResType.D;
|
||
MesMessage = "MES进站成功 ";
|
||
|
||
}
|
||
else
|
||
{
|
||
if (res1.rows[0].category == null)
|
||
{
|
||
mesResType = MesResType.B;
|
||
MesMessage = res1.rows[0].message;
|
||
}
|
||
else
|
||
{
|
||
switch (res1.rows[0].category)
|
||
{
|
||
case "A":
|
||
mesResType = MesResType.A;
|
||
MesMessage = res1.rows[0].message;
|
||
break;
|
||
case "B":
|
||
mesResType = MesResType.B;
|
||
MesMessage = res1.rows[0].message;
|
||
break;
|
||
case "C":
|
||
mesResType = MesResType.C;
|
||
MesMessage = res1.rows[0].message;
|
||
break;
|
||
default:
|
||
mesResType = MesResType.UnKnow;
|
||
MesMessage = "MES进站失败 ";
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 多电池进站分类
|
||
/// </summary>
|
||
/// <param name="res1"></param>
|
||
/// <param name="listBar"></param>
|
||
/// <param name="MesMessage"></param>
|
||
/// <param name="mesResType"></param>
|
||
private void GetInMesResType(MesResponseIn res1, List<string> listBar, ref List<string> MesMessage, ref List<MesResType> mesResType)
|
||
{
|
||
if (res1 != null)
|
||
{
|
||
for (int i = 0; i < res1.total; i++)
|
||
{
|
||
for (int j = 0; j < res1.total; j++)
|
||
{
|
||
if (res1.rows[j].identification == listBar[i])
|
||
{
|
||
if (res1.rows[j].success)
|
||
{
|
||
mesResType[i] = MesResType.D;
|
||
MesMessage[i] = "MES进站成功 ";
|
||
|
||
}
|
||
else
|
||
{
|
||
if (res1.rows[j].category == null)
|
||
{
|
||
mesResType[i] = MesResType.B;
|
||
MesMessage[i] = res1.rows[j].message;
|
||
}
|
||
else
|
||
{
|
||
switch (res1.rows[j].category)
|
||
{
|
||
case "A":
|
||
mesResType[i] = MesResType.A;
|
||
MesMessage[i] = res1.rows[j].message;
|
||
break;
|
||
case "B":
|
||
mesResType[i] = MesResType.B;
|
||
MesMessage[i] = res1.rows[j].message;
|
||
break;
|
||
case "C":
|
||
mesResType[i] = MesResType.C;
|
||
MesMessage[i] = res1.rows[j].message;
|
||
break;
|
||
default:
|
||
mesResType[i] = MesResType.UnKnow;
|
||
MesMessage[i] = "MES进站失败 ";
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 单电池出站分类
|
||
/// </summary>
|
||
/// <param name="res1"></param>
|
||
/// <param name="BarCode"></param>
|
||
/// <param name="MesMessage"></param>
|
||
/// <param name="mesResType"></param>
|
||
private void GetOutMesResType(MesResponseOut res1, string BarCode, ref string MesMessage, ref MesResType mesResType)
|
||
{
|
||
if (res1 != null && res1.rows != null)
|
||
{
|
||
if (res1.rows[0].success)
|
||
{
|
||
mesResType = MesResType.D;
|
||
MesMessage = "MES出站成功 ";
|
||
|
||
}
|
||
else
|
||
{
|
||
if (res1.rows[0].category == null)
|
||
{
|
||
mesResType = MesResType.B;
|
||
MesMessage = res1.rows[0].message;
|
||
}
|
||
else
|
||
{
|
||
switch (res1.rows[0].category)
|
||
{
|
||
case "A":
|
||
mesResType = MesResType.A;
|
||
MesMessage = res1.rows[0].message;
|
||
break;
|
||
case "B":
|
||
mesResType = MesResType.B;
|
||
MesMessage = res1.rows[0].message;
|
||
break;
|
||
case "C":
|
||
mesResType = MesResType.C;
|
||
MesMessage = res1.rows[0].message;
|
||
break;
|
||
default:
|
||
mesResType = MesResType.UnKnow;
|
||
MesMessage = "MES出站失败 ";
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
/// <summary>
|
||
/// 多电池出站结果分类
|
||
/// </summary>
|
||
/// <param name="res1"></param>
|
||
/// <param name="list"></param>
|
||
/// <param name="MesMessage"></param>
|
||
/// <param name="mesResType"></param>
|
||
private void GetOutMesResType(MesResponseOut res1, List<BGearEntity> list, ref List<string> MesMessage, ref List<MesResType> mesResType)
|
||
{
|
||
if (res1 != null)
|
||
{
|
||
for (int i = 0; i < list.Count; i++)
|
||
{
|
||
for (int j = 0; j < res1.total; j++)
|
||
{
|
||
if (res1.rows[j].identification == list[i].CSBYHCODEA)
|
||
{
|
||
if (res1.rows[j].success)
|
||
{
|
||
mesResType[i] = MesResType.D;
|
||
MesMessage[i] = "MES出站成功 ";
|
||
|
||
}
|
||
else
|
||
{
|
||
if (res1.rows[j].category == null)
|
||
{
|
||
mesResType[i] = MesResType.B;
|
||
MesMessage[i] = res1.rows[j].message;
|
||
}
|
||
else
|
||
{
|
||
switch (res1.rows[i].category)
|
||
{
|
||
case "A":
|
||
mesResType[i] = MesResType.A;
|
||
MesMessage[i] = res1.rows[j].message;
|
||
break;
|
||
case "B":
|
||
mesResType[i] = MesResType.B;
|
||
MesMessage[i] = res1.rows[j].message;
|
||
break;
|
||
case "C":
|
||
mesResType[i] = MesResType.C;
|
||
MesMessage[i] = res1.rows[j].message;
|
||
break;
|
||
default:
|
||
mesResType[i] = MesResType.UnKnow;
|
||
MesMessage[i] = "MES出站失败 ";
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
|
||
/// <summary>
|
||
/// 序列化各类返回
|
||
/// </summary>
|
||
/// <typeparam name="T"></typeparam>
|
||
/// <param name="ret"></param>
|
||
/// <returns></returns>
|
||
private T ReturnMesMsg<T>(string ret)
|
||
{
|
||
|
||
try
|
||
{
|
||
return JsonConvert.DeserializeObject<T>(ret);
|
||
}
|
||
catch (System.Exception ex)
|
||
{
|
||
return default(T);
|
||
}
|
||
}
|
||
|
||
public List<MesResType> GetMesType(int Num)
|
||
{
|
||
List<MesResType> mesResTypes = new List<MesResType>();
|
||
for (int i = 0; i < Num; i++)
|
||
{
|
||
mesResTypes.Add(MesResType.B);
|
||
}
|
||
return mesResTypes;
|
||
}
|
||
|
||
|
||
public List<string> GetListString(int Num, string str)
|
||
{
|
||
List<string> mesResTypes = new List<string>();
|
||
for (int i = 0; i < Num; i++)
|
||
{
|
||
mesResTypes.Add(str);
|
||
}
|
||
return mesResTypes;
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
///本地时间为Unix时间戳
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
public static long GetUnixTimestamp()
|
||
{
|
||
return (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
|
||
}
|
||
|
||
#endregion
|
||
}
|
||
}
|