| | |
| | | // NBoTk Sep-21-2023 (created) |
| | | |
| | | data := selectobject( owner,PriorityFactor,p, |
| | | p.BusinessType() = businessType and p.Name() = name |
| | | p.Name() = name |
| | | ) |
| | | |
| | | return data.Coefficient(); |
| | |
| | | value := ""; |
| | | |
| | | strList := selectuniquevalues( owner,PriorityFactor,p, |
| | | p.BusinessType() = businessType, |
| | | p.Name() |
| | | ); |
| | | |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod InitData ( |
| | | MacroPlan owner, |
| | | String businessType |
| | | MacroPlan owner |
| | | ) |
| | | { |
| | | TextBody: |
| | |
| | | // NBoTk Sep-15-2023 (created) |
| | | // businessType |
| | | // result := "éå¢é¢æ¿;ä¸ä¸æ¾ç¤ºäºä¸é¨;å¤åCELL;éæ¾;è¿å¨å¥åº·;è¿å¨å¥åº·äºä¸é¨;ææºäºä¸é¨;ç¹ç§æ¾ç¤º;汽车çµåäºä¸é¨;车载æ¾ç¤ºäºä¸é¨;ITäºä¸é¨"; |
| | | |
| | | businessType := ""; |
| | | |
| | | // 妿已ç»åå¨ä¼å
çº§æ°æ® åä¸åå¤ç |
| | | list := selectset( owner,PriorityFactor,p,true); |
| | | if( list.Size() = 0 ) |
| | | { |
| | | |
| | | // æ·»å äºä¸é¨å¯¹åºçé¢å¶ä¼å
级å åæ°æ® |
| | | owner.PriorityFactor(relnew,Name := "客æ·çç¥" ,Desc := "å°äºä¸é¨è®¡ç®çä¼å
çº§ï¼æè¯¥ç»å项æ¯ä¾é¶æ¢¯ç¡®å®è¯¥é¡¹å¾åãå¦ï¼81%â¤Xâ¤100% 5åï¼61%â¤Xâ¤80% 4å", BusinessType := businessType ); |
| | | owner.PriorityFactor(relnew,Name := "客æ·ç级" ,Desc := "æ ¹æ®éæ±æ°æ®ä¸å®¢æ·ï¼å¹é
客æ·ç级",BusinessType := businessType); |
| | |
| | | { |
| | | PriorityFactorDetails::InitData( owner,e); |
| | | } |
| | | |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod GetCalcFormula ( |
| | | MacroPlan macroPlan, |
| | | String formula |
| | | ) as String |
| | | { |
| | | TextBody: |
| | | [* |
| | | // NBoTk Oct-7-2023 (created) |
| | | priorityFactor := null( PriorityFactor); |
| | | traverse( macroPlan,PriorityFactor,p) |
| | | { |
| | | if( formula.StartsWith( p.Name()) ) |
| | | { |
| | | priorityFactor := p; |
| | | } |
| | | } |
| | | value := priorityFactor.Name() + "[" + [String]priorityFactor.Coefficient() +"*L]"; |
| | | return value; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod GetCalcStr ( |
| | | MacroPlan macroPlan, |
| | | String formula, |
| | | String lastCalcStr |
| | | ) as String |
| | | { |
| | | TextBody: |
| | | [* |
| | | // NBoTk Oct-7-2023 (created) |
| | | |
| | | calcStr := ""; |
| | | remindFormula := formula; |
| | | |
| | | // éåä¼å
级å åé
ç½® |
| | | if( not remindFormula = '' ) |
| | | { |
| | | // ä»èµ·å§ä½ç½®å¼å§å¹é
|
| | | if(remindFormula.StartsWith( "+" )) |
| | | { |
| | | remindFormula := remindFormula.SubString( 1,remindFormula.Length()-1); |
| | | calcStr := PriorityPolicy::GetCalcFormula(macroPlan,remindFormula); |
| | | calcStr := lastCalcStr + "+" + calcStr; |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityPolicy::GetCalcStr( macroPlan,remindFormula,calcStr); |
| | | } |
| | | else if( remindFormula.StartsWith( "-" )) |
| | | { |
| | | remindFormula := remindFormula.SubString( 1,remindFormula.Length()-1); |
| | | calcStr := PriorityPolicy::GetCalcFormula(macroPlan,remindFormula); |
| | | calcStr := lastCalcStr + "-" + calcStr; |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityPolicy::GetCalcStr( macroPlan,remindFormula,calcStr); |
| | | } |
| | | else if( remindFormula.StartsWith( "*" ) ) |
| | | { |
| | | remindFormula := remindFormula.SubString( 1,remindFormula.Length()-1); |
| | | calcStr := PriorityPolicy::GetCalcFormula(macroPlan,remindFormula); |
| | | calcStr := lastCalcStr + "*" + calcStr; |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityPolicy::GetCalcStr( macroPlan,remindFormula,calcStr); |
| | | } |
| | | else if( remindFormula.StartsWith( "/" ) ) |
| | | { |
| | | remindFormula := remindFormula.SubString( 1,remindFormula.Length()-1); |
| | | calcStr := PriorityPolicy::GetCalcFormula(macroPlan,remindFormula); |
| | | calcStr := lastCalcStr + "/" + calcStr; |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityPolicy::GetCalcStr( macroPlan,remindFormula,calcStr); |
| | | } |
| | | else if( remindFormula.StartsWith( "(" ) ) |
| | | { |
| | | remindFormula := remindFormula.SubString( 1,remindFormula.Length()-1); |
| | | calcStr := PriorityPolicy::GetCalcFormula(macroPlan,remindFormula); |
| | | calcStr := lastCalcStr + "{" + calcStr; |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityPolicy::GetCalcStr( macroPlan,remindFormula,calcStr); |
| | | } |
| | | else if( remindFormula.StartsWith( ")" ) ) |
| | | { |
| | | remindFormula := remindFormula.SubString( 1,remindFormula.Length()-1); |
| | | calcStr := PriorityPolicy::GetCalcFormula(macroPlan,remindFormula); |
| | | calcStr := lastCalcStr + ")" + calcStr; |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityPolicy::GetCalcStr( macroPlan,remindFormula,calcStr); |
| | | } |
| | | else |
| | | { |
| | | // 䏿¯ç¬¦å· ç´æ¥è·å计ç®åçæ°å¼ |
| | | calcStr := PriorityPolicy::GetCalcFormula(macroPlan,remindFormula); |
| | | |
| | | // æªåæå·²ç»è®¡ç®çä¼å
级å å éå½è®¡ç® |
| | | remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan); |
| | | PriorityPolicy::GetCalcStr( macroPlan,remindFormula,calcStr); |
| | | } |
| | | |
| | | } |
| | | |
| | | return calcStr; |
| | | *] |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | nameList := PriorityFactor::GetDataByBusinessType( owner,businessType); |
| | | nameList := PriorityFactor::GetDataByBusinessType( owner,""); |
| | | traverse( nameList,Elements,e) |
| | | { |
| | | nameText := e.Name() + "[" + [String]e.Coefficient() + "*L]" |
| | |
| | | [* |
| | | // NBoTk Sep-21-2023 (created) |
| | | value := stringData; |
| | | |
| | | symbolList := construct( structured[String]); |
| | | symbolList.Add( "+") |
| | | symbolList.Add( "-") |
| | |
| | | } |
| | | } |
| | | |
| | | nameList := PriorityFactor::GetDataByBusinessType( owner,businessType); |
| | | nameList := PriorityFactor::GetDataByBusinessType( owner,""); |
| | | traverse( nameList,Elements,e) |
| | | { |
| | | if( stringData.EndsWith( e.Name())) |
| | |
| | | value := stringData.SubString( 0,end); |
| | | } |
| | | } |
| | | |
| | | return value; |
| | | *] |
| | | } |
| | |
| | | remindFormula := formula; |
| | | |
| | | // éåä¼å
级å åé
ç½® |
| | | |
| | | if( not remindFormula = '' ) |
| | | { |
| | | // ä»èµ·å§ä½ç½®å¼å§å¹é
|
| | |
| | | PriorityResult::CalculateBracketScore(calcStr,customerOrder,businessType,macroPlan,globalOTDTable); |
| | | |
| | | // æªå ) åçå符继ç»è¿è¡è®¡ç® |
| | | remindFormula := remindFormula.SubString( rightBracket,remindFormula.Length()); |
| | | remindFormula := remindFormula.SubString( rightBracket,remindFormula.Length()-1); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | // 没æå¹é
å
¬å¼è®¡ç®å®æ |
| | | return lastScore; |
| | | return score; |
| | | *] |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | info( "remindStr = " + str ); |
| | | return str; |
| | | *] |
| | | } |
| | |
| | | { |
| | | // äºä¸é¨ä¿¡æ¯ |
| | | businessType := e.BusinessType(); |
| | | //businessType := "ææºäºä¸é¨"; |
| | | |
| | | // è·å对åºäºä¸é¨è®¡ç®å
¬å¼ |
| | | priorityPolicys := selectobject( macroPlan,PriorityPolicy,p,p.BusinessType() = businessType and p.Name() = priorityPolicyName); |
| | |
| | | |
| | | // éå½å¤ç计ç®å
¬å¼ è·åå½å订åçå¾å |
| | | 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(), |
| | |
| | | result.PriorityResultScore() |
| | | ) |
| | | |
| | | // Quintiqä¼å
级å10级 éè¦åæ®µè®¡ç® |
| | | subLevel := resultList.Size() div 10; |
| | | subLevelCount := 0; |
| | | |
| | | priorityValue := 1; |
| | | traverse( resultList,Elements,e) |
| | | { |
| | |
| | | |
| | | // å建ä¼å
çº§æ°æ® éè¦å
æ¸
é¤ä¸ä¸æ¬¡ç计ç®ç»æ |
| | | // 夿å½åcustomerOrderæ¯å¦åå¨ |
| | | oldPriority := selectobject( macroPlan,Priority,p,p.Name() = obj.OrderID()); |
| | | if(not isnull( oldPriority ) ) |
| | | oldPriority := selectobject( macroPlan,Priority,p,p.Name() = [String]priorityValue); |
| | | if(isnull( oldPriority ) ) |
| | | { |
| | | macroPlan.Priority(reldelete, oldPriority); |
| | | macroPlan.Priority(relnew,Weight := priorityValue,Name := [String]priorityValue); |
| | | } |
| | | macroPlan.Priority(relnew,Weight := priorityValue,Name := obj.OrderID()); |
| | | priorityValue := priorityValue + 1; |
| | | } |
| | | |
| | | // å¤æè®¡ç®å段æ°éä¸Quintiqåå§ä¼å
级 |
| | | subLevelCount := subLevelCount + 1; |
| | | if( subLevelCount = subLevel ) |
| | | { |
| | | // å½å°è¾¾å段æ°éå ä¼å
级+1 åæ®µè®¡æ°ä»0å¼å§ |
| | | if( priorityValue < 10 ) |
| | | { |
| | | priorityValue := priorityValue + 1; |
| | | } |
| | | subLevelCount := 0; |
| | | } |
| | | } |
| | | *] |
| | | } |
| | |
| | | |
| | | // OnOk |
| | | this.ApplyChanges(); |
| | | |
| | | businessType := DataHolderBusinessType.Data().BusinessTypeName(); |
| | | DataHolderBusinessType.Data().Commit(); |
| | | |
| | | |
| | | PriorityFactor::InitData( MacroPlan,businessType); |
| | | PriorityFactor::InitData( MacroPlan); |
| | | |
| | | this.Close(); |
| | | *] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method New ( |
| | | MacroPlan owner, |
| | | String businessType |
| | | ) id:Method_DialogEditPriorityFactor_New |
| | | { |
| | | #keys: '[414382.0.593002251]' |
| | | Body: |
| | | [* |
| | | data := owner.PriorityFactor(relshadow); |
| | | data.BusinessType(businessType); |
| | | |
| | | DataHolderEditPriorityFactor.Data(&data); |
| | | |
| | | ApplicationMacroPlanner.ShowFormModal( this ); |
| | | *] |
| | | } |
| | |
| | | Properties: |
| | | [ |
| | | Image: 'GEAR_EDIT' |
| | | Taborder: 3 |
| | | Taborder: 4 |
| | | Title: 'ç¼è¾' |
| | | ] |
| | | } |
| | | Component MenuNew |
| | | { |
| | | #keys: '[414382.0.593001800]' |
| | | BaseType: 'WebMenu' |
| | | Properties: |
| | | [ |
| | | Image: 'GEAR_ADD' |
| | | Taborder: 3 |
| | | Title: 'æ°å¢' |
| | | ] |
| | | } |
| | | Component MenuDel |
| | | { |
| | | #keys: '[414382.0.593001811]' |
| | | BaseType: 'WebMenu' |
| | | Properties: |
| | | [ |
| | | Image: 'GEAR_DELETE' |
| | | Taborder: 5 |
| | | Title: 'å é¤' |
| | | ] |
| | | } |
| | | ] |
| | | Properties: |
| | | [ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: DataHolderPriorityFactorSelect |
| | | Response OnDataChanged () id:Response_FormPriorityFactor_DataHolderPriorityFactorSelect_OnDataChanged |
| | | { |
| | | #keys: '[414382.0.593010798]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebComponent_OnDataChanged' |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | data := selectset( MacroPlan,PriorityFactor,p,true); |
| | | this.Data(&data); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | //strings := BusinessType::GetBusinessNameStr( GlobalOTDTable ); |
| | | //this.Strings(strings); |
| | | info( "create" + DropDownStringListBusinessType.Text()); |
| | | list := PriorityFactor::GetDataByBusinessType( MacroPlan, DropDownStringListBusinessType.Text()); |
| | | DataHolderPriorityFactorSelect.Data(&list); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | info( "selection" ); |
| | | info( "selection" + DropDownStringListBusinessType.Text()); |
| | | list := PriorityFactor::GetDataByBusinessType( MacroPlan, DropDownStringListBusinessType.Text()); |
| | | DataHolderPriorityFactorSelect.Data(&list); |
| | | *] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: ListPriorityFactor |
| | | Response OnClick ( |
| | | PriorityFactor selection |
| | | ) id:Response_ListPriorityFactor_MenuDel_OnClick |
| | | { |
| | | #keys: '[414382.0.593002800]' |
| | | CanBindMultiple: false |
| | | DefinitionID => /ListPriorityFactor/Responsedef_ListPriorityFactor_WebMenu_OnClick |
| | | Initiator: 'MenuDel' |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | selection.Delete(); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: ListPriorityFactor |
| | | Response OnClick () id:Response_ListPriorityFactor_MenuNew_OnClick |
| | | { |
| | | #keys: '[414382.0.593002709]' |
| | | CanBindMultiple: false |
| | | DefinitionID => /ListPriorityFactor/Responsedef_ListPriorityFactor_WebMenu_OnClick |
| | | Initiator: 'MenuNew' |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | dlg := construct( DialogEditPriorityFactor ); |
| | | businessType := DropDownStringListBusinessType.Text(); |
| | | dlg.New( MacroPlan, businessType); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
| | |
| | | [ |
| | | Label: 'äºä¸é¨:' |
| | | Taborder: 0 |
| | | Visible: false |
| | | ] |
| | | } |
| | | #child: ListPriorityFactor |
| | |
| | | Properties: |
| | | [ |
| | | DataType: 'structured[PriorityPolicy]' |
| | | Source: 'DataHolderPriorityPolicy' |
| | | Source: 'DataHolderPriorityPolicyShowList' |
| | | Taborder: 0 |
| | | Transformation: 'Elements' |
| | | ] |
| | |
| | | ] |
| | | Properties: |
| | | [ |
| | | Taborder: 2 |
| | | Taborder: 3 |
| | | ] |
| | | ResponseDefinitions: |
| | | [ |
| | |
| | | ] |
| | | Properties: |
| | | [ |
| | | Taborder: 3 |
| | | Taborder: 4 |
| | | Title: 'ä¼å
级çç¥é
ç½®' |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: DataHolderPriorityPolicy |
| | | Response OnCreated () id:Response_FormPriorityPolicy_DataHolderPriorityPolicy_OnCreated |
| | | { |
| | | #keys: '[414382.0.594152096]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebComponent_OnCreated' |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | data := this.Data(); |
| | | businessType := PriorityPolicyBusinessType.Text(); |
| | | list := selectset( data,Elements,e,e.BusinessType() = businessType); |
| | | DataHolderPriorityPolicyShowList.Data(&list); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
| | |
| | | #parent: DataHolderPriorityPolicy |
| | | Response OnDataChanged () id:Response_FormPriorityPolicy_DataHolderPriorityPolicy_OnDataChanged |
| | | { |
| | | #keys: '[414382.0.502145694]' |
| | | #keys: '[414382.0.595379026]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebComponent_OnDataChanged' |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | list := PriorityPolicy::GetDataByBusinessType( MacroPlan, PriorityPolicyBusinessType.Text()); |
| | | this.Data(&list); |
| | | data := this.Data(); |
| | | businessType := PriorityPolicyBusinessType.Text(); |
| | | list := selectset( data,Elements,e,e.BusinessType() = businessType); |
| | | DataHolderPriorityPolicyShowList.Data(&list); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | |
| | | [* |
| | | strings := BusinessType::GetBusinessNameStr( GlobalOTDTable ); |
| | | this.Strings(strings); |
| | | |
| | | list := PriorityPolicy::GetDataByBusinessType( MacroPlan, PriorityPolicyBusinessType.Text()); |
| | | DataHolderPriorityPolicyShowList.Data(&list); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | //list := PriorityPolicy::GetDataByBusinessType( MacroPlan, PriorityPolicyBusinessType.Text()); |
| | | //DataHolderPriorityPolicy.Data(&list); |
| | | list := PriorityPolicy::GetDataByBusinessType( MacroPlan, PriorityPolicyBusinessType.Text()); |
| | | DataHolderPriorityPolicyShowList.Data(&list); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | |
| | | #keys: '[414382.0.487792124]' |
| | | BaseType: 'WebDataHolder' |
| | | Databinding: 'structured[PriorityPolicy]*' |
| | | Children: |
| | | [ |
| | | Component DataExtractorPriorityPolicy216 |
| | | { |
| | | #keys: '[414382.0.593061574]' |
| | | BaseType: 'WebDataExtractor' |
| | | Properties: |
| | | [ |
| | | Taborder: 1 |
| | | DataType: 'MacroPlan' |
| | | Source: 'MacroPlan' |
| | | Taborder: 0 |
| | | Transformation: 'PriorityPolicy' |
| | | ] |
| | | } |
| | | ] |
| | | Properties: |
| | | [ |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | | #child: ListPriorityPolicy |
| | |
| | | Databinding: 'shadow[PriorityPolicy]*' |
| | | Properties: |
| | | [ |
| | | Taborder: 4 |
| | | Taborder: 5 |
| | | ] |
| | | } |
| | | Component DataHolderPriorityPolicyBusinessType |
| | |
| | | ] |
| | | Properties: |
| | | [ |
| | | Taborder: 5 |
| | | Taborder: 6 |
| | | ] |
| | | } |
| | | Component DataHolderPriorityPolicyFactor |
| | |
| | | ] |
| | | Properties: |
| | | [ |
| | | Taborder: 6 |
| | | Taborder: 7 |
| | | ] |
| | | } |
| | | Component DataHolderPriorityPolicyShowList |
| | | { |
| | | #keys: '[414382.0.593062135]' |
| | | BaseType: 'WebDataHolder' |
| | | Databinding: 'structured[PriorityPolicy]*' |
| | | Properties: |
| | | [ |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | | ] |