From 5ac4d4f977b27ee53ec4bc544cc2a6b4019c8fbd Mon Sep 17 00:00:00 2001
From: renhao <renhui.hao@capgemini.com>
Date: 星期一, 18 九月 2023 15:09:27 +0800
Subject: [PATCH] 1 接口数据修正
---
_Main/BL/Type_MacroPlan/StaticMethod_DoSync0.qbl | 3 +
_Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl | 3 +
_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataRouting#576.qbl | 13 ++++--
_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl | 7 ++-
_Main/BL/Type_MacroPlan/Method_DeleteSnaityCheck.qbl | 21 ++++++++++
_Main/BL/Type_MacroPlan/Method_MappingProductData.qbl | 30 +++++++-------
_Main/BL/Type_MacroPlan/Method_MappingForecastData.qbl | 7 ++-
_Main/BL/Type_MacroPlan/Method_MappingUnitData.qbl | 11 +++--
_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl | 17 ++++++--
9 files changed, 75 insertions(+), 37 deletions(-)
diff --git a/_Main/BL/Type_MacroPlan/Method_DeleteSnaityCheck.qbl b/_Main/BL/Type_MacroPlan/Method_DeleteSnaityCheck.qbl
new file mode 100644
index 0000000..d5d02e1
--- /dev/null
+++ b/_Main/BL/Type_MacroPlan/Method_DeleteSnaityCheck.qbl
@@ -0,0 +1,21 @@
+Quintiq file version 2.0
+#parent: #root
+Method DeleteSnaityCheck
+{
+ TextBody:
+ [*
+ // renhao Sep-13-2023 (created)
+ //鍒犻櫎娌℃湁姹囩巼鐨勮揣甯�
+ traverse( this,Currency_MP,currency,not currency.IsBase() and currency.CurrencyRate_MP( relsize ) = 0 ){
+ currency.Delete();
+ }
+ //鍒犻櫎娌℃湁浜у搧鐨勮溅閬�
+ traverse( this,Unit.Lane,lane,not isnull( lane) and lane.ProductInLane(relsize )=0 ){
+ lane.Delete();
+ }
+ //鍒犻櫎娌℃湁鐢ㄥ埌浜у搧鍜宭ane鐨勫簱瀛樼偣
+ traverse( this,StockingPoint_MP,stock,stock.ProductInStockingPoint_MP(relsize ) = 0 ){
+ stock.Delete();
+ }
+ *]
+}
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl
index 873ed35..3916a05 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl
@@ -23,6 +23,7 @@
info( "CustomerOrder has " + totalcount.AsQUILL() + " rows in total" );
count := 0;
+ priorityName :="Normal";
// 澶勭悊
traverse( listToDeal, Elements, item ) {
count := count + 1;
@@ -33,7 +34,7 @@
// info( item.ProductID().AsQUILL() );
CustomerOrder::CreateOrUpdate( this, item.CurrencyID(), item.Customer(), item.CustomerID(), item.ID(),
item.OrderDate(), item.OrderID(), item.OrderLineID(), item.Price(),
- item.PriorityName(), item.ProductID(),
+ priorityName, item.ProductID(),
item.StockPointID(),
item.SalesSegmentName(),
item.Quantity(), item.UnitOfMeasureName(), item.OrderType(), item.IsAvailable());
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl
index 1bdf79c..3ab280c 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl
@@ -8,8 +8,9 @@
TextBody:
[*
// renhao Aug-14-2023 (created)
-
- listtodeal := selectset( this,MappingExternalSupply,externalSupply, externalSupply.UserQuantity()>0 );
+ queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date();
+ queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() );
+ listtodeal := selectset( this,MappingExternalSupply,externalSupply, externalSupply.UserQuantity()>0 and externalSupply.Date() >= queryStartDate and externalSupply.Date() <= queryEndDate);
totalcount := listtodeal.Size();
description := "鍦ㄩ�斿湪鍒�";
info( "ExternalSupply has " + totalcount.AsQUILL() + " rows in total" );
@@ -19,7 +20,7 @@
count := count + 1;
if( count - [Number](count/1000) * 1000 = 0 or count = totalcount ){
info( "Now is dealing with the " + count.AsQUILL() + "ExternalSupply " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" );
- }
+ }
product := select( this,MappingProduct,product,product.ID() = externalSupply.ProductID(),true);
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingForecastData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingForecastData.qbl
index 903aea0..47e8597 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingForecastData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingForecastData.qbl
@@ -11,9 +11,9 @@
// 寰呭鐞嗘暟鎹�
listToDeal := construct( structured[MappingForecast] );
if( isnull( businessTypes ) or businessTypes.Size() = 0 ) {
- listToDeal := selectset( this, MappingForecast, item, true );
+ listToDeal := selectset( this, MappingForecast, item, item.Quantity() > 0 );
} else {
- listToDeal := selectset( this, MappingForecast, item, businessTypes.Find( item.BusinessType() ) <> -1 );
+ listToDeal := selectset( this, MappingForecast, item, businessTypes.Find( item.BusinessType() ) <> -1 and item.Quantity()>0 );
}
queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date();
queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() );
@@ -23,6 +23,7 @@
info( "Forecast has " + totalcount.AsQUILL() + " rows in total" );
count := 0;
+ priorityName := "Normal";
// 澶勭悊
traverse( listToDeal, Elements, item ) {
count := count + 1;
@@ -31,7 +32,7 @@
}
// if( not isnull( Product_MP::FindById( this, item.ProductID() ) ) ){
Forecast::CreateOrUpdate( this,
- item.ProductID(), item.SalesSegmentName(), item.StockingPointID(), item.PriorityName(),
+ item.ProductID(), item.SalesSegmentName(), item.StockingPointID(), priorityName,
item.CurrencyID(), item.UnitOfMeasureName(),
item.ID(), item.StartDate(), item.EndDate(), item.Quantity(), item.Price());
// }else{
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl
index 892f5ef..b152a6e 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl
@@ -12,16 +12,17 @@
keyProductList := construct( Strings );
if( isKeyProduct ) {
- keyProductList := selectuniquevalues( this, MappingProduct, item, item.KeyProduct(), item.ID() );
+ keyProductList := selectuniquevalues( this, MappingProduct, item, item.ProductMajorType()="鎴愬搧" or item.ProductMajorType()="鍗婃垚鍝�", item.ID() );
}
bomList := selectsortedset( this, MappingBOM, item,
ifexpr( isnull( businessTypes ) or businessTypes.Size() = 0,
true,
// businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 )
businessTypes.Find( item.BusinessType() ) >= 0 )
- and ifexpr( isKeyProduct,
- keyProductList.Size() > 0 and keyProductList.Find( item.ComponentCode() ) >= 0,
- true ),
+ // and ifexpr( isKeyProduct,
+ // keyProductList.Size() > 0 and keyProductList.Find( item.ComponentCode() ) >= 0,
+ // true )
+ ,
item.OrganCode() + "_" + item.ProductCode() + "_" + item.ProcessSection() );
// 鎸塺outing鍙妑outingStep鍒嗙粍
routingIds := selectuniquevalues( bomList, Elements, item, true, item.OrganCode() + "_" + item.ProductCode() );
@@ -56,7 +57,13 @@
}
if( not isnull( inputStockingPoint)){
- this.MappingOperationBOMDataRouting( routing,routingRows,inputStockingPoint,keyProductList);
+ if( isKeyProduct){
+ keyRows := selectset( routingRows,Elements,routingrow,keyProductList.Find( routingrow.ComponentCode())>=0);
+ this.MappingOperationBOMDataRouting( routing,keyRows);
+ }else{
+ this.MappingOperationBOMDataRouting( routing,routingRows);
+ }
+
}
}
}
diff --git "a/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataRouting\043576.qbl" "b/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataRouting\043576.qbl"
index 059c6c9..24a85f3 100644
--- "a/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataRouting\043576.qbl"
+++ "b/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataRouting\043576.qbl"
@@ -2,9 +2,7 @@
#parent: #root
Method MappingOperationBOMDataRouting (
Routing routing,
- MappingBOMs routingRows,
- StockingPoint_MP stockingPoint,
- Strings keyProductIds
+ MappingBOMs routingRows
)
{
TextBody:
@@ -32,6 +30,8 @@
if( not isnull( component ) ) {
// error( "component : " + noAlterRow.ComponentCode() + " not found" );
// 杩炴帴浜у搧涓巓peration
+ inputStockingPointId := noAlterRow.OrganCode() + "_" + noAlterRow.ComponentType() + "_Stock";
+ stockingPoint := StockingPoint_MP::FindStockingPointTypeIndex( inputStockingPointId);
pisp := ProductInStockingPoint_MP::CreateIfNotFound( component, stockingPoint );
trash := construct( OperationBOMs );
operationBOM := toLink.LinkProduct( component, true, BaseOperationLink::GetGroupID( toLink, true, false ), pisp,
@@ -54,6 +54,8 @@
// }
traverse( routingStep, Operation, toLink ) {
// 杩炴帴浜у搧涓巓peration
+ inputStockingPointId := firstAlterRow.OrganCode() + "_" + firstAlterRow.ComponentType() + "_Stock";
+ stockingPoint := StockingPoint_MP::FindStockingPointTypeIndex( inputStockingPointId);
pisp := ProductInStockingPoint_MP::CreateIfNotFound( component, stockingPoint );
trash := construct( OperationBOMs );
mainBOM := toLink.LinkProduct( component, true, BaseOperationLink::GetGroupID( toLink, true, false ), pisp,
@@ -67,13 +69,14 @@
alterProd := Product_MP::FindById( this, alterRow.AlternativeMaterialCode() );
if( not isnull( alterProd ) ) {
// error( "alterProd : " + alterRow.AlternativeMaterialCode() + " not found" );
- stockingPointIdAlter := alterRow.OrganCode() + "_" + alterRow.ProductType() + "_Stock";
+ stockingPointIdAlter := alterRow.OrganCode() + "_" + alterRow.ComponentType() + "_Stock";
stockingPointAlter := StockingPoint_MP::FindById( this, stockingPointIdAlter );
if( isnull( stockingPointAlter ) ) {
error( "stockingPoint : " + stockingPointIdAlter + " not found" );
}
pispAlter := ProductInStockingPoint_MP::CreateIfNotFound( alterProd, stockingPointAlter );
- mainInput := toLink.LastOperationInput();
+ //mainInput := toLink.LastOperationInput();
+ mainInput := select( toLink,OperationInput,operationInut,operationInut.ProductID()=alterRow.ComponentCode());
trash := construct( OperationBOMs );
if( not isnull( mainInput ) ) {
alterBom := mainInput.Operation().LinkPISP( pispAlter, true, mainInput.OperationLinkGroupID(), trash );
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingProductData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingProductData.qbl
index 547f0bf..9a854ef 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingProductData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingProductData.qbl
@@ -62,25 +62,25 @@
productmajortype := "鍏ㄩ儴鐗╂枡浜у搧";
}
- if( not item.ProductSubclassType() = "" ){
- Product_MP::CreateOrUpdate( this,
- item.ProductSubclassType(),
- productmajortype,
- item.ProductSubclassType(),
- "PCS",
- item.ProductSubclassType(),
- 0.0,false,false
- );
- }
- productsubclasstype := item.ProductSubclassType();
- if( productsubclasstype="" ){
- productsubclasstype := productmajortype;
- }
+ // if( not item.ProductSubclassType() = "" ){
+ // Product_MP::CreateOrUpdate( this,
+ // item.ProductSubclassType(),
+ // productmajortype,
+ // item.ProductSubclassType(),
+ // "PCS",
+ // item.ProductSubclassType(),
+ // 0.0,false,false
+ // );
+ // }
+ // productsubclasstype := item.ProductSubclassType();
+ // if( productsubclasstype="" ){
+ // productsubclasstype := productmajortype;
+ // }
if( not item.ID() = "" ){
Product_MP::CreateOrUpdate( this,
item.ID(),
- productsubclasstype,
+ productmajortype,
item.ID(),
item.UnitOfMeasureName(),
item.Name(),
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingUnitData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingUnitData.qbl
index b5618c6..7c856ff 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingUnitData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingUnitData.qbl
@@ -22,6 +22,7 @@
//Set the Default values
unitofmeasurename := "PCS";
+ infinite := "Infinite";
capacitytype := "Transport quantity";
// Get the root data
@@ -29,7 +30,7 @@
"澶╅┈闆嗗洟",
"澶╅┈闆嗗洟",
"",
- capacitytype,
+ infinite,
unitofmeasurename );
// Get the sub root data
@@ -37,14 +38,14 @@
"鐢熶骇",
"鐢熶骇",
"澶╅┈闆嗗洟",
- capacitytype,
+ infinite,
unitofmeasurename );
Unit::CreateOrUpdate( this,
"渚涘簲鍟�",
"渚涘簲鍟�",
"澶╅┈闆嗗洟",
- capacitytype,
+ infinite,
unitofmeasurename );
Unit::CreateOrUpdate( this,
@@ -65,7 +66,7 @@
item.OrganCode(),
OrgName,
"鐢熶骇",
- capacitytype,
+ infinite,
unitofmeasurename );
//Get the second level unit
@@ -74,7 +75,7 @@
secondlevelid,
secondlevelid,
item.OrganCode(),
- capacitytype,
+ infinite,
unitofmeasurename );
//Get the third level unit
diff --git a/_Main/BL/Type_MacroPlan/StaticMethod_DoSync0.qbl b/_Main/BL/Type_MacroPlan/StaticMethod_DoSync0.qbl
index fe4e7a1..168122d 100644
--- a/_Main/BL/Type_MacroPlan/StaticMethod_DoSync0.qbl
+++ b/_Main/BL/Type_MacroPlan/StaticMethod_DoSync0.qbl
@@ -140,6 +140,9 @@
// 璁㈠崟闇�姹�-18
CustomerOrder::DoSync( macroPlan, businessTypes );
+ //鍒犻櫎澶氫綑鎶ラ敊鏁版嵁-19
+ //macroPlan.DeleteSnaityCheck();
+
//// todo 渚涘簲鍟嗚兘鍔�
//info( "ProviderCapacity::DoSync" )
--
Gitblit v1.9.3