Browse Source

cim-大屏总览修改

dev
niujiyi 2 weeks ago
parent
commit
add59fd205
  1. 13
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/cim/CimDashboardOverviewController.java
  2. 5
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/vo/CimDashboardOverviewVo.java
  3. 118
      zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/CimDashboardOverviewMapper.xml

13
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 之间相除是整数除法会截断小数,必须先转 BigDecimal 再 divide,并指定 4 位小数
Long xzzfCount = cimDashboardOverviewService.getEnfRegistrationCount(bo);
vo.setRqyjl(xzzfCount-(lhzfsCount+ddbmzfCount));
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);
}

5
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;
/**
* 编码

118
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
<where>
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
<if test="dayTime !=null">
and DATE_FORMAT(t1.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d')
</if>
@ -274,7 +281,7 @@
<!-- 获取单独部门执法 (实)-->
<select id="getSepDeptLawCount" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo" resultType="java.lang.Long">
select
<!--select
(
select
count(1)
@ -286,8 +293,15 @@
t2.area_node = t3.code
<where>
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.dept_id is not null
and t1.law_enforcer_id is not null
and t1.law_enforcer_id_other is not null
and t1.law_enforcement_type is not null
and t1.bureau_dept_id is not null
<if test="dayTime !=null">
and DATE_FORMAT(t1.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d')
</if>
@ -310,8 +324,15 @@
t2.area_node = t3.code
<where>
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.dept_id is not null
and t1.law_enforcer_id is not null
and t1.law_enforcer_id_other is not null
and t1.law_enforcement_type is not null
and t1.bureau_dept_id is not null
and t1.union_no is not null
and t1.union_no != ''
<if test="dayTime !=null">
@ -322,13 +343,40 @@
</if>
</where>
GROUP BY t1.union_no HAVING COUNT(1) &lt; 2) as t
)
)-->
select
count(1)
from
enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.is_submit = 1
and t1.law_enforcement_id is not null
and t1.enterprise_name is not null
and t1.enterprise_number 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 t1.is_real_union = 0
<if test="dayTime !=null">
and DATE_FORMAT(t1.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d')
</if>
<if test="code !=null and code!='' and code!='20220210190102183-D7DD-E31F5E9C1'">
and t3.code = #{code}
</if>
</where>
</select>
<!-- 联合检查数量统计 (实)-->
<select id="getUnionLawCount" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo" resultType="java.lang.Long">
SELECT
<!--SELECT
COUNT(1) AS lhjcs
FROM (
SELECT
@ -340,8 +388,15 @@
t2.area_node = t3.code
<where>
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.dept_id is not null
and t1.law_enforcer_id is not null
and t1.law_enforcer_id_other is not null
and t1.law_enforcement_type is not null
and t1.bureau_dept_id is not null
and t1.union_no IS NOT NULL
and t1.union_no != ''
<if test="dayTime !=null">
@ -359,7 +414,40 @@
</where>
GROUP BY t1.union_no
HAVING COUNT(1) &gt; 1
) AS t
) AS t-->
select
COUNT(distinct union_no) as lhjcs
from
enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.union_no is not null
and t1.is_submit = 1
and t1.law_enforcement_id is not null
and t1.enterprise_name is not null
and t1.enterprise_number 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 is_real_union = 1
<if test="dayTime !=null">
and DATE_FORMAT(t1.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d')
</if>
<if test="code !=null and code!='' and code!='20220210190102183-D7DD-E31F5E9C1'">
and t3.code = #{code}
</if>
<if test="monthTime !=null">
and DATE_FORMAT(t1.enforcement_time,'%Y-%m') = DATE_FORMAT(#{monthTime},'%Y-%m')
</if>
<if test="enterpriseNumber !=null and enterpriseNumber !=''">
and t1.enterprise_number = #{enterpriseNumber}
</if>
</where>
</select>
<!-- 获取区域检查趋势分析(季度) -->
@ -561,8 +649,16 @@
<where>
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
<if test="dayTime !=null">
and DATE_FORMAT(t2.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d')
</if>
@ -595,8 +691,12 @@
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
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
<if test="dayTime !=null">
and DATE_FORMAT(t1.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d')
</if>
@ -614,8 +714,12 @@
t3.area_node = t4.code
<where>
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
<if test="dayTime !=null">
and DATE_FORMAT(t2.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d')
</if>

Loading…
Cancel
Save