Browse Source

修正:统计月报两票、巡检、值班统计逻辑

zhongwei
ty 5 months ago
parent
commit
a5fdc44dbf
  1. 1
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml
  2. 13
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java
  3. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java
  4. 93
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  5. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java
  6. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/DutyRunReportVO.java
  7. 22
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  8. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java

1
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml

@ -393,6 +393,7 @@
from hz_st_ex_task t,hz_st_ex_task_user u from hz_st_ex_task t,hz_st_ex_task_user u
where t.id = u.task_id and t.is_deleted = 0 and u.is_deleted = 0 where t.id = u.task_id and t.is_deleted = 0 and u.is_deleted = 0
and u.user_id is not null and u.user_id is not null
and u.CLAIM_STATUS =1
<if test="startTime != null"> <if test="startTime != null">
and t.CREATE_TIME &gt;= #{startTime} and t.CREATE_TIME &gt;= #{startTime}
</if> </if>

13
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java

@ -1003,9 +1003,16 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp
QueryWrapper<TaskEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<TaskEntity> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotEmpty(deptId)) { if (ObjectUtil.isNotEmpty(deptId)) {
if (deptIds.contains(deptId)) { if (deptIds.contains(deptId)) {
queryWrapper.in(ObjectUtils.isNotNull(deptIds), "CREATE_DEPT", deptId); //模糊查询,查询当前机构及其子机构
} else { R<List<Dept>> childDeptListR = sysClient.getDeptChild(deptId);
throw new ServiceException("暂无该机构权限"); if (childDeptListR.isSuccess() && CollectionUtil.isNotEmpty(childDeptListR.getData())) {
List<Long> currentDeptIdList = new ArrayList<>();
currentDeptIdList.add(deptId);
currentDeptIdList.addAll(childDeptListR.getData().stream().map(Dept::getId).collect(Collectors.toList()));
queryWrapper.in(CollectionUtil.isNotEmpty(currentDeptIdList), "CREATE_DEPT", currentDeptIdList);
} else {
throw new ServiceException("暂无该机构权限");
}
} }
} else { } else {
queryWrapper.in(ObjectUtils.isNotNull(deptIds), "CREATE_DEPT", deptIds); queryWrapper.in(ObjectUtils.isNotNull(deptIds), "CREATE_DEPT", deptIds);

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java

@ -596,12 +596,19 @@ public class OperPhenomenonServiceImpl extends BaseServiceImpl<OperPhenomenonMap
QueryWrapper<OperPhenomenonEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<OperPhenomenonEntity> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotEmpty(deptId)) { if (ObjectUtil.isNotEmpty(deptId)) {
if (deptIds.contains(deptId)) { if (deptIds.contains(deptId)) {
queryWrapper.in(ObjectUtils.isNotNull(deptIds), "CREATE_DEPT", deptId); //模糊查询,查询当前机构及其子机构
R<List<Dept>> childDeptListR = sysClient.getDeptChild(deptId);
if (childDeptListR.isSuccess() && CollectionUtil.isNotEmpty(childDeptListR.getData())) {
List<Long> currentDeptIdList=new ArrayList<>();
currentDeptIdList.add(deptId);
currentDeptIdList.addAll(childDeptListR.getData().stream().map(Dept::getId).collect(Collectors.toList()));
queryWrapper.in(CollectionUtil.isNotEmpty(currentDeptIdList), "CREATE_DEPT", currentDeptIdList);
}
} else { } else {
throw new ServiceException("暂无该机构权限"); throw new ServiceException("暂无该机构权限");
} }
} else { } else {
queryWrapper.in(ObjectUtils.isNotNull(deptIds), "CREATE_DEPT", deptIds); queryWrapper.in(CollectionUtil.isNotEmpty(deptIds), "CREATE_DEPT", deptIds);
} }
queryWrapper.ge(ObjectUtils.isNotNull(startTime), "CREATE_TIME", startTime); queryWrapper.ge(ObjectUtils.isNotNull(startTime), "CREATE_TIME", startTime);
queryWrapper.le(ObjectUtils.isNotNull(endTime), "CREATE_TIME", endTime); queryWrapper.le(ObjectUtils.isNotNull(endTime), "CREATE_TIME", endTime);

93
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

@ -49,6 +49,9 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.hnac.hzims.operational.duty.DutyContants.DutyRecDelayStatusEnum.CARRY_DELAY_STATUS;
import static com.hnac.hzims.operational.duty.DutyContants.DutyRecDelayStatusEnum.HAND_DELAY_STATUS;
/** /**
* 服务实现类 * 服务实现类
* *
@ -1052,7 +1055,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
in(ImsDutyRecEntity::getDutyId, dutyIdList); in(ImsDutyRecEntity::getDutyId, dutyIdList);
}}); }});
//延迟交接班 //延迟交接班
List<ImsDutyRecEntity> delayList = imsDutyRecEntityList.stream().filter(rec -> rec.getDelayStatus() == 1).collect(Collectors.toList()); List<ImsDutyRecEntity> delayList = imsDutyRecEntityList.stream().filter(rec -> rec.getDelayStatus() != 0).collect(Collectors.toList());
//异常交接班 //异常交接班
List<ImsDutyRecEntity> exceptionList = imsDutyRecEntityList.stream().filter(rec -> DutyRecStatus.ANOMALY.getVal().equals(rec.getStatus())).collect(Collectors.toList()); List<ImsDutyRecEntity> exceptionList = imsDutyRecEntityList.stream().filter(rec -> DutyRecStatus.ANOMALY.getVal().equals(rec.getStatus())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(delayList)) { if (CollectionUtil.isNotEmpty(delayList)) {
@ -1070,7 +1073,6 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
} }
private void getDutyRunReportByGroup(LocalDate startDate, LocalDate endDate, List<Long> deptIdList, List<ImsDutyMainEntity> imsDutyMainEntityList, List<DutyRunReportVO> dutyReportVOList,AtomicInteger index) { private void getDutyRunReportByGroup(LocalDate startDate, LocalDate endDate, List<Long> deptIdList, List<ImsDutyMainEntity> imsDutyMainEntityList, List<DutyRunReportVO> dutyReportVOList,AtomicInteger index) {
//按班组组合值班记录 //按班组组合值班记录
Map<Long, List<ImsDutyMainEntity>> listByGroup = imsDutyMainEntityList.stream().filter(o -> ObjectUtil.isNotEmpty(o.getDutyGroupId())).collect(Collectors.groupingBy(ImsDutyMainEntity::getDutyGroupId)); Map<Long, List<ImsDutyMainEntity>> listByGroup = imsDutyMainEntityList.stream().filter(o -> ObjectUtil.isNotEmpty(o.getDutyGroupId())).collect(Collectors.groupingBy(ImsDutyMainEntity::getDutyGroupId));
listByGroup.forEach((k, v) -> { listByGroup.forEach((k, v) -> {
@ -1079,6 +1081,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
if (ObjectUtil.isNotEmpty(imsDutyGroupEntity)) { if (ObjectUtil.isNotEmpty(imsDutyGroupEntity)) {
DutyRunReportVO dutyReportVO = new DutyRunReportVO(); DutyRunReportVO dutyReportVO = new DutyRunReportVO();
dutyReportVO.setIndex(index.get()); dutyReportVO.setIndex(index.get());
dutyReportVO.setGroupId(k.toString());
index.getAndIncrement(); index.getAndIncrement();
dutyReportVO.setGroupName(imsDutyGroupEntity.getGroupName()); dutyReportVO.setGroupName(imsDutyGroupEntity.getGroupName());
User user = UserCache.getUser(imsDutyGroupEntity.getManagerId()); User user = UserCache.getUser(imsDutyGroupEntity.getManagerId());
@ -1101,28 +1104,76 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
eq(OperPhenomenonEntity::getIsDeleted, 0); eq(OperPhenomenonEntity::getIsDeleted, 0);
}}); }});
dutyReportVO.setFindProblemNum(operPhenomenonEntityList.size()); dutyReportVO.setFindProblemNum(operPhenomenonEntityList.size());
dutyReportVOList.add(dutyReportVO);
}
});
//获取交接班异常记录 }
List<ImsDutyRecEntity> imsDutyRecEntityList = imsDutyRecMapper.selectList(new LambdaQueryWrapper<ImsDutyRecEntity>() {{
in(ImsDutyRecEntity::getDutyId, dutyIdList); private void getDelayAndExceptionList(List<ImsDutyMainEntity> imsDutyMainEntityList, List<DutyRunReportVO> dutyReportVOList) {
}}); List<Long> mainIdList= imsDutyMainEntityList.stream().filter(o -> ObjectUtil.isNotEmpty(o.getDutyGroupId())).map(ImsDutyMainEntity::getId).collect(Collectors.toList());
//延迟交接班 //获取交接班异常记录
List<ImsDutyRecEntity> delayList = imsDutyRecEntityList.stream().filter(rec -> rec.getDelayStatus() == 1).collect(Collectors.toList()); List<ImsDutyRecEntity> imsDutyRecEntityList = imsDutyRecMapper.selectList(new LambdaQueryWrapper<ImsDutyRecEntity>() {{
//异常交接班 in(ImsDutyRecEntity::getDutyId, mainIdList);
List<ImsDutyRecEntity> exceptionList = imsDutyRecEntityList.stream().filter(rec -> DutyRecStatus.ANOMALY.getVal().equals(rec.getStatus())).collect(Collectors.toList()); }});
if (CollectionUtil.isNotEmpty(delayList)) { //延迟交接班
dutyReportVO.setDelayChangeShifts(delayList.size()); List<ImsDutyRecEntity> delayList = imsDutyRecEntityList.stream().filter(rec -> rec.getDelayStatus() != 0).collect(Collectors.toList());
List<String> delayIdsList = delayList.stream().map(ImsDutyRecEntity::getDutyId).map(s -> String.valueOf(s)).collect(Collectors.toList()); //异常交接班
dutyReportVO.setDelayChangeList(delayIdsList); List<ImsDutyRecEntity> exceptionList = imsDutyRecEntityList.stream().filter(rec -> DutyRecStatus.ANOMALY.getVal().equals(rec.getStatus())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(delayList)) {
for (ImsDutyRecEntity rec : delayList) {
if (rec.getDelayStatus().equals(CARRY_DELAY_STATUS.getStatus())){
//如果是接班,算接班的班组+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList());
List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setDelayChangeShifts(troubleRunReport.getDelayChangeShifts()+1);
}else if (rec.getDelayStatus().equals(HAND_DELAY_STATUS.getStatus())) {
//如果是交班延迟,算当前的班组+1
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList());
List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setDelayChangeShifts(handerRunRepor.getDelayChangeShifts()+1);
}else {
//交接班延迟,交接班组都+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList());
List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setDelayChangeShifts(troubleRunReport.getDelayChangeShifts()+1);
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList());
List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setDelayChangeShifts(handerRunRepor.getDelayChangeShifts()+1);
} }
if (CollectionUtil.isNotEmpty(exceptionList)) { }
dutyReportVO.setExceptionChangeShifts(exceptionList.size()); }
List<String> exceptionIdsList = exceptionList.stream().map(ImsDutyRecEntity::getDutyId).map(s -> String.valueOf(s)).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(exceptionList)) {
dutyReportVO.setExceptionChangeList(exceptionIdsList); for (ImsDutyRecEntity rec : exceptionList) {
if (rec.getDelayStatus().equals(CARRY_DELAY_STATUS.getStatus())){
//如果是接班,算接班的班组+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList());
List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setExceptionChangeShifts(troubleRunReport.getExceptionChangeShifts()+1);
}else if (rec.getDelayStatus().equals(HAND_DELAY_STATUS.getStatus())) {
//如果是交班延迟,算当前的班组+1
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList());
List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setExceptionChangeShifts(handerRunRepor.getExceptionChangeShifts()+1);
}else {
//交接班延迟,交接班组都+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList());
List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setExceptionChangeShifts(troubleRunReport.getExceptionChangeShifts()+1);
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList());
List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setExceptionChangeShifts(handerRunRepor.getExceptionChangeShifts()+1);
} }
dutyReportVOList.add(dutyReportVO);
} }
}); }
} }
@Override @Override
@ -1143,6 +1194,8 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
if(CollectionUtil.isNotEmpty(imsDutyMainEntityList)) { if(CollectionUtil.isNotEmpty(imsDutyMainEntityList)) {
//带班组的值班数据 //带班组的值班数据
this.getDutyRunReportByGroup(startDate, endDate, deptIdList, imsDutyMainEntityList, dutyReportVOList,index); this.getDutyRunReportByGroup(startDate, endDate, deptIdList, imsDutyMainEntityList, dutyReportVOList,index);
//带班组的交接班异常数据处理
getDelayAndExceptionList(imsDutyMainEntityList, dutyReportVOList);
//灵活排班的值班数据 //灵活排班的值班数据
this.getDutyRunReportByPerson(startDate, endDate, deptIdList, imsDutyMainEntityList, dutyReportVOList,index); this.getDutyRunReportByPerson(startDate, endDate, deptIdList, imsDutyMainEntityList, dutyReportVOList,index);
} }

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java

@ -312,11 +312,11 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
//使用预定义实例来转换 //使用预定义实例来转换
DateTimeFormatter fmt = DateTimeFormatter.ISO_LOCAL_DATE; DateTimeFormatter fmt = DateTimeFormatter.ISO_LOCAL_DATE;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDate startDate = DateUtil.getFirstDayByYearMonth(yearAndMonth); LocalDate startDate = DateUtil.getFirstDayByYearMonth(yearAndMonth);
LocalDate endDate = DateUtil.getLastDayByYearMonth(yearAndMonth); LocalDate endDate = DateUtil.getLastDayByYearMonth(yearAndMonth);
params.put("startDate", fmt.format(startDate)); params.put("startDate", fmt.format(startDate));
params.put("endDate", fmt.format(endDate)); params.put("endDate", fmt.format(endDate));
List<Long> deptIdList = new ArrayList<>(); List<Long> deptIdList = new ArrayList<>();
deptIdList.add(deptVO.getId()); deptIdList.add(deptVO.getId());
//获取下属机构 //获取下属机构
@ -390,7 +390,9 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
pool.execute(() -> { pool.execute(() -> {
try { try {
List<RunReportVO> reportVOS=new ArrayList<>(); List<RunReportVO> reportVOS=new ArrayList<>();
List<TaskReportVO> inspectStatisticsByName = inspectReportClient.getInspectStatisticsByName(deptIdList, fmt.format(startDate), fmt.format(endDate)); List<TaskReportVO> inspectStatisticsByName = inspectReportClient.getInspectStatisticsByName(deptIdList,
formatter.format(LocalDateTime.of(startDate, LocalTime.MIN)),
formatter.format(LocalDateTime.of(endDate, LocalTime.MAX)));
if(CollectionUtil.isNotEmpty(inspectStatisticsByName)) { if(CollectionUtil.isNotEmpty(inspectStatisticsByName)) {
for (int i = 0; i < inspectStatisticsByName.size(); i++) { for (int i = 0; i < inspectStatisticsByName.size(); i++) {
TaskReportVO taskReportVO = inspectStatisticsByName.get(i); TaskReportVO taskReportVO = inspectStatisticsByName.get(i);
@ -472,7 +474,6 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
String[] stationIdArray = new String[stationIds.size()]; String[] stationIdArray = new String[stationIds.size()];
stationIds.toArray(stationIdArray); stationIds.toArray(stationIdArray);
fdpFaultTableDTO.setStationIds(stationIdArray); fdpFaultTableDTO.setStationIds(stationIdArray);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
fdpFaultTableDTO.setCreateTimeLeft(formatter.format(LocalDateTime.of(startDate, LocalTime.MIN))); fdpFaultTableDTO.setCreateTimeLeft(formatter.format(LocalDateTime.of(startDate, LocalTime.MIN)));
fdpFaultTableDTO.setCreateTimeRight(formatter.format(LocalDateTime.of(endDate, LocalTime.MAX))); fdpFaultTableDTO.setCreateTimeRight(formatter.format(LocalDateTime.of(endDate, LocalTime.MAX)));
fdpFaultTableDTO.setPageSize(-1); fdpFaultTableDTO.setPageSize(-1);

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/DutyRunReportVO.java

@ -12,7 +12,8 @@ public class DutyRunReportVO implements Serializable {
private static final long serialVersionUID = 3273581622730234931L; private static final long serialVersionUID = 3273581622730234931L;
private Integer index; private Integer index;
@ApiModelProperty("班组名称")
private String groupId;
@ApiModelProperty("班组名称") @ApiModelProperty("班组名称")
private String groupName; private String groupName;
@ApiModelProperty("值长") @ApiModelProperty("值长")

22
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java

@ -697,22 +697,24 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
if (CollectionUtil.isNotEmpty(operateTicketReportStatistic)) { if (CollectionUtil.isNotEmpty(operateTicketReportStatistic)) {
for (Map.Entry<String, List<OperateTicketStatisticVO>> typeOperateTicket : operateTicket.entrySet()) { for (Map.Entry<String, List<OperateTicketStatisticVO>> typeOperateTicket : operateTicket.entrySet()) {
String type = TicketConstants.TicketTypeNameEnum.getTicketNameByType(typeOperateTicket.getKey()); String type = TicketConstants.TicketTypeNameEnum.getTicketNameByType(typeOperateTicket.getKey());
//已完成数量 if (CollectionUtils.isNotEmpty(typeOperateTicket.getValue())) {
int ticketInfoCompleteNum = operateTicketReportStatistic.stream().filter(item -> "结束".equals(item.getFlowTaskName())).collect(Collectors.toList()).size(); //已完成数量
//合格数量 int ticketInfoCompleteNum = typeOperateTicket.getValue().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(); //合格数量
//废票数量 int ticketInfoQualifiedNum = typeOperateTicket.getValue().stream().filter(ticket -> Func.isNotEmpty(ticket.getEvaluation()) && 1 == ticket.getEvaluation().intValue()).collect(Collectors.toList()).size();
int ticketInfoInvalidatedNum = operateTicketReportStatistic.stream().filter(item -> "作废".equals(item.getFlowTaskName())).collect(Collectors.toList()).size(); //废票数量
//计算合格率 int ticketInfoInvalidatedNum = typeOperateTicket.getValue().stream().filter(item -> "作废".equals(item.getFlowTaskName())).collect(Collectors.toList()).size();
double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double) operateTicketReportStatistic.size() * 100).setScale(2, RoundingMode.HALF_DOWN).doubleValue(); //计算合格率
double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double) operateTicketReportStatistic.size() * 100).setScale(2, RoundingMode.HALF_DOWN).doubleValue();
TicketInfoStatisticVO ticketInfoStatisticVO = TicketInfoStatisticVO.builder().ticketInfoType(type) TicketInfoStatisticVO ticketInfoStatisticVO = TicketInfoStatisticVO.builder().ticketInfoType(type)
.ticketInfoNumber(operateTicketReportStatistic.size()) .ticketInfoNumber(typeOperateTicket.getValue().size())
.ticketInfoCompleteNum(ticketInfoCompleteNum) .ticketInfoCompleteNum(ticketInfoCompleteNum)
.ticketInfoQualifiedNum(ticketInfoQualifiedNum) .ticketInfoQualifiedNum(ticketInfoQualifiedNum)
.ticketInfoInvalidatedNum(ticketInfoInvalidatedNum) .ticketInfoInvalidatedNum(ticketInfoInvalidatedNum)
.ticketInfoStartNum(operateTicketReportStatistic.size() - ticketInfoCompleteNum) .ticketInfoStartNum(typeOperateTicket.getValue().size() - ticketInfoCompleteNum)
.ticketInfoProportion(ticketInfoProportion).build(); .ticketInfoProportion(ticketInfoProportion).build();
res.add(ticketInfoStatisticVO); res.add(ticketInfoStatisticVO);
}
} }
} }
return res; return res;

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java

@ -1153,7 +1153,7 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl<WorkTicketInfoMa
.setScale(2, RoundingMode.HALF_UP).doubleValue(); .setScale(2, RoundingMode.HALF_UP).doubleValue();
TicketInfoStatisticVO workTicketStatistic = TicketInfoStatisticVO.builder() TicketInfoStatisticVO workTicketStatistic = TicketInfoStatisticVO.builder()
.ticketInfoType(ticketInfoType) .ticketInfoType(ticketInfoType)
.ticketInfoNumber(workTicketReportStatistic.size()) .ticketInfoNumber(typeWorkTicket.getValue().size())
.ticketInfoCompleteNum(ticketInfoCompleteNum) .ticketInfoCompleteNum(ticketInfoCompleteNum)
.ticketInfoStartNum(ticketInfoStartNum) .ticketInfoStartNum(ticketInfoStartNum)
.ticketInfoDelayNum(ticketInfoDelayNum) .ticketInfoDelayNum(ticketInfoDelayNum)

Loading…
Cancel
Save