package com.terra.system.controller.data;
|
|
import com.terra.system.annotation.SysLog;
|
import com.terra.system.controller.all.BaseController;
|
import com.terra.system.entity.all.ResponseMsg;
|
import com.terra.system.entity.ctrl.CountEntity;
|
import com.terra.system.entity.sys.ReportEntity;
|
import com.terra.system.entity.sys.UserEntity;
|
import com.terra.system.helper.StringHelper;
|
import com.terra.system.service.all.UploadAttachService;
|
import com.terra.system.service.sys.ReportService;
|
import com.terra.system.service.sys.TokenService;
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameters;
|
|
import javax.annotation.Resource;
|
|
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import org.springframework.web.bind.annotation.*;
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.List;
|
|
/**
|
* 数据统计
|
* @author WWW
|
*/
|
@Tag(name = "数据管理\\数据统计")
|
@RestController
|
@RequestMapping("/dataCount")
|
public class DataCountController extends BaseController {
|
@Resource
|
ReportService reportService;
|
|
@Resource
|
TokenService tokenService;
|
|
@Resource
|
UploadAttachService uploadAttachService;
|
|
@SysLog()
|
@Operation(summary = "分页查询并返回记录数")
|
@Parameters({
|
@Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, example = ""),
|
@Parameter(name = "code", description = "编码", in = ParameterIn.QUERY, example = "countOperates"),
|
@Parameter(name = "pageSize", description = "每页条数", in = ParameterIn.QUERY, example = "10"),
|
@Parameter(name = "pageIndex", description = "分页数(从1开始)", in = ParameterIn.QUERY, example = "1")
|
})
|
@GetMapping(value = "/selectByPageAndCount")
|
public ResponseMsg<List<ReportEntity>> selectByPageAndCount(String name, String code, Integer pageSize, Integer pageIndex) {
|
try {
|
if (pageSize < 1 || pageIndex < 1) {
|
return fail("每页页数或分页数小于1", null);
|
}
|
|
int count = reportService.selectCount(name, code);
|
if (count == 0) {
|
return success(0, null);
|
}
|
|
List<ReportEntity> rs = reportService.selectByPage(name, code, pageSize, pageSize * (pageIndex - 1));
|
|
return success(count, rs);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "查询数据量统计")
|
@GetMapping(value = "/selectCountSizes")
|
public ResponseMsg<Object> selectCountSizes() {
|
try {
|
List<CountEntity> list = reportService.countSizes();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按文件类型统计")
|
@GetMapping(value = "/countSizesByType")
|
public ResponseMsg<Object> countSizesByType() {
|
try {
|
List<CountEntity> list = reportService.countSizesByType();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "查询服务调用量统计")
|
@GetMapping(value = "/selectCountServices")
|
public ResponseMsg<Object> selectCountServices() {
|
try {
|
List<CountEntity> list = reportService.countServices();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "查询用户流量统计")
|
@GetMapping(value = "/selectCountOperates")
|
public ResponseMsg<Object> selectCountOperates() {
|
try {
|
List<CountEntity> list = reportService.countOperates();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计数据")
|
@GetMapping(value = "/countSizesByPrj")
|
public ResponseMsg<Object> countSizesByPrj() {
|
try {
|
List<CountEntity> list = reportService.countSizesByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计钻孔数据")
|
@GetMapping(value = "/countExplorationPoints")
|
public ResponseMsg<Object> countExplorationPoints() {
|
try {
|
List<CountEntity> list = reportService.countExplorationPoints();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "下载报告")
|
@Parameters({
|
@Parameter(name = "id", description = "报告ID", in = ParameterIn.QUERY, example = "18"),
|
@Parameter(name = "code", description = "目录编码", in = ParameterIn.QUERY, example = "00"),
|
})
|
@GetMapping(value = "/downloadReport")
|
public void downloadReport(Integer id, String code, HttpServletRequest req, HttpServletResponse res) {
|
try {
|
if (null == id || id < 1) {
|
return;
|
}
|
|
ReportEntity re = reportService.selectById(id);
|
if (null == re || StringHelper.isEmpty(re.getGuid()) || StringHelper.isEmpty(re.getType()) || StringHelper.isEmpty(re.getCode())) {
|
return;
|
}
|
|
UserEntity ue = tokenService.getCurrentUser(req);
|
|
reportService.createReport(ue, re, code, res);
|
} catch (Exception ex) {
|
log.error(ex.getMessage(), ex);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计数字高程模型面积")
|
@GetMapping(value = "/countDemAreaByPrj")
|
public ResponseMsg<Object> countDemAreaByPrj() {
|
try {
|
List<CountEntity> list = reportService.countDemAreaByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计三维地形模型面积")
|
@GetMapping(value = "/countMptAreaByPrj")
|
public ResponseMsg<Object> countMptAreaByPrj() {
|
try {
|
List<CountEntity> list = reportService.countMptAreaByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计倾斜摄影模型面积")
|
@GetMapping(value = "/countOsgbAreaByPrj")
|
public ResponseMsg<Object> countOsgbAreaByPrj() {
|
try {
|
List<CountEntity> list = reportService.countOsgbAreaByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计激光点云模型面积")
|
@GetMapping(value = "/countLasAreaByPrj")
|
public ResponseMsg<Object> countLasAreaByPrj() {
|
try {
|
List<CountEntity> list = reportService.countLasAreaByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计勘察工点个数")
|
@GetMapping(value = "/countSurveyWorksiteByPrj")
|
public ResponseMsg<Object> countSurveyWorksiteByPrj() {
|
try {
|
List<CountEntity> list = reportService.countSurveyWorksiteByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计勘察报告个数")
|
@GetMapping(value = "/countExplorationReportByPrj")
|
public ResponseMsg<Object> countExplorationReportByPrj() {
|
try {
|
List<CountEntity> list = reportService.countExplorationReportByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计崩塌个数")
|
@GetMapping(value = "/countCollapseByPrj")
|
public ResponseMsg<Object> countCollapseByPrj() {
|
try {
|
List<CountEntity> list = reportService.countCollapseByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计泥石流个数")
|
@GetMapping(value = "/countDebrisFlowByPrj")
|
public ResponseMsg<Object> countDebrisFlowByPrj() {
|
try {
|
List<CountEntity> list = reportService.countDebrisFlowByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计地面塌陷个数")
|
@GetMapping(value = "/countGroundCollapseByPrj")
|
public ResponseMsg<Object> countGroundCollapseByPrj() {
|
try {
|
List<CountEntity> list = reportService.countGroundCollapseByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计高陡边坡个数")
|
@GetMapping(value = "/countHighSteepSlopeByPrj")
|
public ResponseMsg<Object> countHighSteepSlopeByPrj() {
|
try {
|
List<CountEntity> list = reportService.countHighSteepSlopeByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计滑坡个数")
|
@GetMapping(value = "/countLandSlideByPrj")
|
public ResponseMsg<Object> countLandSlideByPrj() {
|
try {
|
List<CountEntity> list = reportService.countLandSlideByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计不稳定斜坡个数")
|
@GetMapping(value = "/countUnstableSlopeByPrj")
|
public ResponseMsg<Object> countUnstableSlopeByPrj() {
|
try {
|
List<CountEntity> list = reportService.countUnstableSlopeByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计水毁个数")
|
@GetMapping(value = "/countWaterDamageByPrj")
|
public ResponseMsg<Object> countWaterDamageByPrj() {
|
try {
|
List<CountEntity> list = reportService.countWaterDamageByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计数字线划图面积")
|
@GetMapping(value = "/countDlgAreaByPrj")
|
public ResponseMsg<Object> countDlgAreaByPrj() {
|
try {
|
List<CountEntity> list = reportService.countDlgAreaByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计数字正射影像图面积")
|
@GetMapping(value = "/countDomAreaByPrj")
|
public ResponseMsg<Object> countDomAreaByPrj() {
|
try {
|
List<CountEntity> list = reportService.countDomAreaByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计管线长度")
|
@GetMapping(value = "/countLineLength")
|
public ResponseMsg<Object> countLineLength() {
|
try {
|
List<CountEntity> list = reportService.countLineLength();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计勘探点个数")
|
@GetMapping(value = "/countExplorationPointByPrj")
|
public ResponseMsg<Object> countExplorationPointByPrj() {
|
try {
|
List<CountEntity> list = reportService.countExplorationPointByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计三维地质模型面积")
|
@GetMapping(value = "/countGeoModelAreaByPrj")
|
public ResponseMsg<Object> countGeoModelAreaByPrj() {
|
try {
|
List<CountEntity> list = reportService.countGeoModelAreaByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "按项目统计地灾点个数")
|
@GetMapping(value = "/countGeologicHazardByPrj")
|
public ResponseMsg<Object> countGeologicHazardByPrj() {
|
try {
|
List<CountEntity> list = reportService.countGeologicHazardByPrj();
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
|
@SysLog()
|
@Operation(summary = "项目数据分类统计")
|
@Parameters({
|
@Parameter(name = "code", description = "项目编码", in = ParameterIn.QUERY, example = "0B")
|
})
|
@GetMapping(value = "/countVariousDataByPrj")
|
public ResponseMsg<Object> countVariousDataByPrj(String code) {
|
try {
|
if (StringHelper.isEmpty(code)) {
|
return fail("项目编码不能为空");
|
}
|
|
List<CountEntity> list = reportService.countVariousDataByPrj(code);
|
|
return success(list);
|
} catch (Exception ex) {
|
return fail(ex, null);
|
}
|
}
|
}
|