添加OEE内容
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
package com.klp.da.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.da.domain.bo.OeeQueryBo;
|
||||
import com.klp.da.domain.vo.OeeLineSummaryVo;
|
||||
import com.klp.da.domain.vo.OeeLossCategorySummaryVo;
|
||||
import com.klp.da.domain.vo.OeeLossReasonVo;
|
||||
import com.klp.da.domain.vo.OeeEventVo;
|
||||
import com.klp.da.service.IOeeReportService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* OEE 报表聚合 Controller(方式 A:后端统一聚合多服务)
|
||||
*
|
||||
* 当前仅提供接口“架子”,具体聚合逻辑在 {@link IOeeReportService} 中实现。
|
||||
*
|
||||
* 路由前缀与 docs/oee-report-design.md 设计文档保持一致:
|
||||
* - /api/ems/oee/line/summary
|
||||
* - /api/ems/oee/line/loss7
|
||||
* - /api/ems/oee/line/events
|
||||
* - /api/ems/oee/line/exportWord
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oee/line")
|
||||
public class OeeReportController extends BaseController {
|
||||
|
||||
private final IOeeReportService oeeReportService;
|
||||
|
||||
/**
|
||||
* KPI + 趋势汇总
|
||||
*/
|
||||
@Log(title = "OEE 报表-汇总", businessType = BusinessType.OTHER)
|
||||
@GetMapping("/summary")
|
||||
public R<List<OeeLineSummaryVo>> summary(OeeQueryBo queryBo) {
|
||||
return R.ok(oeeReportService.summary(queryBo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 7 大损失汇总
|
||||
*/
|
||||
@Log(title = "OEE 报表-7大损失", businessType = BusinessType.OTHER)
|
||||
@GetMapping("/loss7")
|
||||
public R<Map<String, Object>> lossSummary(OeeQueryBo queryBo) {
|
||||
Map<String, Object> result = oeeReportService.lossSummary(queryBo);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停机/损失事件明细
|
||||
*/
|
||||
@Log(title = "OEE 报表-事件明细", businessType = BusinessType.OTHER)
|
||||
@GetMapping("/events")
|
||||
public TableDataInfo<OeeEventVo> events(OeeQueryBo queryBo, PageQuery pageQuery) {
|
||||
return oeeReportService.events(queryBo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出 Word 报表(整体版式由后端模板控制)
|
||||
*/
|
||||
@Log(title = "OEE 报表-导出Word", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/exportWord")
|
||||
public void exportWord(OeeQueryBo queryBo, HttpServletResponse response) {
|
||||
oeeReportService.exportWord(queryBo, response);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user