You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

636 lines
30 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MaterialTraceability.WebService;
using MaterialTraceability.WebService.GetParametricValueServiceService;
using MaterialTraceability.WebService.Param;
using MaterialTraceability.Common;
using MaterialTraceability.WebService.MachineIntegrationServiceService;
using MaterialTraceability.SqlSugar;
using MaterialTraceability.Entity.DAO;
using MaterialTraceability.SqlSugar.ServiceImpl;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq.Expressions;
using MaterialTraceability.Business;
using GRreader;
using System.Web.Services;
using MaterialTraceability.Entity.UpLoad;
namespace UnitTestProject
{
[TestClass]
public class UnitTest1
{
private IMesWebServices webService = new MesWebServicesImpl();
private IBaseServices<ProDownRecord> baseServices = new BaseServices<ProDownRecord>();
[TestMethod]
public void TestMesthodl1()
{
// string binSfc = "L22221110A0160"; LYLAPC022302150114 LYLAPA032302230128 LYLAPA032302230059-06
string binSfc = "LYLAPC022303250141";
string LY_SJFX = "逆时针";//收卷轴方向
string LY_FJFX = "逆时针";//放卷轴方向
string LY_HXMQ = "左";//横向膜区方向
int LY_ZXMQ = 0;//L2 SFC拆分第几轮
string LY_WLMX = "S面";//物料面向 小轴方向
string LY_SJZ = "1A轴小天线";//收卷轴
double LY_S_X01 = 0.00;//冷压S面某膜区特征值-01
double LY_S_X02 = 0.00;//冷压S面某膜区特征值-02
double LY_B_X01 = 0.00;//冷压B面某膜区特征值-01
double LY_B_X02 = 0.00;//冷压B面某膜区特征值-02
GetParametricValueRequestData[] t = null;
if (LY_HXMQ == "左" && LY_ZXMQ == 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_1_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_1_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_1_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_1_2" },
// new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
if (LY_HXMQ == "中" && LY_ZXMQ == 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_2_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_2_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_2_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_2_2" },
// new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
if (LY_HXMQ == "右" && LY_ZXMQ == 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_3_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_3_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_3_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_3_2" },
// new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
if (LY_HXMQ == "左" && LY_ZXMQ != 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_4_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_4_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_4_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_4_2" },
// new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
if (LY_HXMQ == "中" && LY_ZXMQ != 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_5_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_5_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_5_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_5_2" },
// new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
if (LY_HXMQ == "右" && LY_ZXMQ != 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_6_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_6_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_6_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_6_2" },
// new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
TBDataServiceParam tbServiceParam = new TBDataServiceParam()
{
url = "http://lymesa.catlbattery.com:8103/atlmeswebservice/GetParametricValueServiceService?wsdl",
site = "2100",
sfc = binSfc,
memberlist = t
};
try
{
var tbresult = webService.findTBData(tbServiceParam);
LogHelper.Info($"从mes中获取涂布数据{JsonChange.ModeToJson(tbresult)}");
if (StringChange.ParseToInt(tbresult.code) > 0)
{
LogHelper.Info("MES 查询涂布数据接口调用失败:" + tbresult.msg);
}
LogHelper.Info(String.Format("涂布特征数据LY_S_X01{0}LY_S_X02{1}LY_B_X01{2}LY_B_X02{3}", LY_S_X01, LY_S_X02, LY_B_X01, LY_B_X02));
}
catch (Exception ex)
{
LogHelper.Info("冷压获取数值失败:" + ex.Message);
}
}
[TestMethod]
public void RfidTestMethod()
{
IBaseServices<ProTagInfo> tagInfoServices = new BaseServices<ProTagInfo>();
ProTagInfo tagInfo = new ProTagInfo()
{
Id = System.Guid.NewGuid().ToString("N"),
MachineId ="1",
PositionId = "1",
Count = "1",
Rssi = "1",
Antana = "1",
Pcstring = "1",
Epcstring = "1"
};
tagInfoServices.Add(tagInfo);
EquipBusiness equipBusiness = new EquipBusiness();
List<TagInfo> tagInfos = new List<TagInfo>();
tagInfos.Add(new TagInfo()
{
Count = 10,
RSSI = -60,
Antana = 1,
EPCstring = "JSLY5RDC00087701"
});
tagInfos.Add(new TagInfo()
{
Count = 15,
RSSI = -60,
Antana = 1,
EPCstring = "JSLY5RDC00087702"
});
tagInfos.Add(new TagInfo()
{
Count = 11,
RSSI = -60,
Antana = 1,
EPCstring = "JSLY5RDC00087701"
});
tagInfos.Add(new TagInfo()
{
Count = 14,
RSSI = -60,
Antana = 1,
EPCstring = "JSLY5RDC00087702"
});
//
tagInfos.Add(new TagInfo()
{
Count = 10,
RSSI = -60,
Antana = 1,
EPCstring = "JSLY5RDC00366301"
});
tagInfos.Add(new TagInfo()
{
Count = 15,
RSSI = -60,
Antana = 1,
EPCstring = "JSLY5RDC00366301"
});
var info = equipBusiness.FilterEpcByProductionEnd(tagInfos);
}
[TestMethod]
public void TestMethod1()
{
List<String> info = new List<string>();
info.Add("L32221113A0053-01");
info.Add("L32221113A0053-02");
info.Add("L32221113A0053-03");
info.Add("L32221113A0053-04");
info.Add("L32221113A0053-05");
info.Add("L32221113A0053-06");
info.Add("L32221113A0053-07");
info.Add("L32221113A0053-08");
info.Add("L32221113A0053-09");
foreach (string item in info)
{
string downSplitSfc = item;
var df = downSplitSfc.Substring(downSplitSfc.IndexOf("-") + 1, 2);
int recordAmount = StringChange.ParseToInt(df);
var tag = Convert.ToInt32(ConfigHelper.GetConfig("tagAmount"));
var splitAmount = Math.Ceiling(Convert.ToDouble(recordAmount) / Convert.ToDouble(tag));
}
var dayShift = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 08:00:00"));
var nightShift = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 20:00:00"));
//webService.machineIntegration(new MaterialTraceability.WebService.Param.MachineIntegrationServiceParam());
//int LY_ZXMQ = 0;
//for (int i = 0; i < 10; i++)
//{
// var df = i;
// var tag = Convert.ToInt32(ConfigHelper.GetConfig("tagAmount"));
// var splitAmount = Math.Ceiling(Convert.ToDouble(df) / Convert.ToDouble(tag));
// if (df % tag == 0)
// {
// LY_ZXMQ = LY_ZXMQ + 1;
// }
// Console.WriteLine(String.Format("当前生产{0}卷,轮次:{1}", df+1, LY_ZXMQ));
//}
}
public async Task<int> SpliteTest(string sfc)
{
int LY_ZXMQ = 0;
Expression<Func<ProDownRecord, bool>> exp = s1 => true;
exp = exp.And(x => x.Sfc.Contains(sfc));
List<ProDownRecord> df = await baseServices.Query(exp);
int recordAmount = df == null ? 0 : df.Count;
var tag = Convert.ToInt32(ConfigHelper.GetConfig("tagAmount"));
var splitAmount = Math.Ceiling(Convert.ToDouble(recordAmount) / Convert.ToDouble(tag));
if (recordAmount % tag == 0)
{
LY_ZXMQ = LY_ZXMQ + 1;
}
return LY_ZXMQ;
}
[TestMethod]
public void TestMesthodl()
{
// string binSfc = "L22221110A0160"; LYLAPC022302150114 LYLAPA032302230128
string binSfc = "LYLAPC022302150114";
string LY_SJFX = "逆时针";//收卷轴方向
string LY_FJFX = "逆时针";//放卷轴方向
string LY_HXMQ = "左";//横向膜区方向
int LY_ZXMQ = 1;//L2 SFC拆分第几轮
string LY_WLMX = "S面";//物料面向 小轴方向
string LY_SJZ = "1A轴小天线";//收卷轴
double LY_S_X01 = 0.00;//冷压S面某膜区特征值-01
double LY_S_X02 = 0.00;//冷压S面某膜区特征值-02
double LY_B_X01 = 0.00;//冷压B面某膜区特征值-01
double LY_B_X02 = 0.00;//冷压B面某膜区特征值-02
GetParametricValueRequestData[] t = null;
if (LY_HXMQ == "左" && LY_ZXMQ == 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_1_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_1_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_1_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_1_2" },
new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
if (LY_HXMQ == "中" && LY_ZXMQ == 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_2_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_2_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_2_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_2_2" },
new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
if (LY_HXMQ == "右" && LY_ZXMQ == 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_3_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_3_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_3_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_3_2" },
new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
if (LY_HXMQ == "左" && LY_ZXMQ != 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_4_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_4_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_4_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_4_2" },
new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
if (LY_HXMQ == "中" && LY_ZXMQ != 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_5_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_5_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_5_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_5_2" },
new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
if (LY_HXMQ == "右" && LY_ZXMQ != 1)
{
t = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_6_1" },
new GetParametricValueRequestData { parameter= "S_EIGENVALUE_6_2" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_6_1" },
new GetParametricValueRequestData { parameter= "B_EIGENVALUE_6_2" },
new GetParametricValueRequestData { parameter= "S_TARGETCW" },
};
}
TBDataServiceParam tbServiceParam = new TBDataServiceParam()
{
url = "http://lymesa.catlbattery.com:8103/atlmeswebservice/GetParametricValueServiceService?wsdl",
site = "2100",
sfc = binSfc,
memberlist = t
};
try
{
var tbresult = webService.findTBData(tbServiceParam);
LogHelper.Info($"从mes中获取涂布数据{JsonChange.ModeToJson(tbresult)}");
if (StringChange.ParseToInt(tbresult.code) > 0)
{
LogHelper.Info("MES 查询涂布数据接口调用失败:" + tbresult.msg);
}
//foreach (var item in tbresult.paramValues)
//{
// if (LY_HXMQ == "左" && LY_ZXMQ == 1)
// {
// if (item.parameter == "S_EIGENVALUE_1_1") LY_S_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "S_EIGENVALUE_1_2") LY_S_X02 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_1_1") LY_B_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_1_2") LY_B_X02 = Convert.ToDouble((item.value));
// }
// if (LY_HXMQ == "中" && LY_ZXMQ == 1)
// {
// if (item.parameter == "S_EIGENVALUE_2_1") LY_S_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "S_EIGENVALUE_2_2") LY_S_X02 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_2_1") LY_B_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_2_2") LY_B_X02 = Convert.ToDouble((item.value));
// }
// if (LY_HXMQ == "右" && LY_ZXMQ == 1)
// {
// if (item.parameter == "S_EIGENVALUE_3_1") LY_S_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "S_EIGENVALUE_3_2") LY_S_X02 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_3_1") LY_B_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_2_2") LY_B_X02 = Convert.ToDouble((item.value));
// }
// if (LY_HXMQ == "左" && LY_ZXMQ != 1)
// {
// if (item.parameter == "S_EIGENVALUE_4_1") LY_S_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "S_EIGENVALUE_4_2") LY_S_X02 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_4_1") LY_B_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_4_2") LY_B_X02 = Convert.ToDouble((item.value));
// }
// if (LY_HXMQ == "中" && LY_ZXMQ != 1)
// {
// if (item.parameter == "S_EIGENVALUE_5_1") LY_S_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "S_EIGENVALUE_5_2") LY_S_X02 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_5_1") LY_B_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_5_2") LY_B_X02 = Convert.ToDouble((item.value));
// }
// if (LY_HXMQ == "右" && LY_ZXMQ != 1)
// {
// if (item.parameter == "S_EIGENVALUE_6_1") LY_S_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "S_EIGENVALUE_6_2") LY_S_X02 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_6_1") LY_B_X01 = Convert.ToDouble((item.value));
// if (item.parameter == "B_EIGENVALUE_6_2") LY_B_X02 = Convert.ToDouble((item.value));
// }
//}
LogHelper.Info(String.Format("涂布特征数据LY_S_X01{0}LY_S_X02{1}LY_B_X01{2}LY_B_X02{3}", LY_S_X01, LY_S_X02, LY_B_X01, LY_B_X02));
}
catch (Exception ex)
{
LogHelper.Info("冷压获取数值失败:" + ex.Message);
}
//LogHelper.Info($"冷压将物料上传到mes中数据LY_FJFX:{LY_FJFX}-LY_SJFX:{LY_SJFX}-LY_SJZ:{LY_SJZ}-LY_HXMQ:{LY_HXMQ}-:LY_ZXMQ{LY_ZXMQ}-LY_WLMX:{LY_WLMX}-LY_S_X01:{LY_S_X01}-LY_S_X02:{LY_S_X02}-LY_B_X01:{LY_B_X01}-LY_B_X02:{LY_B_X02}");
//machineIntegrationParametricData[] data = {
// new machineIntegrationParametricData() {name ="LY_FJFX",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(LY_FJFX.ToString())?"0":LY_FJFX.ToString()},
// new machineIntegrationParametricData() {name ="LY_SJFX",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(LY_SJFX.ToString())?"0":LY_SJFX.ToString()},
// new machineIntegrationParametricData() {name ="LY_SJZ",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(LY_SJZ.ToString())?"0":LY_SJZ.ToString()},
// new machineIntegrationParametricData() {name ="LY_HXMQ",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(LY_HXMQ.ToString())?"0":LY_HXMQ.ToString()},
// new machineIntegrationParametricData() {name ="LY_ZXMQ",dataType=ParameterDataType.NUMBER, value=LY_ZXMQ.ToString()},
// new machineIntegrationParametricData() {name ="LY_WLMX",dataType=ParameterDataType.TEXT, value=string.IsNullOrEmpty(LY_WLMX.ToString())?"0":LY_WLMX.ToString()},
// new machineIntegrationParametricData() {name ="LY_S_X01",dataType=ParameterDataType.NUMBER, value=string.IsNullOrEmpty(LY_S_X01.ToString())?"0":LY_S_X01.ToString()},
// new machineIntegrationParametricData() {name ="LY_S_X02",dataType=ParameterDataType.NUMBER, value=string.IsNullOrEmpty(LY_S_X02.ToString())?"0":LY_S_X02.ToString()},
// new machineIntegrationParametricData() {name ="LY_B_X01",dataType=ParameterDataType.NUMBER, value=string.IsNullOrEmpty(LY_B_X01.ToString())?"0":LY_B_X01.ToString()},
// new machineIntegrationParametricData() {name ="LY_B_X02",dataType=ParameterDataType.NUMBER, value=string.IsNullOrEmpty(LY_B_X02.ToString())?"0":LY_B_X02.ToString()},
// };
//MachineIntegrationServiceParam machineIntegrationServiceParam = new MachineIntegrationServiceParam()
//{
// url = "http://lymesa.catlbattery.com:8103/atlmeswebservice/MachineIntegrationServiceService?wsdl",
// site = "2100",
// sfc = "L32221110A0119",
// operationRevision = "#",
// activityId = "EAP_WS",
// dcGroup = "1CACAP1SI0089",
// dcGroupRevision = "#",
// parametricArray = data,
// modeProcessSfc = ModeProcessSfc.MODE_COMPLETE_SFC_POST_DC
//};
//var dataCollectForSfcExResponse = webService.machineIntegration(machineIntegrationServiceParam);
//var result = dataCollectForSfcExResponse.@return;
//if (result.code > 0)
//{
// LogHelper.Info("冷压数据上传MES失败" + result.message);
//}
//else
//{
// LogHelper.Info("冷压数据上传MES成功");
//}
}
[TestMethod]
public void TestMethodl()
{
string jsonText = @"{""code"":""0"",""msg"":null,""sfc"":""L32221114A0071 - 02"",""paramValues"":[{""parameter"":""LY_WLMX"",""value"":""S面"",""date"":""2022 - 11 - 14 14:35:15""},{""parameter"":""LY_S_X01"",""value"":""204"",""date"":""2022 - 11 - 14 14:35:15""},{""parameter"":""LY_S_X02"",""value"":""205"",""date"":""2022 - 11 - 14 14:35:15""},{""parameter"":""LY_B_X01"",""value"":""0"",""date"":""2022 - 11 - 14 14:35:15""},{""parameter"":""LY_B_X02"",""value"":""0"",""date"":""2022 - 11 - 14 14:35:15""}]}";
var info =JsonChange.JsonToMode<TBParametricValueResult>(jsonText);
//Test("L32221102A0002");
}
private IBaseServices<ProDownRecord> downRecordServices = new BaseServices<ProDownRecord>();
public async void Test(string binSfc)
{
var df = await downRecordServices.Query();
var tag = StringChange.ParseToInt(ConfigHelper.GetConfig("tagAmount"));
var result = df.Count / tag;
}
[TestMethod]
public void MQTest()
{
//L32221114A0071-01-02
machineIntegrationParametricData[] data = {
new machineIntegrationParametricData() {name ="MQ_FJFX",dataType=ParameterDataType.TEXT, value= "顺时针"},
new machineIntegrationParametricData() {name ="MQ_SJFX",dataType=ParameterDataType.TEXT, value="顺时针"},
new machineIntegrationParametricData() {name ="MQ_SJZ",dataType=ParameterDataType.TEXT, value= "上左收卷"},
new machineIntegrationParametricData() {name ="MQ_SFSJ",dataType=ParameterDataType.TEXT, value = "否"},
new machineIntegrationParametricData() {name ="MQ_WLMX",dataType=ParameterDataType.TEXT, value= "S面"},
new machineIntegrationParametricData() {name ="MQ_JRLLFX",dataType=ParameterDataType.TEXT, value= "顺时针"},
new machineIntegrationParametricData() {name ="S_CW",dataType=ParameterDataType.NUMBER, value= "0"},
new machineIntegrationParametricData() {name ="B_CW",dataType=ParameterDataType.NUMBER, value= "200"},
};
MachineIntegrationServiceParam machineIntegrationServiceParam = new MachineIntegrationServiceParam()
{
url = "http://lymesa.catlbattery.com:8103/atlmeswebservice/MachineIntegrationServiceService?wsdl",
site = "2100",
sfc = "L32221114A0071-02-02", //将数据上传至拆分后的膜卷号
operationRevision = "#",
activityId = "EAP_WS",
dcGroup = "1CAEFS1SI00089",
dcGroupRevision = "#",
parametricArray = data,
modeProcessSfc = ModeProcessSfc.MODE_COMPLETE_SFC_POST_DC
};
LogHelper.Info("上传MES数据接口请求参数" + JsonChange.ModeToJson(machineIntegrationServiceParam));
var dataCollectForSfcExResponse = webService.machineIntegration(machineIntegrationServiceParam);
var dataCollectForSfcExResponseResult = dataCollectForSfcExResponse.@return;
if (dataCollectForSfcExResponseResult.code > 0)
{
LogHelper.Info("模切数据上传MES失败" + dataCollectForSfcExResponseResult.message);
}
else
{
LogHelper.Info("模切数据上传MES成功");
}
}
private EquipBusiness equipBusiness = new EquipBusiness();
private IBaseServices<ProTagInfo> tagInfoServices = new BaseServices<ProTagInfo>();
//------------------------------------------------------------------
[TestMethod]
public void MQTest1()
{
test();
}
private async void test()
{
Expression<Func<ProTagInfo, bool>> exp = s1 => true;
exp = exp.And(x => x.PositionId == "12");
List<ProTagInfo> tagInfos = await tagInfoServices.Query(exp);
if (tagInfos == null)
{
return;
}
List<TagInfo> tagInfoList = new List<TagInfo>();
if (tagInfos != null)
{
int tagInfosLength = tagInfos.Count;
for (int i = 0; i < tagInfosLength; i++)
{
TagInfo tagInfo = new TagInfo()
{
Count = StringChange.ParseToInt(tagInfos[i].Count),
RSSI = StringChange.ParseToInt(tagInfos[i].Rssi),
Antana = StringChange.ParseToInt(tagInfos[i].Antana),
PCstring = tagInfos[i].Pcstring,
EPCstring = tagInfos[i].Epcstring
};
tagInfoList.Add(tagInfo);
}
}
string result = equipBusiness.FilterEpcByProductionEnd(tagInfoList);
LogHelper.Info("获取最终RFID条码为" + result);
}
//-----------------------------------------------------------
[TestMethod]
public void getLyDataTest()
{
/*GetParametricValueRequestData[] parametricValueRequestDatas = new GetParametricValueRequestData[] {
new GetParametricValueRequestData { parameter= "LY_WLMX" },
new GetParametricValueRequestData { parameter= "LY_S_X01" },
new GetParametricValueRequestData { parameter= "LY_S_X02" },
new GetParametricValueRequestData { parameter= "LY_B_X01" },
new GetParametricValueRequestData { parameter= "LY_B_X02" },
};
var lyMaterialCharacter = GetLyMaterialCharacter("L32221114A0071-02", parametricValueRequestDatas); //获取冷压特征数据*/
string info = "";
Dictionary<int, string> keyValuePairs = new Dictionary<int, string>();
for(int i = 0; i < 10; i++)
{
if (i % 2 == 0)
{
info = "偶数";
}
else
{
info = "奇数";
}
keyValuePairs.Add(i, info);
}
var result = keyValuePairs;
}
private TBParametricValueResult GetLyMaterialCharacter(string sfc, GetParametricValueRequestData[] parameters)
{
TBDataServiceParam tbServiceParam = new TBDataServiceParam()
{
url = "http://lymesa.catlbattery.com:8103/atlmeswebservice/GetParametricValueServiceService?wsdl",
site = "2100",
sfc = sfc,
memberlist = parameters
};
var lyresult = webService.findTBData(tbServiceParam);
return lyresult;
}
}
}