From 49c021d5c7907d0e932a3e7133391abd526c8cd0 Mon Sep 17 00:00:00 2001
From: yanyuan <yuan.yan@capgemini.com>
Date: 星期五, 10 十一月 2023 15:24:44 +0800
Subject: [PATCH] Merge dev into dev_yy

---
 _Main/BL/Type_DecisionLog/_ROOT_Type_DecisionLog.qbl                                                      |    6 +
 _Main/UI/MacroPlanner/Component_FormDecisionLog/_ROOT_Component_FormDecisionLog.def                       |   10 ++
 _Main/BL/Type_IPAddressCache/Attribute_LoginTime.qbl                                                      |    7 +
 _Main/BL/Relations/Relation_IPAddressCache_GlobalOTDLog_GlobalOTDLog_IPAddressCache.qbl                   |   23 ++++
 _Main/UI/MacroPlanner/Component_FormDecisionLog/Response_TIANMA_JITUAN_ListDecisionLog_OnCreated.def      |   12 ++
 _Main/BL/Type_DecisionLog/StaticMethod_SetIPAddress.qbl                                                   |   15 +++
 _Main/BL/Type_IPAddressCache/StaticMethod_SaveAddress.qbl                                                 |   13 ++
 _Main/UI/MacroPlanner/Component_ApplicationMacroPlanner/_ROOT_Component_ApplicationMacroPlanner.def       |    4 
 _Main/BL/Type_DecisionLog/Attribute_IPAddress.qbl                                                         |    7 +
 _Main/BL/Type_IPAddressCache/_ROOT_Type_IPAddressCache.qbl                                                |    9 +
 _Main/BL/Type_IPAddressCache/Attribute_UserName.qbl                                                       |    7 +
 _Main/UI/MacroPlanner/Component_FormDecisionLog/Response_TIANMA_JITUAN_ListDecisionLog_OnClickElement.def |   16 +++
 /dev/null                                                                                                 |   10 --
 _Main/BL/Type_DecisionLog/Method_SetIPAddress.qbl                                                         |   18 +++
 _Main/BL/Type_DecisionLog/StaticMethod_Create.qbl                                                         |   16 +++
 _Main/UI/MacroPlanner/Component_FormDecisionLog/Component_ListDecisionLog.def                             |    4 
 _Main/BL/Type_IPAddressCache/Attribute_IPAddress.qbl                                                      |    7 +
 _Main/UI/MacroPlanner/Component_ApplicationLibMacroPlanner/Response_OnCreated.def                         |   58 +++++++++++
 18 files changed, 230 insertions(+), 12 deletions(-)

diff --git a/_Main/BL/Relations/Relation_Flag_MacroPlan_MacroPlan_Flag.qbl b/_Main/BL/Relations/Relation_Flag_MacroPlan_MacroPlan_Flag.qbl
deleted file mode 100644
index efc9566..0000000
--- a/_Main/BL/Relations/Relation_Flag_MacroPlan_MacroPlan_Flag.qbl
+++ /dev/null
@@ -1,23 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Relation Flag_MacroPlan_MacroPlan_Flag
-{
-  #keys: '1[414996.0.51027441]'
-  DefaultRelationStrategy
-  {
-  }
-  RelationSide.LeftSide MacroPlan
-  {
-    #keys: '3[414996.0.51027443][414996.0.51027442][414996.0.51027444]'
-    Cardinality: '0to1'
-    ObjectDefinition: Flag
-    OwningSide: 'Reference'
-  }
-  RelationSide.RightSide Flag
-  {
-    #keys: '3[414996.0.51027446][414996.0.51027445][414996.0.51027447]'
-    Cardinality: '1toN'
-    ObjectDefinition: MacroPlan
-    OwningSide: 'Owned'
-  }
-}
diff --git a/_Main/BL/Relations/Relation_IPAddressCache_GlobalOTDLog_GlobalOTDLog_IPAddressCache.qbl b/_Main/BL/Relations/Relation_IPAddressCache_GlobalOTDLog_GlobalOTDLog_IPAddressCache.qbl
new file mode 100644
index 0000000..48112b3
--- /dev/null
+++ b/_Main/BL/Relations/Relation_IPAddressCache_GlobalOTDLog_GlobalOTDLog_IPAddressCache.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation IPAddressCache_GlobalOTDLog_GlobalOTDLog_IPAddressCache
+{
+  #keys: '1[414996.0.81754754]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide GlobalOTDLog
+  {
+    #keys: '3[414996.0.81754756][414996.0.81754755][414996.0.81754757]'
+    Cardinality: '0to1'
+    ObjectDefinition: IPAddressCache
+    OwningSide: 'Reference'
+  }
+  RelationSide.RightSide IPAddressCache
+  {
+    #keys: '3[414996.0.81754759][414996.0.81754758][414996.0.81754760]'
+    Cardinality: '1toN'
+    ObjectDefinition: GlobalOTDLog
+    OwningSide: 'Owned'
+  }
+}
diff --git a/_Main/BL/Type_DecisionLog/Attribute_IPAddress.qbl b/_Main/BL/Type_DecisionLog/Attribute_IPAddress.qbl
new file mode 100644
index 0000000..95a6d62
--- /dev/null
+++ b/_Main/BL/Type_DecisionLog/Attribute_IPAddress.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute IPAddress
+{
+  #keys: '3[414996.0.89381188][414996.0.89381187][414996.0.89381189]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_DecisionLog/Method_SetIPAddress.qbl b/_Main/BL/Type_DecisionLog/Method_SetIPAddress.qbl
new file mode 100644
index 0000000..b2c5473
--- /dev/null
+++ b/_Main/BL/Type_DecisionLog/Method_SetIPAddress.qbl
@@ -0,0 +1,18 @@
+Quintiq file version 2.0
+#parent: #root
+Method SetIPAddress (
+  GlobalOTDLog IPAddressCache
+)
+{
+  TextBody:
+  [*
+    // Akari Nov-10-2023 (created)
+    ipAddresses := selectsortedset( IPAddressCache,IPAddressCache,iac,iac.UserName() = this.User() and iac.LoginTime() <= this.Timestamp(),iac.LoginTime()); 
+    if( not isnull( ipAddresses) and ipAddresses.Size() <> 0 ){
+       this.IPAddress( ipAddresses.Element( ipAddresses.Size() - 1 ).IPAddress() );
+    //   for( i := 0 ; i< ipAddresses.Size() - 1 ; i++){
+    //      ipAddresses.Element( i ).Delete(); 
+    //   }
+    }
+  *]
+}
diff --git a/_Main/BL/Type_DecisionLog/StaticMethod_Create.qbl b/_Main/BL/Type_DecisionLog/StaticMethod_Create.qbl
new file mode 100644
index 0000000..d502896
--- /dev/null
+++ b/_Main/BL/Type_DecisionLog/StaticMethod_Create.qbl
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod Create (
+  MacroPlan owner,
+  String description
+) #extension
+{
+  TextBody:
+  [*
+    // yosia Jun-14-2012 (created)
+    
+    dl := owner.DecisionLog( relnew, Description := description );
+    dl.Timestamp( DateTime::Now() );
+    dl.User( GlobalParameters_MP::GetUserName() );
+  *]
+}
diff --git a/_Main/BL/Type_DecisionLog/StaticMethod_SetIPAddress.qbl b/_Main/BL/Type_DecisionLog/StaticMethod_SetIPAddress.qbl
new file mode 100644
index 0000000..31dd82f
--- /dev/null
+++ b/_Main/BL/Type_DecisionLog/StaticMethod_SetIPAddress.qbl
@@ -0,0 +1,15 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SetIPAddress (
+  MacroPlan owner,
+  GlobalOTDLog IPAddressCache
+)
+{
+  TextBody:
+  [*
+    // Akari Nov-10-2023 (created)
+    traverse( owner,DecisionLog,decisionLog,decisionLog.IPAddress() = ''){
+      decisionLog.SetIPAddress( IPAddressCache );
+    }
+  *]
+}
diff --git a/_Main/BL/Type_DecisionLog/_ROOT_Type_DecisionLog.qbl b/_Main/BL/Type_DecisionLog/_ROOT_Type_DecisionLog.qbl
new file mode 100644
index 0000000..2b8523d
--- /dev/null
+++ b/_Main/BL/Type_DecisionLog/_ROOT_Type_DecisionLog.qbl
@@ -0,0 +1,6 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type DecisionLog #extension
+{
+}
diff --git a/_Main/BL/Type_Flag/Attribute_flag.qbl b/_Main/BL/Type_Flag/Attribute_flag.qbl
deleted file mode 100644
index 3953c87..0000000
--- a/_Main/BL/Type_Flag/Attribute_flag.qbl
+++ /dev/null
@@ -1,7 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Attribute flag
-{
-  #keys: '3[414996.0.51027432][414996.0.51027431][414996.0.51027433]'
-  ValueType: Boolean
-}
diff --git a/_Main/BL/Type_Flag/DefaultValue_flag.qbl b/_Main/BL/Type_Flag/DefaultValue_flag.qbl
deleted file mode 100644
index 7fec89a..0000000
--- a/_Main/BL/Type_Flag/DefaultValue_flag.qbl
+++ /dev/null
@@ -1,7 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-DefaultValue
-{
-  ISOValue: 'false'
-  TargetAttribute: flag
-}
diff --git a/_Main/BL/Type_Flag/_ROOT_Type_Flag.qbl b/_Main/BL/Type_Flag/_ROOT_Type_Flag.qbl
deleted file mode 100644
index 9b19c84..0000000
--- a/_Main/BL/Type_Flag/_ROOT_Type_Flag.qbl
+++ /dev/null
@@ -1,10 +0,0 @@
-Quintiq file version 2.0
-#root
-#parent: #DomainModel
-Type Flag
-{
-  #keys: '5[414996.0.33484648][414996.0.33484646][0.0.0][414996.0.33484647][414996.0.33484649]'
-  BaseType: Object
-  Description: '鏍囧織浣�'
-  StructuredName: 'Flags'
-}
diff --git a/_Main/BL/Type_IPAddressCache/Attribute_IPAddress.qbl b/_Main/BL/Type_IPAddressCache/Attribute_IPAddress.qbl
new file mode 100644
index 0000000..bec03b4
--- /dev/null
+++ b/_Main/BL/Type_IPAddressCache/Attribute_IPAddress.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute IPAddress
+{
+  #keys: '3[414996.0.81754661][414996.0.81754660][414996.0.81754662]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_IPAddressCache/Attribute_LoginTime.qbl b/_Main/BL/Type_IPAddressCache/Attribute_LoginTime.qbl
new file mode 100644
index 0000000..23eb7c5
--- /dev/null
+++ b/_Main/BL/Type_IPAddressCache/Attribute_LoginTime.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute LoginTime
+{
+  #keys: '3[414996.0.81754772][414996.0.81754771][414996.0.81754773]'
+  ValueType: DateTime
+}
diff --git a/_Main/BL/Type_IPAddressCache/Attribute_UserName.qbl b/_Main/BL/Type_IPAddressCache/Attribute_UserName.qbl
new file mode 100644
index 0000000..81ff7c1
--- /dev/null
+++ b/_Main/BL/Type_IPAddressCache/Attribute_UserName.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute UserName
+{
+  #keys: '3[414996.0.81754651][414996.0.81754650][414996.0.81754652]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_IPAddressCache/StaticMethod_SaveAddress.qbl b/_Main/BL/Type_IPAddressCache/StaticMethod_SaveAddress.qbl
new file mode 100644
index 0000000..5c90c21
--- /dev/null
+++ b/_Main/BL/Type_IPAddressCache/StaticMethod_SaveAddress.qbl
@@ -0,0 +1,13 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SaveAddress (
+  GlobalOTDLog owner,
+  String IPAddress
+)
+{
+  TextBody:
+  [*
+    // Akari Nov-10-2023 (created)
+    owner.IPAddressCache(relnew,IPAddress := IPAddress,UserName := GlobalParameters_MP::GetUserName(),LoginTime := DateTime::Now());
+  *]
+}
diff --git a/_Main/BL/Type_IPAddressCache/_ROOT_Type_IPAddressCache.qbl b/_Main/BL/Type_IPAddressCache/_ROOT_Type_IPAddressCache.qbl
new file mode 100644
index 0000000..62597a3
--- /dev/null
+++ b/_Main/BL/Type_IPAddressCache/_ROOT_Type_IPAddressCache.qbl
@@ -0,0 +1,9 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type IPAddressCache
+{
+  #keys: '5[414996.0.81754647][414996.0.81754645][0.0.0][414996.0.81754646][414996.0.81754648]'
+  BaseType: Object
+  StructuredName: 'IPAddressCaches'
+}
diff --git a/_Main/UI/MacroPlanner/Component_ApplicationLibMacroPlanner/Response_OnCreated.def b/_Main/UI/MacroPlanner/Component_ApplicationLibMacroPlanner/Response_OnCreated.def
new file mode 100644
index 0000000..f14e87a
--- /dev/null
+++ b/_Main/UI/MacroPlanner/Component_ApplicationLibMacroPlanner/Response_OnCreated.def
@@ -0,0 +1,58 @@
+Quintiq file version 2.0
+#parent: #root
+Response OnCreated () id:Response_ApplicationLibMacroPlanner_OnCreated #extension
+{
+  Body:
+  [*
+    // Update application title.
+    this.SelectScenarioManager();
+    LabelPeriodRollStatus.Visible( [Boolean] ValueHolderPeriodRollStatus.Value() );
+    
+    if( not isnull( ScenarioManager ) )
+    {                                            
+      if( not isnull( MacroPlan ) )
+      {                                                    
+        // Check that current scenario is created by current user
+        // or is authorized for the current user
+        scenario := select( ScenarioManager,
+                            ScenarioNode.astype( Scenario ),
+                            node,
+                            node.DatasetMDSID() = MacroPlan.MDSID()
+                            and this.IsAuthorizedScenario( node ) )
+        if ( isnull( scenario ) )
+        {
+    
+          // false, deselect current scenario and select something else
+          this.DeselectScenario( null( internal[GUIComponent] ), MacroPlan );
+    
+          scenario := select( ScenarioManager,
+                              ScenarioNode.astype( Scenario ),
+                              node,
+                              this.IsAuthorizedScenario( node ) )
+        }
+        ApplicationLibMacroPlanner.SelectScenario( scenario );    
+      }
+    
+      if( ScenarioManager.ScenarioMP( relsize ) = 0 )
+      {
+        // Create and launch start-up wizard
+        ApplicationLibMacroPlanner.LaunchStartUpWizard();
+      } 
+    }
+    
+    ApplicationLibMacroPlanner.EnableWorkflow( guard( SWF_WorkflowDataset.IsWorkflowEnabled(), false ) );
+    
+    // Configure menus, hide menus with all of their submenus hidden due to functionalities
+    if( not isnull( MPDomainHandler ) )
+    {
+      this.ConfigureMenus();
+    }
+    
+    // Select default representation MacroPlanner instead of Global
+    Application.RepresentationManager().SelectRepresentation( "MacroPlanner" );
+    
+    if ( not isnull( GlobalOTDLog )){
+      IPAddressCache::SaveAddress( GlobalOTDLog,Application.ClientIPAddress());
+    }
+  *]
+}
diff --git a/_Main/UI/MacroPlanner/Component_ApplicationMacroPlanner/_ROOT_Component_ApplicationMacroPlanner.def b/_Main/UI/MacroPlanner/Component_ApplicationMacroPlanner/_ROOT_Component_ApplicationMacroPlanner.def
index fb0b043..1612a8f 100644
--- a/_Main/UI/MacroPlanner/Component_ApplicationMacroPlanner/_ROOT_Component_ApplicationMacroPlanner.def
+++ b/_Main/UI/MacroPlanner/Component_ApplicationMacroPlanner/_ROOT_Component_ApplicationMacroPlanner.def
@@ -39,8 +39,8 @@
       ]
       Properties:
       [
-        Height: 482
-        Width: 533
+        Height: 39
+        Width: 237
         ModeledStringList ChildOrdering
         {
           c: mbMainMenu
diff --git a/_Main/UI/MacroPlanner/Component_FormDecisionLog/Component_ListDecisionLog.def b/_Main/UI/MacroPlanner/Component_FormDecisionLog/Component_ListDecisionLog.def
new file mode 100644
index 0000000..2c1b6e9
--- /dev/null
+++ b/_Main/UI/MacroPlanner/Component_FormDecisionLog/Component_ListDecisionLog.def
@@ -0,0 +1,4 @@
+Quintiq file version 2.0
+Component ListDecisionLog #extension
+{
+}
diff --git a/_Main/UI/MacroPlanner/Component_FormDecisionLog/Response_TIANMA_JITUAN_ListDecisionLog_OnClickElement.def b/_Main/UI/MacroPlanner/Component_FormDecisionLog/Response_TIANMA_JITUAN_ListDecisionLog_OnClickElement.def
new file mode 100644
index 0000000..17a8748
--- /dev/null
+++ b/_Main/UI/MacroPlanner/Component_FormDecisionLog/Response_TIANMA_JITUAN_ListDecisionLog_OnClickElement.def
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: ListDecisionLog
+Response OnClickElement (
+  DecisionLog element
+) id:Response_TIANMA_JITUAN_ListDecisionLog_OnClickElement
+{
+  #keys: '[414996.0.84396833]'
+  Body:
+  [*
+    if ( element.IPAddress() = '' ){
+      element.SetIPAddress( GlobalOTDLog  );
+    }
+  *]
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_List_OnClickElement'
+}
diff --git a/_Main/UI/MacroPlanner/Component_FormDecisionLog/Response_TIANMA_JITUAN_ListDecisionLog_OnCreated.def b/_Main/UI/MacroPlanner/Component_FormDecisionLog/Response_TIANMA_JITUAN_ListDecisionLog_OnCreated.def
new file mode 100644
index 0000000..c971933
--- /dev/null
+++ b/_Main/UI/MacroPlanner/Component_FormDecisionLog/Response_TIANMA_JITUAN_ListDecisionLog_OnCreated.def
@@ -0,0 +1,12 @@
+Quintiq file version 2.0
+#parent: ListDecisionLog
+Response OnCreated () id:Response_TIANMA_JITUAN_ListDecisionLog_OnCreated
+{
+  #keys: '[414996.0.84396556]'
+  Body:
+  [*
+    DecisionLog::SetIPAddress( MacroPlan,GlobalOTDLog );
+  *]
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_GUIComponent_OnCreated'
+}
diff --git a/_Main/UI/MacroPlanner/Component_FormDecisionLog/_ROOT_Component_FormDecisionLog.def b/_Main/UI/MacroPlanner/Component_FormDecisionLog/_ROOT_Component_FormDecisionLog.def
new file mode 100644
index 0000000..84521dd
--- /dev/null
+++ b/_Main/UI/MacroPlanner/Component_FormDecisionLog/_ROOT_Component_FormDecisionLog.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#root
+#parent: LibMacroPlannerTCUI
+OrphanComponent FormDecisionLog #extension
+{
+  Children:
+  [
+    #child: ListDecisionLog
+  ]
+}

--
Gitblit v1.9.3