|
@ -1,5 +1,16 @@ |
|
|
package com.epmet.datareport.controller.screen; |
|
|
package com.epmet.datareport.controller.screen; |
|
|
|
|
|
|
|
|
|
|
|
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; |
|
|
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
|
|
import com.epmet.datareport.service.screen.IndexService; |
|
|
|
|
|
import com.epmet.screen.dto.form.MonthPieChartFormDTO; |
|
|
|
|
|
import com.epmet.screen.dto.form.YearAverageIndexFormDTO; |
|
|
|
|
|
import com.epmet.screen.dto.result.MonthPieChartResultDTO; |
|
|
|
|
|
import com.epmet.screen.dto.result.YearAverageIndexResultDTO; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
@ -12,4 +23,35 @@ import org.springframework.web.bind.annotation.RestController; |
|
|
@RestController |
|
|
@RestController |
|
|
@RequestMapping("/screen/index") |
|
|
@RequestMapping("/screen/index") |
|
|
public class IndexController { |
|
|
public class IndexController { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IndexService indexService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Description 1、年度平均指数 |
|
|
|
|
|
* @param yearAverageIndexFormDTO |
|
|
|
|
|
* @author zxc |
|
|
|
|
|
* @date 2020/8/19 2:53 下午 |
|
|
|
|
|
*/ |
|
|
|
|
|
@ExternalAppRequestAuth |
|
|
|
|
|
@PostMapping("yearaverageindex") |
|
|
|
|
|
public Result<YearAverageIndexResultDTO> yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ |
|
|
|
|
|
ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); |
|
|
|
|
|
return new Result<YearAverageIndexResultDTO>().ok(indexService.yearAverageIndex(yearAverageIndexFormDTO)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Description 2、月度指数分析-饼状图 |
|
|
|
|
|
* @param monthPieChartFormDTO |
|
|
|
|
|
* @author zxc |
|
|
|
|
|
* @date 2020/8/19 3:17 下午 |
|
|
|
|
|
*/ |
|
|
|
|
|
@ExternalAppRequestAuth |
|
|
|
|
|
@PostMapping("monthindexanalysis/piechart") |
|
|
|
|
|
public Result<MonthPieChartResultDTO> monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ |
|
|
|
|
|
ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class); |
|
|
|
|
|
return new Result<MonthPieChartResultDTO>().ok(indexService.monthPieChart(monthPieChartFormDTO)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|