| | |
| | | import com.mes.downworkstation.entity.request.DownWorkRequest; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.utils.RedisUtil; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | private DownWorkstationService downWorkstationService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | @ApiOperation("获取工位信息") |
| | | @GetMapping("/getone") |
| | |
| | | // 调用 DownWorkstationService 中的方法清除指定工位ID的信息 |
| | | int workstationId = (int) requestData.get("workstationId"); |
| | | |
| | | downWorkstationService.clearFlowCardId(workstationId); |
| | | return Result.build(200, "清除工位信息成功", 1); |
| | | |
| | | downWorkstationService.clearFlowCardId(workstationId); |
| | | return Result.build(200, "清除工位信息成功", 1); |
| | | |
| | | |
| | | // 构建响应数据 |
| | |
| | | return Result.build(200, "更换成功", downWorkstationService.closeAlarmSignal()); |
| | | } |
| | | |
| | | @ApiOperation("是否自动打印") |
| | | @PostMapping("/autoPrint") |
| | | public Result autoPrint(Boolean flag) { |
| | | downWorkstationService.autoPrint(flag); |
| | | return Result.build(200, "修改成功", redisUtil.getCacheObject("autoPrint")); |
| | | } |
| | | |
| | | @ApiOperation("新增虚拟工位") |
| | | @PostMapping("/insertDownWorkstation") |
| | | public Result insertDownWorkstation() { |
| | | downWorkstationService.insertDownWorkstation(); |
| | | return Result.build(200, "新增成功", 1); |
| | | } |
| | | |
| | | @ApiOperation("删除虚拟工位") |
| | | @PostMapping("/deleteDownWorkstation") |
| | | public Result deleteDownWorkstation(DownWorkstation downWorkstation) { |
| | | downWorkstationService.removeById(downWorkstation.getWorkstationId()); |
| | | return Result.build(200, "删除成功", 1); |
| | | } |
| | | |
| | | } |
| | | |