修复一个bug
This commit is contained in:
parent
114e6c4ecd
commit
02eb1eb2c8
BIN
code/cpp/car_dealer_util/proj/vs2019/car_dealer_util/111.xlsx
Normal file
BIN
code/cpp/car_dealer_util/proj/vs2019/car_dealer_util/111.xlsx
Normal file
Binary file not shown.
@ -795,6 +795,13 @@ void LoadRepairRecommandationFromXlsx( const std::wstring &
|
|||||||
wstring messageSendingDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring messageSendingDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||||
wstring dataSource = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
wstring dataSource = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||||
|
|
||||||
|
//空行跳过
|
||||||
|
if ( notifyNo.empty() == true )
|
||||||
|
{
|
||||||
|
rowIndex++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
RepairRecommandationRecord record( branchName,
|
RepairRecommandationRecord record( branchName,
|
||||||
orderNo,
|
orderNo,
|
||||||
orderType,
|
orderType,
|
||||||
|
@ -34,7 +34,8 @@ void ImportCarDealerAchievementToOracleCpp( const std::string &
|
|||||||
" :a_others_amount ); \n"
|
" :a_others_amount ); \n"
|
||||||
"END; ";
|
"END; ";
|
||||||
|
|
||||||
//初始化
|
//初始化
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Environment::Initialize();
|
Environment::Initialize();
|
||||||
@ -510,7 +511,7 @@ void ImportRepairRecommandationToOracle( const std::string &
|
|||||||
string 车牌号 = QString::fromStdWString( iterOrder->getPlateNumber() ).toLocal8Bit();
|
string 车牌号 = QString::fromStdWString( iterOrder->getPlateNumber() ).toLocal8Bit();
|
||||||
string 厂牌型号 = QString::fromStdWString( iterOrder->getBrandName() ).toLocal8Bit();
|
string 厂牌型号 = QString::fromStdWString( iterOrder->getBrandName() ).toLocal8Bit();
|
||||||
|
|
||||||
if ( 工单号.empty() == true )
|
if ( 报案号.empty() == true )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ CREATE OR REPLACE PACKAGE data_import_util_pkg IS
|
|||||||
|
|
||||||
PROCEDURE import_repairing_suggestion
|
PROCEDURE import_repairing_suggestion
|
||||||
(
|
(
|
||||||
|
a_branch_name VARCHAR2,
|
||||||
a_order_no VARCHAR2,
|
a_order_no VARCHAR2,
|
||||||
a_order_type VARCHAR2,
|
a_order_type VARCHAR2,
|
||||||
a_notify_no VARCHAR2,
|
a_notify_no VARCHAR2,
|
||||||
@ -271,7 +272,8 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
--防御性验证
|
--防御性验证
|
||||||
IF a_car_dealer_code IS NULL
|
IF a_car_dealer_code IS NULL
|
||||||
THEN
|
THEN
|
||||||
raise_application_error(no_cardealer_code_excpt, no_cardealer_code_text);
|
raise_application_error(no_cardealer_code_excpt,
|
||||||
|
no_cardealer_code_text);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
--先删除旧数据
|
--先删除旧数据
|
||||||
@ -325,7 +327,8 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
--防御性验证
|
--防御性验证
|
||||||
IF a_car_dealer_code IS NULL
|
IF a_car_dealer_code IS NULL
|
||||||
THEN
|
THEN
|
||||||
raise_application_error(no_cardealer_code_excpt, no_cardealer_code_text);
|
raise_application_error(no_cardealer_code_excpt,
|
||||||
|
no_cardealer_code_text);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
--删除旧数据
|
--删除旧数据
|
||||||
@ -341,7 +344,14 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
|
|
||||||
--插入数据
|
--插入数据
|
||||||
INSERT INTO car_dealer.car_dealer_scheme
|
INSERT INTO car_dealer.car_dealer_scheme
|
||||||
(the_year, the_month, car_dealer_code, man_hour_price, part_price, claim_support, scheme, is_qualified)
|
(the_year,
|
||||||
|
the_month,
|
||||||
|
car_dealer_code,
|
||||||
|
man_hour_price,
|
||||||
|
part_price,
|
||||||
|
claim_support,
|
||||||
|
scheme,
|
||||||
|
is_qualified)
|
||||||
VALUES
|
VALUES
|
||||||
(a_the_year,
|
(a_the_year,
|
||||||
a_the_month,
|
a_the_month,
|
||||||
@ -392,7 +402,8 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
--防御性验证
|
--防御性验证
|
||||||
IF a_order_no IS NULL
|
IF a_order_no IS NULL
|
||||||
THEN
|
THEN
|
||||||
raise_application_error(no_cardealer_code_excpt, no_cardealer_code_text);
|
raise_application_error(no_cardealer_code_excpt,
|
||||||
|
no_cardealer_code_text);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
--先删除旧数据
|
--先删除旧数据
|
||||||
@ -405,35 +416,40 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
|
|
||||||
--日期处理
|
--日期处理
|
||||||
BEGIN
|
BEGIN
|
||||||
l_damage_date := to_date(a_damage_date, 'yyyy-mm-dd hh24:mi:ss');
|
l_damage_date := to_date(a_damage_date,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN OTHERS THEN
|
WHEN OTHERS THEN
|
||||||
l_damage_date := NULL;
|
l_damage_date := NULL;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
l_gen_date := to_date(a_generating_date, 'yyyy-mm-dd hh24:mi:ss');
|
l_gen_date := to_date(a_generating_date,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN OTHERS THEN
|
WHEN OTHERS THEN
|
||||||
l_gen_date := NULL;
|
l_gen_date := NULL;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
l_repairing_start_date := to_date(a_repairing_start_date, 'yyyy-mm-dd hh24:mi:ss');
|
l_repairing_start_date := to_date(a_repairing_start_date,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN OTHERS THEN
|
WHEN OTHERS THEN
|
||||||
l_repairing_start_date := NULL;
|
l_repairing_start_date := NULL;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
l_repairing_finish_date := to_date(a_repairing_finish_date, 'yyyy-mm-dd hh24:mi:ss');
|
l_repairing_finish_date := to_date(a_repairing_finish_date,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN OTHERS THEN
|
WHEN OTHERS THEN
|
||||||
l_repairing_finish_date := NULL;
|
l_repairing_finish_date := NULL;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
l_check_date := to_date(a_check_date, 'yyyy-mm-dd hh24:mi:ss');
|
l_check_date := to_date(a_check_date,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN OTHERS THEN
|
WHEN OTHERS THEN
|
||||||
l_check_date := NULL;
|
l_check_date := NULL;
|
||||||
@ -500,6 +516,7 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
|
|
||||||
PROCEDURE import_repairing_suggestion
|
PROCEDURE import_repairing_suggestion
|
||||||
(
|
(
|
||||||
|
a_branch_name VARCHAR2,
|
||||||
a_order_no VARCHAR2,
|
a_order_no VARCHAR2,
|
||||||
a_order_type VARCHAR2,
|
a_order_type VARCHAR2,
|
||||||
a_notify_no VARCHAR2,
|
a_notify_no VARCHAR2,
|
||||||
@ -514,21 +531,15 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
) IS
|
) IS
|
||||||
BEGIN
|
BEGIN
|
||||||
--防御性验证
|
--防御性验证
|
||||||
IF a_order_no IS NULL
|
IF a_notify_no IS NULL --报案号不能为空
|
||||||
THEN
|
THEN
|
||||||
raise_application_error(no_order_no_excpt, no_order_no_text);
|
raise_application_error(no_notify_no_excpt,
|
||||||
END IF;
|
no_notify_no_text);
|
||||||
|
|
||||||
IF a_notify_no IS NULL
|
|
||||||
THEN
|
|
||||||
raise_application_error(no_notify_no_excpt, no_notify_no_text);
|
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
--删除旧数据
|
--删除旧数据
|
||||||
BEGIN
|
BEGIN
|
||||||
DELETE FROM car_dealer.送返修推荐表 a
|
DELETE FROM car_dealer.送返修推荐表 a WHERE a.报案号 = a_notify_no;
|
||||||
WHERE a.工单号 = a_order_no
|
|
||||||
AND a.报案号 = a_notify_no;
|
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN OTHERS THEN
|
WHEN OTHERS THEN
|
||||||
NULL;
|
NULL;
|
||||||
@ -536,7 +547,8 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
|
|
||||||
--插入数据
|
--插入数据
|
||||||
INSERT INTO car_dealer.送返修推荐表
|
INSERT INTO car_dealer.送返修推荐表
|
||||||
(工单号,
|
(分公司名称,
|
||||||
|
工单号,
|
||||||
工单类型,
|
工单类型,
|
||||||
报案号,
|
报案号,
|
||||||
推荐车商代码,
|
推荐车商代码,
|
||||||
@ -548,17 +560,25 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
发送时间,
|
发送时间,
|
||||||
数据来源)
|
数据来源)
|
||||||
VALUES
|
VALUES
|
||||||
(a_order_no,
|
(a_branch_name,
|
||||||
|
a_order_no,
|
||||||
a_order_type,
|
a_order_type,
|
||||||
a_notify_no,
|
a_notify_no,
|
||||||
nvl(a_推荐车商代码, '无'),
|
nvl(a_推荐车商代码,
|
||||||
nvl(a_推荐车商名称, '无'),
|
'无'),
|
||||||
to_date(a_damage_date, 'yyyy-mm-dd hh24:mi:ss'),
|
nvl(a_推荐车商名称,
|
||||||
|
'无'),
|
||||||
|
to_date(a_damage_date,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss'),
|
||||||
a_plateNo,
|
a_plateNo,
|
||||||
nvl(a_brand_name, '无'),
|
nvl(a_brand_name,
|
||||||
nvl(a_message_type, '无'),
|
'无'),
|
||||||
to_date(a_sending_date, 'yyyy-mm-dd hh24:mi:ss'),
|
nvl(a_message_type,
|
||||||
nvl(a_data_source, '无'));
|
'无'),
|
||||||
|
to_date(a_sending_date,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss'),
|
||||||
|
nvl(a_data_source,
|
||||||
|
'无'));
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
@ -738,28 +758,41 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
--防御性验证
|
--防御性验证
|
||||||
IF a_报案号 IS NULL
|
IF a_报案号 IS NULL
|
||||||
THEN
|
THEN
|
||||||
raise_application_error(no_notify_no_excpt, no_notify_no_text);
|
raise_application_error(no_notify_no_excpt,
|
||||||
|
no_notify_no_text);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
--删掉旧数据
|
--删掉旧数据
|
||||||
BEGIN
|
BEGIN
|
||||||
DELETE car_dealer.新送返修监控报表 a WHERE a.报案号 = a_报案号;
|
DELETE car_dealer.新送返修监控报表 a
|
||||||
|
WHERE a.报案号 = a_报案号
|
||||||
|
AND a.车牌 = a_车牌;
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN OTHERS THEN
|
WHEN OTHERS THEN
|
||||||
NULL;
|
NULL;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
--处理日期数据
|
--处理日期数据
|
||||||
l_报案日期 := 日期字符串转换(a_报案日期, 'yyyy-mm-dd hh24:mi:ss');
|
l_报案日期 := 日期字符串转换(a_报案日期,
|
||||||
l_出险日期 := 日期字符串转换(a_出险日期, 'yyyy-mm-dd hh24:mi:ss');
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
l_数据更新日期 := 日期字符串转换(a_数据更新日期, 'yyyy-mm-dd hh24:mi:ss');
|
l_出险日期 := 日期字符串转换(a_出险日期,
|
||||||
l_第一任务分派时间 := 日期字符串转换(a_第一任务分派时间, 'yyyy-mm-dd hh24:mi:ss');
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
l_第二任务分派时间 := 日期字符串转换(a_第二任务分派时间, 'yyyy-mm-dd hh24:mi:ss');
|
l_数据更新日期 := 日期字符串转换(a_数据更新日期,
|
||||||
l_第三任务分派时间 := 日期字符串转换(a_第三任务分派时间, 'yyyy-mm-dd hh24:mi:ss');
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
l_核价通过时间 := 日期字符串转换(a_核价通过时间, 'yyyy-mm-dd hh24:mi:ss');
|
l_第一任务分派时间 := 日期字符串转换(a_第一任务分派时间,
|
||||||
l_车辆进厂时间 := 日期字符串转换(a_车辆进厂时间, 'yyyy-mm-dd hh24:mi:ss');
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
l_车辆出厂时间 := 日期字符串转换(a_车辆出厂时间, 'yyyy-mm-dd hh24:mi:ss');
|
l_第二任务分派时间 := 日期字符串转换(a_第二任务分派时间,
|
||||||
l_结案时间 := 日期字符串转换(a_结案时间, 'yyyy-mm-dd hh24:mi:ss');
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
|
l_第三任务分派时间 := 日期字符串转换(a_第三任务分派时间,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
|
l_核价通过时间 := 日期字符串转换(a_核价通过时间,
|
||||||
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
|
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 car_dealer.新送返修监控报表
|
INSERT INTO car_dealer.新送返修监控报表
|
||||||
@ -1090,7 +1123,8 @@ CREATE OR REPLACE PACKAGE BODY data_import_util_pkg IS
|
|||||||
l_date DATE;
|
l_date DATE;
|
||||||
BEGIN
|
BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
l_date := to_date(a_date, a_formate);
|
l_date := to_date(a_date,
|
||||||
|
a_formate);
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN OTHERS THEN
|
WHEN OTHERS THEN
|
||||||
l_date := NULL;
|
l_date := NULL;
|
||||||
|
BIN
数据/核价清单-字段.xlsx
Normal file
BIN
数据/核价清单-字段.xlsx
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user