hongji.li
2023-10-08 1c013268e21a380f88a6688bdb5b0553d0ea7542
产能分配结果Bug修改
已修改2个文件
47 ■■■■ 文件已修改
_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl
@@ -14,9 +14,9 @@
  [*
    numberOfLayers++;
    //info( "目标时间:", targetDate.Format( "Y-M2-D2" ) );
    info( pisp.Name() );
    //info( pisp.Name() );
    traverse ( pisp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispippl, pispippl.Start().Date() = targetDate ) {
      info( "是否有供应:", pispippl.NewSupply( relsize ) > 0, "    库存:", pispippl.InventoryLevelEnd() );
      //info( "是否有供应:", pispippl.NewSupply( relsize ) > 0, "    库存:", pispippl.InventoryLevelEnd() );
      if ( numberOfLayers <> 1 and pispippl.NewSupply( relsize ) = 0 ) {
        previous := pispippl.PreviousPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf );
        if ( not previous.Period_MP().IsHistorical() ) {
@@ -83,7 +83,7 @@
                                                       );
                                                        
            }
            info( "-----------------------------------------------------------------------------------------------------------------" );
            //info( "-----------------------------------------------------------------------------------------------------------------" );
          }
          
          PeriodTaskLaneLeg as ptll : {
@@ -92,7 +92,7 @@
    //        info( "层数:", numberOfLayers,"    当前供应的pisp:", ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    总供应值:", ns.Quantity(), "    需要供应值:", currentLayerDependentDemandQuantity,
    //              "    当前需求pisp:", targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    需求值:", currentLayerDependentDemandQuantity );
    //        info( "LaneLeg周期任务..." );
            info( "-----------------------------------------------------------------------------------------------------------------" );
            //info( "-----------------------------------------------------------------------------------------------------------------" );
            CapacityAllocationResults::IterativeGeneration2( globalOTDTable,
                                                             targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP(),
                                                             targetDate,
_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
@@ -50,24 +50,27 @@
          id := id + "_" + item.Line();
        }
      operation := Operation::FindOperationTypeIndex( id );
      account := Account_MP::FindByName( this, "Operation cost" );
      isfromdb := false;
      existoperationcost := OperationCost::FindOperationCostTypeIndex( id );
      if( isnull( existoperationcost ) ){
        connecteditem := select( globalOTDTable,
                                 Global_MappingOperationCost,
                                 moperationcost,
                                 moperationcost.OrgCode() = item.OrganCode(),
                                 moperationcost.ProductID() = item.ProductID() );
        if( not isnull( connecteditem)){
            cost := connecteditem.Cost();
            lengthoftime := connecteditem.LengthOfTime();
            start := connecteditem.Start();
            timeunit := connecteditem.TimeUnit();
            OperationCost::Create( id, operation, account, "Volume", start, timeunit, lengthoftime, cost, isfromdb );
          }
        }
      if(not isnull(operation)){
            account := Account_MP::FindByName( this, "Operation cost" );
            isfromdb := false;
            existoperationcost := OperationCost::FindOperationCostTypeIndex( id );
            if( isnull( existoperationcost ) ){
              connecteditem := select( globalOTDTable,
                                       Global_MappingOperationCost,
                                       moperationcost,
                                       moperationcost.OrgCode() = item.OrganCode(),
                                       moperationcost.ProductID() = item.ProductID() );
              if( not isnull( connecteditem)){
                  cost := connecteditem.Cost();
                  lengthoftime := connecteditem.LengthOfTime();
                  start := connecteditem.Start();
                  timeunit := connecteditem.TimeUnit();
                  OperationCost::Create( id, operation, account, "Volume", start, timeunit, lengthoftime, cost, isfromdb );
                }
              }
      }
      }
  *]
}