Compare commits
5 Commits
8d6b4b07d1
...
5765a4b411
Author | SHA1 | Date | |
---|---|---|---|
5765a4b411 | |||
6406fe1784 | |||
dc162b3180 | |||
173aa6655f | |||
92681a8cfe |
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
#include <libxl.h>
|
#include <libxl.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include "LoadFromExcel.h"
|
#include "LoadFromExcel.h"
|
||||||
#include "../../excel/excel.h"
|
#include "../../excel/excel.h"
|
||||||
@ -76,10 +76,14 @@ const wchar_t * pwszRepairRecommandationCaption[] = {
|
|||||||
L"报案号",
|
L"报案号",
|
||||||
L"推荐车商代码",
|
L"推荐车商代码",
|
||||||
L"推荐车商名称",
|
L"推荐车商名称",
|
||||||
|
L"机构",
|
||||||
L"出险日期",
|
L"出险日期",
|
||||||
L"车牌号",
|
L"车牌号",
|
||||||
L"品牌名称",
|
L"品牌名称",
|
||||||
L"短信类型",
|
L"短信类型",
|
||||||
|
L"接收人"
|
||||||
|
L"手机号"
|
||||||
|
L"短信内容"
|
||||||
L"发送时间",
|
L"发送时间",
|
||||||
L"数据来源",
|
L"数据来源",
|
||||||
};
|
};
|
||||||
@ -784,18 +788,18 @@ void LoadRepairRecommandationFromXlsx( const std::wstring &
|
|||||||
//起始列索引
|
//起始列索引
|
||||||
int colunmIndex = pSheet->firstCol();
|
int colunmIndex = pSheet->firstCol();
|
||||||
|
|
||||||
wstring branchName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring branchName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex, true );
|
||||||
wstring orderNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring orderNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex+1, true );
|
||||||
wstring orderType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring orderType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex+2, true );
|
||||||
wstring notifyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring notifyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex+3, true );
|
||||||
wstring RecommandCarDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring RecommandCarDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex+4, true );
|
||||||
wstring RecommandCarDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring RecommandCarDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex+5, true );
|
||||||
wstring damageDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring damageDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex+7, true );
|
||||||
wstring plateNumber = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring plateNumber = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex+8, true );
|
||||||
wstring brandName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring brandName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex+9, true );
|
||||||
wstring messageType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring messageType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex+10, true );
|
||||||
wstring messageSendingDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring messageSendingDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex+14, true );
|
||||||
wstring dataSource = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring dataSource = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex+15, true );
|
||||||
|
|
||||||
//空行跳过
|
//空行跳过
|
||||||
if ( notifyNo.empty() == true )
|
if ( notifyNo.empty() == true )
|
||||||
@ -1072,7 +1076,7 @@ void LoadNewRepairMonitorReportFromXlsx( const std::wstring &
|
|||||||
* \param pszCaptionFormat
|
* \param pszCaptionFormat
|
||||||
* \return
|
* \return
|
||||||
************************************************/
|
************************************************/
|
||||||
bool checkExcelFileFormat( Book * pBook, int sheetIndex, int captionRowIndex, const wchar_t * pszCaptionFormat[], int captionCount )
|
/*bool checkExcelFileFormat( Book * pBook, int sheetIndex, int captionRowIndex, const wchar_t * pszCaptionFormat[], int captionCount )
|
||||||
{
|
{
|
||||||
if ( pBook == nullptr )
|
if ( pBook == nullptr )
|
||||||
{
|
{
|
||||||
@ -1103,4 +1107,4 @@ bool checkExcelFileFormat( Book * pBook, int sheetIndex, int captionRowIndex, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
return isEqual;
|
return isEqual;
|
||||||
}
|
}*/
|
||||||
|
@ -1111,3 +1111,113 @@ void ImportNewRepairMonitorToOracle( const std::string &
|
|||||||
OCI_ConnectionFree( pConnection );
|
OCI_ConnectionFree( pConnection );
|
||||||
OCI_Cleanup();
|
OCI_Cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/************************************************
|
||||||
|
* \brief 保存核价清单表 - 源自新送返修监控报表
|
||||||
|
* \param userName
|
||||||
|
* \param password
|
||||||
|
* \param tnsName
|
||||||
|
* \param recordVector 新送返修监控报表记录
|
||||||
|
************************************************/
|
||||||
|
void ImportPriceCheckedListToOracle( const std::string & userName,
|
||||||
|
const std::string & password,
|
||||||
|
const std::string & tnsName,
|
||||||
|
const std::vector<NewRepairMonitorReportRecord> & recordVector )
|
||||||
|
{
|
||||||
|
OCI_Connection * pConn = nullptr;
|
||||||
|
OCI_Statement * pStatement = nullptr;
|
||||||
|
int returnCode = 0;
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -75,3 +75,16 @@ void ImportNewRepairMonitorToOracle( const std::string &
|
|||||||
const std::string & password,
|
const std::string & password,
|
||||||
const std::string & tnsName,
|
const std::string & tnsName,
|
||||||
const std::vector<NewRepairMonitorReportRecord> & recordVector );
|
const std::vector<NewRepairMonitorReportRecord> & recordVector );
|
||||||
|
|
||||||
|
/************************************************
|
||||||
|
* \brief 保存核价清单表 - 源自新送返修监控报表
|
||||||
|
* \param userName
|
||||||
|
* \param password
|
||||||
|
* \param tnsName
|
||||||
|
* \param recordVector 新送返修监控报表记录
|
||||||
|
************************************************/
|
||||||
|
void ImportPriceCheckedListToOracle( const std::string & userName,
|
||||||
|
const std::string & password,
|
||||||
|
const std::string & tnsName,
|
||||||
|
const std::vector<NewRepairMonitorReportRecord> & recordVector );
|
||||||
|
|
||||||
|
@ -163,3 +163,41 @@ libxl::Sheet * getXlsxSheetByName( libxl::IBookT<wchar_t> * pBook, const std::ws
|
|||||||
|
|
||||||
return pSheet;
|
return pSheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool checkExcelFileFormat(Book* pBook,
|
||||||
|
int sheetIndex,
|
||||||
|
int captionRowIndex,
|
||||||
|
const wchar_t* pszCaptionFormat[],
|
||||||
|
int captionCount)
|
||||||
|
{
|
||||||
|
if (pBook == nullptr)
|
||||||
|
{
|
||||||
|
throw logic_error("Excel文件指针为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sheetIndex < 0 || captionRowIndex < 0)
|
||||||
|
{
|
||||||
|
throw logic_error("标题行参数错误!");
|
||||||
|
}
|
||||||
|
|
||||||
|
Sheet* pSheet = pBook->getSheet(sheetIndex);
|
||||||
|
int captionIndex = 0;
|
||||||
|
bool isEqual = true;
|
||||||
|
|
||||||
|
while (captionIndex < captionCount)
|
||||||
|
{
|
||||||
|
const wchar_t* pwszCaption = pSheet->readStr(captionRowIndex, captionIndex);
|
||||||
|
|
||||||
|
if (wcscmp(pwszCaption, pszCaptionFormat[captionIndex]) != 0)
|
||||||
|
{
|
||||||
|
isEqual = false;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
captionIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isEqual;
|
||||||
|
}
|
@ -1,6 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#ifndef EXCEL_H_
|
|
||||||
#define EXCEL_H_
|
|
||||||
|
|
||||||
#include <libxl.h>
|
#include <libxl.h>
|
||||||
|
|
||||||
@ -31,7 +29,20 @@ std::wstring ReadCellStringFromXlsx( libxl::IBookT<wchar_t> * pBook,
|
|||||||
* \param sheetName
|
* \param sheetName
|
||||||
* \return
|
* \return
|
||||||
************************************************/
|
************************************************/
|
||||||
libxl::Sheet * getXlsxSheetByName( libxl::IBookT<wchar_t> * pBook, const std::wstring & sheetName );
|
libxl::Sheet * getXlsxSheetByName( libxl::IBookT<wchar_t> * pBook,
|
||||||
|
const std::wstring & sheetName );
|
||||||
|
|
||||||
|
/************************************************
|
||||||
#endif
|
* \brief 核对excel表格的内容,根据pszCaptionFormat参数提供的表头数组来核对
|
||||||
|
* \param pBook excel文件指针
|
||||||
|
* \param sheetIndex 要核对的sheet索引
|
||||||
|
* \param captionRowIndex 标题行索引
|
||||||
|
* \param pszCaptionFormat 包含标题内容的字符串数组
|
||||||
|
* \param captionCount 标题数量
|
||||||
|
* \return
|
||||||
|
************************************************/
|
||||||
|
bool checkExcelFileFormat( libxl::Book * pBook,
|
||||||
|
int sheetIndex,
|
||||||
|
int captionRowIndex,
|
||||||
|
const wchar_t * pszCaptionFormat[],
|
||||||
|
int captionCount );
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
43
code/cpp/car_dealer_util/source/util/excel/excel_util.cpp
Normal file
43
code/cpp/car_dealer_util/source/util/excel/excel_util.cpp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#include <stdexcept>
|
||||||
|
#include <cwchar>
|
||||||
|
#include "excel_util.h"
|
||||||
|
|
||||||
|
using namespace libxl;
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
bool checkExcelFileFormat( Book * pBook,
|
||||||
|
int sheetIndex,
|
||||||
|
int captionRowIndex,
|
||||||
|
const wchar_t * pszCaptionFormat[],
|
||||||
|
int captionCount )
|
||||||
|
{
|
||||||
|
if ( pBook == nullptr )
|
||||||
|
{
|
||||||
|
throw logic_error( "Excel文件指针为空!" );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( sheetIndex < 0 || captionRowIndex < 0 )
|
||||||
|
{
|
||||||
|
throw logic_error( "标题行参数错误!" );
|
||||||
|
}
|
||||||
|
|
||||||
|
Sheet * pSheet = pBook->getSheet( sheetIndex );
|
||||||
|
int captionIndex = 0;
|
||||||
|
bool isEqual = true;
|
||||||
|
|
||||||
|
while ( captionIndex < captionCount )
|
||||||
|
{
|
||||||
|
const wchar_t * pwszCaption = pSheet->readStr( captionRowIndex, captionIndex );
|
||||||
|
|
||||||
|
if ( wcscmp( pwszCaption, pszCaptionFormat[captionIndex] ) != 0 )
|
||||||
|
{
|
||||||
|
isEqual = false;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
captionIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isEqual;
|
||||||
|
}
|
26
code/cpp/car_dealer_util/source/util/excel/excel_util.h
Normal file
26
code/cpp/car_dealer_util/source/util/excel/excel_util.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <libxl.h>
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************
|
||||||
|
* \brief 核对excel表格的内容,根据pszCaptionFormat参数提供的表头数组来核对
|
||||||
|
* \param pBook excel文件指针
|
||||||
|
* \param sheetIndex 要核对的sheet索引
|
||||||
|
* \param captionRowIndex 标题行索引
|
||||||
|
* \param pszCaptionFormat 包含标题内容的字符串数组
|
||||||
|
* \param captionCount 标题数量
|
||||||
|
* \return
|
||||||
|
************************************************/
|
||||||
|
bool checkExcelFileFormat( libxl::Book * pBook,
|
||||||
|
int sheetIndex,
|
||||||
|
int captionRowIndex,
|
||||||
|
const wchar_t * pszCaptionFormat[],
|
||||||
|
int captionCount );
|
||||||
|
|
||||||
|
/************************************************
|
||||||
|
* \brief 通过名称获取sheet
|
||||||
|
* \param sheetName
|
||||||
|
* \return
|
||||||
|
************************************************/
|
||||||
|
libxl::Sheet* getXlsxSheetByName(libxl::IBookT<wchar_t>* pBook, const std::wstring& sheetName);
|
@ -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