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 @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());
SysDeptVo bureauDept = sysDeptService.iterationDeptParentToBureau(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; 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);
} }

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 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
<where> <if test="bo.isDelete != null">
and is_submit=1 AND is_delete = #{bo.isDelete}
<if test="bo.enterpriseId != null and bo.enterpriseId != ''"> and enterprise_id = #{bo.enterpriseId}</if> </if>
<if test="bo.enterpriseName != null and bo.enterpriseName != ''"> and enterprise_name like concat('%', #{bo.enterpriseName}, '%')</if> <if test="bo.dateType != null and bo.dateType == 1">
<if test="bo.enterpriseNumber != null and bo.enterpriseNumber != ''"> and enterprise_number = #{bo.enterpriseNumber}</if> AND enforcement_time &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01')
<if test="bo.isDelete != null "> and is_delete = #{bo.isDelete}</if> </if>
<if test="bo.status != null "> and status = #{bo.status}</if> <if test="bo.dateType != null and bo.dateType == 2">
<if test="bo.unionNo != null and bo.unionNo != ''"> and union_no = #{bo.unionNo}</if> AND enforcement_time &gt;= CONCAT(YEAR(CURDATE()), '-', LPAD(QUARTER(CURDATE())*3-2, 2, '0'), '-01')
<if test="bo.hasUnion != null"> and has_union = #{bo.hasUnion}</if> </if>
<if test="bo.isRealUnion != null"> and is_real_union = #{bo.isRealUnion}</if> <if test="bo.dateType != null and bo.dateType == 3">
<if test="bo.hasAuto != null"> and has_auto = #{bo.hasAuto}</if> AND enforcement_time &gt;= CONCAT(YEAR(CURDATE()), '-01-01')
<if test="bo.searchValue != null and bo.searchValue != ''"> </if>
and ( enterprise_name like concat('%',#{bo.searchValue},'%'))</if> <if test="bo.beginTime != null and bo.beginTime != ''">
<if test="bo.dateSearch != null and bo.dateSearch != ''"> AND enforcement_time &gt;= #{bo.beginTime}
and DATE_FORMAT(enforcement_time, '%Y-%m') = #{bo.dateSearch} </if>
</if> <if test="bo.endTime != null and bo.endTime != ''">
<if test="bo.dateType != null and bo.dateType == 1"> AND enforcement_time &lt;= #{bo.endTime}
and DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') </if>
</if> <if test="bo.bureauDeptId != null and bo.bureauDeptId != ''">
<if test="bo.dateType != null and bo.dateType == 2"> AND bureau_dept_id = #{bo.bureauDeptId}
AND DATE_FORMAT(enforcement_time, '%Y-%m') &gt;= CONCAT(YEAR(CURDATE()), '-', </if>
CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' GROUP BY enterprise_number
WHEN QUARTER(CURDATE()) IN (2) THEN '04' ) ent_count ON er.enterprise_number = ent_count.enterprise_number
WHEN QUARTER(CURDATE()) IN (3) THEN '07' <where>
ELSE '10' END) er.is_submit = 1
and DATE_FORMAT(enforcement_time, '%Y-%m') &lt;= CONCAT(YEAR(CURDATE()), '-', <if test="bo.enterpriseId != null and bo.enterpriseId != ''">
CASE AND er.enterprise_id = #{bo.enterpriseId}
WHEN QUARTER(CURDATE()) IN (1) THEN '03' </if>
WHEN QUARTER(CURDATE()) IN (2) THEN '06' <if test="bo.enterpriseName != null and bo.enterpriseName != ''">
WHEN QUARTER(CURDATE()) IN (3) THEN '09' AND er.enterprise_name LIKE CONCAT('%', #{bo.enterpriseName}, '%')
ELSE '12' </if>
END) <if test="bo.enterpriseNumber != null and bo.enterpriseNumber != ''">
</if> AND er.enterprise_number = #{bo.enterpriseNumber}
<if test="bo.dateType != null and bo.dateType == 3"> </if>
and DATE_FORMAT(enforcement_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y') <if test="bo.isDelete != null">
</if> AND er.is_delete = #{bo.isDelete}
<if test="bo.dateSearch != null and bo.dateSearch != ''"> </if>
and DATE_FORMAT(enforcement_time, '%Y-%m') = #{bo.dateSearch} <if test="bo.status != null">
</if> AND er.status = #{bo.status}
<if test="bo.beginTime != null and bo.beginTime != ''"><!-- 开始时间检索 --> </if>
and DATE_FORMAT(enforcement_time,'%Y-%m-%d') &gt;= #{bo.beginTime} <if test="bo.unionNo != null and bo.unionNo != ''">
</if> AND er.union_no = #{bo.unionNo}
<if test="bo.endTime != null and bo.endTime != ''"><!-- 结束时间检索 --> </if>
and DATE_FORMAT(enforcement_time,'%Y-%m-%d') &lt;= #{bo.endTime} <if test="bo.hasUnion != null">
</if> AND er.has_union = #{bo.hasUnion}
<if test="bo.params.beginTime != null and bo.params.beginTime != ''"><!-- 开始时间检索 --> </if>
and enforcement_time &gt;= #{bo.params.beginTime} <if test="bo.isRealUnion != null">
</if> AND er.is_real_union = #{bo.isRealUnion}
<if test="bo.params.endTime != null and bo.params.endTime != ''"><!-- 结束时间检索 --> </if>
and enforcement_time &lt;= #{bo.params.endTime} <if test="bo.hasAuto != null">
</if> AND er.has_auto = #{bo.hasAuto}
<if test="(bo.userId != null and bo.userId != '') and (bo.bureauDeptId == null or bo.bureauDeptId == '')"> </if>
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 test="bo.searchValue != null and bo.searchValue != ''">
</if> AND er.enterprise_name LIKE CONCAT('%', #{bo.searchValue}, '%')
<if test="bo.bureauDeptId != null and bo.bureauDeptId != ''"> </if>
and bureau_dept_id = #{bo.bureauDeptId} <if test="bo.dateSearch != null and bo.dateSearch != ''">
</if> AND er.enforcement_time &gt;= CONCAT(#{bo.dateSearch}, '-01')
<!-- 注释掉数据权限过滤,避免 token 冻结导致的认证错误 --> AND er.enforcement_time &lt; DATE_ADD(CONCAT(#{bo.dateSearch}, '-01'), INTERVAL 1 MONTH)
<!-- <if test="bo.params.dataScope != null and bo.params.dataScope != ''"> </if>
<!- - 数据范围过滤 - -> <if test="bo.dateType != null and bo.dateType == 1">
${bo.params.dataScope} AND er.enforcement_time &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01')
</if> --> </if>
</where> <if test="bo.dateType != null and bo.dateType == 2">
GROUP BY enterprise_number order by enforcement_time desc) t 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> <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