|
|
@ -27,6 +27,7 @@ package com.yxt.anrui.portal.biz.flow; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.yxt.anrui.flowable.api.processcomment.ProcessCommentFeign; |
|
|
|
import com.yxt.anrui.portal.api.flow.*; |
|
|
@ -34,8 +35,10 @@ import com.yxt.anrui.portal.api.flow.app.FlowTaskDoQuery; |
|
|
|
import com.yxt.anrui.portal.api.flow.app.FlowTaskDoVo; |
|
|
|
import com.yxt.anrui.portal.api.flow.app.FlowTaskFinishVo; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgVo; |
|
|
|
import com.yxt.anrui.portal.api.sysurlconfig.SysUrlConfig; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUser; |
|
|
|
import com.yxt.anrui.portal.biz.sysstafforg.SysStaffOrgService; |
|
|
|
import com.yxt.anrui.portal.biz.sysurlconfig.SysUrlConfigService; |
|
|
|
import com.yxt.anrui.portal.biz.sysuser.SysUserService; |
|
|
|
import com.yxt.anrui.terminal.api.app.flowable.ProcessCommentVo; |
|
|
|
import com.yxt.common.base.utils.StringUtils; |
|
|
@ -44,14 +47,12 @@ import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
/** |
|
|
|
* Project: anrui-parent <br/> |
|
|
@ -79,6 +80,10 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
private SysUserService sysUserService; |
|
|
|
@Autowired |
|
|
|
private ProcessCommentFeign processCommentFeign; |
|
|
|
@Autowired |
|
|
|
private SysUrlConfigService sysUrlConfigService; |
|
|
|
@Value("${config.url.prefix}") |
|
|
|
private String urlPrefix; |
|
|
|
/* |
|
|
|
|
|
|
|
@Override |
|
|
@ -271,7 +276,27 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
ResultBean<Page<com.yxt.anrui.flowable.api.flowtask.FlowTaskDto>> pageResultBean = flowableService.doneAllTaskList(userSid, pQuery); |
|
|
|
Page<FlowTaskDto> page = new Page<>(); |
|
|
|
BeanUtil.copyProperties(pageResultBean.getData(),page); |
|
|
|
ResultBean< Page<FlowTaskDto>> success = new ResultBean< Page<FlowTaskDto>>().success(); |
|
|
|
ResultBean<Page<FlowTaskDto>> success = new ResultBean<Page<FlowTaskDto>>().success(); |
|
|
|
List<FlowTaskDto> voList = JSON.parseArray(JSON.toJSONString(page.getRecords()),FlowTaskDto.class); |
|
|
|
voList.removeAll(Collections.singleton(null)); |
|
|
|
for (int i = 0; i < voList.size(); i++) { |
|
|
|
FlowTaskDto f = voList.get(i); |
|
|
|
//根据流程定义id查询是否有终止地址
|
|
|
|
String proDefId = f.getProcDefId(); |
|
|
|
List<String> proDefIdList = Arrays.asList(proDefId.split(":")); |
|
|
|
String proDefKey = proDefIdList.get(0); |
|
|
|
//根据流程定义key查询终止地址
|
|
|
|
SysUrlConfig sysUrlConifg = sysUrlConfigService.selectByKey(proDefKey); |
|
|
|
if(sysUrlConifg != null){ |
|
|
|
f.setStopUrl(urlPrefix+sysUrlConifg.getUrl()); |
|
|
|
}else{ |
|
|
|
sysUrlConifg = sysUrlConfigService.selectByKey("defaultKey"); |
|
|
|
if(sysUrlConifg!= null){ |
|
|
|
f.setStopUrl(urlPrefix+sysUrlConifg.getUrl()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
page.setRecords(voList); |
|
|
|
success.setData(page); |
|
|
|
return success; |
|
|
|
} |
|
|
|