Browse Source

fix: 优化案件核查

master
pengwei 6 months ago
parent
commit
2958656d50
  1. 8
      src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java
  2. 5
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java

8
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<DataCaseVerif>().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<DataCaseVerif>().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);

5
src/main/java/com/biutag/supervision/mapper/NegativeMapper.java

@ -298,15 +298,14 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@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);

Loading…
Cancel
Save