add workflow 天润Smart-ccc通话记录,dev

This commit is contained in:
root 2024-07-03 16:55:07 +08:00
parent 54cf1099e7
commit 7a4476792d
4 changed files with 322 additions and 322 deletions

View File

@ -78,7 +78,7 @@ insert into p10_sa.S98_S_tr_cc_cdr_ib_list
, etl_tx_dt
from p00_tal.S98_S_tr_cc_cdr_ib_list
;
delete from p12_sfull.S98_S_tr_cc_cdr_ib_list
delete from p12_sfull.S98_S_tr_cc_cdr_ib_list where main_unique_id in (select main_unique_id from S98_S_tr_cc_cdr_ib_list)
;
;
insert into p12_sfull.S98_S_tr_cc_cdr_ib_list

View File

@ -5,101 +5,101 @@
delete from p10_sa.S98_S_tr_cc_cdr_ob_detail
;
insert into p10_sa.S98_S_tr_cc_cdr_ob_detail
( cno
, client_name
, client_number
, start_time
, callee_ringing_time
, answer_time
, end_time
, bridge_duration
, call_type
, call_type_desc
, detail_call_type
, detail_call_type_desc
, ob_sip_cause
, sip_cause
, sip_cause_desc
, record_file
, tsi_file
, call_id
, webrtc_call_id
, main_unique_id
, unique_id
( cno
, client_name
, client_number
, start_time
, callee_ringing_time
, answer_time
, end_time
, bridge_duration
, call_type
, call_type_desc
, detail_call_type
, detail_call_type_desc
, ob_sip_cause
, sip_cause
, sip_cause_desc
, record_file
, tsi_file
, call_id
, webrtc_call_id
, main_unique_id
, unique_id
, etl_tx_dt )
select
cno
, client_name
, client_number
, start_time
, callee_ringing_time
, answer_time
, end_time
, bridge_duration
, call_type
, call_type_desc
, detail_call_type
, detail_call_type_desc
, ob_sip_cause
, sip_cause
, sip_cause_desc
, record_file
, tsi_file
, call_id
, webrtc_call_id
, main_unique_id
, unique_id
cno
, client_name
, client_number
, start_time
, callee_ringing_time
, answer_time
, end_time
, bridge_duration
, call_type
, call_type_desc
, detail_call_type
, detail_call_type_desc
, ob_sip_cause
, sip_cause
, sip_cause_desc
, record_file
, tsi_file
, call_id
, webrtc_call_id
, main_unique_id
, unique_id
, etl_tx_dt
from p00_tal.S98_S_tr_cc_cdr_ob_detail
;
delete from p12_sfull.S98_S_tr_cc_cdr_ob_detail
delete from p12_sfull.S98_S_tr_cc_cdr_ob_detail where unique_id in (select unique_id from p10_sa.S98_S_tr_cc_cdr_ob_detail)
;
;
insert into p12_sfull.S98_S_tr_cc_cdr_ob_detail
( cno
, client_name
, client_number
, start_time
, callee_ringing_time
, answer_time
, end_time
, bridge_duration
, call_type
, call_type_desc
, detail_call_type
, detail_call_type_desc
, ob_sip_cause
, sip_cause
, sip_cause_desc
, record_file
, tsi_file
, call_id
, webrtc_call_id
, main_unique_id
, unique_id
( cno
, client_name
, client_number
, start_time
, callee_ringing_time
, answer_time
, end_time
, bridge_duration
, call_type
, call_type_desc
, detail_call_type
, detail_call_type_desc
, ob_sip_cause
, sip_cause
, sip_cause_desc
, record_file
, tsi_file
, call_id
, webrtc_call_id
, main_unique_id
, unique_id
, etl_tx_dt )
select
cno
, client_name
, client_number
, start_time
, callee_ringing_time
, answer_time
, end_time
, bridge_duration
, call_type
, call_type_desc
, detail_call_type
, detail_call_type_desc
, ob_sip_cause
, sip_cause
, sip_cause_desc
, record_file
, tsi_file
, call_id
, webrtc_call_id
, main_unique_id
, unique_id
cno
, client_name
, client_number
, start_time
, callee_ringing_time
, answer_time
, end_time
, bridge_duration
, call_type
, call_type_desc
, detail_call_type
, detail_call_type_desc
, ob_sip_cause
, sip_cause
, sip_cause_desc
, record_file
, tsi_file
, call_id
, webrtc_call_id
, main_unique_id
, unique_id
, etl_tx_dt
from p10_sa.S98_S_tr_cc_cdr_ob_detail
;

View File

@ -5,249 +5,249 @@
delete from p10_sa.S98_S_tr_cc_cdr_ob_list
;
insert into p10_sa.S98_S_tr_cc_cdr_ob_list
( customer_number
, customer_number_encrypt
, customer_area
, customer_province
, customer_city
, call_type
, call_type_key
, left_clid
, left_clid_area
, left_clid_province
, left_clid_city
, trunk_group_key
, xnumber
, xnumber_area
, xnumber_province
, xnumber_city
, status
, status_desc
, tag_names
, main_unique_id
, request_unique_id
, ob_sip_cause
, on_hook_source
, record_file
, asr_record
, evaluation
, investigation_keys
, call_id
, webrtc_call_id
, rtc_uid
, cno
, client_name
, client_number
, start_time
, up_time
, callee_ringing_time
, bridge_time
, end_time
, bridge_duration
, total_duration
, pre_ring_wait_duration
, callee_ringing_duration
, ob_wait_duration
, task_id
, task_name
, task_inventory_id
, exist_ticket
, ticket_ids
, exist_business
, business_ids
, user_field
, exist_customer
, customer_area_code
, customer_post_code
, customer_vip
, enterprise_id
, mark_data
, type
( customer_number
, customer_number_encrypt
, customer_area
, customer_province
, customer_city
, call_type
, call_type_key
, left_clid
, left_clid_area
, left_clid_province
, left_clid_city
, trunk_group_key
, xnumber
, xnumber_area
, xnumber_province
, xnumber_city
, status
, status_desc
, tag_names
, main_unique_id
, request_unique_id
, ob_sip_cause
, on_hook_source
, record_file
, asr_record
, evaluation
, investigation_keys
, call_id
, webrtc_call_id
, rtc_uid
, cno
, client_name
, client_number
, start_time
, up_time
, callee_ringing_time
, bridge_time
, end_time
, bridge_duration
, total_duration
, pre_ring_wait_duration
, callee_ringing_duration
, ob_wait_duration
, task_id
, task_name
, task_inventory_id
, exist_ticket
, ticket_ids
, exist_business
, business_ids
, user_field
, exist_customer
, customer_area_code
, customer_post_code
, customer_vip
, enterprise_id
, mark_data
, type
, etl_tx_dt )
select
customer_number
, customer_number_encrypt
, customer_area
, customer_province
, customer_city
, call_type
, call_type_key
, left_clid
, left_clid_area
, left_clid_province
, left_clid_city
, trunk_group_key
, xnumber
, xnumber_area
, xnumber_province
, xnumber_city
, status
, status_desc
, tag_names
, main_unique_id
, request_unique_id
, ob_sip_cause
, on_hook_source
, record_file
, asr_record
, evaluation
, investigation_keys
, call_id
, webrtc_call_id
, rtc_uid
, cno
, client_name
, client_number
, start_time
, up_time
, callee_ringing_time
, bridge_time
, end_time
, bridge_duration
, total_duration
, pre_ring_wait_duration
, callee_ringing_duration
, ob_wait_duration
, task_id
, task_name
, task_inventory_id
, exist_ticket
, ticket_ids
, exist_business
, business_ids
, user_field
, exist_customer
, customer_area_code
, customer_post_code
, customer_vip
, enterprise_id
, mark_data
, type
customer_number
, customer_number_encrypt
, customer_area
, customer_province
, customer_city
, call_type
, call_type_key
, left_clid
, left_clid_area
, left_clid_province
, left_clid_city
, trunk_group_key
, xnumber
, xnumber_area
, xnumber_province
, xnumber_city
, status
, status_desc
, tag_names
, main_unique_id
, request_unique_id
, ob_sip_cause
, on_hook_source
, record_file
, asr_record
, evaluation
, investigation_keys
, call_id
, webrtc_call_id
, rtc_uid
, cno
, client_name
, client_number
, start_time
, up_time
, callee_ringing_time
, bridge_time
, end_time
, bridge_duration
, total_duration
, pre_ring_wait_duration
, callee_ringing_duration
, ob_wait_duration
, task_id
, task_name
, task_inventory_id
, exist_ticket
, ticket_ids
, exist_business
, business_ids
, user_field
, exist_customer
, customer_area_code
, customer_post_code
, customer_vip
, enterprise_id
, mark_data
, type
, etl_tx_dt
from p00_tal.S98_S_tr_cc_cdr_ob_list
;
delete from p12_sfull.S98_S_tr_cc_cdr_ob_list
delete from p12_sfull.S98_S_tr_cc_cdr_ob_list where main_unique_id in (select main_unique_id from p10_sa.S98_S_tr_cc_cdr_ob_list)
;
;
insert into p12_sfull.S98_S_tr_cc_cdr_ob_list
( customer_number
, customer_number_encrypt
, customer_area
, customer_province
, customer_city
, call_type
, call_type_key
, left_clid
, left_clid_area
, left_clid_province
, left_clid_city
, trunk_group_key
, xnumber
, xnumber_area
, xnumber_province
, xnumber_city
, status
, status_desc
, tag_names
, main_unique_id
, request_unique_id
, ob_sip_cause
, on_hook_source
, record_file
, asr_record
, evaluation
, investigation_keys
, call_id
, webrtc_call_id
, rtc_uid
, cno
, client_name
, client_number
, start_time
, up_time
, callee_ringing_time
, bridge_time
, end_time
, bridge_duration
, total_duration
, pre_ring_wait_duration
, callee_ringing_duration
, ob_wait_duration
, task_id
, task_name
, task_inventory_id
, exist_ticket
, ticket_ids
, exist_business
, business_ids
, user_field
, exist_customer
, customer_area_code
, customer_post_code
, customer_vip
, enterprise_id
, mark_data
, type
( customer_number
, customer_number_encrypt
, customer_area
, customer_province
, customer_city
, call_type
, call_type_key
, left_clid
, left_clid_area
, left_clid_province
, left_clid_city
, trunk_group_key
, xnumber
, xnumber_area
, xnumber_province
, xnumber_city
, status
, status_desc
, tag_names
, main_unique_id
, request_unique_id
, ob_sip_cause
, on_hook_source
, record_file
, asr_record
, evaluation
, investigation_keys
, call_id
, webrtc_call_id
, rtc_uid
, cno
, client_name
, client_number
, start_time
, up_time
, callee_ringing_time
, bridge_time
, end_time
, bridge_duration
, total_duration
, pre_ring_wait_duration
, callee_ringing_duration
, ob_wait_duration
, task_id
, task_name
, task_inventory_id
, exist_ticket
, ticket_ids
, exist_business
, business_ids
, user_field
, exist_customer
, customer_area_code
, customer_post_code
, customer_vip
, enterprise_id
, mark_data
, type
, etl_tx_dt )
select
customer_number
, customer_number_encrypt
, customer_area
, customer_province
, customer_city
, call_type
, call_type_key
, left_clid
, left_clid_area
, left_clid_province
, left_clid_city
, trunk_group_key
, xnumber
, xnumber_area
, xnumber_province
, xnumber_city
, status
, status_desc
, tag_names
, main_unique_id
, request_unique_id
, ob_sip_cause
, on_hook_source
, record_file
, asr_record
, evaluation
, investigation_keys
, call_id
, webrtc_call_id
, rtc_uid
, cno
, client_name
, client_number
, start_time
, up_time
, callee_ringing_time
, bridge_time
, end_time
, bridge_duration
, total_duration
, pre_ring_wait_duration
, callee_ringing_duration
, ob_wait_duration
, task_id
, task_name
, task_inventory_id
, exist_ticket
, ticket_ids
, exist_business
, business_ids
, user_field
, exist_customer
, customer_area_code
, customer_post_code
, customer_vip
, enterprise_id
, mark_data
, type
customer_number
, customer_number_encrypt
, customer_area
, customer_province
, customer_city
, call_type
, call_type_key
, left_clid
, left_clid_area
, left_clid_province
, left_clid_city
, trunk_group_key
, xnumber
, xnumber_area
, xnumber_province
, xnumber_city
, status
, status_desc
, tag_names
, main_unique_id
, request_unique_id
, ob_sip_cause
, on_hook_source
, record_file
, asr_record
, evaluation
, investigation_keys
, call_id
, webrtc_call_id
, rtc_uid
, cno
, client_name
, client_number
, start_time
, up_time
, callee_ringing_time
, bridge_time
, end_time
, bridge_duration
, total_duration
, pre_ring_wait_duration
, callee_ringing_duration
, ob_wait_duration
, task_id
, task_name
, task_inventory_id
, exist_ticket
, ticket_ids
, exist_business
, business_ids
, user_field
, exist_customer
, customer_area_code
, customer_post_code
, customer_vip
, enterprise_id
, mark_data
, type
, etl_tx_dt
from p10_sa.S98_S_tr_cc_cdr_ob_list
;

View File

@ -65,8 +65,8 @@ def build_query_string(params):
def request_data_signature_get():
print(f'开始请求外呼记录数据')
url='https://api-bj.clink.cn/cc/list_cdr_ob'
# param={'Timestamp':current_time_utc,'Expires':86400,'startTime':previous_hour_timestamp(1),'startTimeEnd':previous_hour_timestamp(0),'AccessKeyId':'b17759d3a36fba9a2cf522fbf4cbf177'}
param={'Timestamp':current_time_utc,'Expires':86400,'startTime':1717516800,'startTimeEnd':previous_hour_timestamp(0),'AccessKeyId':'b17759d3a36fba9a2cf522fbf4cbf177'}
param={'Timestamp':current_time_utc,'Expires':86400,'startTime':previous_hour_timestamp(1),'startTimeEnd':previous_hour_timestamp(0),'AccessKeyId':'b17759d3a36fba9a2cf522fbf4cbf177'}
# param={'Timestamp':current_time_utc,'Expires':86400,'startTime':1717516800,'startTimeEnd':previous_hour_timestamp(0),'AccessKeyId':'b17759d3a36fba9a2cf522fbf4cbf177'}
print(f'param: {param}')
url_path = build_query_string(param)
url_param = url_path
@ -148,7 +148,7 @@ def load_detail_data_to_db(ids, dataList):
json_object = json.dumps(dataList)
idstr = ','.join(ids)
cur=conn.cursor()
sql="update data_api.cc_details_ids_exp set is_loaded = '1' where api_id = '7a38de24858a40ed9837f61ca7f80b08' and id in (%s); INSERT INTO data_api.cc_cdr_ob_details (id,api_id,data,total_num,is_loaded,status,request_tm,execute_tm,remark) values (%s,%s,%s,%s,'0','0',current_timestamp(0),current_timestamp(0),'')"
sql="update data_api.cc_details_ids_exp set is_loaded = '1' where api_id = '7a38de24858a40ed9837f61ca7f80b08' and id in (%s);update data_api.cc_cdr_ob_details set is_loaded = '1' where api_id = '7a38de24858a40ed9837f61ca7f80b08'; INSERT INTO data_api.cc_cdr_ob_details (id,api_id,data,total_num,is_loaded,status,request_tm,execute_tm,remark) values (%s,%s,%s,%s,'0','0',current_timestamp(0),current_timestamp(0),'')"
cur.execute(sql,[idstr,dataId,'7a38de24858a40ed9837f61ca7f80b08', json_object, total])
conn.commit()
cur.close()