From a80361675b58ab61191e977723f94c01f87d9753 Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期一, 11 十一月 2024 15:26:38 +0800
Subject: [PATCH] 修改锁定期的库存点和产品的顺序

---
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlContent.def                                         |   12 ++--
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlActions.def                                         |    6 +-
 _Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl                                                                     |   19 +++---
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlActions_btnCancel_OnClick.def                        |    2 
 _Main/BL/Type_DispatchShiftPlan/Function_CalcFac.qbl                                                                          |    4 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pStockingPoint.def                                     |   22 +++---
 /dev/null                                                                                                                     |   18 ------
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pStockingPoint_cbAllStockingPoint_OnChanged.def         |   20 ++++++
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pStockingPoint_ddlStockingPoint_OnSelectionChanged.def  |   18 ++++++
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent661_cbAllProductInStockingPoint_OnChanged.def |    3 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlContent661.def                                      |   16 ++--
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlActions_btnOk_OnClick.def                            |   23 +++++--
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent_dsLockDate_OnCreated.def                     |    2 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/_ROOT_Component_DialogCreateLockPeriod.def                       |    2 
 14 files changed, 99 insertions(+), 68 deletions(-)

diff --git a/_Main/BL/Type_DispatchShiftPlan/Function_CalcFac.qbl b/_Main/BL/Type_DispatchShiftPlan/Function_CalcFac.qbl
index a20b0a3..5f1c80b 100644
--- a/_Main/BL/Type_DispatchShiftPlan/Function_CalcFac.qbl
+++ b/_Main/BL/Type_DispatchShiftPlan/Function_CalcFac.qbl
@@ -6,9 +6,9 @@
   [*
     // Akari Aug-21-2024 (created)
     value := "";
-    if( this.FactoryName() = "澶ц繛宸ュ巶" ){
+    if( this.FactoryName().LikeUserLocale( "澶ц繛" ) or  this.FactoryName().LikeUserLocale( "DL" ) ){
       value := "DL";
-    }else if( this.FactoryName() = "闀挎槬宸ュ巶"){
+    }else if( this.FactoryName().LikeUserLocale( "闀挎槬" ) or  this.FactoryName().LikeUserLocale( "CC" )){
       value := "CC";
     }
     
diff --git a/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl b/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
index ec03621..0eaff48 100644
--- a/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
+++ b/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
@@ -52,18 +52,19 @@
          dispatchShiftPlan.VersionName( macroPlanName );
          dispatchShiftPlan.InterfaceTime( now );
        }else{
-         interfaceLoginfo.DispatchShiftPlan( relnew,ID := OS:: GenerateGUIDAsString(),
-                                             ProductLine := productLine,
-                                             FactoryName := factory.ID(),
-                                             ShiftQty := shiftPlan.Outcome(),
+         if( shiftPlan.Outcome() <> "" ){
+           interfaceLoginfo.DispatchShiftPlan( relnew,ID := OS:: GenerateGUIDAsString(),
+                                               ProductLine := productLine,
+                                               FactoryName := factory.ID(),
+                                               ShiftQty := shiftPlan.Outcome(),
                                   
-                                             ShiftDate := shiftDate,
-                                             Tips := shiftPlan.Remark(),
-                                             VersionName := macroPlanName,
-                                             InterfaceTime := now );
+                                               ShiftDate := shiftDate,
+                                               Tips := shiftPlan.Remark(),
+                                               VersionName := macroPlanName,
+                                               InterfaceTime := now );
+         }
        }
     }
     DispatchShiftPlan::Publish( interfaceLoginfo );
-    // owner.RB_DispatchShiftPlanBroker().AsyncExecute();
   *]
 }
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pProduct\043519.def" b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pStockingPoint.def
similarity index 63%
rename from "_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pProduct\043519.def"
rename to _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pStockingPoint.def
index a93f402..fabf479 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pProduct\043519.def"
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pStockingPoint.def
@@ -1,41 +1,41 @@
 Quintiq file version 2.0
-Component pProduct
+Component pStockingPoint
 {
-  #keys: '[414996.1.172931824]'
+  #keys: '[414996.1.206961942]'
   BaseType: 'WebPanel'
   Children:
   [
-    Component ddlProduct
+    Component ddlStockingPoint
     {
-      #keys: '[414996.1.172931898]'
+      #keys: '[414996.1.206961943]'
       BaseType: 'WebDropDownList'
-      Databinding: 'Product_MP'
+      Databinding: 'StockingPoint_MP'
       Children:
       [
-        Component deContent id:deContent_245
+        Component deContent
         {
-          #keys: '[414996.1.172931899]'
+          #keys: '[414996.1.206961944]'
           BaseType: 'WebDataExtractor'
           Properties:
           [
             DataType: 'MacroPlan'
             Source: 'MacroPlan'
             Taborder: 0
-            Transformation: 'Product_MP'
+            Transformation: 'StockingPoint_MP'
           ]
         }
       ]
       Properties:
       [
         DisplayField: 'ID'
-        Label: '浜у搧'
+        Label: '搴撳瓨鐐�'
         NumberOfColumns: 50
         Taborder: 0
       ]
     }
-    Component cbAllProduct
+    Component cbAllStockingPoint
     {
-      #keys: '[414996.1.172931904]'
+      #keys: '[414996.1.206961945]'
       BaseType: 'WebCheckbox'
       Properties:
       [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlActions.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlActions.def
index e45d1f7..89a752f 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlActions.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlActions.def
@@ -1,13 +1,13 @@
 Quintiq file version 2.0
 Component pnlActions
 {
-  #keys: '[412672.0.1039310286]'
+  #keys: '[414996.1.206961981]'
   BaseType: 'WebPanel'
   Children:
   [
     Component btnOk
     {
-      #keys: '[412672.0.1039310290]'
+      #keys: '[414996.1.206961982]'
       BaseType: 'WebButton'
       Properties:
       [
@@ -17,7 +17,7 @@
     }
     Component btnCancel
     {
-      #keys: '[412672.0.1039310292]'
+      #keys: '[414996.1.206961983]'
       BaseType: 'WebButton'
       Properties:
       [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlContent.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlContent.def
index 91bbeb6..3eaa956 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlContent.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlContent.def
@@ -1,13 +1,13 @@
 Quintiq file version 2.0
 Component pnlContent
 {
-  #keys: '[412672.0.1039310284]'
+  #keys: '[414996.1.206961940]'
   BaseType: 'WebPanel'
   Children:
   [
     Component dsLockDate
     {
-      #keys: '[412672.0.1039341942]'
+      #keys: '[414996.1.206961941]'
       BaseType: 'WebDateSelector'
       Properties:
       [
@@ -15,13 +15,13 @@
         Taborder: 3
       ]
     }
-    #child: pProduct
+    #child: pStockingPoint
     #child: pnlContent661
-    Component dhSelectProduct id:dhSelectProduct_159
+    Component dhSelectStockingPoint
     {
-      #keys: '[414996.1.172932445]'
+      #keys: '[414996.1.206961950]'
       BaseType: 'WebDataHolder'
-      Databinding: 'Product_MP'
+      Databinding: 'StockingPoint_MP'
       Properties:
       [
         Taborder: 1
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlContent661.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlContent661.def
index df2d059..cb83f7d 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlContent661.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Component_pnlContent661.def
@@ -1,25 +1,25 @@
 Quintiq file version 2.0
 Component pnlContent661
 {
-  #keys: '[414996.1.172932399]'
+  #keys: '[414996.1.206961946]'
   BaseType: 'WebPanel'
   Children:
   [
     Component ddlProductInStockingPoint
     {
-      #keys: '[414996.1.172932647]'
+      #keys: '[414996.1.206961947]'
       BaseType: 'WebDropDownList'
       Databinding: 'ProductInStockingPoint_MP'
       Children:
       [
         Component deContent404
         {
-          #keys: '[414996.1.172932649]'
+          #keys: '[414996.1.206961948]'
           BaseType: 'WebDataExtractor'
           Properties:
           [
-            DataType: 'Product_MP'
-            Source: 'dhSelectProduct'
+            DataType: 'StockingPoint_MP'
+            Source: 'dhSelectStockingPoint'
             Taborder: 0
             Transformation: 'ProductInStockingPoint_MP'
           ]
@@ -27,15 +27,15 @@
       ]
       Properties:
       [
-        DisplayField: 'StockingPointID'
-        Label: '搴撳瓨鐐�'
+        DisplayField: 'ProductID'
+        Label: '浜у搧'
         NumberOfColumns: 50
         Taborder: 0
       ]
     }
     Component cbAllProductInStockingPoint
     {
-      #keys: '[414996.1.172932676]'
+      #keys: '[414996.1.206961949]'
       BaseType: 'WebCheckbox'
       Properties:
       [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pProduct_cbAllProduct_OnChanged.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pProduct_cbAllProduct_OnChanged.def
deleted file mode 100644
index d41683e..0000000
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pProduct_cbAllProduct_OnChanged.def
+++ /dev/null
@@ -1,22 +0,0 @@
-Quintiq file version 2.0
-#parent: pProduct/cbAllProduct
-Response OnChanged () id:Response_pProduct_cbAllProduct_OnChanged
-{
-  #keys: '[414996.1.172932859]'
-  CanBindMultiple: false
-  DefinitionID: 'Responsedef_WebCheckbox_OnChanged'
-  GroupServerCalls: true
-  QuillAction
-  {
-    Body:
-    [*
-      if( this.Checked() ){
-        ddlProduct.Enabled( false,"" );
-        cbAllProductInStockingPoint.Checked( true );
-      }else{
-        ddlProduct.Enabled( true,"" );
-        cbAllProductInStockingPoint.Checked( false );
-      }
-    *]
-  }
-}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pProduct_ddlProduct_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pProduct_ddlProduct_OnSelectionChanged.def
deleted file mode 100644
index 4bd82df..0000000
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pProduct_ddlProduct_OnSelectionChanged.def
+++ /dev/null
@@ -1,18 +0,0 @@
-Quintiq file version 2.0
-#parent: pProduct/ddlProduct
-Response OnSelectionChanged (
-  Product_MP selection
-) id:Response_pProduct_ddlProduct_OnSelectionChanged
-{
-  #keys: '[414996.1.172932024]'
-  CanBindMultiple: false
-  DefinitionID: 'Responsedef_WebDropDownList_OnSelectionChanged'
-  GroupServerCalls: true
-  QuillAction
-  {
-    Body:
-    [*
-      dhSelectProduct.Data( selection );
-    *]
-  }
-}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pStockingPoint_cbAllStockingPoint_OnChanged.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pStockingPoint_cbAllStockingPoint_OnChanged.def
new file mode 100644
index 0000000..c7d89c1
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pStockingPoint_cbAllStockingPoint_OnChanged.def
@@ -0,0 +1,20 @@
+Quintiq file version 2.0
+#parent: pStockingPoint/cbAllStockingPoint
+Response OnChanged () id:Response_pStockingPoint_cbAllStockingPoint_OnChanged
+{
+  #keys: '[414996.1.206961938]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebCheckbox_OnChanged'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      if( this.Checked() ){
+        ddlStockingPoint.Enabled( false,"" );
+      }else{
+        ddlStockingPoint.Enabled( true,"" );
+      }
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pStockingPoint_ddlStockingPoint_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pStockingPoint_ddlStockingPoint_OnSelectionChanged.def
new file mode 100644
index 0000000..660d3f1
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pStockingPoint_ddlStockingPoint_OnSelectionChanged.def
@@ -0,0 +1,18 @@
+Quintiq file version 2.0
+#parent: pStockingPoint/ddlStockingPoint
+Response OnSelectionChanged (
+  StockingPoint_MP selection
+) id:Response_pStockingPoint_ddlStockingPoint_OnSelectionChanged
+{
+  #keys: '[414996.1.206961939]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebDropDownList_OnSelectionChanged'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      dhSelectStockingPoint.Data( selection );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlActions_btnCancel_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlActions_btnCancel_OnClick.def
index 4d5cb33..73b809c 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlActions_btnCancel_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlActions_btnCancel_OnClick.def
@@ -2,7 +2,7 @@
 #parent: pnlActions/btnCancel
 Response OnClick () id:Response_pnlActions_btnCancel_OnClick
 {
-  #keys: '[412672.0.1039310296]'
+  #keys: '[414996.1.206961979]'
   DefinitionID: 'Responsedef_WebButton_OnClick'
   GroupServerCalls: true
   QuillAction
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlActions_btnOk_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlActions_btnOk_OnClick.def
index f131cc6..7fd1b52 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlActions_btnOk_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlActions_btnOk_OnClick.def
@@ -2,26 +2,37 @@
 #parent: pnlActions/btnOk
 Response OnClick () id:Response_pnlActions_btnOk_OnClick
 {
-  #keys: '[412672.0.1039310295]'
+  #keys: '[414996.1.206961980]'
   DefinitionID: 'Responsedef_WebButton_OnClick'
   GroupServerCalls: true
   QuillAction
   {
     Body:
     [*
-      if( cbAllProduct.Checked() ){
-        traverse( MacroPlan,Product_MP,product ){
-          traverse( product,ProductInStockingPoint_MP,productInStockingPoint ){
+      if( cbAllStockingPoint.Checked() ){
+        if( cbAllProductInStockingPoint.Checked() ){
+          // 閿佸畾鍏ㄩ儴浜у搧
+          traverse( MacroPlan,Product_MP,product ){
+            traverse( product,ProductInStockingPoint_MP,productInStockingPoint ){
+              LockPeriod::Create( productInStockingPoint,dsLockDate.Date() );
+            }
+          }
+        }else{
+          // 閿佸畾鎸囧畾浜у搧涓嬬殑鍏ㄩ儴搴撳瓨鐐�
+          product := ddlProductInStockingPoint.Data().Product_MP();
+          traverse( product,ProductInStockingPoint_MP,productInStockingPoint){
             LockPeriod::Create( productInStockingPoint,dsLockDate.Date() );
           }
         }
       }else{
         if( cbAllProductInStockingPoint.Checked() ){
-          product := ddlProduct.Data();
-          traverse( product,ProductInStockingPoint_MP,productInStockingPoint ){
+          // 閿佸畾鎸囧畾搴撳瓨鐐逛笅鐨勫叏閮ㄤ骇鍝�
+          stockingPoint := ddlStockingPoint.Data();
+          traverse( stockingPoint,ProductInStockingPoint_MP,productInStockingPoint ){
             LockPeriod::Create( productInStockingPoint,dsLockDate.Date() );
           }
         }else{
+          // 閿佸畾鎸囧畾搴撳瓨鐐圭殑鎸囧畾浜у搧
           LockPeriod::Create( ddlProductInStockingPoint.Data(),dsLockDate.Date() );
         } 
       }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent661_cbAllProductInStockingPoint_OnChanged.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent661_cbAllProductInStockingPoint_OnChanged.def
index 3be14e0..b0901ff 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent661_cbAllProductInStockingPoint_OnChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent661_cbAllProductInStockingPoint_OnChanged.def
@@ -2,7 +2,7 @@
 #parent: pnlContent661/cbAllProductInStockingPoint
 Response OnChanged () id:Response_pnlContent661_cbAllProductInStockingPoint_OnChanged
 {
-  #keys: '[414996.1.172932951]'
+  #keys: '[414996.1.206961937]'
   CanBindMultiple: false
   DefinitionID: 'Responsedef_WebCheckbox_OnChanged'
   GroupServerCalls: true
@@ -14,7 +14,6 @@
         ddlProductInStockingPoint.Enabled( false,"" ); 
       }else{
         ddlProductInStockingPoint.Enabled( true,"" );
-        cbAllProduct.Checked( false );
       }
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent_dsLockDate_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent_dsLockDate_OnCreated.def
index 4301412..5e229f5 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent_dsLockDate_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent_dsLockDate_OnCreated.def
@@ -2,7 +2,7 @@
 #parent: pnlContent/dsLockDate
 Response OnCreated () id:Response_pnlContent_dsLockDate_OnCreated
 {
-  #keys: '[414996.1.172933211]'
+  #keys: '[414996.1.206961936]'
   CanBindMultiple: false
   DefinitionID: 'Responsedef_WebComponent_OnCreated'
   GroupServerCalls: true
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/_ROOT_Component_DialogCreateLockPeriod.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/_ROOT_Component_DialogCreateLockPeriod.def
index 04859c6..ca1aad0 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/_ROOT_Component_DialogCreateLockPeriod.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/_ROOT_Component_DialogCreateLockPeriod.def
@@ -7,8 +7,8 @@
   BaseType: 'WebForm'
   Children:
   [
-    #child: pnlContent
     #child: pnlActions
+    #child: pnlContent
   ]
   Properties:
   [

--
Gitblit v1.9.3