diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/TaskStatisticsVo.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/TaskStatisticsVo.java index 9d4b4a2..0e039ec 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/TaskStatisticsVo.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/TaskStatisticsVo.java @@ -43,7 +43,7 @@ public class TaskStatisticsVo extends FdpTaskEntity { @ApiModelProperty(value = "几级菜单") private Integer level; @ApiModelProperty(value = "菜单名称") - private String name; + private String memuName; diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/response/FaultStateResp.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/response/FaultStateResp.java index a449dce..c10b35d 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/response/FaultStateResp.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/response/FaultStateResp.java @@ -24,7 +24,7 @@ public class FaultStateResp { // @JSONField(name = "NAME") // private String name; @ApiModelProperty("数据时间") - @JSONField(name = "NAME") + @JSONField(name = "ts") private String ts; @ApiModelProperty("状态") @JSONField(name = "STATUS") diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java index 9db05c1..500e43c 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java @@ -134,25 +134,25 @@ public class FdpTaskServiceImpl extends BaseServiceImpl> collectByCreateDept = fdpTaskEntities.stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpDeviceName)); - getCount("",collectByCreateDept, fdpTaskEntities, res, 1); + Map> collectByFdpDeviceName = fdpTaskEntities.stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpDeviceName)); + getCount("",collectByFdpDeviceName, fdpTaskEntities, res, 1); if (Func.isEmpty(statisticsVo.getName())) { - collectByCreateDept.entrySet().forEach(s->{ + collectByFdpDeviceName.entrySet().forEach(s->{ Map> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getName)); getCount(s.getKey(),collectByName, s.getValue(), res, 2); }); - } else if (Func.isEmpty(statisticsVo.getFdpDeviceName())){ - collectByCreateDept.entrySet().forEach(s->{ - Map> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpDeviceName)); - getCount(s.getKey(),collectByName, s.getValue(), res, 2); + } else if (Func.isEmpty(statisticsVo.getCreateDept())){ + collectByFdpDeviceName.entrySet().forEach(s->{ + Map> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getCreateDept)); + getCount2(s.getKey(),collectByName, s.getValue(), res, 2); }); }else if (Func.isEmpty(statisticsVo.getFdpOrd())){ - collectByCreateDept.entrySet().forEach(s->{ + collectByFdpDeviceName.entrySet().forEach(s->{ Map> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getFdpOrd)); getCount(s.getKey(),collectByName, s.getValue(), res, 2); }); }else if (Func.isEmpty(statisticsVo.getType())){ - collectByCreateDept.entrySet().forEach(s->{ + collectByFdpDeviceName.entrySet().forEach(s->{ Map> collectByName = s.getValue().stream().collect(Collectors.groupingBy(FdpTaskEntity::getType)); getCount(s.getKey(),collectByName, s.getValue(), res, 2); }); @@ -179,7 +179,7 @@ public class FdpTaskServiceImpl extends BaseServiceImpl> collectByCreateDept, List fdpTaskEntities, ArrayList res,Integer level) { + collectByCreateDept.entrySet().forEach(s->{ + TaskStatisticsVo taskStatisticsVo = new TaskStatisticsVo(); + taskStatisticsVo.setCount(s.getValue().size()); + BigDecimal bigDecimal=BigDecimal.valueOf(s.getValue().size()).divide(BigDecimal.valueOf(fdpTaskEntities.size())); + taskStatisticsVo.setPercentage(bigDecimal.toString()); + taskStatisticsVo.setLevel(level); + R deptNameCode = sysClient.getDeptName(s.getKey()); + String deptName; + if (deptNameCode.isSuccess()){ + deptName=deptNameCode.getData(); + }else { + deptName=""; + } + taskStatisticsVo.setName(key+"-"+deptName); + res.add(taskStatisticsVo); + }); + } }