lihongji
2024-08-04 fb1634fb000c80a7b66d3af521c964dea9923d79
Merge remote-tracking branch 'origin/dev' into dev
已重命名2个文件
已添加30个文件
已修改15个文件
已删除6个文件
1071 ■■■■■ 文件已修改
_Main/BL/Type_FinancialProductionReport/Method_GetCurrentPeriod.qbl 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionReport/Method_GetRowByUnit.qbl 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionReport/StaticMethod_GetDefaultCCUnit.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionReport/StaticMethod_GetDefaultDLUnit.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionRow/Method_Initialize.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultCCUnit.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultDLUnit.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_Event/StaticMethod_ValidDate.qbl 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MaxDayDate.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MaxMonthDate.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MaxWeekDate.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MinDayDate.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MinMonthDate.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MinWeekDate.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMaxDayDate.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMaxMonthDate.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMaxWeekDate.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMinDayDate.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMinMonthDate.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMinWeekDate.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Method_GetColumnByTimeUnit.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Method_ProcessColumnDay.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Method_ProcessColumnMonth#1.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_SubscriberEventTable/Method_ProcessColumnWeek.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/Attribute_BaseVersion.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/Attribute_BaseVersionValue.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/Attribute_CompareVersion.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/Attribute_CompareVersionValue.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/Attribute_Gap.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/DefaultValue_BaseVersionValue.qbl 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/DefaultValue_CompareVersionValue.qbl 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/Function_CalcGap.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/Method_GetAttributeByName.qbl 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/StaticMethod_AsyncExport.qbl 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/StaticMethod_Compared.qbl 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/StaticMethod_GetAttributeNames.qbl 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/StaticMethod_GetColumnXML.qbl 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/_ROOT_Type_LocalCell_OfflinePlanComparison.qbl 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ProductionComparison/Attribute_BaseVersionValue.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ProductionComparison/Attribute_CompareVersionValue.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ProductionComparison/Method_GetAttributeByName.qbl 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ProductionComparison/StaticMethod_Compared.qbl 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ProductionComparison/StaticMethod_FillCells.qbl 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ProductionComparison/StaticMethod_FillRows.qbl 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ProductionComparison/StaticMethod_GenerateColumnIndex.qbl 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ProductionComparison/StaticMethod_GetAttributeNames.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalRow/Attribute_Remark.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_TemplateManager/StaticMethod_GetCurveTemplate.qbl 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_TemplateManager/StaticMethod_GetIDSTemplate.qbl 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_TemplateManager/StaticMethod_GetPPATemplate.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionReport/Method_GetCurrentPeriod.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,53 @@
Quintiq file version 2.0
#parent: #root
Method GetCurrentPeriod (
  Date startofplanning,
  Period_MPs periods
) as owning Period_MPs
{
  Description: '获取当前月的计划周期---------------废弃'
  TextBody:
  [*
    // ç”„兰鸽 Aug-2-2024 (created)
    //开始日期到下个月的间隔天数
    currentperiods            := construct( Period_MPs );
    startofnextmonth          := startofplanning.StartOfNextMonth();
    //特殊情况,当开始日期正好是这个月第一天, åˆ™ç›´æŽ¥ä½¿ç”¨TimeUnit为月的数据
    if( startofplanning.StartOfMonth() = startofplanning ){
      period                  := selectobject( periods, Elements, period, period.TimeUnit() = Translations::MP_GlobalParameters_Month() and period.StartDate() = startofplanning );
      currentperiods.Add( period );
    } else if( startofplanning.StartOfWeek() = startofplanning ){
      //特殊情况,当开始日期正好是这个周第一天, åˆ™ç›´æŽ¥ä½¿ç”¨TimeUnit为周的数据, è·¨å‘¨æ—¶ä½¿ç”¨day
      traverse( periods, Elements, period, ( period.TimeUnit() =  Translations::MP_GlobalParameters_Week() and period.StartDate() < startofnextmonth )
                or (  period.TimeUnit() =  Translations::MP_GlobalParameters_Day() and period.EndDate() = startofnextmonth ) ){
        currentperiods.Add( period );
      }
    } else {
      duration                := startofplanning.StartOfNextMonth() - startofplanning;
      //如果计划开始日期到下个月小于7天,则可以直接使用Period的TimeUnit为天的数据
      if( duration <= 7 ){
        i := 1;
        traverse( periods, Elements, period, period.TimeUnit() = Translations::MP_GlobalParameters_Day() and i < duration ){
          currentperiods.Add( period );
          i ++;
        }
      }else{
        //反之需要在加上Period的TimeUnit为周的数据
        day := startofplanning;
        while( day < startofnextmonth ){
          if( day = day.StartOfWeek() ){
            period     := selectobject( periods, Elements, cperiod, cperiod.TimeUnit() = Translations::MP_GlobalParameters_Week() and cperiod.StartDate() = day );
            day        := period.EndDate();
            currentperiods.Add( period );
          } else {
            period     := selectobject( periods, Elements, cperiod, cperiod.TimeUnit() = Translations::MP_GlobalParameters_Day() and cperiod.StartDate() = day );
            day        := period.EndDate();
            currentperiods.Add( period );
          }
        }
      }
    }
    return &currentperiods;
  *]
}
_Main/BL/Type_FinancialProductionReport/Method_GetRowByUnit.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
Quintiq file version 2.0
#parent: #root
Method GetRowByUnit (
  String product,
  String unit
) as FinancialProductionRow
{
  Description: '根据工厂获取行'
  TextBody:
  [*
    // ç”„兰鸽 Aug-2-2024 (created)
    row := selectobject( this, FinancialProductionRow, row, row.Name() = product and row.Unit() = unit );
    if( isnull( row ) ){
      //初始化单元格
      row := this.FinancialProductionRow( relnew, Name := product, Unit := unit );
      traverse( this, FinancialProductionColumn, column ){
        row.Initialize( column, unit );
      }
    }
    return row;
  *]
}
_Main/BL/Type_FinancialProductionReport/StaticMethod_GetDefaultCCUnit.qbl
@@ -5,7 +5,7 @@
  TextBody:
  [*
    // ç”„兰鸽 Jun-25-2024 (created)
    return '长春';
    return '长春工厂';
    //return 'Assembly Plant (France)';
  *]
}
_Main/BL/Type_FinancialProductionReport/StaticMethod_GetDefaultDLUnit.qbl
@@ -5,7 +5,7 @@
  TextBody:
  [*
    // ç”„兰鸽 Jun-25-2024 (created)
    return '大连';
    return '大连工厂';
    //return 'Assembly Plant (Spain)';
  *]
}
_Main/BL/Type_FinancialProductionRow/Method_Initialize.qbl
@@ -2,7 +2,7 @@
#parent: #root
Method Initialize (
  FinancialProductionColumn column,
  Real quantity
  Number quantity
)
{
  TextBody:
@@ -10,7 +10,7 @@
    // ç”„兰鸽 Jun-24-2024 (created)
    cell := selectobject( this, FinancialProductionCell, cell, cell.FinancialProductionColumn() = column );
          
    value := [Real]cell.Value() + quantity;
    value := [Number]cell.Value() + quantity;
    cell.Value( [String]value );
  *]
}
_Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl
@@ -14,66 +14,54 @@
    source                    := owner.FinancialProductionSource( relnew, IsImport := false, Name := FinancialProductionReport::GetDefaultName() );
    table                     := source.FinancialProductionReport( relnew, ID := source.Name(), Name := source.Name(), IsImport := false );
    showtable                 := source.FinancialProductionReport( relnew, ID := source.Name() + 'Show', Name := source.Name(), IsImport := false, IsShow := true );
    startofplanning           := owner.StartOfPlanning();
    startofnextmonth          := owner.StartOfPlanning().StartOfNextMonth();
    startofyear               := startofplanning.StartOfYear();
    startofplanning           := owner.StartOfPlanning().Date();
    //startofnextmonth          := startofplanning.StartOfNextMonth();
    startofnextyear           := startofplanning.StartOfNextYear();
    
    search                    := source.FinancialProductionSearch( relnew, Unit := allunit, Generation := allunit, MqbMlb := allunit, Power := allunit );
    
    products                  := construct( Product_MPs );
    //需要的日期区间, å‘¨å’Œå¤©çš„只需要当前月
    //periods                   := selectset( owner, Period_MP, period, not period.IsHistorical()
    //                                        and period.StartDate() < startofnextmonth
    //                                        and period.TimeUnit() <> Translations::MP_GlobalParameters_Quarter()
    //                                        );
    //获取当前月需要的Period
    //currentperiods            := table.GetCurrentPeriod( startofplanning, periods );
    table.GenerateColumn( owner );
    traverse( owner, Product_MP.ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() and ( pisp.StockingPoint_MP().UnitID() = ccunit or pisp.StockingPoint_MP().UnitID() = dlunit ) ){
      unit := pisp.StockingPoint_MP().UnitID();
      info( unit, pisp.ProductID() );
      ccrow := null( FinancialProductionRow );
      dlrow := null( FinancialProductionRow );
      allrow := selectobject( table, FinancialProductionRow, row, row.Name() = pisp.ProductID() and row.Unit() = allunit );
      if( unit = ccunit ){
        ccrow := table.FinancialProductionRow( relnew, Name := pisp.ProductID(), Unit := unit );
      }else{
        dlrow := table.FinancialProductionRow( relnew, Name := pisp.ProductID(), Unit := unit );
      }
      if( isnull( allrow ) ){
    //取当前版本的product planning里new supply字段,分大连和长春工厂的产线,进行加总
    traverse( owner, StockingPoint_MP, stockingpoint ){
      unit         := stockingpoint.Unit();
      parentunits  := unit.GetAllParent();
      //是否属于长春工厂
      iscc         := unit.ID() = ccunit or exists( parentunits, Elements, punit, punit.ID() = ccunit );
      //是否属于大连工厂
      isdl         := unit.ID() = dlunit or exists( parentunits, Elements, punit, punit.ID() = dlunit );
      if( iscc or isdl ){
        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() ){
          //获取工厂行
          factoryrow := table.GetRowByUnit( pisp.ProductID(), ifexpr( iscc, ccunit, dlunit ) );
          //获取合计行
          allrow     := table.GetRowByUnit( pisp.ProductID(), allunit );
        products.Add( pisp.Product_MP() );
        allrow := table.FinancialProductionRow( relnew, Name := pisp.ProductID(), Unit := allunit );
      }
      for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){
        periodtime := start.Date();
        periodname := periodtime.Format( "M2/D2/Y" );
        column := selectobject( table, FinancialProductionColumn, column, column.Name() = periodname and column.Period() = periodtime );
        if( not isnull( ccrow ) ){
          ccrow.Initialize( column, ccunit );
        }
        if( not isnull( dlrow ) ){
          dlrow.Initialize( column, dlunit );
        }
        if( not exists( allrow, FinancialProductionCell, allcell, allcell.FinancialProductionColumn() = column ) ){
          allrow.Initialize( column, allunit );
        }
      }
      traverse( pisp, ProductInStockingPointInPeriod, pispip, pispip.Start() >= startofplanning
                and ( ( pispip.Start() < startofnextmonth and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() )
                      or ( pispip.Start() < startofnextyear and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Month() ) ) ){
          //当product planning的日期区间在需要的日期区间内
          traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear
    //                and ( ( pispip.Period_MP().StartDate().StartOfMonth() = startofplanning.StartOfMonth() and currentperiods.Find( pispip.Period_MP() ) >= 0 )
    //                 or ( pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Month() and pispip.Period_MP().StartDate() < startofnextyear ) )
                    ){
        periodtime := pispip.Start().StartOfMonth().Date();
        periodname := periodtime.Format( "M2/D2/Y" );
            quantity   := ceil( pispip.NewSupplyQuantity() );//向上取整
        
        column := selectobject( table, FinancialProductionColumn, column, column.Name() = periodname and column.Period() = periodtime );
        
        if( not isnull( ccrow ) ){
          ccrow.Initialize( column, pispip.NewSupplyProductionQuantity() );
        }
        if( not isnull( dlrow ) ){
          dlrow.Initialize( column, pispip.NewSupplyProductionQuantity() );
        }
        allrow.Initialize( column, pispip.NewSupplyProductionQuantity() );
            factoryrow.Initialize( column, quantity );
            allrow.Initialize( column, quantity );
      }
    }
      }
    }
    rows := selectsortedset( table, FinancialProductionRow, row, row.Name() );
    i    := 0;
    traverse( rows, Elements, e ){
_Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultCCUnit.qbl
@@ -5,7 +5,7 @@
  TextBody:
  [*
    // ç”„兰鸽 Jun-28-2024 (created)
    return '长春';
    return '长春工程';
    //return 'Assembly Plant (France)';
  *]
}
_Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultDLUnit.qbl
@@ -5,7 +5,7 @@
  TextBody:
  [*
    // ç”„兰鸽 Jun-28-2024 (created)
    return '大连';
    return '大连工厂';
    //return 'Assembly Plant (Spain)';
  *]
}
_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
@@ -27,7 +27,7 @@
    table.GenerateColumn( owner, 'All', startofyear, startofnextyear );
    //info( '-----------------------------------', table.InventorySummaryColumn( relsize ) );
    //库存数量为Actual inventories里面的点Planned inventories字段库存量加总
    traverse( owner, Product_MP.ProductInStockingPoint_MP, pisp, pisp.IsLeaf() and not pisp.IsSystem() and ( pisp.StockingPoint_MP().UnitID() = ccunit or pisp.StockingPoint_MP().UnitID() = dlunit ) ){
    traverse( owner, Product_MP.ProductInStockingPoint_MP, pisp, pisp.IsLeaf() and not pisp.IsSystem() and not isnull( pisp.StockingPoint_MP() ) and ( pisp.StockingPoint_MP().UnitID() = ccunit or pisp.StockingPoint_MP().UnitID() = dlunit ) ){
      unit := pisp.StockingPoint_MP().UnitID();
      product := pisp.Product_MP();
    //  info( '-----------------------------------', unit, product.ID() );
_Main/BL/Type_LibCal_Event/StaticMethod_ValidDate.qbl
@@ -22,5 +22,6 @@
      feedback_o := Translations::MP_LibCal_Event_ValidDate();
    }
    return feedback_o = '';
    //return true;
  *]
}
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MaxDayDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute MaxDayDate
{
  #keys: '3[415136.0.960591378][415136.0.960591377][415136.0.960591379]'
  Description: '最大日期-天'
  ValueType: Date
}
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MaxMonthDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute MaxMonthDate
{
  #keys: '3[415136.0.960591412][415136.0.960591411][415136.0.960591413]'
  Description: '最大日期-月'
  ValueType: Date
}
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MaxWeekDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute MaxWeekDate
{
  #keys: '3[415136.0.960591398][415136.0.960591397][415136.0.960591399]'
  Description: '最大日期-周'
  ValueType: Date
}
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MinDayDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute MinDayDate
{
  #keys: '3[415136.0.960591388][415136.0.960591387][415136.0.960591389]'
  Description: '最小日期-天'
  ValueType: Date
}
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MinMonthDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute MinMonthDate
{
  #keys: '3[415136.0.960591419][415136.0.960591418][415136.0.960591420]'
  Description: '最小日期-月'
  ValueType: Date
}
_Main/BL/Type_LibCal_SubscriberEventTable/Attribute_MinWeekDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute MinWeekDate
{
  #keys: '3[415136.0.960591405][415136.0.960591404][415136.0.960591406]'
  Description: '最小日期-周'
  ValueType: Date
}
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMaxDayDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
Quintiq file version 2.0
#parent: #root
Function CalcMaxDayDate
{
  TextBody:
  [*
    // ç”„兰鸽 Aug-1-2024 (created)
    value := maxobject( this,LibCal_SubscriberEventColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day(), column.Period() );
    this.MaxDayDate( value.Period() );
  *]
}
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMaxMonthDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
Quintiq file version 2.0
#parent: #root
Function CalcMaxMonthDate
{
  TextBody:
  [*
    // ç”„兰鸽 Aug-1-2024 (created)
    value := maxobject( this,LibCal_SubscriberEventColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Month(), column.Period() );
    this.MaxMonthDate( value.Period() );
  *]
}
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMaxWeekDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
Quintiq file version 2.0
#parent: #root
Function CalcMaxWeekDate
{
  TextBody:
  [*
    // ç”„兰鸽 Aug-1-2024 (created)
    value := maxobject( this,LibCal_SubscriberEventColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Week(), column.Period() );
    this.MaxWeekDate( value.Period() );
  *]
}
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMinDayDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
Quintiq file version 2.0
#parent: #root
Function CalcMinDayDate
{
  TextBody:
  [*
    // ç”„兰鸽 Aug-1-2024 (created)
    value := minobject( this, LibCal_SubscriberEventColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day(), column.Period() );
    this.MinDayDate( value.Period() );
  *]
}
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMinMonthDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
Quintiq file version 2.0
#parent: #root
Function CalcMinMonthDate
{
  TextBody:
  [*
    // ç”„兰鸽 Aug-1-2024 (created)
    value := minobject( this, LibCal_SubscriberEventColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Month(), column.Period() );
    this.MinMonthDate( value.Period() );
  *]
}
_Main/BL/Type_LibCal_SubscriberEventTable/Function_CalcMinWeekDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
Quintiq file version 2.0
#parent: #root
Function CalcMinWeekDate
{
  TextBody:
  [*
    // ç”„兰鸽 Aug-1-2024 (created)
    value := minobject( this, LibCal_SubscriberEventColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Week(), column.Period() );
    this.MinWeekDate( value.Period() );
  *]
}
_Main/BL/Type_LibCal_SubscriberEventTable/Method_GetColumnByTimeUnit.qbl
@@ -9,7 +9,7 @@
  TextBody:
  [*
    // ç”„兰鸽 Jul-26-2024 (created)
    column := selectobject( table, LibCal_SubscriberEventColumn, column, column.Name() = time.Format( 'M/D/Y' ) );
    column := selectobject( table, LibCal_SubscriberEventColumn, column, column.Name() = time.Format( 'M/D/Y' ), column.TimeUnit() = timeunit );
    if( isnull( column ) ){
      column := table.LibCal_SubscriberEventColumn( relnew, Name := time.Format( 'M/D/Y' ), Period := time, TimeUnit := timeunit );
    }
_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeTable.qbl
@@ -33,14 +33,27 @@
    
      }
    }
    //info( '----------------------1------------------------', this.LibCal_SubscriberEventColumn( relsize ) );
    //traverse( this, LibCal_SubscriberEventColumn, column ){
    //  traverse( this, LibCal_SubscriberEventRow, row ){
    //    if( not exists( column, LibCal_SubscriberEventCell, cell, cell.LibCal_SubscriberEventRow() = row ) ) {
    //      cell := column.LibCal_SubscriberEventCell( relnew, Value := '' );
    //      row.LibCal_SubscriberEventCell( relinsert, cell );
    //  info( '------------------------', column.Name(), column.Period(), column.TimeUnit() );
    //    }
    //  }
    //}
    Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MaxDayDate ) );
    Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MaxWeekDate ) );
    Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MaxMonthDate ) );
    Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MinDayDate ) );
    Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MinWeekDate ) );
    Transaction::Transaction().Propagate( attribute( LibCal_SubscriberEventTable, MinMonthDate ) );
    this.ProcessColumnDay();
    this.ProcessColumnWeek();
    this.ProcessColumnMonth();
    traverse( this, LibCal_SubscriberEventColumn, column ){
      traverse( this, LibCal_SubscriberEventRow, row ){
        if( not exists( column, LibCal_SubscriberEventCell, cell, cell.LibCal_SubscriberEventRow() = row ) ) {
          cell := column.LibCal_SubscriberEventCell( relnew, Value := '' );
          row.LibCal_SubscriberEventCell( relinsert, cell );
        }
      }
    }
  *]
}
_Main/BL/Type_LibCal_SubscriberEventTable/Method_ProcessColumnDay.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
Quintiq file version 2.0
#parent: #root
Method ProcessColumnDay
{
  TextBody:
  [*
    // ç”„兰鸽 Aug-1-2024 (created)
    day      := ( this.MinDayDate() + Duration::Days( 1 ) ).Date();
    while( day < this.MaxDayDate() ){
      if( not exists( this, LibCal_SubscriberEventColumn, column, column.Period() = day and column.TimeUnit() = Translations::MP_GlobalParameters_Day() ) ){
        this.LibCal_SubscriberEventColumn( relnew, Name := day.Format( 'M/D/Y' ), Period := day, TimeUnit := Translations::MP_GlobalParameters_Day() );
      }
      day      := ( day + Duration::Days( 1 ) ).Date();
    }
  *]
}
_Main/BL/Type_LibCal_SubscriberEventTable/Method_ProcessColumnMonth#1.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
Quintiq file version 2.0
#parent: #root
Method ProcessColumnMonth
{
  TextBody:
  [*
    // ç”„兰鸽 Aug-1-2024 (created)
    day      := this.MinMonthDate().StartOfNextMonth();
    while( day < this.MaxMonthDate()){
      if( not exists( this, LibCal_SubscriberEventColumn, column, column.Period() = day and column.TimeUnit() = Translations::MP_GlobalParameters_Month()) ){
        this.LibCal_SubscriberEventColumn( relnew, Name := day.Format( 'M/D/Y' ), Period := day, TimeUnit := Translations::MP_GlobalParameters_Month() );
      }
      day      := day.StartOfNextMonth();
    }
  *]
}
_Main/BL/Type_LibCal_SubscriberEventTable/Method_ProcessColumnWeek.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
Quintiq file version 2.0
#parent: #root
Method ProcessColumnWeek
{
  TextBody:
  [*
    // ç”„兰鸽 Aug-1-2024 (created)
    day      := this.MinWeekDate().StartOfNextWeek();
    while( day < this.MaxWeekDate() ){
      if( not exists( this, LibCal_SubscriberEventColumn, column, column.Period() = day and column.TimeUnit() = Translations::MP_GlobalParameters_Week() ) ){
        this.LibCal_SubscriberEventColumn( relnew, Name := day.Format( 'M/D/Y' ), Period := day, TimeUnit := Translations::MP_GlobalParameters_Week() );
      }
      day      := day.StartOfNextWeek();
    }
  *]
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/Attribute_BaseVersion.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute BaseVersion
{
  #keys: '3[412672.1.76654685][412672.1.76654684][412672.1.76654686]'
  ValueType: Real
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/Attribute_BaseVersionValue.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute BaseVersionValue
{
  #keys: '3[412672.1.76654688][412672.1.76654687][412672.1.76654689]'
  ValueType: String
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/Attribute_CompareVersion.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute CompareVersion
{
  #keys: '3[412672.1.76654691][412672.1.76654690][412672.1.76654692]'
  ValueType: Real
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/Attribute_CompareVersionValue.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute CompareVersionValue
{
  #keys: '3[412672.1.76654694][412672.1.76654693][412672.1.76654695]'
  ValueType: String
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/Attribute_Gap.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute Gap
{
  #keys: '3[412672.1.76654697][412672.1.76654696][412672.1.76654698]'
  ValueType: Real
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/DefaultValue_BaseVersionValue.qbl
_Main/BL/Type_LocalCell_OfflinePlanComparison/DefaultValue_CompareVersionValue.qbl
_Main/BL/Type_LocalCell_OfflinePlanComparison/Function_CalcGap.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
Quintiq file version 2.0
#parent: #root
Function CalcGap
{
  TextBody:
  [*
    // rislai Jun-21-2024 (created)
    value := this.BaseVersion() - this.CompareVersion();
    this.Gap( value );
  *]
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/Method_GetAttributeByName.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
Quintiq file version 2.0
#parent: #root
Method GetAttributeByName (
  String attributeName
) const declarative as String
{
  TextBody:
  [*
    // rislai Jun-21-2024 (created)
    value := "";
    if( attributeName = "BaseVersion" ){
       if( not this.LocalColumn().IsAttrbuteColumn() ){
         value := this.BaseVersion().Format( "N(Dec)" );
       }
    }
    if( attributeName = "CompareVersion" ){
      if( not this.LocalColumn().IsAttrbuteColumn() ){
        value := this.CompareVersion().Format( "N(Dec)" );
      }
    }
    if( attributeName = "Gap" ){
      if( not this.LocalColumn().IsAttrbuteColumn() ){
        value := this.Gap().Format( "N(Dec)" );
      }
    }
    if( attributeName = "BaseVersionValue" ){
      if( not this.LocalColumn().IsAttrbuteColumn() ){
        value := "0";
      }else{
        value := this.BaseVersionValue();
      }
    }
    if( attributeName = "CompareVersionValue" ){
      if( not this.LocalColumn().IsAttrbuteColumn() ){
        value := "0";
      }else{
        value := this.CompareVersionValue();
      }
    }
    return value;
  *]
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/StaticMethod_AsyncExport.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
Quintiq file version 2.0
#parent: #root
StaticMethod AsyncExport (
  RecycleBin recycleBin,
  const constcontent LocalRows rows,
  const constcontent LocalColumns columns,
  const MacroPlan macroPlan
)
{
  TextBody:
  [*
    // rislai Jun-20-2024 (created)
    sortColumns := selectsortedset( columns,Elements,column,true,column.Index());
    attributeNames := LocalCell_DemandComparison::GetAttributeNames();
    columnstring := emit( "" );
    flag := true;
    traverse( sortColumns,Elements,sortColumn ){
      if( flag ){
        attributeXML := rows -> LocalCell_DemandComparison::GetColumnXML( sortColumn,attributeNames,"attribute",macroPlan );
        columnstring := columnstring.Merge( attributeXML )
        flag := false;
      }
      cellxml := rows -> LocalCell_DemandComparison::GetColumnXML( sortColumn,attributeNames ,"data",macroPlan );
      columnstring := columnstring.Merge( cellxml);
    }
    columnstring -> GroupAll() -> ExportXMLManager::AwaitLocalTableXMLData( recycleBin,guard( rows.Element(0).LocalTable().Name(),"Sheet1") );
  *]
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/StaticMethod_Compared.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,107 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Compared (
  RecycleBin recycleBin,
  const OfflinePlanTable baseOfflinePlan,
  const OfflinePlanTable compareOfflinePlan
) as LocalTable
{
  TextBody:
  [*
    // rislai Jun-20-2024 (created)
    table := recycleBin.LocalTable( relnew,Name := "下线计划报表对比");
    localColumns := construct( LocalColumns );
    localColumnIndexTree := NamedValueTree::Create();
    traverse( baseOfflinePlan,OfflinePlanColumn,column,column.ColumnDate() >=  baseOfflinePlan.MacroPlan().StartOfPlanning().Date()){
      localColumnHandle := localColumnIndexTree.GetHandle( column.ColumnDate().AsQUILL() );
      localColumnIndex := guard( localColumnIndexTree.Root().Child( localColumnHandle ),null( NamedValue ));
      if( isnull( localColumnIndex )){
        localColumn := table.LocalColumn( relnew,CustomDate := column.ColumnDate());
        localColumns.Add( localColumn );
        localColumnIndexTree.Root().AddChild( localColumnHandle,localColumns.Size() - 1 );
      }
    }
    traverse( compareOfflinePlan,OfflinePlanColumn,column,column.ColumnDate() >=  compareOfflinePlan.MacroPlan().StartOfPlanning().Date()){
      localColumnHandle := localColumnIndexTree.GetHandle( column.ColumnDate().AsQUILL() );
      localColumnIndex := guard( localColumnIndexTree.Root().Child( localColumnHandle ),null( NamedValue ));
      if( isnull( localColumnIndex )){
        localColumn := table.LocalColumn( relnew,CustomDate := column.ColumnDate());
        localColumns.Add( localColumn );
        localColumnIndexTree.Root().AddChild( localColumnHandle,localColumns.Size() - 1 );
      }
    }
    baseOfflinePlanCells := construct( OfflinePlanCells, constcontent );
    baseOfflinePlanCellIndexTree := NamedValueTree::Create();
    compareOfflinePlanCells := construct( OfflinePlanCells, constcontent );
    compareOfflinePlanCellIndexTree := NamedValueTree::Create();
    localRows := construct( LocalRows );
    localRowIndexTree := NamedValueTree::Create();
    traverse( baseOfflinePlan,OfflinePlanRow,row,row.Type() = "1" ){
      rowKey := row.ProductID() + "@$#" + row.ProductionLine()+ "@$#";
      localRowHandle := localRowIndexTree.GetHandle( rowKey );
      localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue ));
      if( isnull( localRowIndex )){
        localRow := table.LocalRow( relnew,Index := table.GetRowIndexCache(),CustomName := row.ProductID(),Remark := rowKey );
        localRows.Add( localRow );
        localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 );
      }
      traverse( row,OfflinePlanCell,cell ){
        columnKey := cell.OfflinePlanColumn().ColumnDate().AsQUILL();
        cellKey := rowKey + columnKey;
        cellHandle := baseOfflinePlanCellIndexTree.GetHandle( cellKey );
        baseOfflinePlanCells.Add( cell );
        baseOfflinePlanCellIndexTree.Root().AddChild( cellHandle,baseOfflinePlanCells.Size() - 1 );
      }
    }
    traverse( compareOfflinePlan,OfflinePlanRow,row,row.Type() = "1" ){
      rowKey := row.ProductID() + "@$#" + row.ProductionLine()+ "@$#";
      localRowHandle := localRowIndexTree.GetHandle( rowKey );
      localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue ));
      if( isnull( localRowIndex )){
        localRow := table.LocalRow( relnew,Index := table.GetRowIndexCache(),CustomName := row.ProductID(),Remark := rowKey );
        localRows.Add( localRow );
        localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 );
      }
      traverse( row,OfflinePlanCell,cell ){
        columnKey := cell.OfflinePlanColumn().ColumnDate().AsQUILL();
        cellHandle := compareOfflinePlanCellIndexTree.GetHandle( rowKey + columnKey );
        compareOfflinePlanCells.Add( cell );
        compareOfflinePlanCellIndexTree.Root().AddChild( cellHandle,compareOfflinePlanCells.Size() - 1 );
      }
    }
    traverse( localRows,Elements,localRow ){
      rowKey := localRow.Remark();
      traverse( localColumns,Elements,localColumn ){
        columnKey := localColumn.CustomDate().AsQUILL();
        cellKey := rowKey + columnKey;
        baseOfflinePlanCell := constnull( OfflinePlanCell );
        compareOfflinePlanCell := constnull( OfflinePlanCell );
        baseOfflinePlanCellIndex := guard( baseOfflinePlanCellIndexTree.Root().Child( baseOfflinePlanCellIndexTree.GetHandle( cellKey ) ),null( NamedValue ));
        compareOfflinePlanCellIndex := guard( compareOfflinePlanCellIndexTree.Root().Child( compareOfflinePlanCellIndexTree.GetHandle( cellKey ) ),null( NamedValue ));
        if( not isnull( baseOfflinePlanCellIndex )){
          baseOfflinePlanCell := baseOfflinePlanCells.Element( baseOfflinePlanCellIndex.GetValueAsNumber() );
        }
        if( not isnull( compareOfflinePlanCellIndex )){
          compareOfflinePlanCell := compareOfflinePlanCells.Element( compareOfflinePlanCellIndex.GetValueAsNumber() );
        }
        localRow.LocalCell( relnew,LocalCell_OfflinePlanComparison,LocalColumn := localColumn,
                            BaseVersion := ifexpr( isnull( baseOfflinePlanCell),0.0,baseOfflinePlanCell.Quantity()),
                            CompareVersion := ifexpr( isnull( compareOfflinePlanCell),0.0,compareOfflinePlanCell.Quantity()));
      }
    }
    traverse( table,LocalColumn,column ){
      if( column.LocalCell( relsize ) = 0 ){
        column.Delete();
      }
    }
    return table;
  *]
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/StaticMethod_GetAttributeNames.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetAttributeNames () const declarative as owning Strings
{
  TextBody:
  [*
    // rislai Jun-21-2024 (created)
    attributeNames := construct( Strings );
    attributeNames.Add( "BaseVersion" );
    attributeNames.Add( "CompareVersion" );
    attributeNames.Add( "Gap" );
    return &attributeNames;
  *]
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/StaticMethod_GetColumnXML.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,97 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetColumnXML (
  const constcontent LocalRows rows,
  const LocalColumn column,
  const Strings attributeNames,
  String type,
  const MacroPlan macroPlan
) const as String
{
  TextBody:
  [*
    // rislai Jun-21-2024 (created)
    // rislai Jun-20-2024 (created)
    columnXML := "";
    cells := selectsortedset( column, LocalCell.astype( LocalCell_DemandComparison ), cell,
                                  exists( rows,Elements,element,element = cell.LocalRow()), cell.LocalRow().Index());
    if( type = "data" ){
      columnXML := "";
      if( column.IsAttrbuteColumn() ){
        columnXML := "<column><name>" + column.Name() + "</name><type>String</type>";
      }else{
        columnXML := "<column><name>" + column.Name() + "</name><type>Number</type>";
      }
      traverse ( cells, Elements, cell ) {
        traverse( attributeNames ,Elements,e ){
          cellXML := '<cell value="' + cell.GetAttributeByName( e ) + '"/>'
          columnXML := columnXML + cellXML;
        }
      }
      columnXML := columnXML + "</column>";
    }
    if( type = "attribute" ){
      columnXML0_1 := "<column><name>Sales Segment</name><type>String</type>";
      columnXML0_2 := "<column><name>Generation</name><type>String</type>";
      columnXML0_3 := "<column><name>MQB/MLB</name><type>String</type>";
      columnXML0_4 := "<column><name>功率</name><type>String</type>";
      columnXML1 := "<column><name>Product ID</name><type>String</type>";
      columnXML2 := "<column><name>Attribute</name><type>String</type>";
      traverse ( cells, Elements, cell ) {
        flag := true;
        traverse( attributeNames ,Elements,e ){
          if( flag ){
            cellXML := '<cell value="' + cell.LocalRow().Name() + '"/>'
            columnXML1 := columnXML1 + cellXML;
            salesSegment := select( cell.LocalRow().LocalTable(),LocalColumn.LocalCell.astype( LocalCell_DemandComparison ),temp_cell,temp_cell.LocalRow() = cell.LocalRow() and temp_cell.LocalColumn().Name() = "产地");
            if( not isnull( salesSegment )){
              cellXML0_1 := '<cell value="' + ifexpr( salesSegment.BaseVersionValue() <> "空",salesSegment.BaseVersionValue(),salesSegment.CompareVersionValue()) + '"/>';
              columnXML0_1 := columnXML0_1 + cellXML0_1;
            }else{
              cellXML0_1 := '<cell value="  "/>'
              columnXML0_1 := columnXML0_1 + cellXML0_1;
            }
            product := select( macroPlan,Product_MP,product,product.ID() = cell.LocalRow().Name() );
            if( not isnull( product )){
              cellXML0_2 := '<cell value="' + product.Generation() + '"/>';
              cellXML0_3 := '<cell value="' + product.MQBMLB() + '"/>';
              cellXML0_4 := '<cell value="' + product.Power() + '"/>';
              columnXML0_2 := columnXML0_2 + cellXML0_2;
              columnXML0_3 := columnXML0_3 + cellXML0_3;
              columnXML0_4 := columnXML0_4 + cellXML0_4;
            }else{
              cellXML0_2 := '<cell value="  "/>';
              cellXML0_3 := '<cell value="  "/>';
              cellXML0_4 := '<cell value="  "/>';
              columnXML0_2 := columnXML0_2 + cellXML0_2;
              columnXML0_3 := columnXML0_3 + cellXML0_3;
              columnXML0_4 := columnXML0_4 + cellXML0_4;
            }
            flag := false;
          }else{
            cellXML := '<cell value="  "/>'
            columnXML1 := columnXML1 + cellXML;
            cellXML0_1 := '<cell value="  "/>'
            cellXML0_2 := '<cell value="  "/>';
            cellXML0_3 := '<cell value="  "/>';
            cellXML0_4 := '<cell value="  "/>';
            columnXML0_1 := columnXML0_1 + cellXML0_1;
            columnXML0_2 := columnXML0_2 + cellXML0_2;
            columnXML0_3 := columnXML0_3 + cellXML0_3;
            columnXML0_4 := columnXML0_4 + cellXML0_4;
          }
          cellXML := '<cell value="' + e + '"/>'
          columnXML2 := columnXML2 + cellXML;
        }
      }
      columnXML := columnXML0_1 + "</column>" + columnXML0_2 + "</column>" + columnXML0_3 + "</column>" + columnXML0_4 + "</column>" + columnXML1 + "</column>" + columnXML2 + "</column>";
    }
    return columnXML;
  *]
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/_ROOT_Type_LocalCell_OfflinePlanComparison.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
Quintiq file version 2.0
#root
#parent: #DomainModel
TypeSpecialization LocalCell_OfflinePlanComparison
{
  #keys: '2[412672.1.76654683][412672.1.76654682]'
  Parent: LocalCell
  StructuredName: 'LocalCell_OfflinePlanComparisons'
}
_Main/BL/Type_LocalCell_ProductionComparison/Attribute_BaseVersionValue.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_LocalCell_ProductionComparison/Attribute_CompareVersionValue.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_LocalCell_ProductionComparison/Method_GetAttributeByName.qbl
@@ -9,12 +9,12 @@
    // rislai Jun-21-2024 (created)
    value := "";
    
    if( attributeName = "BaseVersion" ){
    if( attributeName = "Plan" ){
       if( not this.LocalColumn().IsAttrbuteColumn() ){
         value := this.Plan().Format( "N(Dec)" );
       }
    }
    if( attributeName = "CompareVersion" ){
    if( attributeName = "Actual" ){
      if( not this.LocalColumn().IsAttrbuteColumn() ){
        value := this.Actual().Format( "N(Dec)" );
      }
@@ -22,20 +22,6 @@
    if( attributeName = "Gap" ){
      if( not this.LocalColumn().IsAttrbuteColumn() ){
        value := this.Gap().Format( "N(Dec)" );
      }
    }
    if( attributeName = "BaseVersionValue" ){
      if( not this.LocalColumn().IsAttrbuteColumn() ){
        value := "0";
      }else{
        value := this.BaseVersionValue();
      }
    }
    if( attributeName = "CompareVersionValue" ){
      if( not this.LocalColumn().IsAttrbuteColumn() ){
        value := "0";
      }else{
        value := this.CompareVersionValue();
      }
    }
    
_Main/BL/Type_LocalCell_ProductionComparison/StaticMethod_Compared.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_LocalCell_ProductionComparison/StaticMethod_FillCells.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_LocalCell_ProductionComparison/StaticMethod_FillRows.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_LocalCell_ProductionComparison/StaticMethod_GenerateColumnIndex.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_LocalCell_ProductionComparison/StaticMethod_GetAttributeNames.qbl
@@ -7,8 +7,8 @@
    // rislai Jun-21-2024 (created)
    attributeNames := construct( Strings );
    
    attributeNames.Add( "BaseVersion" );
    attributeNames.Add( "CompareVersion" );
    attributeNames.Add( "Actual" );
    attributeNames.Add( "Plan" );
    attributeNames.Add( "Gap" );
    
    return &attributeNames;
_Main/BL/Type_LocalRow/Attribute_Remark.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute Remark
{
  #keys: '3[412672.1.76649345][412672.1.76649344][412672.1.76649346]'
  ValueType: String
}
_Main/BL/Type_TemplateManager/StaticMethod_GetCurveTemplate.qbl
@@ -23,84 +23,84 @@
    }
    xmlTemplate := xmlTemplate + "</column>";
    
    xmlTemplate := xmlTemplate + "<column><name>AUDI B9 PA</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>AUDI B9 PA</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>AUDI C8</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>AUDI C8</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>Q5 Derivat</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>Q5 Derivat</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>Q5 NF PA</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>Q5 NF PA</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>Magotan B8L FL</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>Magotan B8L FL</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>Magotan B9</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>Magotan B9</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>CC FB PA</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>CC FB PA</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>CC ShBr</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>CC ShBr</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>B-SMV</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>B-SMV</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>B-Main SUV</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>B-Main SUV</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>Tayron PA</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>Tayron PA</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>Tayron NF</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>Tayron NF</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>Tayron X PA</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>Tayron X PA</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>Tayron GTE</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>Tayron GTE</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>Q3 NF</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>Q3 NF</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    xmlTemplate := xmlTemplate + "<column><name>Q3 Derivat</name><type>Number</type>";
    xmlTemplate := xmlTemplate + "<column><name>Q3 Derivat</name><type>String</type>";
    for( i := 0; i < totalDate ; i++ ){
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      xmlTemplate := xmlTemplate + '<cell value=""/>';
    }
    xmlTemplate := xmlTemplate + "</column>";
    
_Main/BL/Type_TemplateManager/StaticMethod_GetIDSTemplate.qbl
@@ -14,22 +14,22 @@
    xmlTemplate := '<?xml version="1.0" encoding="UTF-16"?><table><name>'+ sheetName +'</name>';
    
    xmlTemplate := xmlTemplate + "<column><name>产地</name><type>String</type>";
    xmlTemplate := xmlTemplate + '<cell value="长春"/>';
    // xmlTemplate := xmlTemplate + '<cell value=""/>';
    xmlTemplate := xmlTemplate + "</column>";
    
    xmlTemplate := xmlTemplate + "<column><name>车型</name><type>String</type>";
    xmlTemplate := xmlTemplate + '<cell value="30C"/>';
    // xmlTemplate := xmlTemplate + '<cell value=""/>';
    xmlTemplate := xmlTemplate + "</column>";
    
    xmlTemplate := xmlTemplate + "<column><name>发动机号</name><type>String</type>";
    xmlTemplate := xmlTemplate + '<cell value="06S 100 010 N"/>';
    // xmlTemplate := xmlTemplate + '<cell value=""/>';
    xmlTemplate := xmlTemplate + "</column>";
    
    actualDate := Date::ActualDate();
    
    for( i := 0 ; i < dateNumber ; i++ ){
      xmlTemplate := xmlTemplate + "<column><name>" + (actualDate + i).Format( "Y/M/D" ) + "</name><type>Number</type>";
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      // xmlTemplate := xmlTemplate + '<cell value=""/>';
      xmlTemplate := xmlTemplate + "</column>";
    }
    
_Main/BL/Type_TemplateManager/StaticMethod_GetPPATemplate.qbl
@@ -11,14 +11,14 @@
    
    xmlTemplate := xmlTemplate + "<column><name>六位码</name><type>String</type>";
    
    xmlTemplate := xmlTemplate + '<cell value="86LC2G"/>';
    // xmlTemplate := xmlTemplate + '<cell value=" "/>';
    xmlTemplate := xmlTemplate + "</column>";
    
    actualDate := Date::ActualDate();
    
    for( i := 1 ; i <= 12 ; i++ ){
      xmlTemplate := xmlTemplate + "<column><name>" + Date::Construct( actualDate.Year(),i,1 ).Format( "Y/M/D" ) + "</name><type>Number</type>";
      xmlTemplate := xmlTemplate + '<cell value="0"/>';
      // xmlTemplate := xmlTemplate + '<cell value=" "/>';
      xmlTemplate := xmlTemplate + "</column>";
    }