|
|
|
@ -2,26 +2,19 @@ package com.hnac.hzims.scheduled.service.ticket.impl;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.hnac.hzims.scheduled.mapper.ticket.WorkTicketMapper; |
|
|
|
|
import com.hnac.hzims.scheduled.service.ticket.WorkDelayService; |
|
|
|
|
import com.hnac.hzims.scheduled.service.ticket.WorkPrincipalService; |
|
|
|
|
import com.hnac.hzims.scheduled.service.ticket.WorkTicketService; |
|
|
|
|
import com.hnac.hzims.ticket.constants.TicketConstants; |
|
|
|
|
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; |
|
|
|
|
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; |
|
|
|
|
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketPrincipalChangeEntity; |
|
|
|
|
import com.hnac.hzims.ticket.workTicket.vo.WorkTicketStatisticVO; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
|
import java.util.concurrent.FutureTask; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -46,32 +39,40 @@ public class WorkTicketServiceImpl extends BaseServiceImpl<WorkTicketMapper, Wor
|
|
|
|
|
in(WorkTicketInfoEntity::getCreateDept, areas); |
|
|
|
|
}}); |
|
|
|
|
if (CollectionUtil.isNotEmpty(infoList)) { |
|
|
|
|
List<Long> infoIdList = infoList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList()); |
|
|
|
|
// List<Long> infoIdList = infoList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList());
|
|
|
|
|
work.setTotal(infoList.size()); |
|
|
|
|
//工作票作废
|
|
|
|
|
List<WorkTicketInfoEntity> invalidList = infoList.stream().filter(w -> TicketConstants.FirstWorkTicketFlowStatusEnum.INVALID.getStatus().equals(w.getStatus())) |
|
|
|
|
List<WorkTicketInfoEntity> invalidList = infoList.stream().filter(item -> "废票".equals(item.getFlowTaskName())) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
work.setInvalid(CollectionUtil.isNotEmpty(invalidList) ? invalidList.size() : 0); |
|
|
|
|
// 工作票完成数
|
|
|
|
|
List<WorkTicketInfoEntity> completeList = infoList.stream().filter(w -> TicketConstants.FirstWorkTicketFlowStatusEnum.FINISH.getStatus().equals(w.getStatus())) |
|
|
|
|
// 工作票结束数
|
|
|
|
|
List<WorkTicketInfoEntity> completeList = infoList.stream().filter(item -> "结束".equals(item.getFlowTaskName())) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
work.setComplete(CollectionUtil.isNotEmpty(completeList) ? completeList.size() : 0); |
|
|
|
|
int transferTask = 0; |
|
|
|
|
int delayTask = 0; |
|
|
|
|
List<WorkTicketPrincipalChangeEntity> moveList = workPrincipalService.list(new LambdaQueryWrapper<WorkTicketPrincipalChangeEntity>() {{ |
|
|
|
|
in(WorkTicketPrincipalChangeEntity::getTicketId, infoIdList); |
|
|
|
|
}}); |
|
|
|
|
if(CollectionUtil.isNotEmpty(moveList)){ |
|
|
|
|
transferTask = moveList.size(); |
|
|
|
|
} |
|
|
|
|
List<WorkTicketDelayEntity> delayEntityList = workDelayService.list(Wrappers.<WorkTicketDelayEntity>lambdaQuery() |
|
|
|
|
.in(WorkTicketDelayEntity::getTicketId, infoIdList) |
|
|
|
|
); |
|
|
|
|
if(CollectionUtil.isNotEmpty(delayEntityList)){ |
|
|
|
|
delayTask = delayEntityList.size(); |
|
|
|
|
} |
|
|
|
|
work.setDelay(delayTask); |
|
|
|
|
work.setTransfer(transferTask); |
|
|
|
|
// 工作票延期总数数
|
|
|
|
|
List<WorkTicketInfoEntity> delayList = infoList.stream().filter(item -> "延期".equals(item.getInput())) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
work.setDelay(CollectionUtil.isNotEmpty(delayList) ? delayList.size() : 0); |
|
|
|
|
// 工作票移交数
|
|
|
|
|
List<WorkTicketInfoEntity> changeList = infoList.stream().filter(item -> "转移".equals(item.getInput())) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
work.setTransfer(CollectionUtil.isNotEmpty(changeList) ? changeList.size() : 0); |
|
|
|
|
// int transferTask = 0;
|
|
|
|
|
// int delayTask = 0;
|
|
|
|
|
// List<WorkTicketPrincipalChangeEntity> moveList = workPrincipalService.list(new LambdaQueryWrapper<WorkTicketPrincipalChangeEntity>() {{
|
|
|
|
|
// in(WorkTicketPrincipalChangeEntity::getTicketId, infoIdList);
|
|
|
|
|
// }});
|
|
|
|
|
// if(CollectionUtil.isNotEmpty(moveList)){
|
|
|
|
|
// transferTask = moveList.size();
|
|
|
|
|
// }
|
|
|
|
|
// List<WorkTicketDelayEntity> delayEntityList = workDelayService.list(Wrappers.<WorkTicketDelayEntity>lambdaQuery()
|
|
|
|
|
// .in(WorkTicketDelayEntity::getTicketId, infoIdList)
|
|
|
|
|
// );
|
|
|
|
|
// if(CollectionUtil.isNotEmpty(delayEntityList)){
|
|
|
|
|
// delayTask = delayEntityList.size();
|
|
|
|
|
// }
|
|
|
|
|
// work.setDelay(delayTask);
|
|
|
|
|
// work.setTransfer(transferTask);
|
|
|
|
|
} |
|
|
|
|
return work; |
|
|
|
|
} |
|
|
|
|