From 39d207344803fffdce4b65eba90f56ea997c1d2c Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期五, 29 十一月 2024 14:34:51 +0800
Subject: [PATCH] 添加实际生产计划数据修改功能

---
 _Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Method_Edit.def                                                    |   14 ++
 _Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/_ROOT_Component_DialogEditActualDailyProductionQuantity.def        |   22 +++
 _Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_ListActualDailyProduction.def                                          |   18 +++
 _Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Component_pnlContent.def                                           |  108 ++++++++++++++++++
 _Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_ListActualDailyProduction_MenuEditActualDailyProductionQuantity_OnC.def |   20 +++
 _Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Component_pnlActions.def                                           |   40 ++++++
 _Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listContextMenuActualDailyProduction.def                               |   14 ++
 _Main/UI/MacroPlannerWebApp/Component_FormArchivePackagingPlan/Component_MatrixEditorArchivePackagingPlan.def                                    |    2 
 _Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Response_pnlActions_btnCancel_OnClick.def                          |   15 ++
 _Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl                                                           |   49 +++++--
 _Main/BL/Type_Test/StaticMethod_Test.qbl                                                                                                         |    7 -
 _Main/UI/MacroPlannerWebApp/Component_FormArchiveShiftPlan/Component_MatrixEditorArchiveShiftPlan.def                                            |    2 
 _Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Response_pnlActions_btnOk_OnClick.def                              |   17 ++
 13 files changed, 306 insertions(+), 22 deletions(-)

diff --git a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
index cff141e..777b22d 100644
--- a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
+++ b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
@@ -165,14 +165,25 @@
         singleShiftVolume2 := 0.0;
         singleShiftVolume3 := 0.0;
         
-        if( line.Tips().LikeUserLocale( "淇濆吇" )){
-          singleShiftVolume1 := 0.0;
-          singleShiftVolume2 := lineQuantity / 2;
-          singleShiftVolume3 := lineQuantity / 2;
-        }else{
-          singleShiftVolume1 := lineQuantity / 3;
-          singleShiftVolume2 := lineQuantity / 3;
-          singleShiftVolume3 := lineQuantity / 3;
+        singleShiftConfigs := selectset( unit,SingleShiftConfig,config,config.ShiftName() = "3" );
+        traverse( singleShiftConfigs,Elements,singleShiftConfig ){
+          if( line.Tips().LikeUserLocale( "淇濆吇" )){
+            if( singleShiftConfig.SingleShiftName() = "鐧界彮"){
+              singleShiftVolume1 := 0.0;
+            }else if( singleShiftConfig.SingleShiftName() = "浜岀彮"){
+              singleShiftVolume2 := singleShiftConfig.StandardYield();
+            }else if( singleShiftConfig.SingleShiftName() = "涓夌彮"){
+              singleShiftVolume3 := singleShiftConfig.StandardYield();
+            }
+          }else{
+            if( singleShiftConfig.SingleShiftName() = "鐧界彮"){
+              singleShiftVolume1 := singleShiftConfig.StandardYield();
+            }else if( singleShiftConfig.SingleShiftName() = "浜岀彮"){
+              singleShiftVolume2 := singleShiftConfig.StandardYield();
+            }else if( singleShiftConfig.SingleShiftName() = "涓夌彮"){
+              singleShiftVolume3 := singleShiftConfig.StandardYield();
+            }
+          }
         }
         
         for( i := tempProducts.Size() - 1;i >= 0; i-- ){
@@ -207,12 +218,22 @@
         // 240.5
         singleShiftVolume1 := 0.0;
         singleShiftVolume2 := 0.0;
-        if( line.Tips().LikeUserLocale( "淇濆吇" )){
-          singleShiftVolume1 := 0.0;
-          singleShiftVolume2 := lineQuantity;
-        }else{
-          singleShiftVolume1 := lineQuantity / 2;
-          singleShiftVolume2 := lineQuantity / 2;
+        
+        singleShiftConfigs := selectset( unit,SingleShiftConfig,config,config.ShiftName() = line.ShiftName() );
+        traverse( singleShiftConfigs,Elements,singleShiftConfig ){
+          if( line.Tips().LikeUserLocale( "淇濆吇" )){
+            if( singleShiftConfig.SingleShiftName() = "鐧界彮"){
+              singleShiftVolume1 := 0.0;
+            }else if( singleShiftConfig.SingleShiftName() = "浜岀彮"){
+              singleShiftVolume2 := singleShiftConfig.StandardYield();
+            }
+          }else{
+            if( singleShiftConfig.SingleShiftName() = "鐧界彮"){
+              singleShiftVolume1 := singleShiftConfig.StandardYield();
+            }else if( singleShiftConfig.SingleShiftName() = "浜岀彮"){
+              singleShiftVolume2 := singleShiftConfig.StandardYield();
+            }
+          }
         }
     
         for( i := tempProducts.Size() - 1;i >= 0; i-- ){
diff --git a/_Main/BL/Type_Test/StaticMethod_Test.qbl b/_Main/BL/Type_Test/StaticMethod_Test.qbl
index ea55e75..a114517 100644
--- a/_Main/BL/Type_Test/StaticMethod_Test.qbl
+++ b/_Main/BL/Type_Test/StaticMethod_Test.qbl
@@ -9,10 +9,5 @@
   InterfaceDataset interfaceDataset
 )
 {
-  TextBody:
-  [*
-    traverse( macroPlan,Unit,unit ){
-      info( LocalTool::GetFactoryByUnit( unit ).ID() ); 
-    }
-  *]
+  TextBody: '//archive.ActualDailyProductionData( relnew ,ActualOut := 100,Fac := "CC",LineName := "CC1",ProductionDate := Date::ActualDate(),ProductNo := "112233445566",ShiftCode := "3",ShiftName := "鐧界彮");'
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Component_pnlActions.def b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Component_pnlActions.def
new file mode 100644
index 0000000..0f0cecb
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Component_pnlActions.def
@@ -0,0 +1,40 @@
+Quintiq file version 2.0
+Component pnlActions
+{
+  #keys: '[414996.1.257133954]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component btnOk
+    {
+      #keys: '[414996.1.257133958]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Label: 'OK'
+        Taborder: 0
+      ]
+    }
+    Component btnCancel
+    {
+      #keys: '[414996.1.257133960]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Label: 'Cancel'
+        Taborder: 1
+      ]
+    }
+  ]
+  Properties:
+  [
+    Alignment: 'trailing'
+    Border: true
+    ExcludeFromActiveComponent: true
+    FixedSize: true
+    Orientation: 'horizontal'
+    Padding: 'true'
+    Style: 'footer'
+    Taborder: 1
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Component_pnlContent.def b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Component_pnlContent.def
new file mode 100644
index 0000000..aa4e955
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Component_pnlContent.def
@@ -0,0 +1,108 @@
+Quintiq file version 2.0
+Component pnlContent
+{
+  #keys: '[414996.1.257133952]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component dhDialogData
+    {
+      #keys: '[414996.1.257214133]'
+      BaseType: 'WebDataHolder'
+      Databinding: 'shadow[ActualDailyProductionData]*'
+      Properties:
+      [
+        Taborder: 0
+      ]
+    }
+    Component npActualOut
+    {
+      #keys: '[414996.1.257174083]'
+      BaseType: 'WebNumberPicker'
+      Properties:
+      [
+        DataBinding: 'dhDialogData.Data.ActualOut'
+        Label: 'Actual out'
+        Min: '0'
+        Taborder: 7
+      ]
+    }
+    Component efFac
+    {
+      #keys: '[414996.1.257174096]'
+      BaseType: 'WebEditField'
+      Properties:
+      [
+        DataBinding: 'dhDialogData.Data.Fac'
+        Enabled: false
+        Label: 'Fac'
+        Taborder: 2
+      ]
+    }
+    Component efLineName
+    {
+      #keys: '[414996.1.257174109]'
+      BaseType: 'WebEditField'
+      Properties:
+      [
+        DataBinding: 'dhDialogData.Data.LineName'
+        Enabled: false
+        Label: 'Line name'
+        Taborder: 1
+      ]
+    }
+    Component efProductNo
+    {
+      #keys: '[414996.1.257174135]'
+      BaseType: 'WebEditField'
+      Properties:
+      [
+        DataBinding: 'dhDialogData.Data.ProductNo'
+        Enabled: false
+        Label: 'Product No.'
+        Taborder: 4
+      ]
+    }
+    Component efShiftCode
+    {
+      #keys: '[414996.1.257174147]'
+      BaseType: 'WebEditField'
+      Properties:
+      [
+        DataBinding: 'dhDialogData.Data.ShiftCode'
+        Enabled: false
+        Label: 'Shift code'
+        Taborder: 5
+      ]
+    }
+    Component efShiftName
+    {
+      #keys: '[414996.1.257174160]'
+      BaseType: 'WebEditField'
+      Properties:
+      [
+        DataBinding: 'dhDialogData.Data.ShiftName'
+        Enabled: false
+        Label: 'Shift name'
+        Taborder: 6
+      ]
+    }
+    Component dsProductionDate
+    {
+      #keys: '[414996.1.257174292]'
+      BaseType: 'WebDateSelector'
+      Properties:
+      [
+        DataBinding: 'dhDialogData.Data.ProductionDate'
+        Enabled: false
+        Label: 'Production date'
+        Taborder: 3
+      ]
+    }
+  ]
+  Properties:
+  [
+    Padding: 'true'
+    Taborder: 0
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Method_Edit.def b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Method_Edit.def
new file mode 100644
index 0000000..d0c9ece
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Method_Edit.def
@@ -0,0 +1,14 @@
+Quintiq file version 2.0
+#parent: #root
+Method Edit (
+  ActualDailyProductionData data
+) id:Method_DialogEditActualDailyProductionQuantity_Edit
+{
+  #keys: '[414996.1.257173735]'
+  Body:
+  [*
+    dhDialogData.Data( shadow(data));
+    
+    ApplicationMacroPlanner.ShowFormModal( this );
+  *]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Response_pnlActions_btnCancel_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Response_pnlActions_btnCancel_OnClick.def
new file mode 100644
index 0000000..d0bba15
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Response_pnlActions_btnCancel_OnClick.def
@@ -0,0 +1,15 @@
+Quintiq file version 2.0
+#parent: pnlActions/btnCancel
+Response OnClick () id:Response_pnlActions_btnCancel_OnClick
+{
+  #keys: '[414996.1.257133964]'
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      Form.Close();
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Response_pnlActions_btnOk_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Response_pnlActions_btnOk_OnClick.def
new file mode 100644
index 0000000..6a1eda0
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/Response_pnlActions_btnOk_OnClick.def
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: pnlActions/btnOk
+Response OnClick () id:Response_pnlActions_btnOk_OnClick
+{
+  #keys: '[414996.1.257133963]'
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      Form.ApplyChanges();
+      dhDialogData.Data( ).Commit();
+      Form.Close();
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/_ROOT_Component_DialogEditActualDailyProductionQuantity.def b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/_ROOT_Component_DialogEditActualDailyProductionQuantity.def
new file mode 100644
index 0000000..d8cdb67
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogEditActualDailyProductionQuantity/_ROOT_Component_DialogEditActualDailyProductionQuantity.def
@@ -0,0 +1,22 @@
+Quintiq file version 2.0
+#root
+#parent: MacroPlannerWebApp
+OrphanComponent DialogEditActualDailyProductionQuantity
+{
+  #keys: '[414996.1.257133950]'
+  BaseType: 'WebForm'
+  Children:
+  [
+    #child: pnlContent
+    #child: pnlActions
+  ]
+  Properties:
+  [
+    Alignment: 'trailing'
+    EnterButton: 'btnOk'
+    EscapeButton: 'btnCancel'
+    ExcludeFromActiveComponent: true
+    Padding: 'false'
+    Title: '缂栬緫瀹為檯鐢熶骇搴撳瓨鏁伴噺'
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_ListActualDailyProduction.def b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_ListActualDailyProduction.def
index 9771638..d2910b8 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_ListActualDailyProduction.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_ListActualDailyProduction.def
@@ -38,4 +38,22 @@
   [
     Taborder: 0
   ]
+  ResponseDefinitions:
+  [
+    DelegatedResponseDefinition OnClick id:Responsedef_ListActualDailyProduction_WebMenu_OnClick
+    {
+      #keys: '[414996.1.256612374]'
+      Initiator: 'WebMenu'
+      IsInherited: false
+      ResponseType: 'OnClick'
+      Arguments:
+      [
+        ResponseDefinitionArgument selection
+        {
+          #keys: '[467.0.15387290]'
+          Binding: 'this.Selection()'
+        }
+      ]
+    }
+  ]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listContextMenuActualDailyProduction.def b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listContextMenuActualDailyProduction.def
index d9f75a7..2f868c9 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listContextMenuActualDailyProduction.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listContextMenuActualDailyProduction.def
@@ -3,6 +3,20 @@
 {
   #keys: '[414996.1.184390822]'
   BaseType: 'listContextMenu'
+  Children:
+  [
+    Component MenuEditActualDailyProductionQuantity
+    {
+      #keys: '[414996.1.256612646]'
+      BaseType: 'WebMenu'
+      Properties:
+      [
+        Image: 'PENCIL'
+        Taborder: 3
+        Title: 'Edit'
+      ]
+    }
+  ]
   Properties:
   [
     Taborder: 0
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_ListActualDailyProduction_MenuEditActualDailyProductionQuantity_OnC.def b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_ListActualDailyProduction_MenuEditActualDailyProductionQuantity_OnC.def
new file mode 100644
index 0000000..326a233
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_ListActualDailyProduction_MenuEditActualDailyProductionQuantity_OnC.def
@@ -0,0 +1,20 @@
+Quintiq file version 2.0
+#parent: ListActualDailyProduction
+Response OnClick (
+  ActualDailyProductionData selection
+) id:Response_ListActualDailyProduction_MenuEditActualDailyProductionQuantity_OnClick
+{
+  #keys: '[414996.1.256612464]'
+  CanBindMultiple: false
+  DefinitionID => /ListActualDailyProduction/Responsedef_ListActualDailyProduction_WebMenu_OnClick
+  GroupServerCalls: true
+  Initiator: 'MenuEditActualDailyProductionQuantity'
+  QuillAction
+  {
+    Body:
+    [*
+      dlg := construct( DialogEditActualDailyProductionQuantity );
+      dlg.Edit( selection )
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormArchivePackagingPlan/Component_MatrixEditorArchivePackagingPlan.def b/_Main/UI/MacroPlannerWebApp/Component_FormArchivePackagingPlan/Component_MatrixEditorArchivePackagingPlan.def
index d06318b..2725c7b 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormArchivePackagingPlan/Component_MatrixEditorArchivePackagingPlan.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormArchivePackagingPlan/Component_MatrixEditorArchivePackagingPlan.def
@@ -26,7 +26,7 @@
       ]
       Properties:
       [
-        Attributes: 'CC_PackagingInventory;CC_UnpackagedInventory;EndingInventory;InitialPackagingInventory;NetDemand;NewSupply;Out;Package;PackagingInventory;TransferIn;UnpackagedInventory;Unpacking'
+        Attributes: 'NetDemand;NewSupply;EndingInventory;Out;TransferIn;UnpackagedInventory;PackagingInventory;Package;Unpacking'
         Column: 'ArchivePackagingPlanColumn'
         Row: 'ArchivePackagingPlanRow'
         Taborder: 0
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormArchiveShiftPlan/Component_MatrixEditorArchiveShiftPlan.def b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveShiftPlan/Component_MatrixEditorArchiveShiftPlan.def
index 68a79ae..88e3276 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormArchiveShiftPlan/Component_MatrixEditorArchiveShiftPlan.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveShiftPlan/Component_MatrixEditorArchiveShiftPlan.def
@@ -26,7 +26,7 @@
       ]
       Properties:
       [
-        Attributes: 'EventType;IsHoliday;Outcome;Remark;MacroPlanName'
+        Attributes: 'Outcome;Remark'
         Column: 'ArchiveShiftPlanColumn'
         Row: 'ArchiveShiftPlanRow'
         Taborder: 0

--
Gitblit v1.9.3