提交 e0d09d1e 编写于 作者: sq3536's avatar sq3536

wf统一待办

上级 af352406
...@@ -2,6 +2,8 @@ package cn.ibizlab.core.workflow.extensions.service; ...@@ -2,6 +2,8 @@ package cn.ibizlab.core.workflow.extensions.service;
import cn.ibizlab.core.workflow.extensions.domain.FlowUser; import cn.ibizlab.core.workflow.extensions.domain.FlowUser;
import cn.ibizlab.core.workflow.domain.*; import cn.ibizlab.core.workflow.domain.*;
import cn.ibizlab.core.workflow.filter.WFTaskSearchContext;
import cn.ibizlab.core.workflow.mapper.WFCoreMapper;
import cn.ibizlab.core.workflow.service.IWFGroupService; import cn.ibizlab.core.workflow.service.IWFGroupService;
import cn.ibizlab.core.workflow.service.IWFProcessDefinitionService; import cn.ibizlab.core.workflow.service.IWFProcessDefinitionService;
import cn.ibizlab.core.workflow.service.IWFUserService; import cn.ibizlab.core.workflow.service.IWFUserService;
...@@ -138,6 +140,9 @@ public class WFCoreService ...@@ -138,6 +140,9 @@ public class WFCoreService
return definitionKeys; return definitionKeys;
} }
@Autowired
private WFCoreMapper wfCoreMapper;
public List<WFProcessNode> getWFStep(String system,String appname, String entity) { public List<WFProcessNode> getWFStep(String system,String appname, String entity) {
List<WFProcessNode> rt=new ArrayList<>(); List<WFProcessNode> rt=new ArrayList<>();
for(WFProcessDefinition wfdef:wfModelService.getWorkflow(system,entity)) { for(WFProcessDefinition wfdef:wfModelService.getWorkflow(system,entity)) {
...@@ -154,6 +159,13 @@ public class WFCoreService ...@@ -154,6 +159,13 @@ public class WFCoreService
return rt; return rt;
} }
public List<WFProcessNode> getWFStep2(String system,String appname, String entity) {
WFTaskSearchContext context = new WFTaskSearchContext();
context.setSize(1000);
context.setN_definitionkey_leftlike(system+"-"+entity);
return wfCoreMapper.searchMyTaskCnt(context,context.getSearchCond());
}
public Map<String,Long> getWFStepCnt(String system,String appname, String entity,String processDefinitionKey,String wfstepcode) public Map<String,Long> getWFStepCnt(String system,String appname, String entity,String processDefinitionKey,String wfstepcode)
{ {
...@@ -274,7 +286,7 @@ public class WFCoreService ...@@ -274,7 +286,7 @@ public class WFCoreService
way.setProcessdefinitionkey(task.getProcessDefinitionId().split(":")[0]); way.setProcessdefinitionkey(task.getProcessDefinitionId().split(":")[0]);
way.setTaskid(task.getId()); way.setTaskid(task.getId());
way.setProcessinstanceid(task.getProcessInstanceId()); way.setProcessinstanceid(task.getProcessInstanceId());
way.setTaskprocessdefinitionkey(task.getTaskDefinitionKey()); way.setTaskdefinitionkey(task.getTaskDefinitionKey());
way.setProcessinstancebusinesskey(processInstanceBusinessKey); way.setProcessinstancebusinesskey(processInstanceBusinessKey);
taskWays.add(way); taskWays.add(way);
} }
...@@ -305,7 +317,7 @@ public class WFCoreService ...@@ -305,7 +317,7 @@ public class WFCoreService
way.setProcessdefinitionkey(task.getProcessDefinitionId().split(":")[0]); way.setProcessdefinitionkey(task.getProcessDefinitionId().split(":")[0]);
way.setTaskid(task.getId()); way.setTaskid(task.getId());
way.setProcessinstanceid(task.getProcessInstanceId()); way.setProcessinstanceid(task.getProcessInstanceId());
way.setTaskprocessdefinitionkey(task.getTaskDefinitionKey()); way.setTaskdefinitionkey(task.getTaskDefinitionKey());
way.setProcessinstancebusinesskey(processInstanceBusinessKey); way.setProcessinstancebusinesskey(processInstanceBusinessKey);
taskWays.add(way); taskWays.add(way);
} }
......
package cn.ibizlab.core.workflow.filter; package cn.ibizlab.core.workflow.filter;
import java.math.BigDecimal; import cn.ibizlab.core.workflow.domain.WFTask;
import java.math.BigInteger; import cn.ibizlab.util.filter.QueryWrapperContext;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.sql.Timestamp;
import cn.ibizlab.util.filter.SearchContextBase;
/** /**
* ServiceApi数据实体[WFTask] 查询条件对象 * 关系型数据实体[WFTask] 查询条件对象
*/ */
@Slf4j @Slf4j
@Data @Data
public class WFTaskSearchContext extends SearchContextBase { public class WFTaskSearchContext extends QueryWrapperContext<WFTask> {
private String n_taskname_like;//[状态]
private String n_taskname_like;//[状态]
private String n_definitionid_eq;//[DefinitionId] public void setN_taskname_like(String n_taskname_like) {
this.n_taskname_like = n_taskname_like;
private String n_definitionkey_eq;//[DefinitionKey] if(!ObjectUtils.isEmpty(this.n_taskname_like)){
this.getSearchCond().like("taskname", n_taskname_like);
private String n_definitionkey_leftlike;//[DefinitionKey] }
}
private String n_definitionkey_like;//[DefinitionKey] private String n_definitionid_eq;//[DefinitionId]
public void setN_definitionid_eq(String n_definitionid_eq) {
private String n_definitionname_like;//[流程] this.n_definitionid_eq = n_definitionid_eq;
if(!ObjectUtils.isEmpty(this.n_definitionid_eq)){
private String n_taskdefinitionkey_eq;//[TaskDefinitionKey] this.getSearchCond().eq("definitionid", n_definitionid_eq);
}
private String n_taskdefinitionkey_like;//[TaskDefinitionKey] }
private String n_definitionkey_eq;//[DefinitionKey]
private String n_description_like;//[待办事项] public void setN_definitionkey_eq(String n_definitionkey_eq) {
this.n_definitionkey_eq = n_definitionkey_eq;
if(!ObjectUtils.isEmpty(this.n_definitionkey_eq)){
this.getSearchCond().eq("definitionkey", n_definitionkey_eq);
}
}
private String n_definitionkey_leftlike;//[DefinitionKey]
public void setN_definitionkey_leftlike(String n_definitionkey_leftlike) {
this.n_definitionkey_leftlike = n_definitionkey_leftlike;
if(!ObjectUtils.isEmpty(this.n_definitionkey_leftlike)){
this.getSearchCond().likeRight("definitionkey", n_definitionkey_leftlike);
}
}
private String n_definitionkey_like;//[DefinitionKey]
public void setN_definitionkey_like(String n_definitionkey_like) {
this.n_definitionkey_like = n_definitionkey_like;
if(!ObjectUtils.isEmpty(this.n_definitionkey_like)){
this.getSearchCond().like("definitionkey", n_definitionkey_like);
}
}
private String n_definitionname_like;//[流程]
public void setN_definitionname_like(String n_definitionname_like) {
this.n_definitionname_like = n_definitionname_like;
if(!ObjectUtils.isEmpty(this.n_definitionname_like)){
this.getSearchCond().like("definitionname", n_definitionname_like);
}
}
private String n_taskdefinitionkey_eq;//[TaskDefinitionKey]
public void setN_taskdefinitionkey_eq(String n_taskdefinitionkey_eq) {
this.n_taskdefinitionkey_eq = n_taskdefinitionkey_eq;
if(!ObjectUtils.isEmpty(this.n_taskdefinitionkey_eq)){
this.getSearchCond().eq("taskdefinitionkey", n_taskdefinitionkey_eq);
}
}
private String n_taskdefinitionkey_like;//[TaskDefinitionKey]
public void setN_taskdefinitionkey_like(String n_taskdefinitionkey_like) {
this.n_taskdefinitionkey_like = n_taskdefinitionkey_like;
if(!ObjectUtils.isEmpty(this.n_taskdefinitionkey_like)){
this.getSearchCond().like("taskdefinitionkey", n_taskdefinitionkey_like);
}
}
private String n_description_like;//[待办事项]
public void setN_description_like(String n_description_like) {
this.n_description_like = n_description_like;
if(!ObjectUtils.isEmpty(this.n_description_like)){
this.getSearchCond().like("description", n_description_like);
}
}
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
@JSONField(format="yyyy-MM-dd HH:mm:ss") @JSONField(format="yyyy-MM-dd HH:mm:ss")
private Timestamp n_createtime_gtandeq;//[发起时间] private Timestamp n_createtime_gtandeq;//[发起时间]
public void setN_createtime_gtandeq(Timestamp n_createtime_gtandeq) {
this.n_createtime_gtandeq = n_createtime_gtandeq;
if(!ObjectUtils.isEmpty(this.n_createtime_gtandeq)){
this.getSearchCond().ge("createtime", n_createtime_gtandeq);
}
}
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
@JSONField(format="yyyy-MM-dd HH:mm:ss") @JSONField(format="yyyy-MM-dd HH:mm:ss")
private Timestamp n_createtime_ltandeq;//[发起时间] private Timestamp n_createtime_ltandeq;//[发起时间]
public void setN_createtime_ltandeq(Timestamp n_createtime_ltandeq) {
private String n_businesskey_eq;//[业务键值] this.n_createtime_ltandeq = n_createtime_ltandeq;
if(!ObjectUtils.isEmpty(this.n_createtime_ltandeq)){
this.getSearchCond().le("createtime", n_createtime_ltandeq);
}
}
private String n_businesskey_eq;//[业务键值]
public void setN_businesskey_eq(String n_businesskey_eq) {
this.n_businesskey_eq = n_businesskey_eq;
if(!ObjectUtils.isEmpty(this.n_businesskey_eq)){
this.getSearchCond().eq("businesskey", n_businesskey_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("taskname", query)
);
}
}
} }
package cn.ibizlab.core.workflow.mapper;
import cn.ibizlab.core.workflow.domain.WFGroup;
import cn.ibizlab.core.workflow.domain.WFProcessNode;
import cn.ibizlab.core.workflow.domain.WFTask;
import cn.ibizlab.core.workflow.filter.WFTaskSearchContext;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.*;
import java.util.List;
public interface WFCoreMapper extends BaseMapper<WFGroup>{
Page<WFTask> searchMyTask(IPage page, @Param("srf") WFTaskSearchContext context, @Param("ew") Wrapper<WFTask> wrapper) ;
List<WFProcessNode> searchMyTaskCnt(@Param("srf") WFTaskSearchContext context, @Param("ew") Wrapper<WFTask> wrapper) ;
}
package cn.ibizlab.core.workflow.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.core.workflow.domain.WFTask;
import cn.ibizlab.core.workflow.filter.WFTaskSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface WFTaskMapper extends BaseMapper<WFTask>{
Page<WFTask> searchDefault(IPage page, @Param("srf") WFTaskSearchContext context, @Param("ew") Wrapper<WFTask> wrapper) ;
@Override
WFTask selectById(Serializable id);
@Override
int insert(WFTask entity);
@Override
int updateById(@Param(Constants.ENTITY) WFTask entity);
@Override
int update(@Param(Constants.ENTITY) WFTask entity, @Param("ew") Wrapper<WFTask> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
...@@ -12,6 +12,8 @@ import java.util.Objects; ...@@ -12,6 +12,8 @@ import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import java.math.BigInteger; import java.math.BigInteger;
import cn.ibizlab.core.workflow.domain.WFSystem;
import cn.ibizlab.core.workflow.mapper.WFCoreMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -95,13 +97,16 @@ public class WFTaskServiceImpl implements IWFTaskService { ...@@ -95,13 +97,16 @@ public class WFTaskServiceImpl implements IWFTaskService {
@Autowired
private WFCoreMapper wfCoreMapper;
/** /**
* 查询集合 DEFAULT * 查询集合 DEFAULT
*/ */
@Override @Override
public Page<WFTask> searchDefault(WFTaskSearchContext context) { public Page<WFTask> searchDefault(WFTaskSearchContext context) {
return new PageImpl<WFTask>(new ArrayList(),context.getPageable(),0); 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());
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.workflow.mapper.WFCoreMapper">
<select id="searchMyTask" parameterType="cn.ibizlab.core.workflow.filter.WFTaskSearchContext" resultType="cn.ibizlab.core.workflow.domain.WFTask">
select t1.* from (
select res.ID_ as Id,res.PROC_DEF_ID_ as ProcessDefinitionId,arp.NAME_ as ProcessDefinitionKey,arp.KEY_ as ProcessDefinitionName,
res.PROC_INST_ID_ as ProcessInstanceId,res.NAME_ as Name,res.TASK_DEF_KEY_ as TaskDefinitionKey,res.CATEGORY_ as ProcessInstanceBusinessKey,
res.DESCRIPTION_ as Description,res.CREATE_TIME_ as CreateTime from ACT_RU_TASK RES inner join act_re_procdef arp on RES.PROC_DEF_ID_ = arp.ID_
where
exists (select LINK.ID_ from ACT_RU_IDENTITYLINK LINK where LINK.TASK_ID_ = RES.ID_ and LINK.USER_ID_ = #{context.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="searchMyTaskCnt" parameterType="cn.ibizlab.core.workflow.filter.WFTaskSearchContext" resultType="cn.ibizlab.core.workflow.domain.WFProcessNode">
select t.ProcessDefinitionId,t.ProcessDefinitionKey,t.ProcessDefinitionName,t.TaskDefinitionKey as UserTaskId,concat(concat(t.Name,' v'),t.version) as UserTaskName,count(1) as cnt from
(select * from
(
select res.ID_ as Id,
res.PROC_DEF_ID_ as ProcessDefinitionId,
arp.NAME_ as ProcessDefinitionKey,
arp.KEY_ as ProcessDefinitionName,
arp.VERSION_ as version,
res.NAME_ as Name,
res.TASK_DEF_KEY_ as TaskDefinitionKey
from ACT_RU_TASK RES
inner join act_re_procdef arp on RES.PROC_DEF_ID_ = arp.ID_
where exists (select LINK.ID_
from ACT_RU_IDENTITYLINK LINK
where LINK.TASK_ID_ = RES.ID_ and LINK.USER_ID_ = #{context.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>
) t
group by t.ProcessDefinitionId,t.ProcessDefinitionKey,t.ProcessDefinitionName,t.TaskDefinitionKey,t.Name ,t.version order by t.ProcessDefinitionKey, t.version desc, t.TaskDefinitionKey
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.workflow.mapper.WFTaskMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="WFTaskResultMap" type="cn.ibizlab.core.workflow.domain.WFTask" autoMapping="true">
<id property="id" column="taskid" /><!--主键字段映射-->
<result property="name" column="taskname" />
<result property="processdefinitionid" column="definitionid" />
<result property="processdefinitionkey" column="definitionkey" />
<result property="processdefinitionname" column="definitionname" />
<result property="processinstanceid" column="instanceid" />
<result property="processinstancebusinesskey" column="businesskey" />
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.workflow.filter.WFTaskSearchContext" resultMap="WFTaskResultMap">
select t1.* from (
<include refid="Default" />
)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>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`BUSINESSKEY`, t1.`CREATETIME`, t1.`DEFINITIONID`, t1.`DEFINITIONKEY`, t1.`DEFINITIONNAME`, t1.`DESCRIPTION`, t1.`INSTANCEID`, t1.`TASKDEFINITIONKEY`, t1.`TASKID`, t1.`TASKNAME` FROM `IBZTASK` t1
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="oracle">
<![CDATA[ SELECT t1.BUSINESSKEY, t1.CREATETIME, t1.DEFINITIONID, t1.DEFINITIONKEY, t1.DEFINITIONNAME, t1.DESCRIPTION, t1.INSTANCEID, t1.TASKDEFINITIONKEY, t1.TASKID, t1.TASKNAME FROM IBZTASK t1
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="postgresql">
<![CDATA[ SELECT t1.BUSINESSKEY, t1.DEFINITIONKEY, t1.INSTANCEID, t1.TASKDEFINITIONKEY, t1.TASKID, t1.TASKNAME FROM IBZTASK t1
]]>
</sql>
</mapper>
package cn.ibizlab.api.rest.extensions; package cn.ibizlab.api.rest.extensions;
import cn.ibizlab.api.dto.WFTaskDTO;
import cn.ibizlab.core.workflow.domain.*; import cn.ibizlab.core.workflow.domain.*;
import cn.ibizlab.core.workflow.extensions.service.WFCoreService; import cn.ibizlab.core.workflow.extensions.service.WFCoreService;
import cn.ibizlab.core.workflow.filter.WFTaskSearchContext;
import cn.ibizlab.core.workflow.service.IWFTaskService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -24,6 +28,9 @@ public class WFCoreResource ...@@ -24,6 +28,9 @@ public class WFCoreResource
@Autowired @Autowired
private WFCoreService wfCoreService; private WFCoreService wfCoreService;
@Autowired
private IWFTaskService taskService;
@ApiOperation(value = "getWFProcessDefinition", tags = {"WFProcessDefinition" }, notes = "根据系统实体查找当前适配的工作流模型") @ApiOperation(value = "getWFProcessDefinition", tags = {"WFProcessDefinition" }, notes = "根据系统实体查找当前适配的工作流模型")
@RequestMapping(method = RequestMethod.GET, value = "/{system}-app-{appname}/{entity}/process-definitions") @RequestMapping(method = RequestMethod.GET, value = "/{system}-app-{appname}/{entity}/process-definitions")
...@@ -36,7 +43,7 @@ public class WFCoreResource ...@@ -36,7 +43,7 @@ public class WFCoreResource
@RequestMapping(method = RequestMethod.GET, value = "/{system}-app-{appname}/{entity}/process-definitions-nodes") @RequestMapping(method = RequestMethod.GET, value = "/{system}-app-{appname}/{entity}/process-definitions-nodes")
public ResponseEntity<List<WFProcessNode>> getwfstep(@PathVariable("system") String system,@PathVariable("appname") String appname, public ResponseEntity<List<WFProcessNode>> getwfstep(@PathVariable("system") String system,@PathVariable("appname") String appname,
@PathVariable("entity") String entity) { @PathVariable("entity") String entity) {
return ResponseEntity.status(HttpStatus.OK).body(wfCoreService.getWFStep(system,appname,entity)); return ResponseEntity.status(HttpStatus.OK).body(wfCoreService.getWFStep2(system,appname,entity));
} }
//@PreAuthorize("hasPermission(#entity,'WFSTART',this.getEntity())") //@PreAuthorize("hasPermission(#entity,'WFSTART',this.getEntity())")
...@@ -112,9 +119,35 @@ public class WFCoreResource ...@@ -112,9 +119,35 @@ public class WFCoreResource
return ResponseEntity.status(HttpStatus.OK).body(wfCoreService.getBusinessKeys(system,"",entity,processDefinitionKey,taskDefinitionKey,userId)); return ResponseEntity.status(HttpStatus.OK).body(wfCoreService.getBusinessKeys(system,"",entity,processDefinitionKey,taskDefinitionKey,userId));
} }
@ApiOperation(value = "获取我的系统待办", tags = {"工作流任务" } ,notes = "获取我的系统待办")
@RequestMapping(method= RequestMethod.GET , value="/{system}-app-{appname}/mytasks")
public ResponseEntity<List<WFTask>> fetchDefault(@PathVariable("system") String system,WFTaskSearchContext context) {
context.setN_definitionkey_leftlike(system);
context.setSort("createtime,desc");
Page<WFTask> domains = taskService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(domains.getContent());
}
@RequestMapping(method = RequestMethod.POST, value = "/deploybpmn") @RequestMapping(method = RequestMethod.POST, value = "/deploybpmn")
public ResponseEntity<Boolean> deployBpmnFile(@RequestBody List<Map<String,Object>> bpmnfiles){ public ResponseEntity<Boolean> deployBpmnFile(@RequestBody List<Map<String,Object>> bpmnfiles){
return ResponseEntity.status(HttpStatus.OK).body(wfCoreService.wfdeploybpmns(bpmnfiles)); return ResponseEntity.status(HttpStatus.OK).body(wfCoreService.wfdeploybpmns(bpmnfiles));
} }
@ApiOperation(value = "获取我的全部待办", tags = {"工作流任务" } ,notes = "获取我的全部待办")
@RequestMapping(method= RequestMethod.GET , value="/mytasks")
public ResponseEntity<List<WFTask>> fetchMyTasks(WFTaskSearchContext context) {
context.setSort("createtime,desc");
Page<WFTask> domains = taskService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(domains.getContent());
}
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册