lazhen
2024-08-16 107f0e4b79a6189e5f61ca0a4d77dd8d047a8f2b
机加件管线报表装配数据
已修改3个文件
已添加2个文件
已删除1个文件
108 ■■■■ 文件已修改
_Main/BL/Type_MachiningPipelineCell/StaticMethod_Initialize.qbl 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineColumn0/Attribute_CCAssemblyPlanQty.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineColumn0/Attribute_DLAssemblyPlanQty.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineRow/Method_SetCellAssemblyValue.qbl 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineCell/StaticMethod_Initialize.qbl
@@ -8,13 +8,13 @@
  [*
    // ç”„兰鸽 Jul-12-2024 (created)
    cell := column.Cell( relnew, CCAssemblyPlanQty := 0, 
                         CCProductionQty := 0,
                         CCTransferQty := 0,
                         CCInventoryQty := 0,
                         DLAssemblyPlanQty := 0,
                         DLProductionQty := 0,
                         DLTransferQty := 0,
                         DLInventoryQty := 0 );
                         CCProductionQty           := 0,
                         CCTransferQty             := 0,
                         CCInventoryQty            := 0,
                         DLAssemblyPlanQty         := 0,
                         DLProductionQty           := 0,
                         DLTransferQty             := 0,
                         DLInventoryQty            := 0 );
    
    return cell;
  *]
_Main/BL/Type_MachiningPipelineColumn0/Attribute_CCAssemblyPlanQty.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute CCAssemblyPlanQty
{
  #keys: '3[415136.0.1006432687][415136.0.1006432686][415136.0.1006432688]'
  Description: '长春装配计划'
  ValueType: Real
}
_Main/BL/Type_MachiningPipelineColumn0/Attribute_DLAssemblyPlanQty.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute DLAssemblyPlanQty
{
  #keys: '3[415136.0.1006432691][415136.0.1006432690][415136.0.1006432692]'
  Description: '大连装配计划'
  ValueType: Real
}
_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl
@@ -17,13 +17,13 @@
        periodtime          := period.StartDate();
        periodname          := periodtime.Format( "M2/D2/Y" );
        
        this.Column( relnew, Name := periodname, StartDate := periodtime, EndDate := periodtime, TimeUnit := Translations::MP_GlobalParameters_Day() );
        this.Column( relnew, Name := periodname, StartDate := periodtime, EndDate := periodtime, CCAssemblyPlanQty := 0, DLAssemblyPlanQty := 0, TimeUnit := Translations::MP_GlobalParameters_Day() );
      }
      
      if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Week() ){
        if( period.StartDate() = weekstart ){
          weekperiodname    := weekstart.Format( "M2/D2/Y" );
          this.Column( relnew, Name := weekperiodname, StartDate := weekstart, EndDate := ( weekstart + Duration::Days( 6 ) ).Date(), TimeUnit := Translations::MP_GlobalParameters_Week() );
          this.Column( relnew, Name := weekperiodname, StartDate := weekstart, EndDate := ( weekstart + Duration::Days( 6 ) ).Date(), CCAssemblyPlanQty := 0, DLAssemblyPlanQty := 0, TimeUnit := Translations::MP_GlobalParameters_Week() );
          weekstart         := ( weekstart + Duration::Days( 7 ) ).Date();
        }
      }
_Main/BL/Type_MachiningPipelineRow/Method_SetCellAssemblyValue.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
@@ -41,31 +41,35 @@
      isdlproduction          := unit.ID() = MachiningPipelineReport::GetDefaultDLProductionUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultDLProductionUnit() );
      if( iscc or isdl ){
        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() and not pisp.IsSystem() 
                  and exists( pisp.Product_MP().GetAllParent(), Elements, e, e.ID() = productparent )
    //              and exists( pisp.Product_MP().GetAllParent(), Elements, e, e.ID() = productparent )
                  and exists( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() and ( pispip.NewSupplyQuantity() <> 0 or pispip.PlannedInventoryLevelEnd() <> 0 ) ) ){
          product             := pisp.Product_MP();
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = productparent ) ){//查询产品类型是发动机
            row               := table.GetRow( pisp.ProductID() );
            products.Add( pisp.Product_MP() );
    //        weekstart         := owner.StartOfPlanning().Date();
            pispips           := selectsortedset( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical()
                                                    and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() and ( pispip.NewSupplyQuantity() <> 0 or pispip.PlannedInventoryLevelEnd() <> 0 ), pispip.Start() );
          pispips             := selectsortedset( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical()
                                                  and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() and ( pispip.NewSupplyQuantity() <> 0 or pispip.PlannedInventoryLevelEnd() <> 0 ), pispip.Start() );
          traverse( pispips, Elements, pispip ){
            supplyquantity    := [Number]pispip.NewSupplyQuantity();//四舍五入
            //天
            daycolumn         := table.GetColumnByUnit( Translations::MP_GlobalParameters_Day(), pispip.Start().Date() );
            //周
            weekcolumn        := table.GetColumnByUnit( Translations::MP_GlobalParameters_Week(), pispip.Start().Date() );
            
            traverse( pispips, Elements, pispip ){
              //天
              daycolumn        := table.GetColumnByUnit( Translations::MP_GlobalParameters_Day(), pispip.Start().Date() );
              //周
              weekcolumn       := table.GetColumnByUnit( Translations::MP_GlobalParameters_Week(), pispip.Start().Date() );
              supplyquantity   := [Number]pispip.NewSupplyQuantity();//四舍五入
            //装配线
            if( isccassemnly or isdlassemnly ){
              if( isccassemnly ){
                daycolumn.CCAssemblyPlanQty( daycolumn.CCAssemblyPlanQty() + supplyquantity );
                weekcolumn.CCAssemblyPlanQty( weekcolumn.CCAssemblyPlanQty() + supplyquantity );
              } else {
                daycolumn.DLAssemblyPlanQty( daycolumn.DLAssemblyPlanQty() + supplyquantity );
                weekcolumn.DLAssemblyPlanQty( weekcolumn.DLAssemblyPlanQty() + supplyquantity );
              }
            }
            product           := pisp.Product_MP();
            productparents    := product.GetAllParent();
            if( exists( productparents, Elements, e, e.ID() = productparent ) ){//查询产品类型是发动机
              row             := table.GetRow( pisp.ProductID() );
              products.Add( pisp.Product_MP() );
              inventoryquantity:= [Number]pispip.PlannedInventoryLevelEnd();//四舍五入
              //装配线
              if( isccassemnly or isdlassemnly ){
                row.SetCellAssemblyValue( daycolumn, isccassemnly, [Real]supplyquantity );
                row.SetCellAssemblyValue( weekcolumn, isccassemnly, [Real]supplyquantity );
              }
              
              //机加线
              if( isccproduction or isdlproduction ){
@@ -103,7 +107,7 @@
        destiiscc             := destisp.ID() = ccunit or destiunit.ID() = ccunit or exists( destiparentunits, Elements, punit, punit.ID() = ccunit );
        destiisdl             := destisp.ID() = dlunit or destiunit.ID() = dlunit or exists( destiparentunits, Elements, punit, punit.ID() = dlunit );
        if( ( originiscc and destiisdl ) or ( originisdl and destiiscc ) ){
          row := selectobject( table, Row, row, row.Name() = tprow.Name() );
          row := table.GetRow( tprow.ProductID() );
          traverse( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() <> Date::MinDate() ){
            //天
            daycolumn        := table.GetColumnByUnit( Translations::MP_GlobalParameters_Day(), tpcell.TransferPlanColumn().ColumnDate() );
@@ -122,6 +126,10 @@
    i    := 0;
    traverse( rows, Elements, e ){
      e.RowNr( i );
      traverse( e, Cell, cell ){
        cell.CCAssemblyPlanQty( cell.Column().CCAssemblyPlanQty() );
        cell.DLAssemblyPlanQty( cell.Column().DLAssemblyPlanQty() );
      }
      i := i + 1;
    }
    showtable.Generate( search, products );