package com.ktg.iscs.controller; import com.ktg.common.annotation.Log; import com.ktg.common.core.controller.BaseController; import com.ktg.common.enums.BusinessType; import com.ktg.common.pojo.CommonResult; import com.ktg.iscs.domain.dto.hardwareApi.*; import com.ktg.iscs.domain.vo.hardwareApi.JobTicketVO; import com.ktg.iscs.service.HardwareApiService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Parameter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** * 硬件调用接口 * * @author cgj * @date 2024-10-16 */ @Api(tags = "硬件调用接口") @RestController @RequestMapping("/iscs/hardware-api") public class HardwareApiController extends BaseController { @Autowired private HardwareApiService hardwareApiService; // ----------------------------------作业票取还钥匙------------------------------------------------------- @ApiOperation("取出钥匙") @Log(title = "取出钥匙", businessType = BusinessType.UPDATE) @PostMapping("/updateTakeOutKey") public CommonResult updateTakeOutKey(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") TakeOutKeyDTO dto) { return CommonResult.success(hardwareApiService.updateTakeOutKey(dto)); } @ApiOperation("归还钥匙") @Log(title = "归还钥匙", businessType = BusinessType.UPDATE) @PostMapping("/updateReturnKey") public CommonResult updateReturnKey(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") ReturnKeyDTO dto) { return CommonResult.success(hardwareApiService.updateReturnKey(dto)); } // ----------------------------------作业票取还挂锁------------------------------------------------------- @ApiOperation("取出挂锁时更新数据") @Log(title = "取出挂锁时更新数据", businessType = BusinessType.UPDATE) @PostMapping("/updateTicketLockTake") public CommonResult updateTicketLockTake(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") ParamDTO dto) { return CommonResult.success(hardwareApiService.updateTicketLockTake(dto.getList())); } @ApiOperation("归还挂锁时更新数据") @Log(title = "归还挂锁时更新数据", businessType = BusinessType.UPDATE) @PostMapping("/updateTicketLockReturn") public CommonResult updateTicketLockReturn(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") ReturnTicketLockDTO dto) { return CommonResult.success(hardwareApiService.updateTicketLockReturn(dto)); } @ApiOperation("批量更新作业票下隔离点的上锁状况") @Log(title = "批量更新作业票下隔离点的上锁状况", businessType = BusinessType.UPDATE) @PostMapping("/updateLockPointBatch") public CommonResult updateLockPointBatch(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") LPBParamDTO dto) { return CommonResult.success(hardwareApiService.updateLockPointBatch(dto.getList())); } // ----------------------------------作业票取还辅件------------------------------------------------------- @ApiOperation("取出辅件时更新数据") @Log(title = "取出辅件时更新数据", businessType = BusinessType.UPDATE) @PostMapping("/updateLocksetTake") public CommonResult updateLocksetTake(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") LTParamDTO dto) { return CommonResult.success(hardwareApiService.updateLocksetTake(dto.getList())); } @ApiOperation("辅件绑定隔离点(辅件和给隔离点上锁时)") @Log(title = "辅件绑定隔离点", businessType = BusinessType.UPDATE) @PostMapping("/updateLocksetPoint") public CommonResult updateLocksetPoint(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") LocksetPointDTO dto) { return CommonResult.success(hardwareApiService.updateLocksetPoint(dto)); } @ApiOperation("辅件归还物资柜") @Log(title = "辅件归还物资柜", businessType = BusinessType.UPDATE) @PostMapping("/updateLocksetReturn") public CommonResult updateLocksetReturn(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") ReturnLocksetDTO dto) { return CommonResult.success(hardwareApiService.updateLocksetReturn(dto)); } // ----------------------------------作业票及作业票的相关数据查询------------------------------------------------------- @ApiOperation("获取作业票和关联数据") @Parameter(name = "ticketId", description = "ticketId") @GetMapping(value = "/selectTicketDetailById") public CommonResult selectTicketDetailById(Long ticketId) { return CommonResult.success(hardwareApiService.selectTicketDetailById(ticketId)); } }