From a058edded3901601f8597c66bcae687c5dbc4407 Mon Sep 17 00:00:00 2001
From: 刘小明 <liuxm_a@163.com>
Date: 星期三, 26 六月 2024 11:37:55 +0800
Subject: [PATCH] 记录维修步骤

---
 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java      |    2 
 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionNodeMapper.java        |    7 +
 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaRepairInfo.java               |   22 +----
 pms-parent/pms-global/src/main/resources/mapper/StaRepairInfoMapper.xml                       |   50 ++++--------
 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java               |    2 
 pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml              |   21 ++--
 pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java |   13 +++
 pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml                       |   18 ++--
 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java               |    2 
 pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml                    |    7 +
 pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml                       |   18 ++--
 pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/QueryVo.java          |    6 -
 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaAssemblyWorkLastMapper.java    |    3 
 pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java   |   63 +++++++++++++--
 14 files changed, 134 insertions(+), 100 deletions(-)

diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionNodeMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionNodeMapper.java
index 71176a2..19e63e3 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionNodeMapper.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrProductionNodeMapper.java
@@ -27,4 +27,11 @@
     List<PrProductionNode> selectByProcess(Long processId);
 
     void deleteByProcessId(Long id);
+
+    /**
+     * 鑺傜偣鏄粨鏉熻妭鐐规垨涔嬪悗鐨勮妭鐐�
+     * @param currNode
+     * @return
+     */
+    boolean isEndNode(Long currNode);
 }
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaAssemblyWorkLastMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaAssemblyWorkLastMapper.java
index b228f00..dea48a6 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaAssemblyWorkLastMapper.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaAssemblyWorkLastMapper.java
@@ -2,7 +2,6 @@
 
 import com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast;
 import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Options;
 
 import java.util.List;
 import java.util.Map;
@@ -20,7 +19,7 @@
 
     int insert(StaAssemblyWorkLast record);
 
-    @Options(useGeneratedKeys = true, keyProperty = "id")
+//    @Options(useGeneratedKeys = true, keyProperty = "id")
     int insertSelective(StaAssemblyWorkLast record);
 
     StaAssemblyWorkLast selectByPrimaryKey(Long id);
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java
index 17f2283..36e1b70 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java
@@ -35,7 +35,7 @@
     * 鐢熶骇鐧诲綍id
     */
     @JSONField(serializeUsing= ObjectWriterImplToString.class)
-    public Long claimId;
+    public Long workId;
     /**
     * 缁翠慨id
     */
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java
index 33cc91a..4d2a8f4 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java
@@ -35,7 +35,7 @@
     * 鐢熶骇鐧诲綍id
     */
     @JSONField(serializeUsing= ObjectWriterImplToString.class)
-    public Long claimId;
+    public Long workId;
     /**
     * 缁翠慨id
     */
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java
index 4bfedf4..89e9356 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java
@@ -35,7 +35,7 @@
     * 鐢熶骇鐧诲綍id
     */
     @JSONField(serializeUsing= ObjectWriterImplToString.class)
-    public Long claimId;
+    public Long workId;
     /**
     * 缁翠慨id
     */
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaRepairInfo.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaRepairInfo.java
index 25ae9c2..e69c07c 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaRepairInfo.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaRepairInfo.java
@@ -23,15 +23,17 @@
 @AllArgsConstructor
 public class StaRepairInfo implements BaseEntity {
 
-    /**
-    * 
-    */
     @JSONField(serializeUsing= ObjectWriterImplToString.class)
     public Long id;
     /**
     * 璁惧鐮�
     */
     public String equipNo;
+    /**
+    * 鐢熶骇鐧诲綍id
+    */
+    @JSONField(serializeUsing= ObjectWriterImplToString.class)
+    public Long workId;
     /**
     * 浠庡摢涓妭鐐硅繘鍏ョ淮淇�
     */
@@ -42,11 +44,6 @@
     */
     public String repairReason;
     /**
-    * 鍘诲悜鑺傜偣
-    */
-    @JSONField(serializeUsing= ObjectWriterImplToString.class)
-    public Long toNode;
-    /**
     * 缁翠慨鍛樺伐
     */
     @JSONField(serializeUsing= ObjectWriterImplToString.class)
@@ -55,15 +52,6 @@
     * 缁翠慨鏃堕棿
     */
     public Date repairTime;
-    /**
-    * 鍒涘缓鏃堕棿
-    */
-    public Date createTime;
-    /**
-    * 鎺ㄩ�佸憳宸�
-    */
-    @JSONField(serializeUsing= ObjectWriterImplToString.class)
-    public Long createBy;
 
 
 }
diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml
index dffaf9f..046ca0c 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml
@@ -153,6 +153,13 @@
             </if>
         </trim>
     </select>
+    <select id="isEndNode" resultType="java.lang.Boolean">
+        select
+            n.sort >=n1.sort
+        from pr_production_node n
+                 left join pr_production_node n1 on n.process_id = n1.process_id
+        where n1.id = #{id} and n.is_end=1
+    </select>
 
     <update id="deleteLogicById" parameterType="java.lang.Long">
         update pr_production_node set deleted = 1
diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml
index c6f32b4..8a85756 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml
@@ -7,7 +7,7 @@
     <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLast">
             <id property="id" column="id" jdbcType="BIGINT"/>
             <result property="equipNo" column="equip_no" jdbcType="VARCHAR"/>
-            <result property="claimId" column="claim_id" jdbcType="BIGINT"/>
+            <result property="workId" column="work_id" jdbcType="BIGINT"/>
             <result property="repairId" column="repair_id" jdbcType="BIGINT"/>
             <result property="planId" column="plan_id" jdbcType="BIGINT"/>
             <result property="stationId" column="station_id" jdbcType="BIGINT"/>
@@ -25,7 +25,7 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,equip_no,claim_id,
+        id,equip_no,work_id,
         repair_id,plan_id,station_id,
         curr_node,node_content,equip_cycle_content,
         status,result,
@@ -53,14 +53,14 @@
     </delete>
     <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLast" useGeneratedKeys="true">
         insert into sta_device_last
-        ( id,equip_no,claim_id
+        ( id,equip_no,work_id
         ,repair_id,plan_id,station_id
         ,curr_node,node_content,equip_cycle_content
         ,status,result
         ,error_code,assistants
         ,updated_by,in_time,out_time
         ,memo)
-        values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{claimId,jdbcType=BIGINT}
+        values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{workId,jdbcType=BIGINT}
         ,#{repairId,jdbcType=BIGINT},#{planId,jdbcType=BIGINT},#{stationId,jdbcType=BIGINT}
         ,#{currNode,jdbcType=BIGINT},#{nodeContent,jdbcType=VARCHAR},#{equipCycleContent,jdbcType=VARCHAR}
         ,#{status,jdbcType=TINYINT},#{result,jdbcType=TINYINT}
@@ -73,7 +73,7 @@
         <trim prefix="(" suffix=")" suffixOverrides=",">
                 <if test="id != null">id,</if>
                 <if test="equipNo != null">equip_no,</if>
-                <if test="claimId != null">claim_id,</if>
+                <if test="workId != null">work_id,</if>
                 <if test="repairId != null">repair_id,</if>
                 <if test="planId != null">plan_id,</if>
                 <if test="stationId != null">station_id,</if>
@@ -92,7 +92,7 @@
         <trim prefix="values (" suffix=")" suffixOverrides=",">
                 <if test="id != null">#{id,jdbcType=BIGINT},</if>
                 <if test="equipNo != null">#{equipNo,jdbcType=VARCHAR},</if>
-                <if test="claimId != null">#{claimId,jdbcType=BIGINT},</if>
+                <if test="workId != null">#{workId,jdbcType=BIGINT},</if>
                 <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if>
                 <if test="planId != null">#{planId,jdbcType=BIGINT},</if>
                 <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if>
@@ -115,8 +115,8 @@
                 <if test="equipNo != null">
                     equip_no = #{equipNo,jdbcType=VARCHAR},
                 </if>
-                <if test="claimId != null">
-                    claim_id = #{claimId,jdbcType=BIGINT},
+                <if test="workId != null">
+                    work_id = #{workId,jdbcType=BIGINT},
                 </if>
                 <if test="repairId != null">
                     repair_id = #{repairId,jdbcType=BIGINT},
@@ -167,7 +167,7 @@
         update sta_device_last
         set 
             equip_no =  #{equipNo,jdbcType=VARCHAR},
-            claim_id =  #{claimId,jdbcType=BIGINT},
+            work_id =  #{workId,jdbcType=BIGINT},
             repair_id =  #{repairId,jdbcType=BIGINT},
             plan_id =  #{planId,jdbcType=BIGINT},
             station_id =  #{stationId,jdbcType=BIGINT},
diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml
index 412af69..ba7f75c 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml
@@ -7,7 +7,7 @@
     <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLife">
             <id property="id" column="id" jdbcType="BIGINT"/>
             <result property="equipNo" column="equip_no" jdbcType="VARCHAR"/>
-            <result property="claimId" column="claim_id" jdbcType="BIGINT"/>
+            <result property="workId" column="work_id" jdbcType="BIGINT"/>
             <result property="repairId" column="repair_id" jdbcType="BIGINT"/>
             <result property="planId" column="plan_id" jdbcType="BIGINT"/>
             <result property="stationId" column="station_id" jdbcType="BIGINT"/>
@@ -25,7 +25,7 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,equip_no,claim_id,
+        id,equip_no,work_id,
         repair_id,plan_id,station_id,
         curr_node,node_content,equip_cycle_content,
         status,result,
@@ -46,14 +46,14 @@
     </delete>
     <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLife" useGeneratedKeys="true">
         insert into sta_device_life
-        ( id,equip_no,claim_id
+        ( id,equip_no,work_id
         ,repair_id,plan_id,station_id
         ,curr_node,node_content,equip_cycle_content
         ,status,result
         ,error_code,assistants,in_time
         ,out_time,updated_by,memo
         )
-        values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{claimId,jdbcType=BIGINT}
+        values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{workId,jdbcType=BIGINT}
         ,#{repairId,jdbcType=BIGINT},#{planId,jdbcType=BIGINT},#{stationId,jdbcType=BIGINT}
         ,#{currNode,jdbcType=BIGINT},#{nodeContent,jdbcType=VARCHAR},#{equipCycleContent,jdbcType=VARCHAR}
         ,#{status,jdbcType=TINYINT},#{result,jdbcType=TINYINT}
@@ -66,7 +66,7 @@
         <trim prefix="(" suffix=")" suffixOverrides=",">
                 <if test="id != null">id,</if>
                 <if test="equipNo != null">equip_no,</if>
-                <if test="claimId != null">claim_id,</if>
+                <if test="workId != null">work_id,</if>
                 <if test="repairId != null">repair_id,</if>
                 <if test="planId != null">plan_id,</if>
                 <if test="stationId != null">station_id,</if>
@@ -85,7 +85,7 @@
         <trim prefix="values (" suffix=")" suffixOverrides=",">
                 <if test="id != null">#{id,jdbcType=BIGINT},</if>
                 <if test="equipNo != null">#{equipNo,jdbcType=VARCHAR},</if>
-                <if test="claimId != null">#{claimId,jdbcType=BIGINT},</if>
+                <if test="workId != null">#{workId,jdbcType=BIGINT},</if>
                 <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if>
                 <if test="planId != null">#{planId,jdbcType=BIGINT},</if>
                 <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if>
@@ -108,8 +108,8 @@
                 <if test="equipNo != null">
                     equip_no = #{equipNo,jdbcType=VARCHAR},
                 </if>
-                <if test="claimId != null">
-                    claim_id = #{claimId,jdbcType=BIGINT},
+                <if test="workId != null">
+                    work_id = #{workId,jdbcType=BIGINT},
                 </if>
                 <if test="repairId != null">
                     repair_id = #{repairId,jdbcType=BIGINT},
@@ -160,7 +160,7 @@
         update sta_device_life
         set 
             equip_no =  #{equipNo,jdbcType=VARCHAR},
-            claim_id =  #{claimId,jdbcType=BIGINT},
+            work_id =  #{workId,jdbcType=BIGINT},
             repair_id =  #{repairId,jdbcType=BIGINT},
             plan_id =  #{planId,jdbcType=BIGINT},
             station_id =  #{stationId,jdbcType=BIGINT},
diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml
index 3ddb7c2..f3d3bb0 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml
@@ -7,7 +7,7 @@
     <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceProductionLog">
             <id property="id" column="id" jdbcType="BIGINT"/>
             <result property="equipNo" column="equip_no" jdbcType="VARCHAR"/>
-            <result property="claimId" column="claim_id" jdbcType="BIGINT"/>
+            <result property="workId" column="work_id" jdbcType="BIGINT"/>
             <result property="repairId" column="repair_id" jdbcType="BIGINT"/>
             <result property="planId" column="plan_id" jdbcType="BIGINT"/>
             <result property="stationId" column="station_id" jdbcType="BIGINT"/>
@@ -25,7 +25,7 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,equip_no,claim_id,
+        id,equip_no,work_id,
         repair_id,plan_id,station_id,
         curr_node,node_content,equip_cycle_content,
         status,result,
@@ -46,17 +46,17 @@
     </delete>
     <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceProductionLog" useGeneratedKeys="true">
         insert into sta_device_production_log
-        ( id,equip_no,claim_id
+        ( id,equip_no,work_id
         ,repair_id,plan_id,station_id
         ,curr_node,node_content,equip_cycle_content
         ,status,result
         ,error_code,assistants,in_time
         ,out_time,updated_by,memo
         )
-        values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{claimId,jdbcType=BIGINT}
+        values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{workId,jdbcType=BIGINT}
         ,#{repairId,jdbcType=BIGINT},#{planId,jdbcType=BIGINT},#{stationId,jdbcType=BIGINT}
         ,#{currNode,jdbcType=BIGINT},#{nodeContent,jdbcType=VARCHAR},#{equipCycleContent,jdbcType=VARCHAR}
-        ,#{nextNode,jdbcType=BIGINT},#{status,jdbcType=TINYINT},#{result,jdbcType=TINYINT}
+        ,#{status,jdbcType=TINYINT},#{result,jdbcType=TINYINT}
         ,#{errorCode,jdbcType=VARCHAR},#{assistants,jdbcType=VARCHAR},#{inTime,jdbcType=TIMESTAMP}
         ,#{outTime,jdbcType=TIMESTAMP},#{updatedBy,jdbcType=BIGINT},#{memo,jdbcType=VARCHAR}
         )
@@ -66,7 +66,7 @@
         <trim prefix="(" suffix=")" suffixOverrides=",">
                 <if test="id != null">id,</if>
                 <if test="equipNo != null">equip_no,</if>
-                <if test="claimId != null">claim_id,</if>
+                <if test="workId != null">work_id,</if>
                 <if test="repairId != null">repair_id,</if>
                 <if test="planId != null">plan_id,</if>
                 <if test="stationId != null">station_id,</if>
@@ -85,14 +85,13 @@
         <trim prefix="values (" suffix=")" suffixOverrides=",">
                 <if test="id != null">#{id,jdbcType=BIGINT},</if>
                 <if test="equipNo != null">#{equipNo,jdbcType=VARCHAR},</if>
-                <if test="claimId != null">#{claimId,jdbcType=BIGINT},</if>
+                <if test="workId != null">#{workId,jdbcType=BIGINT},</if>
                 <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if>
                 <if test="planId != null">#{planId,jdbcType=BIGINT},</if>
                 <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if>
                 <if test="currNode != null">#{currNode,jdbcType=BIGINT},</if>
                 <if test="nodeContent != null">#{nodeContent,jdbcType=VARCHAR},</if>
                 <if test="equipCycleContent != null">#{equipCycleContent,jdbcType=VARCHAR},</if>
-                <if test="nextNode != null">#{nextNode,jdbcType=BIGINT},</if>
                 <if test="status != null">#{status,jdbcType=TINYINT},</if>
                 <if test="result != null">#{result,jdbcType=TINYINT},</if>
                 <if test="errorCode != null">#{errorCode,jdbcType=VARCHAR},</if>
@@ -109,8 +108,8 @@
                 <if test="equipNo != null">
                     equip_no = #{equipNo,jdbcType=VARCHAR},
                 </if>
-                <if test="claimId != null">
-                    claim_id = #{claimId,jdbcType=BIGINT},
+                <if test="workId != null">
+                    work_id = #{workId,jdbcType=BIGINT},
                 </if>
                 <if test="repairId != null">
                     repair_id = #{repairId,jdbcType=BIGINT},
@@ -161,7 +160,7 @@
         update sta_device_production_log
         set 
             equip_no =  #{equipNo,jdbcType=VARCHAR},
-            claim_id =  #{claimId,jdbcType=BIGINT},
+            work_id =  #{workId,jdbcType=BIGINT},
             repair_id =  #{repairId,jdbcType=BIGINT},
             plan_id =  #{planId,jdbcType=BIGINT},
             station_id =  #{stationId,jdbcType=BIGINT},
diff --git a/pms-parent/pms-global/src/main/resources/mapper/StaRepairInfoMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/StaRepairInfoMapper.xml
index 65c0f0d..984ece3 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/StaRepairInfoMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/StaRepairInfoMapper.xml
@@ -7,19 +7,17 @@
     <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoSta.StaRepairInfo">
             <id property="id" column="id" jdbcType="BIGINT"/>
             <result property="equipNo" column="equip_no" jdbcType="VARCHAR"/>
+            <result property="workId" column="work_id" jdbcType="BIGINT"/>
             <result property="fromNode" column="from_node" jdbcType="BIGINT"/>
             <result property="repairReason" column="repair_reason" jdbcType="VARCHAR"/>
-            <result property="toNode" column="to_node" jdbcType="BIGINT"/>
             <result property="repairBy" column="repair_by" jdbcType="BIGINT"/>
             <result property="repairTime" column="repair_time" jdbcType="TIMESTAMP"/>
-            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
-            <result property="createBy" column="create_by" jdbcType="BIGINT"/>
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,equip_no,from_node,
-        repair_reason,to_node,repair_by,
-        repair_time,create_time,create_by
+        id,equip_no,work_id,
+        from_node,repair_reason,repair_by,
+        repair_time
     </sql>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -35,38 +33,32 @@
     </delete>
     <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaRepairInfo" useGeneratedKeys="true">
         insert into sta_repair_info
-        ( id,equip_no,from_node
-        ,repair_reason,to_node,repair_by
-        ,repair_time,create_time,create_by
-        )
-        values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{fromNode,jdbcType=BIGINT}
-        ,#{repairReason,jdbcType=VARCHAR},#{toNode,jdbcType=BIGINT},#{repairBy,jdbcType=BIGINT}
-        ,#{repairTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{createBy,jdbcType=BIGINT}
-        )
+        ( id,equip_no,work_id
+        ,from_node,repair_reason,repair_by
+        ,repair_time)
+        values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{workId,jdbcType=BIGINT}
+        ,#{fromNode,jdbcType=BIGINT},#{repairReason,jdbcType=VARCHAR},#{repairBy,jdbcType=BIGINT}
+        ,#{repairTime,jdbcType=TIMESTAMP})
     </insert>
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaRepairInfo" useGeneratedKeys="true">
         insert into sta_repair_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
                 <if test="id != null">id,</if>
                 <if test="equipNo != null">equip_no,</if>
+                <if test="workId != null">work_id,</if>
                 <if test="fromNode != null">from_node,</if>
                 <if test="repairReason != null">repair_reason,</if>
-                <if test="toNode != null">to_node,</if>
                 <if test="repairBy != null">repair_by,</if>
                 <if test="repairTime != null">repair_time,</if>
-                <if test="createTime != null">create_time,</if>
-                <if test="createBy != null">create_by,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
                 <if test="id != null">#{id,jdbcType=BIGINT},</if>
                 <if test="equipNo != null">#{equipNo,jdbcType=VARCHAR},</if>
+                <if test="workId != null">#{workId,jdbcType=BIGINT},</if>
                 <if test="fromNode != null">#{fromNode,jdbcType=BIGINT},</if>
                 <if test="repairReason != null">#{repairReason,jdbcType=VARCHAR},</if>
-                <if test="toNode != null">#{toNode,jdbcType=BIGINT},</if>
                 <if test="repairBy != null">#{repairBy,jdbcType=BIGINT},</if>
                 <if test="repairTime != null">#{repairTime,jdbcType=TIMESTAMP},</if>
-                <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
-                <if test="createBy != null">#{createBy,jdbcType=BIGINT},</if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaRepairInfo">
@@ -75,26 +67,20 @@
                 <if test="equipNo != null">
                     equip_no = #{equipNo,jdbcType=VARCHAR},
                 </if>
+                <if test="workId != null">
+                    work_id = #{workId,jdbcType=BIGINT},
+                </if>
                 <if test="fromNode != null">
                     from_node = #{fromNode,jdbcType=BIGINT},
                 </if>
                 <if test="repairReason != null">
                     repair_reason = #{repairReason,jdbcType=VARCHAR},
                 </if>
-                <if test="toNode != null">
-                    to_node = #{toNode,jdbcType=BIGINT},
-                </if>
                 <if test="repairBy != null">
                     repair_by = #{repairBy,jdbcType=BIGINT},
                 </if>
                 <if test="repairTime != null">
                     repair_time = #{repairTime,jdbcType=TIMESTAMP},
-                </if>
-                <if test="createTime != null">
-                    create_time = #{createTime,jdbcType=TIMESTAMP},
-                </if>
-                <if test="createBy != null">
-                    create_by = #{createBy,jdbcType=BIGINT},
                 </if>
         </set>
         where   id = #{id,jdbcType=BIGINT} 
@@ -103,13 +89,11 @@
         update sta_repair_info
         set 
             equip_no =  #{equipNo,jdbcType=VARCHAR},
+            work_id =  #{workId,jdbcType=BIGINT},
             from_node =  #{fromNode,jdbcType=BIGINT},
             repair_reason =  #{repairReason,jdbcType=VARCHAR},
-            to_node =  #{toNode,jdbcType=BIGINT},
             repair_by =  #{repairBy,jdbcType=BIGINT},
-            repair_time =  #{repairTime,jdbcType=TIMESTAMP},
-            create_time =  #{createTime,jdbcType=TIMESTAMP},
-            create_by =  #{createBy,jdbcType=BIGINT}
+            repair_time =  #{repairTime,jdbcType=TIMESTAMP}
         where   id = #{id,jdbcType=BIGINT} 
     </update>
 </mapper>
diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
index 6894e18..754eaac 100644
--- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
+++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
@@ -25,7 +25,7 @@
 
     @PostMapping(path = "save")
     public BaseResponse save(@RequestBody @Valid QueryVo vo) {
-        log.info("AssemblyStepCtrl.test()");
+        log.info("AssemblyStepCtrl.save()");
         int count = sv.save(vo);
         if (count <= 0) {
             return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
@@ -33,4 +33,15 @@
             return BaseResponseUtils.buildSuccess(true);
         }
     }
+
+    @PostMapping(path = "repair")
+    public BaseResponse repair(@RequestBody @Valid QueryVo vo) {
+        log.info("AssemblyStepCtrl.repair()");
+        int count = sv.repair(vo);
+        if (count <= 0) {
+            return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
+        } else {
+            return BaseResponseUtils.buildSuccess(true);
+        }
+    }
 }
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 e3b6538..3fa99a4 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
@@ -31,6 +31,7 @@
     private PrAssemblyPlanMapper assemblyPlanDao;
 //    private PrProductionProcessMapper processDao;
     private PrProductionNodeMapper nodeDao;
+    private StaRepairInfoMapper repairInfoDao;
     @Autowired
     public void setDeviceLastDao(StaDeviceLastMapper deviceLastDao) {
         this.deviceLastDao = deviceLastDao;
@@ -59,10 +60,14 @@
     public void setNodeDao(PrProductionNodeMapper nodeDao) {
         this.nodeDao = nodeDao;
     }
+    @Autowired
+    public void setRepairInfoDao(StaRepairInfoMapper repairInfoDao) {
+        this.repairInfoDao = repairInfoDao;
+    }
 
     public int save(QueryVo params) {
-        long taskId = Long.parseLong(params.taskId);
-        StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(taskId);
+        long workId = Long.parseLong(params.workId);
+        StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(workId);
         if (workLast == null) {
             throw new RuntimeException("宸ュ崟涓嶅瓨鍦�");
         }
@@ -88,7 +93,7 @@
             throw new RuntimeException("璁惧鍙锋湁涓斿彧鑳芥湁涓�涓�");
         }
 
-        StaDeviceLast deviceLast = saveDeviceLast(params, workLast, deviceList);
+        StaDeviceLast deviceLast = buildDeviceLast(params, workLast, deviceList.get(0));
         int count = deviceLast.id == null ? deviceLastDao.insertSelective(deviceLast) :
                 deviceLastDao.updateByPrimaryKeySelective(deviceLast);
 
@@ -117,22 +122,22 @@
         deviceLifeDao.insertSelective(life);
     }
 
-    private StaDeviceLast saveDeviceLast(QueryVo params, StaAssemblyWorkLast workLast, List<String> deviceList){
+    private StaDeviceLast buildDeviceLast(QueryVo params, StaAssemblyWorkLast workLast, String deviceNo){
         //缁勮鏁版嵁
         StaDeviceLast record = new StaDeviceLast();
 
-        StaDeviceLast preRecord = deviceLastDao.selectByDeviceNo(deviceList.get(0));
+        StaDeviceLast preRecord = deviceLastDao.selectByDeviceNo(deviceNo);
         if(preRecord != null){
             record.id = preRecord.id;
             record.inTime = preRecord.outTime;
         }
         record.outTime = new Date();
 
-        record.setPlanId(workLast.planId);
-        record.setClaimId(Long.parseLong(params.taskId));
-        record.setStationId(workLast.stationId);
-        record.setEquipNo(deviceList.get(0));
-        record.setCurrNode(workLast.nodeId);
+        record.planId = workLast.planId;
+        record.workId = Long.parseLong(params.workId);
+        record.stationId = workLast.stationId;
+        record.equipNo = deviceNo;
+        record.currNode = workLast.nodeId;
 //        record.setNextNode(getNextNode(params.status,workLast.nodeId));
 
         record.updatedBy = workLast.userId;
@@ -170,4 +175,42 @@
             default -> throw new RuntimeException("鐘舵�侀敊璇�");
         };
     }
+
+    public int repair(QueryVo vo) {
+        long workId = Long.parseLong(vo.workId);
+        StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(workId);
+        if (workLast == null) {
+            throw new RuntimeException("宸ュ崟涓嶅瓨鍦�");
+        }
+        StaDeviceLast preDeviceRecord = deviceLastDao.selectByDeviceNo(vo.deviceNo);
+        StaRepairInfo repairInfo = new StaRepairInfo();
+        repairInfo.workId = workId;
+        repairInfo.equipNo = vo.deviceNo;
+        repairInfo.repairTime = new Date();
+        repairInfo.repairBy = workLast.userId;
+        repairInfo.repairReason = vo.errorMsg;
+        repairInfo.fromNode = preDeviceRecord.currNode;
+        repairInfoDao.insertSelective(repairInfo);
+
+        StaDeviceLast deviceLast = new StaDeviceLast();
+        BeanUtils.copyProperties(preDeviceRecord, deviceLast);
+        deviceLast.repairId = repairInfo.id;
+        deviceLast.errorCode = vo.errorMsg;
+        deviceLast.assistants = vo.assistants;
+        //濡傛灉鍘熻妭鐐规槸缁撴潫鑺傜偣鎴栦箣鍚庣殑鑺傜偣锛屾槸鍒欐洿鏂颁负瀹屾垚,鍚﹀垯鏇存柊涓虹粍瑁呬腑(榛樿缁翠慨鑺傜偣鐨勭姸鎬佸彧鑳戒负 纭畾鎴� 鎶ュ簾)
+        boolean isEndNode = nodeDao.isEndNode(preDeviceRecord.currNode);
+        if(QrCodeConstant.MarkWaste.equals(vo.status)){
+            deviceLast.status = STATUS_WASTE;
+        }else{
+            deviceLast.status = isEndNode? STATUS_COMPLETE:STATUS_OK;
+        }
+        int count = deviceLast.id == null ? deviceLastDao.insertSelective(deviceLast) :
+                deviceLastDao.updateByPrimaryKeySelective(deviceLast);
+        saveDeviceProductionLog(deviceLast);
+
+        if (isEndNode) {
+            saveDeviceLife(deviceLast);
+        }
+        return count;
+    }
 }
diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/QueryVo.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/QueryVo.java
index 91484d8..6ef34d1 100644
--- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/QueryVo.java
+++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/QueryVo.java
@@ -14,7 +14,7 @@
     @NotEmpty(message = "璁惧缂栧彿涓嶈兘涓虹┖")
     public String deviceNo;
     @NotNull(message = "浠诲姟缂栧彿涓嶈兘涓虹┖")
-    public String taskId;
+    public String workId;
     @NotNull(message = "鐘舵�佷笉鑳戒负绌�")
     public String status;
     /**
@@ -26,8 +26,4 @@
      */
     public String assistants;
 
-    public void setTaskId(String taskId) {
-        taskId = taskId.replace("", "103");
-        this.taskId = taskId;
-    }
 }

--
Gitblit v1.8.0