Browse Source

执法端-企业的执法记录页面一直显示加载的图标

dev-V1.0.1
niujiyi 3 months ago
parent
commit
66870c7505
  1. 44
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/app/enforcement/AppEnforcementRegistrationController.java
  2. 264
      zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/EnforcementRegistrationMapper.xml

44
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/app/enforcement/AppEnforcementRegistrationController.java

@ -109,9 +109,10 @@ public class AppEnforcementRegistrationController extends BaseController {
@SaIgnore
@GetMapping("/queryList")
@ResponseBody
public R<EnforcementRegistrationVo> queryList(EnforcementRegistrationBo bo) {
// dateType本单位 0 全市 1
if (Objects.nonNull( LoginHelper.getUserId()) && bo.getWarnType()==0) {
public R<EnforcementRegistrationVo> queryList(EnforcementRegistrationBo bo, PageQuery pageQuery) {
long startTime = System.currentTimeMillis();
if (Objects.nonNull(LoginHelper.getUserId()) && bo.getWarnType() == 0) {
bo.setDeptId(LoginHelper.getDeptId() == null ? null : LoginHelper.getDeptId());
SysDeptVo bureauDept = sysDeptService.iterationDeptParentToBureau(LoginHelper.getDeptId());
@ -120,10 +121,37 @@ public class AppEnforcementRegistrationController extends BaseController {
}
}
List<EnforcementRegistrationVo> list = enforcementRegistrationService.selectEnforcementRegistrationList(bo);
if (pageQuery.getPageSize() == null || pageQuery.getPageSize() <= 0) {
pageQuery.setPageSize(50);
}
if (pageQuery.getPageNum() == null || pageQuery.getPageNum() <= 0) {
pageQuery.setPageNum(1);
}
if (bo.getWarnType() != null && bo.getWarnType() == 1) {
if (StringUtils.isBlank(bo.getDateSearch()) && bo.getDateType() == null
&& StringUtils.isBlank(bo.getBeginTime()) && StringUtils.isBlank(bo.getEndTime())) {
bo.setDateType(3);
log.warn("查询全市数据时未指定时间范围,默认限制为本年数据");
}
if (pageQuery.getPageSize() > 100) {
pageQuery.setPageSize(100);
log.warn("查询全市数据限制最大页大小为100");
}
}
TableDataInfo<EnforcementRegistrationVo> pageResult = DataPermissionHelper.ignore(() ->
enforcementRegistrationService.queryPageList(bo, pageQuery)
);
List<EnforcementRegistrationVo> list = pageResult.getRows();
if (list == null) {
list = new ArrayList<>();
}
int count = 0;
if (list.size() > 0) {
if (!list.isEmpty()) {
count = list.stream()
.map(item -> item.getNum())
.filter(num -> num != null)
@ -134,6 +162,12 @@ public class AppEnforcementRegistrationController extends BaseController {
EnforcementRegistrationVo result = new EnforcementRegistrationVo();
result.setListCount(count);
result.setList(list);
long endTime = System.currentTimeMillis();
log.info("执法登记列表查询耗时: {}ms, 查询类型: {}, 数据量: {}, 总数: {}, 页码: {}/{}",
(endTime - startTime), bo.getWarnType() == 1 ? "全市" : "本单位",
list.size(), count, pageQuery.getPageNum(), pageResult.getTotal());
return R.ok(result);
}

264
zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/EnforcementRegistrationMapper.xml

@ -438,136 +438,156 @@
<select id="selectEnforcementRegistrationList" parameterType="com.zdxt.enforcementcode.domain.bo.EnforcementRegistrationBo" resultType="com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo">
select
*
from
(
select
id,
law_enforcement,
law_enforcement_id,
enforce,
enterprise_id,
enterprise_name,
enterprise_number,
enforcement_time,
create_time,
create_by,
law_enforcer,
law_enforcer_id,
law_enforcer_tel,
law_enforcer_two,
law_enforcer_id_two,
law_enforcer_tel_two,
subsidiaryer,
subsidiaryer_id,
subsidiaryer_tel,
law_enforcement_item,
law_enforcement_item_text,
law_enforcement_basis,
law_enforcement_basis_text,
remark,
reslut,
user_id,
dept_id,
is_delete,
status,
law_enforcement_code,
is_complaint,
is_submit,
unite_check,
check_css,
enforce_reason,
law_field,
check_category,
bureau_dept_id,
bureau_dept_name,
is_evaluate,
law_id,
law_text,
count(enterprise_number) as num
from
enforcement_registration
<where>
and is_submit=1
<if test="bo.enterpriseId != null and bo.enterpriseId != ''"> and enterprise_id = #{bo.enterpriseId}</if>
<if test="bo.enterpriseName != null and bo.enterpriseName != ''"> and enterprise_name like concat('%', #{bo.enterpriseName}, '%')</if>
<if test="bo.enterpriseNumber != null and bo.enterpriseNumber != ''"> and enterprise_number = #{bo.enterpriseNumber}</if>
<if test="bo.isDelete != null "> and is_delete = #{bo.isDelete}</if>
<if test="bo.status != null "> and status = #{bo.status}</if>
<if test="bo.unionNo != null and bo.unionNo != ''"> and union_no = #{bo.unionNo}</if>
<if test="bo.hasUnion != null"> and has_union = #{bo.hasUnion}</if>
<if test="bo.isRealUnion != null"> and is_real_union = #{bo.isRealUnion}</if>
<if test="bo.hasAuto != null"> and has_auto = #{bo.hasAuto}</if>
<if test="bo.searchValue != null and bo.searchValue != ''">
and ( enterprise_name like concat('%',#{bo.searchValue},'%'))</if>
<if test="bo.dateSearch != null and bo.dateSearch != ''">
and DATE_FORMAT(enforcement_time, '%Y-%m') = #{bo.dateSearch}
</if>
<if test="bo.dateType != null and bo.dateType == 1">
and DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
</if>
<if test="bo.dateType != null and bo.dateType == 2">
AND DATE_FORMAT(enforcement_time, '%Y-%m') &gt;= CONCAT(YEAR(CURDATE()), '-',
CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01'
WHEN QUARTER(CURDATE()) IN (2) THEN '04'
WHEN QUARTER(CURDATE()) IN (3) THEN '07'
ELSE '10' END)
and DATE_FORMAT(enforcement_time, '%Y-%m') &lt;= CONCAT(YEAR(CURDATE()), '-',
CASE
WHEN QUARTER(CURDATE()) IN (1) THEN '03'
WHEN QUARTER(CURDATE()) IN (2) THEN '06'
WHEN QUARTER(CURDATE()) IN (3) THEN '09'
ELSE '12'
END)
</if>
<if test="bo.dateType != null and bo.dateType == 3">
and DATE_FORMAT(enforcement_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y')
</if>
<if test="bo.dateSearch != null and bo.dateSearch != ''">
and DATE_FORMAT(enforcement_time, '%Y-%m') = #{bo.dateSearch}
</if>
<if test="bo.beginTime != null and bo.beginTime != ''"><!-- 开始时间检索 -->
and DATE_FORMAT(enforcement_time,'%Y-%m-%d') &gt;= #{bo.beginTime}
</if>
<if test="bo.endTime != null and bo.endTime != ''"><!-- 结束时间检索 -->
and DATE_FORMAT(enforcement_time,'%Y-%m-%d') &lt;= #{bo.endTime}
</if>
<if test="bo.params.beginTime != null and bo.params.beginTime != ''"><!-- 开始时间检索 -->
and enforcement_time &gt;= #{bo.params.beginTime}
</if>
<if test="bo.params.endTime != null and bo.params.endTime != ''"><!-- 结束时间检索 -->
and enforcement_time &lt;= #{bo.params.endTime}
</if>
<if test="(bo.userId != null and bo.userId != '') and (bo.bureauDeptId == null or bo.bureauDeptId == '')">
and (law_enforcer_id = #{bo.userId} or user_id = #{bo.userId} or law_enforcer_id = #{bo.userId} or FIND_IN_SET(#{bo.userId}, law_enforcer_id_two))
</if>
<if test="bo.bureauDeptId != null and bo.bureauDeptId != ''">
and bureau_dept_id = #{bo.bureauDeptId}
</if>
<!-- 注释掉数据权限过滤,避免 token 冻结导致的认证错误 -->
<!-- <if test="bo.params.dataScope != null and bo.params.dataScope != ''">
<!- - 数据范围过滤 - ->
${bo.params.dataScope}
</if> -->
</where>
GROUP BY enterprise_number order by enforcement_time desc) t
SELECT * FROM (
SELECT
er.id,
er.law_enforcement,
er.law_enforcement_id,
er.enforce,
er.enterprise_id,
er.enterprise_name,
er.enterprise_number,
er.enforcement_time,
er.create_time,
er.create_by,
er.law_enforcer,
er.law_enforcer_id,
er.law_enforcer_tel,
er.law_enforcer_two,
er.law_enforcer_id_two,
er.law_enforcer_tel_two,
er.subsidiaryer,
er.subsidiaryer_id,
er.subsidiaryer_tel,
er.law_enforcement_item,
er.law_enforcement_item_text,
er.law_enforcement_basis,
er.law_enforcement_basis_text,
er.remark,
er.reslut,
er.user_id,
er.dept_id,
er.is_delete,
er.status,
er.law_enforcement_code,
er.is_complaint,
er.is_submit,
er.unite_check,
er.check_css,
er.enforce_reason,
er.law_field,
er.check_category,
er.bureau_dept_id,
er.bureau_dept_name,
er.is_evaluate,
er.law_id,
er.law_text,
COALESCE(ent_count.cnt, 0) as num
FROM enforcement_registration er
LEFT JOIN (
SELECT enterprise_number, COUNT(*) as cnt
FROM enforcement_registration
WHERE is_submit = 1
<if test="bo.isDelete != null">
AND is_delete = #{bo.isDelete}
</if>
<if test="bo.dateType != null and bo.dateType == 1">
AND enforcement_time &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01')
</if>
<if test="bo.dateType != null and bo.dateType == 2">
AND enforcement_time &gt;= CONCAT(YEAR(CURDATE()), '-', LPAD(QUARTER(CURDATE())*3-2, 2, '0'), '-01')
</if>
<if test="bo.dateType != null and bo.dateType == 3">
AND enforcement_time &gt;= CONCAT(YEAR(CURDATE()), '-01-01')
</if>
<if test="bo.beginTime != null and bo.beginTime != ''">
AND enforcement_time &gt;= #{bo.beginTime}
</if>
<if test="bo.endTime != null and bo.endTime != ''">
AND enforcement_time &lt;= #{bo.endTime}
</if>
<if test="bo.bureauDeptId != null and bo.bureauDeptId != ''">
AND bureau_dept_id = #{bo.bureauDeptId}
</if>
GROUP BY enterprise_number
) ent_count ON er.enterprise_number = ent_count.enterprise_number
<where>
er.is_submit = 1
<if test="bo.enterpriseId != null and bo.enterpriseId != ''">
AND er.enterprise_id = #{bo.enterpriseId}
</if>
<if test="bo.enterpriseName != null and bo.enterpriseName != ''">
AND er.enterprise_name LIKE CONCAT('%', #{bo.enterpriseName}, '%')
</if>
<if test="bo.enterpriseNumber != null and bo.enterpriseNumber != ''">
AND er.enterprise_number = #{bo.enterpriseNumber}
</if>
<if test="bo.isDelete != null">
AND er.is_delete = #{bo.isDelete}
</if>
<if test="bo.status != null">
AND er.status = #{bo.status}
</if>
<if test="bo.unionNo != null and bo.unionNo != ''">
AND er.union_no = #{bo.unionNo}
</if>
<if test="bo.hasUnion != null">
AND er.has_union = #{bo.hasUnion}
</if>
<if test="bo.isRealUnion != null">
AND er.is_real_union = #{bo.isRealUnion}
</if>
<if test="bo.hasAuto != null">
AND er.has_auto = #{bo.hasAuto}
</if>
<if test="bo.searchValue != null and bo.searchValue != ''">
AND er.enterprise_name LIKE CONCAT('%', #{bo.searchValue}, '%')
</if>
<if test="bo.dateSearch != null and bo.dateSearch != ''">
AND er.enforcement_time &gt;= CONCAT(#{bo.dateSearch}, '-01')
AND er.enforcement_time &lt; DATE_ADD(CONCAT(#{bo.dateSearch}, '-01'), INTERVAL 1 MONTH)
</if>
<if test="bo.dateType != null and bo.dateType == 1">
AND er.enforcement_time &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01')
</if>
<if test="bo.dateType != null and bo.dateType == 2">
AND er.enforcement_time &gt;= CONCAT(YEAR(CURDATE()), '-', LPAD(QUARTER(CURDATE())*3-2, 2, '0'), '-01')
</if>
<if test="bo.dateType != null and bo.dateType == 3">
AND er.enforcement_time &gt;= CONCAT(YEAR(CURDATE()), '-01-01')
</if>
<if test="bo.beginTime != null and bo.beginTime != ''">
AND er.enforcement_time &gt;= #{bo.beginTime}
</if>
<if test="bo.endTime != null and bo.endTime != ''">
AND er.enforcement_time &lt;= #{bo.endTime}
</if>
<if test="bo.params.beginTime != null and bo.params.beginTime != ''">
AND er.enforcement_time &gt;= #{bo.params.beginTime}
</if>
<if test="bo.params.endTime != null and bo.params.endTime != ''">
AND er.enforcement_time &lt;= #{bo.params.endTime}
</if>
<if test="(bo.userId != null and bo.userId != '') and (bo.bureauDeptId == null or bo.bureauDeptId == '')">
AND (er.law_enforcer_id = #{bo.userId} OR er.user_id = #{bo.userId} OR FIND_IN_SET(#{bo.userId}, er.law_enforcer_id_two))
</if>
<if test="bo.bureauDeptId != null and bo.bureauDeptId != ''">
AND er.bureau_dept_id = #{bo.bureauDeptId}
</if>
</where>
) t
<where>
<if test="bo.numLeft != null and bo.numLeft != ''">
and t.num &gt;= #{bo.numLeft}
AND t.num &gt;= #{bo.numLeft}
</if>
<if test="bo.numRight != null and bo.numRight != ''">
and t.num &lt;= #{bo.numRight}
AND t.num &lt;= #{bo.numRight}
</if>
<if test="bo.num != null and bo.num != ''">
and t.num &gt;= #{bo.num}
AND t.num &gt;= #{bo.num}
</if>
<!-- <if test="bo.deptId != null and bo.warnType!=null and bo.warnType ==0" >
and t.bureau_dept_id = #{bo.deptId}
</if>-->
<!-- 数据范围过滤 -->
</where>
order by t.num desc
ORDER BY t.num DESC, t.enforcement_time DESC
</select>
<!-- 统计当前用户作为执法人员的执法登记总数 -->

Loading…
Cancel
Save