Browse Source

巡检记录增加完成率

zhongwei
ty 1 year ago
parent
commit
d3e19ed246
  1. 3
      hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/VoteChartVo.java
  2. 7
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java
  3. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java

3
hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/VoteChartVo.java

@ -36,4 +36,7 @@ public class VoteChartVo {
@ApiModelProperty(value = "完成id") @ApiModelProperty(value = "完成id")
@ExcelIgnore @ExcelIgnore
private List<Long> finishIds; private List<Long> finishIds;
@ApiModelProperty(value = "完成率")
@ExcelProperty(value = "完成率", index = 3)
private Double finishRate;
} }

7
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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
@ -1162,6 +1163,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp
voteChartVo.setFinishIds(finishIds); voteChartVo.setFinishIds(finishIds);
voteChartVo.setUndoneNum(undoneIds.size()); voteChartVo.setUndoneNum(undoneIds.size());
voteChartVo.setUndoneIds(undoneIds); 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; return voteChartVo;
} }

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java

@ -799,6 +799,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) { if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) {
deptList = res.getData().stream().map(Dept::getId).map(s -> s.toString()).collect(Collectors.toList()); deptList = res.getData().stream().map(Dept::getId).map(s -> s.toString()).collect(Collectors.toList());
} else { } else {
log.error("getCurrentMonthStatic"+"用户权限问题");
throw new WebServiceException("该用户没有此权限"); throw new WebServiceException("该用户没有此权限");
} }
if (StringUtil.isNotBlank(deptId)) { if (StringUtil.isNotBlank(deptId)) {

Loading…
Cancel
Save