From f8139abd06d83a1260946d600faead9e4b447814 Mon Sep 17 00:00:00 2001
From: limj <limj@taizhitech.com>
Date: 星期三, 27 九月 2023 15:34:04 +0800
Subject: [PATCH] 优先级因子计算
---
_Main/BL/Type_PriorityResult/StaticMethod_calculatePriorityResult.qbl | 17 ++++-
_Main/BL/Type_PriorityResult/StaticMethod_GetDetailsValue.qbl | 45 ++++++++++++--
_Main/BL/Type_PriorityResult/StaticMethod_GetRemindFormula.qbl | 10 +++
_Main/UI/MacroPlannerWebApp/Component_DialogChoosePriorityPolicy/Method_CalculatePriorityResult.def | 12 ++++
_Main/UI/MacroPlannerWebApp/Component_DialogChoosePriorityPolicy/Response_pnlActions_btnOk_OnClick.def | 4
_Main/BL/Type_PriorityResult/StaticMethod_CalculateScore.qbl | 2
_Main/UI/MacroPlannerWebApp/Component_FormPriorityPolicy/Component_PanelPriorityPolicyOperationButton#713.def | 2
_Main/BL/Type_PriorityFactorDetails/StaticMethod_InitData.qbl | 62 +++++++++++++++++---
8 files changed, 127 insertions(+), 27 deletions(-)
diff --git a/_Main/BL/Type_PriorityFactorDetails/StaticMethod_InitData.qbl b/_Main/BL/Type_PriorityFactorDetails/StaticMethod_InitData.qbl
index 01917f6..1449c61 100644
--- a/_Main/BL/Type_PriorityFactorDetails/StaticMethod_InitData.qbl
+++ b/_Main/BL/Type_PriorityFactorDetails/StaticMethod_InitData.qbl
@@ -17,7 +17,7 @@
if( priorityFactor.Name() = "澶у紶鐩堝埄姘村钩" )
{
- priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 5,
+ 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());
@@ -31,7 +31,7 @@
if( priorityFactor.Name() = "瀹㈡埛绛栫暐" )
{
- priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 5,
+ priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 5,
IsRange := false,GradingName := "81%鈮鈮�100%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 4,
IsRange := false,GradingName := "61%鈮鈮�80%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
@@ -43,18 +43,60 @@
IsRange := false,GradingName := "1%鈮鈮�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 := "鎴樼暐",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 := 1,
+ 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 := "120",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
+ priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 4,
+ IsRange := false,GradingName := "90",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
+ priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 3,
+ IsRange := false,GradingName := "60",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
+ priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 2,
+ IsRange := false,GradingName := "30",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
+ priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 1,
+ IsRange := false,GradingName := "0",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 := "鏈夐娴�",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 := 1,
+ 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%鈮鈮�100%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
- priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 4,
- IsRange := false,GradingName := "61%鈮鈮�80%",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 := "41%鈮鈮�60%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
- priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 2,
- IsRange := false,GradingName := "21%鈮鈮�40%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
+ IsRange := false,GradingName := "閲嶇偣",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 1,
- IsRange := false,GradingName := "1%鈮鈮�20%",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
+ IsRange := false,GradingName := "娼滃姏",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
+ }
+
+ if( priorityFactor.Name() = "DOI" or priorityFactor.Name() = "DSI")
+ {
+ priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 5,
+ IsRange := false,GradingName := "<7",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
+ priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 3,
+ IsRange := false,GradingName := "<15",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
+ priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 1,
+ IsRange := false,GradingName := "<30",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
+ priorityFactor.PriorityFactorDetails(relnew,BusinessType := priorityFactor.BusinessType(), IsBusinessType := isBusinessType,GradeTarget := 1,
+ IsRange := false,GradingName := ">30",RangeMin := 0.0,RangeMax := 0.0,PriorityFactorName := priorityFactor.Name());
}
*]
}
diff --git a/_Main/BL/Type_PriorityResult/StaticMethod_CalculateScore.qbl b/_Main/BL/Type_PriorityResult/StaticMethod_CalculateScore.qbl
index decca69..0cc1c80 100644
--- a/_Main/BL/Type_PriorityResult/StaticMethod_CalculateScore.qbl
+++ b/_Main/BL/Type_PriorityResult/StaticMethod_CalculateScore.qbl
@@ -76,7 +76,7 @@
{
// 涓嶆槸绗﹀彿 鐩存帴鑾峰彇璁$畻鍚庣殑鏁板��
score := PriorityResult::GetDetailsValue( customerOrder,remindFormula,macroPlan,globalOTDTable);
-
+ info( "123123");
// 鎴彇鎺夊凡缁忚绠楃殑浼樺厛绾у洜瀛� 閫掑綊璁$畻
remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan);
PriorityResult::CalculateScore( remindFormula,customerOrder,businessType,macroPlan,score,globalOTDTable);
diff --git a/_Main/BL/Type_PriorityResult/StaticMethod_GetDetailsValue.qbl b/_Main/BL/Type_PriorityResult/StaticMethod_GetDetailsValue.qbl
index f12f852..035c057 100644
--- a/_Main/BL/Type_PriorityResult/StaticMethod_GetDetailsValue.qbl
+++ b/_Main/BL/Type_PriorityResult/StaticMethod_GetDetailsValue.qbl
@@ -10,6 +10,7 @@
TextBody:
[*
// NBoTk Sep-26-2023 (created)
+ // 褰撳墠璁$畻浼樺厛绾у洜瀛愮粏鍒� 濡傛灉鑾峰彇涓嶅埌鍏ㄩ儴鍏堥粯璁や负1
value := 0.0;
@@ -32,41 +33,71 @@
if( "澶у紶鐩堝埄姘村钩" = priorityFactor.Name())
{
obj := selectobject( priorityFactor,PriorityFactorDetails,p , p.PriorityFactorName() = "澶у紶鐩堝埄姘村钩" and p.GradingName() = customerOrder.SheetProfitability());
- value := priorityFactor.Coefficient() * obj.GradeTarget();
+ gradeTarget := 1.0;
+ if( not isnull( obj ) )
+ {
+ gradeTarget := obj.GradeTarget();
+ }
+ value := priorityFactor.Coefficient() * gradeTarget;
}
if( "DOI" = priorityFactor.Name())
{
// DOI鏁版嵁
obj := selectobject( globalOTDTable,Global_MappingDOI_DSI,doi,doi.ProductID() = customerOrder.ProductID())
- value := priorityFactor.Coefficient() * [Real]obj.DOI();
+ doi := 1.0;
+ if( not isnull( obj ) )
+ {
+ doi := [Real]obj.DOI();
+ }
+ value := priorityFactor.Coefficient() * doi;
}
if( "DSI" = priorityFactor.Name())
{
// DOI鏁版嵁
obj := selectobject( globalOTDTable,Global_MappingDOI_DSI,doi,doi.ProductID() = customerOrder.ProductID())
- value := priorityFactor.Coefficient() * [Real]obj.DSI();
+ dsi := 1.0;
+ if( not isnull( obj ) )
+ {
+ dsi := [Real]obj.DSI();
+ }
+ value := priorityFactor.Coefficient() * dsi;
}
if( "缁嗗垎甯傚満绛夌骇" = priorityFactor.Name())
{
obj := selectobject( priorityFactor,PriorityFactorDetails,p , p.PriorityFactorName() = "缁嗗垎甯傚満绛夌骇" and p.GradingName() = customerOrder.SegmentPriority());
- value := priorityFactor.Coefficient() * obj.GradeTarget();
+ gradeTarget := 1.0;
+ if( not isnull( obj ) )
+ {
+ gradeTarget := obj.GradeTarget();
+ }
+ value := priorityFactor.Coefficient() * gradeTarget;
}
if( "闇�姹傜被鍨�" = priorityFactor.Name())
{
// 鏈夐娴� 鏃犻娴� 绾娴�
obj := selectobject( priorityFactor,PriorityFactorDetails,p,p.GradingName() = customerOrder.OrderType());
- value := priorityFactor.Coefficient() * obj.GradeTarget();
+ gradeTarget := 1.0;
+ if( not isnull( obj ) )
+ {
+ gradeTarget := obj.GradeTarget();
+ }
+ value := priorityFactor.Coefficient() * 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();
+ obj := selectobject( globalOTDTable,Global_MappingCustomerGrade,doi,doi.BusinessType() = customerOrder.BusinessType() and doi.Customer() = customerOrder.CustomerName())
+ customerGrade := 1.0;
+ if( not isnull( obj ) )
+ {
+ customerGrade := [Real]obj.CustomerGrade();
+ }
+ value := priorityFactor.Coefficient() * customerGrade;
}
if( "璁㈠崟涓嬪崟鏃堕棿" = priorityFactor.Name())
diff --git a/_Main/BL/Type_PriorityResult/StaticMethod_GetRemindFormula.qbl b/_Main/BL/Type_PriorityResult/StaticMethod_GetRemindFormula.qbl
index 7c211d6..c931871 100644
--- a/_Main/BL/Type_PriorityResult/StaticMethod_GetRemindFormula.qbl
+++ b/_Main/BL/Type_PriorityResult/StaticMethod_GetRemindFormula.qbl
@@ -15,7 +15,15 @@
{
if( formula.StartsWith( p.Name()) )
{
- str := formula.SubString( 0 + p.Name().Length(),formula.Length());
+ // 鍒ゆ柇鍓╀綑瀛楃闀垮害
+ if( p.Name().Length() = formula.Length() )
+ {
+ str := ""
+ }
+ else
+ {
+ str := formula.SubString( 0 + p.Name().Length(),formula.Length());
+ }
}
}
diff --git a/_Main/BL/Type_PriorityResult/StaticMethod_calculatePriorityResult.qbl b/_Main/BL/Type_PriorityResult/StaticMethod_calculatePriorityResult.qbl
index 1b2da12..7688006 100644
--- a/_Main/BL/Type_PriorityResult/StaticMethod_calculatePriorityResult.qbl
+++ b/_Main/BL/Type_PriorityResult/StaticMethod_calculatePriorityResult.qbl
@@ -15,7 +15,8 @@
traverse( macroPlan,SalesDemand.astype( CustomerOrder ),e)
{
// 浜嬩笟閮ㄤ俊鎭�
- businessType := e.BusinessType();
+ //businessType := e.BusinessType();
+ businessType := "鎵嬫満浜嬩笟閮�";
// 鑾峰彇瀵瑰簲浜嬩笟閮ㄨ绠楀叕寮�
priorityPolicys := selectobject( macroPlan,PriorityPolicy,p,p.BusinessType() = businessType and p.Name() = priorityPolicyName);
@@ -61,11 +62,17 @@
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;
+ // 璁㈠崟鏁版嵁涓嶄负绌哄啀鍋氬鐞�
+ if( not isnull( obj ) )
+ {
+ obj.PriorityName([String]priorityValue);
+
+ // 鍒涘缓浼樺厛绾ф暟鎹�
+ macroPlan.Priority(relnew,Weight := priorityValue,Name := obj.OrderID());
+ priorityValue := priorityValue + 1;
+ }
+
}
*]
}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogChoosePriorityPolicy/Method_CalculatePriorityResult.def b/_Main/UI/MacroPlannerWebApp/Component_DialogChoosePriorityPolicy/Method_CalculatePriorityResult.def
new file mode 100644
index 0000000..177aa43
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogChoosePriorityPolicy/Method_CalculatePriorityResult.def
@@ -0,0 +1,12 @@
+Quintiq file version 2.0
+#parent: #root
+Method CalculatePriorityResult () id:Method_DialogChoosePriorityPolicy_CalculatePriorityResult
+{
+ #keys: '[414382.0.577602130]'
+ Body:
+ [*
+ name := PriorityPolicyStringList.Text();
+ PriorityResult::CalculatePriorityResult(name,MacroPlan,GlobalOTDTable);
+ this.Close();
+ *]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogChoosePriorityPolicy/Response_pnlActions_btnOk_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_DialogChoosePriorityPolicy/Response_pnlActions_btnOk_OnClick.def
index 7750e77..9924430 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogChoosePriorityPolicy/Response_pnlActions_btnOk_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogChoosePriorityPolicy/Response_pnlActions_btnOk_OnClick.def
@@ -8,8 +8,8 @@
{
Body:
[*
- name := PriorityPolicyStringList.Text();
- PriorityResult::CalculatePriorityResult(name,MacroPlan,GlobalOTDTable);
+ dlg := construct( DialogChoosePriorityPolicy );
+ dlg.CalculatePriorityResult();
*]
GroupServerCalls: false
}
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormPriorityPolicy/Component_PanelPriorityPolicyOperationButton\043713.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormPriorityPolicy/Component_PanelPriorityPolicyOperationButton\043713.def"
index 014ed5d..571a83c 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormPriorityPolicy/Component_PanelPriorityPolicyOperationButton\043713.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormPriorityPolicy/Component_PanelPriorityPolicyOperationButton\043713.def"
@@ -31,7 +31,7 @@
BaseType: 'WebButton'
Properties:
[
- Label: '*'
+ Label: '-'
Taborder: 3
]
}
--
Gitblit v1.9.3