41 lines
1.4 KiB
Java
41 lines
1.4 KiB
Java
package com.zioinfo.mro.dashboard;
|
|
|
|
import com.zioinfo.mro.common.ApiResponse;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* 대시보드 KPI 집계 API — 전부 조회 전용(GET, Viewer+). 순수 매퍼 집계로 타 도메인 클래스에 의존하지 않는다.
|
|
*/
|
|
@RestController
|
|
@RequestMapping("/api/mro/dashboard")
|
|
@RequiredArgsConstructor
|
|
public class DashboardController {
|
|
|
|
private final DashboardService service;
|
|
|
|
/** 설비·WO·재고·구매·다운타임 핵심 지표 단일 요약. */
|
|
@GetMapping("/summary")
|
|
public ApiResponse<Map<String, Object>> summary() {
|
|
return ApiResponse.ok(service.summary());
|
|
}
|
|
|
|
/** 작업지시 status 별 카운트 목록(GROUP BY status). */
|
|
@GetMapping("/wo-status")
|
|
public ApiResponse<List<Map<String, Object>>> woStatus() {
|
|
return ApiResponse.ok(service.woStatus());
|
|
}
|
|
|
|
/** 향후 N일 내 next_due_date 도래 PM 계획 목록(기본 7일). */
|
|
@GetMapping("/pm-due")
|
|
public ApiResponse<List<Map<String, Object>>> pmDue(@RequestParam(defaultValue = "7") int days) {
|
|
return ApiResponse.ok(service.pmDue(days));
|
|
}
|
|
}
|