From d175d9c401fb97ebe6a580005a8c9ad5fedccb6b Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期一, 29 七月 2024 17:02:41 +0800
Subject: [PATCH] add other method

---
 pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java |   44 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
index 3d7179b..336c43f 100644
--- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
+++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
@@ -281,6 +281,7 @@
         if (WORK_TYPE_ASSEMBLY.equals(workType) || WORK_TYPE_TEST.equals(workType) || WORK_TYPE_INSPECTION.equals(workType) || WORK_TYPE_REPAIR.equals(workType)) {
             return switch (status) {
                 case QrCodeConstant.MarkOk -> isEnd ? DeviceStatus.COMPLETED.getCode() : DeviceStatus.ASSEMBLING.getCode();
+                case QrCodeConstant.MarkQualified -> isEnd ? DeviceStatus.COMPLETED.getCode() : DeviceStatus.ASSEMBLING.getCode();
                 case QrCodeConstant.MarkUnqualified -> DeviceStatus.REPAIR.getCode();
                 case QrCodeConstant.MarkWaste -> DeviceStatus.WASTE.getCode();
                 default -> throw new RuntimeException("鐘舵�侀敊璇�");
@@ -304,14 +305,14 @@
             //娴嬭瘯
         }else if (WORK_TYPE_TEST.equals(workType)) {
             return switch (status) {
-                case QrCodeConstant.MarkOk -> DeviceResult.TEST_PASS.getCode();
+                case QrCodeConstant.MarkQualified  -> DeviceResult.TEST_PASS.getCode();
                 case QrCodeConstant.MarkUnqualified -> DeviceResult.TEST_FAIL.getCode();
                 default -> throw new RuntimeException("鐘舵�侀敊璇�");
             };
             //鍝佹
         }else if (WORK_TYPE_INSPECTION.equals(workType)) {
             return switch (status) {
-                case QrCodeConstant.MarkOk -> DeviceResult.INSPECTION_PASS.getCode();
+                case QrCodeConstant.MarkQualified -> DeviceResult.INSPECTION_PASS.getCode();
                 case QrCodeConstant.MarkUnqualified -> DeviceResult.INSPECTION_FAIL.getCode();
                 default -> throw new RuntimeException("鐘舵�侀敊璇�");
             };
@@ -325,6 +326,7 @@
         }
         throw new RuntimeException("鐘舵�侀敊璇紝鏃犳晥鐨勮妭鐐圭被鍨�: " + workType);
     }
+    @Transactional
     public int repair(QueryVo vo) {
         long workId = Long.parseLong(vo.workId);
         StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(workId);
@@ -353,6 +355,7 @@
         return count;
     }
 
+    @Transactional
     public int testing(QueryVo vo) {
         long workId = Long.parseLong(vo.workId);
         StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(workId);
@@ -370,6 +373,41 @@
         return count;
     }
 
+    @Transactional
+    public int inspectQuality(QueryVo vo) {
+        long workId = Long.parseLong(vo.workId);
+        StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(workId);
+        if (workLast == null) {
+            throw new RuntimeException("绯荤粺涓病鏈夎鏉$櫥褰曚俊鎭�");
+        }
+        StaDeviceLast deviceLast = buildDeviceLast(vo, workLast, vo.deviceNo[0]);
+        int count = deviceLast.id == null ? deviceLastDao.insertSelective(deviceLast) :
+                deviceLastDao.updateByPrimaryKeySelective(deviceLast);
+        saveDeviceProductionLog(deviceLast);
+        PrProductionNode node = nodeDao.selectByPrimaryKey(workLast.nodeId);
+        if (node.isRecord) {
+            saveDeviceLife(deviceLast);
+        }
+        return count;
+    }
+    //鏃犱换鍔¤鍒掍腑鐨勫叾浠� 浼爓orkId ,鎵嬪啓宸ヤ綔鍐呭 , 鏁伴噺
+    @Transactional
+    public int other(QueryVo vo) {
+        long workId = Long.parseLong(vo.workId);
+        StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(workId);
+        if (workLast == null) {
+            throw new RuntimeException("绯荤粺涓病鏈夎鏉$櫥褰曚俊鎭�");
+        }
+        StaDeviceLast deviceLast = buildDeviceLast(vo, workLast, vo.deviceNo[0]);
+        int count = deviceLast.id == null ? deviceLastDao.insertSelective(deviceLast) :
+                deviceLastDao.updateByPrimaryKeySelective(deviceLast);
+        saveDeviceProductionLog(deviceLast);
+        PrProductionNode node = nodeDao.selectByPrimaryKey(workLast.nodeId);
+        if (node.isRecord) {
+            saveDeviceLife(deviceLast);
+        }
+        return count;
+    }
     //鏍规嵁鑺傜偣鏌ュ嚭鑺傜偣浣滀笟鎸囧涔�
     public PrProductionNode getSopByNodeId(String nodeId) {
         if (com.alibaba.excel.util.StringUtils.isBlank(nodeId)) {
@@ -525,4 +563,6 @@
     public List<StaDeviceProductionLog> queryLogByDeviceNo(String devoiceNo) {
         return deviceProductionLogDao.selectByDeviceNo(devoiceNo);
     }
+
+
 }

--
Gitblit v1.8.0