| | |
| | | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.controller.all.BaseQueryController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.ctrl.CountEntity; |
| | | import com.lf.server.entity.sys.ReportEntity; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | |
| | | @RestController |
| | | @RequestMapping("/dataCount") |
| | | public class DataCountController extends BaseController { |
| | | @Autowired |
| | | @Resource |
| | | ReportService reportService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | UploadAttachService uploadAttachService; |
| | | |
| | | @SysLog() |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "下载报告") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "报告ID", dataType = "Integer", paramType = "query", example = "18") |
| | | @ApiImplicitParam(name = "id", value = "报告ID", dataType = "Integer", paramType = "query", example = "18"), |
| | | @ApiImplicitParam(name = "code", value = "目录编码", dataType = "String", paramType = "query", example = "00"), |
| | | }) |
| | | @GetMapping(value = "/downloadReport") |
| | | public void downloadReport(Integer id, HttpServletRequest req, HttpServletResponse res) { |
| | | public void downloadReport(Integer id, String code, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == id || id < 1) { |
| | | return; |
| | |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | |
| | | reportService.createReport(ue, re, res); |
| | | reportService.createReport(ue, re, code, res); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "按项目统计数字线划图面积") |
| | | @GetMapping(value = "/countDlgAreaByPrj") |
| | | public ResponseMsg<Object> countDlgAreaByPrj() { |
| | | try { |
| | | List<CountEntity> list = reportService.countDlgAreaByPrj(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "按项目统计数字正射影像图面积") |
| | | @GetMapping(value = "/countDomAreaByPrj") |
| | | public ResponseMsg<Object> countDomAreaByPrj() { |
| | | try { |
| | | List<CountEntity> list = reportService.countDomAreaByPrj(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "按项目统计管线长度") |
| | | @GetMapping(value = "/countLineLength") |
| | | public ResponseMsg<Object> countLineLength() { |
| | | try { |
| | | List<CountEntity> list = reportService.countLineLength(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "按项目统计勘探点个数") |
| | | @GetMapping(value = "/countExplorationPointByPrj") |
| | | public ResponseMsg<Object> countExplorationPointByPrj() { |
| | | try { |
| | | List<CountEntity> list = reportService.countExplorationPointByPrj(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "按项目统计三维地质模型面积") |
| | | @GetMapping(value = "/countGeoModelAreaByPrj") |
| | | public ResponseMsg<Object> countGeoModelAreaByPrj() { |
| | | try { |
| | | List<CountEntity> list = reportService.countGeoModelAreaByPrj(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "按项目统计地灾点个数") |
| | | @GetMapping(value = "/countGeologicHazardByPrj") |
| | | public ResponseMsg<Object> countGeologicHazardByPrj() { |
| | | try { |
| | | List<CountEntity> list = reportService.countGeologicHazardByPrj(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "项目数据分类统计") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "code", value = "项目编码", dataType = "String", paramType = "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); |
| | | } |
| | | } |
| | | } |