Browse Source

水电站月报统计功能修正bug

zhongwei
tyty 1 year ago
parent
commit
0a6a154ee1
  1. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java
  2. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java

@ -4,7 +4,7 @@ import lombok.Getter;
public class OperationalConstants {
public final static String APP_NAME = "hzims-operational";
public final static String APP_NAME = "hzims-operational-ty";

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java

@ -491,10 +491,12 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
ticketChartCell.setTicketName(value.getFileName());
if (value.getTicketType() == 2) {
List<WorkTicketInfoEntity> yearTicketCollect = Optional.ofNullable(yearTicket.getData()).orElse(new ArrayList<>()).stream()
.filter(s -> s.getSignageCode() != null)
.filter(s -> stationId.equals(s.getSignageCode()))
.filter(s -> s.getType().equals(value.getType())).collect(Collectors.toList());
List<WorkTicketInfoEntity> monthTicketCollect = Optional.ofNullable(monthTicket.getData()).orElse(new ArrayList<>()).stream()
.filter(s -> s.getSignageCode().equals(stationId))
.filter(s -> s.getSignageCode() != null)
.filter(s -> stationId.equals(s.getSignageCode()))
.filter(s -> s.getType().equals(value.getType())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(yearTicketCollect)) {
//年合格率和数量
@ -521,10 +523,12 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
}
if (value.getTicketType() == 1) {
List<StandardTicketInfoEntity> yearOperateCollect = Optional.ofNullable(yearOperateTicket.getData()).orElse(new ArrayList<>()).stream()
.filter(s -> s.getSignageCode() != null)
.filter(s -> stationId.equals(s.getSignageCode()))
.filter(s -> s.getTicketType().equals(value.getType())).collect(Collectors.toList());
List<StandardTicketInfoEntity> monthOperateCollect = Optional.ofNullable(monthOperateTicket.getData()).orElse(new ArrayList<>()).stream()
.filter(s -> s.getSignageCode().equals(stationId))
.filter(s -> s.getSignageCode() != null)
.filter(s -> stationId.equals(s.getSignageCode()))
.filter(s -> s.getTicketType().equals(value.getType())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(yearOperateCollect)) {
//年合格率和数量
@ -590,8 +594,8 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
ticketMap2.put("info", "合格率");
ticketMap.put("ticketMon" + ticketType, String.valueOf(chartCell.getTicketMon()));
ticketMap.put("ticketYear" + ticketType, String.valueOf(chartCell.getTicketYear()));
ticketMap2.put("ticketMon" + ticketType, chartCell.getTicketMonPerc()* 100 + "%");
ticketMap2.put("ticketYear" + ticketType, chartCell.getTicketYeaPercr()* 100 + "%");
ticketMap2.put("ticketMon" + ticketType, new BigDecimal(chartCell.getTicketMonPerc()).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue() + "%");
ticketMap2.put("ticketYear" + ticketType,new BigDecimal(chartCell.getTicketYeaPercr()).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()+ "%");
}
ticketListRes.add(ticketMap);
ticketListRes.add(ticketMap2);

Loading…
Cancel
Save