提交信息!
This commit is contained in:
parent
92681a8cfe
commit
173aa6655f
Binary file not shown.
@ -1128,7 +1128,96 @@ void ImportPriceCheckedListToOracle( const std::string &
|
|||||||
OCI_Statement * pStatement = nullptr;
|
OCI_Statement * pStatement = nullptr;
|
||||||
int returnCode = 0;
|
int returnCode = 0;
|
||||||
|
|
||||||
returnCode = OCI_Initialize(l_error_handler, nullptr, OCI_ENV_DEFAULT);
|
QString sql = QString::fromUtf8( "begin \n"
|
||||||
|
" car_dealer.data_import_util_pkg.import_pricecheck_list( \n"
|
||||||
|
" :a_caseno, \n"
|
||||||
|
" :a_report_date, \n"
|
||||||
|
" :a_damage_date, \n"
|
||||||
|
" :a_damage_address, \n"
|
||||||
|
" :a_plateno, \n"
|
||||||
|
" :a_brandname, \n"
|
||||||
|
" :a_carseries, \n"
|
||||||
|
" :a_policyno, \n"
|
||||||
|
" :a_insuredcar, \n"
|
||||||
|
" :a_checked_premium, \n"
|
||||||
|
" :a_step, \n"
|
||||||
|
" :a_branch_name, \n"
|
||||||
|
" :a_cardealer_code, \n"
|
||||||
|
" :a_cardealer_name, \n"
|
||||||
|
" :a_check_date \n"
|
||||||
|
" ); \n"
|
||||||
|
"end;" );
|
||||||
|
|
||||||
|
returnCode = OCI_Initialize( l_error_handler, nullptr, OCI_ENV_DEFAULT );
|
||||||
|
|
||||||
|
if ( static_cast<bool>(returnCode) == false )
|
||||||
|
{
|
||||||
|
string errorMessage( "ocilib初始化错误:" );
|
||||||
|
errorMessage.append( get_last_error_message() );
|
||||||
|
|
||||||
|
throw runtime_error( errorMessage );
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
pConn = OCI_ConnectionCreate( tnsName.c_str(),
|
||||||
|
userName.c_str(),
|
||||||
|
password.c_str(),
|
||||||
|
OCI_SESSION_DEFAULT );
|
||||||
|
pStatement = OCI_StatementCreate( pConn );
|
||||||
|
|
||||||
|
OCI_AllowRebinding( pStatement, true );
|
||||||
|
OCI_Prepare( pStatement, sql.toLocal8Bit().data() );
|
||||||
|
|
||||||
|
for ( auto iterRecord = recordVector.begin();
|
||||||
|
iterRecord != recordVector.end();
|
||||||
|
++iterRecord )
|
||||||
|
{
|
||||||
|
string a_caseno = QString::fromStdWString( iterRecord->报案号_ ).toLocal8Bit();
|
||||||
|
string a_report_date = QString::fromStdWString( iterRecord->报案日期_ ).toLocal8Bit();
|
||||||
|
string a_damage_date = QString::fromStdWString( iterRecord->出险日期_ ).toLocal8Bit();
|
||||||
|
string a_damage_address = QString::fromStdWString( iterRecord->出险地点_ ).toLocal8Bit();
|
||||||
|
string a_plateno = QString::fromStdWString( iterRecord->车牌_ ).toLocal8Bit();
|
||||||
|
string a_brandname = QString::fromStdWString( iterRecord->品牌名称_ ).toLocal8Bit();
|
||||||
|
string a_carseries = QString::fromStdWString( iterRecord->车系名称_ ).toLocal8Bit();
|
||||||
|
string a_policyno = QString::fromStdWString( iterRecord->保单号_ ).toLocal8Bit();
|
||||||
|
string a_insuredcar = QString::fromStdWString( iterRecord->标的车_三者车_ ).toLocal8Bit();
|
||||||
|
string a_checked_premium = QString::fromStdWString( iterRecord->核价金额_ ).toLocal8Bit();
|
||||||
|
string a_step = QString::fromStdWString( iterRecord->车状_核价通过环节_ ).toLocal8Bit();
|
||||||
|
string a_branch_name = QString::fromStdWString( iterRecord->核价车商分公司名称_ ).toLocal8Bit();
|
||||||
|
string a_cardealer_code = QString::fromStdWString( iterRecord->核价车商代码_ ).toLocal8Bit();
|
||||||
|
string a_cardealer_name = QString::fromStdWString( iterRecord->核价车商名称_ ).toLocal8Bit();
|
||||||
|
string a_check_date = QString::fromStdWString( iterRecord->核价通过时间_ ).toLocal8Bit();
|
||||||
|
|
||||||
|
//OCI_BindString(pStatement, (const otext*)(":"), (otext*)(.c_str()), .size());
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_caseno"), (otext*)(a_caseno.c_str()), a_caseno.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_report_date"), (otext*)(a_report_date.c_str()), a_report_date.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_damage_date"), (otext*)(a_damage_date.c_str()), a_damage_date.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_damage_address"), (otext*)(a_damage_address.c_str()), a_damage_address.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_plateno"), (otext*)(a_plateno.c_str()), a_plateno.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_brandname"), (otext*)(a_brandname.c_str()), a_brandname.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_carseries"), (otext*)(a_carseries.c_str()), a_carseries.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_policyno"), (otext*)(a_policyno.c_str()), a_policyno.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_insuredcar"), (otext*)(a_insuredcar.c_str()), a_insuredcar.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_checked_premium"), (otext*)(a_checked_premium.c_str()), a_checked_premium.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_step"), (otext*)(a_step.c_str()), a_step.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_branch_name"), (otext*)(a_branch_name.c_str()), a_branch_name.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_cardealer_code"), (otext*)(a_cardealer_code.c_str()), a_cardealer_code.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_cardealer_name"), (otext*)(a_cardealer_name.c_str()), a_cardealer_name.size() );
|
||||||
|
OCI_BindString( pStatement, (const otext*)(":a_check_date"), (otext*)(a_check_date.c_str()), a_check_date.size() );
|
||||||
|
|
||||||
|
OCI_Execute( pStatement );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( runtime_error & error )
|
||||||
|
{
|
||||||
|
OCI_ConnectionFree( pConn );
|
||||||
|
OCI_Cleanup();
|
||||||
|
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
OCI_Commit( pConn );
|
||||||
|
OCI_ConnectionFree( pConn );
|
||||||
|
OCI_Cleanup();
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,8 @@ void QNewRepairMonitorWidget::onImport()
|
|||||||
string password = "cpic123456";
|
string password = "cpic123456";
|
||||||
string tnsName = "xmcx1";
|
string tnsName = "xmcx1";
|
||||||
|
|
||||||
ImportNewRepairMonitorToOracle( userName, password, tnsName, recordVector );
|
//ImportNewRepairMonitorToOracle( userName, password, tnsName, recordVector );
|
||||||
|
ImportPriceCheckedListToOracle(userName, password, tnsName, recordVector);
|
||||||
|
|
||||||
//showNewRepairMonitorRecords();
|
//showNewRepairMonitorRecords();
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,26 @@ CREATE OR REPLACE PACKAGE data_import_util_pkg IS
|
|||||||
a_data_source VARCHAR2
|
a_data_source VARCHAR2
|
||||||
);
|
);
|
||||||
|
|
||||||
|
--导入核价清单(新送返修监控报表)
|
||||||
|
PROCEDURE import_pricecheck_list
|
||||||
|
(
|
||||||
|
a_报案号 VARCHAR2,
|
||||||
|
a_报案日期 VARCHAR2,
|
||||||
|
a_出险日期 VARCHAR2,
|
||||||
|
a_出险地点 VARCHAR2,
|
||||||
|
a_车牌 VARCHAR2,
|
||||||
|
a_品牌名称 VARCHAR2,
|
||||||
|
a_车系名称 VARCHAR2,
|
||||||
|
a_保单号 VARCHAR2,
|
||||||
|
a_标的车三者车 VARCHAR2,
|
||||||
|
a_核价金额 VARCHAR2,
|
||||||
|
a_车辆状态名称核价通过环节 VARCHAR2,
|
||||||
|
a_核价车商分公司名称 VARCHAR2,
|
||||||
|
a_核价车商代码 VARCHAR2,
|
||||||
|
a_核价车商名称 VARCHAR2,
|
||||||
|
a_核价通过时间 VARCHAR2
|
||||||
|
);
|
||||||
|
|
||||||
PROCEDURE 导入新送返修监控报表
|
PROCEDURE 导入新送返修监控报表
|
||||||
(
|
(
|
||||||
a_分公司名称 VARCHAR2,
|
a_分公司名称 VARCHAR2,
|
||||||
@ -408,7 +428,8 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
|
|
||||||
--先删除旧数据
|
--先删除旧数据
|
||||||
BEGIN
|
BEGIN
|
||||||
DELETE car_dealer.repair_order_info a WHERE a_order_no = a.order_no;
|
DELETE car_dealer.repair_order_info a
|
||||||
|
WHERE a_order_no = a.order_no;
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN OTHERS THEN
|
WHEN OTHERS THEN
|
||||||
NULL;
|
NULL;
|
||||||
@ -539,7 +560,8 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
|
|
||||||
--删除旧数据
|
--删除旧数据
|
||||||
BEGIN
|
BEGIN
|
||||||
DELETE FROM car_dealer.送返修推荐表 a WHERE a.报案号 = a_notify_no;
|
DELETE FROM car_dealer.送返修推荐表 a
|
||||||
|
WHERE a.报案号 = a_notify_no;
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN OTHERS THEN
|
WHEN OTHERS THEN
|
||||||
NULL;
|
NULL;
|
||||||
@ -584,6 +606,90 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
|
|
||||||
END;
|
END;
|
||||||
|
|
||||||
|
PROCEDURE import_pricecheck_list
|
||||||
|
(
|
||||||
|
a_报案号 VARCHAR2,
|
||||||
|
a_报案日期 VARCHAR2,
|
||||||
|
a_出险日期 VARCHAR2,
|
||||||
|
a_出险地点 VARCHAR2,
|
||||||
|
a_车牌 VARCHAR2,
|
||||||
|
a_品牌名称 VARCHAR2,
|
||||||
|
a_车系名称 VARCHAR2,
|
||||||
|
a_保单号 VARCHAR2,
|
||||||
|
a_标的车三者车 VARCHAR2,
|
||||||
|
a_核价金额 VARCHAR2,
|
||||||
|
a_车辆状态名称核价通过环节 VARCHAR2,
|
||||||
|
a_核价车商分公司名称 VARCHAR2,
|
||||||
|
a_核价车商代码 VARCHAR2,
|
||||||
|
a_核价车商名称 VARCHAR2,
|
||||||
|
a_核价通过时间 VARCHAR2
|
||||||
|
) IS
|
||||||
|
l_报案日期 DATE;
|
||||||
|
l_出险日期 DATE;
|
||||||
|
l_核价通过时间 DATE;
|
||||||
|
BEGIN
|
||||||
|
NULL;
|
||||||
|
|
||||||
|
IF a_报案号 IS NULL OR
|
||||||
|
a_车牌 IS NULL
|
||||||
|
THEN
|
||||||
|
raise_application_error(no_notify_no_excpt,
|
||||||
|
no_notify_no_text);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
DELETE 核价清单 hj
|
||||||
|
--DELETE check_price_list hj
|
||||||
|
WHERE hj.报案号 = a_报案号
|
||||||
|
AND hj.车牌 = a_车牌;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN OTHERS THEN
|
||||||
|
NULL;
|
||||||
|
END;
|
||||||
|
|
||||||
|
l_报案日期 := 日期字符串转换(a_报案日期,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
|
l_出险日期 := 日期字符串转换(a_出险日期,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
|
l_核价通过时间 := 日期字符串转换(a_核价通过时间,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
|
|
||||||
|
INSERT INTO 核价清单
|
||||||
|
--INSERT INTO check_price_list
|
||||||
|
(报案号,
|
||||||
|
报案日期,
|
||||||
|
出险日期,
|
||||||
|
出险地点,
|
||||||
|
车牌,
|
||||||
|
品牌名称,
|
||||||
|
车系名称,
|
||||||
|
保单号,
|
||||||
|
标的车三者车,
|
||||||
|
核价金额,
|
||||||
|
车辆状态名称核价通过环节,
|
||||||
|
核价车商分公司名称,
|
||||||
|
核价车商代码,
|
||||||
|
核价车商名称,
|
||||||
|
核价通过时间)
|
||||||
|
VALUES
|
||||||
|
(a_报案号,
|
||||||
|
l_报案日期,
|
||||||
|
l_出险日期,
|
||||||
|
a_出险地点,
|
||||||
|
a_车牌,
|
||||||
|
a_品牌名称,
|
||||||
|
a_车系名称,
|
||||||
|
a_保单号,
|
||||||
|
a_标的车三者车,
|
||||||
|
a_核价金额,
|
||||||
|
a_车辆状态名称核价通过环节,
|
||||||
|
a_核价车商分公司名称,
|
||||||
|
a_核价车商代码,
|
||||||
|
a_核价车商名称,
|
||||||
|
l_核价通过时间);
|
||||||
|
|
||||||
|
END;
|
||||||
|
|
||||||
PROCEDURE 导入新送返修监控报表
|
PROCEDURE 导入新送返修监控报表
|
||||||
(
|
(
|
||||||
a_分公司名称 VARCHAR2,
|
a_分公司名称 VARCHAR2,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user