|
@@ -15,7 +15,6 @@ import com.qmth.distributed.print.business.enums.*;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
import com.qmth.teachcloud.common.bean.params.ApproveUserResult;
|
|
import com.qmth.teachcloud.common.bean.params.ApproveUserResult;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
-import com.qmth.teachcloud.common.entity.SysOrg;
|
|
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
@@ -2256,7 +2255,6 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
@Override
|
|
@Override
|
|
public FlowViewResult getFlowView(Long flowId) {
|
|
public FlowViewResult getFlowView(Long flowId) {
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
- SysOrg sysOrg = commonCacheService.orgCache(sysUser.getOrgId());
|
|
|
|
TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(flowId);
|
|
TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(flowId);
|
|
Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程实体数据为空"));
|
|
Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程实体数据为空"));
|
|
|
|
|
|
@@ -2292,46 +2290,37 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
agginessMap = JacksonUtil.readJson(tfFlowApprove.getTransferAssignee(), Map.class);
|
|
agginessMap = JacksonUtil.readJson(tfFlowApprove.getTransferAssignee(), Map.class);
|
|
}
|
|
}
|
|
|
|
|
|
-// Map<String, Object> varMap = new HashMap<>();
|
|
|
|
-// for (Map.Entry<String, CustomFlowVarDto> entry : agginessMap.entrySet()) {
|
|
|
|
-// CustomFlowVarDto customFlowVarDto = gson.fromJson(gson.toJson(entry.getValue()), CustomFlowVarDto.class);
|
|
|
|
-// varMap.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), s -> customFlowVarDto.getApproveIds().size() == 1 ? customFlowVarDto.getApproveIds().get(0) : customFlowVarDto.getApproveIds());
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
//获取流程审批历史
|
|
//获取流程审批历史
|
|
List<TFFlowLogResult> tfFlowLogResultList = tfFlowLogService.findByExamTaskId(tExamTaskFlowList.get(0).getTaskId());
|
|
List<TFFlowLogResult> tfFlowLogResultList = tfFlowLogService.findByExamTaskId(tExamTaskFlowList.get(0).getTaskId());
|
|
if (Objects.nonNull(tfFlowLogResultList) && tfFlowLogResultList.size() > 0) {
|
|
if (Objects.nonNull(tfFlowLogResultList) && tfFlowLogResultList.size() > 0) {
|
|
- LinkedMultiValueMap<Integer, TFFlowLogResult> tfFlowLogResultMap = new LinkedMultiValueMap<>();
|
|
|
|
|
|
+ LinkedMultiValueMap<Integer, TFFlowViewLogResult> tfFlowViewLogResultMap = new LinkedMultiValueMap<>();
|
|
for (TFFlowLogResult t : tfFlowLogResultList) {
|
|
for (TFFlowLogResult t : tfFlowLogResultList) {
|
|
- tfFlowLogResultMap.add(t.getApproveSetup(), t);
|
|
|
|
|
|
+ tfFlowViewLogResultMap.add(t.getApproveSetup(), new TFFlowViewLogResult(t));
|
|
}
|
|
}
|
|
|
|
|
|
- int nextFlowSetup = 0;
|
|
|
|
for (FlowViewTaskResult f : flowViewTaskResultList) {
|
|
for (FlowViewTaskResult f : flowViewTaskResultList) {
|
|
CustomFlowVarDto customFlowVarDto = gson.fromJson(gson.toJson(agginessMap.get(f.getTaskKey())), CustomFlowVarDto.class);
|
|
CustomFlowVarDto customFlowVarDto = gson.fromJson(gson.toJson(agginessMap.get(f.getTaskKey())), CustomFlowVarDto.class);
|
|
- if (currFlowTaskResult.getSetup().intValue() == f.getSetup().intValue()) {//当前审批节点
|
|
|
|
- f.setCurrentTask(true);
|
|
|
|
- f.setCurrentApproveUsers(sysUser.getRealName() + "(" + sysOrg.getName() + ")");
|
|
|
|
- nextFlowSetup = currFlowTaskResult.getSetup().intValue() + 1;
|
|
|
|
- nextFlowSetup = nextFlowSetup == setupMap.size() ? 0 : nextFlowSetup;
|
|
|
|
- } else if (f.getSetup().intValue() < currFlowTaskResult.getSetup().intValue()) {//已审节点
|
|
|
|
- //上一节点审核人
|
|
|
|
- f.setTfFlowLogResultList(tfFlowLogResultMap.get(f.getSetup()));
|
|
|
|
|
|
+ if (f.getSetup().intValue() <= currFlowTaskResult.getSetup().intValue()) {//已审节点
|
|
|
|
+ if (currFlowTaskResult.getSetup().intValue() == f.getSetup().intValue()) {//当前审批节点
|
|
|
|
+ f.setCurrentTask(true);
|
|
|
|
+ List<TFFlowViewLogResult> tfFlowViewLogResultList = tfFlowViewLogResultMap.get(f.getSetup());
|
|
|
|
+ f.setTfFlowViewLogResultList(tfFlowViewLogResultList);
|
|
|
|
+ TFFlowViewLogResult tfFlowViewLogResult = tfFlowViewLogResultList.get(tfFlowViewLogResultList.size() - 1);
|
|
|
|
+ f.setCurrentApproveUsers(tfFlowViewLogResult.getPendApproveUserName());
|
|
|
|
+ } else {
|
|
|
|
+ //上一节点审核人
|
|
|
|
+ f.setTfFlowViewLogResultList(tfFlowViewLogResultMap.get(f.getSetup()));
|
|
|
|
+ }
|
|
} else if (f.getSetup().intValue() > currFlowTaskResult.getSetup().intValue()) {//待审核节点
|
|
} else if (f.getSetup().intValue() > currFlowTaskResult.getSetup().intValue()) {//待审核节点
|
|
//下一节点审批人
|
|
//下一节点审批人
|
|
- if (nextFlowSetup > 0 && nextFlowSetup == f.getSetup().intValue()) {
|
|
|
|
- List<TFFlowLogResult> tfFlowLogResults = tfFlowLogResultMap.get(f.getSetup() - 1 == 1 ? SystemConstant.START_SETUP : f.getSetup() - 1);
|
|
|
|
- if (Objects.nonNull(tfFlowLogResults) && tfFlowLogResults.size() > 0) {
|
|
|
|
- f.setPendApproveUsers(tfFlowLogResults.get(tfFlowLogResults.size() - 1).getPendApproveUserName());
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- f.setPendApproveUsers(customFlowVarDto.getApproveIds().toString());
|
|
|
|
|
|
+ if (Objects.nonNull(customFlowVarDto.getApproveIds())) {
|
|
|
|
+ ApproveUserResult approveUserResult = sysUserService.findByIds(customFlowVarDto.getApproveIds().stream().map(x -> SystemConstant.convertIdToLong(x)).collect(Collectors.toList()));
|
|
|
|
+ f.setPendApproveUsers(approveUserResult.getPendApproveUsers());
|
|
|
|
+ f.setTfFlowViewLogResultList(tfFlowViewLogResultMap.get(f.getSetup()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
f.setMultipleUserApproveType(customFlowVarDto.getMultipleUserApproveType());
|
|
f.setMultipleUserApproveType(customFlowVarDto.getMultipleUserApproveType());
|
|
}
|
|
}
|
|
-// flowViewResult.setFlowTaskResultList(flowViewTaskResultList);
|
|
|
|
-// flowViewResult.setTfFlowLogResultList(tfFlowLogResultList);
|
|
|
|
}
|
|
}
|
|
return new FlowViewResult(flowViewTaskResultList);
|
|
return new FlowViewResult(flowViewTaskResultList);
|
|
}
|
|
}
|