diff --git a/src/main/java/com/iflytop/gd/app/controller/CraftsController.java b/src/main/java/com/iflytop/gd/app/controller/CraftsController.java index 99f3fa5..cdc67e2 100644 --- a/src/main/java/com/iflytop/gd/app/controller/CraftsController.java +++ b/src/main/java/com/iflytop/gd/app/controller/CraftsController.java @@ -73,16 +73,17 @@ public class CraftsController { return Result.failed(); } - @Operation(summary = "配置加热区工艺") - @PostMapping("/set") - public Result setCrafts(@Valid @RequestBody SetCraftsDTO setCraftsDTO) { - return Result.success(craftsService.setCraft(setCraftsDTO.getCraftId(), setCraftsDTO.getHeatId())); - } +// @Operation(summary = "配置加热区工艺") +// @PostMapping("/set") +// public Result setCrafts(@Valid @RequestBody SetCraftsDTO setCraftsDTO) { +// return Result.success(craftsService.setCraft(setCraftsDTO.getCraftId(), setCraftsDTO.getHeatId())); +// } @Operation(summary = "开始执行工艺") @PostMapping("/start") public Result startCrafts(@Valid @RequestBody StartCraftsDTO startCraftsDTO) { + craftsService.setCraft(startCraftsDTO.getCraftId(), startCraftsDTO.getHeatId()); craftsService.startCrafts(startCraftsDTO.getHeatId()); return Result.success(); } diff --git a/src/main/java/com/iflytop/gd/app/controller/SelfTestController.java b/src/main/java/com/iflytop/gd/app/controller/SelfTestController.java index 1a8b2a4..cd09f05 100644 --- a/src/main/java/com/iflytop/gd/app/controller/SelfTestController.java +++ b/src/main/java/com/iflytop/gd/app/controller/SelfTestController.java @@ -1,7 +1,7 @@ package com.iflytop.gd.app.controller; import com.iflytop.gd.app.model.bo.status.SelfTestState; -import com.iflytop.gd.app.model.vo.GetRequireOutTray; +import com.iflytop.gd.app.model.vo.GetRequireOutTrayVO; import com.iflytop.gd.app.service.device.SelfTestService; import com.iflytop.gd.app.service.device.DeviceStateService; import com.iflytop.gd.app.service.device.module.CapModuleService; @@ -35,7 +35,7 @@ public class SelfTestController { @Operation(summary = "是否存在需要移除的托盘") @GetMapping("/require-out-tray") - public Result> getRequireOutTray() { + public Result> getRequireOutTray() { return Result.success(selfTestService.getRequireOutTray()); } diff --git a/src/main/java/com/iflytop/gd/app/model/dto/StartCraftsDTO.java b/src/main/java/com/iflytop/gd/app/model/dto/StartCraftsDTO.java index cb9d280..17ee073 100644 --- a/src/main/java/com/iflytop/gd/app/model/dto/StartCraftsDTO.java +++ b/src/main/java/com/iflytop/gd/app/model/dto/StartCraftsDTO.java @@ -2,12 +2,17 @@ package com.iflytop.gd.app.model.dto; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; import lombok.Data; @Schema(description = "开始工艺") @Data public class StartCraftsDTO { + @Positive(message = "工艺ID 必须是正数") @NotNull - @Schema(description = "加热区id") + @Schema(description = "工艺id") + private Long craftId; + + @Schema(description = "加热区id,如果不传递则自动分配加热区") private String heatId; } diff --git a/src/main/java/com/iflytop/gd/app/model/vo/GetRequireOutTray.java b/src/main/java/com/iflytop/gd/app/model/vo/GetRequireOutTrayVO.java similarity index 81% rename from src/main/java/com/iflytop/gd/app/model/vo/GetRequireOutTray.java rename to src/main/java/com/iflytop/gd/app/model/vo/GetRequireOutTrayVO.java index 62d98c2..1fdf82c 100644 --- a/src/main/java/com/iflytop/gd/app/model/vo/GetRequireOutTray.java +++ b/src/main/java/com/iflytop/gd/app/model/vo/GetRequireOutTrayVO.java @@ -6,7 +6,7 @@ import lombok.Data; @Schema(description = "是否存在需要移除的托盘") @Data -public class GetRequireOutTray { +public class GetRequireOutTrayVO { @Schema(description = "加热模块CODE") private HeatModuleCode moduleCode; @@ -17,7 +17,7 @@ public class GetRequireOutTray { @Schema(description = "是否存在拍子") private boolean capExist; - public GetRequireOutTray(HeatModuleCode moduleCode, boolean trayExist, boolean capExist) { + public GetRequireOutTrayVO(HeatModuleCode moduleCode, boolean trayExist, boolean capExist) { this.moduleCode = moduleCode; this.trayExist = trayExist; this.capExist = capExist; diff --git a/src/main/java/com/iflytop/gd/app/service/device/SelfTestService.java b/src/main/java/com/iflytop/gd/app/service/device/SelfTestService.java index 2fcea0b..e3c93a1 100644 --- a/src/main/java/com/iflytop/gd/app/service/device/SelfTestService.java +++ b/src/main/java/com/iflytop/gd/app/service/device/SelfTestService.java @@ -2,7 +2,7 @@ package com.iflytop.gd.app.service.device; import com.iflytop.gd.app.model.bo.status.SelfTestState; import com.iflytop.gd.app.model.bo.status.device.HeatModuleState; -import com.iflytop.gd.app.model.vo.GetRequireOutTray; +import com.iflytop.gd.app.model.vo.GetRequireOutTrayVO; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -25,11 +25,12 @@ public class SelfTestService { /** * 是否存在需要移除的托盘 */ - public List getRequireOutTray() { - List getRequireOutTrayList = new ArrayList<>(); + public List getRequireOutTray() { + List getRequireOutTrayList = new ArrayList<>(); List heatModuleStateList = deviceStateService.getDeviceState().getHeatModule(); for (HeatModuleState heatModuleState : heatModuleStateList) { - getRequireOutTrayList.add(new GetRequireOutTray(heatModuleState.getModuleCode(),heatModuleState.getTrayStatus() == 1,heatModuleState.isCapExist())); + //TODO 只获取存在托盘的 + getRequireOutTrayList.add(new GetRequireOutTrayVO(heatModuleState.getModuleCode(),heatModuleState.getTrayStatus() == 1,heatModuleState.isCapExist())); } return getRequireOutTrayList; }