车车 пре 11 месеци
родитељ
комит
1c2252d5ad

+ 6 - 8
ktg-iscs/src/main/java/com/ktg/iscs/controller/HardwareApiController.java

@@ -13,8 +13,6 @@ import io.swagger.v3.oas.annotations.Parameter;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.List;
-
 /**
  * 硬件调用接口
  *
@@ -51,9 +49,9 @@ public class HardwareApiController extends BaseController
     @ApiOperation("取出挂锁时更新数据")
     @Log(title = "取出挂锁时更新数据", businessType = BusinessType.UPDATE)
     @PostMapping("/updateTicketLockTake")
-    public CommonResult<Boolean> updateTicketLockTake(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") ParamDTO list)
+    public CommonResult<Boolean> updateTicketLockTake(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") ParamDTO dto)
     {
-        return CommonResult.success(hardwareApiService.updateTicketLockTake(list));
+        return CommonResult.success(hardwareApiService.updateTicketLockTake(dto.getList()));
     }
 
     @ApiOperation("归还挂锁时更新数据")
@@ -83,9 +81,9 @@ public class HardwareApiController extends BaseController
     @ApiOperation("批量更新作业票下隔离点的上锁状况")
     @Log(title = "批量更新作业票下隔离点的上锁状况", businessType = BusinessType.UPDATE)
     @PostMapping("/updateLockPointBatch")
-    public CommonResult<Boolean> updateLockPointBatch(@RequestBody @Parameter(name = "dtos", description = "修改数据类,放到body") List<LockPointBatchDTO> list)
+    public CommonResult<Boolean> updateLockPointBatch(@RequestBody @Parameter(name = "dtos", description = "修改数据类,放到body") LPBParamDTO dto)
     {
-        return CommonResult.success(hardwareApiService.updateLockPointBatch(list));
+        return CommonResult.success(hardwareApiService.updateLockPointBatch(dto.getList()));
     }
 
 
@@ -93,9 +91,9 @@ public class HardwareApiController extends BaseController
     @ApiOperation("取出辅件时更新数据")
     @Log(title = "取出辅件时更新数据", businessType = BusinessType.UPDATE)
     @PostMapping("/updateLocksetTake")
-    public CommonResult<Boolean> updateLocksetTake(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") List<TakeLocksetDTO> list)
+    public CommonResult<Boolean> updateLocksetTake(@RequestBody @Parameter(name = "list", description = "修改数据类,放到body") LTParamDTO dto)
     {
-        return CommonResult.success(hardwareApiService.updateLocksetTake(list));
+        return CommonResult.success(hardwareApiService.updateLocksetTake(dto.getList()));
     }
 
     @ApiOperation("辅件绑定隔离点(辅件和给隔离点上锁时)")

+ 20 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/dto/hardwareApi/LPBParamDTO.java

@@ -0,0 +1,20 @@
+package com.ktg.iscs.domain.dto.hardwareApi;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * UpdateTicketLockDTO
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+@Data
+public class LPBParamDTO {
+
+    @ApiModelProperty(value = "传参数据")
+    private List<LockPointBatchDTO> list;
+
+}

+ 20 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/dto/hardwareApi/LTParamDTO.java

@@ -0,0 +1,20 @@
+package com.ktg.iscs.domain.dto.hardwareApi;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * UpdateTicketLockDTO
+ *
+ * @author cgj
+ * @date 2024-10-16
+ */
+@Data
+public class LTParamDTO {
+
+    @ApiModelProperty(value = "传参数据")
+    private List<TakeLocksetDTO> list;
+
+}

+ 1 - 1
ktg-iscs/src/main/java/com/ktg/iscs/domain/dto/hardwareApi/ParamDTO.java

@@ -14,7 +14,7 @@ import java.util.List;
 @Data
 public class ParamDTO {
 
-    @ApiModelProperty(value = "作业票ID")
+    @ApiModelProperty(value = "传参数据")
     private List<TakeTicketLockDTO> list;
 
 }

+ 6 - 1
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/HardwareApiServiceImpl.java

@@ -152,7 +152,12 @@ public class HardwareApiServiceImpl implements HardwareApiService {
             IsLock lock = iIsLockService.getOne(Wrappers.<IsLock>lambdaQuery()
                     .eq(IsLock::getLockNfc, dto.getLockNfc()));
             Assert.notNull(lock, "该nfc无对应的挂锁信息!");
-            // 1.1通过序列号查询柜子信息
+            // 1.1检查这把锁是不是已经在该作业票中使用
+            List<IsJobTicketLock> jobTicketLockList = iIsJobTicketLockService.list(Wrappers.<IsJobTicketLock>lambdaQuery()
+                    .eq(IsJobTicketLock::getTicketId, dto.getLockId())
+                    .eq(IsJobTicketLock::getLockId, lock.getLockId()));
+            Assert.isFalse(!jobTicketLockList.isEmpty(), lock.getLockName() + "已被取出!");
+            // 1.2通过序列号查询柜子信息
             IsHardware isHardware = isHardwareService.getOne(Wrappers.<IsHardware>lambdaQuery()
                     .eq(IsHardware::getSerialNumber, dto.getSerialNumber()));
             Assert.notNull(isHardware, "该序列号无对应的硬件信息!");

+ 1 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsJobTicketServiceImpl.java

@@ -75,6 +75,7 @@ public class IsJobTicketServiceImpl extends ServiceImpl<IsJobTicketMapper, IsJob
     {
         // 1.查询基础数据
         IsJobTicket jobTicket = isJobTicketMapper.selectIsJobTicketByTicketId(ticketId);
+        Assert.notNull(jobTicket, "作业票信息不存在!");
         JobTicketDetailVO jobTicketDetailVO = BeanUtils.toBean(jobTicket, JobTicketDetailVO.class);
         // 1.1 查询工作区域数据
         if (jobTicket != null && jobTicket.getWorkareaId() != null) {