📄 statereport.cpp
字号:
#include "StateReport.h"
int CStateReport::InsertReport( StruDispense &stDispense )
{
long j = 0 ;
long report_id = oCode.NewCode( "REPORT_ID" );
if ( report_id > 0 )
{
t_mobile_report.Clear();
t_mobile_report.REPORT_ID = report_id;
t_mobile_report.MSGID = stDispense.msg_id;
t_mobile_report.ACCT_NBR = stDispense.acct_nbr;
t_mobile_report.DEST_NBR = stDispense.dest_nbr;
t_mobile_report.SERVICE_CODE = stDispense.service_code ;
t_mobile_report.SEND_TIME = stDispense.send_time ;
j = t_mobile_report.Insert();
if (j > 0)
Connect.Commit();
else
Connect.Rollback();
}
else
j = -1 ;
return int(j) ;
}
int CStateReport::SetState( StruReport &stReport )
{
pcSql[ 0 ] = 0 ;
sprintf( pcSql," MSGID = '%s' ",stReport.message_id ) ;
long j = t_mobile_report.Query( pcSql ) ;
if ( j > 0 )
{
if ( 0 == strcmp( stReport.state,"0") )
{
t_mobile_report_log.Clear() ;
t_mobile_report_log = t_mobile_report ;
t_mobile_report_log.STATE = stReport.state ;
t_mobile_report_log.SMCSEQUENCE = stReport.ErrorCode ;
j = t_mobile_report_log.Insert() ;
if ( j > 0 )
j = t_mobile_report.Delete() ;
}
else
{
sprintf( pcSql," UPDATE %s SET STATE = '%s',SMCSEQUENCE = %u WHERE MSGID = '%s' ",
m_sReportName,
stReport.state,
stReport.ErrorCode,//暂存
stReport.message_id ) ;
j = Connect.ExecSql( pcSql ) ;
}
if ( j > 0 )
Connect.Commit() ;
else
Connect.Rollback() ;
}
return int(j) ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -