Browse Source

优化项目计划

master
zhouhaibin 4 months ago
parent
commit
e1be972e9f
  1. 69
      easy-activiti/src/main/java/com/easy/admin/activiti/dao/mapping/ActivitiTaskMapper.xml
  2. 2
      easy-activiti/src/main/java/com/easy/admin/activiti/service/impl/ActivitiTaskServiceImpl.java

69
easy-activiti/src/main/java/com/easy/admin/activiti/dao/mapping/ActivitiTaskMapper.xml

@ -4,25 +4,62 @@
<select id="select" resultType="com.easy.admin.activiti.model.ActivitiTask"> <select id="select" resultType="com.easy.admin.activiti.model.ActivitiTask">
select distinct -- select distinct
art.id_, art.rev_, art.execution_id_, art.proc_inst_id_ as process_instance_id, art.proc_def_id_ as process_definition_id, art.name_, -- art.id_, art.rev_, art.execution_id_, art.proc_inst_id_ as process_instance_id, art.proc_def_id_ as process_definition_id, art.name_,
art.parent_task_id_, art.description_, art.task_def_key_ as task_definition_key, art.owner_, art.assignee_, art.delegation_, art.priority_, -- art.parent_task_id_, art.description_, art.task_def_key_ as task_definition_key, art.owner_, art.assignee_, art.delegation_, art.priority_,
art.create_time_, art.due_date_, art.category_, art.suspension_state_, art.tenant_id_, art.form_key_, -- art.create_time_, art.due_date_, art.category_, art.suspension_state_, art.tenant_id_, art.form_key_,
arp.name_ as processDefinitionName, arv_businessKey.text_ as businessKey, arp.version_, -- arp.name_ as processDefinitionName, arv_businessKey.text_ as businessKey, arp.version_,
arv_businessTitle.text_ as businessTitle, arv_businessDetailsPath.text_ as businessDetailsPath, -- arv_businessTitle.text_ as businessTitle, arv_businessDetailsPath.text_ as businessDetailsPath,
su.nickname as applyUser, arv_applyUserId.text_ as _applyUserId -- su.nickname as applyUser, arv_applyUserId.text_ as _applyUserId
from act_ru_task art -- from act_ru_task art
inner join act_ru_identitylink ari on ari.task_id_ = art.id_ -- inner join act_ru_identitylink ari on ari.task_id_ = art.id_
left join act_re_procdef arp on art.proc_def_id_ = arp.id_ -- left join act_re_procdef arp on art.proc_def_id_ = arp.id_
left join act_ru_variable arv_businessKey on arv_businessKey.execution_id_ = art.execution_id_ and arv_businessKey.name_ = 'businessKey' -- left join act_ru_variable arv_businessKey on arv_businessKey.execution_id_ = art.execution_id_ and arv_businessKey.name_ = 'businessKey'
left join act_ru_variable arv_businessTitle on arv_businessTitle.execution_id_ = art.execution_id_ and arv_businessTitle.name_ = 'businessTitle' -- left join act_ru_variable arv_businessTitle on arv_businessTitle.execution_id_ = art.execution_id_ and arv_businessTitle.name_ = 'businessTitle'
left join act_ru_variable arv_businessDetailsPath on arv_businessDetailsPath.execution_id_ = art.execution_id_ and arv_businessDetailsPath.name_ = 'businessDetailsPath' -- left join act_ru_variable arv_businessDetailsPath on arv_businessDetailsPath.execution_id_ = art.execution_id_ and arv_businessDetailsPath.name_ = 'businessDetailsPath'
left join act_ru_variable arv_applyUserId on arv_applyUserId.execution_id_ = art.execution_id_ and arv_applyUserId.name_ = 'applyUserId' -- left join act_ru_variable arv_applyUserId on arv_applyUserId.execution_id_ = art.execution_id_ and arv_applyUserId.name_ = 'applyUserId'
left join sys_user su on su.id = arv_applyUserId.text_ -- left join sys_user su on su.id = arv_applyUserId.text_
SELECT
MAX(art.id_) AS id_,
MAX(art.rev_) AS rev_,
MAX(art.execution_id_) AS execution_id_,
art.proc_inst_id_ AS process_instance_id,
MAX(art.proc_def_id_) AS process_definition_id,
art.name_,
MAX(art.parent_task_id_) AS parent_task_id_,
MAX(art.description_) AS description_,
MAX(art.task_def_key_) AS task_definition_key,
MAX(art.owner_) AS owner_,
MAX(art.assignee_) AS assignee_,
MAX(art.delegation_) AS delegation_,
MAX(art.priority_) AS priority_,
MAX(art.create_time_) AS create_time_,
MAX(art.due_date_) AS due_date_,
MAX(art.category_) AS category_,
MAX(art.suspension_state_) AS suspension_state_,
MAX(art.tenant_id_) AS tenant_id_,
MAX(art.form_key_) AS form_key_,
MAX(arp.name_) AS processDefinitionName,
MAX(arv_businessKey.text_) AS businessKey,
MAX(arp.version_) AS version_,
MAX(arv_businessTitle.text_) AS businessTitle,
MAX(arv_businessDetailsPath.text_) AS businessDetailsPath,
MAX(su.nickname) AS applyUser,
MAX(arv_applyUserId.text_) AS _applyUserId
FROM act_ru_task art
INNER JOIN act_ru_identitylink ari ON ari.task_id_ = art.id_
LEFT JOIN act_re_procdef arp ON art.proc_def_id_ = arp.id_
LEFT JOIN act_ru_variable arv_businessKey ON arv_businessKey.execution_id_ = art.execution_id_ AND arv_businessKey.name_ = 'businessKey'
LEFT JOIN act_ru_variable arv_businessTitle ON arv_businessTitle.execution_id_ = art.execution_id_ AND arv_businessTitle.name_ = 'businessTitle'
LEFT JOIN act_ru_variable arv_businessDetailsPath ON arv_businessDetailsPath.execution_id_ = art.execution_id_ AND arv_businessDetailsPath.name_ = 'businessDetailsPath'
LEFT JOIN act_ru_variable arv_applyUserId ON arv_applyUserId.execution_id_ = art.execution_id_ AND arv_applyUserId.name_ = 'applyUserId'
LEFT JOIN sys_user su ON su.id = arv_applyUserId.text_
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
GROUP BY art.proc_inst_id_, art.name_
ORDER BY MAX(art.create_time_) DESC
</select> </select>
<select id="selectProcessDefinitionId" resultType="com.easy.admin.activiti.model.ActivitiTask"> <select id="selectProcessDefinitionId" resultType="com.easy.admin.activiti.model.ActivitiTask">
select art.proc_def_id_ as process_definition_id, art.proc_inst_id_ as process_instance_id select art.proc_def_id_ as process_definition_id, art.proc_inst_id_ as process_instance_id

2
easy-activiti/src/main/java/com/easy/admin/activiti/service/impl/ActivitiTaskServiceImpl.java

@ -96,7 +96,7 @@ public class ActivitiTaskServiceImpl extends ServiceImpl<ActivitiTaskMapper, Act
} }
// 待签、待办中只查询激活流程实例数据,已挂起的不查询 // 待签、待办中只查询激活流程实例数据,已挂起的不查询
queryWrapper.eq("arp.suspension_state_", ActivitiSuspensionStatus.ACTIVATION.getCode()); queryWrapper.eq("arp.suspension_state_", ActivitiSuspensionStatus.ACTIVATION.getCode());
page.setDefaultDesc("art.id_"); // page.setDefaultDesc("art.id_");
page.setRecords(baseMapper.select(page, queryWrapper)); page.setRecords(baseMapper.select(page, queryWrapper));
return page; return page;
} }

Loading…
Cancel
Save