hongxudong 3 lat temu
rodzic
commit
e122871770

+ 7 - 0
src/main/java/com/dk/mdm/infrastructure/strategy/production/strategy/FinishCheckStrategy.java

@@ -1,5 +1,6 @@
 package com.dk.mdm.infrastructure.strategy.production.strategy;
 
+import com.dk.common.infrastructure.enums.ErrorCodeEnum;
 import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
@@ -44,6 +45,12 @@ public class FinishCheckStrategy implements ProductionStrategy {
             return checkRes;
         }
 
+        //产品分级,在现在工艺节点的分级里
+        if (!processNode.getJudgeGradeIds().contains(collectCommand.getOpnGradeId())) {
+            return ResponseResultUtil.error(ErrorCodeEnum.COLLECT_CHECK_GRADE_NOT_IN_NODE.getCode(),
+                    ErrorCodeEnum.COLLECT_CHECK_GRADE_NOT_IN_NODE.getMessage());
+        }
+
         return ResponseResultUtil.success();
     }
 

+ 7 - 0
src/main/java/com/dk/mdm/infrastructure/strategy/production/strategy/HalfCheckStrategy.java

@@ -1,6 +1,7 @@
 package com.dk.mdm.infrastructure.strategy.production.strategy;
 
 import com.dk.common.infrastructure.constant.Constant;
+import com.dk.common.infrastructure.enums.ErrorCodeEnum;
 import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
@@ -48,6 +49,12 @@ public class HalfCheckStrategy implements ProductionStrategy {
             return checkRes;
         }
 
+        //产品分级,在现在工艺节点的分级里
+        if (!processNode.getJudgeGradeIds().contains(collectCommand.getOpnGradeId())) {
+            return ResponseResultUtil.error(ErrorCodeEnum.COLLECT_CHECK_GRADE_NOT_IN_NODE.getCode(),
+                    ErrorCodeEnum.COLLECT_CHECK_GRADE_NOT_IN_NODE.getMessage());
+        }
+
         return ResponseResultUtil.success();
     }
 

+ 3 - 0
src/main/java/com/dk/mdm/mapper/pdm/ProcessNodeMapper.xml

@@ -226,6 +226,8 @@
                         where tpnu.node_id = tpn.node_id
                           and tpnu.user_id = #{userId}
                           and tpnu.user_kind = tpn.user_kind)
+                   ,
+                   tpn.user_kind
                    ) as user_kind,
                stat.station_id,
                stat.station_name
@@ -238,6 +240,7 @@
             where twuc.station_id is not null
               and twuc.user_id = #{userId}
               and tws.flow_node_id = #{id}::uuid
+              and tws.flg_valid
         ) stat on stat.flow_node_id = tpn.node_id
         WHERE tpn.node_id = #{id}::uuid
     </select>

+ 1 - 1
src/main/java/com/dk/mdm/mapper/pdm/ProductionDefectMapper.xml

@@ -161,7 +161,7 @@
         </foreach>
     </insert>
 
-    <select id="getNextId" resultType="Long">
+    <select id="getNextId" resultType="Long" flushCache="true">
         select nextval('pdm.t_production_defect_prod_defect_id_seq')
     </select>