From 2958656d5023a9d89fc7868ce70ae6056e6dc143 Mon Sep 17 00:00:00 2001 From: pengwei Date: Wed, 28 May 2025 19:08:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=A1=88=E4=BB=B6?= =?UTF-8?q?=E6=A0=B8=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/datav/DataVCaseVerifController.java | 8 +++++--- .../com/biutag/supervision/mapper/NegativeMapper.java | 5 ++--- 2 files changed, 7 insertions(+), 6 deletions(-) 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);