| | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Map; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| | | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| | | |
| | | @Tag(name = "管理后台 - 决策支持 KPI") |
| | | @RestController |
| | |
| | | return success(decisionKpiService.refreshKpi(kpiCode)); |
| | | } |
| | | |
| | | @GetMapping("/trend/{kpiCode}") |
| | | @Operation(summary = "获取KPI历史快照趋势") |
| | | @PreAuthorize("@ss.hasPermission('bi:decision:kpi:query')") |
| | | public CommonResult<Map<String, Object>> getKpiTrend(@PathVariable("kpiCode") String kpiCode, |
| | | @RequestParam(value = "beginTime", required = false) |
| | | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| | | LocalDateTime beginTime, |
| | | @RequestParam(value = "endTime", required = false) |
| | | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| | | LocalDateTime endTime, |
| | | @RequestParam(value = "periodType", required = false) String periodType) { |
| | | return success(decisionKpiService.getKpiTrend(kpiCode, beginTime, endTime, periodType)); |
| | | } |
| | | |
| | | @GetMapping("/compare/{kpiCode}") |
| | | @Operation(summary = "获取KPI环比研判") |
| | | @PreAuthorize("@ss.hasPermission('bi:decision:kpi:query')") |
| | | public CommonResult<Map<String, Object>> getKpiCompare(@PathVariable("kpiCode") String kpiCode) { |
| | | return success(decisionKpiService.getKpiCompare(kpiCode)); |
| | | } |
| | | |
| | | } |