20 changed files with 305 additions and 40 deletions
@ -0,0 +1,95 @@ |
|||
package com.zdxt.enforcementcode.controller.web.supervision.report; |
|||
|
|||
|
|||
import cn.dev33.satoken.annotation.SaIgnore; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendStatAreaBo; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendStatDomainBo; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendStatQueryBo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationAreaVo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationDomainVo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardTrendStatAreaVo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardTrendStatDomainVo; |
|||
import com.zdxt.enforcementcode.service.IDashboardSituationTrendAreaService; |
|||
import com.zdxt.enforcementcode.service.IDashboardSituationTrendDomainService; |
|||
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/situationTrend") |
|||
public class SituationController { |
|||
|
|||
private final IDashboardSituationTrendAreaService situationTrendAreaService; |
|||
private final IDashboardSituationTrendDomainService situationTrendDomainService; |
|||
|
|||
|
|||
@GetMapping("/situationTrendAreaList") |
|||
public TableDataInfo<DashboardSituationAreaVo> querySituationTrendAreaPageList(DashboardTrendStatQueryBo bo, PageQuery pageQuery) { |
|||
return situationTrendAreaService.selectSituationTrendAreaPageList( bo,pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 重点企业-导出Excel |
|||
*/ |
|||
@PostMapping("/exportSituationTrendArea") |
|||
public void export(DashboardTrendStatQueryBo bo, HttpServletResponse response) { |
|||
try { |
|||
List<DashboardSituationAreaVo> list = situationTrendAreaService.querySituationTrendAreaList(bo); |
|||
ExcelUtil.exportExcel(list, "重点企业", DashboardSituationAreaVo.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); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 领域 |
|||
*/ |
|||
@GetMapping("/situationTrendDomainList") |
|||
public TableDataInfo<DashboardSituationDomainVo> selectSituationTrendDomainPageList(DashboardTrendStatQueryBo bo, PageQuery pageQuery) { |
|||
return situationTrendDomainService.selectSituationTrendDomainPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 重点企业-导出Excel |
|||
*/ |
|||
@PostMapping("/exportSituationTrendDomain") |
|||
public void exportDomain(DashboardTrendStatQueryBo bo, HttpServletResponse response) { |
|||
try { |
|||
List<DashboardSituationDomainVo> list = situationTrendDomainService.querySituationTrendDomainList(bo); |
|||
ExcelUtil.exportExcel(list, "重点企业", DashboardSituationDomainVo.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); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue