xiaoding721
2024-09-06 aec8326b660028ef0d11d472ec71d587bf54b719
修复工时制报表的一些问题
已修改1个文件
已添加4个文件
209 ■■■■■ 文件已修改
_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateStandardHoursReport.qbl 104 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ShiftPlan/Attribute_DefaultRemark.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ShiftPlan/Function_CalcDefaultRemark.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ShiftPlan/Method_GetBreakDayOvertimeHour.qbl 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ShiftPlan/Method_GetDefaultDayOvertimeHour.qbl 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_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;
_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
}
_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 );
  *]
}
_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;
  *]
}
_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;
  *]
}