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