diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/response/AccessTicketPageRspDTO.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/response/AccessTicketPageRspDTO.java index aa79b6f..be2ff88 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/response/AccessTicketPageRspDTO.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/response/AccessTicketPageRspDTO.java @@ -1,8 +1,13 @@ package com.hnac.hzims.ticket.accessTicket.dto.response; import com.hnac.hzims.ticket.accessTicket.entity.AccessTicketEntity; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import org.springblade.system.user.entity.User; + +import java.util.List; /** * @author ysj @@ -11,4 +16,6 @@ import lombok.EqualsAndHashCode; @Data public class AccessTicketPageRspDTO extends AccessTicketEntity { + @ApiModelProperty("下一步执行人") + private List executors; } \ No newline at end of file diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java index 6b211c9..929b55f 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java @@ -239,4 +239,5 @@ public class PlanController extends BladeController { } return result; } + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java index e0d838f..a6a8708 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java @@ -111,11 +111,4 @@ public class AccessTicketController extends BladeController { public R> roleQueryUser(@RequestParam("roleAlias") String roleAlias) { return R.data(accessTicketService.roleQueryUser(roleAlias)); } - - @GetMapping("/stageExecutor") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "阶段执行人查询") - public R> stageExecutor(@RequestParam("processInstanceId") String processInstanceId) { - return R.data(accessTicketService.stageExecutor(processInstanceId)); - } } \ No newline at end of file diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java index b192e1b..87d6498 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java @@ -14,7 +14,6 @@ import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketTaskCountVo; import org.springblade.core.mp.support.Query; import org.springblade.system.user.entity.User; -import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -37,6 +36,4 @@ public interface AccessTicketService extends IService { List roleQueryUser(String roleAlias); AccessTicketTaskCountVo taskCount(AccessTicketTaskCountReqDTO param); - - List stageExecutor(String processInstanceId); } \ No newline at end of file diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java index 87d211c..95993d0 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java @@ -52,6 +52,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletResponse; import java.util.*; +import java.util.stream.Collectors; /** * @author ysj @@ -272,7 +273,26 @@ public class AccessTicketServiceImpl extends ServiceImpl pageCondition(AccessTicketPageReqDTO param, Query query) { - return super.baseMapper.pageCondition(Condition.getPage(query),param); + IPage ipage = super.baseMapper.pageCondition(Condition.getPage(query),param); + if(CollectionUtil.isEmpty(ipage.getRecords())){ + return ipage; + } + List records = ipage.getRecords(); + ipage.setRecords(records.stream().peek(record->{ + List users = new ArrayList<>(); + Arrays.stream(record.getNextStepExecutor().split(",")).forEach(account->{ + User user = UserCache.getUser(Long.valueOf(account)); + if(ObjectUtil.isNotEmpty(user)){ + users.add(user); + } + }); + if(CollectionUtil.isEmpty(users)){ + record.setExecutors(new ArrayList<>()); + }else{ + record.setExecutors(users); + } + }).collect(Collectors.toList())); + return ipage; } /** @@ -537,27 +557,4 @@ public class AccessTicketServiceImpl extends ServiceImpl!"流程结束".equals(o.getTaskName())).count()); return task; } - - /** - * 阶段执行人查询 - * @param processInstanceId - * @return - */ - @Override - public List stageExecutor(String processInstanceId) { - AccessTicketEntity entity = this.getOne(Wrappers.lambdaQuery() - .eq(AccessTicketEntity::getProcessInstanceId,processInstanceId) - ); - if(ObjectUtil.isEmpty(entity) || StringUtils.isEmpty(entity.getNextStepExecutor())){ - return new ArrayList<>(); - } - List users = new ArrayList<>(); - Arrays.stream(entity.getNextStepExecutor().split(",")).forEach(account->{ - User user = UserCache.getUser(Long.valueOf(account)); - if(ObjectUtil.isNotEmpty(user)){ - users.add(user); - } - }); - return users; - } } \ No newline at end of file