From b07ae18d8846d286a0be2bfbfb694485d4ca2db3 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期五, 06 九月 2024 14:54:41 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg

---
 _Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupDebug_ButtonTest_OnClick.def |    2 
 _Main/BL/Type_LocalCell_Default/StaticMethod_GenerateStandardHoursReport.qbl                                                   |  104 ++++++++++++++++++++++---
 _Main/BL/Type_ShiftPlan/Function_CalcDefaultRemark.qbl                                                                         |   13 +++
 _Main/BL/Type_Test/StaticMethod_Test.qbl                                                                                       |    3 
 _Main/BL/Type_ShiftPlan/Method_GetDefaultDayOvertimeHour.qbl                                                                   |   43 ++++++++++
 _Main/BL/Type_ShiftPlan/Attribute_DefaultRemark.qbl                                                                            |    7 +
 _Main/BL/Type_ShiftPlan/Method_GetBreakDayOvertimeHour.qbl                                                                     |   42 ++++++++++
 7 files changed, 198 insertions(+), 16 deletions(-)

diff --git a/_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateStandardHoursReport.qbl b/_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateStandardHoursReport.qbl
index 738d95b..a33d7b0 100644
--- a/_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateStandardHoursReport.qbl
+++ b/_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateStandardHoursReport.qbl
@@ -46,32 +46,103 @@
       
       unitIndexTree.Root().AddChild( unitIndexTree.GetHandle( unit.ID() ),i );
     }
+    
+    shiftPlanIndexTree := NamedValueTree::Create();
+    for( i := 0 ; i<shiftPlans.Size(); i++ ){
+      shiftPlan := shiftPlans.Element( i );
+      period := shiftPlan.UnitPeriodTime().Period_MP();
+      rowKey := shiftPlan.UnitPeriodTime().Unit().ID();
+      columnKey := period.StartDate().AsQUILL() + period.EndDate().AsQUILL();
+      shiftPlanHanlde := shiftPlanIndexTree.GetHandle( rowKey + columnKey );
+      shiftPlanIndexTree.Root().AddChild( shiftPlanHanlde, i );
+    }
+    
     traverse( shiftPlans,Elements,shiftPlan ){
       rowKey := shiftPlan.UnitPeriodTime().Unit().ID();
       row := rows.Element( rowIndexTree.Root().Child( rowIndexTree.GetHandle( rowKey )).GetValueAsNumber() );
+      nextShiftPlan := constnull( ShiftPlan );
+      {
+        nextPeriod := shiftPlan.UnitPeriodTime().Period_MP().NextPeriod();
+        if( not isnull( nextPeriod )){
+          columnKey := nextPeriod.StartDate().AsQUILL() + nextPeriod.EndDate().AsQUILL();
+          nextShiftPlanHanlde := shiftPlanIndexTree.GetHandle( rowKey + columnKey );
+          nextShiftPlanIndex := guard( shiftPlanIndexTree.Root().Child( nextShiftPlanHanlde ),null( NamedValue ));
+          if( not isnull( nextShiftPlanIndex )){
+            nextShiftPlan := shiftPlans.Element( nextShiftPlanIndex.GetValueAsNumber() );
+          }
+        }
+      }
     
       // gongchangCell := LocalCell_Default::GetCell(  rowKey + column1.Name(), cellIndexTree, cells, row, column1 );
       // chanxianxCell := LocalCell_Default::GetCell(  rowKey + column2.Name(), cellIndexTree, cells, row, column2 );
-    
-      shengchanCell := LocalCell_Default::GetCell(  rowKey + column3.Name(), cellIndexTree, cells, row, column3 );
-      week := shiftPlan.UnitPeriodTime().Period_MP().StartDate().DayOfWeek();
+      // 宸ヤ綔鏃�
+      workingDayCell := LocalCell_Default::GetCell(  rowKey + column3.Name(), cellIndexTree, cells, row, column3 );
+      // 鑺傚亣鏃ュ姞鐝� 
+      holidayOvertimeHourCell := LocalCell_Default::GetCell(  rowKey + column6.Name(), cellIndexTree, cells, row, column6 );
+      // 浼戞伅鏃ュ姞鐝� 
+      breakDayOvertimeHourCell := LocalCell_Default::GetCell(  rowKey + column5.Name(), cellIndexTree, cells, row, column5 );
+      // 骞虫椂鍔犵彮
+      defaultDayOvertimeHourCell := LocalCell_Default::GetCell(  rowKey + column4.Name(), cellIndexTree, cells, row, column4 );
+      
       if( shiftPlan.Outcome() <> "" ){
-        shengchanCell.RealValue( shengchanCell.RealValue() + 1 );
+        workingDayCell.RealValue( workingDayCell.RealValue() + 1 );
         if( shiftPlan.IsHoliday() ){
-          // 鑺傚亣鏃ュ姞鐝� 
-          jiejiariCell := LocalCell_Default::GetCell(  rowKey + column6.Name(), cellIndexTree, cells, row, column6 );
-          jiejiariCell.SetBreakDayOverTimeDurction( shiftPlan.Outcome() );
-        }else if( week = 6 or week = 7 ){
-          // 浼戞伅鏃ュ姞鐝� 
-          xiuxiCell := LocalCell_Default::GetCell(  rowKey + column5.Name(), cellIndexTree, cells, row, column5 );
-          xiuxiCell.SetBreakDayOverTimeDurction( shiftPlan.Outcome() );
+          // 鑺傚亣鏃ュ姞鐝�
+          overtime := shiftPlan.GetBreakDayOvertimeHour( false );
+          holidayOvertimeHourCell.RealValue( holidayOvertimeHourCell.RealValue() + overtime );
+          if( not isnull( nextShiftPlan )){
+            nextDayOvertime := shiftPlan.GetBreakDayOvertimeHour( true );
+            if( nextShiftPlan.IsHoliday()){
+              // 涓嬩竴澶╂槸鑺傚亣鏃�
+              holidayOvertimeHourCell.RealValue( holidayOvertimeHourCell.RealValue() + nextDayOvertime );
+            }else if( shiftPlan.DefaultRemark().LikeUserLocale( "鍛ㄥ叚" ) or shiftPlan.DefaultRemark().LikeUserLocale( "鍛ㄦ棩" ) ){
+              // 涓嬩竴澶╂槸鍛ㄥ叚鎴栧懆鏃�
+              breakDayOvertimeHourCell.RealValue( breakDayOvertimeHourCell.RealValue() + nextDayOvertime );
+            }else{
+              // 涓嬩竴澶╂槸骞冲父鐨勫伐浣滄棩
+              nextDayOvertime := shiftPlan.GetDefaultDayOvertimeHour( true );
+              defaultDayOvertimeHourCell.RealValue( defaultDayOvertimeHourCell.RealValue() + nextDayOvertime );
+            }
+          }
+        }else if( shiftPlan.DefaultRemark().LikeUserLocale( "鍛ㄥ叚" ) or shiftPlan.DefaultRemark().LikeUserLocale( "鍛ㄦ棩" ) ){
+          // 浼戞伅鏃ュ姞鐝�
+          overtime := shiftPlan.GetBreakDayOvertimeHour( false );
+          breakDayOvertimeHourCell.RealValue( breakDayOvertimeHourCell.RealValue() + overtime );
+          if( not isnull( nextShiftPlan )){
+            nextDayOvertime := shiftPlan.GetBreakDayOvertimeHour( true );
+            if( nextShiftPlan.IsHoliday()){
+              // 涓嬩竴澶╂槸鑺傚亣鏃�
+              holidayOvertimeHourCell.RealValue( holidayOvertimeHourCell.RealValue() + nextDayOvertime );
+            }else if( shiftPlan.DefaultRemark().LikeUserLocale( "鍛ㄥ叚" ) or shiftPlan.DefaultRemark().LikeUserLocale( "鍛ㄦ棩" ) ){
+              // 涓嬩竴澶╂槸鍛ㄥ叚鎴栧懆鏃�
+              breakDayOvertimeHourCell.RealValue( breakDayOvertimeHourCell.RealValue() + nextDayOvertime );
+            }else{
+              // 涓嬩竴澶╂槸骞冲父鐨勫伐浣滄棩
+              nextDayOvertime := shiftPlan.GetDefaultDayOvertimeHour( true );
+              defaultDayOvertimeHourCell.RealValue( defaultDayOvertimeHourCell.RealValue() + nextDayOvertime );
+            }
+          }
         }else{
           // 骞虫椂鍔犵彮
-          jiabanCell := LocalCell_Default::GetCell(  rowKey + column4.Name(), cellIndexTree, cells, row, column4 );
-          jiabanCell.SetOvertimeDurction( shiftPlan.Outcome() );
+          overtime := shiftPlan.GetDefaultDayOvertimeHour( false );
+          defaultDayOvertimeHourCell.RealValue( defaultDayOvertimeHourCell.RealValue() + overtime );
+          if( not isnull( nextShiftPlan )){
+            nextDayOvertime := shiftPlan.GetBreakDayOvertimeHour( true );
+            if( nextShiftPlan.IsHoliday()){
+              // 涓嬩竴澶╂槸鑺傚亣鏃�
+              holidayOvertimeHourCell.RealValue( holidayOvertimeHourCell.RealValue() + nextDayOvertime );
+            }else if( shiftPlan.DefaultRemark().LikeUserLocale( "鍛ㄥ叚" ) or shiftPlan.DefaultRemark().LikeUserLocale( "鍛ㄦ棩" ) ){
+              // 涓嬩竴澶╂槸鍛ㄥ叚鎴栧懆鏃�
+              breakDayOvertimeHourCell.RealValue( breakDayOvertimeHourCell.RealValue() + nextDayOvertime );
+            }else{
+              // 涓嬩竴澶╂槸骞冲父鐨勫伐浣滄棩
+              nextDayOvertime := shiftPlan.GetDefaultDayOvertimeHour( true );
+              defaultDayOvertimeHourCell.RealValue( defaultDayOvertimeHourCell.RealValue() + nextDayOvertime );
+            }
+          }
         }
       }else{
-        if( not shiftPlan.IsHoliday() and not ( week = 6 or week = 7 )){
+        if( not shiftPlan.IsHoliday() and not ( shiftPlan.DefaultRemark().LikeUserLocale( "鍛ㄥ叚" ) or shiftPlan.DefaultRemark().LikeUserLocale( "鍛ㄦ棩" ) )){
           qiangongCell := LocalCell_Default::GetCell(  rowKey + column7.Name(), cellIndexTree, cells, row, column7 );
           qiangongCell.RealValue( qiangongCell.RealValue() + 8 );
         }
@@ -115,6 +186,11 @@
       qiangongCell := LocalCell_Default::GetCell(  rowKey + column7.Name(), cellIndexTree, cells, row, column7 );
       qiangongfeiCell := LocalCell_Default::GetCell(  rowKey + column11.Name(), cellIndexTree, cells, row, column11 );
       qiangongfeiCell.RealValue( EmployeeCost::GetSalary( unit,defaultMultiplier,qiangongCell.RealValue() ));
+      
+      
+      // 宸ヤ綔鏃�
+      workingDayCell := LocalCell_Default::GetCell(  rowKey + column3.Name(), cellIndexTree, cells, row, column3 );
+      workingDayCell.RealValue( workingDayCell.RealValue() + 1 );
     }
     
     return table;
diff --git a/_Main/BL/Type_ShiftPlan/Attribute_DefaultRemark.qbl b/_Main/BL/Type_ShiftPlan/Attribute_DefaultRemark.qbl
new file mode 100644
index 0000000..ce26bd7
--- /dev/null
+++ b/_Main/BL/Type_ShiftPlan/Attribute_DefaultRemark.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute DefaultRemark
+{
+  #keys: '3[414996.1.72390028][414996.1.72390027][414996.1.72390029]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_ShiftPlan/Function_CalcDefaultRemark.qbl b/_Main/BL/Type_ShiftPlan/Function_CalcDefaultRemark.qbl
new file mode 100644
index 0000000..c492fcb
--- /dev/null
+++ b/_Main/BL/Type_ShiftPlan/Function_CalcDefaultRemark.qbl
@@ -0,0 +1,13 @@
+Quintiq file version 2.0
+#parent: #root
+Function CalcDefaultRemark
+{
+  TextBody:
+  [*
+    // Akari Sep-6-2024 (created)
+    
+    value := this.CalculateRemark();
+    
+    this.DefaultRemark( value );
+  *]
+}
diff --git a/_Main/BL/Type_ShiftPlan/Method_GetBreakDayOvertimeHour.qbl b/_Main/BL/Type_ShiftPlan/Method_GetBreakDayOvertimeHour.qbl
new file mode 100644
index 0000000..55d6b6b
--- /dev/null
+++ b/_Main/BL/Type_ShiftPlan/Method_GetBreakDayOvertimeHour.qbl
@@ -0,0 +1,42 @@
+Quintiq file version 2.0
+#parent: #root
+Method GetBreakDayOvertimeHour (
+  Boolean isGetNextDay
+) const declarative remote as Real
+{
+  TextBody:
+  [*
+    // Akari Sep-6-2024 (created)
+    overtime := 0.0;
+    nextDayOvertime := 0.0;
+    if( this.Outcome() = "1" ){
+      overtime := 0;
+      nextDayOvertime := 0.0;
+    }else if( this.Outcome() = "2" ){
+      overtime := 0;
+      nextDayOvertime := 0.0;
+    }else if(this.Outcome() = "9+9"){
+      overtime := 1;
+      nextDayOvertime := 1;
+    }else if(this.Outcome() = "10+10"){
+      overtime := 2;
+      nextDayOvertime := 2;
+    }else if(this.Outcome() = "1(9)" or this.Outcome() = "1锛�9锛�"){
+      overtime := 1;
+      nextDayOvertime := 0;
+    }else if(this.Outcome() = "1(10)" or this.Outcome() = "1锛�10锛�"){
+      overtime := 2;
+      nextDayOvertime := 0;
+    }else if(this.Outcome() = "3"){
+      overtime := 0;
+      nextDayOvertime := 0;
+    }
+    result := 0.0;
+    if( isGetNextDay ){
+      result := nextDayOvertime;
+    }else{
+      result := overtime;
+    }
+    return result;
+  *]
+}
diff --git a/_Main/BL/Type_ShiftPlan/Method_GetDefaultDayOvertimeHour.qbl b/_Main/BL/Type_ShiftPlan/Method_GetDefaultDayOvertimeHour.qbl
new file mode 100644
index 0000000..12ccccf
--- /dev/null
+++ b/_Main/BL/Type_ShiftPlan/Method_GetDefaultDayOvertimeHour.qbl
@@ -0,0 +1,43 @@
+Quintiq file version 2.0
+#parent: #root
+Method GetDefaultDayOvertimeHour (
+  Boolean isGetNextDay
+) const declarative remote as Real
+{
+  TextBody:
+  [*
+    // rislai Jul-10-2024 (created)
+    overtime := 0.0;
+    nextDayOvertime := 0.0;
+    if( this.Outcome() = "1" ){
+      overtime := 0;
+      nextDayOvertime := 0.0;
+    }else if( this.Outcome() = "2" ){
+      overtime := 0;
+      nextDayOvertime := 0.0;
+    }else if(this.Outcome() = "9+9"){
+      overtime := 1;
+      nextDayOvertime := 1;
+    }else if(this.Outcome() = "10+10"){
+      overtime := 2;
+      nextDayOvertime := 2;
+    }else if(this.Outcome() = "1(9)" or this.Outcome() = "1锛�9锛�"){
+      overtime := 1;
+      nextDayOvertime := 0;
+    }else if(this.Outcome() = "1(10)" or this.Outcome() = "1锛�10锛�"){
+      overtime := 2;
+      nextDayOvertime := 0;
+    }else if(this.Outcome() = "3"){
+      overtime := 0;
+      nextDayOvertime := 0;
+    }
+    
+    result := 0.0;
+    if( isGetNextDay ){
+      result := nextDayOvertime;
+    }else{
+      result := overtime;
+    }
+    return result;
+  *]
+}
diff --git a/_Main/BL/Type_Test/StaticMethod_Test.qbl b/_Main/BL/Type_Test/StaticMethod_Test.qbl
index a1d7e18..a037ae7 100644
--- a/_Main/BL/Type_Test/StaticMethod_Test.qbl
+++ b/_Main/BL/Type_Test/StaticMethod_Test.qbl
@@ -5,7 +5,8 @@
   MacroPlan macroPlan,
   Archive archive,
   RecycleBin recycleBin,
-  ArchiveExecutionStatus archiveExecutionStatus
+  ArchiveExecutionStatus archiveExecutionStatus,
+  InterfaceDataset interfaceDataset
 )
 {
   TextBody:
diff --git a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupDebug_ButtonTest_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupDebug_ButtonTest_OnClick.def
index 73ce7f1..ee95e71 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupDebug_ButtonTest_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupDebug_ButtonTest_OnClick.def
@@ -9,7 +9,7 @@
   {
     Body:
     [*
-      Test::Test( ScenarioManager,MacroPlan,Archive,RecycleBin,ArchiveExecutionStatus );
+      Test::Test( ScenarioManager,MacroPlan,Archive,RecycleBin,ArchiveExecutionStatus,InterfaceDataset );
       
       WebMessageBox::Success( "Success");
     *]

--
Gitblit v1.9.3