HardwareApiController.java 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. package com.ktg.iscs.controller;
  2. import com.ktg.common.annotation.Log;
  3. import com.ktg.common.core.controller.BaseController;
  4. import com.ktg.common.enums.BusinessType;
  5. import com.ktg.common.pojo.CommonResult;
  6. import com.ktg.iscs.domain.dto.hardwareApi.*;
  7. import com.ktg.iscs.domain.vo.hardwareApi.JobTicketVO;
  8. import com.ktg.iscs.service.HardwareApiService;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import io.swagger.v3.oas.annotations.Parameter;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.*;
  14. /**
  15. * 硬件调用接口
  16. *
  17. * @author cgj
  18. * @date 2024-10-16
  19. */
  20. @Api(tags = "硬件调用接口")
  21. @RestController
  22. @RequestMapping("/iscs/hardware-api")
  23. public class HardwareApiController extends BaseController
  24. {
  25. @Autowired
  26. private HardwareApiService hardwareApiService;
  27. // ----------------------------------作业票取还钥匙-------------------------------------------------------
  28. @ApiOperation("取出钥匙")
  29. @Log(title = "取出钥匙", businessType = BusinessType.UPDATE)
  30. @PostMapping("/updateTakeOutKey")
  31. public CommonResult<Boolean> updateTakeOutKey(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") TakeOutKeyDTO dto)
  32. {
  33. return CommonResult.success(hardwareApiService.updateTakeOutKey(dto));
  34. }
  35. @ApiOperation("归还钥匙")
  36. @Log(title = "归还钥匙", businessType = BusinessType.UPDATE)
  37. @PostMapping("/updateReturnKey")
  38. public CommonResult<Boolean> updateReturnKey(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") ReturnKeyDTO dto)
  39. {
  40. return CommonResult.success(hardwareApiService.updateReturnKey(dto));
  41. }
  42. // ----------------------------------作业票取还挂锁-------------------------------------------------------
  43. @ApiOperation("取出挂锁时更新数据")
  44. @Log(title = "取出挂锁时更新数据", businessType = BusinessType.UPDATE)
  45. @PostMapping("/updateTicketLockTake")
  46. public CommonResult<Boolean> updateTicketLockTake(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") ParamDTO dto)
  47. {
  48. return CommonResult.success(hardwareApiService.updateTicketLockTake(dto.getList()));
  49. }
  50. @ApiOperation("归还挂锁时更新数据")
  51. @Log(title = "归还挂锁时更新数据", businessType = BusinessType.UPDATE)
  52. @PostMapping("/updateTicketLockReturn")
  53. public CommonResult<Boolean> updateTicketLockReturn(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") ReturnTicketLockDTO dto)
  54. {
  55. return CommonResult.success(hardwareApiService.updateTicketLockReturn(dto));
  56. }
  57. @ApiOperation("批量更新作业票下隔离点的上锁状况")
  58. @Log(title = "批量更新作业票下隔离点的上锁状况", businessType = BusinessType.UPDATE)
  59. @PostMapping("/updateLockPointBatch")
  60. public CommonResult<Boolean> updateLockPointBatch(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") LPBParamDTO dto)
  61. {
  62. return CommonResult.success(hardwareApiService.updateLockPointBatch(dto.getList()));
  63. }
  64. // ----------------------------------作业票取还辅件-------------------------------------------------------
  65. @ApiOperation("取出辅件时更新数据")
  66. @Log(title = "取出辅件时更新数据", businessType = BusinessType.UPDATE)
  67. @PostMapping("/updateLocksetTake")
  68. public CommonResult<Boolean> updateLocksetTake(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") LTParamDTO dto)
  69. {
  70. return CommonResult.success(hardwareApiService.updateLocksetTake(dto.getList()));
  71. }
  72. @ApiOperation("辅件绑定隔离点(辅件和给隔离点上锁时)")
  73. @Log(title = "辅件绑定隔离点", businessType = BusinessType.UPDATE)
  74. @PostMapping("/updateLocksetPoint")
  75. public CommonResult<Boolean> updateLocksetPoint(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") LocksetPointDTO dto)
  76. {
  77. return CommonResult.success(hardwareApiService.updateLocksetPoint(dto));
  78. }
  79. @ApiOperation("辅件归还物资柜")
  80. @Log(title = "辅件归还物资柜", businessType = BusinessType.UPDATE)
  81. @PostMapping("/updateLocksetReturn")
  82. public CommonResult<Boolean> updateLocksetReturn(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") ReturnLocksetDTO dto)
  83. {
  84. return CommonResult.success(hardwareApiService.updateLocksetReturn(dto));
  85. }
  86. // ----------------------------------作业票及作业票的相关数据查询-------------------------------------------------------
  87. @ApiOperation("获取作业票和关联数据")
  88. @Parameter(name = "ticketId", description = "ticketId")
  89. @GetMapping(value = "/selectTicketDetailById")
  90. public CommonResult<JobTicketVO> selectTicketDetailById(Long ticketId)
  91. {
  92. return CommonResult.success(hardwareApiService.selectTicketDetailById(ticketId));
  93. }
  94. }