From eab10a370cd6e9d46c67ef1b8dbf6c767e1d478b Mon Sep 17 00:00:00 2001
From: limj <limj@taizhitech.com>
Date: 星期一, 09 十月 2023 09:45:42 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lmj
---
_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl | 28 +++++++++++---
_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl | 35 ++++++++++-------
2 files changed, 42 insertions(+), 21 deletions(-)
diff --git a/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl b/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl
index b327f63..226f832 100644
--- a/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl
+++ b/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl
@@ -14,8 +14,24 @@
[*
numberOfLayers++;
//info( "鐩爣鏃堕棿锛�", targetDate.Format( "Y-M2-D2" ) );
- info( pisp.Name() );
+ //info( pisp.Name() );
traverse ( pisp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispippl, pispippl.Start().Date() = targetDate ) {
+ //info( "鏄惁鏈変緵搴旓細", pispippl.NewSupply( relsize ) > 0, " 搴撳瓨锛�", pispippl.InventoryLevelEnd() );
+ if ( numberOfLayers <> 1 and pispippl.NewSupply( relsize ) = 0 ) {
+ previous := pispippl.PreviousPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf );
+ if ( not previous.Period_MP().IsHistorical() ) {
+ previousDate := previous.Start().Date();
+ CapacityAllocationResults::IterativeGeneration2( globalOTDTable,
+ pisp,
+ previousDate,
+ carrcs,
+ numberOfLayers,
+ firstLevelSupply,
+ currentLayerDependentDemandQuantity
+ );
+ }
+ }
+
traverse ( pispippl, NewSupply, ns, ns.Quantity() > 0 ) {
if ( numberOfLayers = 1 ) {
firstLevelSupply := ns;
@@ -24,7 +40,7 @@
ontype( ns.PeriodTask_MP() ) {
PeriodTaskOperation as pto : {
// info( "Operation鍛ㄦ湡浠诲姟..." );
- traverse ( ns, PeriodTask_MP.astype( PeriodTaskOperation ).DependentDemand, dd ) {
+ traverse ( ns, PeriodTask_MP.astype( PeriodTaskOperation ).DependentDemand, dd, dd.Quantity() > 0 ) {
if ( numberOfLayers = 1 ) {
currentLayerDependentDemandQuantity := ns.Quantity();
}
@@ -56,8 +72,8 @@
ModuleMeasurementUnit := firstLevelSupply.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().UnitOfMeasureName(),
ModuleBase := guard( firstLevelSupply.PeriodTask_MP().astype( PeriodTaskOperation ).Operation().UnitID(), "杞﹂亾杩愯緭" ),
Division := carrc.Division(),
- RequirementDate := ns.Start().Date(),
- Date := ns.Start().Date(),
+ RequirementDate := firstLevelSupply.Start().Date(),
+ Date := firstLevelSupply.Start().Date(),
Description := "",
ID := OS::GenerateGUIDAsString(),
ProductID := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID(),
@@ -67,7 +83,7 @@
);
}
- info( "-----------------------------------------------------------------------------------------------------------------" );
+ //info( "-----------------------------------------------------------------------------------------------------------------" );
}
PeriodTaskLaneLeg as ptll : {
@@ -76,7 +92,7 @@
// info( "灞傛暟锛�", numberOfLayers," 褰撳墠渚涘簲鐨刾isp锛�", ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), " 鎬讳緵搴斿�硷細", ns.Quantity(), " 闇�瑕佷緵搴斿�硷細", currentLayerDependentDemandQuantity,
// " 褰撳墠闇�姹俻isp锛�", targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), " 闇�姹傚�硷細", currentLayerDependentDemandQuantity );
// info( "LaneLeg鍛ㄦ湡浠诲姟..." );
- info( "-----------------------------------------------------------------------------------------------------------------" );
+ //info( "-----------------------------------------------------------------------------------------------------------------" );
CapacityAllocationResults::IterativeGeneration2( globalOTDTable,
targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP(),
targetDate,
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
index 219bbfc..e6907cc 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
@@ -50,21 +50,26 @@
id := id + "_" + item.Line();
}
operation := Operation::FindOperationTypeIndex( id );
- account := Account_MP::FindByName( this, "Operation cost" );
- isfromdb := false;
- existoperationcost := OperationCost::FindOperationCostTypeIndex( id );
- if( isnull( existoperationcost ) ){
- connecteditem := select( globalOTDTable,
- Global_MappingOperationCost,
- moperationcost,
- moperationcost.OrgCode() = item.OrganCode(),
- moperationcost.ProductID() = item.ProductID() );
- cost := connecteditem.Cost();
- lengthoftime := connecteditem.LengthOfTime();
- start := connecteditem.Start();
- timeunit := connecteditem.TimeUnit();
- OperationCost::Create( id, operation, account, "Volume", start, timeunit, lengthoftime, cost, isfromdb );
- }
+ if(not isnull(operation)){
+ account := Account_MP::FindByName( this, "Operating cost" );
+ isfromdb := false;
+ existoperationcost := OperationCost::FindOperationCostTypeIndex( id );
+ if( isnull( existoperationcost ) ){
+ connecteditem := select( globalOTDTable,
+ Global_MappingOperationCost,
+ moperationcost,
+ moperationcost.OrgCode() = item.OrganCode(),
+ moperationcost.ProductID() = item.ProductID() );
+ if( not isnull( connecteditem)){
+ cost := connecteditem.Cost();
+ lengthoftime := connecteditem.LengthOfTime();
+ start := connecteditem.Start();
+ timeunit := connecteditem.TimeUnit();
+ OperationCost::Create( id, operation, account, "Volume", start, timeunit, lengthoftime, cost, isfromdb );
+ }
+
+ }
}
+ }
*]
}
--
Gitblit v1.9.3