Browse Source

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

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

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

@ -109,8 +109,9 @@ public class AppEnforcementRegistrationController extends BaseController {
@SaIgnore @SaIgnore
@GetMapping("/queryList") @GetMapping("/queryList")
@ResponseBody @ResponseBody
public R<EnforcementRegistrationVo> queryList(EnforcementRegistrationBo bo) { public R<EnforcementRegistrationVo> queryList(EnforcementRegistrationBo bo, PageQuery pageQuery) {
// dateType本单位 0 全市 1 long startTime = System.currentTimeMillis();
if (Objects.nonNull(LoginHelper.getUserId()) && bo.getWarnType() == 0) { if (Objects.nonNull(LoginHelper.getUserId()) && bo.getWarnType() == 0) {
bo.setDeptId(LoginHelper.getDeptId() == null ? null : LoginHelper.getDeptId()); bo.setDeptId(LoginHelper.getDeptId() == null ? null : 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; int count = 0;
if (list.size() > 0) { if (!list.isEmpty()) {
count = list.stream() count = list.stream()
.map(item -> item.getNum()) .map(item -> item.getNum())
.filter(num -> num != null) .filter(num -> num != null)
@ -134,6 +162,12 @@ public class AppEnforcementRegistrationController extends BaseController {
EnforcementRegistrationVo result = new EnforcementRegistrationVo(); EnforcementRegistrationVo result = new EnforcementRegistrationVo();
result.setListCount(count); result.setListCount(count);
result.setList(list); 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); return R.ok(result);
} }

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

Loading…
Cancel
Save