7 changed files with 244 additions and 1 deletions
@ -0,0 +1,78 @@ |
|||||
|
package com.zdxt.enforcementcode.controller.web.supervision.report; |
||||
|
|
||||
|
|
||||
|
import cn.dev33.satoken.annotation.SaIgnore; |
||||
|
import com.zdxt.enforcementcode.domain.bo.EnforcementRegistrationBo; |
||||
|
import com.zdxt.enforcementcode.domain.bo.dashboard.DashboardEnterpriseCheckListBo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.report.DashboardEnterpriseCheckListVo; |
||||
|
import com.zdxt.enforcementcode.report.ILawEnfOfficerService; |
||||
|
import jakarta.servlet.http.HttpServletResponse; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.dromara.common.excel.utils.ExcelUtil; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 执法人员情况 |
||||
|
*/ |
||||
|
@SaIgnore |
||||
|
@Slf4j |
||||
|
@Validated |
||||
|
@RequiredArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("/web/supervision/report/lawEnfOfficer") |
||||
|
public class LawEnfOfficerController { |
||||
|
|
||||
|
private final ILawEnfOfficerService lawEnfOfficerService; |
||||
|
|
||||
|
/** |
||||
|
* 重点企业-分页列表查询 |
||||
|
*/ |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo<EnforcementRegistrationVo> list(EnforcementRegistrationBo bo, PageQuery pageQuery) { |
||||
|
return lawEnfOfficerService.selectLawEnfOfficerPageList( pageQuery,bo); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 重点企业-查询详情 |
||||
|
* @param bo |
||||
|
* @param pageQuery |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/details") |
||||
|
public TableDataInfo<EnforcementRegistrationVo> detatils(EnforcementRegistrationBo bo, PageQuery pageQuery){ |
||||
|
TableDataInfo<EnforcementRegistrationVo> list=lawEnfOfficerService.selectLawEnfOfficerDetailsPageList(pageQuery,bo); |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 重点企业-导出Excel |
||||
|
*/ |
||||
|
@PostMapping("/export") |
||||
|
public void export(EnforcementRegistrationBo bo, HttpServletResponse response) { |
||||
|
try { |
||||
|
List<EnforcementRegistrationVo> list = lawEnfOfficerService.selectLawEnfOfficerList(bo); |
||||
|
ExcelUtil.exportExcel(list, "重点企业", EnforcementRegistrationVo.class, response); |
||||
|
} catch (Exception e) { |
||||
|
log.error("导出重点企业Excel异常", e); |
||||
|
response.reset(); |
||||
|
response.setContentType("application/json; charset=utf-8"); |
||||
|
try { |
||||
|
response.getWriter().write("{\"code\":500,\"msg\":\"导出失败: " + e.getMessage() + "\"}"); |
||||
|
} catch (Exception ignored) { |
||||
|
log.error("响应重置异常", ignored); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.zdxt.enforcementcode.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.zdxt.enforcementcode.domain.bo.EnforcementRegistrationBo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface LawEnfOfficerMapper { |
||||
|
|
||||
|
Page<EnforcementRegistrationVo> selectLawEnfOfficerPageList(@Param("page") Page<EnforcementRegistrationVo> page, |
||||
|
@Param("bo") EnforcementRegistrationBo bo); |
||||
|
|
||||
|
List<EnforcementRegistrationVo> selectLawEnfOfficerList(@Param("bo") EnforcementRegistrationBo bo); |
||||
|
|
||||
|
Page<EnforcementRegistrationVo> selectLawEnfOfficerDetailsPageList(@Param("page") Page<EnforcementRegistrationVo> page, |
||||
|
@Param("bo") EnforcementRegistrationBo bo); |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.zdxt.enforcementcode.report; |
||||
|
|
||||
|
|
||||
|
import com.zdxt.enforcementcode.domain.bo.EnforcementRegistrationBo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface ILawEnfOfficerService { |
||||
|
|
||||
|
TableDataInfo<EnforcementRegistrationVo> selectLawEnfOfficerPageList(PageQuery pageQuery, EnforcementRegistrationBo bo); |
||||
|
|
||||
|
List<EnforcementRegistrationVo> selectLawEnfOfficerList(EnforcementRegistrationBo bo); |
||||
|
|
||||
|
TableDataInfo<EnforcementRegistrationVo> selectLawEnfOfficerDetailsPageList(PageQuery pageQuery,EnforcementRegistrationBo bo); |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.zdxt.enforcementcode.report.impl; |
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.zdxt.enforcementcode.domain.bo.EnforcementRegistrationBo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo; |
||||
|
import com.zdxt.enforcementcode.mapper.LawEnfOfficerMapper; |
||||
|
import com.zdxt.enforcementcode.report.ILawEnfOfficerService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
@Service |
||||
|
@RequiredArgsConstructor |
||||
|
public class LawEnfOfficerSericeImpl implements ILawEnfOfficerService { |
||||
|
|
||||
|
private final LawEnfOfficerMapper lawEnfOfficerMapper; |
||||
|
@Override |
||||
|
public TableDataInfo<EnforcementRegistrationVo> selectLawEnfOfficerPageList(PageQuery pageQuery, EnforcementRegistrationBo bo) { |
||||
|
Page<EnforcementRegistrationVo> list=lawEnfOfficerMapper.selectLawEnfOfficerPageList(pageQuery.build(),bo); |
||||
|
return TableDataInfo.build(list); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<EnforcementRegistrationVo> selectLawEnfOfficerList(EnforcementRegistrationBo bo) { |
||||
|
return lawEnfOfficerMapper.selectLawEnfOfficerList(bo); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public TableDataInfo<EnforcementRegistrationVo> selectLawEnfOfficerDetailsPageList(PageQuery pageQuery, EnforcementRegistrationBo bo) { |
||||
|
Page<EnforcementRegistrationVo> list=lawEnfOfficerMapper.selectLawEnfOfficerDetailsPageList(pageQuery.build(),bo); |
||||
|
return TableDataInfo.build(list); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,82 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper |
||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.zdxt.enforcementcode.mapper.LawEnfOfficerMapper"> |
||||
|
|
||||
|
<sql id="selectLawEnfOfficerSql"> |
||||
|
select |
||||
|
t1.lawEnforcerId, |
||||
|
t1.lawEnforcer, |
||||
|
t1.bureauDeptId, |
||||
|
t1.bureauDeptName, |
||||
|
t1.zfcs, |
||||
|
t4.name as districtName |
||||
|
from |
||||
|
( |
||||
|
select |
||||
|
law_enforcer_id as lawEnforcerId, |
||||
|
law_enforcer as lawEnforcer, |
||||
|
bureau_dept_id as bureauDeptId, |
||||
|
bureau_dept_name as bureauDeptName, |
||||
|
count(1) as zfcs |
||||
|
from |
||||
|
enforcement_registration t1 |
||||
|
<where> |
||||
|
t1.is_submit = 1 |
||||
|
and t1.is_delete = 0 |
||||
|
and t1.enterprise_name is not null |
||||
|
and t1.enterprise_number is not null |
||||
|
<if test="bo.lawEnforcer !=null and bo.lawEnforcer !=''"> |
||||
|
and t1.law_enforcer LIKE CONCAT('%', #{bo.lawEnforcer}, '%') |
||||
|
</if> |
||||
|
<if test="bo.enforcementTime!=null"> |
||||
|
and DATE_FORMAT(t1.enforcement_time,'%Y-%m') = DATE_FORMAT(#{bo.enforcementTime},'%Y-%m') |
||||
|
</if> |
||||
|
</where> |
||||
|
group by |
||||
|
lawEnforcerId, |
||||
|
lawEnforcer, |
||||
|
bureauDeptId, |
||||
|
bureauDeptName) t1 |
||||
|
left join sys_user t2 on |
||||
|
t1.lawEnforcerId = t2.user_id |
||||
|
left join sys_dept t3 on |
||||
|
t2.dept_id = t3.dept_id |
||||
|
left join dashboard_area_info t4 on |
||||
|
t3.area_node = t4.code |
||||
|
and t4.level = 3 |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectLawEnfOfficerPageList" resultType="com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo"> |
||||
|
<include refid="selectLawEnfOfficerSql"/> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectLawEnfOfficerList" resultType="com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo"> |
||||
|
<include refid="selectLawEnfOfficerSql"/> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectLawEnfOfficerDetailsPageList" resultType="com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo"> |
||||
|
select |
||||
|
t1.bureau_dept_id as bureauDeptId, |
||||
|
t1.bureau_dept_name as bureauDeptName, |
||||
|
t1.law_enforcer_id as lawEnforcerId, |
||||
|
t1.law_enforcer as lawEnforcer, |
||||
|
t1.law_enforcer_id_two as lawEnforcerIdTwo, |
||||
|
t1.law_enforcer_two as lawEnforcerTwo, |
||||
|
t1.enforcement_time as enforcementTime, |
||||
|
t1.enterprise_number as enterpriseNumber, |
||||
|
t1.enterprise_name as enterpriseName, |
||||
|
t1.law_enforcement_item_text as lawEnforcementItemText |
||||
|
from enforcement_registration t1 |
||||
|
<where> |
||||
|
<if test="bo.lawEnforcerId !=null and bo.lawEnforcerId!=''"> |
||||
|
and t1.law_enforcer_id=#{bo.lawEnforcerId} |
||||
|
</if> |
||||
|
</where> |
||||
|
and t1.is_submit =1 |
||||
|
and t1.is_delete = 0 |
||||
|
and t1.enterprise_name is not null |
||||
|
and t1.enterprise_number is not null |
||||
|
</select> |
||||
|
</mapper> |
||||
Loading…
Reference in new issue