package com.mes.md.controller;
|
|
|
import com.mes.md.entity.Machine;
|
import com.mes.md.entity.Tasking;
|
import com.mes.md.mapper.MachineMapper;
|
import com.mes.md.service.MachineService;
|
import com.mes.utils.Result;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* <p>
|
* 前端控制器
|
* </p>
|
*
|
* @author yanzhixin
|
* @since 2024-09-13
|
*/
|
@RestController
|
@RequestMapping("/machine")
|
public class MachineController {
|
|
@Autowired
|
MachineService machineService;
|
@Autowired
|
MachineMapper machineMapper;
|
|
@ApiOperation("查询当前设备 数据")
|
@PostMapping("/findMachine")
|
@ResponseBody
|
public Result findMachine(@RequestBody Machine findMachine) {
|
Machine machine =machineMapper.selectById(findMachine);
|
return Result.build(200,"成功",machine);
|
}
|
|
@ApiOperation("修改当前设备 【开工/暂停】")
|
@PostMapping("/updateMachineState")
|
@ResponseBody
|
public Result updateMachineState(@RequestBody Machine machine) {
|
int count =machineService.openOrCloseMachine(machine);
|
return Result.build(200,"修改成功:"+count,count);
|
}
|
|
@ApiOperation("当前设备切换模式 【定制/标准】")
|
@PostMapping("/toggleModeMachine")
|
@ResponseBody
|
public Result toggleModeMachine(@RequestBody Machine machine) {
|
int count =machineService.toggleModeMachine(machine);
|
return Result.build(200,"修改成功:"+count,count);
|
}
|
|
@ApiOperation("当前旋转模式 【1旋转/2不旋转】")
|
@PostMapping("/toggleModeRotate")
|
@ResponseBody
|
public Result toggleModeRotate(@RequestBody Machine machine) {
|
int count =machineService.toggleModeRotate(machine);
|
return Result.build(200,"修改成功:"+count,count);
|
}
|
|
@ApiOperation("[手动上片模式] 修改数量")
|
@PostMapping("/manualOperationTask")
|
@ResponseBody
|
public Result manualOperationTask(@RequestBody Machine machine) {
|
int count =machineService.manualOperationTask(machine);
|
return Result.build(200,"修改成功:"+count,count);
|
}
|
}
|