chr
2025-01-03 31a636e735a0addc56e4f4527f500b7aa0874eb5
PdmSwPlugin.Common/Entity/Pdm/PdmBom.cs
@@ -85,6 +85,14 @@
            set => RaiseAndSetIfChanged(ref _status, value);
        }
        private bool? _inKeeDeeDb;
        public bool? inKeeDeeDb
        {
            get => _inKeeDeeDb;
            set => RaiseAndSetIfChanged(ref _inKeeDeeDb, value);
        }
        private string _auditId;
        public string auditId
        {
@@ -116,6 +124,26 @@
    /// </summary>
    public class DrawInfo : NotifyBase
    {
        /// <summary>
        /// true说明没有工程图
        /// </summary>
        public bool _noDrw = false;
        public bool noDrw
        {
            get => _noDrw;
            set => RaiseAndSetIfChanged(ref _noDrw, value);
        }
        public bool _inKeeDeeDb = false;
        private bool _isSpecial;
        public bool isSpecial
        {
            get => _isSpecial;
            set => RaiseAndSetIfChanged(ref _isSpecial, value);
        }
        /// <summary>
        /// 3Dmd5
        /// </summary>
@@ -169,6 +197,10 @@
        public List<string> errMessages { get; set; }
        public Dictionary<string, string> allProperties { get; set; }
        /// <summary>
        /// 为True说明没有工程图
        /// </summary>
    }
    [Serializable]
@@ -197,6 +229,11 @@
            set => RaiseAndSetIfChanged(ref _treeId, value);
        }
        /// <summary>
        /// true说明没有工程图
        /// </summary>
        public bool noDrw => (_drawInfo?.noDrw == true);
        public string id => BomInfo?.id;
        public string name => BomInfo?.name;
        public string partNo => BomInfo?.partNo;
@@ -222,10 +259,6 @@
        public string checkUserId => BomInfo?.checkUserId;
        public string checkUserName => BomInfo?.checkUserName;
        #region 规则检查相关字段
        #endregion
        #region 图纸审核相关字段
        public string drawStatus => BomInfo?.status;
        public string requestUserId => BomInfo?.requestUserId;
@@ -244,8 +277,15 @@
        /// <summary>
        /// 图纸是否发生变更 非历史图纸看2D图MD5 历史图纸看一致性检查没通过
        /// </summary>
        public bool localDocChanged => (!IsHistoryData && localD2Md5 != _drawInfo?.d2Md5)
            || (IsHistoryData && _drawInfo?.checkRuleResult == 2); //localD3Md5 != _drawInfo?.d3Md5;
        public bool localDocChanged
        {
            get
            {
                //if (!IsHistoryData) return localD2Md5 != _drawInfo?.d2Md5; //(!IsHistoryData && localD2Md5 != _drawInfo?.d2Md5)
                //return (IsHistoryData && _drawInfo?.checkRuleResult == 2);
                return false;
            }
        }
        /// <summary>
        /// 规则检查结果
        /// </summary>
@@ -277,24 +317,29 @@
            {
                // 找不到文档的不审核
                if (lost) return false;
                // 不在物料明细表中不审核
                if (ExcludeFromBOM) return false;
                // 模组不审核
                if (produceWay == "模组") return false;
                // 跳过检查的不审
                if (skipCheck) return false;
                // 进入系统的不审核
                if (BomInfo.inKeeDeeDb == true) return false;
                //if (_drawInfo.isSpecial) return false;
                // 待审核的不重复提交
                if (drawStatus == "submitted" || drawStatus == "resubmitted") return false;
                if (IsHistoryData)
                {
                    // 历史图纸只审核一致性不通过的 和被驳回的
                    return _drawInfo.checkRuleResult == 2 || drawStatus == "rejected";
                }
                else
                {
                    // 非历史图纸只审核 允许审核的加工件
                    return produceWay == "加工件"
                            && (drawStatus != "submitted" && drawStatus != "resubmitted")
                            && (drawStatus != "completed" || localDocChanged);
                }
                return produceWay == "加工件" && (drawStatus != "submitted" && drawStatus != "resubmitted")
                            && (drawStatus != "completed");
                /// 以前还要分图纸变更,现在不弄了
                //if (IsHistoryData)
                //{
                //    // 历史图纸只审核一致性不通过的 和被驳回的
                //    return _drawInfo.checkRuleResult == 2 || drawStatus == "rejected";
                //}
                //else
                //{
                //    // 非历史图纸只审核 允许审核的加工件
                //    return produceWay == "加工件"
                //            && (drawStatus != "submitted" && drawStatus != "resubmitted")
                //            && (drawStatus != "completed" || localDocChanged);
                //}
            }
        }
@@ -304,18 +349,18 @@
        /// <returns></returns>
        public string NeedStopCheckIn()
        {
            if (produceWay == "模组") return null;
            if (ExcludeFromBOM) return null;
            if (skipCheck) return null;
            if (BomInfo.inKeeDeeDb == true) return null;
            if (IsHistoryData)
            {
                bool err = false;
                string msg = $"历史图纸【{partModel}】";
                if (localDocChanged)
                if (localDocChanged && !noDrw)
                {
                    err = true;
                    msg += "变更后未重新审核;";
                }
                else if (drawStatus == "rejected" || drawStatus == "submitted" || drawStatus == "resubmitted")
                if ((drawStatus == "rejected" || drawStatus == "submitted" || drawStatus == "resubmitted") && BomInfo.inKeeDeeDb != true)
                {
                    err = true;
                    msg += "未通过审核";
@@ -325,6 +370,11 @@
                {
                    err = true;
                    msg += "被隐藏;";
                }
                if (noDrw)
                {
                    err = true;
                    msg += "未找到工程图";
                }
                return err ? msg : null;
            }
@@ -342,16 +392,21 @@
                    error = true;
                    msg += "被隐藏;";
                }
                if (produceWay == "加工件" && drawStatus != "completed")
                if (produceWay == "加工件" && drawStatus != "completed" && BomInfo.inKeeDeeDb != true)
                {
                    error = true;
                    msg += "未通过审核;";
                }
                if (produceWay == "加工件" && drawStatus == "completed" && localDocChanged)
                if (produceWay == "加工件" && drawStatus == "completed" && localDocChanged && !noDrw)
                {
                    error = true;
                    msg += "图纸变更后未重新审核";
                }
                if (noDrw)
                {
                    error = true;
                    msg += "未找到工程图";
                }
                return error ? msg : null;
            }
            return null;