diff --git a/zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/cim/CimDashboardOverviewController.java b/zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/cim/CimDashboardOverviewController.java index 894427f8..7f8f3799 100644 --- a/zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/cim/CimDashboardOverviewController.java +++ b/zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/cim/CimDashboardOverviewController.java @@ -10,6 +10,9 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + +import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.Date; import java.util.List; @@ -78,9 +81,15 @@ public class CimDashboardOverviewController { //被执法企业 Long bzfqyCount= cimDashboardOverviewService.getSubLawEntCount(bo); vo.setBzfqy(bzfqyCount); - //入企压减率 - Long xzzfCount= cimDashboardOverviewService.getEnfRegistrationCount(bo); - vo.setRqyjl(xzzfCount-(lhzfsCount+ddbmzfCount)); + //入企压减率 = (行政执法数 - (联合执法数 + 单独部门执法数)) / 行政执法数 + //Long 之间相除是整数除法会截断小数,必须先转 BigDecimal 再 divide,并指定 4 位小数 + Long xzzfCount = cimDashboardOverviewService.getEnfRegistrationCount(bo); + if (xzzfCount == null || xzzfCount == 0) { + vo.setRqyjl(BigDecimal.ZERO); + } else { + vo.setRqyjl(BigDecimal.valueOf(xzzfCount - (lhzfsCount + ddbmzfCount)) + .divide(BigDecimal.valueOf(xzzfCount), 4, RoundingMode.HALF_UP)); + } return R.ok(vo); } diff --git a/zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/vo/CimDashboardOverviewVo.java b/zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/vo/CimDashboardOverviewVo.java index 970fdcc8..8084b804 100644 --- a/zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/vo/CimDashboardOverviewVo.java +++ b/zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/vo/CimDashboardOverviewVo.java @@ -1,11 +1,13 @@ package com.zdxt.enforcementcode.domain.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import com.zdxt.enforcementcode.domain.bean.DashboardOverview; import io.github.linpeilie.annotations.AutoMapping; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; +import java.math.BigDecimal; import java.util.Date; @Data @@ -108,7 +110,8 @@ public class CimDashboardOverviewVo { /** * 入企压减率 */ - private Long rqyjl; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#.0000") + private BigDecimal rqyjl; /** * 编码 diff --git a/zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/CimDashboardOverviewMapper.xml b/zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/CimDashboardOverviewMapper.xml index 2bd4285a..9747c186 100644 --- a/zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/CimDashboardOverviewMapper.xml +++ b/zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/CimDashboardOverviewMapper.xml @@ -256,10 +256,17 @@ left join dashboard_area_info t3 on t2.area_node = t3.code - t1.is_delete = 0 - and t1.is_submit = 1 + t1.is_submit = 1 + and t1.is_delete = 0 and t1.enterprise_name is not null and t1.enterprise_number is not null + and t1.bureau_dept_name is not null + and t1.law_enforcement_id is not null + and t1.law_enforcer is not null + and t1.law_enforcer_two is not null + and t1.is_complaint is not null + and t1.check_category is not null + and t1.bureau_dept_id is not null and DATE_FORMAT(t1.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d') @@ -274,7 +281,7 @@ @@ -561,8 +649,16 @@ t1.dict_type = 'law_enforce_category' and t2.is_submit = 1 + and t2.is_delete = 0 and t2.enterprise_name is not null and t2.enterprise_number is not null + and t2.bureau_dept_name is not null + and t2.law_enforcement_id is not null + and t2.law_enforcer is not null + and t2.law_enforcer_two is not null + and t2.is_complaint is not null + and t2.check_category is not null + and t2.bureau_dept_id is not null and DATE_FORMAT(t2.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d') @@ -595,8 +691,12 @@ left join dashboard_area_info t3 on t2.area_node = t3.code - t1.enterprise_name is not null + t1.bureau_dept_name is not null + and t1.dept_id is not null + and t1.enterprise_name is not null and t1.enterprise_number is not null + and t1.law_enforcer_id is not null + and t1.bureau_dept_id is not null and DATE_FORMAT(t1.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d') @@ -614,8 +714,12 @@ t3.area_node = t4.code t1.dict_type = 'no_check_category' + and t2.bureau_dept_name is not null + and t2.dept_id is not null and t2.enterprise_name is not null and t2.enterprise_number is not null + and t2.law_enforcer_id is not null + and t2.bureau_dept_id is not null and DATE_FORMAT(t2.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d')