From aaa5425f15ccdf795bf8b997715883392161a2ca Mon Sep 17 00:00:00 2001 From: tyty Date: Wed, 23 Aug 2023 17:21:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E4=B8=A4=E7=A5=A8=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=AD=97=E6=AE=B5=EF=BC=9A=E7=BB=9F=E8=AE=A1=E6=9C=88?= =?UTF-8?q?=E6=8A=A5/=E6=99=BA=E8=83=BD=E7=94=9F=E4=BA=A7=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=EF=BC=88=E6=96=B0=E5=B7=A5=E4=BD=9C=E6=B5=81=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=8F=98=E6=9B=B4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ticket/impl/TicketServiceImpl.java | 1 - .../service/ticket/impl/WorkTicketServiceImpl.java | 55 +++++++++++----------- .../impl/StandardTicketInfoServiceImpl.java | 6 +-- .../service/impl/FirstWorkTicketServiceImpl.java | 7 +-- 4 files changed, 32 insertions(+), 37 deletions(-) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java index a108ff0..03ed645 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java @@ -15,7 +15,6 @@ import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; -import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.CollectionUtil; import org.springframework.stereotype.Service; diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java index 7cad00b..c7638d1 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java @@ -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 infoIdList = infoList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList()); +// List infoIdList = infoList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList()); work.setTotal(infoList.size()); //工作票作废 - List invalidList = infoList.stream().filter(w -> TicketConstants.FirstWorkTicketFlowStatusEnum.INVALID.getStatus().equals(w.getStatus())) + List invalidList = infoList.stream().filter(item -> "废票".equals(item.getFlowTaskName())) .collect(Collectors.toList()); work.setInvalid(CollectionUtil.isNotEmpty(invalidList) ? invalidList.size() : 0); - // 工作票完成数 - List completeList = infoList.stream().filter(w -> TicketConstants.FirstWorkTicketFlowStatusEnum.FINISH.getStatus().equals(w.getStatus())) + // 工作票结束数 + List 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 moveList = workPrincipalService.list(new LambdaQueryWrapper() {{ - in(WorkTicketPrincipalChangeEntity::getTicketId, infoIdList); - }}); - if(CollectionUtil.isNotEmpty(moveList)){ - transferTask = moveList.size(); - } - List delayEntityList = workDelayService.list(Wrappers.lambdaQuery() - .in(WorkTicketDelayEntity::getTicketId, infoIdList) - ); - if(CollectionUtil.isNotEmpty(delayEntityList)){ - delayTask = delayEntityList.size(); - } - work.setDelay(delayTask); - work.setTransfer(transferTask); + // 工作票延期总数数 + List delayList = infoList.stream().filter(item -> "延期".equals(item.getInput())) + .collect(Collectors.toList()); + work.setDelay(CollectionUtil.isNotEmpty(delayList) ? delayList.size() : 0); + // 工作票移交数 + List 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 moveList = workPrincipalService.list(new LambdaQueryWrapper() {{ +// in(WorkTicketPrincipalChangeEntity::getTicketId, infoIdList); +// }}); +// if(CollectionUtil.isNotEmpty(moveList)){ +// transferTask = moveList.size(); +// } +// List delayEntityList = workDelayService.list(Wrappers.lambdaQuery() +// .in(WorkTicketDelayEntity::getTicketId, infoIdList) +// ); +// if(CollectionUtil.isNotEmpty(delayEntityList)){ +// delayTask = delayEntityList.size(); +// } +// work.setDelay(delayTask); +// work.setTransfer(transferTask); } return work; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java index 4da8447..f67d3ea 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java @@ -28,16 +28,14 @@ import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketMeasureVO; import com.hnac.hzims.ticket.standardTicket.wrapper.StandardTicketInfoWrapper; -import com.hnac.hzims.ticket.twoTicket.vo.ticket.StandardTicketCountQueryVo; -import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountQueryVo; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketMeasureVo; +import com.hnac.hzims.ticket.twoTicket.vo.ticket.StandardTicketCountQueryVo; import com.hnac.hzims.ticket.utils.ExcelUtil; import com.hnac.hzims.ticket.utils.PdfUtils; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; -import com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -680,7 +678,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl operateTicketReportStatistic = this.baseMapper.getOperateTicketReportStatistic(startDate, endDate, deptIdList); if (CollectionUtil.isNotEmpty(operateTicketReportStatistic)) { //已完成数量 - int ticketInfoCompleteNum = operateTicketReportStatistic.stream().filter(ticket -> TicketConstants.StandardTicketStatusEnum.END.getStatus().equals(ticket.getStatus())).collect(Collectors.toList()).size(); + int ticketInfoCompleteNum = operateTicketReportStatistic.stream().filter(item -> "结束".equals(item.getFlowTaskName())).collect(Collectors.toList()).size(); //合格数量 int ticketInfoQualifiedNum = operateTicketReportStatistic.stream().filter(ticket -> Func.isNotEmpty(ticket.getEvaluation()) && 1 == ticket.getEvaluation().intValue()).collect(Collectors.toList()).size(); //计算合格率 diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java index b207705..bb8023f 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java @@ -47,7 +47,6 @@ import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -58,7 +57,6 @@ import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; -import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** @@ -885,9 +883,8 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl workTicketReportStatistic = this.baseMapper.getWorkTicketReportStatistic(startDate, endDate, deptIdList); if(CollectionUtil.isNotEmpty(workTicketReportStatistic)) { // 工作票完成数量 - int ticketInfoCompleteNum = workTicketReportStatistic.stream().filter( - ticket-> WorkTicketConstants.FirstWorkTicketStatusEnum.FINISH.getStatus().equals(ticket.getStatus()) - ).collect(Collectors.toList()).size(); + int ticketInfoCompleteNum = workTicketReportStatistic.stream().filter(item -> "结束".equals(item.getFlowTaskName())) + .collect(Collectors.toList()).size(); // 工作票未完成数量 int ticketInfoStartNum = workTicketReportStatistic.size() - ticketInfoCompleteNum; // 延期数量统计