HardwareApiController.java 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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.exUpdate.ExDTO;
  7. import com.ktg.iscs.domain.dto.hardwareApi.*;
  8. import com.ktg.iscs.domain.vo.hardwareApi.JobTicketVO;
  9. import com.ktg.iscs.service.HardwareApiService;
  10. import io.swagger.annotations.Api;
  11. import io.swagger.annotations.ApiOperation;
  12. import io.swagger.v3.oas.annotations.Parameter;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.*;
  15. /**
  16. * 硬件调用接口
  17. *
  18. * @author cgj
  19. * @date 2024-10-16
  20. */
  21. @Api(tags = "硬件调用接口")
  22. @RestController
  23. @RequestMapping("/iscs/hardware-api")
  24. public class HardwareApiController extends BaseController
  25. {
  26. @Autowired
  27. private HardwareApiService hardwareApiService;
  28. // ----------------------------------作业票取还钥匙-------------------------------------------------------
  29. @ApiOperation("取出钥匙")
  30. @Log(title = "取出钥匙", businessType = BusinessType.UPDATE)
  31. @PostMapping("/updateTakeOutKey")
  32. public CommonResult<Boolean> updateTakeOutKey(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") TakeOutKeyDTO dto)
  33. {
  34. return CommonResult.success(hardwareApiService.updateTakeOutKey(dto));
  35. }
  36. @ApiOperation("归还钥匙")
  37. @Log(title = "归还钥匙", businessType = BusinessType.UPDATE)
  38. @PostMapping("/updateReturnKey")
  39. public CommonResult<Boolean> updateReturnKey(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") ReturnKeyDTO dto)
  40. {
  41. return CommonResult.success(hardwareApiService.updateReturnKey(dto));
  42. }
  43. // ----------------------------------作业票取还挂锁-------------------------------------------------------
  44. @ApiOperation("取出挂锁时更新数据")
  45. @Log(title = "取出挂锁时更新数据", businessType = BusinessType.UPDATE)
  46. @PostMapping("/updateTicketLockTake")
  47. public CommonResult<Boolean> updateTicketLockTake(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") ParamDTO dto)
  48. {
  49. return CommonResult.success(hardwareApiService.updateTicketLockTake(dto.getList()));
  50. }
  51. @ApiOperation("归还挂锁时更新数据")
  52. @Log(title = "归还挂锁时更新数据", businessType = BusinessType.UPDATE)
  53. @PostMapping("/updateTicketLockReturn")
  54. public CommonResult<Boolean> updateTicketLockReturn(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") ReturnTicketLockDTO dto)
  55. {
  56. return CommonResult.success(hardwareApiService.updateTicketLockReturn(dto));
  57. }
  58. @ApiOperation("批量更新作业票下隔离点的上锁状况")
  59. @Log(title = "批量更新作业票下隔离点的上锁状况", businessType = BusinessType.UPDATE)
  60. @PostMapping("/updateLockPointBatch")
  61. public CommonResult<Boolean> updateLockPointBatch(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") LPBParamDTO dto)
  62. {
  63. return CommonResult.success(hardwareApiService.updateLockPointBatch(dto.getList()));
  64. }
  65. // ----------------------------------作业票取还辅件-------------------------------------------------------
  66. @ApiOperation("取出辅件时更新数据")
  67. @Log(title = "取出辅件时更新数据", businessType = BusinessType.UPDATE)
  68. @PostMapping("/updateLocksetTake")
  69. public CommonResult<Boolean> updateLocksetTake(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") LTParamDTO dto)
  70. {
  71. return CommonResult.success(hardwareApiService.updateLocksetTake(dto.getList()));
  72. }
  73. @ApiOperation("辅件绑定隔离点(辅件和给隔离点上锁时)")
  74. @Log(title = "辅件绑定隔离点", businessType = BusinessType.UPDATE)
  75. @PostMapping("/updateLocksetPoint")
  76. public CommonResult<Boolean> updateLocksetPoint(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") LocksetPointDTO dto)
  77. {
  78. return CommonResult.success(hardwareApiService.updateLocksetPoint(dto));
  79. }
  80. @ApiOperation("辅件归还物资柜")
  81. @Log(title = "辅件归还物资柜", businessType = BusinessType.UPDATE)
  82. @PostMapping("/updateLocksetReturn")
  83. public CommonResult<Boolean> updateLocksetReturn(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") ReturnLocksetDTO dto)
  84. {
  85. return CommonResult.success(hardwareApiService.updateLocksetReturn(dto));
  86. }
  87. // ----------------------------------作业票及作业票的相关数据查询-------------------------------------------------------
  88. @ApiOperation("获取作业票和关联数据")
  89. @Parameter(name = "ticketId", description = "ticketId")
  90. @GetMapping(value = "/selectTicketDetailById")
  91. public CommonResult<JobTicketVO> selectTicketDetailById(Long ticketId)
  92. {
  93. return CommonResult.success(hardwareApiService.selectTicketDetailById(ticketId));
  94. }
  95. // 共锁人上锁/解锁
  96. @ApiOperation("共锁人上锁/解锁")
  97. @Log(title = "共锁人上锁/解锁", businessType = BusinessType.UPDATE)
  98. @PostMapping("/updateColockerStatus")
  99. public CommonResult<Boolean> updateColockerStatus(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") UpdateColockerStatusDTO dto)
  100. {
  101. return CommonResult.success(hardwareApiService.updateColockerStatus(dto));
  102. }
  103. @ApiOperation("批量更新隔离点开关状态")
  104. @Log(title = "批量更新隔离点开关状态", businessType = BusinessType.UPDATE)
  105. @PostMapping("/updateSwitchList")
  106. public CommonResult<Boolean> updateSwitchList(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") UpdateSwitchParam dto)
  107. {
  108. return CommonResult.success(hardwareApiService.updateSwitchList(dto));
  109. }
  110. // ----------------------------------作业票及作业票的相关数据查询-------------------------------------------------------
  111. @ApiOperation("上锁取钥匙前检查")
  112. @Parameter(name = "ticketId", description = "ticketId")
  113. @GetMapping(value = "/checkBeforeToLock")
  114. public CommonResult<Boolean> checkBeforeToLock(Long ticketId)
  115. {
  116. return CommonResult.success(hardwareApiService.checkBeforeToLock(ticketId));
  117. }
  118. @ApiOperation("解锁取钥匙前检查")
  119. @Parameter(name = "ticketId", description = "ticketId")
  120. @GetMapping(value = "/checkBeforeToUnlock")
  121. public CommonResult<Boolean> checkBeforeToUnlock(Long ticketId)
  122. {
  123. return CommonResult.success(hardwareApiService.checkBeforeToUnlock(ticketId));
  124. }
  125. @ApiOperation("重合点位数据解锁")
  126. @Log(title = "重合点位数据解锁", businessType = BusinessType.UPDATE)
  127. @PostMapping("/updateCoincideToUnLock")
  128. public CommonResult<Boolean> updateCoincideToUnLock(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") CoincidePointToUnLockDTO dto)
  129. {
  130. return CommonResult.success(hardwareApiService.updateCoincideToUnLock(dto));
  131. }
  132. // ----------------------------------批量更新硬件状态-------------------------------------------------------
  133. @ApiOperation("批量更新硬件状态")
  134. @Log(title = "批量更新硬件状态", businessType = BusinessType.UPDATE)
  135. @PostMapping("/updateHardwareEsStatus")
  136. public CommonResult<Boolean> updateHardwareEsStatus(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") ExDTO dto)
  137. {
  138. return CommonResult.success(hardwareApiService.updateHardwareEsStatus(dto));
  139. }
  140. }