|
|
@ -29,6 +29,8 @@ 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.flowtask.FlowTaskFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowableQuery; |
|
|
|
import com.yxt.anrui.flowable.api.processcomment.ProcessCommentFeign; |
|
|
|
import com.yxt.anrui.portal.api.flow.*; |
|
|
|
import com.yxt.anrui.portal.api.flow.app.FlowTaskDoQuery; |
|
|
@ -46,6 +48,7 @@ import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import org.apache.commons.collections4.comparators.NullComparator; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
@ -84,6 +87,10 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
private SysUrlConfigService sysUrlConfigService; |
|
|
|
@Value("${config.url.prefix}") |
|
|
|
private String urlPrefix; |
|
|
|
|
|
|
|
private static final NullComparator<Date> nullComparator = new NullComparator<>(); |
|
|
|
@Autowired |
|
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
|
/* |
|
|
|
|
|
|
|
@Override |
|
|
@ -159,7 +166,6 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
public ResultBean<List<PCHistTaskListAndCommentList>> flowRecordAndComment(String procInsId, String deployId) { |
|
|
|
ResultBean<com.yxt.anrui.flowable.api.flowtask.FlowRecordVo> flowRecordVoResultBean = flowableService.flowRecord(procInsId, deployId); |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowRecordVo flowRecordVo = flowRecordVoResultBean.getData(); |
|
|
|
// private List<com.yxt.anrui.flowable.api.flowtask.FlowTask> flowList = new ArrayList<>();
|
|
|
|
List<PCHistTaskListAndCommentList> flowList = new ArrayList<>(); |
|
|
|
//流转记录
|
|
|
|
List<com.yxt.anrui.flowable.api.flowtask.FlowTask> flowList1 = flowRecordVo.getFlowList(); |
|
|
@ -184,8 +190,34 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
a.setState(1+""); |
|
|
|
flowList.add(a); |
|
|
|
}); |
|
|
|
flowList.sort((t1, t2) -> t2.getTime().compareTo(t1.getTime())); |
|
|
|
//flowRecordVo.setFlowList(flowList);
|
|
|
|
if(flowList1.size()>0){ |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTask appFlowableRecordVo = flowList1.get(flowList1.size()-1); |
|
|
|
if(!"Event_end".equals(appFlowableRecordVo.getTaskDefKey())){ |
|
|
|
String proDefId = appFlowableRecordVo.getProcDefId(); |
|
|
|
Map<String,Object> map = (Map<String, Object>) appFlowableRecordVo.getProcVars(); |
|
|
|
FlowableQuery flowableQuery = new FlowableQuery(); |
|
|
|
flowableQuery.setModelId(proDefId); |
|
|
|
flowableQuery.setTaskDefKey(appFlowableRecordVo.getTaskDefKey()); |
|
|
|
flowableQuery.setMap(map); |
|
|
|
ResultBean<List<Map<String,Object>>> resultBean = flowTaskFeign.yuyanTest(flowableQuery); |
|
|
|
if(!resultBean.getData().isEmpty()){ |
|
|
|
List<Map<String,Object>> mapList = resultBean.getData(); |
|
|
|
mapList.forEach(f->{ |
|
|
|
PCHistTaskListAndCommentList a = new PCHistTaskListAndCommentList(); |
|
|
|
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(f); |
|
|
|
stringObjectMap.put("taskName",f.get("nodeName").toString()); |
|
|
|
stringObjectMap.put("finishTime",null); |
|
|
|
stringObjectMap.put("createTime",""); |
|
|
|
stringObjectMap.put("taskUserInfos",new ArrayList<>()); |
|
|
|
a.setFlowableRecordVo(stringObjectMap); |
|
|
|
a.setState(3 + ""); |
|
|
|
flowList.add(a); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
flowList.sort(Comparator.nullsLast(Comparator.comparing(PCHistTaskListAndCommentList::getTime,nullComparator))); |
|
|
|
// flowList.sort((t1, t2) -> t2.getTime().compareTo(t1.getTime()));
|
|
|
|
ResultBean<List<PCHistTaskListAndCommentList>> resultBean = new ResultBean<List<PCHistTaskListAndCommentList>>().success(); |
|
|
|
resultBean.setData(flowList); |
|
|
|
return resultBean; |
|
|
|