| | |
| | | #parent: #root |
| | | StaticMethod DoASync ( |
| | | MacroPlan macroPlan, |
| | | Strings businessTypes, |
| | | BusinessType businessType, |
| | | Boolean isKeyProduct, |
| | | Boolean createPurchaseSupplyMaterial, |
| | | const GlobalOTDTable globalOTDTable |
| | | ) |
| | | ) as stream[MacroPlan] |
| | | { |
| | | Description: '忬¡åæ¥' |
| | | TextBody: |
| | |
| | | //Currency_MP::CreateCurrencyFromJson( macroPlan, jsonDataRow ); |
| | | info( "Prepare to do sync" ) |
| | | info( "Get organ code list" ) |
| | | organcodelist := selectvalues( globalOTDTable, Global_MappingOperationBOM, bom,true, bom.OrganCode() ); |
| | | if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | traverse( businessTypes, Elements, item ) { |
| | | info( "Business type : " + item ) |
| | | } |
| | | organcodelist := selectvalues( globalOTDTable, BusinessType.OrganCode, organ, businessTypes.Find( organ.BusinessType().BusinessTypeName() ) <> -1, organ.OrganCodeName() ); |
| | | } |
| | | else{ |
| | | if( businessTypes.Size() = 0 ){ |
| | | if( not isnull( selectset( globalOTDTable, BusinessType, b, b.BusinessTypeName() = "" ) ) ){ |
| | | organcodelist := selectvalues( globalOTDTable, BusinessType.OrganCode, organ, organ.BusinessType().BusinessTypeName() = "", organ.OrganCodeName() ); |
| | | } |
| | | } |
| | | } |
| | | businessTypeName := businessType.BusinessTypeName().Tokenize( "," ); |
| | | organcodelist := selectvalues( businessType, OrganCode, organ, true, organ.OrganCodeName() ); |
| | | |
| | | if( organcodelist.Size() = 0 ){ |
| | | organcodelist := selectvalues( globalOTDTable, Global_MappingOperationBOM, bom,true, bom.OrganCode() ); |
| | |
| | | UnitOfMeasure_MP::DoASync( globalOTDTable, macroPlan ); |
| | | |
| | | // éå®é¨é¨-2 |
| | | SalesSegment_MP::DoASync( macroPlan, businessTypes,globalOTDTable ); |
| | | SalesSegment_MP::DoASync( macroPlan, businessTypeName,globalOTDTable ); |
| | | |
| | | // Unit-9 |
| | | // ä¸Operationä¸åå¤ç |
| | | //info( "BaseConversionFactor Finished, Start Operation Data Broker" ); |
| | | //macroPlan.Broker_OTD_Operation().Execute(); |
| | | info( "Operation Data Broker Finished, Start Unit Mapping" ); |
| | | macroPlan.DoASyncMappingUnitData( businessTypes ,globalOTDTable, organcodelist); |
| | | macroPlan.DoASyncMappingUnitData( businessTypeName ,globalOTDTable, organcodelist); |
| | | |
| | | // åºåç¹-3 |
| | | info( "Sales Segment Finished, Start Get StockingPoint From Api" ) |
| | |
| | | //macroPlan.Broker_OTD_Product().Execute(); |
| | | info( "Product Data Broker Finished, Start Product Mapping" ); |
| | | //testproduct := construct( Strings ); |
| | | macroPlan.DoASyncMappingProductData( businessTypes, globalOTDTable,isKeyProduct ); |
| | | macroPlan.DoASyncMappingProductData( businessTypeName, globalOTDTable,isKeyProduct ); |
| | | |
| | | //åä½è½¬æ¢-7 |
| | | BaseConversionFactor::DoASync( macroPlan ,globalOTDTable); |
| | | |
| | | // å·¥èºè·¯çº¿ + BOM-9 |
| | | info( "Unit Finished, Start Operation Mapping" ); |
| | | macroPlan.DoASyncMappingOperationData( businessTypes ,globalOTDTable, organcodelist ); |
| | | macroPlan.DoASyncMappingOperationData( businessTypeName ,globalOTDTable, organcodelist ); |
| | | //info( "Operation Finished, Start BOM Data Broker" ); |
| | | //macroPlan.Broker_OTD_BOM().Execute(); |
| | | info( "BOM Data Broker Finished, Start BOM Mapping" ); |
| | | macroPlan.DoASyncMappingOperationBOMData( businessTypes, isKeyProduct, createPurchaseSupplyMaterial,globalOTDTable, organcodelist ); |
| | | macroPlan.DoASyncMappingOperationBOMData( businessTypeName, isKeyProduct, createPurchaseSupplyMaterial,globalOTDTable, organcodelist ); |
| | | |
| | | //车éä¿¡æ¯-10 |
| | | info( "BOM Finished, Start Get Lanes From Api" ); |
| | |
| | | //info( "ProductInLane Finished, Start ActualPISPIP Data Broker" ); |
| | | //macroPlan.Broker_OTD_ActualPISPIP().Execute(); |
| | | info( "ActualPISPIP Data Broker Finished, Start ActualPISPIP Mapping" ); |
| | | macroPlan.DoASyncMappingActualPISPIPData( businessTypes, globalOTDTable,isKeyProduct, organcodelist ); |
| | | macroPlan.DoASyncMappingActualPISPIPData( businessTypeName, globalOTDTable,isKeyProduct, organcodelist ); |
| | | |
| | | // å¨éåºå-14 |
| | | //info( "ActualPISPIP Finished, Start ExternalSupply Data Broker" ); |
| | | //macroPlan.Broker_OTD_ExternalSupply().Execute(); |
| | | info( "ExternalSupply Data Broker Finished, Start ExternalSupply Mapping" ); |
| | | macroPlan.DoASyncMappingExternalSupplyData( businessTypes, isKeyProduct ,globalOTDTable, organcodelist ); |
| | | macroPlan.DoASyncMappingExternalSupplyData( businessTypeName, isKeyProduct ,globalOTDTable, organcodelist ); |
| | | |
| | | // åºåææ¬-15 |
| | | InventoryValueAndCost::DoASync( macroPlan,globalOTDTable ); |
| | | |
| | | // todo å¶é ææ¬-16 |
| | | info( "InventoryCost Finished, Start OperationCost Mapping" ); |
| | | macroPlan.DoASyncMappingOperationCostData( globalOTDTable, businessTypes, organcodelist ); |
| | | macroPlan.DoASyncMappingOperationCostData( globalOTDTable, businessTypeName, organcodelist ); |
| | | |
| | | // 订å颿µ-17 |
| | | Forecast::DoASync( macroPlan, businessTypes, globalOTDTable, organcodelist ); |
| | | Forecast::DoASync( macroPlan, businessTypeName, globalOTDTable, organcodelist ); |
| | | |
| | | // 订åéæ±-18 |
| | | CustomerOrder::DoASync( macroPlan, businessTypes, globalOTDTable, organcodelist ); |
| | | CustomerOrder::DoASync( macroPlan, businessTypeName, globalOTDTable, organcodelist ); |
| | | |
| | | //å é¤å¤ä½æ¥éæ°æ®-19 |
| | | macroPlan.DeleteSnaityCheck(); |
| | |
| | | |
| | | //// todo ä¾åºååå¤ |
| | | //info( "ProviderReply::DoSync" ) |
| | | |
| | | return emit( macroPlan ); |
| | | *] |
| | | } |