Files
FTC25009/ruoyi-admin/src/main/java/com/ruoyi/kpi/controller/KpiController.java

116 lines
4.1 KiB
Java

package com.ruoyi.kpi.controller;
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.kpi.domain.InAnalysisDataQuery;
import com.ruoyi.kpi.domain.OutAnalysisDataQuery;
import com.ruoyi.kpi.domain.RoadwayAnalysisQuery;
import com.ruoyi.kpi.service.KpiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
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.RestController;
/**
* KPI分析Controller
*
* @author ruoyi
* @date 2026-05-18
*/
@RestController
@RequestMapping("/kpi")
public class KpiController extends BaseController
{
@Autowired
private KpiService kpiService;
/**
* 入库分析趋势
*/
@GetMapping("/getInAnalysisData")
@PreAuthorize("@ss.hasPermi('kpi:in:analysis:data')")
public AjaxResult getInAnalysisData(InAnalysisDataQuery query) {
return AjaxResult.success(kpiService.selectInboundTrend(query));
}
/**
* 出库分析趋势
*/
@GetMapping("/getOutAnalysisData")
@PreAuthorize("@ss.hasPermi('kpi:out:analysis:data')")
public AjaxResult getOutAnalysisData(OutAnalysisDataQuery query) {
return AjaxResult.success(kpiService.selectOutboundTrend(query));
}
/**
* 货位平面图数据
*/
@GetMapping("/cargoSpacePlan")
@PreAuthorize("@ss.hasPermi('kpi:cargo:space:plan')")
public AjaxResult getCargoSpacePlan(String warehouseId, String thePlatoon) {
return AjaxResult.success(kpiService.getCargoSpacePlanData(warehouseId, thePlatoon));
}
/**
* 密集库货位平面图数据
*/
@GetMapping("/denseCargoSpacePlan")
@PreAuthorize("@ss.hasPermi('kpi:cargo:space:plan')")
public AjaxResult getDenseCargoSpacePlan(String warehouseId) {
return AjaxResult.success(kpiService.getDenseCargoSpacePlanData(warehouseId));
}
@GetMapping("/denseRelocation/options")
@PreAuthorize("@ss.hasPermi('kpi:cargo:space:plan')")
public AjaxResult denseRelocationOptions(
com.ruoyi.out.relocation.domain.RelocationGenerateRequest request) {
return AjaxResult.success(kpiService.getDenseRelocationOptions(request));
}
@PostMapping("/denseRelocation/preview")
@PreAuthorize("@ss.hasPermi('kpi:cargo:space:plan')")
public AjaxResult previewDenseRelocation(
@RequestBody com.ruoyi.out.relocation.domain.RelocationGenerateRequest request) {
return AjaxResult.success(kpiService.previewDenseRelocation(request));
}
@PostMapping("/denseRelocation/generate")
@PreAuthorize("@ss.hasPermi('kpi:cargo:space:plan')")
public AjaxResult generateDenseRelocation(
@RequestBody com.ruoyi.out.relocation.domain.RelocationGenerateRequest request) {
return AjaxResult.success(kpiService.generateDenseRelocation(request));
}
/**
* 货位平面图-货位详情
*/
@GetMapping("/cargoSpaceMag")
@PreAuthorize("@ss.hasPermi('kpi:cargo:space:msg')")
public AjaxResult getCargoSpaceMag(String warehouseId, String thePlatoon, String theColumn, String theFloor) {
return AjaxResult.success(kpiService.getCargoSpaceMag(warehouseId, thePlatoon, theColumn, theFloor));
}
/**
* 货位状态统计
*/
@GetMapping("/spaceStatusCounts")
@PreAuthorize("@ss.hasPermi('kpi:cargo:space:status')")
public AjaxResult getSpaceStatusCounts(BasCargoSpace basCargoSpace) {
return AjaxResult.success(kpiService.selectSpaceStatusCounts(basCargoSpace));
}
/**
* 巷道分析
*/
@GetMapping("/getRoadwayAnalysisList")
@PreAuthorize("@ss.hasPermi('kpi:roadway:analysis:list')")
public AjaxResult getRoadwayAnalysisList(RoadwayAnalysisQuery query) {
return AjaxResult.success(kpiService.getRoadwayAnalysisList(query));
}
}