|
@@ -84,29 +84,38 @@ BEGIN
|
|
|
select count(0) into partytimeline_count from PartyTimeLine;
|
|
|
partytimeline_count:=partytimeline_count+1;
|
|
|
DBMS_OUTPUT.PUT_LINE(partytimeline_count);
|
|
|
- init_insuranceclaimthread_edorlist(partytimeline_count)
|
|
|
+ init_PartyTimeLine_edorlist(partytimeline_count)
|
|
|
|
|
|
|
|
|
select count(0) into partytimeline_count from PartyTimeLine;
|
|
|
partytimeline_count:=partytimeline_count+1;
|
|
|
DBMS_OUTPUT.PUT_LINE(partytimeline_count);
|
|
|
- init_insuranceclaimthread_edorinfo(partytimeline_count)
|
|
|
+ init_PartyTimeLine_edorinfo(partytimeline_count)
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
select count(0) into partytimeline_count from PartyTimeLine;
|
|
|
partytimeline_count:=partytimeline_count+1;
|
|
|
DBMS_OUTPUT.PUT_LINE(partytimeline_count);
|
|
|
- init_insuranceclaimthread_insuranceclaimthread(partytimeline_count)
|
|
|
+ init_PartyTimeLine_insuranceclaimthread(partytimeline_count)
|
|
|
|
|
|
|
|
|
select count(0) into partytimeline_count from PartyTimeLine;
|
|
|
partytimeline_count:=partytimeline_count+1;
|
|
|
DBMS_OUTPUT.PUT_LINE(partytimeline_count);
|
|
|
- init_insuranceclaimthread_InsuranceArrangement(partytimeline_count)
|
|
|
+ init_PartyTimeLine_InsuranceArrangement(partytimeline_count)
|
|
|
|
|
|
+
|
|
|
+ select count(0) into partytimeline_count from PartyTimeLine;
|
|
|
partytimeline_count:=partytimeline_count+1;
|
|
|
DBMS_OUTPUT.PUT_LINE(partytimeline_count);
|
|
|
+ init_PartyTimeLine_cc(partytimeline_count)
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+
|
|
|
+
|
|
|
|
|
|
strsql:='
|
|
|
CREATE SEQUENCE globaleTripID_sequence
|
|
@@ -178,7 +187,7 @@ replication 1;
|
|
|
!set plsqlUseSlash true
|
|
|
SET plsql.catch.hive.exception=true;
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE init_insuranceclaimthread_edorlist(partytimeline_count OUT int)
|
|
|
+CREATE OR REPLACE PROCEDURE init_PartyTimeLine_edorlist(partytimeline_count OUT int)
|
|
|
IS
|
|
|
BEGIN
|
|
|
|
|
@@ -253,9 +262,9 @@ BEGIN
|
|
|
|
|
|
EXCEPTION
|
|
|
WHEN HIVE_EXCEPTION THEN
|
|
|
- log_exception('init_insuranceclaimthread_edorlist',sqlerrm(),sqlcode())
|
|
|
+ log_exception('init_PartyTimeLine_edorlist',sqlerrm(),sqlcode())
|
|
|
WHEN Others THEN
|
|
|
- log_exception('init_insuranceclaimthread_edorlist',sqlerrm(),sqlcode())
|
|
|
+ log_exception('init_PartyTimeLine_edorlist',sqlerrm(),sqlcode())
|
|
|
END;
|
|
|
|
|
|
|
|
@@ -280,7 +289,7 @@ END;
|
|
|
EDORCVALIDATE string DEFAULT NULL COMMENT '保全生效日期 '
|
|
|
*/
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE init_insuranceclaimthread_edorinfo(partytimeline_count OUT int)
|
|
|
+CREATE OR REPLACE PROCEDURE init_PartyTimeLine_edorinfo(partytimeline_count OUT int)
|
|
|
IS
|
|
|
BEGIN
|
|
|
|
|
@@ -354,9 +363,9 @@ BEGIN
|
|
|
|
|
|
EXCEPTION
|
|
|
WHEN HIVE_EXCEPTION THEN
|
|
|
- log_exception('init_insuranceclaimthread_edorinfo',sqlerrm(),sqlcode())
|
|
|
+ log_exception('init_PartyTimeLine_edorinfo',sqlerrm(),sqlcode())
|
|
|
WHEN Others THEN
|
|
|
- log_exception('init_insuranceclaimthread_edorinfo',sqlerrm(),sqlcode())
|
|
|
+ log_exception('init_PartyTimeLine_edorinfo',sqlerrm(),sqlcode())
|
|
|
END;
|
|
|
|
|
|
|
|
@@ -366,10 +375,9 @@ END;
|
|
|
==========================================================================================================================================================
|
|
|
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE init_insuranceclaimthread_insuranceclaimthread(partytimeline_count OUT int)
|
|
|
+CREATE OR REPLACE PROCEDURE init_PartyTimeLine_insuranceclaimthread(partytimeline_count OUT int)
|
|
|
IS
|
|
|
BEGIN
|
|
|
-
|
|
|
insert into PartyTimeLine(
|
|
|
TripID,
|
|
|
PartyID,
|
|
@@ -408,9 +416,9 @@ BEGIN
|
|
|
|
|
|
EXCEPTION
|
|
|
WHEN HIVE_EXCEPTION THEN
|
|
|
- log_exception('init_insuranceclaimthread_insuranceclaimthread',sqlerrm(),sqlcode())
|
|
|
+ log_exception('init_PartyTimeLine_insuranceclaimthread',sqlerrm(),sqlcode())
|
|
|
WHEN Others THEN
|
|
|
- log_exception('init_insuranceclaimthread_insuranceclaimthread',sqlerrm(),sqlcode())
|
|
|
+ log_exception('init_PartyTimeLine_insuranceclaimthread',sqlerrm(),sqlcode())
|
|
|
END;
|
|
|
|
|
|
|
|
@@ -419,7 +427,7 @@ END;
|
|
|
==========================================================================================================================================================
|
|
|
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE init_insuranceclaimthread_InsuranceArrangement(partytimeline_count OUT int)
|
|
|
+CREATE OR REPLACE PROCEDURE init_PartyTimeLine_InsuranceArrangement(partytimeline_count OUT int)
|
|
|
IS
|
|
|
BEGIN
|
|
|
|
|
@@ -460,9 +468,146 @@ BEGIN
|
|
|
|
|
|
EXCEPTION
|
|
|
WHEN HIVE_EXCEPTION THEN
|
|
|
- log_exception('init_insuranceclaimthread_InsuranceArrangement',sqlerrm(),sqlcode())
|
|
|
+ log_exception('init_PartyTimeLine_InsuranceArrangement',sqlerrm(),sqlcode())
|
|
|
+ WHEN Others THEN
|
|
|
+ log_exception('init_PartyTimeLine_InsuranceArrangement',sqlerrm(),sqlcode())
|
|
|
+END;
|
|
|
+
|
|
|
+
|
|
|
+==================================================================================================================================================
|
|
|
+===========================================================根据cc_record_main表插入 保全 理赔 咨询=========================================================
|
|
|
+==================================================================================================================================================
|
|
|
+CREATE TABLE PartyTimeLine_cc_tmp(
|
|
|
+ id string,
|
|
|
+ ThreadID string comment '记录id',
|
|
|
+ ParentID string comment '父ID 保单号 ',
|
|
|
+ PartyID string COMMENT '参与方ID' ,
|
|
|
+ Name string COMMENT '参与方名称' ,
|
|
|
+ PCertID string COMMENT '参与方证件号码' ,
|
|
|
+ PPhone string COMMENT '参与方手机' ,
|
|
|
+ PRole string COMMENT '参与方角色' ,
|
|
|
+ EndDate DATE COMMENT '完成日期'
|
|
|
+) COMMENT '呼叫中心临时表'
|
|
|
+STORED AS ES
|
|
|
+with shard number 10
|
|
|
+replication 1;
|
|
|
+
|
|
|
+
|
|
|
+CREATE OR REPLACE PROCEDURE init_PartyTimeLine_cc(partytimeline_count OUT int)
|
|
|
+IS
|
|
|
+BEGIN
|
|
|
+
|
|
|
+ delete from PartyTimeLine_cc_tmp;
|
|
|
+
|
|
|
+
|
|
|
+ insert into PartyTimeLine_cc_tmp(
|
|
|
+ id ,
|
|
|
+ ThreadID,
|
|
|
+ ParentID ,
|
|
|
+
|
|
|
+ Name ,
|
|
|
+
|
|
|
+ PPhone ,
|
|
|
+
|
|
|
+ EndDate
|
|
|
+ )
|
|
|
+ SELECT
|
|
|
+ row_number()over(),
|
|
|
+ recordinfo_id,
|
|
|
+ contNos,
|
|
|
+
|
|
|
+ econtactsName,
|
|
|
+
|
|
|
+ econtactsPhone,
|
|
|
+ startTime
|
|
|
+ from shanghailifeecif.cc_record_main where contNos is not null;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ UPDATE PartyTimeLine_cc_tmp a SET (
|
|
|
+ PartyID ,
|
|
|
+ PCertID ,
|
|
|
+ PRole
|
|
|
+ ) = (
|
|
|
+ select
|
|
|
+ b.ApplicantID ,
|
|
|
+ b.appcertid,
|
|
|
+ '投保人'
|
|
|
+ from (
|
|
|
+ SELECT
|
|
|
+ policyno,
|
|
|
+ row_number()over(partition by policyno ) tmpfiled,
|
|
|
+ ApplicantID ,
|
|
|
+ appname,
|
|
|
+ appcertid
|
|
|
+ FROM qxp.insurancearrangement
|
|
|
+ )b
|
|
|
+ where b.policyno = a.ParentID AND b.appname = a.name AND b.tmpfiled=1
|
|
|
+ ) WHERE a.PartyID IS null ;
|
|
|
+
|
|
|
+ UPDATE PartyTimeLine_cc_tmp a SET (
|
|
|
+ PartyID ,
|
|
|
+ PCertID ,
|
|
|
+ PRole
|
|
|
+ ) = (
|
|
|
+ select
|
|
|
+ b.insuredid ,
|
|
|
+ b.inscertid,
|
|
|
+ '被保人'
|
|
|
+ from (
|
|
|
+ SELECT
|
|
|
+ policyno,
|
|
|
+ row_number()over(partition by policyno ) tmpfiled,
|
|
|
+ insuredid ,
|
|
|
+ insname,
|
|
|
+ inscertid
|
|
|
+ FROM qxp.insurancearrangement
|
|
|
+ )b
|
|
|
+ where b.policyno = a.ParentID AND b.insname = a.name AND b.tmpfiled=1
|
|
|
+ ) WHERE a.PartyID IS null ;
|
|
|
+
|
|
|
+
|
|
|
+ insert into PartyTimeLine(
|
|
|
+ TripID,
|
|
|
+ PartyID,
|
|
|
+ Name,
|
|
|
+ PCertID,
|
|
|
+ PPhone,
|
|
|
+ PRole,
|
|
|
+ Scenario,
|
|
|
+ SDate,
|
|
|
+ ThreadID,
|
|
|
+ ParentID,
|
|
|
+ EndDate,
|
|
|
+ CREATED_BY,
|
|
|
+ CREATED_TIME
|
|
|
+ )
|
|
|
+ SELECT
|
|
|
+ row_number()over() +partytimeline_count,
|
|
|
+ PartyID,
|
|
|
+ Name,
|
|
|
+ PCertID,
|
|
|
+ PPhone,
|
|
|
+ PRole,
|
|
|
+ '咨询',
|
|
|
+ EndDate,
|
|
|
+ ThreadID,
|
|
|
+ ParentID,
|
|
|
+ EndDate ,
|
|
|
+ 'admin',
|
|
|
+ sysdate
|
|
|
+ from PartyTimeLine_cc_tmp where PartyID is not null;
|
|
|
+
|
|
|
+
|
|
|
+ select count(0) into partytimeline_count from PartyTimeLine;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ EXCEPTION
|
|
|
+ WHEN HIVE_EXCEPTION THEN
|
|
|
+ log_exception('init_PartyTimeLine_cc',sqlerrm(),sqlcode())
|
|
|
WHEN Others THEN
|
|
|
- log_exception('init_insuranceclaimthread_InsuranceArrangement',sqlerrm(),sqlcode())
|
|
|
+ log_exception('init_PartyTimeLine_cc',sqlerrm(),sqlcode())
|
|
|
END;
|
|
|
|
|
|
|
|
@@ -471,16 +616,27 @@ END;
|
|
|
|
|
|
|
|
|
|
|
|
+==================================================================================================================================================
|
|
|
+===========================================================更新投诉到事件表中=========================================================
|
|
|
+==================================================================================================================================================
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+==================================================================================================================================================
|
|
|
+===========================================================更新用户主表最后接触方式=========================================================
|
|
|
+==================================================================================================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-================================================数据解析============================================================================================
|
|
|
+===================================================================数据解析========================================================================
|
|
|
|
|
|
|
|
|
|