Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lhj
已修改39个文件
已添加10个文件
已删除1个文件
| | |
| | | if( productId <> "" ) { |
| | | product := Product_MP::FindById( macroPlan, productId ); |
| | | }else{ |
| | | // info( productId ); |
| | | // cf := select( source, |
| | | // AsSourceUnitOfMeasure, |
| | | // cf, |
| | | // ( cf.TargetUnitOfMeasure() = target |
| | | // or cf.TargetUnitOfMeasure() = source ) |
| | | // and cf.Product_MP() = product |
| | | // ); |
| | | // info( isnull( cf ) ); |
| | | // info( "sourceuomname: " + cf.astype( BaseConversionFactor ).SourceUnitOfMeasureName() ); |
| | | // info( "targetuomname: " + target.Name() ); |
| | | // info( "cf.targetuomname: " + cf.astype( BaseConversionFactor ).TargetUnitOfMeasureName() ); |
| | | // info( "productid: " + guard( product.ID(), "" ) ); |
| | | // info( "cf.product: " + cf.astype( BaseConversionFactor ).ProductID() ); |
| | | result := BaseConversionFactor::CreateUpdate( source, target, factor, product, isEnable ) |
| | | } |
| | | |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateCurrencyRate ( |
| | | MacroPlan mp, |
| | | String currencyid, |
| | | Date start, |
| | | Real rate |
| | |
| | | [* |
| | | // Administrator Jul-19-2023 (created) |
| | | isfromdb := true; |
| | | currency := Currency_MP::FindCurrencyTypeIndex( currencyid ); |
| | | currency := Currency_MP::FindById( mp, currencyid ); |
| | | |
| | | //create new currency |
| | | result := CurrencyRate_MP::FindCurrencyRateTypeIndex( currencyid, start ); |
| | | result := CurrencyRate_MP::FindByIdAndStart( currency, currencyid, start ); |
| | | |
| | | if( isnull( result ) ) |
| | | { |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateCurrencyRateFromJson ( |
| | | MacroPlan mp, |
| | | JSON datarow |
| | | ) as CurrencyRate_MP |
| | | { |
| | |
| | | day := [Number]startstring.SubString( 8, 2 ); |
| | | |
| | | start := Date::Construct( years, month, day ); |
| | | result := CurrencyRate_MP::CreateCurrencyRate( currencyid, start, rate ); |
| | | result := CurrencyRate_MP::CreateCurrencyRate( mp, currencyid, start, rate ); |
| | | |
| | | return result; |
| | | *] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateFromMapping ( |
| | | const GlobalOTDTable globalOTDTable, |
| | | MacroPlan macroPlan |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // Administrator Oct-31-2023 (created) |
| | | updates := construct( CurrencyRate_MPs ); |
| | | traverse( globalOTDTable, Global_MappingCurrencyRate_MP, gcr, true ) |
| | | { |
| | | a := CurrencyRate_MP::CreateCurrencyRate( macroPlan, gcr.CurrencyID(), gcr.Start(), gcr.Rate() ); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( macroPlan, Currency_MP.CurrencyRate_MP, cr, true ); |
| | | obsoletes := origindataset.Difference( updates ); |
| | | // delete obsoleted |
| | | difflength := obsoletes.Size(); |
| | | for( j:=0; j<difflength; j++ ) |
| | | { |
| | | obsolete := obsoletes.Element( j ); |
| | | obsolete.Delete(); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod FindByIdAndStart ( |
| | | Currency_MP owner, |
| | | String id, |
| | | Date start |
| | | ) as CurrencyRate_MP |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-14-2023 (created) |
| | | |
| | | result := select( owner, CurrencyRate_MP, item, true, item.CurrencyID() = id and item.Start() = start ); |
| | | |
| | | return result; |
| | | *] |
| | | } |
| | |
| | | isfromdb := true; |
| | | |
| | | //create new currency |
| | | result := Currency_MP::FindCurrencyTypeIndex( id ); |
| | | result := Currency_MP::FindById( mp, id ); |
| | | |
| | | if( isnull( result ) ) |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateFromMapping ( |
| | | const GlobalOTDTable globalOTDTable, |
| | | MacroPlan macroPlan |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // Administrator Oct-31-2023 (created) |
| | | updates := construct( Currency_MPs ); |
| | | traverse( globalOTDTable, Global_MappingCurrency_MP, gc, true ) |
| | | { |
| | | a := Currency_MP::CreateCurrency( macroPlan, gc.ID(), gc.Name(), " ", gc.IsBase() ); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( macroPlan, Currency_MP, c, true ); |
| | | obsoletes := origindataset.Difference( updates ); |
| | | // delete obsoleted |
| | | difflength := obsoletes.Size(); |
| | | for( j:=0; j<difflength; j++ ) |
| | | { |
| | | obsolete := obsoletes.Element( j ); |
| | | obsolete.Delete(); |
| | | } |
| | | *] |
| | | } |
| | |
| | | macroPlan.InitialUnitAndStockingPoint(); |
| | | |
| | | if ( isUnitOfMeasure_MP ) { |
| | | Global_MappingUnitOfMeasure_MP::SynchronizeMacroPlanData( this, macroPlan ); |
| | | Global_MappingUnitOfMeasure_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser ); |
| | | } |
| | | |
| | | if ( isCustomOrder ) { |
| | | Global_MappingCustomOrder::SynchronizeMacroPlanData( this, macroPlan, executionUser ); |
| | | Global_MappingCustomOrder::SynchronizeMacroPlanData( this, macroPlan, businessTypes, organcodelist, executionUser ); |
| | | } |
| | | |
| | | if ( isForeacst ) { |
| | |
| | | } |
| | | |
| | | if ( isProductInLane ) { |
| | | Global_MappingProductInLane::SynchronizeMacroPlanData( this, macroPlan, executionUser ); |
| | | Global_MappingProductInLane::SynchronizeMacroPlanData( this, macroPlan, businessTypes, executionUser ); |
| | | } |
| | | |
| | | if ( isAIPISPIP ) { |
| | |
| | | } |
| | | |
| | | if ( isStockingPointCost ) { |
| | | Global_MappingStockingPointCost::SynchronizeMacroPlanData( this, macroPlan, executionUser ); |
| | | Global_MappingStockingPointCost::SynchronizeMacroPlanData( this, macroPlan, businessTypes, executionUser ); |
| | | } |
| | | |
| | | if ( isOperationCost ) { |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥å®é
åºåæ°æ®", |
| | | BrokerName := "忥å®é
åºåæ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | macroPlan.MappingActualPISPIPData( businessTypes, globalOTDTable, isKeyProduct, organcodelist ); |
| | | macroPlan.DoASyncMappingActualPISPIPData( businessTypes, globalOTDTable, isKeyProduct, organcodelist ); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥åä½è½¬æ¢æ°æ®", |
| | | BrokerName := "忥åä½è½¬æ¢æ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | macroPlan.MappingBaseConversionFactorData(globalOTDTable); |
| | | macroPlan.DoASyncMappingBaseConversionFactorData(globalOTDTable); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "åæ¥è´§å¸æ±çæ°æ®", |
| | | BrokerName := "åæ¥è´§å¸æ±çæ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | updates := construct( CurrencyRate_MPs ); |
| | | traverse( globalOTDTable, Global_MappingCurrencyRate_MP, gcr, true ) |
| | | { |
| | | a := CurrencyRate_MP::CreateCurrencyRate( gcr.CurrencyID(), gcr.Start(), gcr.Rate() ); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( macroPlan, Currency_MP.CurrencyRate_MP, cr, true ); |
| | | obsoletes := origindataset.Difference( updates ); |
| | | // delete obsoleted |
| | | difflength := obsoletes.Size(); |
| | | for( j:=0; j<difflength; j++ ) |
| | | { |
| | | obsolete := obsoletes.Element( j ); |
| | | obsolete.Delete(); |
| | | } |
| | | |
| | | CurrencyRate_MP::CreateFromMapping( globalOTDTable, macroPlan ); |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | | } onerror { |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "åæ¥è´§å¸æ°æ®", |
| | | BrokerName := "åæ¥è´§å¸æ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | updates := construct( Currency_MPs ); |
| | | traverse( globalOTDTable, Global_MappingCurrency_MP, gc, true ) |
| | | { |
| | | a := Currency_MP::CreateCurrency( macroPlan, gc.ID(), gc.Name(), " ", gc.IsBase() ); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( macroPlan, Currency_MP, c, true ); |
| | | obsoletes := origindataset.Difference( updates ); |
| | | // delete obsoleted |
| | | difflength := obsoletes.Size(); |
| | | for( j:=0; j<difflength; j++ ) |
| | | { |
| | | obsolete := obsoletes.Element( j ); |
| | | obsolete.Delete(); |
| | | } |
| | | |
| | | Currency_MP::CreateFromMapping( globalOTDTable, macroPlan ); |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | | } onerror { |
| | |
| | | StaticMethod SynchronizeMacroPlanData ( |
| | | GlobalOTDTable globalOTDTable, |
| | | MacroPlan macroPlan, |
| | | Strings businessTypes, |
| | | Strings organcodelist, |
| | | String executionUser |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "åæ¥è®¢åæ°æ®", |
| | | BrokerName := "åæ¥è®¢åæ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | Global_MappingCustomOrder::CreateCustomOrder( globalOTDTable, macroPlan ); |
| | | macroPlan.DoASyncMappingCustomerOrderData( businessTypes, globalOTDTable, organcodelist ); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥颿µæ°æ®", |
| | | BrokerName := "忥颿µæ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | macroPlan.MappingForecastData( businessTypes, globalOTDTable, organcodelist ); |
| | | macroPlan.DoASyncMappingForecastData( businessTypes, globalOTDTable, organcodelist ); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥å¨éåºåæ°æ®", |
| | | BrokerName := "忥å¨éåºåæ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | macroPlan.MappingExternalSupplyData( businessTypes, isKeyProduct ,globalOTDTable, organcodelist ); |
| | | macroPlan.DoASyncMappingExternalSupplyData( businessTypes, isKeyProduct, globalOTDTable, organcodelist ); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "åæ¥è½¦éæ°æ®", |
| | | BrokerName := "åæ¥è½¦éæ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | updates := construct( Lanes ); |
| | | traverse( globalOTDTable, Global_MappingLane, gl, true ) |
| | | { |
| | | id := gl.ID(); |
| | | unitid := gl.UnitID(); |
| | | name := gl.Name(); |
| | | userleadtime := gl.UserLeadTime(); |
| | | processingtime := Duration::Zero(); |
| | | |
| | | unitofmeasurename := "PCS"; |
| | | currencyid := "CNY"; |
| | | startdate := Date::Date( 1900, 1, 1 ); |
| | | enddate := Date::Date( 9999, 12, 31 ); |
| | | capacitytype := "Transport quantity"; |
| | | if( userleadtime.Length() = 0 ) |
| | | { |
| | | processingtime := Duration::Zero(); |
| | | } |
| | | else |
| | | { |
| | | processingtime := Duration::Hours( [Number]userleadtime ); |
| | | }; |
| | | |
| | | unit := Unit::FindUnitTypeIndex( unitid ); |
| | | if( isnull( unit)){ |
| | | unit :=macroPlan.Unit( relnew, |
| | | ID := unitid, |
| | | Name := unitid, |
| | | UnitOfMeasureName := unitofmeasurename, |
| | | CurrencyID := currencyid, |
| | | StartDate := startdate, |
| | | EndDate := enddate, |
| | | CapacityType := capacitytype ); |
| | | } |
| | | |
| | | a := Lane::CreateLane( unit, id, name, processingtime); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( macroPlan, Unit.Lane, l, true ); |
| | | obsoletes := origindataset.Difference( updates ); |
| | | // delete obsoleted |
| | | difflength := obsoletes.Size(); |
| | | for( j:=0; j<difflength; j++ ) |
| | | { |
| | | obsolete := obsoletes.Element( j ); |
| | | obsolete.Delete(); |
| | | } |
| | | |
| | | Lane::CreasteFromMapping( globalOTDTable, macroPlan ); |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | | } onerror { |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "åæ¥è½¦éè·¯çº¿æ°æ®", |
| | | BrokerName := "åæ¥è½¦éè·¯çº¿æ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | updates := construct( LaneLegs ); |
| | | traverse( globalOTDTable, Global_MappingLaneLeg, gll, true ) |
| | | { |
| | | processingtime := Duration::Zero(); |
| | | hasprocessingtime := true; |
| | | userleadtime := gll.UserLeadTime(); |
| | | if( userleadtime.Length() = 0 ) |
| | | { |
| | | hasprocessingtime := false; |
| | | processingtime := Duration::Zero(); |
| | | } |
| | | else |
| | | { |
| | | hasprocessingtime := true; |
| | | processingtime := Duration::Hours( [Number]userleadtime ); |
| | | }; |
| | | |
| | | lane := Lane::FindLaneTypeIndex( gll.LaneID() ); |
| | | a := LaneLeg::CreateLaneleg(lane, gll.LaneID(), gll.OriginStockingPointID(), gll.DestinationStockingPointID(), gll.Name(), hasprocessingtime, processingtime); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( macroPlan, Unit.Lane.LaneLeg, ll, true ); |
| | | obsoletes := origindataset.Difference( updates ); |
| | | // delete obsoleted |
| | | difflength := obsoletes.Size(); |
| | | for( j:=0; j<difflength; j++ ) |
| | | { |
| | | obsolete := obsoletes.Element( j ); |
| | | obsolete.Delete(); |
| | | } |
| | | |
| | | LaneLeg::CreateFromMapping( globalOTDTable, macroPlan ); |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | | } onerror { |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥工èºè·¯çº¿æ°æ®", |
| | | BrokerName := "忥工èºè·¯çº¿æ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | macroPlan.MappingOperationData( businessTypes ,globalOTDTable, organcodelist ); |
| | | macroPlan.DoASyncMappingOperationData( businessTypes, globalOTDTable, organcodelist ); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥BOMæ°æ®", |
| | | BrokerName := "忥BOMæ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | macroPlan.MappingOperationBOMData( businessTypes, isKeyProduct, createPurchaseSupplyMaterial, globalOTDTable, organcodelist ); |
| | | macroPlan.DoASyncMappingOperationBOMData( businessTypes, isKeyProduct, createPurchaseSupplyMaterial, globalOTDTable, organcodelist ); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | StaticMethod SynchronizeMacroPlanData ( |
| | | GlobalOTDTable globalOTDTable, |
| | | MacroPlan macroPlan, |
| | | Strings businessTypes, |
| | | String executionUser |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥è¿è¾è·¯çº¿äº§åæ°æ®", |
| | | BrokerName := "忥è¿è¾è·¯çº¿äº§åæ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | macroPlan.MappingProductInLaneData(globalOTDTable); |
| | | macroPlan.DoASyncMappingProductInLaneData( globalOTDTable, businessTypes ); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "åæ¥äº§åæ°æ®", |
| | | BrokerName := "åæ¥äº§åæ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | macroPlan.MappingProductData( businessTypes, globalOTDTable,isKeyProduct ); |
| | | macroPlan.DoASyncMappingProductData( businessTypes, globalOTDTable, isKeyProduct ); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥éå®é¨é¨æ°æ®", |
| | | BrokerName := "忥éå®é¨é¨æ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | macroPlan.MappingSalesSegmentData( businessTypes, globalOTDTable ); |
| | | macroPlan.DoASyncMappingSalesSegmentData( businessTypes, globalOTDTable ); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | StaticMethod SynchronizeMacroPlanData ( |
| | | GlobalOTDTable globalOTDTable, |
| | | MacroPlan macroPlan, |
| | | Strings businessTypes, |
| | | String executionUser |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥åºåææ¬æ°æ®", |
| | | BrokerName := "忥åºåææ¬æ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | macroPlan.MappingInventoryValueAndCostData(globalOTDTable); |
| | | macroPlan.DoASyncMappingInventoryValueAndCostData( globalOTDTable, businessTypes ); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥åºåç¹æ°æ®", |
| | | BrokerName := "忥åºåç¹æ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | updates := construct( StockingPoint_MPs ); |
| | | traverse( globalOTDTable, Global_MappingStockingPoint_MP, sp, true ) |
| | | { |
| | | a := StockingPoint_MP::CreateStockingpoint( macroPlan, sp.ID(), sp.UnitID(), sp.Name() ); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( macroPlan, StockingPoint_MP, sp, true ); |
| | | obsoletes := origindataset.Difference( updates ); |
| | | // delete obsoleted |
| | | difflength := obsoletes.Size(); |
| | | for( j:=0; j<difflength; j++ ) |
| | | { |
| | | obsolete := obsoletes.Element( j ); |
| | | obsolete.Delete(); |
| | | } |
| | | |
| | | StockingPoint_MP::CreateFromMapping( globalOTDTable, macroPlan ); |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | | } onerror { |
| | |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥å¶é ææ¬æ°æ®", |
| | | BrokerName := "忥å¶é ææ¬æ°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | |
| | | try { |
| | | macroPlan.MappingOperationCostData( globalOTDTable, businessTypes, organcodelist ); |
| | | macroPlan.DoASyncMappingOperationCostData( globalOTDTable, businessTypes, organcodelist ); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | |
| | | #parent: #root |
| | | StaticMethod SynchronizeMacroPlanData ( |
| | | GlobalOTDTable globalOTDTable, |
| | | MacroPlan macroPlan |
| | | MacroPlan macroPlan, |
| | | String executionUser |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew, |
| | | Name := "忥å使°æ®", |
| | | IsSuccess := true |
| | | BrokerName := "忥å使°æ®", |
| | | ExecutionStatus := "InOperation", |
| | | IsSuccess := true, |
| | | ExecuteUser := executionUser |
| | | ); |
| | | |
| | | try { |
| | | traverse ( globalOTDTable, Global_MappingUnitOfMeasure_MP, gmuommp ) { |
| | | unitOfMeasure_MP := select( macroPlan, UnitOfMeasure_MP, tempUOMMP, tempUOMMP.Name() = gmuommp.Name() ); |
| | | if ( isnull( unitOfMeasure_MP ) ) { |
| | | unitOfMeasure_MP := UnitOfMeasure_MP::Create( macroPlan, gmuommp.Name(), false, false ); |
| | | } |
| | | if ( gmuommp.IsDefault() ) { |
| | | unitOfMeasure_MP.SetAsDefault(); |
| | | } |
| | | } |
| | | macroPlan.DoASyncMappingUnitOfMeasureData(globalOTDTable); |
| | | |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | | } onerror { |
| | | global_BrokerExecuteLog.IsSuccess( false ); |
| | | global_BrokerExecuteLog.ErrorNo( e.ErrorNr() ); |
| | | global_BrokerExecuteLog.ErrorMessage( e.GeneralInformation() ); |
| | | global_BrokerExecuteLog.ErrorDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) ); |
| | | global_BrokerExecuteLog.ExecutionStatus( "Complete" ); |
| | | } |
| | | *] |
| | | } |
| | |
| | | //if( isnull( account ) ) { |
| | | // error( "account not found" ); |
| | | //} |
| | | result := InventoryValueAndCost::FindById( macroPlan, stockingPointId,productId,start,id ); |
| | | result := InventoryValueAndCost::FindById( macroPlan, stockingPointId, productId, start, id ); |
| | | if( not isnull( product) and not isnull( stockingPoint) and not isnull( account)){ |
| | | if( isnull( result ) ) { |
| | | result := InventoryValueAndCost::Create( id, product, stockingPoint, account, costDriver, start, cost, true ).astype( InventoryValueAndCost ); |
| | | } else if( result.ProductID() <> productId ) { |
| | | info( "cannot change product of inventory value and cost" ) |
| | | } |
| | | // else { |
| | | // result.Update( account, costDriver, start, account.DefaultTimeUnit(), account.DefaultLengthOfTime(), cost, true ); |
| | | // } |
| | | else { |
| | | result.Update( account, costDriver, start, account.DefaultTimeUnit(), account.DefaultLengthOfTime(), cost, true ); |
| | | } |
| | | } |
| | | |
| | | return result; |
| | |
| | | [* |
| | | // yypsybs Aug-16-2023 (created) |
| | | value := select( macroPlan, Product_MP.InventoryValueAndCost, item, true, item.ProductID()=productId and item.StockingPointID() = stockPointId and item.Start() = start ); |
| | | if( isnull( value ) ){ |
| | | value := select( macroPlan, Product_MP.InventoryValueAndCost, item, true, item.ID() = id ); |
| | | } |
| | | return value; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreasteFromMapping ( |
| | | const GlobalOTDTable globalOTDTable, |
| | | MacroPlan macroPlan |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // Administrator Oct-31-2023 (created) |
| | | updates := construct( Lanes ); |
| | | traverse( globalOTDTable, Global_MappingLane, gl, true ) |
| | | { |
| | | id := gl.ID(); |
| | | unitid := gl.UnitID(); |
| | | name := gl.Name(); |
| | | userleadtime := gl.UserLeadTime(); |
| | | processingtime := Duration::Zero(); |
| | | |
| | | unitofmeasurename := "PCS"; |
| | | currencyid := "CNY"; |
| | | startdate := Date::Date( 1900, 1, 1 ); |
| | | enddate := Date::Date( 9999, 12, 31 ); |
| | | capacitytype := "Transport quantity"; |
| | | if( userleadtime.Length() = 0 ) |
| | | { |
| | | processingtime := Duration::Zero(); |
| | | } |
| | | else |
| | | { |
| | | processingtime := Duration::Hours( [Number]userleadtime ); |
| | | }; |
| | | |
| | | unit := Unit::FindById( macroPlan, unitid ); |
| | | if( isnull( unit)){ |
| | | unit :=macroPlan.Unit( relnew, |
| | | ID := unitid, |
| | | Name := unitid, |
| | | UnitOfMeasureName := unitofmeasurename, |
| | | CurrencyID := currencyid, |
| | | StartDate := startdate, |
| | | EndDate := enddate, |
| | | CapacityType := capacitytype ); |
| | | } |
| | | |
| | | a := Lane::CreateLane( macroPlan, unit, id, name, processingtime); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( macroPlan, Unit.Lane, l, true ); |
| | | obsoletes := origindataset.Difference( updates ); |
| | | // delete obsoleted |
| | | difflength := obsoletes.Size(); |
| | | for( j:=0; j<difflength; j++ ) |
| | | { |
| | | obsolete := obsoletes.Element( j ); |
| | | obsolete.Delete(); |
| | | } |
| | | *] |
| | | } |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateLane ( |
| | | MacroPlan mp, |
| | | Unit unit, |
| | | String id, |
| | | String name, |
| | |
| | | isfromdb := true; |
| | | |
| | | //create new stockingpoint |
| | | result := Lane::FindLaneTypeIndex( id ); |
| | | result := Lane::FindById( mp, id ); |
| | | |
| | | if( isnull( result ) ) |
| | | { |
| | |
| | | EndDate := enddate ); |
| | | } |
| | | |
| | | result := Lane::CreateLane( unit, id, name, processingtime); |
| | | result := Lane::CreateLane( macroplan, unit, id, name, processingtime); |
| | | |
| | | return result; |
| | | *] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod FindById ( |
| | | MacroPlan mp, |
| | | String id |
| | | ) as Lane |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-14-2023 (created) |
| | | result := select( mp, Unit.Lane, lane, true, lane.ID() = id ); |
| | | |
| | | return result; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod FindByIdAndUnit ( |
| | | Unit unit, |
| | | String id |
| | | ) as Lane |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-14-2023 (created) |
| | | |
| | | result := select( unit, Lane, item, true, item.ID() = id ); |
| | | |
| | | return result; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateFromMapping ( |
| | | const GlobalOTDTable globalOTDTable, |
| | | MacroPlan macroPlan |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // Administrator Oct-31-2023 (created) |
| | | updates := construct( LaneLegs ); |
| | | traverse( globalOTDTable, Global_MappingLaneLeg, gll, true ) |
| | | { |
| | | processingtime := Duration::Zero(); |
| | | hasprocessingtime := true; |
| | | userleadtime := gll.UserLeadTime(); |
| | | if( userleadtime.Length() = 0 ) |
| | | { |
| | | hasprocessingtime := false; |
| | | processingtime := Duration::Zero(); |
| | | } |
| | | else |
| | | { |
| | | hasprocessingtime := true; |
| | | processingtime := Duration::Hours( [Number]userleadtime ); |
| | | }; |
| | | |
| | | lane := Lane::FindById( macroPlan, gll.LaneID() ); |
| | | a := LaneLeg::CreateLaneleg( macroPlan, lane, gll.LaneID(), gll.OriginStockingPointID(), gll.DestinationStockingPointID(), gll.Name(), hasprocessingtime, processingtime); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( macroPlan, Unit.Lane.LaneLeg, ll, true ); |
| | | obsoletes := origindataset.Difference( updates ); |
| | | // delete obsoleted |
| | | difflength := obsoletes.Size(); |
| | | for( j:=0; j<difflength; j++ ) |
| | | { |
| | | obsolete := obsoletes.Element( j ); |
| | | obsolete.Delete(); |
| | | } |
| | | *] |
| | | } |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateLaneLegFromJson ( |
| | | MacroPlan mp, |
| | | JSON datarow |
| | | ) as LaneLeg |
| | | { |
| | |
| | | |
| | | lane := Lane::FindLaneTypeIndex( laneid ); |
| | | |
| | | result := LaneLeg::CreateLaneleg(lane, laneid, originstockingpointid, destinationstockingpointid, name, hasprocessingtime, processingtime); |
| | | result := LaneLeg::CreateLaneleg( mp, lane, laneid, originstockingpointid, destinationstockingpointid, name, hasprocessingtime, processingtime); |
| | | |
| | | return result; |
| | | *] |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateLaneleg ( |
| | | MacroPlan mp, |
| | | Lane lane, |
| | | String laneid, |
| | | String originstockingpointid, |
| | |
| | | isfromdb := true; |
| | | |
| | | //create new stockingpoint |
| | | originstockingpoint := StockingPoint_MP::FindStockingPointTypeIndex( originstockingpointid ); |
| | | originstockingpoint := StockingPoint_MP::FindById( mp, originstockingpointid ); |
| | | lane.AddStockingPoint( originstockingpoint, true, isfromdb ); |
| | | Transaction::Transaction().Propagate(); |
| | | |
| | | destinationstockingpoint := StockingPoint_MP::FindStockingPointTypeIndex( destinationstockingpointid ); |
| | | destinationstockingpoint := StockingPoint_MP::FindById( mp, destinationstockingpointid ); |
| | | lane.AddStockingPoint( destinationstockingpoint, false, isfromdb ); |
| | | |
| | | Transaction::Transaction().Propagate(); |
| | | |
| | | result := LaneLeg::FindLaneLegTypeIndex( laneid, originstockingpointid, destinationstockingpointid ); |
| | | result := LaneLeg::FindByIdAndLane( lane, originstockingpointid, destinationstockingpointid ); |
| | | |
| | | if( isnull( result ) ) |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod FindByIdAndLane ( |
| | | Lane lane, |
| | | String originstockingpointid, |
| | | String destinationstockingpointid |
| | | ) as LaneLeg |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-14-2023 (created) |
| | | |
| | | result := select( lane, LaneLeg, item, true, item.OriginStockingPointID() = originstockingpointid and item.DestinationStockingPointID() = destinationstockingpointid ); |
| | | |
| | | return result; |
| | | *] |
| | | } |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method ApiCurencyRatesData ( |
| | | MacroPlan mp, |
| | | JSON data |
| | | ) |
| | | { |
| | |
| | | for( i:=0; i<data_length; i++ ) |
| | | { |
| | | datarow := data.Get( i ); |
| | | a := CurrencyRate_MP::CreateCurrencyRateFromJson( datarow ); |
| | | a := CurrencyRate_MP::CreateCurrencyRateFromJson( mp, datarow ); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( this, Currency_MP.CurrencyRate_MP, cr, true ); |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method ApiLaneLegsData ( |
| | | MacroPlan mp, |
| | | JSON data |
| | | ) |
| | | { |
| | |
| | | for( i:=0; i<data_length; i++ ) |
| | | { |
| | | datarow := data.Get( i ); |
| | | a := LaneLeg::CreateLaneLegFromJson( datarow ); |
| | | a := LaneLeg::CreateLaneLegFromJson( mp, datarow ); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( this, Unit.Lane.LaneLeg, ll, true ); |
| | |
| | | ( organcodelist.Find( item.StockingPointID().SubString( 0, 3 ) ) >= 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() ); |
| | | //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.StockingPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) ); |
| | | |
| | | totalcount := listToDeal.Size(); |
| | |
| | | [* |
| | | // 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() ); |
| | | //queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() ); |
| | | |
| | | listtodeal := construct( Global_MappingInventorySupplys, constcontent ); |
| | | if ( businessTypes.Size() > 0 ) { |
| | |
| | | info( "Prepare to do sync" ) |
| | | info( "Get organ code list" ) |
| | | businessTypeName := businessType.BusinessTypeName().Tokenize( "," ); |
| | | macroPlan.BusinessType( businessType.BusinessTypeName() ); |
| | | |
| | | organcodelist := selectvalues( businessType, OrganCode, organ, true, organ.OrganCodeName() ); |
| | | |
| | | if( organcodelist.Size() = 0 ){ |
| | |
| | | macroPlan.DoASyncMappingUnitData( businessTypeName ,globalOTDTable, organcodelist); |
| | | |
| | | // åºåç¹-3 |
| | | info( "Sales Segment Finished, Start Get StockingPoint From Api" ) |
| | | parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "StockingPoint" ); |
| | | postrequestbody := parameter.PostRequestBody(); |
| | | address := parameter.Address(); |
| | | url := parameter.AttributeValue(); |
| | | port := [Number]parameter.Port(); |
| | | data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody ); |
| | | macroPlan.ApiStockingPointData( data ); |
| | | info( "Sales Segment Finished, Start Get StockingPoint From Mapping" ) |
| | | StockingPoint_MP::CreateFromMapping( globalOTDTable, macroPlan ); |
| | | //parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "StockingPoint" ); |
| | | //postrequestbody := parameter.PostRequestBody(); |
| | | //address := parameter.Address(); |
| | | //url := parameter.AttributeValue(); |
| | | //port := [Number]parameter.Port(); |
| | | //data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody ); |
| | | //macroPlan.ApiStockingPointData( data ); |
| | | |
| | | // è´§å¸ä¿¡æ¯-4 |
| | | info( "Get StockingPoint From Api Finished, Start Get CurrencyInfo From Api" ) |
| | | parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "CurrencyInfo" ); |
| | | postrequestbody := parameter.PostRequestBody(); |
| | | address := parameter.Address(); |
| | | url := parameter.AttributeValue(); |
| | | port := [Number]parameter.Port(); |
| | | data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody ); |
| | | macroPlan.ApiCurenciesData( data ); |
| | | info( "Get StockingPoint From Api Finished, Start Get CurrencyInfo From Mapping" ) |
| | | Currency_MP::CreateFromMapping( globalOTDTable, macroPlan ); |
| | | |
| | | //è´§å¸æ±çä¿¡æ¯-5 |
| | | info( "Get CurrencyInfo From Api Finished, Start Get CurrencyRates From Api" ) |
| | | parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "CurrencyRates" ); |
| | | postrequestbody := parameter.PostRequestBody(); |
| | | address := parameter.Address(); |
| | | url := parameter.AttributeValue(); |
| | | port := [Number]parameter.Port(); |
| | | data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody ); |
| | | macroPlan.ApiCurencyRatesData( data ); |
| | | info( "Get CurrencyInfo From Api Finished, Start Get CurrencyRates From Mapping" ) |
| | | CurrencyRate_MP::CreateFromMapping( globalOTDTable, macroPlan ); |
| | | |
| | | // 产åç©æ-6 |
| | | //info( "Get CurrencyRates From Api Finished, Start Product Data Broker" ) |
| | |
| | | macroPlan.DoASyncMappingOperationBOMData( businessTypeName, isKeyProduct, createPurchaseSupplyMaterial,globalOTDTable, organcodelist ); |
| | | |
| | | //车éä¿¡æ¯-10 |
| | | info( "BOM Finished, Start Get Lanes From Api" ); |
| | | parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "Lanes" ); |
| | | postrequestbody := parameter.PostRequestBody(); |
| | | address := parameter.Address(); |
| | | url := parameter.AttributeValue(); |
| | | port := [Number]parameter.Port(); |
| | | data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody ); |
| | | macroPlan.ApiLanesData( data ); |
| | | info( "BOM Finished, Start Get Lanes From Mapping" ); |
| | | Lane::CreasteFromMapping( globalOTDTable, macroPlan ); |
| | | |
| | | //车éè¿è¾æ®µ-11 |
| | | info( "Get Lanes From Api Finished, Start Get LaneLegs From Api" ); |
| | | parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "LaneLegs" ); |
| | | postrequestbody := parameter.PostRequestBody(); |
| | | address := parameter.Address(); |
| | | url := parameter.AttributeValue(); |
| | | port := [Number]parameter.Port(); |
| | | data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody ); |
| | | macroPlan.ApiLaneLegsData( data ); |
| | | info( "Get Lanes From Api Finished, Start Get LaneLegs From Mapping" ); |
| | | LaneLeg::CreateFromMapping( globalOTDTable, macroPlan ); |
| | | |
| | | // ä¾åºç½ç»ï¼è½¦éï¼-12 |
| | | //info( "Get Lanelegs From Api Finished, Start ProductInLane Data Broker" ); |
| | |
| | | url := "/otdService/https/GetCurrencyRatesInfo"; |
| | | port := 443; |
| | | data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody ); |
| | | macroPlan.ApiCurencyRatesData( data ); |
| | | macroPlan.ApiCurencyRatesData( macroPlan, data ); |
| | | |
| | | // 产åç©æ-6 |
| | | //info( "Get CurrencyRates From Api Finished, Start Product Data Broker" ) |
| | |
| | | url := "/otdService/https/GetLaneLegsInfo"; |
| | | port := 443; |
| | | data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody ); |
| | | macroPlan.ApiLaneLegsData( data ); |
| | | macroPlan.ApiLaneLegsData( macroPlan, data ); |
| | | |
| | | // ä¾åºç½ç»ï¼è½¦éï¼-12 |
| | | //info( "Get Lanelegs From Api Finished, Start ProductInLane Data Broker" ); |
| | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | score := score + PriorityResult::CalculateScore( remindFormula,customerOrder,businessType,macroPlan,score,globalOTDTable); |
| | | }else if( remindFormula.StartsWith( "*" ) ){ |
| | | }else if( remindFormula.StartsWith( "x" ) ){ |
| | | remindFormula := remindFormula.SubString( 1,remindFormula.Length()-1); |
| | | score := PriorityResult::GetDetailsValue( customerOrder,remindFormula,macroPlan,globalOTDTable); |
| | | score := lastScore * score; |
| | |
| | | |
| | | // Get product&line |
| | | product := Product_MP::FindById( owner, productid ); |
| | | line := Lane::FindLaneTypeIndex( lineid ); |
| | | line := Lane::FindById( owner, lineid ); |
| | | |
| | | if( not isnull( product) and not isnull( line)){ |
| | | productinline := ProductInLane::FindProductInLaneTypeIndex( lineid, productid ); |
| | | productinline := ProductInLane::FindById( owner, productid, lineid ); |
| | | |
| | | if( isnull( productinline ) ){ |
| | | ProductInLane::Create( product, line, isexcluded, isfromdb ); |
| | | }else{ |
| | | productinline.Update( productid, lineid, isexcluded, isfromdb ); |
| | | productinline.Update( lineid, productid, isexcluded, isfromdb ); |
| | | } |
| | | } |
| | | *] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod FindById ( |
| | | MacroPlan mp, |
| | | String id, |
| | | String laneid |
| | | ) as ProductInLane |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yy 2023-11-01 |
| | | result := select( mp, Product_MP.ProductInLane, pil, true, pil.ProductID() = id and pil.LaneID() = laneid ); |
| | | |
| | | return result; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateFromMapping ( |
| | | const GlobalOTDTable globalOTDTable, |
| | | MacroPlan macroPlan |
| | | ) |
| | | { |
| | | Description: 'ä»mapping表å建åºåç¹' |
| | | TextBody: |
| | | [* |
| | | // Administrator Oct-31-2023 (created) |
| | | updates := construct( StockingPoint_MPs ); |
| | | traverse( globalOTDTable, Global_MappingStockingPoint_MP, sp, true ) |
| | | { |
| | | a := StockingPoint_MP::CreateStockingpoint( macroPlan, sp.ID(), sp.UnitID(), sp.Name() ); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( macroPlan, StockingPoint_MP, sp, true ); |
| | | obsoletes := origindataset.Difference( updates ); |
| | | // delete obsoleted |
| | | difflength := obsoletes.Size(); |
| | | for( j:=0; j<difflength; j++ ) |
| | | { |
| | | obsolete := obsoletes.Element( j ); |
| | | obsolete.Delete(); |
| | | } |
| | | *] |
| | | } |
| | |
| | | isfromdb := true; |
| | | |
| | | //create new stockingpoint |
| | | result := StockingPoint_MP::FindStockingPointTypeIndex( id ); |
| | | result := StockingPoint_MP::FindById( mp, id ); |
| | | |
| | | if( isnull( result ) ) |
| | | { |
| | |
| | | Taborder: 0 |
| | | ] |
| | | } |
| | | Component DataHolderInterfaceTest |
| | | { |
| | | #keys: '[414502.0.443241895]' |
| | | BaseType: 'WebDataHolder' |
| | | Databinding: 'Scenario' |
| | | Properties: |
| | | [ |
| | | Taborder: 7 |
| | | ] |
| | | } |
| | | ] |
| | | Properties: |
| | | [ |