| | |
| | | package com.mes.md.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.mes.md.entity.Machine; |
| | | import com.mes.md.entity.Tasking; |
| | | import com.mes.md.service.TaskingService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 工作任务操作记录明细 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-08-28 |
| | | * @author yanzhixin |
| | | * @since 2024-09-13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/tasking") |
| | | public class TaskingController { |
| | | @RestController |
| | | @RequestMapping("/tasking") |
| | | public class TaskingController { |
| | | @Autowired |
| | | private TaskingService taskingService; |
| | | |
| | | // @ApiOperation("切换模式") |
| | | // @PostMapping("/updateLoadState") //切换模式" |
| | | // @ResponseBody |
| | | // public Result<Boolean> updateStatus(@RequestBody Integer state) { |
| | | // if(state == 1){ |
| | | // boolean result =taskingService.updateStatus(state); |
| | | // return Result.build(1,"定制模式",result); |
| | | // }else { |
| | | // boolean result =taskingService.updateStatus(state); |
| | | // return Result.build(0,"标准模式",result); |
| | | // } |
| | | // } |
| | | // @ApiOperation("点击暂停设备") |
| | | // @PostMapping("/updateLoadStatus") //点击暂停设备 |
| | | // @ResponseBody |
| | | // public Result<Boolean> updateLoadStatus(@RequestBody Integer state) { |
| | | // if(state == 1){ |
| | | // boolean result =taskingService.updateLoadState(state); |
| | | // return Result.build(1,"成功",result); |
| | | // }else { |
| | | // boolean result =taskingService.updateLoadState(state); |
| | | // return Result.build(0,"成功",result); |
| | | // } |
| | | // } |
| | | // @ApiOperation("点击破损") |
| | | // @PostMapping("/updateDamage") //暂停上片任务 |
| | | // @ResponseBody |
| | | // public Result<Tasking> updateDamage(@RequestBody Tasking tasking) { |
| | | // |
| | | // boolean result =taskingService.updateDamage(tasking); |
| | | // return Result.build(1,"定制模式",null); |
| | | // |
| | | // |
| | | // } |
| | | // @ApiOperation("查询当前模式过去的玻璃") |
| | | // @PostMapping("/selectTasking") //暂停上片任务 |
| | | // @ResponseBody |
| | | // public Result<List<Tasking>> selectTasking() { |
| | | // |
| | | // List<Tasking> tasking =taskingService.selectTasking(); |
| | | // return Result.build(1,"定制模式",tasking); |
| | | // } |
| | | |
| | | |
| | | |
| | | @ApiOperation("查询当前设备,未完工状态的线上任务") |
| | | @PostMapping("/findMachineTask") |
| | | @ResponseBody |
| | | public Result findMachineTask(@RequestBody Machine machine) { |
| | | List<Tasking> list =taskingService.findMachineTask(machine); |
| | | return Result.build(200,"成功",list); |
| | | } |
| | | |
| | | @ApiOperation("查询当前设备,某状态的线上任务【等待/正在工作/完工】") |
| | | @PostMapping("/findMachineWorkStateTask") |
| | | @ResponseBody |
| | | public Result findMachineWorkStateTask(@RequestBody Machine machine,String workState) { |
| | | List<Tasking> list =taskingService.findMachineWorkStateTask(machine,workState); |
| | | return Result.build(200,"成功",list); |
| | | } |
| | | |
| | | @ApiOperation("修改玻璃状态 【破损】") |
| | | @PostMapping("/damagedTask") |
| | | @ResponseBody |
| | | public Result damagedTask(@RequestBody Tasking tasking) { |
| | | int count =taskingService.damagedTask(tasking); |
| | | return Result.build(200,"修改成功:"+count,count); |
| | | } |
| | | @ApiOperation("修改任务状态 【正在工作】") |
| | | @PostMapping("/startMachineTask") |
| | | @ResponseBody |
| | | public Result startMachineTask(@RequestBody Machine machine) { |
| | | Tasking tasking =taskingService.startMachineTask(machine); |
| | | return Result.build(200,"修改成功:",tasking); |
| | | } |
| | | @ApiOperation("修改任务状态 【失败】") |
| | | @PostMapping("/loseMachineTask") |
| | | @ResponseBody |
| | | public Result loseMachineTask(@RequestBody Machine machine) { |
| | | int count =taskingService.loseMachineTask(machine); |
| | | return Result.build(200,"修改成功:"+count,count); |
| | | } |
| | | @ApiOperation("修改任务状态 【完工】") |
| | | @PostMapping("/finishMachineTask") |
| | | @ResponseBody |
| | | public Result finishMachineTask(@RequestBody Machine machine) { |
| | | int count =taskingService.finishMachineTask(machine); |
| | | return Result.build(200,"修改成功:"+count,count); |
| | | } |
| | | |
| | | @ApiOperation("修改当前设备 【上线】") |
| | | @PostMapping("/glassTopLine") |
| | | @ResponseBody |
| | | public Result glassTopLine(@RequestBody List<Tasking> taskingList) { |
| | | int count =taskingService.glassTopLine(taskingList); |
| | | return Result.build(200,"修改成功:"+count,count); |
| | | } |
| | | |
| | | @ApiOperation("修改当前设备 【下线】") |
| | | @PostMapping("/glassDownLine") |
| | | @ResponseBody |
| | | public Result glassDownLine(@RequestBody Tasking tasking) { |
| | | int count =taskingService.glassDownLine(tasking); |
| | | return Result.build(200,"修改成功:"+count,count); |
| | | } |
| | | |
| | | |
| | | } |
| | | |