| | |
| | | package com.mes.md.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.md.entity.Account; |
| | | import com.mes.md.entity.Tasking; |
| | | import com.mes.md.mapper.TaskingMapper; |
| | | import com.mes.md.service.TaskingService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @author wu |
| | | * @since 2024-08-28 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/tasking") |
| | | public class TaskingController { |
| | | @RestController |
| | | @RequestMapping("/jiumumes/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) { |
| | | |
| | | @Autowired |
| | | TaskingMapper taskingMapper; |
| | | boolean result =taskingService.updateDamage(tasking); |
| | | return Result.build(1,"定制模式",null); |
| | | |
| | | @ApiOperation("账户绑定角色") |
| | | @PostMapping("/bindAccountRole") |
| | | @ResponseBody |
| | | public Result Tasking (@RequestBody Tasking tasking) { |
| | | List<Tasking> list=taskingMapper.selectList(new MPJLambdaWrapper<Tasking>().selectAll() |
| | | .eq(Tasking::getState,"线上") |
| | | .eq(Tasking::getCurrentCraft,"gongui")); |
| | | return Result.build(200,"成功",list); |
| | | } |
| | | |
| | | } |
| | | @ApiOperation("查询当前模式过去的玻璃") |
| | | @PostMapping("/selectTasking") //暂停上片任务 |
| | | @ResponseBody |
| | | public Result<List<Tasking>> selectTasking() { |
| | | |
| | | List<Tasking> tasking =taskingService.selectTasking(); |
| | | return Result.build(1,"定制模式",tasking); |
| | | } |
| | | } |
| | | |