Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
539
Server/Billing/MediaWebBilling/MediaWebBilling.cpp
Normal file
539
Server/Billing/MediaWebBilling/MediaWebBilling.cpp
Normal file
@@ -0,0 +1,539 @@
|
||||
// MediaWebBilling.cpp : 응용 프로그램에 대한 진입점을 정의합니다.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MediaWebBilling.h"
|
||||
#include <myOLEDB.h>
|
||||
#include <Config.h>
|
||||
#include <Log.h>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <ctime>
|
||||
#include <vector>
|
||||
#include <oledb.h>
|
||||
#include <srv.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
template<class _Elem, class _Traits>
|
||||
inline basic_ostream<_Elem, _Traits>& __cdecl writetime(basic_ostream<_Elem, _Traits>& _Ostr)
|
||||
{
|
||||
SYSTEMTIME systime;
|
||||
GetLocalTime(&systime);
|
||||
|
||||
_Elem fill = _Ostr.fill();
|
||||
|
||||
_Ostr << setfill('0')
|
||||
<< "["
|
||||
<< setw(4) << systime.wYear << "-"
|
||||
<< setw(2) << systime.wMonth << "-"
|
||||
<< setw(2) << systime.wDay << " "
|
||||
<< setw(2) << systime.wHour << ":"
|
||||
<< setw(2) << systime.wMinute << ":"
|
||||
<< setw(2) << systime.wSecond << "] " << setfill(fill);
|
||||
|
||||
return (_Ostr);
|
||||
}
|
||||
|
||||
inline std::string& addNumber(std::string& str, const char* szData)
|
||||
{
|
||||
const char* szWriteData = (0 == strlen(szData)) ? "NULL" : szData;
|
||||
|
||||
str += szWriteData;
|
||||
str += ", ";
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
inline std::string& addString(std::string& str, const char* szData)
|
||||
{
|
||||
if(0 == strlen(szData))
|
||||
{
|
||||
str += "NULL, ";
|
||||
}
|
||||
else
|
||||
{
|
||||
str += "'";
|
||||
str += szData;
|
||||
str += "', ";
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
#pragma pack(1)
|
||||
struct MWBillingData
|
||||
{
|
||||
DBCHAR m_CRMCode[16]; // PC방 CRMCode
|
||||
DBCHAR m_Command[16]; // 처리 command
|
||||
|
||||
DBCHAR m_CRMIP1[13]; // 서비스ip대역1
|
||||
DBCHAR m_CRMIP2[13]; // 서비스ip대역2
|
||||
DBCHAR m_CRMIP3[13]; // 서비스ip대역3
|
||||
|
||||
DBCHAR m_Index[11]; // 자동증가(SEQID)
|
||||
DBCHAR m_ServiceTime[11]; // 정량제시간
|
||||
DBCHAR m_EndTime[11]; // 선승일, 보상 요청시간
|
||||
DBCHAR m_ServiceIPNum[11]; // 정액제구매ip개수
|
||||
|
||||
DBCHAR m_SysDay[20]; // 결재일 YYYY-MM-DD HH24:MI:SS
|
||||
DBCHAR m_ServiceDay[11]; // 정액제만료일 YYYY-MM-DD
|
||||
DBCHAR m_EndDay[11]; // 선승일, 보상 만료일 YYYY-MM-DD
|
||||
|
||||
DBCHAR m_CRMStartIP1[4]; // 서비스ip대역시작1
|
||||
DBCHAR m_CRMStopIP1[4]; // 서비스ip대역끝1
|
||||
DBCHAR m_CRMStartIP2[4]; // 서비스ip대역시작2
|
||||
DBCHAR m_CRMStopIP2[4]; // 서비스ip대역끝2
|
||||
DBCHAR m_CRMStartIP3[4]; // 서비스ip대역시작3
|
||||
DBCHAR m_CRMStopIP3[4]; // 서비스ip대역끝3
|
||||
|
||||
DBCHAR m_TimeProcess[2]; // 잔여일처리 방법 (m = -처리, z = 끊음)
|
||||
DBCHAR m_PriceType[2]; // 정액제,정량제 여부 (D 정액제, T 정량제)
|
||||
};
|
||||
|
||||
struct RemainTimeLog
|
||||
{
|
||||
DBCHAR m_CRMCode[20];
|
||||
DBCHAR m_IntServiceTime[11];
|
||||
DBCHAR m_DelColumn[2];
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
|
||||
int APIENTRY _tWinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPTSTR lpCmdLine,
|
||||
int nCmdShow)
|
||||
{
|
||||
CLog log;
|
||||
CConfigurator config;
|
||||
|
||||
OleDB mwDB;
|
||||
OleDB billingDB;
|
||||
|
||||
char szQuery[OleDB::MaxQueryTextLen];
|
||||
int nQueryLen = 0;
|
||||
|
||||
if(!log.RedirectStdOut("MediaWebBilling"))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
cout << endl << writetime << "쿼리를 실행합니다." << endl;
|
||||
|
||||
TCHAR* tszConfigFileName = TEXT("MWBillingInfo.cfg");
|
||||
|
||||
if(!config.Load(tszConfigFileName))
|
||||
{
|
||||
cout << writetime << tszConfigFileName << "DB설정 파일을 읽을 수 없습니다." << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char* szMWServerName = config.Get("MWServerName");
|
||||
const char* szMWDBName = config.Get("MWDBName");
|
||||
const char* szMWUserName = config.Get("MWUserName");
|
||||
const char* szMWPassword = config.Get("MWPassword");
|
||||
|
||||
if(!mwDB.ConnectSQLServer(szMWServerName, szMWDBName,
|
||||
szMWUserName, szMWPassword, OleDB::ConnType_ORACLE))
|
||||
{
|
||||
cout << writetime << "미디어웹DB : 접속할 수 없습니다. : " << mwDB.GetErrorString()
|
||||
<< " ServerName : " << szMWServerName
|
||||
<< " DBName : " << szMWDBName
|
||||
<< " UserName : " << szMWUserName
|
||||
<< " Password : " << szMWPassword
|
||||
<< endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char* szBillingServerName = config.Get("BillingServerName");
|
||||
const char* szBillingDBName = config.Get("BillingDBName");
|
||||
const char* szBillingUserName = config.Get("BillingUserName");
|
||||
const char* szBillingPassword = config.Get("BillingPassword");
|
||||
|
||||
if(!billingDB.ConnectSQLServer(szBillingServerName, szBillingDBName,
|
||||
szBillingUserName, szBillingPassword, OleDB::ConnType_MSSQL))
|
||||
{
|
||||
cout << writetime << "빌링DB : 접속할 수 없습니다. : " << billingDB.GetErrorString()
|
||||
<< " ServerName : " << szBillingServerName
|
||||
<< " DBName : " << szBillingDBName
|
||||
<< " UserName : " << szBillingUserName
|
||||
<< " Password : " << szBillingPassword
|
||||
<< endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 1. 테이블 클리어
|
||||
if(!billingDB.ExcuteQuery("EXEC agt_CRM_RYLLOG_Delete"))
|
||||
{
|
||||
cout << writetime << "빌링DB : 임시 테이블 삭제에 실패했습니다 : "
|
||||
<< billingDB.GetErrorString() << endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 2. 미디어웹(Oracle) 에서 데이터 가져오기
|
||||
int nMinNum = 0;
|
||||
|
||||
if(!billingDB.ExcuteQueryGetData(
|
||||
"SELECT intCount FROM TblImportedNum WHERE strCompType = 'M'", &nMinNum))
|
||||
{
|
||||
cout << writetime << "빌링DB : 마지막으로 처리된 데이터 건수 번호를 얻어올 수 없습니다 : "
|
||||
<< billingDB.GetErrorString() << endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
nQueryLen = _snprintf(szQuery, OleDB::MaxQueryTextLen,
|
||||
"SELECT "
|
||||
" CAST(crmcode AS VARCHAR(16)), "
|
||||
" CAST(command AS VARCHAR(16)), "
|
||||
|
||||
" CAST(crmip1 AS VARCHAR(13)), "
|
||||
" CAST(crmip2 AS VARCHAR(13)), "
|
||||
" CAST(crmip3 AS VARCHAR(13)), "
|
||||
|
||||
" CAST(seqid AS VARCHAR(11)), "
|
||||
" CAST(servicetime AS VARCHAR(11)), "
|
||||
" CAST(endtime AS VARCHAR(11)), "
|
||||
" CAST(serviceipnum AS VARCHAR(11)), "
|
||||
|
||||
" TO_CHAR(regdate, 'YYYY-MM-DD HH24:MI:SS '), "
|
||||
" TO_CHAR(serviceday, 'YYYY-MM-DD '), "
|
||||
" TO_CHAR(endday, 'YYYY-MM-DD '), "
|
||||
|
||||
" CAST(startcrmip1 AS VARCHAR(4)), "
|
||||
" CAST(endcrmip1 AS VARCHAR(4)), "
|
||||
" CAST(startcrmip2 AS VARCHAR(4)), "
|
||||
" CAST(endcrmip2 AS VARCHAR(4)), "
|
||||
" CAST(startcrmip3 AS VARCHAR(4)), "
|
||||
" CAST(endcrmip3 AS VARCHAR(4)), "
|
||||
|
||||
" CAST(timeprocess AS VARCHAR(2)), "
|
||||
" CAST(pricetype AS VARCHAR(2)) "
|
||||
|
||||
" FROM CRM.CRM_RYLLOG WHERE SEQID > %d AND RYLCHK = 'N' ORDER BY SEQID ASC", nMinNum);
|
||||
|
||||
if(nQueryLen < 0)
|
||||
{
|
||||
cout << writetime << "미디어웹DB : 빌링 데이터를 얻어오는 쿼리를 만들 수 없습니다." << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!mwDB.ExcuteQuery(szQuery))
|
||||
{
|
||||
cout << writetime << "미디어웹DB : 빌링 정보를 얻어올 수 없습니다 : "
|
||||
<< mwDB.GetErrorString()
|
||||
<< " Query : " << szQuery << endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
typedef std::vector<MWBillingData> BillingDataArray;
|
||||
|
||||
BillingDataArray mwBillingArray;
|
||||
mwBillingArray.reserve(5000);
|
||||
|
||||
const int MAX_DATA = 1000;
|
||||
MWBillingData mwBillingData[MAX_DATA];
|
||||
memset(mwBillingData, 0, sizeof(MWBillingData) * MAX_DATA);
|
||||
|
||||
int nReturnRow = 0;
|
||||
while(mwDB.GetData((void**)&mwBillingData,
|
||||
sizeof(MWBillingData), MAX_DATA, &nReturnRow))
|
||||
{
|
||||
if(0 == nReturnRow)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
mwBillingArray.insert(mwBillingArray.end(),
|
||||
mwBillingData, mwBillingData + nReturnRow);
|
||||
|
||||
memset(mwBillingData, 0, sizeof(MWBillingData) * MAX_DATA);
|
||||
}
|
||||
|
||||
// BillNum, MemberID, RylUID, BillingType, EndTime, GameMin
|
||||
const char* szInsertQuery = "INSERT INTO TblCRM_RYLLOG "
|
||||
" (intIndex, strCRMCode, strPriceType, dateSysDay, strCommand, "
|
||||
" strCRMIP1,strStartCRMIP1,strEndCRMIP1, "
|
||||
" strCRMIP2,strStartCRMIP2,strEndCRMIP2, "
|
||||
" strCRMIP3,strStartCRMIP3,strEndCRMIP3, "
|
||||
" strTimeprocess, intServiceTime, dateServiceDay, "
|
||||
" TinyServiceIPNum, dateEndday, intEndTime, strRylChk) values ( ";
|
||||
|
||||
BillingDataArray::iterator pos = mwBillingArray.begin();
|
||||
BillingDataArray::iterator end = mwBillingArray.end();
|
||||
|
||||
std::string strQuery;
|
||||
strQuery.reserve(OleDB::MaxQueryTextLen);
|
||||
|
||||
for(; pos != end; ++pos)
|
||||
{
|
||||
MWBillingData& data = *pos;
|
||||
|
||||
strQuery.assign(szInsertQuery);
|
||||
|
||||
addNumber(strQuery, data.m_Index);
|
||||
addString(strQuery, data.m_CRMCode);
|
||||
addString(strQuery, data.m_PriceType);
|
||||
addString(strQuery, data.m_SysDay);
|
||||
addString(strQuery, data.m_Command);
|
||||
|
||||
addString(strQuery, data.m_CRMIP1);
|
||||
addNumber(strQuery, data.m_CRMStartIP1);
|
||||
addNumber(strQuery, data.m_CRMStopIP1);
|
||||
|
||||
addString(strQuery, data.m_CRMIP2);
|
||||
addNumber(strQuery, data.m_CRMStartIP2);
|
||||
addNumber(strQuery, data.m_CRMStopIP2);
|
||||
|
||||
addString(strQuery, data.m_CRMIP3);
|
||||
addNumber(strQuery, data.m_CRMStartIP3);
|
||||
addNumber(strQuery, data.m_CRMStopIP3);
|
||||
|
||||
addString(strQuery, data.m_TimeProcess);
|
||||
addNumber(strQuery, data.m_ServiceTime);
|
||||
addString(strQuery, data.m_ServiceDay);
|
||||
addNumber(strQuery, data.m_ServiceIPNum);
|
||||
addString(strQuery, data.m_EndDay);
|
||||
addNumber(strQuery, data.m_EndTime);
|
||||
|
||||
strQuery += " 'N')";
|
||||
|
||||
if(!billingDB.ExcuteQuery(strQuery.c_str(), OleDB::Rowset_Update))
|
||||
{
|
||||
cout << writetime << "빌링DB : 미디어웹에서 가져온 데이터를 기록할 수 없습니다. : " << billingDB.GetErrorString()
|
||||
<< " 현재 SEQIndex : " << data.m_Index
|
||||
<< " Query : " << strQuery << endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int nMaxNum = 0;
|
||||
|
||||
if(!billingDB.ExcuteQueryGetData(
|
||||
"SELECT MAX(intIndex) FROM TblCRM_RYLLOG WHERE strRYLCHK = 'N' AND strConvertCHK ='N'", &nMaxNum))
|
||||
{
|
||||
cout << writetime << "빌링DB : 미디어웹에서 가져온 데이터 건수 최대 번호를 얻어올 수 없습니다 : "
|
||||
<< billingDB.GetErrorString() << endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(0 < nMaxNum)
|
||||
{
|
||||
nQueryLen = _snprintf(szQuery, OleDB::MaxQueryTextLen,
|
||||
"UPDATE CRM.CRM_RYLLOG SET RYLCHK = 'Y'"
|
||||
"WHERE SEQID > %d AND SEQID <= %d AND RYLCHK = 'N'", nMinNum, nMaxNum);
|
||||
|
||||
if(nQueryLen < 0)
|
||||
{
|
||||
cout << writetime << "미디어웹DB : 과금 처리 업데이트 실패 - 쿼리 생성 실패" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!mwDB.ExcuteQuery(szQuery, OleDB::Rowset_Update))
|
||||
{
|
||||
cout << writetime << "미디어웹DB : 과금 처리 업데이트 실패 - 쿼리 실패 : "
|
||||
<< mwDB.GetErrorString() << " Query : " << szQuery << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
nQueryLen = _snprintf(szQuery, OleDB::MaxQueryTextLen,
|
||||
"UPDATE TblImportedNum SET intCount = %d WHERE strCompType = 'M'", nMaxNum);
|
||||
|
||||
if(nQueryLen < 0)
|
||||
{
|
||||
cout << writetime << "빌링DB : 과금 처리 업데이트 실패 - 쿼리 생성 실패 "
|
||||
<< " MinBillingNum : " << nMinNum
|
||||
<< " MaxBillingNum : " << nMaxNum
|
||||
<< " Query : " << szQuery << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!billingDB.ExcuteQuery(szQuery, OleDB::Rowset_Update))
|
||||
{
|
||||
cout << writetime << "빌링DB : 과금 처리 업데이트 실패 - 쿼리 실패 : "
|
||||
<< billingDB.GetErrorString()
|
||||
<< " MinBillingNum : " << nMinNum
|
||||
<< " MaxBillingNum : " << nMaxNum
|
||||
<< " Query : " << szQuery << endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 3. 데이터 처리
|
||||
if(!billingDB.ExcuteQuery("EXEC agt_CRM_RYLLOG_EXECUTE"))
|
||||
{
|
||||
cout << writetime << "빌링DB : agt_CRM_RYLLOG_EXECUTE을 실패했습니다. : "
|
||||
<< billingDB.GetErrorString()
|
||||
<< " MinBillingNum : " << nMinNum
|
||||
<< " MaxBillingNum : " << nMaxNum
|
||||
<< endl;
|
||||
|
||||
// 빠져나가지 않는다. 데이터 오류가 있으면 에러가 날 수 있다.
|
||||
// return -1;
|
||||
}
|
||||
|
||||
// 4. 남은 서비스 타임 계산
|
||||
if(!billingDB.ExcuteQuery("EXEC agt_CRM_RemainServiceTime"))
|
||||
{
|
||||
cout << writetime << "빌링DB : agt_CRM_RemainServiceTime을 실패했습니다. : "
|
||||
<< billingDB.GetErrorString()
|
||||
<< " MinBillingNum : " << nMinNum
|
||||
<< " MaxBillingNum : " << nMaxNum
|
||||
<< endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 5. 잔여시간 넘겨주기 agt_CRM_RemainServiceTime_Transfer
|
||||
if(!billingDB.ExcuteQuery(
|
||||
"SELECT strCRMCode, "
|
||||
" CAST(MIN(intServiceTime) AS VARCHAR(11)), "
|
||||
" CAST(delColumn AS VARCHAR(2)) "
|
||||
" FROM TblCRM_SERVICETIME WHERE WebCHK = 'N' "
|
||||
" GROUP BY strCRMCode,delColumn"))
|
||||
{
|
||||
cout << writetime << "빌링DB : 잔여시간을 얻어오는 데 실패했습니다. : "
|
||||
<< billingDB.GetErrorString()
|
||||
<< " MinBillingNum : " << nMinNum
|
||||
<< " MaxBillingNum : " << nMaxNum
|
||||
<< endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
typedef std::vector<RemainTimeLog> RemainTimeLogArray;
|
||||
|
||||
RemainTimeLogArray remainTimeLogArray;
|
||||
remainTimeLogArray.reserve(10000);
|
||||
|
||||
const int MAX_REMAIN_TIME_DATA = 1000;
|
||||
RemainTimeLog remainTimes[MAX_REMAIN_TIME_DATA];
|
||||
|
||||
memset(remainTimes, 0, sizeof(RemainTimeLog) * MAX_REMAIN_TIME_DATA);
|
||||
|
||||
int nGetRemainTimesNum = 0;
|
||||
|
||||
while(billingDB.GetData((void**)&remainTimes, sizeof(RemainTimeLog),
|
||||
MAX_REMAIN_TIME_DATA, &nGetRemainTimesNum))
|
||||
{
|
||||
if(0 == nGetRemainTimesNum)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
remainTimeLogArray.insert(remainTimeLogArray.end(),
|
||||
remainTimes, remainTimes + nGetRemainTimesNum);
|
||||
|
||||
memset(remainTimes, 0, sizeof(RemainTimeLog) * MAX_REMAIN_TIME_DATA);
|
||||
}
|
||||
|
||||
if(!billingDB.ExcuteQuery("UPDATE TblCRM_SERVICETIME SET WebCHK = 'Y' WHERE WebCHK ='N'",
|
||||
OleDB::Rowset_Update))
|
||||
{
|
||||
cout << writetime << "빌링DB : WebCHK를 Y로 설정하는 데 실패했습니다. : "
|
||||
<< billingDB.GetErrorString()
|
||||
<< " MinBillingNum : " << nMinNum
|
||||
<< " MaxBillingNum : " << nMaxNum
|
||||
<< endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
RemainTimeLogArray::iterator rtpos = remainTimeLogArray.begin();
|
||||
RemainTimeLogArray::iterator rtend = remainTimeLogArray.end();
|
||||
|
||||
for(; rtpos != rtend; ++rtpos)
|
||||
{
|
||||
RemainTimeLog& data = *rtpos;
|
||||
|
||||
char szCRMCode[20];
|
||||
memset(szCRMCode, 0, sizeof(char) * 20);
|
||||
|
||||
strQuery = "SELECT CRMCODE FROM GAME.CRM_SERVICETIME WHERE CRMCODE = '";
|
||||
strQuery += data.m_CRMCode;
|
||||
strQuery += "' AND GAMECODE ='002' ";
|
||||
|
||||
if(!mwDB.ExcuteQuery(strQuery.c_str()))
|
||||
{
|
||||
cout << writetime << "미디어웹DB : CRMCODE검색에 실패했습니다. : "
|
||||
<< mwDB.GetErrorString()
|
||||
<< " MinBillingNum : " << nMinNum
|
||||
<< " MaxBillingNum : " << nMaxNum
|
||||
<< " Query : " << strQuery << endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
mwDB.GetData(szCRMCode);
|
||||
|
||||
if(0 != strlen(szCRMCode))
|
||||
{
|
||||
strQuery = "UPDATE GAME.CRM_SERVICETIME SET SERVICETIME = ";
|
||||
strQuery += data.m_IntServiceTime;
|
||||
strQuery += ",DELCHK = '";
|
||||
strQuery += data.m_DelColumn;
|
||||
strQuery += "' WHERE CRMCODE = '";
|
||||
strQuery += data.m_CRMCode;
|
||||
strQuery += "' AND GAMECODE ='002'";
|
||||
|
||||
if(!mwDB.ExcuteQuery(strQuery.c_str(), OleDB::Rowset_Update))
|
||||
{
|
||||
cout << writetime << "미디어웹DB : ServiceTime Update에 실패했습니다. : "
|
||||
<< mwDB.GetErrorString()
|
||||
<< " MinBillingNum : " << nMinNum
|
||||
<< " MaxBillingNum : " << nMaxNum
|
||||
<< " Query : " << strQuery << endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strQuery = "INSERT INTO GAME.CRM_SERVICETIME (CRMCODE,GAMECODE,SERVICETIME,DELCHK) VALUES ('";
|
||||
strQuery += data.m_CRMCode;
|
||||
strQuery += "','002',";
|
||||
strQuery += data.m_IntServiceTime;
|
||||
strQuery += ", '";
|
||||
strQuery += data.m_DelColumn;
|
||||
strQuery += "') ";
|
||||
|
||||
if(!mwDB.ExcuteQuery(strQuery.c_str(), OleDB::Rowset_Update))
|
||||
{
|
||||
cout << writetime << "미디어웹DB : ServiceTime Insert에 실패했습니다. : "
|
||||
<< mwDB.GetErrorString()
|
||||
<< " MinBillingNum : " << nMinNum
|
||||
<< " MaxBillingNum : " << nMaxNum
|
||||
<< " Query : " << strQuery << endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 6. 잔여시간 로그남기기
|
||||
if(!billingDB.ExcuteQuery("EXEC agt_CRM_RemainServiceTime_LOG"))
|
||||
{
|
||||
cout << writetime << "빌링DB : agt_CRM_RemainServiceTime_LOG를 실패했습니다. : "
|
||||
<< billingDB.GetErrorString()
|
||||
<< " MinBillingNum : " << nMinNum
|
||||
<< " MaxBillingNum : " << nMaxNum
|
||||
<< endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
cout << writetime << "쿼리 실행 완료." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
3
Server/Billing/MediaWebBilling/MediaWebBilling.h
Normal file
3
Server/Billing/MediaWebBilling/MediaWebBilling.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include "resource.h"
|
||||
BIN
Server/Billing/MediaWebBilling/MediaWebBilling.ico
Normal file
BIN
Server/Billing/MediaWebBilling/MediaWebBilling.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
128
Server/Billing/MediaWebBilling/MediaWebBilling.rc
Normal file
128
Server/Billing/MediaWebBilling/MediaWebBilling.rc
Normal file
@@ -0,0 +1,128 @@
|
||||
//Microsoft Visual C++에서 생성한 리소스 스크립트입니다.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE 2 리소스에서 생성되었습니다.
|
||||
//
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
|
||||
LANGUAGE 18, 1
|
||||
#pragma code_page(949)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 아이콘
|
||||
//
|
||||
|
||||
// 응용 프로그램 아이콘이 모든 시스템에서 일관적인 상태를 유지하도록 하기 위해
|
||||
// 가장 낮은 ID 값을 갖는 아이콘을 처음에 배치하였습니다.
|
||||
|
||||
IDI_MEDIAWEBBILLING ICON "MediaWebBilling.ico"
|
||||
IDI_SMALL ICON "small.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 메뉴
|
||||
//
|
||||
|
||||
IDC_MEDIAWEBBILLING MENU
|
||||
BEGIN
|
||||
POPUP "파일(&F)"
|
||||
BEGIN
|
||||
MENUITEM "끝내기(&X)", IDM_EXIT
|
||||
END
|
||||
POPUP "도움말(&H)"
|
||||
BEGIN
|
||||
MENUITEM "정보(&A)...", IDM_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 액셀러레이터 키
|
||||
//
|
||||
|
||||
IDC_MEDIAWEBBILLING ACCELERATORS
|
||||
BEGIN
|
||||
"?", IDM_ABOUT, ASCII, ALT
|
||||
"/", IDM_ABOUT, ASCII, ALT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 대화 상자
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG 22, 17, 230, 75
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "정보"
|
||||
FONT 9, "System"
|
||||
BEGIN
|
||||
ICON IDI_MEDIAWEBBILLING,IDC_MYICON,14,9,16,16
|
||||
LTEXT "MediaWebBilling 버전 1.0",IDC_STATIC,49,10,119,8,SS_NOPREFIX
|
||||
LTEXT "Copyright (C) 2003",IDC_STATIC,49,20,119,8
|
||||
DEFPUSHBUTTON "확인",IDOK,195,6,30,11,WS_GROUP
|
||||
END
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 문자열 테이블
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDC_MEDIAWEBBILLING "MEDIAWEBBILLING"
|
||||
IDS_APP_TITLE "MediaWebBilling"
|
||||
END
|
||||
|
||||
#endif
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE 3 리소스에서 생성되었습니다.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // APSTUDIO_INVOKED가 아닙니다.
|
||||
172
Server/Billing/MediaWebBilling/MediaWebBilling.vcproj
Normal file
172
Server/Billing/MediaWebBilling/MediaWebBilling.vcproj
Normal file
@@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="ks_c_5601-1987"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="MediaWebBilling"
|
||||
ProjectGUID="{FD74ADE2-6961-4304-B23A-89DA3665477E}"
|
||||
SccProjectName=""
|
||||
SccLocalPath=""
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="../Executable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../DB"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/MediaWebBilling.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/MediaWebBilling.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="../Executable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../DB"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/MediaWebBilling.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="소스 파일"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath=".\MediaWebBilling.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="헤더 파일"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath=".\MediaWebBilling.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="리소스 파일"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
<File
|
||||
RelativePath=".\MediaWebBilling.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MediaWebBilling.rc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\small.ico">
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
53
Server/Billing/MediaWebBilling/ReadMe.txt
Normal file
53
Server/Billing/MediaWebBilling/ReadMe.txt
Normal file
@@ -0,0 +1,53 @@
|
||||
========================================================================
|
||||
Win32 응용 프로그램 : MediaWebBilling 프로젝트 개요
|
||||
========================================================================
|
||||
|
||||
응용 프로그램 마법사에서 이 MediaWebBilling 응용 프로그램을 만들었습니다.
|
||||
이 파일에는 MediaWebBilling 응용 프로그램을 구성하는 각각의 파일에
|
||||
들어 있는 요약 설명이 포함되어 있습니다.
|
||||
|
||||
|
||||
MediaWebBilling.vcproj
|
||||
응용 프로그램 마법사를 사용하여 생성한 VC++ 프로젝트의 기본 프로젝트 파일입니다.
|
||||
해당 파일을 생성한 Visual C++의 버전 정보를 비롯하여
|
||||
응용 프로그램 마법사에서 선택한 플랫폼, 구성 및
|
||||
프로젝트 기능에 대한 정보가 들어 있습니다.
|
||||
|
||||
MediaWebBilling.cpp
|
||||
기본 응용 프로그램 소스 파일입니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
응용 프로그램 마법사에서 다음 리소스를 만들었습니다.
|
||||
|
||||
MediaWebBilling.rc
|
||||
프로그램에서 사용하는 모든
|
||||
Microsoft Windows 리소스의 목록입니다. RES 하위 디렉터리에 저장된
|
||||
아이콘, 비트맵, 및 커서 등이 여기에 포함됩니다. 이 파일은
|
||||
Microsoft Visual C++에서 직접 편집할 수 있습니다.
|
||||
|
||||
Resource.h
|
||||
새 리소스 ID를 정의하는 표준 헤더 파일입니다.
|
||||
Microsoft Visual C++에서 이 파일을 읽고 업데이트합니다.
|
||||
MediaWebBilling.ico
|
||||
아이콘 파일이며, 응용 프로그램의 아이콘(32x32)으로 사용됩니다.
|
||||
해당 아이콘은 기본 리소스 파일인 MediaWebBilling.rc에 의해 포함됩니다.
|
||||
|
||||
small.ico
|
||||
아이콘 파일이며, 응용 프로그램 아이콘의 더 작은 버전(16x16)이
|
||||
들어 있습니다. 해당 아이콘은 기본 리소스 파일인
|
||||
MediaWebBilling.rc에 의해 포함됩니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
기타 표준 파일:
|
||||
|
||||
StdAfx.h 및 StdAfx.cpp는
|
||||
MediaWebBilling.pch라는 이름의 PCH(미리 컴파일된 헤더) 파일과
|
||||
StdAfx.obj라는 이름의 미리 컴파일된 형식 파일을 빌드하는 데 사용됩니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
기타 참고:
|
||||
|
||||
응용 프로그램 마법사에서 사용하는 "TODO:" 주석은 사용자가 추가하거나 사용자 지정해야 하는
|
||||
소스 코드 부분을 나타냅니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
29
Server/Billing/MediaWebBilling/Resource.h
Normal file
29
Server/Billing/MediaWebBilling/Resource.h
Normal file
@@ -0,0 +1,29 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by MediaWebBilling.rc
|
||||
//
|
||||
|
||||
#define IDS_APP_TITLE 103
|
||||
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_MEDIAWEBBILLING_DIALOG 102
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_MEDIAWEBBILLING 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_MEDIAWEBBILLING 109
|
||||
#define IDC_MYICON 2
|
||||
#define IDC_STATIC -1
|
||||
// 새 개체에 대한 다음 기본값입니다.
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#define _APS_NO_MFC 130
|
||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
#endif
|
||||
BIN
Server/Billing/MediaWebBilling/small.ico
Normal file
BIN
Server/Billing/MediaWebBilling/small.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
8
Server/Billing/MediaWebBilling/stdafx.cpp
Normal file
8
Server/Billing/MediaWebBilling/stdafx.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : 표준 포함 파일만 들어 있는 소스 파일입니다.
|
||||
// MediaWebBilling.pch는 미리 컴파일된 헤더가 됩니다.
|
||||
// stdafx.obj에는 미리 컴파일된 형식 정보가 포함됩니다.
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: 필요한 추가 헤더는
|
||||
// 이 파일이 아닌 STDAFX.H에서 참조합니다.
|
||||
18
Server/Billing/MediaWebBilling/stdafx.h
Normal file
18
Server/Billing/MediaWebBilling/stdafx.h
Normal file
@@ -0,0 +1,18 @@
|
||||
// stdafx.h : 자주 사용하지만 자주 변경되지는 않는
|
||||
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
|
||||
// 들어 있는 포함 파일입니다.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // 거의 사용되지 않는 내용은 Windows 헤더에서 제외합니다.
|
||||
// Windows 헤더 파일입니다.
|
||||
#include <windows.h>
|
||||
// C의 런타임 헤더 파일입니다.
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <tchar.h>
|
||||
|
||||
// TODO: 프로그램에 필요한 추가 헤더는 여기에서 참조합니다.
|
||||
Reference in New Issue
Block a user