From 038d0b0fb80ef6f8fad968322436b9e171419fdb Mon Sep 17 00:00:00 2001
From: yypsybs <yypsybs@foxmail.com>
Date: 星期五, 13 十月 2023 16:39:25 +0800
Subject: [PATCH] 产销预算优化
---
_Main/BL/Type_GlobalDTOTable/Method_InitTestData#12.qbl | 60 +++++++++++++++---------------
_Main/BL/Type_Global_MappingAnnualBudgetData/StaticMethod_SetOrgCodeFromForecast.qbl | 21 +++++-----
_Main/BL/Type_GlobalDTOTable/Method_CapacityAndSaleBudgeCompare.qbl | 23 ++++++-----
3 files changed, 53 insertions(+), 51 deletions(-)
diff --git a/_Main/BL/Type_GlobalDTOTable/Method_CapacityAndSaleBudgeCompare.qbl b/_Main/BL/Type_GlobalDTOTable/Method_CapacityAndSaleBudgeCompare.qbl
index ccbd232..6937389 100644
--- a/_Main/BL/Type_GlobalDTOTable/Method_CapacityAndSaleBudgeCompare.qbl
+++ b/_Main/BL/Type_GlobalDTOTable/Method_CapacityAndSaleBudgeCompare.qbl
@@ -36,22 +36,23 @@
this.CapacityAndSaleBudgeCompareItemColumn( relflush );
// ====姹囨�绘墍鏈夊嚭鐜扮殑浜у搧====
historyData := selectset( this, Global_MappingAnnualBudgetData, item, true );
- debuginfo( "historyData : " + [String]historyData.Size() )
+ debuginfo( "historyData : " + [String]historyData.Size() );
+
traverse( historyData, Elements, one ) {
productCode := one.ProductID();
- Global_MappingOperationBOM::CreateTestData( otdTable, "浜嬩笟閮�" + [String](productCode.Length() mod 3), "闈㈡澘鍩哄湴" + [String](productCode.Length() mod 4), productCode );
- boms := selectset( otdTable, Global_MappingOperationBOM, bom, bom.ProductCode() = productCode );
- if( boms.Size() > 0 ) {
- bom := boms.First();
- businessType := bom.BusinessType();
- placeOfProductionOfArray := bom.OrganCode();
+ // Global_MappingOperationBOM::CreateTestData( otdTable, "浜嬩笟閮�" + [String](productCode.Length() mod 3), "闈㈡澘鍩哄湴" + [String](productCode.Length() mod 4), productCode );
+ // boms := selectset( otdTable, Global_MappingOperationBOM, bom, bom.ProductCode() = productCode );
+ // if( boms.Size() > 0 ) {
+ // bom := boms.First();
+ // businessType := bom.BusinessType();
+ // placeOfProductionOfArray := bom.OrganCode();
// 鐩稿悓闈㈡澘鍩哄湴鍜屼簨涓氶儴鐨勬斁涓�琛�
- row := CapacityAndSaleBudgeCompareItemRow::CreateIfNotExist( this, businessType, placeOfProductionOfArray );
+ row := CapacityAndSaleBudgeCompareItemRow::CreateIfNotExist( this, one.BusinessType(), one.OrgCodeFromBom() );
// 璁板綍姣忚鍖呭惈鍝簺product
CapacityAndSaleBudgeCompareItemRowProduct::CreateIfNotExist( row, productCode );
- } else {
- debuginfo( "no boms for product : " + productCode );
- }
+ // } else {
+ // debuginfo( "no boms for product : " + productCode );
+ // }
}
debuginfo( "CapacityAndSaleBudgeCompareItemRow : " + [String]selectset( this, CapacityAndSaleBudgeCompareItemRow, item, true ).Size() );
// ====浠庡乏鍚戝彸鐢熸垚鍒楀ご涓庡唴瀹�====
diff --git "a/_Main/BL/Type_GlobalDTOTable/Method_InitTestData\04312.qbl" "b/_Main/BL/Type_GlobalDTOTable/Method_InitTestData\04312.qbl"
index 274df0b..b83e909 100644
--- "a/_Main/BL/Type_GlobalDTOTable/Method_InitTestData\04312.qbl"
+++ "b/_Main/BL/Type_GlobalDTOTable/Method_InitTestData\04312.qbl"
@@ -6,35 +6,35 @@
{
TextBody:
[*
- // yypsybs Oct-7-2023 (created)
- productCodeList := selectuniquevalues( macroPlan, Product_MP, item, item.ID() );
- debuginfo( "productCodeList : " + [String]productCodeList.Size() );
-
- this.Global_MappingAnnualBudgetData( relflush );
- if( this.Global_MappingAnnualBudgetData( relsize ) = 0 ) {
- debuginfo( "create Global_MappingAnnualBudgetData test data" );
- id := 1;
- for( year := Date::ActualDate().Year() - 10; year <= Date::ActualDate().Year() + 5; year := year + 1 ) {
- for( i := 1; i <= productCodeList.Size(); i := i + 1 ) {
- productCode := productCodeList.Element( i - 1 );
- mappingAnnualBudget := this.Global_MappingAnnualBudgetData( relnew,
- ID := [String]id,
- YearNo := [String]year,
- BusinessType := "浜嬩笟閮�" + [String](productCode.Length() mod 3),
- ProductID := productCode);
- id := id + 1;
- for( month := 1; month <= 12; month := month + 1 ) {
- field := Reflection::FindAttribute( "Global_MappingAnnualBudgetData", "MonthlyModCapacity" + [String]month );
- field.Set( mappingAnnualBudget, [String]Real::Random( 20000.0, 30000.0 ) );
- field := Reflection::FindAttribute( "Global_MappingAnnualBudgetData", "MonthlySheetCapacity" + [String]month );
- field.Set( mappingAnnualBudget, [String]Real::Random( 20000.0, 30000.0 ) );
- field := Reflection::FindAttribute( "Global_MappingAnnualBudgetData", "MonthlySales" + [String]month );
- field.Set( mappingAnnualBudget, [String]Real::Random( 20000.0, 30000.0 ) );
- }
- }
- }
- result2 := selectset( this, Global_MappingAnnualBudgetData, item, true );
- debuginfo( "test MappingAnnualBudget size : " + [String]result2.Size() );
- }
+ //// yypsybs Oct-7-2023 (created)
+ //productCodeList := selectuniquevalues( macroPlan, Product_MP, item, item.ID() );
+ //debuginfo( "productCodeList : " + [String]productCodeList.Size() );
+ //
+ //this.Global_MappingAnnualBudgetData( relflush );
+ //if( this.Global_MappingAnnualBudgetData( relsize ) = 0 ) {
+ // debuginfo( "create Global_MappingAnnualBudgetData test data" );
+ // id := 1;
+ // for( year := Date::ActualDate().Year() - 10; year <= Date::ActualDate().Year() + 5; year := year + 1 ) {
+ // for( i := 1; i <= productCodeList.Size(); i := i + 1 ) {
+ // productCode := productCodeList.Element( i - 1 );
+ // mappingAnnualBudget := this.Global_MappingAnnualBudgetData( relnew,
+ // ID := [String]id,
+ // YearNo := [String]year,
+ // BusinessType := "浜嬩笟閮�" + [String](productCode.Length() mod 3),
+ // ProductID := productCode);
+ // id := id + 1;
+ // for( month := 1; month <= 12; month := month + 1 ) {
+ // field := Reflection::FindAttribute( "Global_MappingAnnualBudgetData", "MonthlyModCapacity" + [String]month );
+ // field.Set( mappingAnnualBudget, [String]Real::Random( 20000.0, 30000.0 ) );
+ // field := Reflection::FindAttribute( "Global_MappingAnnualBudgetData", "MonthlySheetCapacity" + [String]month );
+ // field.Set( mappingAnnualBudget, [String]Real::Random( 20000.0, 30000.0 ) );
+ // field := Reflection::FindAttribute( "Global_MappingAnnualBudgetData", "MonthlySales" + [String]month );
+ // field.Set( mappingAnnualBudget, [String]Real::Random( 20000.0, 30000.0 ) );
+ // }
+ // }
+ // }
+ // result2 := selectset( this, Global_MappingAnnualBudgetData, item, true );
+ // debuginfo( "test MappingAnnualBudget size : " + [String]result2.Size() );
+ //}
*]
}
diff --git a/_Main/BL/Type_Global_MappingAnnualBudgetData/StaticMethod_SetOrgCodeFromForecast.qbl b/_Main/BL/Type_Global_MappingAnnualBudgetData/StaticMethod_SetOrgCodeFromForecast.qbl
index 149ef2e..67f51c6 100644
--- a/_Main/BL/Type_Global_MappingAnnualBudgetData/StaticMethod_SetOrgCodeFromForecast.qbl
+++ b/_Main/BL/Type_Global_MappingAnnualBudgetData/StaticMethod_SetOrgCodeFromForecast.qbl
@@ -7,18 +7,19 @@
TextBody:
[*
// yypsybs Oct-7-2023 (created)
+
traverse( parent, Global_MappingAnnualBudgetData, item ) {
- productCode := item.ProductID();
- Global_MappingOperationBOM::CreateTestData( parent, "浜嬩笟閮�" + [String](productCode.Length() mod 3), "闈㈡澘鍩哄湴" + [String](productCode.Length() mod 4), productCode );
- boms := selectset( parent, Global_MappingOperationBOM, bom, bom.ProductCode() = productCode );
- if( boms.Size() > 0 ) {
- bom := boms.First();
- placeOfProductionOfArray := bom.OrganCode();
- item.OrgCodeFromBom( placeOfProductionOfArray );
- } else {
- debuginfo( "no boms for product : " + productCode );
+ // productCode := item.ProductID();
+ //// Global_MappingOperationBOM::CreateTestData( parent, "浜嬩笟閮�" + [String](productCode.Length() mod 3), "闈㈡澘鍩哄湴" + [String](productCode.Length() mod 4), productCode );
+ // boms := selectset( parent, Global_MappingOperationBOM, bom, bom.ProductCode() = productCode );
+ // if( boms.Size() > 0 ) {
+ // bom := boms.First();
+ // placeOfProductionOfArray := bom.OrganCode();
+ // item.OrgCodeFromBom( placeOfProductionOfArray );
+ // } else {
+ // debuginfo( "no boms for product : " + productCode );
item.OrgCodeFromBom( item.OrganCode() );
- }
+ // }
}
*]
}
--
Gitblit v1.9.3