|
|
@ -996,6 +996,129 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask |
|
|
|
return rb.success().setData(page); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<Page<FlowTaskDto>> businessFinishedListForOAApp(String userSid, List<BusinessTaskParam> params, Integer pageNum, Integer pageSize) { |
|
|
|
Page<FlowTaskDto> page = new Page<>(); |
|
|
|
Map<String, Object> paraMap = new HashMap<>(); |
|
|
|
String names = ""; |
|
|
|
List<Map<String, Object>> ll = new ArrayList<>(); |
|
|
|
for (BusinessTaskParam btq : params) { |
|
|
|
paraMap.put(btq.getField(), btq.getValue()); |
|
|
|
Map<String, Object> mapss = new HashMap<>(); |
|
|
|
if (btq.getSqlOperationSymbol().equals(SQLOperationSymbol.EQUAL)) { |
|
|
|
mapss.put("symbol", "="); |
|
|
|
mapss.put("value", btq.getValue()); |
|
|
|
mapss.put("filed", btq.getField()); |
|
|
|
} |
|
|
|
ll.add(mapss); |
|
|
|
} |
|
|
|
paraMap.put("category","OA"); |
|
|
|
paraMap.put("userSid", userSid); |
|
|
|
paraMap.put("list", ll); |
|
|
|
paraMap.put("page", (pageNum - 1) * pageSize); |
|
|
|
paraMap.put("size", pageSize); |
|
|
|
List<Map<String, Object>> maps = baseMapper.finishedList1(paraMap); |
|
|
|
int count = baseMapper.finishedListCount(paraMap); |
|
|
|
List<FlowTaskDto> hisTaskList = new ArrayList(); |
|
|
|
for (Map<String, Object> histTask : maps) { |
|
|
|
FlowTaskDto flowTask = new FlowTaskDto(); |
|
|
|
// 当前流程信息
|
|
|
|
flowTask.setTaskId(histTask.get("ID_").toString()); |
|
|
|
// 审批人员信息
|
|
|
|
Timestamp start_time_ = (Timestamp) histTask.get("START_TIME_"); |
|
|
|
Timestamp processCreateTime = (Timestamp) histTask.get("processCreateTime"); |
|
|
|
long time = start_time_.getTime(); |
|
|
|
long processCreateTime1 = processCreateTime.getTime(); |
|
|
|
Date date = new Date(time); |
|
|
|
flowTask.setCreateTime(date); |
|
|
|
flowTask.setProcessCreateTime(new Date(processCreateTime1)); |
|
|
|
flowTask.setAssigneeSid(histTask.get("ASSIGNEE_") == null ? "" : histTask.get("ASSIGNEE_").toString()); |
|
|
|
if (histTask.get("ASSIGNEE_") != null && StringUtils.isNotBlank(histTask.get("ASSIGNEE_").toString())) { |
|
|
|
ResultBean<List<SysUserVo>> assignee_ = sysUserFeign.fetchBySids(histTask.get("ASSIGNEE_").toString()); |
|
|
|
StringBuilder userName = new StringBuilder(); |
|
|
|
List<SysUserVo> data1 = assignee_.getData(); |
|
|
|
for (SysUserVo data : data1) { |
|
|
|
userName.append(data.getName()).append(","); |
|
|
|
} |
|
|
|
String userName_str = ""; |
|
|
|
userName_str = userName.substring(0, userName.length() - 1); |
|
|
|
flowTask.setAssigneeName(userName_str); |
|
|
|
} |
|
|
|
|
|
|
|
flowTask.setHasRevokeButton(userSid.equals(flowTask.getAssigneeSid()) ? true : false); |
|
|
|
flowTask.setProcDefId(histTask.get("PROC_DEF_ID_") == null ? "" : histTask.get("PROC_DEF_ID_").toString()); |
|
|
|
flowTask.setTaskDefKey(histTask.get("taskDefKey") == null ? "" : histTask.get("taskDefKey").toString()); |
|
|
|
flowTask.setTaskName(histTask.get("NAME_") == null ? "" : histTask.get("NAME_").toString()); |
|
|
|
flowTask.setDeployId(histTask.get("DEPLOYMENT_ID_") == null ? "" : histTask.get("DEPLOYMENT_ID_").toString()); |
|
|
|
flowTask.setProcDefName(histTask.get("PROC_DEF_NAME_") == null ? "" : histTask.get("PROC_DEF_NAME_").toString()); |
|
|
|
flowTask.setFlowableName(histTask.get("PROC_DEF_NAME_") == null ? "" : histTask.get("PROC_DEF_NAME_").toString()); |
|
|
|
flowTask.setProcDefVersion(histTask.get("PROC_DEF_VERSION_") == null ? 0 : Integer.parseInt(histTask.get("PROC_DEF_VERSION_").toString())); |
|
|
|
flowTask.setProcInsId(histTask.get("PROC_INST_ID_").toString()); |
|
|
|
flowTask.setHisProcInsId(histTask.get("PROC_INST_ID_").toString()); |
|
|
|
ResultBean<SysUserVo> sysUserVoResultBean = sysUserFeign.fetchBySid(histTask.get("START_USER_ID_").toString()); |
|
|
|
flowTask.setStartUserSid(sysUserVoResultBean.getData().getSid()); |
|
|
|
flowTask.setStartUserName(sysUserVoResultBean.getData().getName()); |
|
|
|
HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().includeProcessVariables().taskId(flowTask.getTaskId()).singleResult(); |
|
|
|
flowTask.setProcessVariables(historicTaskInstance.getProcessVariables()); |
|
|
|
Object end_act_id = histTask.get("end_act_id_"); |
|
|
|
if (end_act_id != null) { |
|
|
|
flowTask.setEndActId((String) end_act_id); |
|
|
|
} |
|
|
|
Object end_time = histTask.get("END_TIME_"); |
|
|
|
if (end_time != null) { |
|
|
|
Timestamp end_time_t = (Timestamp) end_time; |
|
|
|
long end_time_t_l = end_time_t.getTime(); |
|
|
|
flowTask.setEndTime(new Date(end_time_t_l)); |
|
|
|
} |
|
|
|
flowTask.setProcessVariables(historicTaskInstance.getProcessVariables()); |
|
|
|
|
|
|
|
ResultBean<List<SysProUrlVo>> listResultBean = sysProUrlService.selectUrlByKey(flowTask.getProcDefId(), flowTask.getTaskDefKey(), "2", "2"); |
|
|
|
if (listResultBean.getData() != null && listResultBean.getData().size() > 0) { |
|
|
|
flowTask.setSysProUrlVo(listResultBean.getData().get(0)); |
|
|
|
} |
|
|
|
//发起人部门
|
|
|
|
String createOrgPath = ConstantUtils.getString(flowTask.getProcessVariables(), "createOrgPath", ""); |
|
|
|
String ogrName = ""; |
|
|
|
if (StringUtils.isNotBlank(createOrgPath)) { |
|
|
|
List<String> stringList = Arrays.asList(createOrgPath.split("/")); |
|
|
|
ResultBean<SysOrganizationVo> sysOrganizationVoResultBean = sysOrganizationFeign.fetchBySid(stringList.get(stringList.size() - 1)); |
|
|
|
if (sysOrganizationVoResultBean.getData() != null) { |
|
|
|
if (StringUtils.isNotBlank(sysOrganizationVoResultBean.getData().getPsid())) { |
|
|
|
ResultBean<SysOrganizationVo> sysOrganizationVoResultBeanP = sysOrganizationFeign.fetchBySid(sysOrganizationVoResultBean.getData().getPsid()); |
|
|
|
if (sysOrganizationVoResultBeanP.getData() != null) { |
|
|
|
ogrName = sysOrganizationVoResultBeanP.getData().getName(); |
|
|
|
flowTask.setStartDeptName(ogrName + "-" + sysOrganizationVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
flowTask.setStartDeptName(sysOrganizationVoResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
ResultBean<String> pathSidByUserSid = sysStaffOrgFeign.getPathSidByUserSid(sysUserVoResultBean.getData().getSid()); |
|
|
|
if (pathSidByUserSid.getData() != null) { |
|
|
|
ResultBean<SysOrganizationVo> sysOrganizationVoResultBean = sysOrganizationFeign.fetchBySid(pathSidByUserSid.getData()); |
|
|
|
if (sysOrganizationVoResultBean.getData() != null) { |
|
|
|
ogrName = sysOrganizationVoResultBean.getData().getName(); |
|
|
|
flowTask.setStartDeptName(ogrName + "-" + sysUserVoResultBean.getData().getOrganizationName()); |
|
|
|
} else { |
|
|
|
flowTask.setStartDeptName(sysUserVoResultBean.getData().getOrganizationName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (flowTask.getProcessVariables().containsKey("orderNames")) { |
|
|
|
flowTask.setProcDefName(flowTask.getProcessVariables().get("orderNames").toString()); |
|
|
|
} |
|
|
|
hisTaskList.add(flowTask); |
|
|
|
} |
|
|
|
List<FlowTaskDto> userHisTaskList = Optional.ofNullable(hisTaskList).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FlowTaskDto.class)).collect(Collectors.toList()); |
|
|
|
List<FlowTaskDto> namesHisTaskList = Optional.ofNullable(hisTaskList).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FlowTaskDto.class)).collect(Collectors.toList()); |
|
|
|
page.setTotal(count); |
|
|
|
page.setRecords(hisTaskList); |
|
|
|
|
|
|
|
ResultBean<Page<FlowTaskDto>> rb = new ResultBean<Page<FlowTaskDto>>(); |
|
|
|
return rb.success().setData(page); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 完成任务 |
|
|
|
* |
|
|
@ -1913,6 +2036,13 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask |
|
|
|
return businessFinishedListForApp(userSid, fields, current, size); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<Page<FlowTaskDto>> businessDoneListNewForOAApp(String userSid, PagerQuery<BusinessTaskQuery> taskQueryPagerQuery) { |
|
|
|
int size = Integer.valueOf(taskQueryPagerQuery.getSize() + ""); |
|
|
|
int current = Integer.valueOf(taskQueryPagerQuery.getCurrent() + ""); |
|
|
|
List<BusinessTaskParam> fields = taskQueryPagerQuery.getParams().getFields(); |
|
|
|
return businessFinishedListForOAApp(userSid, fields, current, size); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean stopProcessNew(String userSid, FlowTaskVo flowTaskVo) { |
|
|
|
stopProcess(userSid, flowTaskVo); |
|
|
|
return ResultBean.fireSuccess(); |
|
|
|