From d4ca3871c18474768c924fcbfd6e8d3178040092 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期一, 15 九月 2025 01:19:56 +0800
Subject: [PATCH] 性能优化

---
 blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/entity/NcNode.java |   76 +++++++++++++++++++++++++++++++++++---
 1 files changed, 70 insertions(+), 6 deletions(-)

diff --git a/blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/entity/NcNode.java b/blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/entity/NcNode.java
index 547aba6..1d21dec 100644
--- a/blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/entity/NcNode.java
+++ b/blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/entity/NcNode.java
@@ -1,5 +1,6 @@
 package org.springblade.mdm.program.entity;
 
+import com.alibaba.excel.util.StringUtils;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Getter;
 import lombok.Setter;
@@ -42,7 +43,11 @@
 	/**
 	 * 鍔犲伐鏈哄簥
 	 */
-	public static final String TYPE_MACHINE_CODE = "50";
+	//public static final String TYPE_MACHINE_CODE = "50";
+	/**
+	 * 鍔犲伐鏈哄簥
+	 */
+	public static final String TYPE_MACHINE_GROUP = "50";
 	/**
 	 * 绋嬪簭鍖呭悕
 	 */
@@ -52,6 +57,15 @@
 	 * 绋嬪簭鏂囦欢
 	 */
 	public static final String TYPE_PROGRAM_FILE = "70";
+
+	/**
+	 * 鏈攣瀹�
+	 */
+	public static final int UNLOCK = 0;
+	/**
+	 * 宸查攣瀹�
+	 */
+	public static final int LOCKED = 1;
 
 	/**
 	 * 鏂囦欢鑺傜偣鏂囦欢绫诲瀷锛氱▼搴�
@@ -78,11 +92,10 @@
 	 */
 	private String machineCode;
 
-
 	/**
-	 * 鏂囦欢绫诲瀷锛屽彧鏈�
+	 * 鏈哄簥缁勫瓧鍏稿悧
 	 */
-	//private String fileCategory;
+	private String machineGroupCode;
 	/**
 	 * 宸ュ簭锛屽鈥滅簿閾b��
 	 */
@@ -113,7 +126,7 @@
 	/**
 	 * 鏄惁鍥哄寲
 	 */
-	private Integer isCured;
+	private Integer isCured = 0;
 	/**
 	 * 杩囨湡鏃ユ湡
 	 */
@@ -145,6 +158,11 @@
 	private String programNo;
 
 	/**
+	 * 鍘嗗彶搴忓垪鍙�
+	 */
+	private Long hisSerial;
+
+	/**
 	 * 娴佺▼绋嬪簭鏂囦欢id锛屽彧鏈夌▼搴忔枃浠讹紙70锛夌被鍨嬬殑鑺傜偣鏈夋鍊�
 	 */
 	private Long flowProgramFileId;
@@ -153,7 +171,10 @@
 	 * 瀹℃壒鏃剁殑娴佺▼瀹炰緥id锛屽彧鏈夌▼搴忓寘鑺傜偣鏈夎繖涓瓧娈靛��
 	 */
 	private String processInstanceId;
-
+	/**
+	 * 鍋忕鍗曞彿
+	 */
+	private String deviation;
 	/**
 	 * 鐗堟湰鍙凤紝鏇存柊涓�娆★紙鍏ュ崌鐗堬紝dnc瀵煎叆锛夛紝灏变細+1
 	 */
@@ -161,6 +182,13 @@
 
 	transient FlowProgramFile flowProgramFile;
 
+	/**
+	 * 鏄惁鏄亸绂荤▼搴�
+	 * @return 鏄惁鍋忕
+	 */
+	public boolean isDeviationProgram(){
+		return StringUtils.isNotBlank(this.deviation);
+	}
 	/**
 	 * 鏍规嵁褰撳墠鐗堟湰鍙凤紝鑾峰彇鏂板鐗堟湰鍙�
 	 * @return 鍗囩骇鍚庣殑鐗堟湰鍙�
@@ -191,4 +219,40 @@
 	public boolean hasCured() {
 		return this.isCured != null && this.isCured == 1;
 	}
+
+	public void upgradeVersionNumber() {
+		this.versionNumber = genNewVersionNumber();
+	}
+
+	/**
+	 * 閿佸畾鑺傜偣
+	 */
+	public void lock() {
+		this.isLocked = LOCKED;
+	}
+
+	/**
+	 * 閿佸畾鑺傜偣
+	 * @param remark 閿佸畾鍘熷洜
+	 */
+	public void lock(String remark) {
+		this.isLocked = LOCKED;
+		this.remark = remark;
+	}
+
+	public void unlock() {
+		this.isLocked = UNLOCK;
+	}
+
+	/**
+	 * 鏄惁宸查攣瀹�
+	 * @return 鏄惁
+	 */
+    public boolean hasLocked() {
+		return this.isLocked != null && this.isLocked == LOCKED;
+    }
+
+	public String subNodeParentIds(){
+		return this.parentIds+","+this.getId();
+	}
 }

--
Gitblit v1.9.3