Browse Source

修正:月报统计修改

zhongwei
ty 6 months ago
parent
commit
e260edb960
  1. 4
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml
  2. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java
  3. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java
  4. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java
  5. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/FDPRunReportVO.java

4
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 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
<if test="startTime != null"> <if test="startTime != null">
and t.PLAN_START_TIME &gt;= #{startTime} and t.CREATE_TIME &gt;= #{startTime}
</if> </if>
<if test="endTime != null"> <if test="endTime != null">
and t.PLAN_END_TIME &lt;= #{endTime} and t.CREATE_TIME &lt;= #{endTime}
</if> </if>
<if test="list != null"> <if test="list != null">
AND t.CREATE_DEPT IN AND t.CREATE_DEPT IN

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java

@ -297,8 +297,8 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpl<OperAccessTaskMap
LocalDate endDate = LocalDate.parse(params.get("endDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE)); LocalDate endDate = LocalDate.parse(params.get("endDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE));
List<Long> deptIdList = (List<Long>) params.get("deptId"); List<Long> deptIdList = (List<Long>) params.get("deptId");
List<OperAccessTaskEntity> operAccessTaskEntityList = this.list(new LambdaQueryWrapper<OperAccessTaskEntity>() {{ List<OperAccessTaskEntity> operAccessTaskEntityList = this.list(new LambdaQueryWrapper<OperAccessTaskEntity>() {{
ge(OperAccessTaskEntity::getPlanStartTime, startDate); ge(OperAccessTaskEntity::getCreateTime, startDate);
le(OperAccessTaskEntity::getPlanStartTime, endDate); le(OperAccessTaskEntity::getCreateTime, endDate);
in(OperAccessTaskEntity::getCreateDept, deptIdList); in(OperAccessTaskEntity::getCreateDept, deptIdList);
}}); }});
List<AccessRunReportVO> res =new ArrayList<>(); List<AccessRunReportVO> res =new ArrayList<>();

4
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.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType; 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.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.service.IOperDefectService; import com.hnac.hzims.operational.defect.service.IOperDefectService;
import com.hnac.hzims.operational.defect.vo.OperDefectVO; import com.hnac.hzims.operational.defect.vo.OperDefectVO;
@ -93,6 +94,9 @@ public class OperDefectController extends BladeController {
BusinessType.GENCODE, BusinessType.GENCODE,
action = "获取缺陷的统计月报") action = "获取缺陷的统计月报")
public R<Map<String, Object>> getDefectStatistics(@ApiParam(value = "month 格式:2021-01", required = true) @RequestParam String month, @RequestParam String deptId) { public R<Map<String, Object>> getDefectStatistics(@ApiParam(value = "month 格式:2021-01", required = true) @RequestParam String month, @RequestParam String deptId) {
if(StringUtils.isEmpty(deptId)){
return R.data(new HashMap<>());
}
Map<String, Object> defectStatistics = defectService.getDefectStatistics(month,deptId); Map<String, Object> defectStatistics = defectService.getDefectStatistics(month,deptId);
return R.data(defectStatistics); return R.data(defectStatistics);
} }

13
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.setIndex(index);
fdpRunReportVO.setLastBeginTime(fdpFaultHistoryDataEntity.getCreateTime()); fdpRunReportVO.setLastBeginTime(fdpFaultHistoryDataEntity.getCreateTime());
fdpRunReportVO.setType("智能预警"); fdpRunReportVO.setType("智能预警");
fdpRunReportVO.setOrd(fdpFaultHistoryDataEntity.getOrd());
List<StationEntity> stationEntities = stationEntityList.stream().filter(s -> s.getCode().equals(fdpFaultHistoryDataEntity.getStation())).collect(Collectors.toList());
fdpRunReportVO.setStation(stationEntities.get(0).getName());
fdpRunReportVO.setContent(fdpFaultHistoryDataEntity.getName()); fdpRunReportVO.setContent(fdpFaultHistoryDataEntity.getName());
fdpRunReportVO.setNum(String.valueOf(fdpFaultHistoryDataEntities.size())); fdpRunReportVO.setNum(String.valueOf(fdpFaultHistoryDataEntities.size()));
fdpRunReportVO.setReason(fdpFaultHistoryDataEntity.getDiagReason()); fdpRunReportVO.setReason(fdpFaultHistoryDataEntity.getDiagReason());
@ -1222,11 +1225,17 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
List<RunReportVO> inspectReportVOList = stationReportAllVo.getInspectReportVOList(); List<RunReportVO> inspectReportVOList = stationReportAllVo.getInspectReportVOList();
int completeInspectTaskNum =inspectReportVOList.stream().filter(vo ->"合计".equals(vo.getUserName())).mapToInt(RunReportVO::getCompleteNum).sum(); 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 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) { if (completeInspectTaskNum == 0 && incompleteInspectTaskNum == 0) {
conclusion.append("3、无巡检任务;\r\n"); conclusion.append("3、无巡检任务;\r\n");
} else { } else {
String inspectTaskConclusion = "3、%s个巡检任务,已执行%s个巡检任务。"; String inspectTaskConclusion = "3、%s个巡检任务,已执行%s个巡检任务,完成率%s%%";
conclusion.append(String.format(inspectTaskConclusion, (completeInspectTaskNum + incompleteInspectTaskNum), completeInspectTaskNum)).append(";\r\n"); conclusion.append(String.format(inspectTaskConclusion, sum, completeInspectTaskNum,rate)).append(";\r\n");
} }
} else { } else {
conclusion.append("3、无巡检任务;\r\n"); conclusion.append("3、无巡检任务;\r\n");

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/FDPRunReportVO.java

@ -22,6 +22,11 @@ public class FDPRunReportVO implements Serializable {
@ApiModelProperty("告警内容") @ApiModelProperty("告警内容")
private String content; private String content;
@ApiModelProperty("告警位置")
private String ord;
@ApiModelProperty("站点")
private String station;
@ApiModelProperty("告警类型") @ApiModelProperty("告警类型")
private String type; private String type;

Loading…
Cancel
Save