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