156 lines
5.6 KiB
Java
156 lines
5.6 KiB
Java
package com.ruoyi.kpi.controller;
|
||
|
||
import com.ruoyi.common.core.controller.BaseController;
|
||
import com.ruoyi.common.core.domain.AjaxResult;
|
||
import com.ruoyi.kpi.service.KpiService;
|
||
import org.springframework.beans.factory.annotation.Autowired;
|
||
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;
|
||
|
||
/**
|
||
* KPI 统计分析
|
||
*
|
||
* @author gw
|
||
* @date 2025-05-21
|
||
*/
|
||
@RestController
|
||
@RequestMapping("/kpi")
|
||
public class KpiController extends BaseController {
|
||
@Autowired
|
||
private KpiService kpiService;
|
||
|
||
/**
|
||
* 获取入库均匀分析数据
|
||
*
|
||
* @param warehouseId 仓库ID
|
||
* @param yearMonth 年月,格式:yyyy-MM
|
||
* @return 入库均匀分析数据
|
||
*/
|
||
@GetMapping("/inAnalysis")
|
||
public AjaxResult getInAnalysis(@RequestParam("warehouseId") String warehouseId,
|
||
@RequestParam(value = "yearMonth", required = false) String yearMonth) {
|
||
return success(kpiService.getInAnalysis(warehouseId, yearMonth));
|
||
}
|
||
|
||
/**
|
||
* 按时间维度获取入库均匀分析数据
|
||
* @param warehouseId
|
||
* @return
|
||
*/
|
||
@GetMapping("/inAnalysisByData")
|
||
public AjaxResult getInAnalysisByData(@RequestParam(required = false) String warehouseId,
|
||
@RequestParam String startTime,
|
||
@RequestParam String endTime,
|
||
@RequestParam String inOut) {
|
||
return kpiService.getInAnalysisByData(warehouseId, startTime,endTime,inOut);
|
||
}
|
||
|
||
/**
|
||
* 获取出库均匀分析数据
|
||
*
|
||
* @param warehouseId 仓库ID
|
||
* @param yearMonth 年月,格式:yyyy-MM
|
||
* @return 入库均匀分析数据
|
||
*/
|
||
@GetMapping("/outAnalysis")
|
||
public AjaxResult getOutAnalysis(@RequestParam("warehouseId") String warehouseId,
|
||
@RequestParam(value = "yearMonth", required = false) String yearMonth) {
|
||
return success(kpiService.getOutAnalysis(warehouseId, yearMonth));
|
||
}
|
||
|
||
/**
|
||
* 获取巷道均匀分析数据
|
||
*
|
||
* @param warehouseId 仓库ID
|
||
* @param startTime 开始时间,格式:yyyy-MM-dd HH:mm:ss
|
||
* @param endTime 结束时间,格式:yyyy-MM-dd HH:mm:ss
|
||
* @return 巷道分析数据,格式:{tunnels: [巷道名称列表], inCounts: [入库数量列表], outCounts: [出库数量列表]}
|
||
*/
|
||
@GetMapping("/roadwayAnalysis")
|
||
public AjaxResult getRoadwayAnalysis(@RequestParam("warehouseId") String warehouseId,
|
||
@RequestParam(value = "startTime", required = false) String startTime,
|
||
@RequestParam(value = "endTime", required = false) String endTime) {
|
||
return success(kpiService.getRoadwayAnalysis(warehouseId, startTime, endTime));
|
||
}
|
||
|
||
|
||
/**
|
||
* 获取货位分析数据
|
||
*
|
||
* @param warehouseId 仓库ID
|
||
* @return 货位分析数据
|
||
*/
|
||
@GetMapping("/spaceAnalysis")
|
||
public AjaxResult getSpaceAnalysis(@RequestParam(value = "warehouseId",required = false) String warehouseId) {
|
||
return success(kpiService.getSpaceAnalysis(warehouseId));
|
||
}
|
||
|
||
/**
|
||
* 新增:根据仓库和巷道统计各状态货位数量
|
||
*/
|
||
@GetMapping("/spaceStatusCounts")
|
||
public AjaxResult getSpaceStatusCounts(String warehouseId,
|
||
String roadwayId) {
|
||
return success(kpiService.getSpaceStatusCounts(warehouseId, roadwayId));
|
||
}
|
||
|
||
/**
|
||
* 获取货位巷道数据
|
||
*
|
||
* @param warehouseId 仓库ID
|
||
* @return 货位巷道数据
|
||
*/
|
||
@GetMapping("/getRoadways")
|
||
public AjaxResult getRoadways(@RequestParam("warehouseId") String warehouseId){
|
||
return success(kpiService.getRoadways(warehouseId));
|
||
}
|
||
|
||
/**
|
||
* 获取货位排数据
|
||
*
|
||
* @param warehouseId 仓库ID
|
||
* @param roadwayId 巷道ID
|
||
* @return 货位排数据
|
||
*/
|
||
@GetMapping("/getPlatoons")
|
||
public AjaxResult getPlatoons(@RequestParam("warehouseId") String warehouseId,
|
||
@RequestParam("roadwayId") String roadwayId){
|
||
return success(kpiService.getPlatoons(warehouseId,roadwayId));
|
||
}
|
||
|
||
/**
|
||
* 获取库存平面图
|
||
*
|
||
* @param warehouseId 仓库ID
|
||
* @param roadwayId 巷道ID
|
||
* @param thePlatoon 排
|
||
* @return 库存平面图数据
|
||
*/
|
||
@GetMapping("/getChartData")
|
||
public AjaxResult getChartData(@RequestParam("warehouseId") String warehouseId,
|
||
@RequestParam("roadwayId") String roadwayId,
|
||
@RequestParam("thePlatoon") String thePlatoon){
|
||
return success(kpiService.getChartData(warehouseId,roadwayId,thePlatoon));
|
||
}
|
||
|
||
/**
|
||
* 获取库存平面图信息
|
||
*
|
||
* @param warehouseId 仓库ID
|
||
* @param theColumn 列
|
||
* @param thePlatoon 排
|
||
* @param theFloor 层
|
||
* @return 库存平面图信息数据
|
||
*/
|
||
@GetMapping("/getChartMag")
|
||
public AjaxResult getChartMag(@RequestParam("warehouseId") String warehouseId,
|
||
@RequestParam("theColumn") String theColumn,
|
||
@RequestParam("theFloor") String theFloor,
|
||
@RequestParam("thePlatoon") String thePlatoon){
|
||
return success(kpiService.getChartMag(warehouseId,theColumn,theFloor,thePlatoon));
|
||
}
|
||
|
||
}
|