
-- jjx 内部消息地址修改
UPDATE PORTAL_SYS_MSG_TPL SET PLAIN_ = '审批提醒，您有新的工作流需要审批：${taskSubject}。', HTML_ = '<p>审批提醒：<br/>您有新的工作流需要审批<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a></p>' WHERE ID_ = '13';

UPDATE  PORTAL_SYS_PROPERTIES SET VALUE = 'front' WHERE ID = '22';
UPDATE  PORTAL_SYS_PROPERTIES  SET VALUE = 'mobile' WHERE ID  = '23';




-- 2022-05-05 yijj 增加target_node_目标节点字段
alter table BPM_EXE_STACK_EXECUTOR
	add TARGET_NODE_ varchar(64);
comment on column BPM_EXE_STACK_EXECUTOR.TARGET_NODE_ is '目标节点';


-- 2022-06-01 待办事项标题 存储字段长度不够，影响启动流程
alter table bpm_task alter column subject_ type varchar(256) using subject_::varchar(256);
alter table BPM_PRO_INST alter column SUBJECT_  type VARCHAR(256) using subject_::varchar(256);


-- 2022-06-06 jjx 内部消息链接地址修改
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '任务创${instSubject}建通知', PLAIN_ = '任务创建：流程实例：${instSubject}，执行到${nodeName}', HTML_ = '<p>任务创建：流程实例<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${instSubject}</a>，执行到${nodeName}</p>' WHERE ID_ = '1';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '流程实例抄送', PLAIN_ = '流程实例抄送：流程${taskSubject}的${instId}实例，已经抄送给您。', HTML_ = '<p>流程实例抄送：流程<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?readId=${readId}&instId=${instId}&from=received&receivedStatus=COPYTO&isRead=0" target="_self">${taskSubject}</a>的${instId}实例，已经抄送给您。</p>' WHERE ID_ = '10';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '驳回提醒', PLAIN_ = '驳回提醒，您的：${taskSubject}，请求被驳回，请处理!', HTML_ = '<p>驳回提醒：<br/>您的<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a>请求被驳回，请处理!</p>'  WHERE ID_ = '14';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '流程人工终止结束通知', PLAIN_ = '流程实例人工终止结束通知：${instSubject}，意见:${cause}。', HTML_ = '<p>流程实例结束<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?instId=${instId}&type=request" target="_self">${taskSubject}</a>，意见:${cause}。</p>'  WHERE ID_ = '17';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '流程终止恢复通知', PLAIN_ = '流程实例终止恢复通知：${instSubject}，意见:${cause}。', HTML_ = '<p>流程实例已恢复运行中状态<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?instId=${instId}&type=request" target="_self">${instSubject}</a>，意见:${cause}。</p>'  WHERE ID_ = '20';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '设置任务执行人通知', PLAIN_ = '设置任务执行人：${taskSubject}，意见:${cause}。', HTML_ = '<p>设置任务执行人：<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a>，意见:${cause}。</p>'  WHERE ID_ = '21';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '任务转交通知', PLAIN_ = '任务转交：流程实例：${instSubject}的${nodeName}任务，已经转交给你办理。', HTML_ = '<p>任务转交：流程实例<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a>，需要你办理。</p>'  WHERE ID_ = '6';

-- 2022-06-08 liangjc删除 任务并行审批默认、撤销并行审批默认、任务驳回默认 配置
DELETE FROM	portal_sys_msg_tpl WHERE	ID_ IN ('18','19','9');
-- 2022-06-08 删除的消息模板：任务创建默认、任务完成默认、任务并行审批默认、撤销并行审批默认、撤销流转默认、任务驳回默认  update by ouyanggaolong
DELETE FROM portal_sys_msg_tpl where KEY_ in ('taskcreate-default', 'taskcomplete-default', 'bpmnTaskApproveLine-default', 'bpmnTaskApproveLineCancel-default', 'bpmtranscancel-default','taskback-default');

-- 2022-06-10 jjx 内部消息链接地址和提示内容修改
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '流程实例抄送', PLAIN_ = '流程实例抄送：流程${taskSubject}的${instId}实例，已经抄送给您。', HTML_ = '<p>流程实例抄送：</p><p>流程<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?readId=${readId}&instId=${instId}&from=received&receivedStatus=COPYTO&isRead=0" target="_self">${taskSubject}</a>的${instId}实例，已经抄送给您</p>' WHERE ID_ = '10';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '流程结束通知', PLAIN_ = '流程实例结束：${instSubject}，意见:${cause}。', HTML_ = '<p>流程实例结束</p><p>${instSubject}，意见:${cause}</p>' WHERE ID_ = '11';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '审批提醒', PLAIN_ = '审批提醒，您有新的工作流需要审批：${taskSubject}。', HTML_ = '<p>审批提醒：<br/>您有新的工作流需要审批<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a></p>' WHERE ID_ = '13';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '驳回提醒', PLAIN_ = '驳回提醒，您的：${taskSubject}，请求被驳回，请处理!', HTML_ = '<p>驳回提醒：<br/>您的<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a>请求被驳回，请处理!</p>' WHERE ID_ = '14';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '撤销提醒', PLAIN_ = '撤销提醒，审批任务${taskSubject}被撤销，撤销原因${cause} 原因通过cmd获取。', HTML_ = '<p>撤销提醒：<br/>审批任务${taskSubject}被撤销，撤销原因${cause}</p>' WHERE ID_ = '15';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '代理任务审批', PLAIN_ = '代理任务审批，您有新的代理任务需要审批：${taskSubject}，委托人${delegate}.', HTML_ = '<p>代理任务审批：<br/>您有新的代理任务需要审批<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a>，委托人${delegate}</p>' WHERE ID_ = '16';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '流程人工终止结束通知', PLAIN_ = '流程实例人工终止结束通知：${instSubject}，意见:${cause}。', HTML_ = '<p>人工终止结束通知:</p><p>流程实例结束<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?instId=${instId}&type=request" target="_self">${taskSubject}</a>，意见:${cause}</p>' WHERE ID_ = '17';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '任务沟通', PLAIN_ = '任务沟通提醒，${receiver}您好,任务：${taskSubject}需要与您交流，请给出意见。', HTML_ = '<p>任务沟通提醒:</p><p>${receiver}您好,任务：${taskSubject}需要与您交流，请给出意见</p>' WHERE ID_ = '2';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '流程终止恢复通知', PLAIN_ = '流程实例终止恢复通知：${instSubject}，意见:${cause}。', HTML_ = '<p>流程终止恢复通知:</p><p>流程实例已恢复运行中状态<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?instId=${instId}&type=request" target="_self">${instSubject}</a>，意见:${cause}</p>' WHERE ID_ = '20';
UPDATE portal_sys_msg_tpl SET SUBJECT_ = '设置任务执行人通知', PLAIN_ = '设置任务执行人：${taskSubject}，意见:${cause}。', HTML_ = '<p>设置任务执行人通知:</p><p>设置任务执行人：<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a>，意见:${cause}</p>'WHERE ID_ = '21';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '通知被代理人', PLAIN_ = '代理通知，您的任务：${taskSubject}，代理给${agent}', HTML_ = '<p>代理通知：<br/>您的任务<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a>，代理给${agent}</p>' WHERE ID_ = '3';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '通知沟通人nn', PLAIN_ = '流程任务沟通 已经给出意见n', HTML_ = '<p>沟通反馈提醒:</p><p>实例${taskSubject}发起的沟通，已给出意见</p><p><br/></p><p><br/></p><p><br/></p>' WHERE ID_ = '4';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '任务流转默认', PLAIN_ = '${cause}', HTML_ = '<p>任务流转通知：</p><p><a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a>的${nodeName}任务，已经流转给您</p>' WHERE ID_ = '5';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '任务转交通知', PLAIN_ = '任务转交：流程实例：${instSubject}的${nodeName}任务，已经转交给你办理。', HTML_ = '<p>任务转交：</p><p>流程实例<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a>，需要您办理</p>' WHERE ID_ = '6';
UPDATE portal_sys_msg_tpl SET  SUBJECT_ = '加签通知', PLAIN_ = '加签通知，${sender}将任务：${taskSubject}转交给您', HTML_ = '<p>加签通知：<br/>${sender}邀请您参与会签任务<a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true" target="_self">${taskSubject}</a>,加签原因:${cause}</p>' WHERE ID_ = '7';


-- 2022-06-17 jjx 待办列表字段显示配置 创建人改为发起人，创建时间改为发起时间
update portal_sys_properties set value='bHfS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qXom3ADdeFuCuNxYc1rJR0S8gwngwSZ1FI75hKGF0dIn7F2DZltLlTXdbMBihFzRPf/3k++JlsfcGFRrhMFE91P5tMnxeMg/OjQl+RpKxDgGvk8o/5EV2AyKNGycHsftMAoUaAP02Lzv' where alias = 'taskListFiledConf';

-- 2022-06-17 jjx 修改领导秘书配置保存流程信息的字段长度
alter table bpm_secretary_manage alter column share_key_ type varchar(4000) using share_key_::varchar(4000);

-- 2022-06-23 wanghb 修改接口管理表创建时间和更新时间的类型
alter table portal_interface_manager alter column create_time_ type timestamp using create_time_::timestamp;
alter table portal_interface_manager alter column update_time_ type timestamp using update_time_::timestamp;


-- 2022-06-23 heyf 修改关联查询、对话框、外部系统调用日志表中header的长度为2000
alter table form_custom_query  alter column header_ type varchar(2000) using header_::varchar(2000);
alter table form_custom_dialog  alter column header_ type varchar(2000) using header_::varchar(2000);
alter table bpm_call_log  alter column header_ type varchar(2000) using header_::varchar(2000);

--2022-07-13 yijj 修改消息模版标题长度
alter table portal_sys_msg_tpl alter column subject_ type varchar(250) using subject_::varchar(250);


--2022-7-13  定时计划配置参数修改
UPDATE "qrtz_job_details" SET "job_data" = E'\\254\\355\\000\\005sr\\000\\025org.quartz.JobDataMap\\237\\260\\203\\350\\277\\251\\260\\313\\002\\000\\000xr\\000&org.quartz.utils.StringKeyDirtyFlagMap\\202\\010\\350\\303\\373\\305](\\002\\000\\001Z\\000\\023allowsTransientDataxr\\000\\035org.quartz.utils.DirtyFlagMap\\023\\346.\\255(v\\012\\316\\002\\000\\002Z\\000\\005dirtyL\\000\\003mapt\\000\\017Ljava/util/Map;xp\\000sr\\000\\021java.util.HashMap\\005\\007\\332\\301\\303\\026`\\321\\003\\000\\002F\\000\\012loadFactorI\\000\\011thresholdxp?@\\000\\000\\000\\000\\000\\020w\\010\\000\\000\\000\\020\\000\\000\\000\\000x\\000'::bytea WHERE "sched_name" = 'quartzScheduler' AND "job_name" = '流程定时启动任务类' AND "job_group" = '-1';
UPDATE "qrtz_job_details" SET  "job_data" = E'\\254\\355\\000\\005sr\\000\\025org.quartz.JobDataMap\\237\\260\\203\\350\\277\\251\\260\\313\\002\\000\\000xr\\000&org.quartz.utils.StringKeyDirtyFlagMap\\202\\010\\350\\303\\373\\305](\\002\\000\\001Z\\000\\023allowsTransientDataxr\\000\\035org.quartz.utils.DirtyFlagMap\\023\\346.\\255(v\\012\\316\\002\\000\\002Z\\000\\005dirtyL\\000\\003mapt\\000\\017Ljava/util/Map;xp\\000sr\\000\\021java.util.HashMap\\005\\007\\332\\301\\303\\026`\\321\\003\\000\\002F\\000\\012loadFactorI\\000\\011thresholdxp?@\\000\\000\\000\\000\\000\\020w\\010\\000\\000\\000\\020\\000\\000\\000\\000x\\000'::bytea WHERE "sched_name" = 'quartzScheduler' AND "job_name" = '任务催办定时计划' AND "job_group" = '-1';

-- 2022-07-15 yijj 修改服务编排表创建时间和更新时间的类型
alter table portal_service_choreography alter column create_time_ type timestamp using create_time_::timestamp;
alter table portal_service_choreography alter column update_time_ type timestamp using update_time_::timestamp;

ALTER TABLE "portal_biz_system" ALTER COLUMN "update_by_" TYPE varchar(255) USING "update_by_"::varchar(255);
