Browse Source

更换两票统计字段:统计月报/智能生产首页(新工作流字段变更)

zhongwei
tyty 1 year ago
parent
commit
aaa5425f15
  1. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java
  2. 55
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/WorkTicketServiceImpl.java
  3. 6
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  4. 7
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java

1
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;

55
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<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;
}

6
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<StandardTicke
List<OperateTicketStatisticVO> 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();
//计算合格率

7
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<WorkTicketInfoMa
List<WorkTicketReportStatisticVO> 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;
// 延期数量统计

Loading…
Cancel
Save