add workflow 天润dynamic邮件同步,dev

This commit is contained in:
root 2024-12-12 11:48:12 +08:00
parent 86abb9564f
commit 6d7788a423
2 changed files with 25 additions and 19 deletions

View File

@ -4,11 +4,11 @@
/*Brilliance stems from wisdoms. */
/*************Head Section**************************************************************************/
/*Script Use: Periodically load data to :f_ccc_work_ticket_integ(smartccc工单信息集成) */
/*Create Date:2024-11-22 10:09:19 */
/*Create Date:2024-12-12 11:47:33 */
/*SDM Developed By: dev */
/*SDM Developed Date: 2024-07-09 */
/*SDM Checked By: dev */
/*SDM Checked Date: 2024-11-22 */
/*SDM Checked Date: 2024-12-12 */
/*Script Developed By: dev */
/*Script Checked By: dev */
/*Source table 1: :PDMDB.t01_ccc_cust_info */
@ -107,15 +107,13 @@ SELECT
,coalesce(p1."source",'') /*PEXTENSION*/
,COALESCE(TRIM(CAST(p0.customer_name AS varchar(20))),'') /*LAST_NAME*/
,coalesce(p0.id,'') /*SUFFIX*/
,'Company: '||coalesce((SELECT jsonb_extract_path_text(j, 'value')
,coalesce((SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j
WHERE jsonb_extract_path_text(j, 'id') = '305038'),(SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements(p1.customize::jsonb) j
WHERE jsonb_extract_path_text(j, 'name') = '公司名称'),'')||',Enduser: '||coalesce((SELECT jsonb_extract_path_text(j, 'value')
WHERE jsonb_extract_path_text(j, 'id') = '305038'),'')||(case when coalesce((SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j
WHERE jsonb_extract_path_text(j, 'id') = '297756'),(SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements(p1.customize::jsonb) j
WHERE jsonb_extract_path_text(j, 'name') = '公司名称'),'') /*COMPANY_NAME*/
WHERE jsonb_extract_path_text(j, 'id') = '297756'),'') = '' then '' else ',Enduser: '||coalesce((SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j
WHERE jsonb_extract_path_text(j, 'id') = '297756'),'') end) /*COMPANY_NAME*/
,coalesce((SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements(p1.customize::jsonb) j
WHERE jsonb_extract_path_text(j, 'name') = '职位'),'') /*JOB_TITLE*/
@ -133,11 +131,15 @@ SELECT
,'YES' /*REQUEST_A_QUOTE*/
,'YES' /*HAMCAM*/
,4 /*PURCHASE_INTENT*/
,'L - mql '||coalesce((SELECT jsonb_extract_path_text(field, 'value') AS value_298245
,'L - mql '||case when p0.workflow_name ='CN离线工单_选型报价' then coalesce((SELECT jsonb_extract_path_text(field, 'value') AS value_298245
FROM (
SELECT jsonb_array_elements(p0.start_form::jsonb->'fields') AS field
) AS t
WHERE jsonb_extract_path_text(field, 'id')::int = 298246),'')||' 预算情况:'||coalesce((SELECT jsonb_extract_path_text(field, 'value') AS value_298245
WHERE jsonb_extract_path_text(field, 'id')::int = 297757),'') else coalesce((SELECT jsonb_extract_path_text(field, 'value') AS value_298245
FROM (
SELECT jsonb_array_elements(p0.start_form::jsonb->'fields') AS field
) AS t
WHERE jsonb_extract_path_text(field, 'id')::int = 298246),'') end ||' 预算情况:'||coalesce((SELECT jsonb_extract_path_text(field, 'value') AS value_298245
FROM (
SELECT jsonb_array_elements(p0.start_form::jsonb->'fields') AS field
) AS t
@ -348,6 +350,10 @@ WHERE jsonb_extract_path_text(field, 'id')::int = 298249),' None ')||';'
FROM (
SELECT jsonb_array_elements(p0.start_form::jsonb->'fields') AS field
) AS t
WHERE jsonb_extract_path_text(field, 'id')::int = 304927),(SELECT jsonb_extract_path_text(field, 'value') AS value_298300
FROM (
SELECT jsonb_array_elements(p0.start_form::jsonb->'fields') AS field
) AS t
WHERE jsonb_extract_path_text(field, 'id')::int = 299137),'') /*LEAD_PRODUCTS_01_5*/
,'YES' /*PERMISSION_PHONE*/
,COALESCE(p0.create_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*PERMISSION_PHONE_DATE*/

View File

@ -24,7 +24,7 @@ default_args = {
}
dag = DAG('wf_dag_smart_ccc_dynamic_email', default_args=default_args,
schedule_interval="5 10,14,16,12,18 * * 1-5",
schedule_interval="5 10,14,16,12,18 * * *",
catchup=False,
dagrun_timeout=timedelta(minutes=160),
max_active_runs=3)