| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DoSync ( |
| | | MacroPlan macroPlan |
| | | MacroPlan macroPlan, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | Description: '忬¡åæ¥' |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-17-2023 (created) |
| | | info( "Product Finished, Start BaseConversionFactor Data Broker" ) |
| | | macroPlan.Broker_OTD_BaseConversionFactor().Execute(); |
| | | //info( "Product Finished, Start BaseConversionFactor Data Broker" ) |
| | | //macroPlan.Broker_OTD_BaseConversionFactor().Execute(); |
| | | info( "BaseConversionFactor Data Broker Finished, Start BaseConversionFactor Mapping" ) |
| | | macroPlan.MappingBaseConversionFactorData(); |
| | | macroPlan.MappingBaseConversionFactorData(globalOTDTable); |
| | | *] |
| | | } |
| | |
| | | #parent: #root |
| | | StaticMethod DoSync ( |
| | | MacroPlan macroPlan, |
| | | Strings businessTypes |
| | | Strings businessTypes, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-17-2023 (created) |
| | | info( "Forecast Finished, Start CustomerOrder Data Broker" ); |
| | | macroPlan.Broker_OTD_CustomerOrder().Execute(); |
| | | //info( "Forecast Finished, Start CustomerOrder Data Broker" ); |
| | | //macroPlan.Broker_OTD_CustomerOrder().Execute(); |
| | | info( "CustomerOrder Data Broker Finished, Start CustomerOrder Mapping" ); |
| | | macroPlan.MappingCustomerOrderData( businessTypes ); |
| | | macroPlan.MappingCustomerOrderData( businessTypes,globalOTDTable ); |
| | | *] |
| | | } |
| | |
| | | #parent: #root |
| | | StaticMethod DoSync ( |
| | | MacroPlan macroPlan, |
| | | Strings businessTypes |
| | | Strings businessTypes, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-17-2023 (created) |
| | | info( "OperationCost Finished, Start Forecast Data Broker" ); |
| | | macroPlan.Broker_OTD_Forecast().Execute(); |
| | | //info( "OperationCost Finished, Start Forecast Data Broker" ); |
| | | //macroPlan.Broker_OTD_Forecast().Execute(); |
| | | info( "Forecast Data Broker Finished, Start Forecast Mapping" ); |
| | | macroPlan.MappingForecastData( businessTypes ); |
| | | macroPlan.MappingForecastData( businessTypes,globalOTDTable ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod FindMinSeq ( |
| | | GlobalOTDTable globalOTDTable, |
| | | String orgCode, |
| | | String productId, |
| | | String processSection |
| | | ) as Number |
| | | { |
| | | TextBody: |
| | | [* |
| | | // renhao Sep-20-2023 (created) |
| | | return guard (min( globalOTDTable, Global_MappingOperation, item, |
| | | item.OrganCode() = orgCode and item.ProductID() = productId and item.ProcessSection() = processSection, |
| | | item.SequenceNumber() ), Number::MinNumber() ); |
| | | *] |
| | | } |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DoSync ( |
| | | MacroPlan macroPlan |
| | | MacroPlan macroPlan, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-17-2023 (created) |
| | | info( "ActualPISPIP Finished, Start InventoryCost Data Broker" ); |
| | | macroPlan.Broker_OTD_InventoryCost().Execute(); |
| | | //info( "ActualPISPIP Finished, Start InventoryCost Data Broker" ); |
| | | //macroPlan.Broker_OTD_InventoryCost().Execute(); |
| | | info( "InventoryCost Data Broker Finished, Start InventoryCost Mapping" ); |
| | | macroPlan.MappingInventoryValueAndCostData(); |
| | | macroPlan.MappingInventoryValueAndCostData(globalOTDTable); |
| | | *] |
| | | } |
| | |
| | | // Administrator Sep-1-2023 (created) |
| | | |
| | | //Set the Default values |
| | | unitofmeasurename := "PCS"; |
| | | currencyid := "CNY"; |
| | | startdate := Date::Date( 1900, 1, 1 ); |
| | | enddate := Date::Date( 9999, 12, 31 ); |
| | | capacitytype := "Transport quantity"; |
| | | //unitofMeasureName := "PCS"; |
| | | //currencyid := "CNY"; |
| | | //startdate := Date::Date( 1900, 1, 1 ); |
| | | //enddate := Date::Date( 9999, 12, 31 ); |
| | | //capacitytype := "Transport quantity"; |
| | | |
| | | if( isnull( Unit::FindById( this, "空è¿" ) ) ){ |
| | | this.Unit( relnew, |
| | | ID := "空è¿", |
| | | Name := "空è¿", |
| | | UnitOfMeasureName := unitofmeasurename, |
| | | CurrencyID := currencyid, |
| | | StartDate := startdate, |
| | | EndDate := enddate, |
| | | CapacityType := capacitytype ); |
| | | } |
| | | |
| | | if( isnull( Unit::FindById( this, "åºåäºå¡å¤ç" ) ) ){ |
| | | this.Unit( relnew, |
| | | ID := "åºåäºå¡å¤ç", |
| | | Name := "åºåäºå¡å¤ç", |
| | | UnitOfMeasureName := unitofmeasurename, |
| | | CurrencyID := currencyid, |
| | | StartDate := startdate, |
| | | EndDate := enddate, |
| | | CapacityType := capacitytype ); |
| | | } |
| | | |
| | | unitofmeasurename := "PCS"; |
| | | name := "æå¨å建åºåç¹"; |
| | | currencyname := "CNY"; |
| | | isplannedinfinite := false; |
| | | datestart := Date::Construct(1900, 1, 1) ; |
| | | dateend := Date::Construct(9999, 12, 31); |
| | | groupname := " "; |
| | | description := " "; |
| | | isfromdb := true; |
| | | |
| | | if( isnull( StockingPoint_MP::FindById( this, "F13_FG_STOCK" ) ) ){ |
| | | StockingPoint_MP::Create( this, |
| | | "F13_FG_STOCK", |
| | | "F13", |
| | | name, |
| | | unitofmeasurename, |
| | | currencyname, |
| | | isplannedinfinite, |
| | | datestart, |
| | | dateend, |
| | | groupname, |
| | | description, |
| | | isfromdb ); |
| | | } |
| | | |
| | | if( isnull( StockingPoint_MP::FindById( this, "H10_SA_STOCK" ) ) ){ |
| | | StockingPoint_MP::Create( this, |
| | | "H10_SA_STOCK", |
| | | "H10", |
| | | name, |
| | | unitofmeasurename, |
| | | currencyname, |
| | | isplannedinfinite, |
| | | datestart, |
| | | dateend, |
| | | groupname, |
| | | description, |
| | | isfromdb ); |
| | | } |
| | | |
| | | if( isnull( StockingPoint_MP::FindById( this, "Q10_FG_STOCK" ) ) ){ |
| | | StockingPoint_MP::Create( this, |
| | | "Q10_FG_STOCK", |
| | | "Q10", |
| | | name, |
| | | unitofmeasurename, |
| | | currencyname, |
| | | isplannedinfinite, |
| | | datestart, |
| | | dateend, |
| | | groupname, |
| | | description, |
| | | isfromdb ); |
| | | } |
| | | |
| | | existcurrency := Currency_MP::FindById( this, "CNY" ); |
| | | if( isnull( existcurrency ) ){ |
| | |
| | | #parent: #root |
| | | Method MappingActualPISPIPData ( |
| | | Strings businessTypes, |
| | | GlobalOTDTable globalOTDTable, |
| | | Boolean nuclear |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // renhao Aug-14-2023 (created) |
| | | date := Date :: Today(); |
| | | listtodeal := selectset( this,MappingActualPISPIP,actual,true ); |
| | | listtodeal := selectset( globalOTDTable,Global_MappingActualProductInStockingPointInPeriod,actual,actual.ActualInventoryLevelEnd() > 0 ); |
| | | totalcount := listtodeal.Size(); |
| | | info( "ActualPISPIP has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | traverse( listtodeal,Elements,actual){ |
| | | count := count + 1; |
| | | if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | if( count - [Number](count/1000) * 1000 = 0 or count = totalcount ){ |
| | | info( "Now is dealing with the " + count.AsQUILL() + "ActualPISPIP " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | } |
| | | product := select( this,MappingProduct,product,product.ID() = actual.ProductID() and product.KeyProduct() = nuclear,true); |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingBaseConversionFactorData |
| | | Method MappingBaseConversionFactorData ( |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | Description: 'ETLæ°æ®è½¬æ¨¡åæ°æ®' |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | traverse( this, MappingBaseConversionFactor, item ) { |
| | | traverse( globalOTDTable, Global_MappingConversionFactor, item ) { |
| | | //妿ProductIDä¸ä¸ºç©ºï¼ä¸å¹é
ä¸å°Productï¼åä¸å建ï¼è¿å为空 |
| | | // info( item.ProductId().AsQUILL() ); |
| | | BaseConversionFactor::CreateOrUpdate( this, |
| | | item.SourceUnitOfMeasureName(), |
| | | item.TargetUnitOfMeasureName(), |
| | | item.IsEnabled(), |
| | | item.ProductId(), |
| | | item.ProductID(), |
| | | item.Factor() ); |
| | | } |
| | | *] |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingCustomerOrderData ( |
| | | Strings businessTypes |
| | | Strings businessTypes, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | Description: 'ETL订å颿µ' |
| | |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | // å¾
å¤çæ°æ® |
| | | listToDeal := construct( structured[MappingCustomerOrder] ); |
| | | listToDeal := construct( Global_MappingCustomOrders ); |
| | | if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | listToDeal := selectset( this, MappingCustomerOrder, item, true ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingCustomOrder, item, true ); |
| | | } else { |
| | | listToDeal := selectset( this, MappingCustomerOrder, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingCustomOrder, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | } |
| | | queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date(); |
| | | queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() ); |
| | | listToDeal := selectset( listToDeal, Elements, item, item.OrderDate() >= queryStartDate /*and item.OrderDate() <= queryEndDate*/, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) ); |
| | | listToDeal := selectset( listToDeal, Elements, item, item.OrderDate() >= queryStartDate /*and item.OrderDate() <= queryEndDate*/, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockingPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) ); |
| | | |
| | | totalcount := listToDeal.Size(); |
| | | info( "CustomerOrder has " + totalcount.AsQUILL() + " rows in total" ); |
| | |
| | | CustomerOrder::CreateOrUpdate( this, item.CurrencyID(), item.Customer(), item.CustomerID(), item.ID(), |
| | | item.OrderDate(), item.OrderID(), item.OrderLineID(), item.Price(), |
| | | priorityName, item.ProductID(), |
| | | item.StockPointID(), |
| | | item.StockingPointID(), |
| | | item.SalesSegmentName(), |
| | | item.Quantity(), item.UnitOfMeasureName(), item.OrderType(), item.IsAvailable()); |
| | | // }else{ |
| | |
| | | #parent: #root |
| | | Method MappingExternalSupplyData ( |
| | | Strings businessTypes, |
| | | Boolean nuclear |
| | | Boolean nuclear, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | TextBody: |
| | |
| | | // renhao Aug-14-2023 (created) |
| | | queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date(); |
| | | queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() ); |
| | | listtodeal := selectset( this,MappingExternalSupply,externalSupply, externalSupply.UserQuantity()>0 and externalSupply.Date() >= queryStartDate /*and externalSupply.Date() <= queryEndDate*/); |
| | | listtodeal := selectset( globalOTDTable,Global_MappingInventorySupply,externalSupply, externalSupply.UserQuantity()>0 and externalSupply.Date() >= queryStartDate /*and externalSupply.Date() <= queryEndDate*/); |
| | | totalcount := listtodeal.Size(); |
| | | description := "å¨éå¨å¶"; |
| | | info( "ExternalSupply has " + totalcount.AsQUILL() + " rows in total" ); |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingForecastData ( |
| | | Strings businessTypes |
| | | Strings businessTypes, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | Description: 'ETL订å颿µ' |
| | |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | // å¾
å¤çæ°æ® |
| | | listToDeal := construct( structured[MappingForecast] ); |
| | | listToDeal := construct( Global_MappingForecasts ); |
| | | if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | listToDeal := selectset( this, MappingForecast, item, item.Quantity() > 0 ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingForecast, item, item.Quantity() > 0 ); |
| | | } else { |
| | | listToDeal := selectset( this, MappingForecast, item, businessTypes.Find( item.BusinessType() ) <> -1 and item.Quantity()>0 ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingForecast, item, businessTypes.Find( item.BusinessType() ) <> -1 and item.Quantity()>0 ); |
| | | } |
| | | queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date(); |
| | | queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() ); |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingInventoryValueAndCostData |
| | | Method MappingInventoryValueAndCostData ( |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | listtodeal := selectset( this,MappingInventoryValueAndCost,item,true ); |
| | | listtodeal := selectset( globalOTDTable,Global_MappingStockingPointCost,item,true ); |
| | | totalcount := listtodeal.Size(); |
| | | |
| | | info( "InventoryCost has " + totalcount.AsQUILL() + " rows in total" ); |
| | |
| | | Method MappingOperationBOMData ( |
| | | Strings businessTypes, |
| | | Boolean isKeyProduct, |
| | | Boolean createPurchaseSupplyMaterial |
| | | Boolean createPurchaseSupplyMaterial, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | TextBody: |
| | |
| | | |
| | | keyProductList := construct( Strings ); |
| | | if( isKeyProduct ) { |
| | | keyProductList := selectuniquevalues( this, MappingProduct, item, item.ProductMajorType()="æå" or item.ProductMajorType()="åæå", item.ID() ); |
| | | keyProductList := selectuniquevalues( globalOTDTable, Global_MappingProduct_MP, item, item.ProductMajorType()="æå" or item.ProductMajorType()="åæå", item.ID() ); |
| | | } |
| | | bomList := selectsortedset( this, MappingBOM, item, |
| | | bomList := selectsortedset( globalOTDTable, Global_MappingOperationBOM, item, |
| | | ifexpr( isnull( businessTypes ) or businessTypes.Size() = 0, |
| | | true, |
| | | // businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 ) |
| | |
| | | if( not isnull( stockingPoint)){ |
| | | if( isKeyProduct){ |
| | | keyRows := selectset( routingRows,Elements,routingrow,keyProductList.Find( routingrow.ComponentCode())>=0); |
| | | this.MappingOperationBOMDataRouting( routing,keyRows); |
| | | this.MappingOperationBOMDataRouting( routing,globalOTDTable,keyRows); |
| | | }else{ |
| | | this.MappingOperationBOMDataRouting( routing,routingRows); |
| | | this.MappingOperationBOMDataRouting( routing,globalOTDTable,routingRows); |
| | | } |
| | | |
| | | } |
| | |
| | | #parent: #root |
| | | Method MappingOperationBOMDataRouting ( |
| | | Routing routing, |
| | | MappingBOMs routingRows |
| | | GlobalOTDTable globalOTDTable, |
| | | Global_MappingOperationBOMs routingRows |
| | | ) |
| | | { |
| | | TextBody: |
| | |
| | | rows := selectset( routingRows, Elements, row, row.ProcessSection() = processSection ); |
| | | firstRow := rows.Element( 0 ); |
| | | // æ¾orgCode/productId/processSectionå¹é
ä¸sequenceæå°çä¸ç»æ°æ® |
| | | minSeq := MappingOperation::FindMinSeq( this, firstRow.OrganCode(), firstRow.ProductCode(), processSection ); |
| | | minSeq := Global_MappingOperation::FindMinSeq( globalOTDTable, firstRow.OrganCode(), firstRow.ProductCode(), processSection ); |
| | | routingStepId := processSection + "_" + [String]minSeq; |
| | | // æ¾å¯¹åºroutingStep |
| | | routingStep := RoutingStep::FindByName( routing, routingStepId ); |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingOperationData ( |
| | | Strings businessTypes |
| | | Strings businessTypes, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-18-2023 (created) |
| | | // è·åæåºçå¾
å¤çè®°å½ |
| | | toDealList := construct( MappingOperations ); |
| | | toDealList := construct( Global_MappingOperations ) ; |
| | | if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | toDealList := selectsortedset( this, MappingOperation, item, |
| | | toDealList := selectsortedset( globalOTDTable, Global_MappingOperation, item, |
| | | businessTypes.Find( item.BusinessType() ) >= 0, |
| | | // businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0, |
| | | item.SequenceNumber() ); |
| | | } else { |
| | | toDealList := selectsortedset( this, MappingOperation, item, |
| | | toDealList := selectsortedset( globalOTDTable, Global_MappingOperation, item, |
| | | true, |
| | | item.SequenceNumber() ); |
| | | } |
| | |
| | | #parent: #root |
| | | Method MappingProductData ( |
| | | Strings businesstypes, |
| | | GlobalOTDTable globalOTDTable, |
| | | Boolean iskeyproduct |
| | | ) |
| | | { |
| | |
| | | // Administrator Aug-16-2023 (created) |
| | | // list to deal |
| | | info( "Get list to deal of product" ); |
| | | listToDeal := construct( structured[MappingProduct] ); |
| | | listToDeal := construct( Global_MappingProduct_MPs ); |
| | | |
| | | if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | if( iskeyproduct = true ){ |
| | | listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, item.KeyProduct() = true ); |
| | | } |
| | | else{ |
| | | listToDeal := selectset( this, MappingProduct, item, true ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, true ); |
| | | } |
| | | } else { |
| | | if( iskeyproduct = true ){ |
| | | listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true and businesstypes.Find( item.BusinessType()) >= 0 ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, item.KeyProduct() = true and businesstypes.Find( item.BusinessType()) >= 0 ); |
| | | } |
| | | else{ |
| | | listToDeal := selectset( this, MappingProduct, item, businesstypes.Find( item.BusinessType()) >= 0 ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, businesstypes.Find( item.BusinessType()) >= 0 ); |
| | | } |
| | | } |
| | | totalcount := listToDeal.Size(); |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingProductInLaneData |
| | | Method MappingProductInLaneData ( |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | Description: 'Get Product In Line data' |
| | | TextBody: |
| | | [* |
| | | // Administrator Aug-17-2023 (created) |
| | | // list to deal |
| | | listtodeal := selectset( this, MappingProductInLane, item ,true ); |
| | | listtodeal := selectset( globalOTDTable, Global_MappingProductInLane, item ,true ); |
| | | totalcount := listtodeal.Size(); |
| | | info( "ProductInLane has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingSalesSegmentData ( |
| | | Strings businessTypes |
| | | Strings businessTypes, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | Description: 'ETLéå®é¨é¨' |
| | |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | // å¾
å¤çæ°æ® |
| | | listToDeal := construct( structured[MappingSalesSegment] ); |
| | | listToDeal := construct( Global_MappingSalesSegment_MPs ); |
| | | if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | listToDeal := selectset( this, MappingSalesSegment, item, true ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingSalesSegment_MP, item, true ); |
| | | } else { |
| | | listToDeal := selectset( this, MappingSalesSegment, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingSalesSegment_MP, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | } |
| | | //nameList := construct( structured[String] ); |
| | | //nameList := selectvalues( listToDeal, Elements, item, true, item.Name() ); |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingUnitData ( |
| | | Strings businesstypes |
| | | Strings businesstypes, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | Description: 'Get unit data from operation mapping' |
| | |
| | | [* |
| | | // Administrator Aug-21-2023 (created) |
| | | // list to deal |
| | | listtodeal := construct( structured[MappingOperation] ); |
| | | listtodeal := construct( Global_MappingOperations); |
| | | |
| | | if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | listtodeal := selectset( this, MappingOperation, item, true ); |
| | | listtodeal := selectset( globalOTDTable, Global_MappingOperation, item, true ); |
| | | } else { |
| | | listtodeal := selectset( this, MappingOperation, item, |
| | | listtodeal := selectset( globalOTDTable, Global_MappingOperation, item, |
| | | // businesstypes.Difference( businesstypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 |
| | | businesstypes.Find( item.BusinessType() ) >= 0 |
| | | ); |
| | |
| | | MacroPlan macroPlan, |
| | | String businessTypeStr, |
| | | Boolean isKeyProduct, |
| | | Boolean createPurchaseSupplyMaterial |
| | | Boolean createPurchaseSupplyMaterial, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | Description: '忬¡åæ¥' |
| | |
| | | if( businessTypeStr.Length() > 0 ) { |
| | | businessTypes := businessTypeStr.Tokenize( ',' ); |
| | | } |
| | | MacroPlan::DoSync( macroPlan, businessTypes, isKeyProduct, createPurchaseSupplyMaterial ); |
| | | MacroPlan::DoSync( macroPlan, businessTypes, isKeyProduct, createPurchaseSupplyMaterial ,globalOTDTable); |
| | | *] |
| | | } |
| | |
| | | StaticMethod DoSync ( |
| | | MacroPlan macroPlan, |
| | | Boolean isKeyProduct, |
| | | Boolean createPurchaseSupplyMaterial |
| | | Boolean createPurchaseSupplyMaterial, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | Description: '忬¡åæ¥' |
| | |
| | | [* |
| | | // yypsybs Aug-17-2023 (created) |
| | | businessTypes := construct( Strings ); |
| | | MacroPlan::DoSync( macroPlan, businessTypes, isKeyProduct, createPurchaseSupplyMaterial ); |
| | | MacroPlan::DoSync( macroPlan, businessTypes, isKeyProduct, createPurchaseSupplyMaterial ,globalOTDTable); |
| | | *] |
| | | } |
| | |
| | | MacroPlan macroPlan, |
| | | Strings businessTypes, |
| | | Boolean isKeyProduct, |
| | | Boolean createPurchaseSupplyMaterial |
| | | Boolean createPurchaseSupplyMaterial, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | Description: '忬¡åæ¥' |
| | |
| | | UnitOfMeasure_MP::DoSync( macroPlan ); |
| | | |
| | | // éå®é¨é¨-2 |
| | | SalesSegment_MP::DoSync( macroPlan, businessTypes ); |
| | | SalesSegment_MP::DoSync( macroPlan, businessTypes,globalOTDTable ); |
| | | |
| | | // åºåç¹-3 |
| | | info( "Sales Segment Finished, Start Get StockingPoint From Api" ) |
| | |
| | | macroPlan.ApiCurencyRatesData( data ); |
| | | |
| | | // 产åç©æ-6 |
| | | info( "Get CurrencyRates From Api Finished, Start Product Data Broker" ) |
| | | macroPlan.Broker_OTD_Product().Execute(); |
| | | //info( "Get CurrencyRates From Api Finished, Start Product Data Broker" ) |
| | | //macroPlan.Broker_OTD_Product().Execute(); |
| | | info( "Product Data Broker Finished, Start Product Mapping" ); |
| | | //testproduct := construct( Strings ); |
| | | macroPlan.MappingProductData( businessTypes, isKeyProduct ); |
| | | macroPlan.MappingProductData( businessTypes, globalOTDTable,isKeyProduct ); |
| | | |
| | | //åä½è½¬æ¢-7 |
| | | BaseConversionFactor::DoSync( macroPlan ); |
| | | BaseConversionFactor::DoSync( macroPlan ,globalOTDTable); |
| | | |
| | | // Unit-9 |
| | | // ä¸Operationä¸åå¤ç |
| | | info( "BaseConversionFactor Finished, Start Operation Data Broker" ); |
| | | macroPlan.Broker_OTD_Operation().Execute(); |
| | | //info( "BaseConversionFactor Finished, Start Operation Data Broker" ); |
| | | //macroPlan.Broker_OTD_Operation().Execute(); |
| | | info( "Operation Data Broker Finished, Start Unit Mapping" ); |
| | | macroPlan.MappingUnitData( businessTypes ); |
| | | macroPlan.MappingUnitData( businessTypes ,globalOTDTable); |
| | | |
| | | // å·¥èºè·¯çº¿ + BOM-9 |
| | | info( "Unit Finished, Start Operation Mapping" ); |
| | | macroPlan.MappingOperationData( businessTypes ); |
| | | info( "Operation Finished, Start BOM Data Broker" ); |
| | | macroPlan.Broker_OTD_BOM().Execute(); |
| | | macroPlan.MappingOperationData( businessTypes ,globalOTDTable); |
| | | //info( "Operation Finished, Start BOM Data Broker" ); |
| | | //macroPlan.Broker_OTD_BOM().Execute(); |
| | | info( "BOM Data Broker Finished, Start BOM Mapping" ); |
| | | macroPlan.MappingOperationBOMData( businessTypes, isKeyProduct, createPurchaseSupplyMaterial ); |
| | | macroPlan.MappingOperationBOMData( businessTypes, isKeyProduct, createPurchaseSupplyMaterial,globalOTDTable ); |
| | | |
| | | //车éä¿¡æ¯-10 |
| | | info( "BOM Finished, Start Get Lanes From Api" ); |
| | |
| | | macroPlan.ApiLaneLegsData( data ); |
| | | |
| | | // ä¾åºç½ç»ï¼è½¦éï¼-12 |
| | | info( "Get Lanelegs From Api Finished, Start ProductInLane Data Broker" ); |
| | | macroPlan.Broker_OTD_ProductInLane().Execute(); |
| | | //info( "Get Lanelegs From Api Finished, Start ProductInLane Data Broker" ); |
| | | //macroPlan.Broker_OTD_ProductInLane().Execute(); |
| | | info( "ProductInLane Data Broker Finished, Start ProductInLane Mapping" ); |
| | | macroPlan.MappingProductInLaneData(); |
| | | macroPlan.MappingProductInLaneData(globalOTDTable); |
| | | |
| | | // å¨åºåºåæ°æ®-13 |
| | | info( "ProductInLane Finished, Start ActualPISPIP Data Broker" ); |
| | | macroPlan.Broker_OTD_ActualPISPIP().Execute(); |
| | | //info( "ProductInLane Finished, Start ActualPISPIP Data Broker" ); |
| | | //macroPlan.Broker_OTD_ActualPISPIP().Execute(); |
| | | info( "ActualPISPIP Data Broker Finished, Start ActualPISPIP Mapping" ); |
| | | //macroPlan.MappingActualPISPIPData( businessTypes, true ); |
| | | macroPlan.MappingActualPISPIPData( businessTypes, isKeyProduct ); |
| | | macroPlan.MappingActualPISPIPData( businessTypes, globalOTDTable,isKeyProduct ); |
| | | |
| | | // å¨éåºå-14 |
| | | info( "ActualPISPIP Finished, Start ExternalSupply Data Broker" ); |
| | | macroPlan.Broker_OTD_ExternalSupply().Execute(); |
| | | //macroPlan.MappingExternalSupplyData( businessTypes, true ); |
| | | //info( "ActualPISPIP Finished, Start ExternalSupply Data Broker" ); |
| | | //macroPlan.Broker_OTD_ExternalSupply().Execute(); |
| | | info( "ExternalSupply Data Broker Finished, Start ExternalSupply Mapping" ); |
| | | macroPlan.MappingExternalSupplyData( businessTypes, isKeyProduct ); |
| | | macroPlan.MappingExternalSupplyData( businessTypes, isKeyProduct ,globalOTDTable); |
| | | |
| | | // åºåææ¬-15 |
| | | InventoryValueAndCost::DoSync( macroPlan ); |
| | | InventoryValueAndCost::DoSync( macroPlan,globalOTDTable ); |
| | | |
| | | // todo å¶é ææ¬-16 |
| | | info( "InventoryCost Finished, Start OperationCost Mapping" ); |
| | | //macroPlan.MappingOperationCostData( businessTypes ); |
| | | |
| | | // 订å颿µ-17 |
| | | Forecast::DoSync( macroPlan, businessTypes ); |
| | | Forecast::DoSync( macroPlan, businessTypes ,globalOTDTable); |
| | | |
| | | // 订åéæ±-18 |
| | | CustomerOrder::DoSync( macroPlan, businessTypes ); |
| | | CustomerOrder::DoSync( macroPlan, businessTypes,globalOTDTable); |
| | | |
| | | //å é¤å¤ä½æ¥éæ°æ®-19 |
| | | macroPlan.DeleteSnaityCheck(); |
| | |
| | | #parent: #root |
| | | StaticMethod DoSync ( |
| | | MacroPlan macroPlan, |
| | | Strings businessTypes |
| | | Strings businessTypes, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-17-2023 (created) |
| | | info( "UnitOfMeasure_MP Finished, Start Sales Segment Data Broker" ) |
| | | macroPlan.Broker_OTD_SalesSegment().Execute(); |
| | | //info( "UnitOfMeasure_MP Finished, Start Sales Segment Data Broker" ) |
| | | //macroPlan.Broker_OTD_SalesSegment().Execute(); |
| | | info( "Sales Segment Data Broker Finished, Start Sales Segment Mapping" ) |
| | | macroPlan.MappingSalesSegmentData( businessTypes ); |
| | | macroPlan.MappingSalesSegmentData( businessTypes,globalOTDTable ); |
| | | *] |
| | | } |
| | |
| | | // Update |
| | | result.Update( unitid, id, name, unitofmeasurename, currencyname, isplannedinfinite, datestart, dateend, groupname, description, isfromdb ); |
| | | }; |
| | | |
| | | result.IsPlannedInfinite(true); |
| | | return result; |
| | | *] |
| | | } |
| | |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-17-2023 (created) |
| | | info( "Inital Finished, Start UnitOfMeasure_MP Data Broker" ) |
| | | macroPlan.Broker_OTD_UnitOfMeasure().Execute(); |
| | | //info( "Inital Finished, Start UnitOfMeasure_MP Data Broker" ) |
| | | //macroPlan.Broker_OTD_UnitOfMeasure().Execute(); |
| | | info( "UnitOfMeasure_MP Data Broker Finished, Start UnitOfMeasure_MP Mapping" ) |
| | | macroPlan.MappingUnitOfMeasureData(); |
| | | *] |