diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/VoteChartVo.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/VoteChartVo.java index 788f4cd..adbf9b0 100644 --- a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/VoteChartVo.java +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/VoteChartVo.java @@ -36,4 +36,7 @@ public class VoteChartVo { @ApiModelProperty(value = "完成id") @ExcelIgnore private List finishIds; + @ApiModelProperty(value = "完成率") + @ExcelProperty(value = "完成率", index = 3) + private Double finishRate; } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java index 16b509d..4da0a75 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java @@ -54,6 +54,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; @@ -1162,6 +1163,12 @@ public class TaskServiceImpl extends BaseServiceImpl imp voteChartVo.setFinishIds(finishIds); voteChartVo.setUndoneNum(undoneIds.size()); voteChartVo.setUndoneIds(undoneIds); + if (CollectionUtil.isEmpty(list)||CollectionUtil.isEmpty(undoneIds)){ + voteChartVo.setFinishRate(0.00d); + }else { + BigDecimal divide = new BigDecimal(list.size()).divide(new BigDecimal(list.size()),2,BigDecimal.ROUND_UP); + voteChartVo.setFinishRate( divide.doubleValue()); + } return voteChartVo; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java index 859102e..cdcd04c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java @@ -799,6 +799,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl s.toString()).collect(Collectors.toList()); } else { + log.error("getCurrentMonthStatic"+"用户权限问题"); throw new WebServiceException("该用户没有此权限"); } if (StringUtil.isNotBlank(deptId)) {