|
@@ -1269,15 +1269,14 @@ public class TaskController extends BladeController {
|
|
|
|
|
|
//判断当前用户所属流程,如果为审计流程则类型1显示Excel,如果是后面流程则类型2显示PDF,没有PDF则类型3
|
|
|
Integer currentUserFlow = null;
|
|
|
- Integer auditFlow = null;
|
|
|
+ List<Integer> auditFlow = new ArrayList<>();
|
|
|
/*预设流程(平行、顺序审批)*/
|
|
|
if (ObjectUtil.isNotEmpty(task.getFixedFlowId()) && !task.getFixedFlowId().equals(0L)) {
|
|
|
List<FixedFlowLink> query = jdbcTemplate.query("SELECT * FROM u_fixed_flow_link WHERE fixed_flow_id = ?", new Object[]{task.getFixedFlowId()}, new BeanPropertyRowMapper<>(FixedFlowLink.class));
|
|
|
//查看流程中是否存在审计流程
|
|
|
for (FixedFlowLink link : query) {
|
|
|
if (StringUtils.isNotBlank(link.getFixedFlowLink()) && link.getFixedFlowLink().contains("审计")){
|
|
|
- auditFlow = link.getFixedFlowBranchSort();
|
|
|
- break;
|
|
|
+ auditFlow.add(link.getFixedFlowBranchSort());
|
|
|
}
|
|
|
}
|
|
|
//校验当前用户在第几流程
|
|
@@ -1400,9 +1399,9 @@ public class TaskController extends BladeController {
|
|
|
String html = this.getExcelHtmlByBuss(Long.valueOf(task.getProjectId()));
|
|
|
if (html != null) {
|
|
|
vo.setTableHtml(html);
|
|
|
- if (auditFlow != null) {
|
|
|
+ if (auditFlow.size() > 0) {
|
|
|
//查看当前用户是否在审计流程
|
|
|
- if (currentUserFlow != null && currentUserFlow.equals(auditFlow)) {
|
|
|
+ if (currentUserFlow != null && auditFlow.contains(currentUserFlow)) {
|
|
|
//是意见人,设置意见为1,查询已经填写的值,如果没有则返回默认值
|
|
|
vo.setOpinionType(1);
|
|
|
R<WbsTreePrivate> r = wbsTreePrivateClient.getProjectOpinionNode(Long.valueOf(task.getProjectId()));
|
|
@@ -2525,7 +2524,7 @@ public class TaskController extends BladeController {
|
|
|
List<TaskParallel> taskParallels = jdbcTemplate.query(sql_2, new Object[]{task.getProcessInstanceId()}, new BeanPropertyRowMapper<>(TaskParallel.class));
|
|
|
|
|
|
//如果要生成审计意见单
|
|
|
- //如果当前是中间计量,材料计量,开工计量,并且是第一流程,则保存表单数据,若第一流程所有人都已审批则生成PDF,并且设置task对应值
|
|
|
+ //如果当前是中间计量,材料计量,开工计量,并且是审计流程,则保存表单数据,若所有审计流程-所有人都已审批则生成PDF,并且设置task对应值
|
|
|
if (task.getIsBuildAudit() == 1) {
|
|
|
checkMiddleApp(dto, task, taskParallels);
|
|
|
}
|
|
@@ -2621,28 +2620,28 @@ public class TaskController extends BladeController {
|
|
|
String html = this.getExcelHtmlByBuss(Long.valueOf(task.getProjectId()));
|
|
|
if (html != null) {
|
|
|
if (task.getMeterTaskType() != null && Arrays.asList(1,2,3).contains(task.getMeterTaskType())) {
|
|
|
- //判断当前用户所属流程,只处理审计流程
|
|
|
+ //判断当前用户所属流程,只处理审计流程,目前审计流程可以有多个,在最后一个生成PDF
|
|
|
Integer currentUserFlow = null;
|
|
|
- Integer auditFlow = null;
|
|
|
+ List<Integer> auditFlow = new ArrayList<>();
|
|
|
Boolean isDefiniteFlow = false;
|
|
|
Boolean isAllApp = false;
|
|
|
List<FixedFlowLink> query = new ArrayList<>();
|
|
|
+ //当前任务是新建流程
|
|
|
if (task.getFixedFlowId() != null && !task.getFixedFlowId().equals(0L)) {
|
|
|
isDefiniteFlow = true;
|
|
|
- query = jdbcTemplate.query("SELECT * FROM u_fixed_flow_link WHERE fixed_flow_id = ?", new Object[]{task.getFixedFlowId()}, new BeanPropertyRowMapper<>(FixedFlowLink.class));
|
|
|
+ query = jdbcTemplate.query("SELECT * FROM u_fixed_flow_link WHERE fixed_flow_id = ? order by fixed_flow_branch_sort", new Object[]{task.getFixedFlowId()}, new BeanPropertyRowMapper<>(FixedFlowLink.class));
|
|
|
//查看流程中是否存在审计流程
|
|
|
for (FixedFlowLink link : query) {
|
|
|
if (StringUtils.isNotBlank(link.getFixedFlowLink()) && link.getFixedFlowLink().contains("审计")){
|
|
|
- auditFlow = link.getFixedFlowBranchSort();
|
|
|
- break;
|
|
|
+ auditFlow.add(link.getFixedFlowBranchSort());
|
|
|
}
|
|
|
}
|
|
|
//校验当前用户在第几流程
|
|
|
Integer sort = query.stream().collect(Collectors.toMap(l -> l.getFixedFlowLinkUser(), l -> l.getFixedFlowBranchSort())).get(AuthUtil.getUserId());
|
|
|
currentUserFlow = sort;
|
|
|
}
|
|
|
- if (auditFlow != null && currentUserFlow != null && auditFlow.equals(currentUserFlow)) {
|
|
|
- //当前流程所有用户id,后面PDF权限校验
|
|
|
+ if (auditFlow.size() > 0 && currentUserFlow != null && auditFlow.contains(currentUserFlow)) {
|
|
|
+ //审计流程所有用户id,后面PDF权限校验
|
|
|
Map<Long, String> flowIds = new HashMap<>();
|
|
|
//查询出项目审计意见节点的基本信息
|
|
|
R r = wbsTreePrivateClient.getProjectOpinionNode(Long.valueOf(dto.getProjectId()));
|
|
@@ -2661,13 +2660,13 @@ public class TaskController extends BladeController {
|
|
|
if (map.size() == 0){
|
|
|
throw new ServiceException("未获取到html中的keyName");
|
|
|
}
|
|
|
+ //是新建的流程
|
|
|
if (isDefiniteFlow) {
|
|
|
- Integer auditFlow2 = auditFlow;
|
|
|
- flowIds = query.stream().filter(l -> l.getFixedFlowBranchSort() == auditFlow2)
|
|
|
+ flowIds = query.stream().filter(l -> auditFlow.contains(l.getFixedFlowBranchSort()))
|
|
|
.collect(Collectors.toMap(l -> l.getFixedFlowLinkUser(), l -> l.getFixedFlowLinkUserName()));
|
|
|
- //获取出当前流程中所有用户
|
|
|
+ //获取出审计流程中所有用户
|
|
|
List<String> ids = query.stream()
|
|
|
- .filter(l -> l.getFixedFlowBranchSort() == auditFlow2 && !l.getFixedFlowLinkUser().equals(AuthUtil.getUserId()))
|
|
|
+ .filter(l -> auditFlow.contains(l.getFixedFlowBranchSort()) && !l.getFixedFlowLinkUser().equals(AuthUtil.getUserId()))
|
|
|
.map(l -> l.getFixedFlowLinkUser() + "")
|
|
|
.collect(Collectors.toList());
|
|
|
//根据用户获取这些用户在当前任务中的进度,来判断是否全部审批完成
|
|
@@ -2780,6 +2779,8 @@ public class TaskController extends BladeController {
|
|
|
// throw new ServiceException("回滚测试");
|
|
|
// }
|
|
|
}
|
|
|
+ }else {
|
|
|
+ throw new ServiceException("未获取到项目配置的审计咨询意见单");
|
|
|
}
|
|
|
}
|
|
|
|