车车 11 mesi fa
parent
commit
f5e394fd8c

+ 1 - 2
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsJobCardController.java

@@ -17,7 +17,6 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.Parameters;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
@@ -107,7 +106,7 @@ public class IsJobCardController extends BaseController
      * 修改工作卡
      */
     @ApiOperation("修改工作卡")
-    @PreAuthorize("@ss.hasPermi('iscs:card:edit')")
+    // @PreAuthorize("@ss.hasPermi('iscs:card:edit')")
     @Log(title = "工作卡", businessType = BusinessType.UPDATE)
     @PostMapping("/updateIsJobCard")
     public CommonResult<Boolean> updateIsJobCard(@RequestBody @Parameter(name = "isJobCard", description = "修改数据类,放到body") IsJobCard isJobCard)

+ 8 - 9
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/HardwareApiServiceImpl.java

@@ -84,7 +84,12 @@ public class HardwareApiServiceImpl implements HardwareApiService {
                     .set(IsJobTicketKey::getFromHardwareId, isHardware.getId())
                     .set(IsJobTicketKey::getCollectTime, date)
                     .set(IsJobTicketKey::getKeyStatus, KeyStatusEnum.TAKED.status));
-
+            // 上锁阶段需要变更状态
+            JobTicketUpdateProgressReqVO reqVO = new JobTicketUpdateProgressReqVO();
+            reqVO.userId = SecurityUtils.getUserId();
+            reqVO.ticketId = dto.getTicketId();
+            reqVO.equipStatus = 3;
+            isJobTicketService.updateTicketProgress(reqVO);
         } else {
             // 3.1解锁阶段取钥匙
             iIsJobTicketKeyService.update(Wrappers.<IsJobTicketKey>lambdaUpdate()
@@ -95,12 +100,6 @@ public class HardwareApiServiceImpl implements HardwareApiService {
                     .set(IsJobTicketKey::getCollectTime, date)
                     .set(IsJobTicketKey::getKeyStatus, KeyStatusEnum.TAKED.status));
         }
-
-        JobTicketUpdateProgressReqVO reqVO = new JobTicketUpdateProgressReqVO();
-        reqVO.userId = SecurityUtils.getUserId();
-        reqVO.ticketId = dto.getTicketId();
-        reqVO.equipStatus = 3;
-        isJobTicketService.updateTicketProgress(reqVO);
         return true;
     }
 
@@ -374,11 +373,11 @@ public class HardwareApiServiceImpl implements HardwareApiService {
                         .set(IsJobTicketLock::getLockStatus, LockStatusEnum.REMOVED_LOCK.status));
             }
         }
-        JobTicketUpdateProgressReqVO reqVO = new JobTicketUpdateProgressReqVO();
+        /*JobTicketUpdateProgressReqVO reqVO = new JobTicketUpdateProgressReqVO();
         reqVO.userId = SecurityUtils.getUserId();
         reqVO.ticketId = list.get(0).getTicketId();
         reqVO.equipStatus = 3;
-        isJobTicketService.updateTicketProgress(reqVO);
+        isJobTicketService.updateTicketProgress(reqVO);*/
 
         return true;
     }

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

@@ -452,6 +452,7 @@ public class IsJobTicketServiceImpl extends ServiceImpl<IsJobTicketMapper, IsJob
                         jobUser.setJobStatus(JobStatusEnum.UNLOCKED.status);
                         // 检查所有设备归还,钥匙归还,锁没还完:已解锁(ticket_status),都还:已完成(ticket_status)
                         int toolRst = checkToolReturn(isJobTicket.getTicketId());
+                        System.out.println("1-------------" + toolRst);
                         if (toolRst == 1) {
                             isJobTicket.setTicketStatus(UNLOCKED.status);
                         } else if (toolRst == 2) {
@@ -468,6 +469,7 @@ public class IsJobTicketServiceImpl extends ServiceImpl<IsJobTicketMapper, IsJob
 //                    }
                     // 检查所有设备归还,钥匙归还,锁没还完:已解锁(ticket_status),都还:已完成(ticket_status)
                     int toolRst = checkToolReturn(isJobTicket.getTicketId());
+                    System.out.println("2-------------" + toolRst);
                     if (toolRst == 1) {
                         isJobTicket.setTicketStatus(UNLOCKED.status);
                     } else if (toolRst == 2) {