diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java index e392517..82eb207 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java @@ -1,6 +1,7 @@ package com.biutag.supervision.controller.datav; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.biutag.supervision.mapper.DataCaseVerifMapper; @@ -133,8 +134,8 @@ public class DataVCaseVerifController { CaseVerificationCountVo overview = negativeMapper.getAllCaseVerificationCount(beginTime, endTime); long total =dataCaseVerifMapper.selectCount(new LambdaQueryWrapper().between(DataCaseVerif::getCreateTime,beginTime,endTime)); overview.setTotal((int) total); - overview.setRate((double) ((overview.getConfirmed() / total ) * 100)); - +// overview.setRate((double) ((overview.getConfirmed() / total * 100) )); + overview.setRate(NumberUtil.div((Number) overview.getConfirmed(),total * 100).doubleValue()); JSONObject res = new JSONObject().fluentPut("overview", overview); return Result.success(res); } @@ -157,7 +158,8 @@ public class DataVCaseVerifController { caseVerificationMapList =caseVerificationMapList.stream().map(s->{ long total =dataCaseVerifMapper.selectCount(new LambdaQueryWrapper().between(DataCaseVerif::getCreateTime,beginTime,finalEndTime)); s.setTotal((int) total); - s.setRate((double) ((s.getConfirmed() / total ) * 100)); + + s.setRate(NumberUtil.div((Number) s.getConfirmed(),total * 100).doubleValue()); return s; }).toList(); JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList); diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index a1f0a7c..05d6f80 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -298,15 +298,14 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT " + - "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2), ng.id, NULL) ) AS confirmed, " + + "COUNT( ng.id ) AS confirmed, " + "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2), ng.id, NULL) ) AS dealCasePro, " + "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2) && nb.type = 'personal' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL) ) AS punishPre, " + "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2) && nb.type = 'department' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL) ) AS punishOrg " + - "FROM negative ng " + "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + "WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + - "AND problemSourcesCode in (17, 18, 19, 20) ") + "AND ng. problemSourcesCode in (17, 18, 19, 20) ") CaseVerificationCountVo getAllCaseVerificationCount(Date beginTime, Date endTime);