From 4c7296d45efe849dc70a3b2e2240c905481a91c9 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期一, 29 九月 2025 17:44:46 +0800
Subject: [PATCH] 工控网涉密网联调

---
 blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/entity/NcNode.java |  215 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 204 insertions(+), 11 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 7e2fbfe..9e7d424 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,17 +1,85 @@
 package org.springblade.mdm.program.entity;
 
+import com.alibaba.excel.util.StringUtils;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Getter;
 import lombok.Setter;
 import org.springblade.core.mp.base.BizEntity;
+import org.springblade.mdm.flow.entity.FlowProgramFile;
 
-import java.time.LocalDate;
-import java.time.LocalDateTime;
+import java.util.Date;
+
 
 @Setter
 @Getter
 @TableName("mdm_nc_node")
 public class NcNode extends BizEntity {
+	/**
+	 * 鑺傜偣绫诲瀷锛� 绋嬪簭鐘舵�� 10
+	 */
+	public static final String TYPE_PROGRAM_STATUS = "10";
+	/*
+	浜у搧鍨嬪彿
+	 */
+	public static final String TYPE_PRODUCT_MODEL = "15";
+	/**
+	 * 鑺傜偣绫诲瀷锛� 闆剁粍浠跺彿/鍥惧彿 10
+	 */
+	public static final String TYPE_DRAWING_NO = "20";
+	/**
+	 * 宸ヨ壓鐗堟
+	 *
+	 */
+	public static final String TYPE_CRAFT_EDITION = "30";
+	/**
+	 * 宸ュ簭鍙�
+	 *
+	 */
+	public static final String TYPE_PROCESS_NO = "40";
+	/**
+	 * 宸ュ簭鐗堟
+	 */
+	public static final String TYPE_PROCESS_EDITION = "45";
+	/**
+	 * 鍔犲伐鏈哄簥
+	 */
+	//public static final String TYPE_MACHINE_CODE = "50";
+	/**
+	 * 鍔犲伐鏈哄簥
+	 */
+	public static final String TYPE_MACHINE_GROUP = "50";
+	/**
+	 * 绋嬪簭鍖呭悕
+	 */
+	public static final String TYPE_PROGRAM_PACKAGE = "60";
+
+	/**
+	 * 绋嬪簭鏂囦欢
+	 */
+	public static final String TYPE_PROGRAM_FILE = "70";
+
+	/**
+	 * 鏈攣瀹�
+	 */
+	public static final int UNLOCK = 0;
+	/**
+	 * 宸查攣瀹�
+	 */
+	public static final int LOCKED = 1;
+
+	/**
+	 * 鏂囦欢鑺傜偣鏂囦欢绫诲瀷锛氱▼搴�
+	 */
+	public static final String FILE_CATEGOAY_PROGRAM = "program";
+	/**
+	 * 鏂囦欢鑺傜偣鏂囦欢绫诲瀷锛氬叾浠�
+	 */
+	public static final String FILE_CATEGORY_OTHER = "other";
+	/**
+	 * 鏂囦欢鑺傜偣鏂囦欢绫诲瀷锛氬瓙绋嬪簭
+	 */
+	public static final String FILE_CATEGORY_SUBPROGRAM = "subprogram";
+
 	private String name;
 	private Long parentId;
 
@@ -24,8 +92,10 @@
 	 */
 	private String machineCode;
 
-
-
+	/**
+	 * 鏈哄簥缁勫瓧鍏稿悧
+	 */
+	private String machineGroupCode;
 	/**
 	 * 宸ュ簭锛屽鈥滅簿閾b��
 	 */
@@ -34,33 +104,37 @@
 	/**
 	 * 宸ュ簭鐗堟
 	 */
-	//private String processEdition;
+	private String processEdition;
 
 	/**
 	 * 宸ヨ壓鐗堟
 	 */
-	//private String craftEdition;
+	private String craftEdition;
+	/**
+	 * 鏄惁鏈�鏂扮増娆★紝1锛氭渶鏂扮増娆★紱0:鍘嗗彶鐗堟
+	 */
+	private Integer isLastEdition = 1;
 	/**
 	 * 闆剁粍浠跺彿/鍥惧彿
 	 */
-	private String partNo;
+	private String drawingNo;
 	/**
 	 * 鍥惧彿鐗堟
 	 */
-	//private String partNoEdition;
+	private String drawingNoEdition;
 
 	/**
 	 * 鏄惁鍥哄寲
 	 */
-	private Integer isCured;
+	private Integer isCured = 0;
 	/**
 	 * 杩囨湡鏃ユ湡
 	 */
-	//private LocalDate expireDate;
+	private Date expireDate;
 	/**
 	 * 鏄惁閿佸畾
 	 */
-	//private Integer isLocked;
+	private Integer isLocked = 0;
 	/**
 	 * 鑺傜偣绫诲瀷锛氬瓧鍏�
  	 */
@@ -68,6 +142,125 @@
 
 	private String description;
 	private String remark;
+	//0808鏂板
+	/**
+	 * 绋嬪簭鏂囦欢鑺傜偣鐨勬暟鎹�
+	 */
+	private String processNo;
+	/**
+	 * 浜у搧鍨嬪彿
+	 */
+	private String productModel;
 
+	/**
+	 * 绋嬪簭缂栧彿锛堢▼搴忓寘鍚嶈妭鐐归渶瑕侊級
+	 */
+	private String programNo;
 
+	/**
+	 * 鍘嗗彶搴忓垪鍙�
+	 */
+	private Long hisSerial;
+
+	/**
+	 * 娴佺▼绋嬪簭鏂囦欢id锛屽彧鏈夌▼搴忔枃浠讹紙70锛夌被鍨嬬殑鑺傜偣鏈夋鍊�
+	 */
+	private Long flowProgramFileId;
+
+	/**
+	 * 瀹℃壒鏃剁殑娴佺▼瀹炰緥id锛屽彧鏈夌▼搴忓寘鑺傜偣鏈夎繖涓瓧娈靛��
+	 */
+	private String processInstanceId;
+	/**
+	 * 鍋忕鍗曞彿
+	 */
+	private String deviation;
+	/**
+	 * 鐗堟湰鍙凤紝鏇存柊涓�娆★紙鍏ュ崌鐗堬紝dnc瀵煎叆锛夛紝灏变細+1
+	 */
+	private Integer versionNumber = 1;
+
+	transient FlowProgramFile flowProgramFile;
+
+	/**
+	 * 鏄惁鏄亸绂荤▼搴�
+	 * @return 鏄惁鍋忕
+	 */
+	public boolean isDeviationProgram(){
+		return StringUtils.isNotBlank(this.deviation);
+	}
+	/**
+	 * 鏍规嵁褰撳墠鐗堟湰鍙凤紝鑾峰彇鏂板鐗堟湰鍙�
+	 * @return 鍗囩骇鍚庣殑鐗堟湰鍙�
+	 */
+	public int genNewVersionNumber(){
+		if(this.versionNumber == null){
+			return 1;
+		}else{
+			return this.versionNumber + 1;
+		}
+	}
+
+	/**
+	 * 鏄惁鍦ㄦ湁鏁堟湡鍐�
+	 * @return 鏄惁
+	 */
+	public boolean withinValidityPeriod() {
+		if(expireDate == null){
+			return true;
+		}
+		return expireDate.getTime() > System.currentTimeMillis();
+	}
+
+	/**
+	 * 鏄惁宸茬粡鍥哄寲
+	 * @return 鏄惁
+	 */
+	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();
+	}
+
+	/**
+	 * 缁勮绋嬪簭鍚嶇О
+	 * @return 绋嬪簭鍚嶇О
+	 */
+	public String programName(){
+		return this.drawingNo+"-"+this.getProcessNo()+"-"+this.getProcessEdition();
+	}
 }

--
Gitblit v1.9.3