Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lhj
已重命名1个文件
已添加30个文件
已修改5个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #root |
| | | KnowledgeBase Knowledge_MP #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute CustomerOrderID |
| | | { |
| | | #keys: '3[414382.0.554303146][414382.0.554303145][414382.0.554303147]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute ForecastID |
| | | { |
| | | #keys: '3[414382.0.554303156][414382.0.554303155][414382.0.554303157]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod RefreshData ( |
| | | MacroPlan owner, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // NBoTk Sep-26-2023 (created) |
| | | |
| | | // è·åå·²ç»åå¨ customerOrderID åforecastID |
| | | customerOrderIDs := selectvalues( owner,CustomerAndForecastOrder,c, |
| | | c.CustomerOrderID() <> '', |
| | | c.CustomerID() |
| | | ); |
| | | |
| | | forecastIDs := selectvalues( owner,CustomerAndForecastOrder,c, |
| | | c.ForecastID() <> '', |
| | | c.ForecastID() |
| | | ); |
| | | |
| | | |
| | | // 仿°æ®æ¹ Global_MappingCustomerOrder Global_MappingForecast ä¸è·åæ°çè®¢åæ°æ® |
| | | |
| | | traverse( globalOTDTable,Global_MappingCustomOrder,cus) |
| | | { |
| | | if(customerOrderIDs.Find( cus.ID()) = -1 ) |
| | | { |
| | | owner.CustomerAndForecastOrder(relnew,OrderID := cus.OrderID(),ProductID := cus.ProductID(),BusinessType := cus.BusinessType(),Customer := cus.Customer(),CustomerID := cus.CustomerID(), |
| | | Quantity := cus.Quantity(),UnitOfMeasureName := cus.UnitOfMeasureName(),DemandDate := cus.OrderDate() |
| | | ); |
| | | } |
| | | } |
| | | |
| | | traverse( globalOTDTable,Global_MappingForecast,forecast) |
| | | { |
| | | if(forecastIDs.Find( forecast.ID()) = -1 ) |
| | | { |
| | | owner.CustomerAndForecastOrder(relnew,ProductID := forecast.ProductID(),BusinessType := forecast.BusinessType(), |
| | | Quantity := forecast.Quantity(),UnitOfMeasureName := forecast.UnitOfMeasureName(),DemandDate := forecast.EndDate() |
| | | ); |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute BusinessType |
| | | { |
| | | #keys: '3[414382.0.554303217][414382.0.554303216][414382.0.554303218]' |
| | | Description: 'äºä¸é¨' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute CustomerPolicy |
| | | { |
| | | #keys: '3[414382.0.554014841][414382.0.554014840][414382.0.554014842]' |
| | | Description: '客æ·çç¥' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute IsAvailable |
| | | { |
| | | #keys: '3[414382.0.554303237][414382.0.554303236][414382.0.554303238]' |
| | | Description: 'è®¢åæ¯å¦åä¸è®¡å' |
| | | ValueType: Boolean |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute OrderTime |
| | | { |
| | | #keys: '3[414382.0.554303277][414382.0.554303276][414382.0.554303278]' |
| | | Description: '订åä¸åæ¶é´' |
| | | ValueType: Date |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute OrderType |
| | | { |
| | | #keys: '3[414382.0.554303227][414382.0.554303226][414382.0.554303228]' |
| | | Description: '订åç±»å' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute ProductGrade |
| | | { |
| | | #keys: '3[414382.0.554303247][414382.0.554303246][414382.0.554303248]' |
| | | Description: '产åç级' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute SegmentPriority |
| | | { |
| | | #keys: '3[414382.0.554303257][414382.0.554303256][414382.0.554303258]' |
| | | Description: 'ç»åå¸åºä¼å
级' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute SheetProfitability |
| | | { |
| | | #keys: '3[414382.0.554303267][414382.0.554303266][414382.0.554303268]' |
| | | Description: 'å¤§å¼ ç婿°´å¹³' |
| | | ValueType: String |
| | | } |
| | |
| | | salesSegmentName := salesSegmentNameList.Concatenate( ",") |
| | | |
| | | schemeDate := Date::Today(); |
| | | |
| | | filllingCapacityOrderScheme := owner.FilllingCapacityOrderScheme(relnew,SchemeName := schemeName,SchemeDate := schemeDate,BusinessType := businessType,Customer := customer,CustomerID := customerID, |
| | | owner.FilllingCapacityOrderScheme(relnew,SchemeName := schemeName,SchemeDate := schemeDate,BusinessType := businessType,Customer := customer,CustomerID := customerID, |
| | | SalesSegmentName := salesSegmentName); |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute ReflectionAttribute |
| | | { |
| | | #keys: '3[414382.0.554303396][414382.0.554303395][414382.0.554303397]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute ReflectionType |
| | | { |
| | | #keys: '3[414382.0.554014806][414382.0.554014805][414382.0.554014807]' |
| | | ValueType: String |
| | | } |
| | |
| | | isBusinessType := true; |
| | | } |
| | | |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 5, |
| | | if( priorityFactor.Name() = "å¤§å¼ ç婿°´å¹³" ) |
| | | { |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 5, |
| | | IsRange := false,GradingName := "大ç",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 3, |
| | | IsRange := false,GradingName := "å°ç",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 0, |
| | | IsRange := false,GradingName := "æå¹³",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := -3, |
| | | IsRange := false,GradingName := "å°äº",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := -5, |
| | | IsRange := false,GradingName := "大äº",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 3, |
| | | IsRange := false,GradingName := "å°ç",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 0, |
| | | IsRange := false,GradingName := "æå¹³",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := -3, |
| | | IsRange := false,GradingName := "å°äº",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := -5, |
| | | IsRange := false,GradingName := "大äº",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | } |
| | | |
| | | if( priorityFactor.Name() = "客æ·çç¥" ) |
| | | { |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 5, |
| | | IsRange := false,GradingName := "81%â¤Xâ¤100%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 4, |
| | | IsRange := false,GradingName := "61%â¤Xâ¤80%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 3, |
| | | IsRange := false,GradingName := "41%â¤Xâ¤60%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 2, |
| | | IsRange := false,GradingName := "21%â¤Xâ¤40%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 1, |
| | | IsRange := false,GradingName := "1%â¤Xâ¤20%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | } |
| | | |
| | | if( priorityFactor.Name() = "客æ·ç级" ) |
| | | { |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 5, |
| | | IsRange := false,GradingName := "81%â¤Xâ¤100%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 4, |
| | | IsRange := false,GradingName := "61%â¤Xâ¤80%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 3, |
| | | IsRange := false,GradingName := "41%â¤Xâ¤60%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 2, |
| | | IsRange := false,GradingName := "21%â¤Xâ¤40%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 1, |
| | | IsRange := false,GradingName := "1%â¤Xâ¤20%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name()); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute CustomerOrderID |
| | | { |
| | | #keys: '3[414382.0.554015006][414382.0.554015005][414382.0.554015007]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CalculateBracketScore ( |
| | | String calcStr, |
| | | CustomerOrder customerOrder, |
| | | String businessType, |
| | | MacroPlan macroPlan, |
| | | GlobalOTDTable globalOTDTable |
| | | ) as Real |
| | | { |
| | | Description: '计ç®å
¬å¼ä¸æ¬å·å
çæ°æ®' |
| | | TextBody: |
| | | [* |
| | | // NBoTk Sep-26-2023 (created) |
| | | |
| | | |
| | | return PriorityResult::CalculateScore( calcStr,customerOrder,businessType,macroPlan,0.0,globalOTDTable); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CalculateScore ( |
| | | String formula, |
| | | CustomerOrder customerOrder, |
| | | String businessType, |
| | | MacroPlan macroPlan, |
| | | Real lastScore, |
| | | GlobalOTDTable globalOTDTable |
| | | ) as Real |
| | | { |
| | | TextBody: |
| | | [* |
| | | // NBoTk Sep-26-2023 (created) |
| | | |
| | | score := 0.0; |
| | | remindFormula := formula; |
| | | |
| | | // éåä¼å
级å åé
ç½® |
| | | |
| | | if( not remindFormula = '' ) |
| | | { |
| | | // ä»èµ·å§ä½ç½®å¼å§å¹é
|
| | | if(remindFormula.StartsWith( "+" )) |
| | | { |
| | | remindFormula := remindFormula.SubString( 1,remindFormula.Length()); |
| | | score := PriorityResult::GetDetailsValue( customerOrder,remindFormula,macroPlan,globalOTDTable); |
| | | score := lastScore + score; |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityResult::CalculateScore( remindFormula,customerOrder,businessType,macroPlan,score,globalOTDTable); |
| | | } |
| | | else if( remindFormula.StartsWith( "-" )) |
| | | { |
| | | remindFormula := remindFormula.SubString( 1,remindFormula.Length()); |
| | | score := PriorityResult::GetDetailsValue( customerOrder,remindFormula,macroPlan,globalOTDTable); |
| | | score := lastScore - score; |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityResult::CalculateScore( remindFormula,customerOrder,businessType,macroPlan,score,globalOTDTable); |
| | | } |
| | | else if( remindFormula.StartsWith( "*" ) ) |
| | | { |
| | | remindFormula := remindFormula.SubString( 1,remindFormula.Length()); |
| | | score := PriorityResult::GetDetailsValue( customerOrder,remindFormula,macroPlan,globalOTDTable); |
| | | score := lastScore * score; |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityResult::CalculateScore( remindFormula,customerOrder,businessType,macroPlan,score,globalOTDTable); |
| | | } |
| | | else if( remindFormula.StartsWith( "/" ) ) |
| | | { |
| | | remindFormula := remindFormula.SubString( 1,remindFormula.Length()); |
| | | score := PriorityResult::GetDetailsValue( customerOrder,remindFormula,macroPlan,globalOTDTable); |
| | | score := lastScore / score; |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityResult::CalculateScore( remindFormula,customerOrder,businessType,macroPlan,score,globalOTDTable); |
| | | } |
| | | else if( remindFormula.StartsWith( "(" ) ) |
| | | { |
| | | // æ¾å°ç¬¬ä¸ä¸ªç»æç ) |
| | | // è®¡ç®æ¬å·ä¸çå
容 |
| | | rightBracket := remindFormula.FindString( ")",0); |
| | | calcStr := remindFormula.SubString( 1,rightBracket); |
| | | PriorityResult::CalculateBracketScore(calcStr,customerOrder,businessType,macroPlan,globalOTDTable); |
| | | |
| | | // æªå ) åçå符继ç»è¿è¡è®¡ç® |
| | | remindFormula := remindFormula.SubString( rightBracket,remindFormula.Length()); |
| | | } |
| | | else |
| | | { |
| | | // 䏿¯ç¬¦å· ç´æ¥è·å计ç®åçæ°å¼ |
| | | score := PriorityResult::GetDetailsValue( customerOrder,remindFormula,macroPlan,globalOTDTable); |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityResult::CalculateScore( remindFormula,customerOrder,businessType,macroPlan,score,globalOTDTable); |
| | | } |
| | | } |
| | | |
| | | // 没æå¹é
å
¬å¼è®¡ç®å®æ |
| | | return lastScore; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod GetDetailsValue ( |
| | | CustomerOrder customerOrder, |
| | | String formula, |
| | | MacroPlan macroPlan, |
| | | GlobalOTDTable globalOTDTable |
| | | ) as Real |
| | | { |
| | | TextBody: |
| | | [* |
| | | // NBoTk Sep-26-2023 (created) |
| | | |
| | | value := 0.0; |
| | | |
| | | priorityFactor := null( PriorityFactor); |
| | | |
| | | traverse( macroPlan,PriorityFactor,p) |
| | | { |
| | | if( formula.StartsWith( p.Name()) ) |
| | | { |
| | | priorityFactor := p; |
| | | } |
| | | } |
| | | |
| | | if( "客æ·çç¥" = priorityFactor.Name()) |
| | | { |
| | | obj := selectobject( priorityFactor,PriorityFactorDetails,p , p.PriorityFactorName() = "客æ·çç¥" and p.GradingName() = customerOrder.CustomerPolicy()); |
| | | value := priorityFactor.Coefficient() * obj.GradeTarget(); |
| | | } |
| | | |
| | | if( "å¤§å¼ ç婿°´å¹³" = priorityFactor.Name()) |
| | | { |
| | | obj := selectobject( priorityFactor,PriorityFactorDetails,p , p.PriorityFactorName() = "å¤§å¼ ç婿°´å¹³" and p.GradingName() = customerOrder.SheetProfitability()); |
| | | value := priorityFactor.Coefficient() * obj.GradeTarget(); |
| | | } |
| | | |
| | | if( "DOI" = priorityFactor.Name()) |
| | | { |
| | | // DOIæ°æ® |
| | | obj := selectobject( globalOTDTable,Global_MappingDOI_DSI,doi,doi.ProductID() = customerOrder.ProductID()) |
| | | value := priorityFactor.Coefficient() * [Real]obj.DOI(); |
| | | } |
| | | |
| | | if( "DSI" = priorityFactor.Name()) |
| | | { |
| | | // DOIæ°æ® |
| | | obj := selectobject( globalOTDTable,Global_MappingDOI_DSI,doi,doi.ProductID() = customerOrder.ProductID()) |
| | | value := priorityFactor.Coefficient() * [Real]obj.DSI(); |
| | | } |
| | | |
| | | if( "ç»åå¸åºç级" = priorityFactor.Name()) |
| | | { |
| | | obj := selectobject( priorityFactor,PriorityFactorDetails,p , p.PriorityFactorName() = "ç»åå¸åºç级" and p.GradingName() = customerOrder.SegmentPriority()); |
| | | value := priorityFactor.Coefficient() * obj.GradeTarget(); |
| | | } |
| | | |
| | | if( "éæ±ç±»å" = priorityFactor.Name()) |
| | | { |
| | | // æé¢æµ æ 颿µ çº¯é¢æµ |
| | | obj := selectobject( priorityFactor,PriorityFactorDetails,p,p.GradingName() = customerOrder.OrderType()); |
| | | value := priorityFactor.Coefficient() * obj.GradeTarget(); |
| | | } |
| | | |
| | | if( "客æ·ç级" = priorityFactor.Name()) |
| | | { |
| | | // éè¿æ°æ®æ¹è®¡ç®å®¢æ·ç级 |
| | | obj := selectobject( globalOTDTable,Global_MappingCustomerGrade,doi,doi.BusinessType() = customerOrder.BusinessType() and doi.Customer() = customerOrder.CustomerName()) |
| | | value := priorityFactor.Coefficient() * [Real]obj.CustomerGrade(); |
| | | } |
| | | |
| | | if( "订åä¸åæ¶é´" = priorityFactor.Name()) |
| | | { |
| | | // ä¸åæ¶é´ |
| | | orderTime := customerOrder.OrderTime(); |
| | | days := orderTime.TotalInDays() - customerOrder.EndDate().TotalInDays(); |
| | | obj := selectobject( priorityFactor,PriorityFactorDetails,p , p.PriorityFactorName() = "订åä¸åæ¶é´" and days >= [Number]p.GradingName()); |
| | | value := priorityFactor.Coefficient() * obj.GradeTarget(); |
| | | } |
| | | |
| | | return value; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod GetRemindFormula ( |
| | | String formula, |
| | | MacroPlan macroPlan |
| | | ) as String |
| | | { |
| | | TextBody: |
| | | [* |
| | | // NBoTk Sep-26-2023 (created) |
| | | |
| | | str := ""; |
| | | |
| | | traverse( macroPlan,PriorityFactor,p) |
| | | { |
| | | if( formula.StartsWith( p.Name()) ) |
| | | { |
| | | str := formula.SubString( 0 + p.Name().Length(),formula.Length()); |
| | | } |
| | | } |
| | | |
| | | return str; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CalculatePriorityResult ( |
| | | String priorityPolicyName, |
| | | MacroPlan macroPlan, |
| | | GlobalOTDTable globalOTDTable |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // NBoTk Sep-26-2023 (created) |
| | | |
| | | // 计ç®å®¢æ·è®¢åçä¼å
级å¾å åå¡«æéæ°æ® çææ°çPriorityæç»æ°æ® |
| | | |
| | | traverse( macroPlan,SalesDemand.astype( CustomerOrder ),e) |
| | | { |
| | | // äºä¸é¨ä¿¡æ¯ |
| | | businessType := e.BusinessType(); |
| | | |
| | | // è·å对åºäºä¸é¨è®¡ç®å
¬å¼ |
| | | priorityPolicys := selectobject( macroPlan,PriorityPolicy,p,p.BusinessType() = businessType and p.Name() = priorityPolicyName); |
| | | formula := priorityPolicys.Formula(); |
| | | |
| | | // éå½å¤ç计ç®å
¬å¼ è·åå½å订åçå¾å |
| | | value := PriorityResult::CalculateScore( formula,e,businessType,macroPlan,0.0,globalOTDTable); |
| | | |
| | | // çæä¼å
级å åè·åç»æ |
| | | priorityResult := macroPlan.PriorityResult(relnew,CustomerOrderID := e.ID(),BusinessType := businessType,Customer := e.CustomerName(),CustomerID := e.CustomerID(), |
| | | DemandDate := e.EndDate(),ProductID := e.ProductID(),Quantity := e.Quantity(),SalesSegmentName := e.SalesSegmentName(), |
| | | StockingPointID := e.StockingPointID(),UnitOfMeasureName := e.UnitOfMeasureName() |
| | | ); |
| | | |
| | | // 夿æ¯éå¢ è¿æ¯äºä¸é¨ |
| | | if( businessType.FindString( "éå¢",0 ) <> -1) |
| | | { |
| | | priorityResult.PriorityResultGroupDetail( relnew,BusinessType := businessType,Customer := e.CustomerName(),CustomerID := e.CustomerID(), |
| | | DemandDate := e.EndDate(),PriorityPolicyName := priorityPolicyName,PriorityResultScore := value, |
| | | Quantity := e.Quantity(),SalesSegmentName := e.SalesSegmentName(),StockingPointID := e.StockingPointID(), |
| | | UnitOfMeasureName := e.UnitOfMeasureName(),PriorityTotalScore := value |
| | | ); |
| | | } |
| | | else |
| | | { |
| | | priorityResult.PriorityResultBusinessTypeDetail( relnew,BusinessType := businessType,Customer := e.CustomerName(),CustomerID := e.CustomerID(), |
| | | DemandDate := e.EndDate(),PriorityPolicyName := priorityPolicyName,PriorityResultScore := value, |
| | | Quantity := e.Quantity(),SalesSegmentName := e.SalesSegmentName(),StockingPointID := e.StockingPointID(), |
| | | UnitOfMeasureName := e.UnitOfMeasureName(),PriorityTotalScore := value |
| | | ); |
| | | } |
| | | } |
| | | |
| | | // ä¼å
级å åå¤çå®æå æåºåå¡«æ°æ® |
| | | resultList := selectsortedset( macroPlan,PriorityResult,result, |
| | | true, |
| | | result.PriorityResultScore() |
| | | ) |
| | | |
| | | priorityValue := 1; |
| | | traverse( resultList,Elements,e) |
| | | { |
| | | obj := selectobject( macroPlan,SalesDemand.astype( CustomerOrder ),order, |
| | | order.ID() = e.CustomerOrderID() |
| | | ); |
| | | obj.PriorityName([String]priorityValue); |
| | | |
| | | // å建ä¼å
çº§æ°æ® |
| | | macroPlan.Priority(relnew,Weight := priorityValue,Name := [String]priorityValue); |
| | | priorityValue := priorityValue + 1; |
| | | } |
| | | *] |
| | | } |
| | |
| | | businessType := DataHolderBusinessType.Data().BusinessTypeName(); |
| | | DataHolderBusinessType.Data().Commit(); |
| | | |
| | | // PriorityFactor |
| | | |
| | | PriorityFactor::InitData( MacroPlan,businessType); |
| | | |
| | | this.Close(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | Component pnlActions |
| | | { |
| | | #keys: '[414382.0.563131222]' |
| | | BaseType: 'WebPanel' |
| | | Children: |
| | | [ |
| | | Component btnOk |
| | | { |
| | | #keys: '[414382.0.563131226]' |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | Label: 'OK' |
| | | Taborder: 0 |
| | | ] |
| | | } |
| | | Component btnCancel |
| | | { |
| | | #keys: '[414382.0.563131228]' |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | Label: 'Cancel' |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | | ] |
| | | Properties: |
| | | [ |
| | | Alignment: 'trailing' |
| | | Border: true |
| | | ExcludeFromActiveComponent: true |
| | | FixedSize: true |
| | | Orientation: 'horizontal' |
| | | Padding: 'true' |
| | | Style: 'footer' |
| | | Taborder: 1 |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | Component pnlContent |
| | | { |
| | | #keys: '[414382.0.563131220]' |
| | | BaseType: 'WebPanel' |
| | | Children: |
| | | [ |
| | | Component PriorityPolicyStringList |
| | | { |
| | | #keys: '[414382.0.563131262]' |
| | | BaseType: 'WebDropDownStringList' |
| | | Properties: |
| | | [ |
| | | Taborder: 0 |
| | | ] |
| | | } |
| | | Component DataHolderChoosePriorityPolicy |
| | | { |
| | | #keys: '[414382.0.563131279]' |
| | | BaseType: 'WebDataHolder' |
| | | Databinding: 'structured[PriorityPolicy]*' |
| | | Properties: |
| | | [ |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | | ] |
| | | Properties: |
| | | [ |
| | | Padding: 'true' |
| | | Taborder: 0 |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method OpenChoose () id:Method_DialogChoosePriorityPolicy_OpenChoose |
| | | { |
| | | #keys: '[414382.0.563950563]' |
| | | Body: |
| | | [* |
| | | ApplicationMacroPlanner.ShowFormModal( this ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: pnlActions/btnCancel |
| | | Response OnClick () id:Response_pnlActions_btnCancel_OnClick |
| | | { |
| | | #keys: '[414382.0.563131232]' |
| | | DefinitionID: 'Responsedef_WebButton_OnClick' |
| | | GroupServerCalls: true |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | Form.Close(); |
| | | *] |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: pnlActions/btnOk |
| | | Response OnClick () id:Response_pnlActions_btnOk_OnClick |
| | | { |
| | | #keys: '[414382.0.563131231]' |
| | | DefinitionID: 'Responsedef_WebButton_OnClick' |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | name := PriorityPolicyStringList.Text(); |
| | | PriorityResult::CalculatePriorityResult(name,MacroPlan,GlobalOTDTable); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: pnlContent/DataHolderChoosePriorityPolicy |
| | | Response OnCreated () id:Response_pnlContent_DataHolderChoosePriorityPolicy_OnCreated |
| | | { |
| | | #keys: '[414382.0.563131469]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebComponent_OnCreated' |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | dataList := selectuniquevalues( MacroPlan,PriorityPolicy,p,p.Name()); |
| | | strings := dataList.Concatenate( ";"); |
| | | PriorityPolicyStringList.Strings(strings); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: pnlContent/DataHolderChoosePriorityPolicy |
| | | Response OnDataChanged () id:Response_pnlContent_DataHolderChoosePriorityPolicy_OnDataChanged |
| | | { |
| | | #keys: '[414382.0.563131545]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebComponent_OnDataChanged' |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | dataList := selectuniquevalues( MacroPlan,PriorityPolicy,p,p.Name()); |
| | | strings := dataList.Concatenate( ";"); |
| | | PriorityPolicyStringList.Strings(strings); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: MacroPlannerWebApp |
| | | OrphanComponent DialogChoosePriorityPolicy |
| | | { |
| | | #keys: '[414382.0.563131218]' |
| | | BaseType: 'WebForm' |
| | | Children: |
| | | [ |
| | | #child: pnlContent |
| | | #child: pnlActions |
| | | ] |
| | | Properties: |
| | | [ |
| | | Alignment: 'trailing' |
| | | EnterButton: 'btnOk' |
| | | EscapeButton: 'btnCancel' |
| | | ExcludeFromActiveComponent: true |
| | | Padding: 'false' |
| | | Title: 'éæ©ä¼å
级çç¥' |
| | | ] |
| | | } |
| | |
| | | [ |
| | | Component DataSetLevelSalesDemands #extension |
| | | { |
| | | Children: |
| | | [ |
| | | #child: listContextMenuSD |
| | | ] |
| | | Properties: |
| | | [ |
| | | Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeAllConstraint","columnid":"All constraints","title":"All constraints","subtotals":"","tooltip":"","width":1,"display":"shown"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StockingPoint_MP.ID","title":"Stocking point","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"StockingPoint_MP.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SalesSegment_MP.Name","title":"Sales segment","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"SalesSegment_MP.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerName","title":"Customer name","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerID","title":"Customer ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderID","title":"Order ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderLineID","title":"Order line ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderLineID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"Order date","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Product_MP.ID","title":"Product","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Product_MP.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"UnitOfMeasure_MP.Name","title":"UoM","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"UnitOfMeasure_MP.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Quantity","title":"Quantity","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Quantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"FulfilledQuantity","title":"Fulfilled","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"FulfilledQuantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeChart","columnid":"Fulfillment","title":"Fulfillment","subtotals":"","tooltip":"","width":-1,"display":"shown","type":"stackbar","relative":true,"attributes":[{"name":"Unfulfilled demand","color":"rgb(232,123,0)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Unfulfilled demand","title":"Unfulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"maxvalue( object.Quantity() - object.FulfilledQuantity(), 0.0).Round( 2)"}},{"name":"Fulfilled demand","color":"rgb(87,184,71)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Fulfilled demand","title":"Fulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"object.FulfilledQuantity().Round( 2)"}}]}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IsFirmed","title":"Is firmed","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IsFirmed"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IsEligibleForNetting","title":"Is eligible for netting","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IsEligibleForNetting"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Price","title":"Price","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Price"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"PriceUoM","title":"PriceUoM","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"PriceUoM"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderTag","title":"è®¢åæ ç¾","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderTag"}}]' |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | Component listContextMenuSD #extension |
| | | { |
| | | Children: |
| | | [ |
| | | Component MenuPriorityResult |
| | | { |
| | | #keys: '[414382.0.562012014]' |
| | | BaseType: 'WebMenu' |
| | | Properties: |
| | | [ |
| | | Taborder: 10 |
| | | Title: 'äºä¸é¨ä¼å
级计ç®' |
| | | ] |
| | | } |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: ListSalesDemands |
| | | Response OnClick () id:Response_ListSalesDemands_MenuPriorityResult_OnClick |
| | | { |
| | | #keys: '[414382.0.563130924]' |
| | | CanBindMultiple: false |
| | | DefinitionID => //FormSalesDemands/ListSalesDemands/Responsedef_ListSalesDemands_WebMenu_OnClick |
| | | Initiator: 'MenuPriorityResult' |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | |
| | | dlg := construct( DialogChoosePriorityPolicy ); |
| | | dlg.OpenChoose(); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
| | |
| | | Title: 'Filling' |
| | | ] |
| | | } |
| | | Component MenuTest |
| | | Component MenuRefresh |
| | | { |
| | | #keys: '[414382.0.415603149]' |
| | | BaseType: 'WebMenu' |
| | |
| | | [ |
| | | Image: 'ADD2' |
| | | Taborder: 4 |
| | | Title: 'Test' |
| | | Title: 'å·æ°' |
| | | ] |
| | | } |
| | | ] |
ÎļþÃû´Ó _Main/UI/MacroPlannerWebApp/Component_FormFillingCapacityScheme/Response_ListCustomerAndFillingCapacityOrder_MenuTest_OnClick.def ÐÞ¸Ä |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: ListCustomerAndFillingCapacityOrder |
| | | Response OnClick () id:Response_ListCustomerAndFillingCapacityOrder_MenuTest_OnClick |
| | | Response OnClick () id:Response_ListCustomerAndFillingCapacityOrder_MenuRefresh_OnClick |
| | | { |
| | | #keys: '[414382.0.415724061]' |
| | | CanBindMultiple: false |
| | | DefinitionID => /ListCustomerAndFillingCapacityOrder/Responsedef_ListCustomerAndFillingCapacityOrder_WebMenu_OnClick |
| | | GroupServerCalls: true |
| | | Initiator: 'MenuTest' |
| | | Initiator: 'MenuRefresh' |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | CustomerAndForecastOrder::CreateTestData( MacroPlan); |
| | | CustomerAndForecastOrder::RefreshData( MacroPlan,GlobalOTDTable); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |