| | |
| | | #parent: #root |
| | | StaticMethod DoSync ( |
| | | MacroPlan macroPlan, |
| | | Strings businessTypes, |
| | | BusinessType businessType, |
| | | Boolean isKeyProduct, |
| | | Boolean createPurchaseSupplyMaterial, |
| | | GlobalOTDTable globalOTDTable |
| | |
| | | //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::DoSync( globalOTDTable,macroPlan ); |
| | | |
| | | // 销售部门-2 |
| | | SalesSegment_MP::DoSync( macroPlan, businessTypes,globalOTDTable ); |
| | | SalesSegment_MP::DoSync( 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.MappingUnitData( businessTypes ,globalOTDTable, organcodelist); |
| | | macroPlan.MappingUnitData( 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.MappingProductData( businessTypes, globalOTDTable,isKeyProduct ); |
| | | macroPlan.MappingProductData( businessTypeName, globalOTDTable,isKeyProduct ); |
| | | |
| | | //单位转换-7 |
| | | BaseConversionFactor::DoSync( macroPlan ,globalOTDTable); |
| | | |
| | | // 工艺路线 + BOM-9 |
| | | info( "Unit Finished, Start Operation Mapping" ); |
| | | macroPlan.MappingOperationData( businessTypes ,globalOTDTable, organcodelist ); |
| | | macroPlan.MappingOperationData( businessTypeName ,globalOTDTable, organcodelist ); |
| | | //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,globalOTDTable, organcodelist ); |
| | | macroPlan.MappingOperationBOMData( 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.MappingActualPISPIPData( businessTypes, globalOTDTable,isKeyProduct, organcodelist ); |
| | | macroPlan.MappingActualPISPIPData( 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.MappingExternalSupplyData( businessTypes, isKeyProduct ,globalOTDTable, organcodelist ); |
| | | macroPlan.MappingExternalSupplyData( businessTypeName, isKeyProduct ,globalOTDTable, organcodelist ); |
| | | |
| | | // 库存成本-15 |
| | | InventoryValueAndCost::DoSync( macroPlan,globalOTDTable ); |
| | | |
| | | // todo 制造成本-16 |
| | | info( "InventoryCost Finished, Start OperationCost Mapping" ); |
| | | macroPlan.MappingOperationCostData( globalOTDTable, businessTypes, organcodelist ); |
| | | macroPlan.MappingOperationCostData( globalOTDTable, businessTypeName, organcodelist ); |
| | | |
| | | // 订单预测-17 |
| | | Forecast::DoSync( macroPlan, businessTypes, globalOTDTable, organcodelist ); |
| | | Forecast::DoSync( macroPlan, businessTypeName, globalOTDTable, organcodelist ); |
| | | |
| | | // 订单需求-18 |
| | | CustomerOrder::DoSync( macroPlan, businessTypes, globalOTDTable, organcodelist ); |
| | | CustomerOrder::DoSync( macroPlan, businessTypeName, globalOTDTable, organcodelist ); |
| | | |
| | | //删除多余报错数据-19 |
| | | macroPlan.DeleteSnaityCheck(); |