|
|
@@ -129,9 +129,6 @@ public class IsJobTicketServiceImpl extends ServiceImpl<IsJobTicketMapper, IsJob
|
|
|
List<IsJobTicketUser> jobTicketUserList = iIsJobTicketUserService.list(Wrappers.<IsJobTicketUser>lambdaQuery().eq(IsJobTicketUser::getTicketId, ticketId));
|
|
|
// 3.1组装人员数据
|
|
|
jobTicketDetailVO.setJobTicketUserList(jobTicketUserList);
|
|
|
- // 4.查询八大步骤数据
|
|
|
- List<IsJobTicketStep> jobTicketSteps = iIsJobTicketStepService.list(Wrappers.<IsJobTicketStep>lambdaQuery().eq(IsJobTicketStep::getTicketId, ticketId));
|
|
|
- jobTicketDetailVO.setJobTicketSteps(jobTicketSteps);
|
|
|
return jobTicketDetailVO;
|
|
|
}
|
|
|
|
|
|
@@ -664,6 +661,16 @@ public class IsJobTicketServiceImpl extends ServiceImpl<IsJobTicketMapper, IsJob
|
|
|
@Override
|
|
|
public Page<MonitorTicketPageVO> getMonitorJobTicketPage(Page<IsJobTicket> page, PageTicketDTO dto) {
|
|
|
Page<MonitorTicketPageVO> monitorJobTicketPage = isJobTicketMapper.getMonitorJobTicketPage(page, dto);
|
|
|
+ // 获取所有的人员信息
|
|
|
+ List<IsJobTicketUser> allUserList = null;
|
|
|
+ if (!monitorJobTicketPage.getRecords().isEmpty()) {
|
|
|
+ List<Long> ticketIds = monitorJobTicketPage.getRecords().stream().map(MonitorTicketPageVO::getTicketId).collect(Collectors.toList());
|
|
|
+ // 相关人员信息
|
|
|
+ allUserList = iIsJobTicketUserService.list(Wrappers.<IsJobTicketUser>lambdaQuery()
|
|
|
+ .in(IsJobTicketUser::getTicketId, ticketIds));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
for (MonitorTicketPageVO record : monitorJobTicketPage.getRecords()) {
|
|
|
// 初始值
|
|
|
record.setLockNum(0);
|
|
|
@@ -672,29 +679,31 @@ public class IsJobTicketServiceImpl extends ServiceImpl<IsJobTicketMapper, IsJob
|
|
|
record.setColockNum(0);
|
|
|
record.setColockedNum(0);
|
|
|
record.setRemoveColockNum(0);
|
|
|
- // 1.获取关联的上锁人信息
|
|
|
- List<IsJobTicketUser> jtlockerList = iIsJobTicketUserService.list(Wrappers.<IsJobTicketUser>lambdaQuery().eq(IsJobTicketUser::getTicketId, record.getTicketId()).eq(IsJobTicketUser::getUserRole, JTLOCKER.key));
|
|
|
- if (!jtlockerList.isEmpty()) {
|
|
|
- // 上锁总数
|
|
|
- record.setLockNum(jtlockerList.size());
|
|
|
- // 已上锁数
|
|
|
- int lockedNum = (int) jtlockerList.stream().filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.READY_TO_UNLOCK.status)).count();
|
|
|
- record.setLockedNum(lockedNum);
|
|
|
- // 已完成(解锁)上锁数
|
|
|
- int removeLockNum = (int) jtlockerList.stream().filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.UNLOCKED.status)).count();
|
|
|
- record.setRemoveLockNum(removeLockNum);
|
|
|
- }
|
|
|
- //2.获取关联的共锁人信息
|
|
|
- List<IsJobTicketUser> jtcolockerList = iIsJobTicketUserService.list(Wrappers.<IsJobTicketUser>lambdaQuery().eq(IsJobTicketUser::getTicketId, record.getTicketId()).eq(IsJobTicketUser::getUserRole, JTCOLOCKER.key));
|
|
|
- if (!jtcolockerList.isEmpty()) {
|
|
|
- // 上锁总数
|
|
|
- record.setColockNum(jtcolockerList.size());
|
|
|
- // 已上锁数
|
|
|
- int colockedNum = (int) jtcolockerList.stream().filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.READY_TO_UNLOCK.status)).count();
|
|
|
- record.setColockedNum(colockedNum);
|
|
|
- // 已完成(解锁)上锁数
|
|
|
- int removeColockNum = (int) jtcolockerList.stream().filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.UNLOCKED.status)).count();
|
|
|
- record.setRemoveColockNum(removeColockNum);
|
|
|
+ if (allUserList != null) {
|
|
|
+ // 1.获取关联的上锁人信息
|
|
|
+ List<IsJobTicketUser> jtlockerList = allUserList.stream().filter(o -> o.getTicketId().equals(record.getTicketId()) && o.getUserRole().equals(JTLOCKER.key)).collect(Collectors.toList());
|
|
|
+ if (!jtlockerList.isEmpty()) {
|
|
|
+ // 上锁总数
|
|
|
+ record.setLockNum(jtlockerList.size());
|
|
|
+ // 已上锁数
|
|
|
+ int lockedNum = (int) jtlockerList.stream().filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.READY_TO_UNLOCK.status)).count();
|
|
|
+ record.setLockedNum(lockedNum);
|
|
|
+ // 已完成(解锁)上锁数
|
|
|
+ int removeLockNum = (int) jtlockerList.stream().filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.UNLOCKED.status)).count();
|
|
|
+ record.setRemoveLockNum(removeLockNum);
|
|
|
+ }
|
|
|
+ //2.获取关联的共锁人信息
|
|
|
+ List<IsJobTicketUser> jtcolockerList = allUserList.stream().filter(o -> o.getTicketId().equals(record.getTicketId()) && o.getUserRole().equals(JTCOLOCKER.key)).collect(Collectors.toList());
|
|
|
+ if (!jtcolockerList.isEmpty()) {
|
|
|
+ // 上锁总数
|
|
|
+ record.setColockNum(jtcolockerList.size());
|
|
|
+ // 已上锁数
|
|
|
+ int colockedNum = (int) jtcolockerList.stream().filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.READY_TO_UNLOCK.status)).count();
|
|
|
+ record.setColockedNum(colockedNum);
|
|
|
+ // 已完成(解锁)上锁数
|
|
|
+ int removeColockNum = (int) jtcolockerList.stream().filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.UNLOCKED.status)).count();
|
|
|
+ record.setRemoveColockNum(removeColockNum);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return monitorJobTicketPage;
|