| | |
| | | |
| | | |
| | | import com.mes.hollow.entity.HollowGlassOutRelationInfo; |
| | | import com.mes.hollow.entity.request.HollowTaskRequest; |
| | | import com.mes.hollow.service.HollowGlassOutRelationInfoService; |
| | | import com.mes.hollowqueue.entity.HollowGlassQueueInfo; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (HollowGlassOutRelationInfo)表控制层 |
| | |
| | | * @author makejava |
| | | * @since 2024-11-30 13:57:28 |
| | | */ |
| | | @Api(tags = "中空任务关系") |
| | | @RestController |
| | | @RequestMapping("hollowGlassOutRelationInfo") |
| | | public class HollowGlassOutRelationInfoController { |
| | |
| | | |
| | | @ApiOperation("领取任务") |
| | | @PostMapping("/receiveTask") |
| | | public Result<HollowGlassOutRelationInfo> receiveTask(String flowCardId, int cell, int totalPairQuantity) { |
| | | HollowGlassOutRelationInfo hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService.receiveTask(flowCardId, cell, totalPairQuantity); |
| | | public Result<HollowGlassOutRelationInfo> receiveTask(HollowTaskRequest request) { |
| | | HollowGlassOutRelationInfo hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService.receiveTask(request); |
| | | if (null == hollowGlassOutRelationInfo) { |
| | | return Result.error(500, "有正在执行的任务,请先确保任务完成后,再次领取任务"); |
| | | return Result.error(500, "当前流程卡有未完成的任务,请先确保任务完成后,再次领取任务"); |
| | | } else { |
| | | return Result.success(hollowGlassOutRelationInfo); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ApiOperation("强制出片") |
| | | @PostMapping("/forceOutGlass") |
| | | public Result<HollowGlassOutRelationInfo> forceOutGlass(String flowCardId, int cell, int totalPairQuantity) { |
| | | HollowGlassOutRelationInfo hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService.forceOutGlass(flowCardId, cell, totalPairQuantity); |
| | | public Result<HollowGlassOutRelationInfo> forceOutGlass(HollowTaskRequest request) { |
| | | HollowGlassOutRelationInfo hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService.forceOutGlass(request); |
| | | if (null == hollowGlassOutRelationInfo) { |
| | | return Result.error(500, "有正在执行的任务,请先确保任务完成后,再次强制执行任务"); |
| | | return Result.error(500, "当前流程卡有未完成的任务,请先确保任务完成后,再次强制执行任务"); |
| | | } else { |
| | | return Result.success(hollowGlassOutRelationInfo); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("流程卡任务列表") |
| | | @PostMapping("/hollowTaskList") |
| | | public Result<List<String>> hollowTaskList(int cell) { |
| | | return Result.build(200, "流程卡任务列表查询成功", hollowGlassOutRelationInfoService.hollowTaskList(cell)); |
| | | } |
| | | |
| | | @ApiOperation("预览指定任务信息") |
| | | @PostMapping("/appointHollowTaskDetails") |
| | | public Result<List<HollowGlassQueueInfo>> appointHollowTaskDetails(String flowCardId, int cell) { |
| | | return Result.build(200, "预览指定任务信息成功", hollowGlassOutRelationInfoService.appointHollowTaskDetails(flowCardId, cell)); |
| | | } |
| | | |
| | | @ApiOperation("删除指定任务信息") |
| | | @PostMapping("/deleteHollowTaskDetails") |
| | | public Result<Boolean> deleteHollowTaskDetails(String flowCardId, int cell) { |
| | | return Result.build(200, "预览指定任务信息成功", hollowGlassOutRelationInfoService.deleteHollowTaskDetails(flowCardId, cell)); |
| | | } |
| | | |
| | | @ApiOperation("开始任务") |
| | | @PostMapping("/startTask") |
| | | public Result<Boolean> startTask(String flowCardId, int cell) { |
| | | return Result.build(200, "开始任务成功", hollowGlassOutRelationInfoService.startTask(flowCardId, cell)); |
| | | } |
| | | |
| | | @ApiOperation("暂停任务") |
| | | @PostMapping("/pauseTask") |
| | | public Result<Boolean> pauseTask(String flowCardId, int cell) { |
| | | return Result.build(200, "暂停任务成功", hollowGlassOutRelationInfoService.pauseTask(flowCardId, cell)); |
| | | } |
| | | |
| | | @ApiOperation("结束任务") |
| | | @PostMapping("/finishTask") |
| | | public Result<Boolean> finishTask(String flowCardId, int cell) { |
| | | return Result.build(200, "结束任务成功", hollowGlassOutRelationInfoService.finishTask(flowCardId, cell)); |
| | | } |
| | | |
| | | @ApiOperation("是否调度开关") |
| | |
| | | return Result.build(200, "修改成功", hollowGlassOutRelationInfoService.dispatchHollowSwitch(flag)); |
| | | } |
| | | |
| | | @ApiOperation("手动生成李赛克文件") |
| | | @PostMapping("/generateHollowLisecFile") |
| | | public Result<String> generateHollowLisecFile(String flowCardId, int cell, int isForce) throws IOException { |
| | | return Result.build(200, "修改成功", hollowGlassOutRelationInfoService.generateHollowLisecFile(flowCardId, cell, isForce, 1)); |
| | | } |
| | | |
| | | } |
| | | |