From 3f25d7528f10d88e76fd0a6598fd231036696d00 Mon Sep 17 00:00:00 2001 From: wenjy Date: Sat, 18 Mar 2023 11:53:41 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20PLC=E5=9C=B0=E5=9D=80=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=88=E6=B6=82=E5=B8=83=E5=B7=A5=E5=BA=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Impl/TBSignalReadBusiness.cs | 120 +++------------- MaterialTraceability.Business/PlcBusiness.cs | 42 +++--- .../Config/TbAddress.cs | 64 +++++++++ .../DTO/AppConfigDto.cs | 3 + .../MaterialTraceability.Entity.csproj | 1 + MaterialTraceabilityUI/CoatingProcess.xaml.cs | 129 +----------------- MaterialTraceabilityUI/TBAlarmRecord.xaml.cs | 29 ---- 7 files changed, 112 insertions(+), 276 deletions(-) create mode 100644 MaterialTraceability.Entity/Config/TbAddress.cs diff --git a/MaterialTraceability.Business/Impl/TBSignalReadBusiness.cs b/MaterialTraceability.Business/Impl/TBSignalReadBusiness.cs index b1bcdb7..9354aa0 100644 --- a/MaterialTraceability.Business/Impl/TBSignalReadBusiness.cs +++ b/MaterialTraceability.Business/Impl/TBSignalReadBusiness.cs @@ -170,14 +170,13 @@ namespace MaterialTraceability.Business.Impl if (StringExtension.IsBlank(epc)) { //读取失败,控制PLC气胀轴 - plcBusiness.writePlc("D9608", 1); + plcBusiness.writePlc(appConfig.TbAddress.气涨泄气, 1); //写入报警 - plcBusiness.writePlc("D9610", 1); + plcBusiness.writePlc(appConfig.TbAddress.RFID异常, 1); //写入转塔是否可以旋转 - plcBusiness.writePlc("D9602", 0); + plcBusiness.writePlc(appConfig.TbAddress.是否转塔, 0); LogHelper.Info("RFID条码信息读取失败,下发气胀轴泄气:D9608写1,下发读取失败报警信息:D9610写1"); - //upLoadBusiness.SaveLogRecord(position, "RFID条码信息读取失败,下发气胀轴泄气:D9608写1,下发读取失败报警信息:D9610写1"); LogRefreshEvent?.Invoke(LogType.RfidLog, logStr + "RFID条码信息读取失败"); LogRefreshEvent?.Invoke(LogType.AlarmLog, logStr + "RFID条码信息读取失败"); ViewModelRefreshEvent?.Invoke(new ViewModelDto() @@ -195,22 +194,19 @@ namespace MaterialTraceability.Business.Impl } LogHelper.Info("收卷位设备:" + proEquip.equipIp + "涨紧信号读取成功:" + epc); - //upLoadBusiness.SaveLogRecord(position, "收卷位设备:" + proEquip.equipIp + "涨紧信号读取成功:" + epc); LogRefreshEvent?.Invoke(LogType.RfidLog, logStr + "RFID条码信息读取成功:" + epc); lock(string.Empty) { LogHelper.Info("判断RFID标签是否重复"); - //upLoadBusiness.SaveLogRecord(position, "判断RFID标签是否重复"); if (BusinessHelper.DownRfidIsRecur(epc,position).Result) { LogHelper.Info(logStr + "RFID读取到的条码:" + epc + "与前一读取相同不做MES处理"); - //upLoadBusiness.SaveLogRecord(position, logStr + "RFID读取到的条码:" + epc + "与前一读取相同不做MES处理"); LogRefreshEvent?.Invoke(LogType.RfidLog, logStr + "RFID读取到的条码:" + epc + "与前一读取相同不做MES处理"); LogRefreshEvent?.Invoke(LogType.AlarmLog, logStr + "RFID读取到的条码:" + epc + "与前一读取相同不做MES处理"); - plcBusiness.writePlc("D9602", 1); + plcBusiness.writePlc(appConfig.TbAddress.是否转塔, 1); return; } @@ -234,7 +230,6 @@ namespace MaterialTraceability.Business.Impl { LogRefreshEvent?.Invoke(LogType.PlcLog, logStr + "收卷结束信号触发成功"); LogHelper.Info(logStr + "收卷结束信号触发成功"); - //upLoadBusiness.SaveLogRecord(position, logStr + "收卷结束信号触发成功"); //获取收卷轴绑定的RFID条码信息,取最新数据 Expression> exp = s1 => true; @@ -247,29 +242,24 @@ namespace MaterialTraceability.Business.Impl LogRefreshEvent?.Invoke(LogType.RfidLog, String.Format("{0}收卷完工获取绑定信息为空不进入结束流程", logStr)); LogRefreshEvent?.Invoke(LogType.AlarmLog, String.Format("{0}收卷完工获取绑定信息为空不进入结束流程", logStr)); LogHelper.Info(String.Format("{0}收卷完工获取绑定信息为空不进入结束流程", logStr)); - //upLoadBusiness.SaveLogRecord(position, String.Format("{0}收卷完工获取绑定信息为空不进入结束流程", logStr)); return; } LogHelper.Info(String.Format("{0}当前绑定的物料信息为:{1}", logStr, JsonChange.ModeToJson(shaftInfo))); - //upLoadBusiness.SaveLogRecord(position, String.Format("{0}当前绑定的物料信息为:{1}", logStr, JsonChange.ModeToJson(shaftInfo))); //下发禁止下料信号 LogRefreshEvent?.Invoke(LogType.PlcLog, logStr + "收卷结束,下发禁止下料信号"); - int eaValue = PlcBusiness.readPlc("D9616"); + int eaValue = PlcBusiness.readPlc(appConfig.TbAddress.收卷轴米数); LogRefreshEvent.Invoke(LogType.PlcLog, "读取收卷米数:" + eaValue); LogHelper.Info("读取设备收卷米数:" + eaValue); - //upLoadBusiness.SaveLogRecord(position, "读取设备收卷米数:" + eaValue); string membraneLength = GetSysConfigList("SysConfig").Where(x => x.paramKey == "membraneLength").FirstOrDefault().paramValue; string volumesNumber = GetSysConfigList("SysConfig").Where(x => x.paramKey == "volumesNumber").FirstOrDefault().paramValue; LogHelper.Info("获取设备膜长:"+ membraneLength+";系数:"+ volumesNumber); - //upLoadBusiness.SaveLogRecord(position, "获取设备膜长:" + membraneLength + ";系数:" + volumesNumber); eaValue = Convert.ToInt32(Convert.ToDouble(eaValue) / Convert.ToDouble(membraneLength) * Convert.ToDouble(volumesNumber)); LogRefreshEvent.Invoke(LogType.PlcLog, "读取设备收卷EA值:" + eaValue); LogHelper.Info("读取设备收卷EA值:" + eaValue); - //upLoadBusiness.SaveLogRecord(position, "读取设备收卷EA值:" + eaValue); LogHelper.Info("日志排查进入收卷完工操作前,打印绑定信息shaftInfo:" + JsonChange.ModeToJson(shaftInfo)); //收卷完工操作 EndProductionEvent?.Invoke(eaValue, shaftInfo); @@ -280,7 +270,6 @@ namespace MaterialTraceability.Business.Impl catch (Exception ex) { LogHelper.Error("涂布工序收卷位结束逻辑处理异常", ex); - //upLoadBusiness.SaveLogRecord(position, "涂布工序收卷位结束逻辑处理异常"+ ex.Message); } } @@ -307,17 +296,14 @@ namespace MaterialTraceability.Business.Impl LogRefreshEvent?.Invoke(LogType.MesLog, "调用MES接口获取RFID绑定的SFC"); LogHelper.Info("MES获取膜卷号接口请求参数:" + JsonChange.ModeToJson(processLotServiceWSServiceParam)); - //upLoadBusiness.SaveLogRecord(position, "MES获取膜卷号接口请求参数:" + JsonChange.ModeToJson(processLotServiceWSServiceParam)); if (appConfig.isMesFlag == 1) { readProcessLotResponse readProcessLotResponse = MesWebServices.readProcessLot(processLotServiceWSServiceParam); LogHelper.Info("MES获取膜卷号接口返回参数:" + JsonChange.ModeToJson(readProcessLotResponse)); - //upLoadBusiness.SaveLogRecord(position, "MES获取膜卷号接口返回参数:" + JsonChange.ModeToJson(readProcessLotResponse)); if (readProcessLotResponse.Response.processLotMemberList != null) { sfcStr = readProcessLotResponse.Response.processLotMemberList[0].memberContext.Substring(11); LogHelper.Info("RFID条码:" + rfidStr + "绑定的SFC条码为:" + sfcStr); - //upLoadBusiness.SaveLogRecord(position, "RFID条码:" + rfidStr + "绑定的SFC条码为:" + sfcStr); LogRefreshEvent?.Invoke(LogType.MesLog, "RFID条码:" + rfidStr + "绑定的SFC条码为:" + sfcStr); } } @@ -329,7 +315,6 @@ namespace MaterialTraceability.Business.Impl catch (Exception ex) { LogHelper.Info("MES获取膜卷号接口调用异常:" + ex.Message); - //upLoadBusiness.SaveLogRecord(position, "MES获取膜卷号接口调用异常:" + ex.Message); LogRefreshEvent?.Invoke(LogType.AlarmLog, "MES获取膜卷号接口调用异常:" + ex.Message); WebServiceLog.saveReadProcessLot(processLotServiceWSServiceParam, null, beginTime, ex.Message); return; @@ -339,15 +324,12 @@ namespace MaterialTraceability.Business.Impl { ProcessLotServiceWSServiceParam lotServiceWSServiceParam = new ProcessLotServiceWSServiceParam() { - //url = "http://lymesa.catlbattery.com:8103/manufacturing-papiservices/ProcessLotServiceWSService?wsdl", - //site = "2100", url = inifile.IniReadValue("ProcessLotServiceWSServiceParam", "url"), site = inifile.IniReadValue("ProcessLotServiceWSServiceParam", "site"), processlotref = "ProcessLotBO:2100," + rfidStr, memberlist = new string[] { "SFCBO:2100," + sfcStr } }; LogHelper.Info("MES解绑接口请求参数:" + JsonChange.ModeToJson(lotServiceWSServiceParam)); - //upLoadBusiness.SaveLogRecord(position, "MES解绑接口请求参数:" + JsonChange.ModeToJson(lotServiceWSServiceParam)); beginTime = DateTime.Now; try { @@ -355,7 +337,6 @@ namespace MaterialTraceability.Business.Impl { removeMemberResponse removeMember = MesWebServices.iRemoveMember(lotServiceWSServiceParam); LogHelper.Info("MES解绑接口返回参数:" + JsonChange.ModeToJson(removeMember)); - //upLoadBusiness.SaveLogRecord(position, "MES解绑接口返回参数:" + JsonChange.ModeToJson(removeMember)); } } catch (Exception ex) @@ -364,7 +345,6 @@ namespace MaterialTraceability.Business.Impl LogRefreshEvent?.Invoke(LogType.MesLog, String.Format("解绑接口调用异常:{0}", ex.Message)); LogRefreshEvent?.Invoke(LogType.AlarmLog, String.Format("RFID条码:{0}解绑失败:{1}!!!", rfidStr, ex.Message)); - //upLoadBusiness.SaveLogRecord(position, String.Format("RFID条码:{0}解绑失败:{1}!!!", rfidStr, ex.Message)); return; } } @@ -372,7 +352,6 @@ namespace MaterialTraceability.Business.Impl { LogHelper.Info("RFID条码:" + rfidStr + "未绑定SFC信息"); LogRefreshEvent?.Invoke(LogType.RfidLog, "RFID条码:" + rfidStr + "未绑定SFC信息"); - //upLoadBusiness.SaveLogRecord(position, "RFID条码:" + rfidStr + "未绑定SFC信息"); } } @@ -391,25 +370,20 @@ namespace MaterialTraceability.Business.Impl if (!auto) { //清除泄气信号 - plcBusiness.writePlc("D9608", 0); + plcBusiness.writePlc(appConfig.TbAddress.气涨泄气, 0); //清除报警 - plcBusiness.writePlc("D9610", 0); - //写入转塔是否可以旋转 - //PlcBusiness.writePlc("D9602", 1); + plcBusiness.writePlc(appConfig.TbAddress.RFID异常, 0); } try { - //LogHelper.Info("解绑RFID条码" + epc + "绑定的SFC信息"); - //LogRefreshEvent?.Invoke(LogType.RfidLog, logStr + "解绑RFID条码:" + epc + "绑定的SFC信息"); - //this.UnBindRfidAndSfc(position,epc); #region Add By wenjy 2022-09-20 获取工单信息,判断是否需要更换工单 if (!ShopOrderAlarm(position)) { //MES接口返回异常,控制PLC气胀轴写1泄气 - plcBusiness.writePlc("D9608", 1); + plcBusiness.writePlc(appConfig.TbAddress.气涨泄气, 1); //写入报警 - plcBusiness.writePlc("D9612", 1); + plcBusiness.writePlc(appConfig.TbAddress.MES异常, 1); return; } #endregion @@ -433,28 +407,9 @@ namespace MaterialTraceability.Business.Impl #endregion LogHelper.Info("涂布工单下达接口调用成功,SFC膜卷号为:" + sfc); - //upLoadBusiness.SaveLogRecord(position, "涂布工单下达接口调用成功,SFC膜卷号为:" + sfc); LogRefreshEvent?.Invoke(LogType.MesLog, "MES涂布工单下达接口调用成功,膜卷号:" + sfc); GetSFCByMesEvent?.Invoke(true, sfc); - #region 下发膜卷号 Delete By wenjy 2022-12-16 - //if (position == 1) - //{ - // LogHelper.Info("将SFC与RFID写入PLC地址"); - // //upLoadBusiness.SaveLogRecord(position, "将SFC与RFID写入PLC地址"); - // PlcBusiness.writeStrPlc("D9630", sfc); - // PlcBusiness.writeStrPlc("D9640", epc); - // LogRefreshEvent?.Invoke(LogType.PlcLog, "将SFC与RFID写入PLC地址"); - //} - //else - //{ - // LogHelper.Info("将SFC与RFID写入PLC地址"); - // //upLoadBusiness.SaveLogRecord(position, "将SFC与RFID写入PLC地址"); - // PlcBusiness.writeStrPlc("D9660", sfc); - // PlcBusiness.writeStrPlc("D9670", epc); - // LogRefreshEvent?.Invoke(LogType.PlcLog, "将SFC与RFID写入PLC地址"); - //} - #endregion WriteSfcAndEpc(position, sfc, epc); ViewModelRefreshEvent?.Invoke(new ViewModelDto() @@ -469,11 +424,9 @@ namespace MaterialTraceability.Business.Impl plcStatus = true, }); LogHelper.Info("本地保存RFID及膜卷号信息生成收卷记录"); - //upLoadBusiness.SaveLogRecord(position, "本地保存RFID及膜卷号信息生成收卷记录"); //实时绑定卷轴与RFID信息 LogHelper.Info(String.Format("绑定{0}卷轴与RFID:{1}获取卷轴信息", logStr, epc)); - //upLoadBusiness.SaveLogRecord(position, String.Format("绑定{0}卷轴与RFID:{1}获取卷轴信息", logStr, epc)); Expression> exp = s1 => true; exp = exp.And(x => x.positionId == position.ToString() && x.processId == appConfig.processId); Expression> order = (x) => x.bindTime; @@ -483,21 +436,18 @@ namespace MaterialTraceability.Business.Impl { LogRefreshEvent?.Invoke(LogType.RfidLog, "绑定卷轴与RFID条码获取卷轴信息为空"); LogRefreshEvent?.Invoke(LogType.AlarmLog, "绑定卷轴与RFID条码获取卷轴信息为空"); - //upLoadBusiness.SaveLogRecord(position, "绑定卷轴与RFID条码获取卷轴信息为空"); LogHelper.Info("绑定卷轴与RFID获取卷轴信息为空"); return; } LogHelper.Info("获取卷轴信息为:" + JsonChange.ModeToJson(shaftInfo)); - //upLoadBusiness.SaveLogRecord(position, "获取卷轴信息为:" + JsonChange.ModeToJson(shaftInfo)); shaftInfo.bindRfid = epc; shaftInfo.bindSfc = sfc; shaftInfo.bindTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); await shaftInfoServices.Update(shaftInfo); LogHelper.Info("本地绑定RFID:" + epc + ",SFC:" + sfc); - //upLoadBusiness.SaveLogRecord(position, "本地绑定RFID:" + epc + ",SFC:" + sfc); //PLC允许转塔 D9602写1 - plcBusiness.writePlc("D9602", 1); + plcBusiness.writePlc(appConfig.TbAddress.是否转塔, 1); //添加下料记录 ProDownRecord downRecord = new ProDownRecord() @@ -518,7 +468,6 @@ namespace MaterialTraceability.Business.Impl catch (Exception e) { LogHelper.Info(e.ToString()); - //upLoadBusiness.SaveLogRecord(position, "卷筒涨紧MES处理信号异常:" + e.ToString()); } } @@ -528,15 +477,15 @@ namespace MaterialTraceability.Business.Impl if (position == 1) { LogHelper.Info("将SFC与RFID写入PLC地址"); - PlcBusiness.writeStrPlc("D9630", sfcStr); - PlcBusiness.writeStrPlc("D9650", rfidStr); + PlcBusiness.writeStrPlc(appConfig.TbAddress.A轴膜卷号, sfcStr); + PlcBusiness.writeStrPlc(appConfig.TbAddress.A轴标签号, rfidStr); LogRefreshEvent?.Invoke(LogType.PlcLog, "将SFC与RFID写入PLC地址"); } else { LogHelper.Info("将SFC与RFID写入PLC地址"); - PlcBusiness.writeStrPlc("D9670", sfcStr); - PlcBusiness.writeStrPlc("D9690", rfidStr); + PlcBusiness.writeStrPlc(appConfig.TbAddress.B轴膜卷号, sfcStr); + PlcBusiness.writeStrPlc(appConfig.TbAddress.B轴标签号, rfidStr); LogRefreshEvent?.Invoke(LogType.PlcLog, "将SFC与RFID写入PLC地址"); } @@ -551,22 +500,9 @@ namespace MaterialTraceability.Business.Impl string sfc = ""; LogHelper.Info("调用MES涂布工单下达接口"); LogRefreshEvent?.Invoke(LogType.MesLog, "调用MES涂布工单下达接口"); - //upLoadBusiness.SaveLogRecord(position, "调用MES涂布工单下达接口"); //调MES涂布工单下达接口获取SFC MiReleaseSfcWithActivityServiceServiceParam miReleaseSfcWithActivityServiceServiceParam = new MiReleaseSfcWithActivityServiceServiceParam() { - //url = "http://lymesa.catlbattery.com:8103/atlmeswebservice/MiReleaseSfcWithActivityServiceService?wsdl", - //site = "2100", - //user = "SUP_LYA_RF01", - //operation = appConfig.operation, - //operationRevision = "#", - //activityId = "Z_MD_500", - //Resource = appConfig.resource, - //sfcQty = 1, - //modeProcessSfc = modeProcessSFC.MODE_START_SFC, //MODE_START_SFC - //isCarrierType = false, - //loginUser = "SUP_LYA_RF01", - //password = "CA@TLmespcrf01", url = inifile.IniReadValue("MiReleaseSfcWithActivityServiceServiceParam","url"), site = inifile.IniReadValue("MiReleaseSfcWithActivityServiceServiceParam", "site"), user = inifile.IniReadValue("MiReleaseSfcWithActivityServiceServiceParam", "user"), @@ -585,27 +521,23 @@ namespace MaterialTraceability.Business.Impl { LogHelper.Info("涂布工单下达接口请求参数:" + JsonChange.ModeToJson(miReleaseSfcWithActivityServiceServiceParam)); - //upLoadBusiness.SaveLogRecord(position, "涂布工单下达接口请求参数:" + JsonChange.ModeToJson(miReleaseSfcWithActivityServiceServiceParam)); if (appConfig.isMesFlag == 1) { miReleaseSfcWithActivityResponse releaseSfcWithActivityResponse = MesWebServices.iMiReleaseSfcWithActivityServiceService(miReleaseSfcWithActivityServiceServiceParam); LogHelper.Info("涂布工单下发接口返回参数:" + JsonChange.ModeToJson(releaseSfcWithActivityResponse)); - //upLoadBusiness.SaveLogRecord(position, "涂布工单下发接口返回参数:" + JsonChange.ModeToJson(releaseSfcWithActivityResponse)); if (releaseSfcWithActivityResponse.@return.code > 0) { LogRefreshEvent?.Invoke(LogType.MesLog, "MES涂布工单获取失败:" + upLoadBusiness.GetMesMessage(releaseSfcWithActivityResponse.@return.code, releaseSfcWithActivityResponse.@return.message)); - //upLoadBusiness.SaveLogRecord(position, "MES涂布工单获取失败:" + releaseSfcWithActivityResponse.@return.message); LogRefreshEvent?.Invoke(LogType.AlarmLog, "MES涂布工单单获取:" + upLoadBusiness.GetMesMessage(releaseSfcWithActivityResponse.@return.code, releaseSfcWithActivityResponse.@return.message)); GetSFCByMesEvent?.Invoke(false, ""); //MES接口返回异常,控制PLC气胀轴写1泄气 - plcBusiness.writePlc("D9608", 1); + plcBusiness.writePlc(appConfig.TbAddress.气涨泄气, 1); //写入报警 - plcBusiness.writePlc("D9612", 1); + plcBusiness.writePlc(appConfig.TbAddress.MES异常, 1); //写入转塔是否可以旋转 - plcBusiness.writePlc("D9602", 0); + plcBusiness.writePlc(appConfig.TbAddress.是否转塔, 0); LogHelper.Info("涂布工单下达接口获取失败:" + releaseSfcWithActivityResponse.@return.message + ",下发气胀轴泄气D9608,下发MES接口返回异常报警D9612"); - //upLoadBusiness.SaveLogRecord(position, "涂布工单下达接口获取失败:" + releaseSfcWithActivityResponse.@return.message + ",下发气胀轴泄气D9608,下发MES接口返回异常报警D9612"); return ""; } sfc = releaseSfcWithActivityResponse.@return.sfcArray[0].sfc; @@ -622,14 +554,13 @@ namespace MaterialTraceability.Business.Impl LogRefreshEvent?.Invoke(LogType.AlarmLog, "MES涂布工单下达接口调用异常:" + ex.Message); LogRefreshEvent?.Invoke(LogType.MesLog, "MES涂布工单下达接口调用异常:" + ex.Message); - //upLoadBusiness.SaveLogRecord(position, "MES涂布工单下达接口调用异常:" + ex.Message); GetSFCByMesEvent?.Invoke(false, ""); //读取失败,控制PLC气胀轴 - plcBusiness.writePlc("D9608", 1); + plcBusiness.writePlc(appConfig.TbAddress.气涨泄气, 1); //写入报警 - plcBusiness.writePlc("D9612", 1); + plcBusiness.writePlc(appConfig.TbAddress.MES异常, 1); //写入转塔是否可以旋转 - plcBusiness.writePlc("D9602", 0); + plcBusiness.writePlc(appConfig.TbAddress.是否转塔, 0); return ""; } } @@ -648,25 +579,20 @@ namespace MaterialTraceability.Business.Impl { LogRefreshEvent?.Invoke(LogType.AlarmLog, "获取工单预警设置信息为空"); LogHelper.Info("获取工单预警设置信息为空"); - //upLoadBusiness.SaveLogRecord(position, "获取工单预警设置信息为空"); return false; } string shopOrderStr = shopOrderConfig.Where(x => x.paramKey == "ShopOrder").FirstOrDefault().paramValue; string orderAlarmAmount = shopOrderConfig.Where(x => x.paramKey == "OrderAlarmAmount").FirstOrDefault().paramValue; FindShopRequestParam findShopRequestParam = new FindShopRequestParam() { - //url = "http://lymesa.catlbattery.com:8103/manufacturing-papiservices/ShopOrderServiceWSService?WSDL", - //site = "2100", url = inifile.IniReadValue("FindShopRequestParam","url"), site = inifile.IniReadValue("FindShopRequestParam", "site"), shopOrder = String.Format("ShopOrderBO:2100,{0}", shopOrderStr) }; LogHelper.Info("调用MES获取工单产量信息接口请求参数:"+ JsonChange.ModeToJson(findShopRequestParam)); - //upLoadBusiness.SaveLogRecord(position, "调用MES获取工单产量信息接口请求参数:" + JsonChange.ModeToJson(findShopRequestParam)); var info = MesWebServices.findShopOrder(findShopRequestParam); LogHelper.Info("调用MES获取工单产量信息接口返回参数:"+JsonChange.ModeToJson(info)); - //upLoadBusiness.SaveLogRecord(position, "调用MES获取工单产量信息接口返回参数:" + JsonChange.ModeToJson(info)); var quantityOrderd = info.Response.quantityOrdered; //工单总数量 var quantityReleased = info.Response.quantityReleased; //已下达数量 @@ -675,12 +601,10 @@ namespace MaterialTraceability.Business.Impl return true; } LogRefreshEvent?.Invoke(LogType.AlarmLog, "工单超产,及时更换工单"); - //upLoadBusiness.SaveLogRecord(position, "工单超产,及时更换工单"); return false; }catch(Exception ex) { LogRefreshEvent?.Invoke(LogType.AlarmLog, "工单预警判断异常:"+ex.Message); - //upLoadBusiness.SaveLogRecord(position, "工单预警判断异常:" + ex.Message); return false; } } @@ -701,7 +625,7 @@ namespace MaterialTraceability.Business.Impl LogRefreshEvent?.Invoke(LogType.PlcLog, logStr + "强制下料信号触发成功"); LogRefreshEvent?.Invoke(LogType.PlcLog, logStr + "下发下料信号"); - plcBusiness.writePlc("D9614", 0); + plcBusiness.writePlc(appConfig.TbAddress.控制下料, 0); string bindSfc = ""; @@ -735,7 +659,7 @@ namespace MaterialTraceability.Business.Impl if (downRecord.eaValue < 15) { - int eaValue = PlcBusiness.readPlc("D9616"); + int eaValue = PlcBusiness.readPlc(appConfig.TbAddress.收卷轴米数); LogRefreshEvent.Invoke(LogType.PlcLog, "读取收卷米数:" + eaValue); LogHelper.Info("读取设备收卷米数:" + eaValue); string membraneLength = GetSysConfigList("SysConfig").Where(x => x.paramKey == "membraneLength").FirstOrDefault().paramValue; diff --git a/MaterialTraceability.Business/PlcBusiness.cs b/MaterialTraceability.Business/PlcBusiness.cs index e1b8247..0d60032 100644 --- a/MaterialTraceability.Business/PlcBusiness.cs +++ b/MaterialTraceability.Business/PlcBusiness.cs @@ -174,16 +174,16 @@ namespace MaterialTraceability.Business lock (string.Empty) { //写入心跳 - plcInstance.writeInt32ByAddress("D9628", 1); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.心跳, 1); LogHelper.PlcLog("RFID系统写入心跳D9628"); Thread.Sleep(200); // A轴收卷涨紧 A轴position设为1 - if (plcInstance.readInt32ByAddress("D9600") == 1) + if (plcInstance.readInt32ByAddress(appConfig.TbAddress.A收卷轴涨紧) == 1) { LogHelper.PlcLog("A轴收卷涨紧"); - plcInstance.writeInt32ByAddress("D9604", 1); - plcInstance.writeInt32ByAddress("D9600", 0); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.涨紧信号清除, 1); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.A收卷轴涨紧, 0); if (isReadFlag(ref lastReadTime_A_Begin)) { SignalRefreshEvent?.Invoke(3, 1); @@ -191,11 +191,11 @@ namespace MaterialTraceability.Business } // B轴收卷涨紧 B轴position设为2 - if (plcInstance.readInt32ByAddress("D9620") == 1) + if (plcInstance.readInt32ByAddress(appConfig.TbAddress.B收卷轴涨紧) == 1) { LogHelper.PlcLog("B轴收卷涨紧"); - plcInstance.writeInt32ByAddress("D9604", 1); - plcInstance.writeInt32ByAddress("D9620", 0); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.涨紧信号清除, 1); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.B收卷轴涨紧, 0); if (isReadFlag(ref lastReadTime_B_Begin)) { SignalRefreshEvent?.Invoke(3, 2); @@ -204,10 +204,10 @@ namespace MaterialTraceability.Business #region 收卷开始信号 Add By wenjy 2022-11-29 // A轴收卷开始信号 - if (plcInstance.readInt32ByAddress("D9720") == 1) + if (plcInstance.readInt32ByAddress(appConfig.TbAddress.收卷轴开始) == 1) { LogHelper.PlcLog("A轴收卷开始信号 D9720==1 -> 0"); - plcInstance.writeInt32ByAddress("D9720", 0); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.收卷轴开始, 0); if (isReadFlag(ref lastReadTime_A_End)) { SignalRefreshEvent?.Invoke(7, 1); @@ -215,10 +215,10 @@ namespace MaterialTraceability.Business } // B轴收卷开始信号 - if (plcInstance.readInt32ByAddress("D9720") == 2) + if (plcInstance.readInt32ByAddress(appConfig.TbAddress.收卷轴开始) == 2) { LogHelper.PlcLog("B轴收卷开始信号 D9720==2 -> 0"); - plcInstance.writeInt32ByAddress("D9720", 0); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.收卷轴开始, 0); if (isReadFlag(ref lastReadTime_B_End)) { @@ -228,12 +228,12 @@ namespace MaterialTraceability.Business #endregion // A轴收卷完工信号 - if (plcInstance.readInt32ByAddress("D9606") == 1) + if (plcInstance.readInt32ByAddress(appConfig.TbAddress.A收卷轴完工) == 1) { LogHelper.PlcLog("A轴收卷完工信号"); - plcInstance.writeInt32ByAddress("D9614", 1); - plcInstance.writeInt32ByAddress("D9606", 0); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.控制下料, 1); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.A收卷轴完工, 0); if (isReadFlag(ref lastReadTime_A_End)) { SignalRefreshEvent?.Invoke(4, 1); @@ -241,11 +241,11 @@ namespace MaterialTraceability.Business } // B轴收卷完工信号 - if (plcInstance.readInt32ByAddress("D9626") == 1) + if (plcInstance.readInt32ByAddress(appConfig.TbAddress.B收卷轴完工) == 1) { LogHelper.PlcLog("B轴收卷完工信号"); - plcInstance.writeInt32ByAddress("D9614", 1); - plcInstance.writeInt32ByAddress("D9626", 0); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.控制下料, 1); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.B收卷轴完工, 0); if (isReadFlag(ref lastReadTime_B_End)) { @@ -254,10 +254,10 @@ namespace MaterialTraceability.Business } //A轴强制下料 - if (plcInstance.readInt32ByAddress("D9618") == 1) + if (plcInstance.readInt32ByAddress(appConfig.TbAddress.强制下料) == 1) { LogHelper.PlcLog("A轴强制下料"); - plcInstance.writeInt32ByAddress("D9618", 0); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.强制下料, 0); if (isReadFlag(ref lastReadTime_Force)) { @@ -266,10 +266,10 @@ namespace MaterialTraceability.Business } //B轴强制下料 - if (plcInstance.readInt32ByAddress("D9618") == 2) + if (plcInstance.readInt32ByAddress(appConfig.TbAddress.强制下料) == 2) { LogHelper.PlcLog("B轴强制下料"); - plcInstance.writeInt32ByAddress("D9618", 0); + plcInstance.writeInt32ByAddress(appConfig.TbAddress.强制下料, 0); if (isReadFlag(ref lastReadTime_Force)) { SignalRefreshEvent?.Invoke(5, 2); diff --git a/MaterialTraceability.Entity/Config/TbAddress.cs b/MaterialTraceability.Entity/Config/TbAddress.cs new file mode 100644 index 0000000..42629e2 --- /dev/null +++ b/MaterialTraceability.Entity/Config/TbAddress.cs @@ -0,0 +1,64 @@ +using MaterialTraceability.Common; +using MaterialTraceability.Entity.DTO; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MaterialTraceability.Entity.Config +{ + public sealed class TbAddress + { + private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/PlcConfig/App.InI"); + + private static readonly Lazy lazy = new Lazy(() => new TbAddress()); + + public static TbAddress Instance + { + get + { + return lazy.Value; + } + } + + private TbAddress() { } + + public string 心跳 = iNIFile.IniReadValue("TBPLcAddress", "心跳"); + + public string A收卷轴涨紧 = iNIFile.IniReadValue("TBPLcAddress", "A收卷轴涨紧"); + + public string B收卷轴涨紧 = iNIFile.IniReadValue("TBPLcAddress", "B收卷轴涨紧"); + + public string 涨紧信号清除 = iNIFile.IniReadValue("TBPLcAddress", "涨紧信号清除"); + + public string 收卷轴开始 = iNIFile.IniReadValue("TBPLcAddress", "收卷轴开始"); + + public string A收卷轴完工 = iNIFile.IniReadValue("TBPLcAddress", "A收卷轴完工"); + + public string B收卷轴完工 = iNIFile.IniReadValue("TBPLcAddress", "B收卷轴完工"); + + public string 强制下料 = iNIFile.IniReadValue("TBPLcAddress", "强制下料"); + + public string 控制下料 = iNIFile.IniReadValue("TBPLcAddress", "控制下料"); + + public string 气涨泄气 = iNIFile.IniReadValue("TBPLcAddress", "气涨泄气"); + + public string RFID异常 = iNIFile.IniReadValue("TBPLcAddress", "RFID异常"); + + public string MES异常 = iNIFile.IniReadValue("TBPLcAddress", "MES异常"); + + public string 是否转塔 = iNIFile.IniReadValue("TBPLcAddress", "是否转塔"); + + public string A轴膜卷号 = iNIFile.IniReadValue("TBPLcAddress", "A轴膜卷号"); + + public string A轴标签号 = iNIFile.IniReadValue("TBPLcAddress", "A轴标签号"); + + public string B轴膜卷号 = iNIFile.IniReadValue("TBPLcAddress", "B轴膜卷号"); + + public string B轴标签号 = iNIFile.IniReadValue("TBPLcAddress", "B轴标签号"); + + public string 收卷轴米数 = iNIFile.IniReadValue("TBPLcAddress", "收卷轴米数"); + + } +} diff --git a/MaterialTraceability.Entity/DTO/AppConfigDto.cs b/MaterialTraceability.Entity/DTO/AppConfigDto.cs index db7813c..cd3cc1a 100644 --- a/MaterialTraceability.Entity/DTO/AppConfigDto.cs +++ b/MaterialTraceability.Entity/DTO/AppConfigDto.cs @@ -1,4 +1,5 @@ using MaterialTraceability.Common; +using MaterialTraceability.Entity.Config; using System; using System.Collections.Generic; using System.Linq; @@ -46,5 +47,7 @@ namespace MaterialTraceability.Entity.DTO public string operationByB = iNIFile.IniReadValue("SystemConfig", "operationByB"); public string MesWebServiceTimeOut = iNIFile.IniReadValue("SystemConfig", "MesWebServiceTimeOut"); + + public TbAddress TbAddress = TbAddress.Instance; } } diff --git a/MaterialTraceability.Entity/MaterialTraceability.Entity.csproj b/MaterialTraceability.Entity/MaterialTraceability.Entity.csproj index 0cadf35..333fb0e 100644 --- a/MaterialTraceability.Entity/MaterialTraceability.Entity.csproj +++ b/MaterialTraceability.Entity/MaterialTraceability.Entity.csproj @@ -44,6 +44,7 @@ + diff --git a/MaterialTraceabilityUI/CoatingProcess.xaml.cs b/MaterialTraceabilityUI/CoatingProcess.xaml.cs index f79c73b..e93eafd 100644 --- a/MaterialTraceabilityUI/CoatingProcess.xaml.cs +++ b/MaterialTraceabilityUI/CoatingProcess.xaml.cs @@ -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 } /// @@ -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); } } diff --git a/MaterialTraceabilityUI/TBAlarmRecord.xaml.cs b/MaterialTraceabilityUI/TBAlarmRecord.xaml.cs index d812047..9ad6518 100644 --- a/MaterialTraceabilityUI/TBAlarmRecord.xaml.cs +++ b/MaterialTraceabilityUI/TBAlarmRecord.xaml.cs @@ -228,7 +228,6 @@ namespace MaterialTraceabilityUI return; } LogHelperBusiness.LogInfo("调用MES注销SFC接口"); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES注销SFC接口"); MiSignOffSFCsServiceServiceParam miSignOffSFCsServiceServiceParam = new MiSignOffSFCsServiceServiceParam() { url = inifile.IniReadValue("MiSignOffSFCsServiceServiceParam", "url"), @@ -247,13 +246,11 @@ namespace MaterialTraceabilityUI { LogHelperBusiness.LogInfo("调用MES注销SFC接口,请求参数:" + JsonChange.ModeToJson(miSignOffSFCsServiceServiceParam)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.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(downRecord.PositionId), "调用MES注销SFC接口,返回参数:" + JsonChange.ModeToJson(signOffSFCsResponse)); if (signOffSFCsResponse.@return.code > 0) { if (signOffSFCsResponse.@return.code == 13900) @@ -292,7 +289,6 @@ namespace MaterialTraceabilityUI private bool CancelSfcFunction(ProDownRecordDto downRecord) { LogHelperBusiness.LogInfo("调用MES注销SFC接口"); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES注销SFC接口"); MiSignOffSFCsServiceServiceParam miSignOffSFCsServiceServiceParam = new MiSignOffSFCsServiceServiceParam() { @@ -312,13 +308,11 @@ namespace MaterialTraceabilityUI { LogHelperBusiness.LogInfo("调用MES注销SFC接口,请求参数:" + JsonChange.ModeToJson(miSignOffSFCsServiceServiceParam)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.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(downRecord.PositionId), "调用MES注销SFC接口,返回参数:" + JsonChange.ModeToJson(signOffSFCsResponse)); if (signOffSFCsResponse.@return.code > 0) { if (signOffSFCsResponse.@return.code == 13900) @@ -340,7 +334,6 @@ namespace MaterialTraceabilityUI catch (Exception ex) { MessageBox.Show("注销SFC接口调用异常:" + ex.Message); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "注销SFC接口调用异常:" + ex.Message); ProcessStatus(1, false); return false; } @@ -408,13 +401,11 @@ namespace MaterialTraceabilityUI { LogHelperBusiness.LogInfo("调用MES调整A面数量接口,请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES调整A面数量接口,请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam)); if (appConfig.isMesFlag == 1) { var requestResult = MesWebServices.iMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam); LogHelperBusiness.LogInfo("调用MES调整A面数量接口,返回参数:" + JsonChange.ModeToJson(requestResult)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES调整A面数量接口,返回参数:" + JsonChange.ModeToJson(requestResult)); if (requestResult.@return.code > 0) { MessageBox.Show("A面数量调整失败:" + upLoadBusiness.GetMesMessage(requestResult.@return.code, requestResult.@return.message)); @@ -428,7 +419,6 @@ namespace MaterialTraceabilityUI catch (Exception ex) { MessageBox.Show("A面数量调整异常:" + ex.Message); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "A面数量调整异常:" + ex.Message); WebServiceLog.saveMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam, null, beginTime, ex.Message); ProcessStatus(2, false); Refresh(); @@ -471,13 +461,11 @@ namespace MaterialTraceabilityUI { LogHelperBusiness.LogInfo("调用MES调整A面数量接口,请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES调整A面数量接口,请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam)); if (appConfig.isMesFlag == 1) { var requestResult = MesWebServices.iMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam); LogHelperBusiness.LogInfo("调用MES调整A面数量接口,返回参数:" + JsonChange.ModeToJson(requestResult)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES调整A面数量接口,返回参数:" + JsonChange.ModeToJson(requestResult)); if (requestResult.@return.code > 0) { MessageBox.Show("A面数量调整失败:" + upLoadBusiness.GetMesMessage(requestResult.@return.code, requestResult.@return.message)); @@ -489,7 +477,6 @@ namespace MaterialTraceabilityUI catch (Exception ex) { MessageBox.Show("A面数量调整异常:" + ex.Message); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "A面数量调整异常:" + ex.Message); WebServiceLog.saveMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam, null, beginTime, ex.Message); ProcessStatus(2, false); return false; @@ -529,7 +516,6 @@ namespace MaterialTraceabilityUI } } LogHelperBusiness.LogInfo("调用MES A面入账开始接口"); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES A面入账开始接口"); MiFirstOperationForsfcServiceServiceParam miFirstOperationForsfcServiceServiceParam = new MiFirstOperationForsfcServiceServiceParam() { @@ -548,12 +534,10 @@ namespace MaterialTraceabilityUI { LogHelperBusiness.LogInfo("调用MES A面入账开始接口,请求参数:" + JsonChange.ModeToJson(miFirstOperationForsfcServiceServiceParam)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES A面入账开始接口,请求参数:" + JsonChange.ModeToJson(miFirstOperationForsfcServiceServiceParam)); if (appConfig.isMesFlag == 1) { miFirstOperationForsfcResponse firstOperationForsfcResponse = MesWebServices.iMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam); LogHelperBusiness.LogInfo("调用MES A面入账开始接口,返回参数:" + JsonChange.ModeToJson(firstOperationForsfcResponse)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES A面入账开始接口,返回参数:" + JsonChange.ModeToJson(firstOperationForsfcResponse)); if (firstOperationForsfcResponse.@return.code > 0) { ProcessStatus(3, false); @@ -566,7 +550,6 @@ namespace MaterialTraceabilityUI catch (Exception ex) { MessageBox.Show("调用A面入账接口异常:" + ex.Message); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用A面入账接口异常:" + ex.Message); ProcessStatus(3, false); Refresh(); @@ -600,13 +583,11 @@ namespace MaterialTraceabilityUI { LogHelperBusiness.LogInfo("调用MES A面入账开始接口,请求参数:" + JsonChange.ModeToJson(miFirstOperationForsfcServiceServiceParam)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES A面入账开始接口,请求参数:" + JsonChange.ModeToJson(miFirstOperationForsfcServiceServiceParam)); if (appConfig.isMesFlag == 1) { miFirstOperationForsfcResponse firstOperationForsfcResponse = MesWebServices.iMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam); LogHelperBusiness.LogInfo("调用MES A面入账开始接口,返回参数:" + JsonChange.ModeToJson(firstOperationForsfcResponse)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES A面入账开始接口,返回参数:" + JsonChange.ModeToJson(firstOperationForsfcResponse)); if (firstOperationForsfcResponse.@return.code > 0) { MessageBox.Show("调用A面入账接口失败:" + upLoadBusiness.GetMesMessage(firstOperationForsfcResponse.@return.code, firstOperationForsfcResponse.@return.message)); @@ -621,7 +602,6 @@ namespace MaterialTraceabilityUI { MessageBox.Show("调用A面入账接口异常:" + ex.Message); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用A面入账接口异常:" + ex.Message); ProcessStatus(3, false); Refresh(); @@ -732,13 +712,11 @@ namespace MaterialTraceabilityUI { LogHelperBusiness.LogInfo("调用A面完工接口,请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用A面完工接口,请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam)); if (appConfig.isMesFlag == 1) { var requestResult = MesWebServices.iMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam); LogHelperBusiness.LogInfo("调用A面完工接口,返回参数:" + JsonChange.ModeToJson(requestResult)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用A面完工接口,返回参数:" + JsonChange.ModeToJson(requestResult)); if (requestResult.@return.code > 0) { MessageBox.Show("调用A面完工接口失败:" + upLoadBusiness.GetMesMessage(requestResult.@return.code, requestResult.@return.message)); @@ -751,7 +729,6 @@ namespace MaterialTraceabilityUI catch (Exception ex) { MessageBox.Show("调用A面完工接口异常:" + ex.Message); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用A面完工接口异常:" + ex.Message); ProcessStatus(4, false); return false; } @@ -856,13 +833,11 @@ namespace MaterialTraceabilityUI { LogHelperBusiness.LogInfo("调用MES B面开始接口请求参数:" + JsonChange.ModeToJson(miFirstOperationForsfcServiceServiceParam)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES B面开始接口请求参数:" + JsonChange.ModeToJson(miFirstOperationForsfcServiceServiceParam)); if (appConfig.isMesFlag == 1) { miFirstOperationForsfcResponse firstOperationForsfcResponse = MesWebServices.iMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam); LogHelperBusiness.LogInfo("调用MES B面开始接口返回参数:" + JsonChange.ModeToJson(firstOperationForsfcResponse)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES B面开始接口返回参数:" + JsonChange.ModeToJson(firstOperationForsfcResponse)); WebServiceLog.saveMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam, firstOperationForsfcResponse, beginTime, ""); if (firstOperationForsfcResponse.@return.code > 0) { @@ -876,7 +851,6 @@ namespace MaterialTraceabilityUI { MessageBox.Show("调用MES B面开始接口异常:" + ex.Message); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES B面开始接口异常:" + ex.Message); WebServiceLog.saveMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam, null, beginTime, ex.Message); ProcessStatus(5, false); return false; @@ -1028,14 +1002,12 @@ namespace MaterialTraceabilityUI { LogHelperBusiness.LogInfo("调用MES B面完工接口,请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES B面完工接口,请求参数:" + JsonChange.ModeToJson(miBatchCompleteSfcAndAdujustQtyServiceServiceParam)); if (appConfig.isMesFlag == 1) { var requestResult = MesWebServices.iMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam); WebServiceLog.saveMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam, requestResult, beginTime, ""); LogHelperBusiness.LogInfo("调用MES B面完工接口,返回参数:" + JsonChange.ModeToJson(requestResult)); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES B面完工接口,返回参数:" + JsonChange.ModeToJson(requestResult)); if (requestResult.@return.code > 0) { MessageBox.Show("调用MES B面完工接口失败:" + upLoadBusiness.GetMesMessage(requestResult.@return.code, requestResult.@return.message)); @@ -1047,7 +1019,6 @@ namespace MaterialTraceabilityUI catch (Exception ex) { MessageBox.Show("调用MES B面完工接口异常:" + ex.Message); - //upLoadBusiness.SaveLogRecord(Convert.ToInt32(downRecord.PositionId), "调用MES B面完工接口异常:" + ex.Message); WebServiceLog.saveMiBatchCompleteSfcAndAdujustQtyServiceService(miBatchCompleteSfcAndAdujustQtyServiceServiceParam, null, beginTime, ex.Message); ProcessStatus(6, false); return false;