|
@ -5,7 +5,9 @@ import com.iflytop.gd.app.model.dto.ResumeCraftsDto; |
|
|
import com.iflytop.gd.app.model.dto.StartCraftsDTO; |
|
|
import com.iflytop.gd.app.model.dto.StartCraftsDTO; |
|
|
import com.iflytop.gd.app.model.dto.StopCraftsDto; |
|
|
import com.iflytop.gd.app.model.dto.StopCraftsDto; |
|
|
import com.iflytop.gd.app.model.entity.Crafts; |
|
|
import com.iflytop.gd.app.model.entity.Crafts; |
|
|
|
|
|
import com.iflytop.gd.app.model.vo.CraftStatusVO; |
|
|
import com.iflytop.gd.app.service.CraftsService; |
|
|
import com.iflytop.gd.app.service.CraftsService; |
|
|
|
|
|
import com.iflytop.gd.app.model.bo.CraftsStep; |
|
|
import com.iflytop.gd.common.result.Result; |
|
|
import com.iflytop.gd.common.result.Result; |
|
|
import com.iflytop.gd.common.result.ResultCode; |
|
|
import com.iflytop.gd.common.result.ResultCode; |
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
@ -20,7 +22,7 @@ import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
@Tag(name = "工艺管理") |
|
|
@Tag(name = "工艺管理") |
|
|
@RestController |
|
|
@RestController |
|
@ -33,7 +35,8 @@ public class CraftsController { |
|
|
|
|
|
|
|
|
@Operation(summary = "根据矿石id获取工艺列表") |
|
|
@Operation(summary = "根据矿石id获取工艺列表") |
|
|
@GetMapping("/list/{oresId}") |
|
|
@GetMapping("/list/{oresId}") |
|
|
public Result<List<Crafts>> getAllCrafts(@NotNull(message = "矿石ID 不能为空") |
|
|
|
|
|
|
|
|
public Result<List<Crafts>> getAllCrafts( |
|
|
|
|
|
@NotNull(message = "矿石ID 不能为空") |
|
|
@Min(value = 1, message = "矿石ID 必须大于等于 1") |
|
|
@Min(value = 1, message = "矿石ID 必须大于等于 1") |
|
|
@Parameter(description = "矿石ID") @PathVariable Long oresId) { |
|
|
@Parameter(description = "矿石ID") @PathVariable Long oresId) { |
|
|
List<Crafts> craftList = craftsService.selectAllByOresId(oresId); |
|
|
List<Crafts> craftList = craftsService.selectAllByOresId(oresId); |
|
@ -67,7 +70,8 @@ public class CraftsController { |
|
|
|
|
|
|
|
|
@Operation(summary = "删除工艺") |
|
|
@Operation(summary = "删除工艺") |
|
|
@DeleteMapping("/{ids}") |
|
|
@DeleteMapping("/{ids}") |
|
|
public Result<String> deleteCrafts(@Parameter(description = "工艺ID,多个以英文逗号(,)分割") @PathVariable String ids) { |
|
|
|
|
|
|
|
|
public Result<String> deleteCrafts( |
|
|
|
|
|
@Parameter(description = "工艺ID,多个以英文逗号(,)分割") @PathVariable String ids) { |
|
|
boolean isSuccess = craftsService.deleteCrafts(ids); |
|
|
boolean isSuccess = craftsService.deleteCrafts(ids); |
|
|
if (isSuccess) { |
|
|
if (isSuccess) { |
|
|
return Result.success(); |
|
|
return Result.success(); |
|
@ -108,4 +112,22 @@ public class CraftsController { |
|
|
} |
|
|
} |
|
|
return Result.failed(); |
|
|
return Result.failed(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "获取某个加热区工艺状态") |
|
|
|
|
|
@GetMapping("/status/{heatId}") |
|
|
|
|
|
public Result<CraftStatusVO> getStatus( |
|
|
|
|
|
@NotNull @PathVariable String heatId) { |
|
|
|
|
|
CraftStatusVO vo = craftsService.getStatus(heatId); |
|
|
|
|
|
if (vo == null) { |
|
|
|
|
|
return Result.failed(ResultCode.NOT_FOUND, "未找到执行任务"); |
|
|
|
|
|
} |
|
|
|
|
|
return Result.success(vo); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "获取所有加热区工艺状态列表") |
|
|
|
|
|
@GetMapping("/status") |
|
|
|
|
|
public Result<List<CraftStatusVO>> getAllStatuses() { |
|
|
|
|
|
List<CraftStatusVO> list = craftsService.getAllStatuses(); |
|
|
|
|
|
return Result.success(list); |
|
|
|
|
|
} |
|
|
} |
|
|
} |