|
|
|
@ -311,69 +311,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 历史代码
|
|
|
|
|
//if (!this.mesResult[3])
|
|
|
|
|
//{
|
|
|
|
|
// ListBoxItemAdd(this.MesLog, "等待MES收集A面数据,收集完工后点击A面收集数据按钮");
|
|
|
|
|
// return;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//if (!this.mesResult[4])
|
|
|
|
|
//{
|
|
|
|
|
// //B面自动入账开始
|
|
|
|
|
// if (BeginAdjustNumberByBFunction(this.eaValue, this.proShaftInfo))
|
|
|
|
|
// {
|
|
|
|
|
// Action action;
|
|
|
|
|
// action = () =>
|
|
|
|
|
// {
|
|
|
|
|
// this.EndAdjustNumberByA.Background = Brushes.Green;
|
|
|
|
|
// };
|
|
|
|
|
// EndAdjustNumberByA.Dispatcher.BeginInvoke(action);
|
|
|
|
|
|
|
|
|
|
// action = () =>
|
|
|
|
|
// {
|
|
|
|
|
// this.BeginBdjustNumberByBText2.Foreground = Brushes.Gray;
|
|
|
|
|
// };
|
|
|
|
|
// BeginBdjustNumberByBText2.Dispatcher.BeginInvoke(action);
|
|
|
|
|
|
|
|
|
|
// action = () =>
|
|
|
|
|
// {
|
|
|
|
|
// this.BeginAdjustNumberByBText.Foreground = Brushes.Gray;
|
|
|
|
|
// };
|
|
|
|
|
// BeginAdjustNumberByBText.Dispatcher.BeginInvoke(action);
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// //PlcBusiness.writePlc("D9612", 1);
|
|
|
|
|
// //PlcBusiness.writePlc("D9614", 1);
|
|
|
|
|
// Action action;
|
|
|
|
|
// action = () =>
|
|
|
|
|
// {
|
|
|
|
|
// this.EndAdjustNumberByA.Background = Brushes.Red;
|
|
|
|
|
// };
|
|
|
|
|
// EndAdjustNumberByA.Dispatcher.BeginInvoke(action);
|
|
|
|
|
|
|
|
|
|
// action = () =>
|
|
|
|
|
// {
|
|
|
|
|
// this.BeginAdjustNumberByBText.Foreground = Brushes.White;
|
|
|
|
|
// };
|
|
|
|
|
// BeginAdjustNumberByBText.Dispatcher.BeginInvoke(action);
|
|
|
|
|
|
|
|
|
|
// action = () =>
|
|
|
|
|
// {
|
|
|
|
|
// this.BeginBdjustNumberByBText2.Foreground = Brushes.White;
|
|
|
|
|
// };
|
|
|
|
|
// BeginBdjustNumberByBText2.Dispatcher.BeginInvoke(action);
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//if (!this.mesResult[5])
|
|
|
|
|
//{
|
|
|
|
|
// ListBoxItemAdd(this.MesLog, "等待MES收集B面数据,收集完工后点击B面收集数据按钮");
|
|
|
|
|
// return;
|
|
|
|
|
//}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -417,7 +354,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
//结束流程初始化
|
|
|
|
|
ButtonInit();
|
|
|
|
|
LogHelperBusiness.LogInfo("进入收卷结束流程" + shaftInfo.bindSfc);
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(shaftInfo.positionId), "进入收卷结束流程" + shaftInfo.bindSfc);
|
|
|
|
|
Action action;
|
|
|
|
|
|
|
|
|
|
action = () =>
|
|
|
|
@ -451,7 +387,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
if (StringExtension.IsBlank(shaftInfo.bindRfid))
|
|
|
|
|
{
|
|
|
|
|
ListBoxItemAdd(this.RfidLog, "下料信息为空,生产过程中未记录到RFID条码信息");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(shaftInfo.positionId), "下料信息为空,生产过程中未记录到RFID条码信息");
|
|
|
|
|
LogHelperBusiness.LogInfo("下料信息为空,生产过程中未记录到RFID条码信息" + shaftInfo.bindSfc);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -461,8 +396,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
//注销SFC
|
|
|
|
|
if (!SignOffSFCs(shaftInfo))
|
|
|
|
|
{
|
|
|
|
|
//PlcBusiness.writePlc("D9612", 1);
|
|
|
|
|
//PlcBusiness.writePlc("D9614", 1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
action = () =>
|
|
|
|
@ -482,8 +415,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
//A面入账开始
|
|
|
|
|
if (!AutoBeginA(ea, shaftInfo))
|
|
|
|
|
{
|
|
|
|
|
//PlcBusiness.writePlc("D9612", 1);
|
|
|
|
|
//PlcBusiness.writePlc("D9614", 1);
|
|
|
|
|
action = () =>
|
|
|
|
|
{
|
|
|
|
|
this.BeginAdjustNumberByA.Background = Brushes.Red;
|
|
|
|
@ -494,9 +425,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//PlcBusiness.writePlc("D9612", 1);
|
|
|
|
|
//PlcBusiness.writePlc("D9614", 1);
|
|
|
|
|
action = () =>
|
|
|
|
|
{
|
|
|
|
|
this.BeginAdjustNumberByA.Background = Brushes.Red;
|
|
|
|
@ -523,7 +451,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
CollectA.Dispatcher.BeginInvoke(action);
|
|
|
|
|
|
|
|
|
|
ListBoxItemAdd(this.RfidLog, "A面数据收集与物料消耗,收集完成后点击A面收数按钮");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "A面数据收集与物料消耗,收集完成后点击A面收数按钮");
|
|
|
|
|
LogHelperBusiness.LogInfo("日志排查进入收卷完工流程,打印绑定信息shaftInfo:" + JsonChange.ModeToJson(this.proShaftInfo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -536,7 +463,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
{
|
|
|
|
|
LogRefresh(LogType.MesLog, "调用MES注销SFC接口");
|
|
|
|
|
LogHelperBusiness.LogInfo("调用MES注销SFC接口" + shaftInfo.bindSfc);
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(shaftInfo.positionId), "调用MES注销SFC接口" + shaftInfo.bindSfc);
|
|
|
|
|
MiSignOffSFCsServiceServiceParam miSignOffSFCsServiceServiceParam = new MiSignOffSFCsServiceServiceParam()
|
|
|
|
|
{
|
|
|
|
|
url = inifile.IniReadValue("MiSignOffSFCsServiceServiceParam", "url"),
|
|
|
|
@ -555,13 +481,11 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
LogHelperBusiness.LogInfo("调用MES注销SFC接口请求参数:" + JsonChange.ModeToJson(miSignOffSFCsServiceServiceParam));
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(shaftInfo.positionId), "调用MES注销SFC接口请求参数:" + JsonChange.ModeToJson(miSignOffSFCsServiceServiceParam));
|
|
|
|
|
if (appConfig.isMesFlag == 1)
|
|
|
|
|
{
|
|
|
|
|
miSignOffSFCsResponse signOffSFCsResponse = MesWebServices.iMiSignOffSFCsServiceService(miSignOffSFCsServiceServiceParam);
|
|
|
|
|
LogHelperBusiness.LogInfo("调用MES注销SFC接口返回参数:" + JsonChange.ModeToJson(signOffSFCsResponse));
|
|
|
|
|
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(shaftInfo.positionId), "调用MES注销SFC接口返回参数:" + JsonChange.ModeToJson(signOffSFCsResponse));
|
|
|
|
|
if (signOffSFCsResponse.@return.code > 0)
|
|
|
|
|
{
|
|
|
|
|
if (signOffSFCsResponse.@return.code == 13900)
|
|
|
|
@ -572,7 +496,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LogRefresh(LogType.MesLog, "注销SFC接口调用失败:" + upLoadBusiness.GetMesMessage(signOffSFCsResponse.@return.code, signOffSFCsResponse.@return.message));
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(shaftInfo.positionId), "注销SFC接口调用失败:" + signOffSFCsResponse.@return.message);
|
|
|
|
|
LogRefresh(LogType.AlarmLog, "注销SFC接口调用失败:" + upLoadBusiness.GetMesMessage(signOffSFCsResponse.@return.code, signOffSFCsResponse.@return.message));
|
|
|
|
|
this.mesResult[0] = false;
|
|
|
|
|
return false;
|
|
|
|
@ -583,7 +506,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("调用MES注销SFC接口异常:" + ex.Message);
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(shaftInfo.positionId), "调用MES注销SFC接口异常:" + ex.Message);
|
|
|
|
|
LogRefresh(LogType.MesLog, "注销SFC接口调用异常:" + ex.Message);
|
|
|
|
|
LogRefresh(LogType.AlarmLog, "注销SFC接口调用异常:" + ex.Message);
|
|
|
|
|
WebServiceLog.saveMiSignOffSFCsServiceService(miSignOffSFCsServiceServiceParam, null, beginTime, ex.Message);
|
|
|
|
@ -593,7 +515,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
//更新完工步骤
|
|
|
|
|
this.UpdateDownRecord(shaftInfo.bindRfid, shaftInfo.bindSfc, 1);
|
|
|
|
|
LogRefresh(LogType.MesLog, String.Format("注销SFC接口调用成功,SFC:{0}", shaftInfo.bindSfc));
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(shaftInfo.positionId), String.Format("注销SFC接口调用成功,SFC:{0}", shaftInfo.bindSfc));
|
|
|
|
|
|
|
|
|
|
this.mesResult[0] = true;
|
|
|
|
|
return true;
|
|
|
|
@ -608,7 +529,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
public bool BeginAdjustNumberByAFunction(int ea, ProShaftInfo proShaftInfo)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("开始调整A面数量接口");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "开始调整A面数量接口");
|
|
|
|
|
MiBatchCompleteSfcAndAdujustQtyServiceServiceParam miBatchCompleteSfcAndAdujustQtyServiceServiceParam = new MiBatchCompleteSfcAndAdujustQtyServiceServiceParam()
|
|
|
|
|
{
|
|
|
|
|
url = inifile.IniReadValue("AdujustQtyParam", "url"),
|
|
|
|
@ -636,13 +556,11 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("开始调整A面数量接口请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam));
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "开始调整A面数量接口请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam));
|
|
|
|
|
Action action;
|
|
|
|
|
if (appConfig.isMesFlag == 1)
|
|
|
|
|
{
|
|
|
|
|
var requestResult = MesWebServices.iMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam);
|
|
|
|
|
LogHelperBusiness.LogInfo("开始调整A面数量接口返回参数:" + JsonChange.ModeToJson(requestResult));
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "开始调整A面数量接口返回参数:" + JsonChange.ModeToJson(requestResult));
|
|
|
|
|
if (requestResult == null || requestResult.@return.code > 0)
|
|
|
|
|
{
|
|
|
|
|
action = () =>
|
|
|
|
@ -652,7 +570,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
LogRefresh(LogType.MesLog, "调整A面数量接口调用失败:" + upLoadBusiness.GetMesMessage(requestResult.@return.code, requestResult.@return.message));
|
|
|
|
|
LogRefresh(LogType.AlarmLog, "调整A面数量接口调用失败:" + upLoadBusiness.GetMesMessage(requestResult.@return.code, requestResult.@return.message));
|
|
|
|
|
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调整A面数量接口调用失败:" + mesAlarm.GetMesAlarmInfo(requestResult.@return.code, requestResult.@return.message));
|
|
|
|
|
this.mesResult[1] = false;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -666,7 +583,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("开始调整A面数量接口异常:" + ex.Message);
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "开始调整A面数量接口异常:" + ex.Message);
|
|
|
|
|
WebServiceLog.saveMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam, null, beginTime, ex.Message);
|
|
|
|
|
LogRefresh(LogType.MesLog, "调整A面数量接口异常:" + ex.Message);
|
|
|
|
|
LogRefresh(LogType.AlarmLog, "调整A面数量接口异常:" + ex.Message);
|
|
|
|
@ -676,7 +592,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
//更新完工步骤
|
|
|
|
|
this.UpdateDownRecord(proShaftInfo.bindRfid, proShaftInfo.bindSfc, 2);
|
|
|
|
|
LogRefresh(LogType.MesLog, String.Format("调整A面数量接口调用成功,数量调整为", ea));
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), String.Format("调整A面数量接口调用成功,数量调整为", ea));
|
|
|
|
|
this.mesResult[1] = true;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -690,7 +605,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
public bool AutoBeginA(int ea, ProShaftInfo shaftInfo)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("调用A面自动入账接口");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用A面自动入账接口");
|
|
|
|
|
MiFirstOperationForsfcServiceServiceParam miFirstOperationForsfcServiceServiceParam = new MiFirstOperationForsfcServiceServiceParam()
|
|
|
|
|
{
|
|
|
|
|
url = inifile.IniReadValue("MiFirstOperationForsfcServiceServiceParam", "url"),
|
|
|
|
@ -709,18 +623,15 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("调用A面自动入账接口请求参数:" + JsonChange.ModeToJson(miFirstOperationForsfcServiceServiceParam));
|
|
|
|
|
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用A面自动入账接口请求参数:" + JsonChange.ModeToJson(miFirstOperationForsfcServiceServiceParam));
|
|
|
|
|
if (appConfig.isMesFlag == 1)
|
|
|
|
|
{
|
|
|
|
|
miFirstOperationForsfcResponse firstOperationForsfcResponse = MesWebServices.iMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam);
|
|
|
|
|
LogHelperBusiness.LogInfo("调用A面自动入账接口返回参数:" + JsonChange.ModeToJson(firstOperationForsfcResponse));
|
|
|
|
|
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用A面自动入账接口返回参数:" + JsonChange.ModeToJson(firstOperationForsfcResponse));
|
|
|
|
|
if (firstOperationForsfcResponse.@return.code > 0)
|
|
|
|
|
{
|
|
|
|
|
ListBoxItemAdd(this.MesLog, "A面自动入账异常:" + upLoadBusiness.GetMesMessage(firstOperationForsfcResponse.@return.code, firstOperationForsfcResponse.@return.message));
|
|
|
|
|
ListBoxItemAdd(this.AlarmLog, "A面自动入账异常:" + upLoadBusiness.GetMesMessage(firstOperationForsfcResponse.@return.code, firstOperationForsfcResponse.@return.message));
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "A面自动入账异常:" + firstOperationForsfcResponse.@return.message);
|
|
|
|
|
this.mesResult[2] = false;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -729,7 +640,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("调用A面自动入账接口异常:" + ex.Message);
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用A面自动入账接口异常:" + ex.Message);
|
|
|
|
|
ListBoxItemAdd(this.MesLog, "A面自动入账接口调用异常:" + ex.Message);
|
|
|
|
|
WebServiceLog.saveMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam, null, beginTime, ex.Message);
|
|
|
|
|
this.mesResult[2] = false;
|
|
|
|
@ -738,7 +648,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
//更新完工步骤
|
|
|
|
|
this.UpdateDownRecord(proShaftInfo.bindRfid, proShaftInfo.bindSfc, 3);
|
|
|
|
|
ListBoxItemAdd(this.MesLog, "A面自动入账成功");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "A面自动入账成功");
|
|
|
|
|
this.mesResult[2] = true;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -751,20 +660,16 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
private void Btn_Click_A(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("A面收集数据,物料消耗");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "A面收集数据,物料消耗");
|
|
|
|
|
if (StringExtension.IsBlank(this.proShaftInfo.bindRfid))
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("未进入结束流程");
|
|
|
|
|
ListBoxItemAdd(this.AlarmLog, "未进入结束流程");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "未进入结束流程");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Action action;
|
|
|
|
|
//A面完工
|
|
|
|
|
if (!EndAdjustNumberByAFunction(this.eaValue, this.proShaftInfo))
|
|
|
|
|
{
|
|
|
|
|
//PlcBusiness.writePlc("D9612", 1);
|
|
|
|
|
//PlcBusiness.writePlc("D9614", 1);
|
|
|
|
|
action = () =>
|
|
|
|
|
{
|
|
|
|
|
this.EndAdjustNumberByA.Background = Brushes.Red;
|
|
|
|
@ -792,8 +697,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
//开始调整B面数量
|
|
|
|
|
if (!BeginAdjustNumberByBFunction(this.eaValue, this.proShaftInfo))
|
|
|
|
|
{
|
|
|
|
|
//PlcBusiness.writePlc("D9612", 1);
|
|
|
|
|
//PlcBusiness.writePlc("D9614", 1);
|
|
|
|
|
action = () =>
|
|
|
|
|
{
|
|
|
|
|
this.EndAdjustNumberByA.Background = Brushes.Red;
|
|
|
|
@ -835,7 +738,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
public bool EndAdjustNumberByAFunction(int ea, ProShaftInfo shaftInfo)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("调用A面调整完成接口");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用A面调整完成接口");
|
|
|
|
|
MiBatchCompleteSfcAndAdujustQtyServiceServiceParam miBatchCompleteSfcAndAdujustQtyServiceServiceParam = new MiBatchCompleteSfcAndAdujustQtyServiceServiceParam()
|
|
|
|
|
{
|
|
|
|
|
url = inifile.IniReadValue("AdujustQtyParam", "url"),
|
|
|
|
@ -864,14 +766,12 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("调用A面调整完成接口请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam));
|
|
|
|
|
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用A面调整完成接口请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam));
|
|
|
|
|
Action action;
|
|
|
|
|
if (appConfig.isMesFlag == 1)
|
|
|
|
|
{
|
|
|
|
|
var requestResult = MesWebServices.iMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam);
|
|
|
|
|
LogHelperBusiness.LogInfo("调用A面调整完成接口返回参数:" + JsonChange.ModeToJson(requestResult));
|
|
|
|
|
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用A面调整完成接口返回参数:" + JsonChange.ModeToJson(requestResult));
|
|
|
|
|
if (requestResult == null || requestResult.@return.code > 0)
|
|
|
|
|
{
|
|
|
|
|
action = () =>
|
|
|
|
@ -880,7 +780,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
};
|
|
|
|
|
EndAdjustNumberByA.Dispatcher.BeginInvoke(action);
|
|
|
|
|
LogRefresh(LogType.MesLog, "A面调整完工失败:" + upLoadBusiness.GetMesMessage(requestResult.@return.code, requestResult.@return.message));
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "A面调整完工失败:" + requestResult.@return.message);
|
|
|
|
|
LogRefresh(LogType.AlarmLog, "A面调整完工失败:" + upLoadBusiness.GetMesMessage(requestResult.@return.code, requestResult.@return.message));
|
|
|
|
|
this.mesResult[3] = false;
|
|
|
|
|
return false;
|
|
|
|
@ -897,7 +796,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("A面调整完工接口异常:" + ex.Message);
|
|
|
|
|
LogRefresh(LogType.AlarmLog, "A面调整完工接口异常:" + ex.Message);
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "A面调整完工接口异常:" + ex.Message);
|
|
|
|
|
WebServiceLog.saveMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam, null, beginTime, ex.Message);
|
|
|
|
|
this.mesResult[3] = false;
|
|
|
|
|
return false;
|
|
|
|
@ -924,7 +822,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
//更新完工步骤
|
|
|
|
|
this.UpdateDownRecord(proShaftInfo.bindRfid, proShaftInfo.bindSfc, 4);
|
|
|
|
|
LogRefresh(LogType.MesLog, "调整A面完工接口调用成功");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调整A面完工接口调用成功");
|
|
|
|
|
this.mesResult[3] = true;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -938,7 +835,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
public bool BeginAdjustNumberByBFunction(int ea, ProShaftInfo shaftInfo)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("调用B面开始接口");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用B面开始接口");
|
|
|
|
|
MiFirstOperationForsfcServiceServiceParam miFirstOperationForsfcServiceServiceParam = new MiFirstOperationForsfcServiceServiceParam()
|
|
|
|
|
{
|
|
|
|
|
url = inifile.IniReadValue("MiFirstOperationForsfcServiceServiceParam", "url"),
|
|
|
|
@ -956,17 +852,14 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("调用B面开始接口请求参数:" + JsonChange.ModeToJson(miFirstOperationForsfcServiceServiceParam));
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用B面开始接口请求参数:" + JsonChange.ModeToJson(miFirstOperationForsfcServiceServiceParam));
|
|
|
|
|
if (appConfig.isMesFlag == 1)
|
|
|
|
|
{
|
|
|
|
|
miFirstOperationForsfcResponse firstOperationForsfcResponse = MesWebServices.iMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam);
|
|
|
|
|
LogHelperBusiness.LogInfo("调用B面开始接口返回参数:" + JsonChange.ModeToJson(firstOperationForsfcResponse));
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用B面开始接口返回参数:" + JsonChange.ModeToJson(firstOperationForsfcResponse));
|
|
|
|
|
WebServiceLog.saveMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam, firstOperationForsfcResponse, beginTime, "");
|
|
|
|
|
if (firstOperationForsfcResponse.@return.code > 0)
|
|
|
|
|
{
|
|
|
|
|
ListBoxItemAdd(this.MesLog, "B面自动入账失败:" + upLoadBusiness.GetMesMessage(firstOperationForsfcResponse.@return.code, firstOperationForsfcResponse.@return.message));
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "B面自动入账失败:" + firstOperationForsfcResponse.@return.message);
|
|
|
|
|
ListBoxItemAdd(this.AlarmLog, "B面自动入账失败:" + upLoadBusiness.GetMesMessage(firstOperationForsfcResponse.@return.code, firstOperationForsfcResponse.@return.message));
|
|
|
|
|
this.mesResult[4] = false;
|
|
|
|
|
return false;
|
|
|
|
@ -976,7 +869,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("调用B面开始接口异常:" + ex.Message);
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用B面开始接口异常:" + ex.Message);
|
|
|
|
|
WebServiceLog.saveMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam, null, beginTime, ex.Message);
|
|
|
|
|
ListBoxItemAdd(this.MesLog, "B面自动入账失败:" + ex.Message);
|
|
|
|
|
ListBoxItemAdd(this.AlarmLog, "B面自动入账失败:" + ex.Message);
|
|
|
|
@ -986,7 +878,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
//更新完工步骤
|
|
|
|
|
this.UpdateDownRecord(proShaftInfo.bindRfid, proShaftInfo.bindSfc, 5);
|
|
|
|
|
ListBoxItemAdd(this.MesLog, "B面自动入账完成");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "B面自动入账完成");
|
|
|
|
|
this.mesResult[4] = true;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -999,20 +890,16 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
private void Btn_Click_B(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("B面收集数据,物料消耗");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "B面收集数据,物料消耗");
|
|
|
|
|
if (StringExtension.IsBlank(this.proShaftInfo.bindRfid))
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("未进入结束流程");
|
|
|
|
|
ListBoxItemAdd(this.AlarmLog, "未进入结束流程");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "未进入结束流程");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Action action;
|
|
|
|
|
//B面完工
|
|
|
|
|
if (!EndAdjustNumberByBFunction(this.eaValue, this.proShaftInfo))
|
|
|
|
|
{
|
|
|
|
|
//PlcBusiness.writePlc("D9612", 1);
|
|
|
|
|
//PlcBusiness.writePlc("D9614", 1);
|
|
|
|
|
action = () =>
|
|
|
|
|
{
|
|
|
|
|
this.EndAdjustNumberByB.Background = Brushes.Red;
|
|
|
|
@ -1044,7 +931,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
public bool EndAdjustNumberByBFunction(int ea, ProShaftInfo shaftInfo)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("开始调用B面调整完成接口");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "开始调用B面调整完成接口");
|
|
|
|
|
MiBatchCompleteSfcAndAdujustQtyServiceServiceParam miBatchCompleteSfcAndAdujustQtyServiceServiceParam = new MiBatchCompleteSfcAndAdujustQtyServiceServiceParam()
|
|
|
|
|
{
|
|
|
|
|
url = inifile.IniReadValue("AdujustQtyParam", "url"),
|
|
|
|
@ -1073,13 +959,11 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("调用B面调整完成接口请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam));
|
|
|
|
|
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用B面调整完成接口请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam));
|
|
|
|
|
Action action;
|
|
|
|
|
if (appConfig.isMesFlag == 1)
|
|
|
|
|
{
|
|
|
|
|
var requestResult = MesWebServices.iMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam);
|
|
|
|
|
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用B面调整完成接口返回参数:" + JsonChange.ModeToJson(requestResult));
|
|
|
|
|
LogHelperBusiness.LogInfo("调用B面调整完成接口返回参数:" + JsonChange.ModeToJson(requestResult));
|
|
|
|
|
WebServiceLog.saveMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam, requestResult, beginTime, "");
|
|
|
|
|
|
|
|
|
@ -1091,7 +975,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
};
|
|
|
|
|
EndAdjustNumberByB.Dispatcher.BeginInvoke(action);
|
|
|
|
|
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调整B面完工失败:" + requestResult.@return.message);
|
|
|
|
|
LogRefresh(LogType.MesLog, "调整B面完工失败:" + upLoadBusiness.GetMesMessage(requestResult.@return.code, requestResult.@return.message));
|
|
|
|
|
LogRefresh(LogType.AlarmLog, "调整B面完工失败:" + upLoadBusiness.GetMesMessage(requestResult.@return.code, requestResult.@return.message));
|
|
|
|
|
this.mesResult[5] = false;
|
|
|
|
@ -1107,7 +990,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("调用B面调整完成接口返回异常:" + ex.Message);
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调用B面调整完成接口返回异常:" + ex.Message);
|
|
|
|
|
WebServiceLog.saveMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam, null, beginTime, ex.Message);
|
|
|
|
|
LogRefresh(LogType.MesLog, "调整B面完工接口异常:" + ex.Message);
|
|
|
|
|
LogRefresh(LogType.AlarmLog, "调整B面完工接口异常:" + ex.Message);
|
|
|
|
@ -1117,7 +999,6 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
//更新完工步骤
|
|
|
|
|
this.UpdateDownRecord(proShaftInfo.bindRfid, proShaftInfo.bindSfc, 6);
|
|
|
|
|
LogRefresh(LogType.MesLog, "调整B面完工接口调用成功");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "调整B面完工接口调用成功");
|
|
|
|
|
this.mesResult[5] = true;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -1204,11 +1085,9 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
if (shaftInfo != null)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("本地绑定RFID:" + shaftInfo.bindRfid + ";流程内RFID:" + this.proShaftInfo.bindRfid);
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "本地绑定RFID:" + shaftInfo.bindRfid + ";流程内RFID:" + this.proShaftInfo.bindRfid);
|
|
|
|
|
if (shaftInfo.bindRfid == this.proShaftInfo.bindRfid)
|
|
|
|
|
{
|
|
|
|
|
LogHelperBusiness.LogInfo("清除收料轴绑定信息");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "清除收料轴绑定信息");
|
|
|
|
|
//清空卷轴绑定的信息
|
|
|
|
|
this.proShaftInfo.bindRfid = "";
|
|
|
|
|
this.proShaftInfo.bindSfc = "";
|
|
|
|
@ -1217,21 +1096,15 @@ namespace MaterialTraceabilityUI
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
LogRefresh(LogType.RfidLog, this.proShaftInfo.shaftName + "收卷结束,下发下料信号");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), this.proShaftInfo.shaftName + "收卷结束,下发下料信号");
|
|
|
|
|
|
|
|
|
|
//下发报警复位
|
|
|
|
|
//PlcBusiness.writePlc("D9612", 0);
|
|
|
|
|
//LogHelperBusiness.LogInfo("收卷流程结束,下发报警复位D9612");
|
|
|
|
|
//下发下料信号
|
|
|
|
|
plcBusiness.writePlc("D9614", 0);
|
|
|
|
|
plcBusiness.writePlc(appConfig.TbAddress.控制下料, 0);
|
|
|
|
|
LogHelperBusiness.LogInfo("收卷流程结束,下发下料信号D9614");
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "收卷流程结束,下发下料信号D9614");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogRefresh(LogType.RfidLog, "收卷完成清空卷轴状态异常:" + ex.Message);
|
|
|
|
|
LogHelperBusiness.LogError("收卷完成清空卷轴状态异常", ex);
|
|
|
|
|
//upLoadBusiness.SaveLogRecord(Convert.ToInt32(proShaftInfo.positionId), "收卷完成清空卷轴状态异常:" + ex.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|