ulysseskao
2016-05-03 410dc2d04dbecf019129cd8cd65a3be2c62b4d0c
CCSTrace/CCS/EventAI/JudgeCase.cs
@@ -22,7 +22,7 @@
        private int _inferFsc; // 推測出可能受損的設備種類
        private int _inferUfid; // 推測出可能受損的設備編號
        private int _parentCaseId = 0;
        private Equipment _mEquip;
        private Equipment _equip;
        private readonly OracleConnection _connectionTpc;
        private readonly OracleTransaction _transaction;
@@ -30,13 +30,13 @@
        // int Range = 360; //比事故案件還早多久時間內的案件才作合併 單位:分
        public JudgeCase(int mFdrId, int mFsc, int mUfid, int mCaseId, string mAcceptDate, OracleConnection connection, OracleTransaction trx, string traceConnection)
        public JudgeCase(int fdrId, int fsc, int ufid, int caseId, string acceptDate, OracleConnection connection, OracleTransaction trx, string traceConnection)
        {
            _damageFdrId = mFdrId;
            _damageFsc = mFsc;
            _damageUfid = mUfid;
            _newCaseId = mCaseId;
            _acceptDate = mAcceptDate;
            _damageFdrId = fdrId;
            _damageFsc = fsc;
            _damageUfid = ufid;
            _newCaseId = caseId;
            _acceptDate = acceptDate;
            _connectionTpc = connection;
            _transaction = trx;
@@ -82,18 +82,15 @@
            }
            catch (Exception e)
            {
                Logger.Error(e.Message);
                Console.WriteLine(e.StackTrace);
                Logger.Error(e, e.Message);
                Logger.Error("尋找母案件時發生錯誤.");
                throw e;
                throw ;
            }
            finally
            {
                if (command != null)
                    command.Dispose();
                command?.Dispose();
                if (reader != null)
                    reader.Close();
                reader?.Close();
            }
            // 若事故案件為該饋線上的第一件事故案件時,無須再作追蹤比較
@@ -129,7 +126,7 @@
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
                throw ex;
                throw;
            }
            Logger.Info("不同變壓器,開始追蹤(New Version)...");
@@ -185,7 +182,7 @@
                                    _parentCaseId = Convert.ToInt32(((ArrayList)_mCase[i])[0].ToString());
                                    _inferFsc = ((Equipment)_newCase[j]).Fsc;
                                    _inferUfid = ((Equipment)_newCase[j]).Ufid;
                                    _mEquip = (Equipment)((ArrayList)_mCase[i])[5];
                                    _equip = (Equipment)((ArrayList)_mCase[i])[5];
                                    Logger.Info("與案件" + ((ArrayList)_mCase[i])[7] + "合併,故障點Fsc: " + _inferFsc + " Ufid: " + _inferUfid);
                                    return;
                                }
@@ -217,7 +214,7 @@
                                    _parentCaseId = Convert.ToInt32(((ArrayList)_mCase[i])[0].ToString());
                                    _inferFsc = damageEquipment.Fsc;
                                    _inferUfid = damageEquipment.Ufid;
                                    _mEquip = (Equipment)((ArrayList)_mCase[i])[5];
                                    _equip = (Equipment)((ArrayList)_mCase[i])[5];
                                    Logger.Info("與案件" + ((ArrayList)_mCase[i])[7] + "合併,故障點Fsc: " + _inferFsc + " Ufid: " + _inferUfid);
                                    return;
                                }
@@ -250,7 +247,7 @@
        public Equipment GetOldrEquipment()
        {
            return _mEquip;
            return _equip;
        }
        public int GetParentCaseId()
@@ -287,8 +284,7 @@
            }
            catch (Exception e)
            {
                Logger.Error("Problems occur: " + e.Message);
                Console.WriteLine(e.StackTrace);
                Logger.Error(e, "Problems occur: " + e.Message);
            }
            finally
            {
@@ -322,8 +318,7 @@
            catch (Exception e)
            {
                // CCS.GlobalVariable.ErrorLog.setErrorLog("Error in JudgeCase(RealDamageEquipment) :" + e.getMessage());
                Logger.Error("Problems occur: " + e.Message);
                Console.WriteLine(e.StackTrace);
                Logger.Error(e, "Problems occur: " + e.Message);
            }
            finally
            {