浏览代码

Z991239-6228 #comment feat: 大机卡机日志精简

Signed-Off-By: commit-hook
刘文涛80174520 4 月之前
父节点
当前提交
7cb06aa64a
共有 2 个文件被更改,包括 10 次插入22 次删除
  1. 8 20
      Module/mod_CardIssuerStand/CardIssuerFSM.cpp
  2. 2 2
      Module/mod_CardIssuerStand/mod_cardissuer.h

+ 8 - 20
Module/mod_CardIssuerStand/CardIssuerFSM.cpp

@@ -1949,7 +1949,7 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerStandService_Issue_Req,
 			LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_Invalid_Hopper, errMsg.GetData());
 			return Error_Param;
 		}
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("IssueCard, m_bHasHopper[ctxEx->Req.hopper - 1]:%d", m_bHasHopper[ctxEx->Req.hopper - 1]));
+
 		if (!m_bHasHopper[ctxEx->Req.hopper - 1])
 		{
 			switch (ctxEx->Req.hopper)
@@ -1982,7 +1982,7 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerStandService_Issue_Req,
 	}
 	else
 		m_currentHopper = 1;
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("IssueCard, current hopper:%d", m_currentHopper));
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("IssueCard, current hopper:%d", m_currentHopper));
 	m_pCardProcess->DataInit();
 	if (m_mixedEx[m_currentHopper - 1] >= 3)
 	{
@@ -4042,9 +4042,6 @@ bool CCardIssuerFSM::SetCardIssued(const int num, const int hopper)
 	eErrDev = spConfig->WriteConfigValueInt(section, "CardIssued", num);
 	if (eErrDev == Error_Succeed)
 	{
-		//if (section.Compare("1") == 0)
-		//	spConfig->WriteConfigValueInt("RunInfo", "CardIssued", num);
-		//oilyang 回写新section
 		if (hopper == 1)
 		{
 			int xNum = 0;
@@ -4054,7 +4051,6 @@ bool CCardIssuerFSM::SetCardIssued(const int num, const int hopper)
 				spConfig->WriteConfigValueInt("all", "HopperNum", 1);
 		}
 		//oilyang@20170428 汪磊东要求单卡箱也要同步数据
-		//if (m_hopperNum != 1 && !m_bSettingMaterial)
 		if (!m_bSettingMaterial)
 		{
 			bool bMaintain[12];
@@ -4116,19 +4112,16 @@ bool CCardIssuerFSM::SetCardRemains(const int num, const int hopper,bool bInit)
 	{
 		if (bInit)
 		{
-			//if (section.Compare("1") == 0)
-			//	spConfig->WriteConfigValueInt("RunInfo", "CardInit", num);
+
 			eErrDev = spConfig->WriteConfigValueInt(section, "CardInit", num);
 		}
-		//if (section.Compare("1") == 0)
-		//	spConfig->WriteConfigValueInt("RunInfo", "CardRemains", num);
+
 		if (eErrDev != Error_Succeed)
 		{
 			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("<SetCardRemains>, write CardInit err:%d", eErrDev);
 			return false;
 		}
 		//oilyang@20170428 汪磊东要求单卡箱也要同步数据
-		//if (m_hopperNum != 1 && !m_bSettingMaterial)
 		if (!m_bSettingMaterial)
 		{
 			bool bMaintain[12];
@@ -4177,15 +4170,13 @@ bool CCardIssuerFSM::SetCardMixed(const int num, const int hopper)
 	_itoa(hopper, (char*)buf, 10);
 	CSimpleStringA section(buf);
 	eErrDev = spConfig->WriteConfigValueInt(section, "CardMixed", num);
-	//if (section.Compare("1") == 0)
-	//	spConfig->WriteConfigValueInt("RunInfo", "CardMixed", num);
+
 	if (eErrDev != Error_Succeed)
 	{
 		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("<SetCardMixed>, write CardMixed err:%d", eErrDev);
 		return false;
 	}
 	//oilyang@20170428 汪磊东要求单卡箱也要同步数据
-	//if (m_hopperNum != 1 && !m_bSettingMaterial)
 	if (!m_bSettingMaterial)
 	{
 		bool bMaintain[12];
@@ -4314,11 +4305,9 @@ int CCardIssuerFSM::SyncDataToDB(bool bMaintain[12], bool bSetCaptured)
 
 	SyncMaterialCountInfo info = {};
 	info.dwCardBoxNum = m_hopperNum;
-
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s",(const char*)m_csMachineType);
 	info.strDeviceNo = m_terminalNo;
 
-	DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("<SyncDataToDB>, to init sync info, CardBox Num:%d, DeviceNo:%s", info.dwCardBoxNum, info.strDeviceNo.GetData());
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<SyncDataToDB>, to init sync info, CardBox Num:%d, DeviceNo:%s", info.dwCardBoxNum, info.strDeviceNo.GetData());
 	info.arrMaintainFlag.Init(m_hopperNum+1);
 	info.arrMaintainer.Init(m_hopperNum+1);
 	info.arrMaintainTime.Init(m_hopperNum+1);
@@ -4345,7 +4334,7 @@ int CCardIssuerFSM::SyncDataToDB(bool bMaintain[12], bool bSetCaptured)
 		info.arrCardMixed[i] = m_mixedEx[i];
 		info.arrCardPercent[i] = m_CardPercentEx[i];
 
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("hopper(%d), Maintain:%d, MaintainerEx:%s, MaintainTimeEx:%d, CardBoxNoEx:%s, PsbCodeEx:%s, PsbNameEx:%s, CardInitEx:%d, RemainsEx:%d, IssuedEx:%d, MixedEx:%d, CardPercentEx:%d",
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("hopper(%d), Maintain:%d, MaintainerEx:%s, MaintainTimeEx:%d, CardBoxNoEx:%s, PsbCodeEx:%s, PsbNameEx:%s, CardInitEx:%d, RemainsEx:%d, IssuedEx:%d, MixedEx:%d, CardPercentEx:%d",
 			i, bMaintain[i],
 			m_MaintainerEx[i].GetData(),
 			m_MaintainTimeEx[i],
@@ -4377,7 +4366,7 @@ int CCardIssuerFSM::SyncDataToDB(bool bMaintain[12], bool bSetCaptured)
 		info.arrCardIssued[m_hopperNum] = 0;
 		info.arrCardMixed[m_hopperNum] = 0;
 		info.arrCardPercent[m_hopperNum] = 0;
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("MaintainFlag:%d, CardRemains:%d, Maintainer:%s, MaintainTime:%d",
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("MaintainFlag:%d, CardRemains:%d, Maintainer:%s, MaintainTime:%d",
 			info.arrMaintainFlag[m_hopperNum],
 			info.arrCardRemains[m_hopperNum],
 			info.arrMaintainer[m_hopperNum].GetData(),
@@ -4715,7 +4704,6 @@ bool CCardIssuerFSM::SyncMaterialCount(IHttpFunc* client,SyncMaterialCountInfo s
 		bool isSucc = rootRet["success"].asBool();
 		if (isSucc){
 			//成功
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("<SyncMaterialCount>, succ");
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402203Z02")("同步物料计数成功");
 			return true;
 		}

+ 2 - 2
Module/mod_CardIssuerStand/mod_cardissuer.h

@@ -165,7 +165,7 @@ public:
 			if (ctx->Req.reserved1.GetLength() > 0 && strnicmp("kaku#", (const char*)ctx->Req.reserved1, 5) == 0)
 			{
 				int state = m_fsm.GetFSMState();
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("m_currentFSMState:%d", state));
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("PreOnline m_currentFSMState:%d", state));
 				if (state == 9)
 				{
 					ctx->Answer(Error_BridgeNotOK);
@@ -270,7 +270,7 @@ public:
 	{
 		LOG_FUNCTION();
 		int state = m_fsm.GetFSMState();
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("m_currentFSMState:%d", state));
+
 		if (!m_fsm.GetDevInitFlag()) {
 			ctx->Answer(Error_DevNotAvailable, CardIssuer_UserErrorCode_DevOpen_Failed);
 		}