limj
2023-10-09 eab10a370cd6e9d46c67ef1b8dbf6c767e1d478b
Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lmj
已修改2个文件
35 ■■■■ 文件已修改
_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl
@@ -14,8 +14,24 @@
  [*
    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() );
      if ( numberOfLayers <> 1 and pispippl.NewSupply( relsize ) = 0 ) {
        previous := pispippl.PreviousPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf );
        if ( not previous.Period_MP().IsHistorical() ) {
          previousDate := previous.Start().Date();
          CapacityAllocationResults::IterativeGeneration2( globalOTDTable,
                                                           pisp,
                                                           previousDate,
                                                           carrcs,
                                                           numberOfLayers,
                                                           firstLevelSupply,
                                                           currentLayerDependentDemandQuantity
                                                          );
        }
      }
      traverse ( pispippl, NewSupply, ns, ns.Quantity() > 0 ) {
        if ( numberOfLayers = 1 ) {
          firstLevelSupply := ns;
@@ -24,7 +40,7 @@
        ontype( ns.PeriodTask_MP() ) {
          PeriodTaskOperation as pto : {
    //        info( "Operation周期任务..." );     
            traverse ( ns, PeriodTask_MP.astype( PeriodTaskOperation ).DependentDemand, dd ) {
            traverse ( ns, PeriodTask_MP.astype( PeriodTaskOperation ).DependentDemand, dd, dd.Quantity() > 0 ) {
              if ( numberOfLayers = 1 ) {
                currentLayerDependentDemandQuantity := ns.Quantity();
              }
@@ -56,8 +72,8 @@
                                                        ModuleMeasurementUnit := firstLevelSupply.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().UnitOfMeasureName(),
                                                        ModuleBase            := guard( firstLevelSupply.PeriodTask_MP().astype( PeriodTaskOperation ).Operation().UnitID(), "车道运输" ),
                                                        Division              := carrc.Division(),
                                                        RequirementDate       := ns.Start().Date(),
                                                        Date                  := ns.Start().Date(),
                                                        RequirementDate       := firstLevelSupply.Start().Date(),
                                                        Date                  := firstLevelSupply.Start().Date(),
                                                        Description           := "",
                                                        ID                    := OS::GenerateGUIDAsString(),
                                                        ProductID             := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID(),
@@ -67,7 +83,7 @@
                                                       );
                                                        
            }
            info( "-----------------------------------------------------------------------------------------------------------------" );
            //info( "-----------------------------------------------------------------------------------------------------------------" );
          }
          
          PeriodTaskLaneLeg as ptll : {
@@ -76,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,7 +50,8 @@
          id := id + "_" + item.Line();
        }
      operation := Operation::FindOperationTypeIndex( id );
      account := Account_MP::FindByName( this, "Operation cost" );
      if(not isnull(operation)){
            account := Account_MP::FindByName( this, "Operating cost" );
      isfromdb := false;
      existoperationcost := OperationCost::FindOperationCostTypeIndex( id );
      if( isnull( existoperationcost ) ){
@@ -59,12 +60,16 @@
                                 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 );
        }
              }
      }
      }
  *]
}