执行重构加入镀锌线1的后端调用接口
This commit is contained in:
@@ -2,16 +2,7 @@ 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.OeeEventVo;
|
||||
import com.klp.da.service.IOeeReportService;
|
||||
import com.klp.da.service.OeeSummaryJobService;
|
||||
import com.klp.da.service.OeeTheoryCycleJobService;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -25,8 +16,6 @@ import java.util.Map;
|
||||
/**
|
||||
* OEE 报表聚合 Controller(方式 A:后端统一聚合多服务)
|
||||
*
|
||||
* 当前仅提供接口“架子”,具体聚合逻辑在 {@link IOeeReportService} 中实现。
|
||||
*
|
||||
* 路由前缀与 docs/oee-report-design.md 设计文档保持一致:
|
||||
* - /api/ems/oee/line/summary
|
||||
* - /api/ems/oee/line/loss7
|
||||
@@ -39,92 +28,6 @@ import java.util.Map;
|
||||
@RequestMapping("/oee/line")
|
||||
public class OeeReportController extends BaseController {
|
||||
|
||||
private final IOeeReportService oeeReportService;
|
||||
private final OeeTheoryCycleJobService oeeTheoryCycleJobService;
|
||||
private final OeeSummaryJobService oeeSummaryJobService;
|
||||
|
||||
/**
|
||||
* KPI + 趋势汇总
|
||||
*/
|
||||
@Log(title = "OEE 报表-汇总", businessType = BusinessType.OTHER)
|
||||
@GetMapping("/summary")
|
||||
public R<List<OeeLineSummaryVo>> summary(OeeQueryBo queryBo) {
|
||||
return R.ok(oeeReportService.summary(queryBo));
|
||||
}
|
||||
|
||||
/**
|
||||
* KPI + 趋势汇总(异步任务):立即返回 jobId,通过 WebSocket 推送进度与结果。
|
||||
*
|
||||
* 前端订阅:
|
||||
* ws://{host}/websocket?type={wsType}
|
||||
*/
|
||||
@Log(title = "OEE 报表-汇总(异步)", businessType = BusinessType.OTHER)
|
||||
@GetMapping("/summary/job")
|
||||
public R<Map<String, Object>> summaryJob(OeeQueryBo queryBo) {
|
||||
System.out.println("[OEE][summary][job][controller] request received, thread=" + Thread.currentThread().getName()
|
||||
+ ", startDate=" + (queryBo == null ? null : queryBo.getStartDate())
|
||||
+ ", endDate=" + (queryBo == null ? null : queryBo.getEndDate())
|
||||
+ ", lineIds=" + (queryBo == null ? null : queryBo.getLineIds()));
|
||||
Map<String, Object> resp = oeeSummaryJobService.createAndStart(queryBo);
|
||||
System.out.println("[OEE][summary][job][controller] job created, resp=" + resp);
|
||||
return R.ok(resp);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 理论节拍回归(散点+拟合线)
|
||||
*
|
||||
* 说明:该接口用于前端绘制“散点+回归折线”的图形,节拍数据来源于 WMS 回归结果。
|
||||
*/
|
||||
@Log(title = "OEE 报表-理论节拍回归", businessType = BusinessType.OTHER)
|
||||
@GetMapping("/theoryCycle/regression")
|
||||
public R<Map<String, Object>> theoryCycleRegression(OeeQueryBo queryBo) {
|
||||
return R.ok(oeeReportService.theoryCycleRegression(queryBo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 理论节拍回归(异步任务):立即返回 jobId,通过 WebSocket 推送进度与结果。
|
||||
*
|
||||
* 前端订阅:
|
||||
* ws://{host}/websocket?type={wsType}
|
||||
*/
|
||||
@Log(title = "OEE 报表-理论节拍回归(异步)", businessType = BusinessType.OTHER)
|
||||
@GetMapping("/theoryCycle/regression/job")
|
||||
public R<Map<String, Object>> theoryCycleRegressionJob(OeeQueryBo queryBo) {
|
||||
System.out.println("[OEE][theoryCycle][job][controller] request received, thread=" + Thread.currentThread().getName()
|
||||
+ ", startTime=" + (queryBo == null ? null : queryBo.getStartTime())
|
||||
+ ", endTime=" + (queryBo == null ? null : queryBo.getEndTime())
|
||||
+ ", lineIds=" + (queryBo == null ? null : queryBo.getLineIds()));
|
||||
Map<String, Object> resp = oeeTheoryCycleJobService.createAndStart(queryBo);
|
||||
System.out.println("[OEE][theoryCycle][job][controller] job created, resp=" + resp);
|
||||
return R.ok(resp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
占位文件,无需使用。
|
||||
|
||||
Reference in New Issue
Block a user