lazhen
2024-08-21 a5d4d31310d9792243db3ca06080a5f8b83b542c
Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg
已修改10个文件
已添加5个文件
187 ■■■■ 文件已修改
_Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CC_EngineRackCell/Attribute_PackagingCapacity.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CC_EngineRackCell/Attribute_PlannedInventory.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CC_EngineRackCell/Function_CalcNumberOfEmptyShelves.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_Compared.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_Create.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_CreateFullTable.qbl 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MP_Cell_AnnualPlanReport/StaticMethod_CreateFullTable.qbl 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MP_Cell_AnnualPlanReport/_ROOT_Type_MP_Cell_AnnualPlanReport.qbl 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MP_Table/StaticMethod_GetMP_Tables_AnnualPlanReport.qbl 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MP_Table/StaticMethod_GetMP_Tables_ScheduleSummary.qbl 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCC_EngineRackReport/Response_pHeader_bRefresh_OnClick.def 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormScheduleSummaryReport/Response_PanelRibbon504_ButtonRibbon820_OnClick.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Views/CCEngineRackReport.vw 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl
@@ -11,7 +11,7 @@
      f.Delete();
    }
    
    traverse ( archiveExecutionStatus, TemporaryDemandData, tdd ) {
    traverse ( archiveExecutionStatus, TemporaryDemandData, tdd ,tdd.StartDate() >= macroPlan.StartOfPlanning().Date()) {
      targetProduct_MP       := select( macroPlan, Product_MP, tempPMP, tempPMP.ID() = tdd.ProductID() );
      targetStockingPoint_MP := select( macroPlan, StockingPoint_MP, tempSPMP, tempSPMP.ID() = tdd.StockingPointID() );
      info( tdd.SalesSegmentName() );
@@ -29,8 +29,7 @@
                          tdd.UnitOfMeasureName(),
                          0.0,
                          false,
                          false
                         );
                          false );
        forcest.Origin( tdd.Origin() );
      }
    }
_Main/BL/Type_CC_EngineRackCell/Attribute_PackagingCapacity.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute PackagingCapacity
{
  #keys: '3[415754.0.111003142][415754.0.111003141][415754.0.111003143]'
  Description: '包装容量'
  ValueType: Number
}
_Main/BL/Type_CC_EngineRackCell/Attribute_PlannedInventory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute PlannedInventory
{
  #keys: '3[415754.0.111003178][415754.0.111003177][415754.0.111003179]'
  ValueType: Real
}
_Main/BL/Type_CC_EngineRackCell/Function_CalcNumberOfEmptyShelves.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
Quintiq file version 2.0
#parent: #root
Function CalcNumberOfEmptyShelves
{
  TextBody:
  [*
    // vwedadmin Aug-20-2024 (created)
    value := guard( [Number] ( this.TotalQuantityOfMaterialRacks() - ( this.PlannedInventory() / this.PackagingCapacity() ) ), 0 );
    this.NumberOfEmptyShelves( value );
  *]
}
_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl
@@ -9,11 +9,14 @@
    macroPlan.CC_EngineRackRow( relflush );
    macroPlan.CC_EngineRackColumn( relflush );
    
    // åˆ›å»ºè¡ŒEVO5 MLB, EVO5 MQB, GEN3 MLB, GEN3 MQB
    macroPlan.CC_EngineRackRow( relnew, Generation := "EVO5", MLB_MQB := "MLB" );
    macroPlan.CC_EngineRackRow( relnew, Generation := "EVO5", MLB_MQB := "MQB" );
    macroPlan.CC_EngineRackRow( relnew, Generation := "GEN3", MLB_MQB := "MLB" );
    macroPlan.CC_EngineRackRow( relnew, Generation := "GEN3", MLB_MQB := "MQB" );
    // åˆ›å»ºè¡Œ
    genrations := selectuniquevalues( macroPlan, Product_MP, tempPMP, tempPMP.Generation().TrimBoth() <> "", tempPMP.Generation() );
    mqbmlbs    := selectuniquevalues( macroPlan, Product_MP, tempPMP, tempPMP.MQBMLB().TrimBoth() <> "", tempPMP.MQBMLB() );
    traverse ( genrations, Elements, g, g.ToUpper() = "EVO5" or g.ToUpper() = "GEN3" ) {
      traverse ( mqbmlbs, Elements, m, m.ToUpper() = "MLB" or m.ToUpper() = "MQB" ) {
        macroPlan.CC_EngineRackRow( relnew, Generation := g, MLB_MQB := m );
      }
    }
    
    // åˆ›å»ºåˆ—
    indexDate := macroPlan.StartOfPlanning().Date().StartOfMonth();
@@ -24,12 +27,54 @@
    
    // åˆ›å»ºå•元格
    traverse ( macroPlan, CC_EngineRackRow, ccerr ) {
      // å‘动机成本参数
      lce  := select( macroPlan, LogisticsCostEngine, tempLCE, tempLCE.Generation() = ccerr.Generation() and tempLCE.MLB_MQB() = ccerr.MLB_MQB() and tempLCE.Factory() = "长春工厂" );
      // æ–™æž¶æˆæœ¬å‚æ•°
      lcmr := select( macroPlan, LogisticsCostMaterialRack, tempLCMR, tempLCMR.Factory() = "长春工厂" );
      traverse ( macroPlan, CC_EngineRackColumn, ccerc ) {
        cell := ccerr.CC_EngineRackCell( relnew );
        
        // ç©ºæ–™æž¶æ•°é‡ï¼ˆé•¿æ˜¥åŽ‚è¯¥äº§å“çš„æ–™æž¶æ€»æ•°é‡ - å‘动机库存 / åŒ…装容量 ï¼‰
        lastDayOfThisMonth := ccerc.StartDate().StartOfNextMonth() - 1;
        plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().IsLeaf()                          and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().ParentID()   = "产成品"           and
                                 tempPISPIP.ProductInStockingPoint_MP().StockingPointID()         = "长春外租库"       and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().Generation() = ccerr.Generation() and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().MQBMLB()     = ccerr.MLB_MQB()    and
                                 tempPISPIP.Start().Date()                                                  = lastDayOfThisMonth,
                                 tempPISPIP.PlannedInventoryLevelEnd() );
        cell.PackagingCapacity( guard( lce.PackagingCapacity(), 0 ) );
        cell.PlannedInventory( plannedInventory );
        // å¤–租库入库费用(发动机销量 / åŒ…装容量[向上取整] * æ–™æž¶å…¥åº“单价)
        engineSales := sum( macroPlan, FSImportData, tempFSID,
                            tempFSID.Unit()              = "长春工厂"               and
                            tempFSID.Generation()        = ccerr.Generation()       and
                            tempFSID.MqbMlb()            = ccerr.MLB_MQB()          and
                            tempFSID.StartDate().Year()  = ccerc.StartDate().Year() and
                            tempFSID.StartDate().Month() = ccerc.StartDate().Month(),
                            tempFSID.Quantity() );
        cell.StorageFeesForRentedWarehouses( guard( [Number] ( engineSales / guard( lce.PackagingCapacity(), 0 ) ) * guard( lcmr.WarehousingPrice(), 0 ), 0 ) );
        
        // å¤–租库出库费用(发动机产量 / åŒ…装容量[向上取整] * æ–™æž¶å‡ºåº“单价)
        engineProductions := sum( macroPlan, FPImportData, tempFPID,
                                  tempFPID.Unit()              = "长春工厂"               and
                                  tempFPID.Generation()        = ccerr.Generation()       and
                                  tempFPID.MqbMlb()            = ccerr.MLB_MQB()          and
                                  tempFPID.StartDate().Year()  = ccerc.StartDate().Year() and
                                  tempFPID.StartDate().Month() = ccerc.StartDate().Month(),
                                  tempFPID.Quantity() );
        cell.OutboundExpensesForRentedWarehouses( guard( [Number] ( engineProductions / guard( lce.PackagingCapacity(), 0 ) ) * guard( lcmr.OutboundPrice(), 0 ), 0 ) );
        // å¤–租库运输费用:发动机运输量/包装容量/装载容量(向上取整)*料架运输单价
        // å¤–租库仓储费用:料架总数量-发动机库存/包装容量(向上取整),再乘以空料架仓储单价得到空料架仓储费用。发动机库存取Actual inventories里取到长春外租库该发动机的仓储量,料架总数量需要手动维护。
        // æ¸…洗费用:发动机入库量/包装容量*料架清洗单价。发动机入库量取发动机销量,包装容量取自发动机成本表。料架清洗单价取料架成本表。
        cell.CC_EngineRackColumn( relset, ccerc );
      }
    }
  *]
_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_Compared.qbl
@@ -88,8 +88,8 @@
              if( columnName = "发动机零件号" ){
                row.ProductID( ifexpr( isnull( baseVersionCell ), ifexpr( isnull( compareVersionCell ),"空",compareVersionCell.Value()), baseVersionCell.Value()) );
              }
              if( columnName = "产地" ){
                row.CustomName( row.ProductID() + " > " + ifexpr( isnull( baseVersionCell ), ifexpr( isnull( compareVersionCell ),"空",compareVersionCell.Value()), baseVersionCell.Value()) );
              if( columnName = "车型" ){
                row.CustomName( " > " + ifexpr( isnull( baseVersionCell ), ifexpr( isnull( compareVersionCell ),"空",compareVersionCell.Value()), baseVersionCell.Value()) );
              }
            }else{
              row.LocalCell( relnew,LocalCell_DemandComparison,LocalColumn := column,
@@ -97,6 +97,7 @@
                             CompareVersion := ifexpr( isnull( compareVersionCell ), 0 ,[Real]compareVersionCell.Value() ));
            }
          }
          row.CustomName( row.ProductID() + row.CustomName() );
        }
      }
      // åŽç»­åˆ é™¤
_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_Create.qbl
@@ -26,7 +26,7 @@
      columnIndexTree.Root().AddChild( columnHandle,columns.Size() - 1 );
    }
    
    traverse( owner,Unit,unit,unit.HasCapacityTypeTime()){
    traverse( owner,Unit,unit,unit.HasCapacityTypeTime() and not unit.HasChild()){
      // unit.AsEntity().DisplayNameForSelection()
      row := table.MP_Row( relnew,CustomName := unit.ID(),Index := table.GetRowIndexCache() ); 
      throughput := sum( unit,Operation,operation,operation.Throughput() ) / unit.Operation( relsize );
_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_CreateFullTable.qbl
@@ -3,20 +3,14 @@
StaticMethod CreateFullTable (
  const MacroPlans owners,
  RecycleBin recycleBin,
  const Archive archive
  const Archive archive,
  const MacroPlan owner
) as LocalTable
{
  TextBody:
  [*
    // rislai Aug-7-2024 (created)
    tables := construct( MP_Tables );
    traverse( owners,Elements,owner ){
      table := select( owner,MP_Table,table,table.Name() = MP_Cell_ScheduleSummary::GetTableName() );
      if( isnull( table )){
        table :=  MP_Cell_ScheduleSummary::Create( owner );
      }
      tables.Add( table );
    }
    tables := MP_Table::GetMP_Tables_ScheduleSummary( owners );
    
    scheduleSummaryOutputDataIndexTree := NamedValueTree::Create();
    scheduleSummaryOutputDatas := selectset( archive,ScheduleSummaryOutputLine.ScheduleSummaryOutputData,data,
@@ -88,6 +82,18 @@
       }
    }
    
    //startDate := owner.StartOfPlanning().Date() + 7;
    //endDate := maxselect( owner,Unit.UnitPeriod.astype( UnitPeriodTime ).Period_MP,period,period.EndDate(),period.TimeUnit() = "Month" ).EndDate();
    //columns := construct( MP_Columns );
    //columnIndexTree := NamedValueTree::Create();
    //for( i := startDate;i < endDate; i := i + 1){
    //  column := table.MP_Column( relnew,CustomDate := i );
    //  columnHandle := columnIndexTree.GetHandle( i.AsQUILL() );
    //  columns.Add( column );
    //  columnIndexTree.Root().AddChild( columnHandle,columns.Size() - 1 );
    //}
    return localTable;
  *]
}
_Main/BL/Type_MP_Cell_AnnualPlanReport/StaticMethod_CreateFullTable.qbl
@@ -8,14 +8,7 @@
  TextBody:
  [*
    // rislai Aug-7-2024 (created)
    tables := construct( MP_Tables );
    traverse( owners,Elements,owner ){
      table := select( owner,MP_Table,table,table.Name() = MP_Cell_AnnualPlanReport::GetTableName() );
      if( isnull( table )){
        table :=  MP_Cell_AnnualPlanReport::Create( owner );
      }
      tables.Add( table );
    }
    tables := MP_Table::GetMP_Tables_AnnualPlanReport( owners );
    
    localTable := recycleBin.LocalTable( relnew,Name := MP_Cell_AnnualPlanReport::GetTableName() );
    startDate := minselect( tables,Elements.MP_Column,column,column.CustomDate() ).CustomDate();
_Main/BL/Type_MP_Cell_AnnualPlanReport/_ROOT_Type_MP_Cell_AnnualPlanReport.qbl
@@ -4,6 +4,7 @@
TypeSpecialization MP_Cell_AnnualPlanReport
{
  #keys: '2[412672.1.107700065][412672.1.107700060]'
  Description: '全年计划报表'
  Parent: MP_Cell
  StructuredName: 'MP_Cell_AnnualPlanReports'
}
_Main/BL/Type_MP_Table/StaticMethod_GetMP_Tables_AnnualPlanReport.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetMP_Tables_AnnualPlanReport (
  const MacroPlans owners
) as owning MP_Tables
{
  TextBody:
  [*
    // Akari Aug-19-2024 (created)
    tables := construct( MP_Tables );
    traverse( owners,Elements,owner ){
      table := select( owner,MP_Table,table,table.Name() = MP_Cell_AnnualPlanReport::GetTableName() );
      if( isnull( table )){
        table :=  MP_Cell_AnnualPlanReport::Create( owner );
      }else{
        startDate := minselect( table,MP_Column,column,column.CustomDate() ).CustomDate();
        planStartDate := owner.StartOfPlanning().Date();
        if( startDate <> planStartDate ){
          table :=  MP_Cell_AnnualPlanReport::Create( owner );
        }
      }
      tables.Add( table );
    }
    return &tables;
  *]
}
_Main/BL/Type_MP_Table/StaticMethod_GetMP_Tables_ScheduleSummary.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetMP_Tables_ScheduleSummary (
  const MacroPlans owners
) as owning MP_Tables
{
  TextBody:
  [*
    // Akari Aug-19-2024 (created)
    tables := construct( MP_Tables );
    traverse( owners,Elements,owner ){
      table := select( owner,MP_Table,table,table.Name() = MP_Cell_ScheduleSummary::GetTableName() );
      if( isnull( table )){
        table :=  MP_Cell_ScheduleSummary::Create( owner );
      }else{
        startDate := minselect( table,MP_Column,column,column.CustomDate() ).CustomDate();
        planStartDate := owner.StartOfPlanning().Date();
        if( startDate <> planStartDate ){
          table :=  MP_Cell_ScheduleSummary::Create( owner );
        }
      }
      tables.Add( table );
    }
    return &tables;
  *]
}
_Main/UI/MacroPlannerWebApp/Component_FormCC_EngineRackReport/Response_pHeader_bRefresh_OnClick.def
@@ -14,6 +14,8 @@
    Body:
    [*
      CC_EngineRackCell::CreateData( MacroPlan );
      WebMessageBox::Success( Translations::A_VWED_Success() );
    *]
    GroupServerCalls: false
  }
_Main/UI/MacroPlannerWebApp/Component_FormScheduleSummaryReport/Response_PanelRibbon504_ButtonRibbon820_OnClick.def
@@ -10,7 +10,7 @@
    Body:
    [*
      macroPlans := ApplicationMacroPlanner.GetMacroPlans();
      table := MP_Cell_ScheduleSummary::CreateFullTable( macroPlans,RecycleBin ,Archive);
      table := MP_Cell_ScheduleSummary::CreateFullTable( macroPlans,RecycleBin ,Archive, MacroPlan );
      
      dhComparisonData854.Data( table );
    *]
_Main/UI/MacroPlannerWebApp/Views/CCEngineRackReport.vw
@@ -30,7 +30,7 @@
          FormCC_EngineRackReport_MatrixEditor531
          {
            gridColor: '#c4c4c4'
            totalHeaderWidth: 200
            totalHeaderWidth: 500
            attributeHeaderWidthRatio: 0.6
            nameHeaderWidthRatio: 0.4
            columnWidth: 100