Commit e5a72c6c authored by 李驰骋's avatar 李驰骋

看板测试数据接口添加

parent da025101
...@@ -2,9 +2,13 @@ package com.ximai.mes.kanban.controller; ...@@ -2,9 +2,13 @@ package com.ximai.mes.kanban.controller;
import cn.hutool.core.collection.ListUtil; import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import com.ximai.common.core.domain.AjaxResult;
import com.ximai.mes.kanban.dto.abnormal.AbnormalMonthStatDto; import com.ximai.mes.kanban.dto.abnormal.AbnormalMonthStatDto;
import com.ximai.mes.kanban.service.KanbanAbnormalService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -17,9 +21,12 @@ import java.util.List; ...@@ -17,9 +21,12 @@ import java.util.List;
@RequestMapping("/kanban/abnormal") @RequestMapping("/kanban/abnormal")
public class KanbanAbnormalController { public class KanbanAbnormalController {
@Autowired
KanbanAbnormalService kanbanAbnormalService;
@ApiOperation("当月异常分布数据") @ApiOperation("当月异常分布数据")
@PostMapping("/currentMonthStat") @PostMapping("/currentMonthStat")
public AbnormalMonthStatDto currentMonthStat() { public AjaxResult<AbnormalMonthStatDto> currentMonthStat() {
AbnormalMonthStatDto rst = new AbnormalMonthStatDto(); AbnormalMonthStatDto rst = new AbnormalMonthStatDto();
AbnormalMonthStatDto.AbnormalMonthStatDetail abnormal1 = new AbnormalMonthStatDto.AbnormalMonthStatDetail(); AbnormalMonthStatDto.AbnormalMonthStatDetail abnormal1 = new AbnormalMonthStatDto.AbnormalMonthStatDetail();
abnormal1.setTotalCt(10); abnormal1.setTotalCt(10);
...@@ -54,7 +61,8 @@ public class KanbanAbnormalController { ...@@ -54,7 +61,8 @@ public class KanbanAbnormalController {
}); });
rst.setAbnormalCauseData(abnormalCauseStats); rst.setAbnormalCauseData(abnormalCauseStats);
rst.setEquipErrorArr(ListUtil.toList(new Integer[]{0,0,0,2,2,0,0})); rst.setEquipErrorArr(ListUtil.toList(new Integer[]{0,0,0,2,2,0,0}));
return rst;
return AjaxResult.success(rst);
} }
......
package com.ximai.mes.kanban.controller; package com.ximai.mes.kanban.controller;
import com.ximai.common.core.domain.AjaxResult;
import com.ximai.mes.kanban.dto.task.TaskStatDto; import com.ximai.mes.kanban.dto.task.TaskStatDto;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -19,7 +20,7 @@ public class KanbanTaskController { ...@@ -19,7 +20,7 @@ public class KanbanTaskController {
@ApiOperation("工序当月统计") @ApiOperation("工序当月统计")
@PostMapping("/currentMonthStat") @PostMapping("/currentMonthStat")
public TaskStatDto currentMonthStat() { public AjaxResult<TaskStatDto> currentMonthStat() {
TaskStatDto rst = new TaskStatDto(); TaskStatDto rst = new TaskStatDto();
List<TaskStatDto.ProcessOutput> outputList = new ArrayList<>(); List<TaskStatDto.ProcessOutput> outputList = new ArrayList<>();
outputList.add(new TaskStatDto.ProcessOutput(){ outputList.add(new TaskStatDto.ProcessOutput(){
...@@ -101,7 +102,7 @@ public class KanbanTaskController { ...@@ -101,7 +102,7 @@ public class KanbanTaskController {
processMonthlyIndexDto.setQualifiedRatio(new BigDecimal("95")); processMonthlyIndexDto.setQualifiedRatio(new BigDecimal("95"));
processMonthlyIndexDto.setMonthPlanConcludeRatio(new BigDecimal("35")); processMonthlyIndexDto.setMonthPlanConcludeRatio(new BigDecimal("35"));
rst.setProcessMonthlyIndexDto(processMonthlyIndexDto); rst.setProcessMonthlyIndexDto(processMonthlyIndexDto);
return rst; return AjaxResult.success(rst);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment