提交 14ca1ef8 编写于 作者: test_0805_001's avatar test_0805_001

统一代办

上级 470fa947
package cn.ibizlab.core.workflow.extensions.service;
import cn.ibizlab.core.workflow.domain.WFTask;
import cn.ibizlab.core.workflow.filter.WFTaskSearchContext;
import cn.ibizlab.core.workflow.mapper.WFCoreMapper;
import cn.ibizlab.core.workflow.service.impl.WFTaskServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
/**
* 实体[工作流任务] 无存储服务对象接口实现 自定义
*/
@Slf4j
@Primary
@Service
public class WFTaskExService extends WFTaskServiceImpl {
@Autowired
private WFCoreMapper wfCoreMapper;
/**
* 查询集合 DEFAULT
*/
@Override
public Page<WFTask> searchDefault(WFTaskSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WFTask> pages
= wfCoreMapper.searchMyTask(context.getPages(),context,context.getSelectCond());
return new PageImpl<WFTask>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 已办任务
*/
@Override
public Page<WFTask> searchDoneTask(WFTaskSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WFTask> pages
= wfCoreMapper.searchDoneTask(context.getPages(),context,context.getSelectCond());
return new PageImpl<WFTask>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 办结任务
*/
@Override
public Page<WFTask> searchFinishTask(WFTaskSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WFTask> pages
= wfCoreMapper.searchFinishTask(context.getPages(),context,context.getSelectCond());
return new PageImpl<WFTask>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 待办任务
*/
@Override
public Page<WFTask> searchTodoTask(WFTaskSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WFTask> pages
= wfCoreMapper.searchMyTask(context.getPages(),context,context.getSelectCond());
return new PageImpl<WFTask>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 待阅任务
*/
@Override
public Page<WFTask> searchToreadTask(WFTaskSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WFTask> pages
= wfCoreMapper.searchUnReadTask(context.getPages(),context,context.getSelectCond());
return new PageImpl<WFTask>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
}
......@@ -32,4 +32,7 @@ public interface WFCoreMapper {
Page<WFTask> searchMyAllTask(IPage page, @Param("srf") WFTaskSearchContext context, @Param("ew") Wrapper<WFTask> wrapper) ;
Page<WFTask> searchDoneTask(IPage page, @Param("srf") WFTaskSearchContext context, @Param("ew") Wrapper<WFTask> wrapper) ;
Page<WFTask> searchFinishTask(IPage page, @Param("srf") WFTaskSearchContext context, @Param("ew") Wrapper<WFTask> wrapper) ;
}
......@@ -232,4 +232,95 @@
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<select id="searchDoneTask" parameterType="cn.ibizlab.core.workflow.filter.WFTaskSearchContext" resultType="cn.ibizlab.core.workflow.domain.WFTask">
<![CDATA[
SELECT
T1.TaskId AS Id,
T1.DefinitionId AS ProcessDefinitionId,
T1.DefinitionName AS ProcessDefinitionName,
T1.DefinitionKey AS ProcessDefinitionKey,
T1.InstanceId AS ProcessInstanceId,
T1.TaskName AS NAME,
T1.TaskDefinitionKey,
T1.BusinessKey AS ProcessInstanceBusinessKey,
T1.Description,
T1.CreateTime,
T1.BusinessKey2 AS ProcessInstanceBusinessKey2
FROM
(
SELECT DISTINCT
RES.ID_ AS TaskId,
RES.PROC_DEF_ID_ AS DefinitionId,
ARP.NAME_ AS DefinitionName,
ARP.KEY_ AS DefinitionKey,
RES.PROC_INST_ID_ AS InstanceId,
RES.NAME_ AS TaskName,
RES.TASK_DEF_KEY_ AS TaskDefinitionKey,
RES.CATEGORY_ AS BusinessKey,
RES.DESCRIPTION_ AS Description,
RES.START_TIME_ AS CreateTime ,
HPI.BUSINESS_KEY_ AS BusinessKey2
FROM
ACT_HI_TASKINST RES
INNER JOIN ACT_HI_PROCINST HPI ON RES.PROC_INST_ID_ = HPI.ID_
INNER JOIN ACT_RE_PROCDEF ARP ON RES.PROC_DEF_ID_ = arp.ID_
WHERE
(RES.END_TIME_ IS NOT NULL
AND HPI.END_TIME_ IS NULL
AND RES.ASSIGNEE_ IS NULL
AND EXISTS ( SELECT LINK.ID_ FROM ACT_HI_IDENTITYLINK LINK WHERE LINK.TASK_ID_ = RES.ID_ AND ( LINK.USER_ID_ = #{srf.sessioncontext.srfpersonid} ) )
) OR HPI.START_USER_ID_ = #{srf.sessioncontext.srfuserid} ) t1
]]>
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<select id="searchFinishTask" parameterType="cn.ibizlab.core.workflow.filter.WFTaskSearchContext" resultType="cn.ibizlab.core.workflow.domain.WFTask">
<![CDATA[
SELECT
T1.TaskId AS Id,
T1.DefinitionId AS ProcessDefinitionId,
T1.DefinitionName AS ProcessDefinitionName,
T1.DefinitionKey AS ProcessDefinitionKey,
T1.InstanceId AS ProcessInstanceId,
T1.TaskName AS NAME,
T1.TaskDefinitionKey,
T1.BusinessKey AS ProcessInstanceBusinessKey,
T1.Description,
T1.CreateTime,
T1.BusinessKey2 AS ProcessInstanceBusinessKey2
FROM
(
SELECT DISTINCT
RES.ID_ AS TaskId,
RES.PROC_DEF_ID_ AS DefinitionId,
ARP.NAME_ AS DefinitionName,
ARP.KEY_ AS DefinitionKey,
RES.PROC_INST_ID_ AS InstanceId,
RES.NAME_ AS TaskName,
RES.TASK_DEF_KEY_ AS TaskDefinitionKey,
RES.CATEGORY_ AS BusinessKey,
RES.DESCRIPTION_ AS Description,
RES.START_TIME_ AS CreateTime,
HPI.BUSINESS_KEY_ AS BusinessKey2
FROM
ACT_HI_TASKINST RES
INNER JOIN ACT_HI_PROCINST HPI ON RES.PROC_INST_ID_ = HPI.ID_
INNER JOIN ACT_RE_PROCDEF ARP ON RES.PROC_DEF_ID_ = ARP.ID_
WHERE
(RES.END_TIME_ IS NOT NULL
AND HPI.END_TIME_ IS NOT NULL
AND RES.ASSIGNEE_ IS NULL
AND EXISTS ( SELECT LINK.ID_ FROM ACT_HI_IDENTITYLINK LINK WHERE LINK.TASK_ID_ = RES.ID_ AND ( LINK.USER_ID_ = #{srf.sessioncontext.srfpersonid} ) )
) OR (HPI.START_USER_ID_ = #{srf.sessioncontext.srfuserid} )
AND RES.END_TIME_ IS NOT NULL
AND HPI.END_TIME_ IS NOT NULL
AND RES.ASSIGNEE_ IS NULL) T1
]]>
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册