lazhen
2024-10-09 f9c8e9e3438d19dc7a3ee087b631dbe593663112
机加管线报表的数据bug
已修改8个文件
已删除1个文件
128 ■■■■ 文件已修改
_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineSource/StaticMethod_Initialize.qbl 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfaceInventoryReport/StaticMethod_GenerateData.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummaryColumn/Attribute_Period.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormMachiningPipelineReport/Component_PanelExport.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl
@@ -10,21 +10,29 @@
  TextBody:
  [*
    // ç”„兰鸽 Jun-25-2024 (created)
    startofplanning           := owner.StartOfPlanning();
    startofyear               := startofplanning.StartOfYear().Date();
    startofendyear            := startofplanning.StartOfNextYear().Date();
    //查询日期返回需要在计划日期之内
    weekstart             := owner.StartOfPlanning().Date();
    traverse( owner, Period_MP, period, not period.IsHistorical() and period.TimeUnit() = Translations::MP_GlobalParameters_Day() ){
      if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Day() ){
        periodtime          := period.StartDate();
        periodname          := periodtime.Format( "M2/D2/Y" );
        this.Column( relnew, Name := periodname, StartDate := periodtime, EndDate := periodtime, TimeUnit := Translations::MP_GlobalParameters_Day() );
    if( startdate < startofendyear and enddate > startofyear ){
      if( startdate < startofyear ){
        startdate             := startofyear;
      }
      if( enddate > startofendyear ){
        enddate               := startofendyear;
      }
      if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Day() ){
        for( start := startdate; start <= enddate; start := start.DateTime().StartOfNextDay().Date() ){
          periodname          := start.Format( "M2/D2/Y" );
          this.Column( relnew, Name := periodname, StartDate := start, EndDate := start, 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() );
          weekstart         := ( weekstart + Duration::Days( 7 ) ).Date();
        for( start := startdate; start <= enddate; start := start.StartOfNextWeek() ){
          periodname          := start.Format( "M2/D2/Y" );
          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
          this.Column( relnew, Name := periodname, StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
        }
      }
    }
_Main/BL/Type_EnginePipelineSource/StaticMethod_Initialize.qbl
@@ -30,7 +30,6 @@
      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, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() and ( pispip.NewSupplyQuantity() <> 0 or pispip.PlannedInventoryLevelEnd() <> 0 ) ) ){
        weekstart           := owner.StartOfPlanning().Date();
        pispips             := selectsortedset( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() 
                                                    and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day(), pispip.Start() );
        row := table.GetRow( pisp.ProductID() );
@@ -50,8 +49,7 @@
          //库存需要取最后一天
          row.SetCellInventoryValue( daycolumn, [Real]inventoryquantity );
      
          if( pispip.Start() = weekstart + Duration::Days( 6 ) or pispip.Period_MP() = endperiod ){
            weekstart       := ( weekstart + Duration::Days( 7 ) ).Date();
          if( pispip.Start().Date() = weekcolumn.EndDate() or pispip.Period_MP() = endperiod ){
              
            row.SetCellInventoryValue( weekcolumn, [Real]inventoryquantity );
          } 
_Main/BL/Type_InterfaceInventoryReport/StaticMethod_GenerateData.qbl
@@ -39,7 +39,7 @@
                                                              , MLBMQB                  := product.MQBMLB()
                                                              , Power                   := product.Power()
                                                              , Product                 := product.ID()
                                                              , InventoryDate           := column.Period()
                                                              , InventoryDate           := column.StartDate()
                                                              , InventoryEndQty         := cell.EndingInventory()
                                                              , InventoryMinQty         := cell.MinimumInventory()
                                                              , InventoryMaxQty         := cell.MaximumInventory()
_Main/BL/Type_InventorySummaryColumn/Attribute_Period.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl
@@ -29,19 +29,15 @@
        }
      }else if( timeunit = Translations::MP_GlobalParameters_Week() ){
        for( start := starttime; start <= endtime; start := start.StartOfNextWeek() ){
          periodtime          := start.Date();
          periodname          := periodtime.Format( "M2/D2/Y" );
          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
          
          this.InventorySummaryColumn( relnew, Name := periodname, StartDate := periodtime, EndaDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
          this.InventorySummaryColumn( relnew, Name := weekend.Format( "M2/D2/Y" ), StartDate := start.Date(), EndaDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
        }
      }else if( timeunit = Translations::MP_GlobalParameters_Month() ){
        for( start := starttime; start <= endtime; start := start.StartOfNextMonth() ){
          periodtime          := start.Date();
          periodname          := periodtime.Format( "M2/D2/Y" );
          monthend            := ( start.StartOfNextMonth() - Duration::Days( 1 ) ).Date();
          
          this.InventorySummaryColumn( relnew, Name := periodname, StartDate := periodtime, EndaDate := monthend, TimeUnit := Translations::MP_GlobalParameters_Month() );
          this.InventorySummaryColumn( relnew, Name := monthend.Format( "M2/D2/Y" ), StartDate := start.Date(), EndaDate := monthend, TimeUnit := Translations::MP_GlobalParameters_Month() );
        }
      }
    }
_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
@@ -50,7 +50,7 @@
            periodname        := periodtime.Format( "M2/D2/Y" );
            
            //天,选择日颗粒度时,期末库存,最小库存,最大库存和平均库存的数值保持一致
            daycolumn         := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.Period() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Day() );
            daycolumn         := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.StartDate() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Day() );
            quantity          := ifexpr( pispip.Period_MP().IsHistorical(), [Number]pispip.ActualInventoryLevelEnd(), [Number]pispip.PlannedInventoryLevelEnd() );
            factoryrow.SetCellValue( daycolumn, quantity );
            allrow.SetCellValue( daycolumn, quantity );
@@ -77,9 +77,9 @@
    selections                := selectset( interface, InventoryPointSelection, selection, allsps.Find( selection.StockpoingPoint() ) >= 0 and selection.IsIncluded() );
    productids                := selectuniquevalues( selections, Elements, selection, selection.ProductID() );
    //最后将这些库位中零件号的数量进行加总
    traverse( table, InventorySummaryColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.Period() < startofplanning.Date() ){
    traverse( table, InventorySummaryColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.StartDate() < startofplanning.Date() ){
      traverse( productids, Elements, productid ){
        column.GenerateCell( selections, ccsps, dlsps, table, column.Period(), column.Period(), productid, allunit, ccunit, dlunit );
        column.GenerateCell( selections, ccsps, dlsps, table, column.StartDate(), column.EndaDate(), productid, allunit, ccunit, dlunit );
      }
    }
      
_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl
@@ -11,20 +11,29 @@
  [*
    // ç”„兰鸽 Jun-25-2024 (created)
    //查询日期返回需要在计划日期之内
    weekstart             := owner.StartOfPlanning().Date();
    traverse( owner, Period_MP, period, not period.IsHistorical() and period.TimeUnit() = Translations::MP_GlobalParameters_Day() ){
      if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Day() ){
        periodtime          := period.StartDate();
        periodname          := periodtime.Format( "M2/D2/Y" );
        this.Column( relnew, Name := periodname, StartDate := periodtime, EndDate := periodtime, TimeUnit := Translations::MP_GlobalParameters_Day() );
    startofplanning           := owner.StartOfPlanning();
    startofyear               := startofplanning.StartOfYear().Date();
    startofendyear            := startofplanning.StartOfNextYear().Date();
    //查询日期返回需要在计划日期之内
    if( startdate < startofendyear and enddate > startofyear ){
      if( startdate < startofyear ){
        startdate             := startofyear;
      }
      if( enddate > startofendyear ){
        enddate               := startofendyear;
      }
      if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Day() ){
        for( start := startdate; start <= enddate; start := start.DateTime().StartOfNextDay().Date() ){
          periodname          := start.Format( "M2/D2/Y" );
          this.Column( relnew, Name := periodname, StartDate := start, EndDate := start, 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() );
          weekstart         := ( weekstart + Duration::Days( 7 ) ).Date();
        for( start := startdate; start <= enddate; start := start.StartOfNextWeek() ){
          periodname          := start.Format( "M2/D2/Y" );
          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
          this.Column( relnew, Name := periodname, StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
        }
      }
    }
_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
@@ -9,9 +9,6 @@
    // ç”„兰鸽 Jun-24-2024 (created)
    owner.FinancialProductionSource( relflush );
    productparent             := MachiningPipelineReport::GetDefaultProductParent();
    //ccunit                    := MachiningPipelineReport::GetDefaultCCUnit();
    //dlunit                    := MachiningPipelineReport::GetDefaultDLUnit();
    //allunit                   := EnginePipelineReport::GetDefaultAllUnit();
    source                    := owner.MachiningPipelineSource( relnew, Name := MachiningPipelineReport::GetDefaultName() );
    table                     := source.Report( relnew, ID := source.Name(), Name := source.Name() );
    showtable                 := source.Report( relnew, ID := source.Name() + 'Show', Name := source.Name(), IsShow := true );
@@ -31,23 +28,15 @@
      iscc                    := stockingpoint.ID().StartsWith( 'CC' ) or unit.ID().StartsWith( 'CC' ) or exists( parentunits, Elements, punit, punit.ID().StartsWith( 'CC' ) );//unit.ID() = ccunit or exists( parentunits, Elements, punit, punit.ID() = ccunit );
      //是否属于大连工厂
      isdl                    := stockingpoint.ID().StartsWith( 'DL' ) or unit.ID().StartsWith( 'DL' ) or exists( parentunits, Elements, punit, punit.ID().StartsWith( 'DL' ) );//unit.ID() = dlunit or exists( parentunits, Elements, punit, punit.ID() = dlunit );
      //是否属于长春装配线CC厂内库
    //  isccassemnly            := stockingpoint.ID().EndsWith( '厂内库' ) and ( stockingpoint.ID().StartsWith( 'CC' ) or stockingpoint.ID().StartsWith( '长春' ) );//unit.ID() = MachiningPipelineReport::GetDefaultCCAssemnlyUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultCCAssemnlyUnit() );
      //是否属于大连装配线DL厂内库
    //  isdlassemnly            := stockingpoint.ID().EndsWith( '厂内库' ) and ( stockingpoint.ID().StartsWith( 'DL' ) or stockingpoint.ID().StartsWith( '大连' ) );//unit.ID() = MachiningPipelineReport::GetDefaultDLAssemnlyUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultDLAssemnlyUnit() );
      //是否属于长春机加产线
      isccproduction          := stockingpoint.ID().EndsWith( '线边库' ) and ( stockingpoint.ID().StartsWith( 'CC' ) or stockingpoint.ID().StartsWith( '长春' ) );//unit.ID() = MachiningPipelineReport::GetDefaultCCProductionUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultCCProductionUnit() );
      //是否属于大连机加产线
      isdlproduction          := unit.ID().EndsWith( 'MoMo' ) and unit.ID().StartsWith( 'DL' );//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()
        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() and not pisp.IsSystem()// and pisp.ProductID() = '06K103011CM'
                  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 or pispip.DependentDemandAndSalesDemandQuantity() <> 0 ) ) ){
          isccassemnly        := stockingpoint.ID().EndsWith( pisp.Product_MP().ParentID() + '线边库' ) and ( stockingpoint.ID().StartsWith( 'CC' ) or stockingpoint.ID().StartsWith( '长春' ) );
          isdlassemnly        := stockingpoint.ID().EndsWith( pisp.Product_MP().ParentID() ) and ( stockingpoint.ID().StartsWith( 'DL' ) or stockingpoint.ID().StartsWith( '大连' ) );
          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 or pispip.DependentDemandAndSalesDemandQuantity() <> 0 ), pispip.Start() );
          traverse( pispips, Elements, pispip ){
          traverse( pispips, Elements, pispip){//, pispip.Start().Month() = 1 and pispip.Start().Day() = 2
            products.Add( pisp.Product_MP() );
            
            //天
@@ -57,18 +46,17 @@
            
            row               := table.GetRow( pisp.ProductID() );
              
            //装配线
            if( isccassemnly or isdlassemnly ){
              quantity        := [Number]pispip.DependentDemandAndSalesDemandQuantity();//四舍五入
              row.SetCellProductionValue( daycolumn, isccassemnly, [Real]quantity );
              row.SetCellProductionValue( weekcolumn, isccassemnly, [Real]quantity );
            }
              
            //机加线
            if( isccproduction or isdlproduction ){
            if( isccassemnly or isdlassemnly ){
              //装配线
              quantity        := [Number]pispip.DependentDemandAndSalesDemandQuantity();//四舍五入
              row.SetAssemblyPlanValue(  daycolumn, isccassemnly, [Real]quantity );
              row.SetAssemblyPlanValue( weekcolumn, isccassemnly, [Real]quantity );
              //生产
              supplyqty       := [Number]pispip.NewSupplyQuantity();//四舍五入
              row.SetCellProductionValue( daycolumn, isccproduction, [Real]supplyqty );
              row.SetCellProductionValue( weekcolumn, isccproduction, [Real]supplyqty );
    //          info( '****************', quantity, supplyqty );
              row.SetCellProductionValue( daycolumn, isccassemnly, [Real]supplyqty );
              row.SetCellProductionValue( weekcolumn, isccassemnly, [Real]supplyqty );
            }
            
            //库存
_Main/UI/MacroPlannerWebApp/Component_FormMachiningPipelineReport/Component_PanelExport.def
@@ -12,7 +12,7 @@
      Properties:
      [
        Image: 'EXPORT1'
        Label: '导入'
        Label: '导出'
        Taborder: 1
      ]
    }