From 5302eb66940f4df55beeef149c1f8c578546cb9d Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期五, 09 八月 2024 15:26:02 +0800
Subject: [PATCH] 发动机管线报表需求显示调整
---
_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultCCALineUnit.qbl | 11 +++++
_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultDLALineUnit.qbl | 11 +++++
_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultCCMPLineUnit.qbl | 11 +++++
_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultDLMPLineUnit.qbl | 11 +++++
_Main/BL/Type_EnginePipelineSource/StaticMethod_Initialize.qbl | 12 ++++--
_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl | 39 ++++++++++++++++---
6 files changed, 84 insertions(+), 11 deletions(-)
diff --git a/_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl b/_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl
index 846f44a..3c3e269 100644
--- a/_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl
+++ b/_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl
@@ -9,7 +9,6 @@
[*
// 鐢勫叞楦� Jun-25-2024 (created)
table := selectobject( this, Source.Report, report, not report.IsShow() );
-
//娓呯┖涔嬪墠瀛樺偍鐨勬樉绀烘暟鎹�
this.Clear( search.TimeUnit(), search.StartDate(), search.EndDate() );
Transaction::Transaction().Propagate( attribute( EnginePipelineColumn, Index ) );
@@ -44,8 +43,22 @@
showrowccproduction := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '闀挎槬浜ч噺', rownr + 2, false );
showrowdemand := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '闇�姹�', rownr + 3, false );
rownr := rownr + 4;
- traverse( models, Elements, model ){
- EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), model, rownr, false );
+ modelsnr := rownr + 3;
+ models := construct( Strings );
+ uniquemodels := selectuniquevalues( row, Cell.Demand, demand, true, demand.Model() );
+
+ traverse( uniquemodels, Elements, e ){
+
+ if( rownr < modelsnr ){
+ EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), e, rownr, false );
+ models.Add( e );
+ rownr := rownr + 1;
+ }
+ }
+
+ for( rownr := rownr; rownr < modelsnr; rownr ++ ){
+
+ EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '', rownr, false );
rownr := rownr + 1;
}
showrowinventory := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '搴撳瓨', rownr, false );
@@ -60,6 +73,7 @@
production := column.CellValue( relnew, Value := [String]cell.ProductionQuantity() );
showrowproduction.CellValue( relinsert, production );
sumproduction := selectobject( column, CellValue, c, c.Row() = sumrowproduction );
+
if( isnull( sumproduction ) ){
sumproduction := column.CellValue( relnew, Value := [String]0 );
sumrowproduction.CellValue( relinsert, sumproduction );
@@ -71,6 +85,7 @@
dlproduction := column.CellValue( relnew, Value := [String]dlproductionquantity );
showrowdlproduction.CellValue( relinsert, dlproduction );
sumdlproduction := selectobject( column, CellValue, c, c.Row() = sumrowdlproduction );
+
if( isnull( sumdlproduction ) ){
sumdlproduction := column.CellValue( relnew, Value := [String]0 );
sumrowdlproduction.CellValue( relinsert, sumdlproduction );
@@ -82,6 +97,7 @@
ccproduction := column.CellValue( relnew, Value := [String]ccproductionquantity );
showrowccproduction.CellValue( relinsert, ccproduction );
sumccproduction := selectobject( column, CellValue, c, c.Row() = sumrowccproduction );
+
if( isnull( sumccproduction ) ){
sumccproduction := column.CellValue( relnew, Value := [String]0 );
sumrowccproduction.CellValue( relinsert, sumccproduction );
@@ -98,21 +114,22 @@
}
sumdemand.Value( [String]( [Real]sumdemand.Value() + cell.DemandQuantity() ) );
- traverse( cell, Demand, demand ){
- demandrow := selectobject( this, Row, r, r.Name() = row.Name() and exists( r, CellValue, cv, cv.Value() = demand.Model() ) );
- sumdemandrow := selectobject( this, Row, r, r.Name() = 'SUM' and exists( r, CellValue, cv, cv.Value() = demand.Model() ) );
+ traverse( cell, Demand, demand, exists( models, Elements, model, model = demand.Model() ) ){
+ demandrow := selectobject( this, Row, r, r.Name() = row.Name() and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model() ) );
+ sumdemandrow := selectobject( this, Row, r, r.Name() = 'SUM' and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model() ) );
if( not isnull( demandrow ) ){
demandcell := column.CellValue( relnew, Value := [String]demand.Quantity() );
demandrow.CellValue( relinsert, demandcell );
}
-
+ if( not isnull( sumdemandrow ) ){
sumdemandcell := selectobject( column, CellValue, c, c.Row() = sumdemandrow );
if( isnull( sumdemandcell ) ){
sumdemandcell := column.CellValue( relnew, Value := [String]0 );
sumdemandrow.CellValue( relinsert, sumdemandcell );
}
sumdemandcell.Value( [String]( [Real]sumdemandcell.Value() + demand.Quantity() ) );
+ }
}
for( demandr := showrowdemand.RowNr() + 1; demandr < showrowinventory.RowNr(); demandr := demandr + 1 ){
@@ -140,11 +157,19 @@
traverse( this, Column, column ){
for( demandr := sumrowdemand.RowNr() + 1; demandr < sumrowinventory.RowNr(); demandr := demandr + 1 ){
demandrow := selectobject( this, Row, r, r.RowNr() = demandr );
+ // info( '------------------14----------------' );
if( not isnull( demandrow ) and not exists( demandrow, CellValue, cv, cv.Column() = column ) ){
demandcell := column.CellValue( relnew, Value := '' );
demandrow.CellValue( relinsert, demandcell );
}
}
}
+
+ rows := selectsortedset( this, Row, row, row.Name(), row.RowNr() );
+ i := 0;
+ traverse( rows, Elements, e ){
+ e.RowNr( i );
+ i := i + 1;
+ }
*]
}
diff --git a/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultCCALineUnit.qbl b/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultCCALineUnit.qbl
new file mode 100644
index 0000000..3afba65
--- /dev/null
+++ b/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultCCALineUnit.qbl
@@ -0,0 +1,11 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetDefaultCCALineUnit () const as String
+{
+ TextBody:
+ [*
+ // 鐢勫叞楦� Jun-25-2024 (created)
+ return '闀挎槬瑁呴厤绾�';
+ //return 'Assembly Plant (France)';
+ *]
+}
diff --git a/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultCCMPLineUnit.qbl b/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultCCMPLineUnit.qbl
new file mode 100644
index 0000000..0c32fd7
--- /dev/null
+++ b/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultCCMPLineUnit.qbl
@@ -0,0 +1,11 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetDefaultCCMPLineUnit () const as String
+{
+ TextBody:
+ [*
+ // 鐢勫叞楦� Jun-25-2024 (created)
+ return '闀挎槬鏈哄姞绾�';
+ //return 'Assembly Plant (France)';
+ *]
+}
diff --git a/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultDLALineUnit.qbl b/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultDLALineUnit.qbl
new file mode 100644
index 0000000..153da57
--- /dev/null
+++ b/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultDLALineUnit.qbl
@@ -0,0 +1,11 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetDefaultDLALineUnit () const as String
+{
+ TextBody:
+ [*
+ // 鐢勫叞楦� Jun-25-2024 (created)
+ return '澶ц繛瑁呴厤绾�';
+ //return 'Assembly Plant (France)';
+ *]
+}
diff --git a/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultDLMPLineUnit.qbl b/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultDLMPLineUnit.qbl
new file mode 100644
index 0000000..48e75f8
--- /dev/null
+++ b/_Main/BL/Type_EnginePipelineReport/StaticMethod_GetDefaultDLMPLineUnit.qbl
@@ -0,0 +1,11 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetDefaultDLMPLineUnit () const as String
+{
+ TextBody:
+ [*
+ // 鐢勫叞楦� Jun-25-2024 (created)
+ return '澶ц繛鏈哄姞绾�';
+ //return 'Assembly Plant (France)';
+ *]
+}
diff --git a/_Main/BL/Type_EnginePipelineSource/StaticMethod_Initialize.qbl b/_Main/BL/Type_EnginePipelineSource/StaticMethod_Initialize.qbl
index b18fbac..7b09478 100644
--- a/_Main/BL/Type_EnginePipelineSource/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_EnginePipelineSource/StaticMethod_Initialize.qbl
@@ -8,8 +8,12 @@
[*
// 鐢勫叞楦� Jun-24-2024 (created)
owner.EnginePipelineSource( relflush );
- ccunit := EnginePipelineReport::GetDefaultCCUnit();
- dlunit := EnginePipelineReport::GetDefaultDLUnit();
+ //ccunit := EnginePipelineReport::GetDefaultCCUnit();
+ //dlunit := EnginePipelineReport::GetDefaultDLUnit();
+ ccalineunit := FinancialProductionReport::GetDefaultCCALineUnit();
+ dlalienunit := FinancialProductionReport::GetDefaultDLALineUnit()
+ ccmplineunit := FinancialProductionReport::GetDefaultCCMPLineUnit()
+ dlmplineunit := FinancialProductionReport::GetDefaultDLMPLineUnit();
//allunit := EnginePipelineReport::GetDefaultAllUnit();
source := owner.EnginePipelineSource( relnew, Name := EnginePipelineReport::GetDefaultName() );
table := source.Report( relnew, ID := source.Name(), Name := source.Name() );
@@ -27,9 +31,9 @@
unit := stockingpoint.Unit();
parentunits := unit.GetAllParent();
//鏄惁灞炰簬闀挎槬宸ュ巶
- iscc := unit.ID() = ccunit or exists( parentunits, Elements, punit, punit.ID() = ccunit );
+ iscc := unit.ID() = ccalineunit or unit.ID() = ccmplineunit or exists( parentunits, Elements, punit, punit.ID() = ccalineunit or punit.ID() = ccmplineunit );
//鏄惁灞炰簬澶ц繛宸ュ巶
- isdl := unit.ID() = dlunit or exists( parentunits, Elements, punit, punit.ID() = dlunit );
+ isdl := unit.ID() = dlalienunit or unit.ID() = dlmplineunit or exists( parentunits, Elements, punit, punit.ID() = dlalienunit or punit.ID() = dlmplineunit );
traverse( stockingpoint, ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() and not pisp.IsSystem() ){
weekstart := owner.StartOfPlanning().Date();
--
Gitblit v1.9.3