| | |
| | | //info( "目标时间:", targetDate.Format( "Y-M2-D2" ) ); |
| | | 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; |
| | |
| | | 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(); |
| | | } |
| | |
| | | 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(), |
| | |
| | | moperationcost, |
| | | moperationcost.OrgCode() = item.OrganCode(), |
| | | moperationcost.ProductID() = item.ProductID() ); |
| | | 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( connecteditem)){ |
| | | cost := connecteditem.Cost(); |
| | | lengthoftime := connecteditem.LengthOfTime(); |
| | | start := connecteditem.Start(); |
| | | timeunit := connecteditem.TimeUnit(); |
| | | OperationCost::Create( id, operation, account, "Volume", start, timeunit, lengthoftime, cost, isfromdb ); |
| | | } |
| | | |
| | | } |
| | | } |
| | | *] |