diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml index 432259f..776535a 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml @@ -394,10 +394,10 @@ where t.id = u.task_id and t.is_deleted = 0 and u.is_deleted = 0 and u.user_id is not null - and t.PLAN_START_TIME >= #{startTime} + and t.CREATE_TIME >= #{startTime} - and t.PLAN_END_TIME <= #{endTime} + and t.CREATE_TIME <= #{endTime} AND t.CREATE_DEPT IN diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java index 3242e57..8504ca8 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java @@ -297,8 +297,8 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpl deptIdList = (List) params.get("deptId"); List operAccessTaskEntityList = this.list(new LambdaQueryWrapper() {{ - ge(OperAccessTaskEntity::getPlanStartTime, startDate); - le(OperAccessTaskEntity::getPlanStartTime, endDate); + ge(OperAccessTaskEntity::getCreateTime, startDate); + le(OperAccessTaskEntity::getCreateTime, endDate); in(OperAccessTaskEntity::getCreateDept, deptIdList); }}); List res =new ArrayList<>(); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java index c5eba9b..b6a472e 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java @@ -8,6 +8,7 @@ import com.hnac.hzims.common.invalid.ObjectRequiredInvalid; import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.operational.defect.entity.OperDefectEntity; import com.hnac.hzims.operational.defect.service.IOperDefectService; import com.hnac.hzims.operational.defect.vo.OperDefectVO; @@ -93,6 +94,9 @@ public class OperDefectController extends BladeController { BusinessType.GENCODE, action = "获取缺陷的统计月报") public R> getDefectStatistics(@ApiParam(value = "month 格式:2021-01", required = true) @RequestParam String month, @RequestParam String deptId) { + if(StringUtils.isEmpty(deptId)){ + return R.data(new HashMap<>()); + } Map defectStatistics = defectService.getDefectStatistics(month,deptId); return R.data(defectStatistics); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java index 1ebf282..0d62ff1 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java @@ -487,6 +487,9 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor fdpRunReportVO.setIndex(index); fdpRunReportVO.setLastBeginTime(fdpFaultHistoryDataEntity.getCreateTime()); fdpRunReportVO.setType("智能预警"); + fdpRunReportVO.setOrd(fdpFaultHistoryDataEntity.getOrd()); + List stationEntities = stationEntityList.stream().filter(s -> s.getCode().equals(fdpFaultHistoryDataEntity.getStation())).collect(Collectors.toList()); + fdpRunReportVO.setStation(stationEntities.get(0).getName()); fdpRunReportVO.setContent(fdpFaultHistoryDataEntity.getName()); fdpRunReportVO.setNum(String.valueOf(fdpFaultHistoryDataEntities.size())); fdpRunReportVO.setReason(fdpFaultHistoryDataEntity.getDiagReason()); @@ -1222,11 +1225,17 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor List inspectReportVOList = stationReportAllVo.getInspectReportVOList(); int completeInspectTaskNum =inspectReportVOList.stream().filter(vo ->"合计".equals(vo.getUserName())).mapToInt(RunReportVO::getCompleteNum).sum(); int incompleteInspectTaskNum =inspectReportVOList.stream().filter(vo ->"合计".equals(vo.getUserName())).mapToInt(RunReportVO::getIncompleteNum).sum(); + int sum=completeInspectTaskNum+incompleteInspectTaskNum; + Double rate =0.0; + if (sum!=0){ + rate=new BigDecimal(completeInspectTaskNum).divide(new BigDecimal(sum),4,BigDecimal.ROUND_UP) + .multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_UP).doubleValue(); + } if (completeInspectTaskNum == 0 && incompleteInspectTaskNum == 0) { conclusion.append("3、无巡检任务;\r\n"); } else { - String inspectTaskConclusion = "3、%s个巡检任务,已执行%s个巡检任务。"; - conclusion.append(String.format(inspectTaskConclusion, (completeInspectTaskNum + incompleteInspectTaskNum), completeInspectTaskNum)).append(";\r\n"); + String inspectTaskConclusion = "3、%s个巡检任务,已执行%s个巡检任务,完成率%s%%"; + conclusion.append(String.format(inspectTaskConclusion, sum, completeInspectTaskNum,rate)).append(";\r\n"); } } else { conclusion.append("3、无巡检任务;\r\n"); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/FDPRunReportVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/FDPRunReportVO.java index 0b40dc2..7f59d7f 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/FDPRunReportVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/FDPRunReportVO.java @@ -22,6 +22,11 @@ public class FDPRunReportVO implements Serializable { @ApiModelProperty("告警内容") private String content; + @ApiModelProperty("告警位置") + private String ord; + + @ApiModelProperty("站点") + private String station; @ApiModelProperty("告警类型") private String type;