¶Ô±ÈÐÂÎļþ |
| | |
| | | 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(); |
| | | } |
| | | //å 餿²¡æç¨å°äº§åålaneçåºåç¹ |
| | | traverse( this,StockingPoint_MP,stock,stock.ProductInStockingPoint_MP(relsize ) = 0 ){ |
| | | stock.Delete(); |
| | | } |
| | | *] |
| | | } |
| | |
| | | info( "CustomerOrder has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | priorityName :="Normal"; |
| | | // å¤ç |
| | | traverse( listToDeal, Elements, item ) { |
| | | count := count + 1; |
| | |
| | | // 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()); |
| | |
| | | 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" ); |
| | |
| | | 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); |
| | | |
| | | |
| | |
| | | // å¾
å¤çæ°æ® |
| | | 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() ); |
| | |
| | | info( "Forecast has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | priorityName := "Normal"; |
| | | // å¤ç |
| | | traverse( listToDeal, Elements, item ) { |
| | | count := count + 1; |
| | |
| | | } |
| | | // 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{ |
| | |
| | | |
| | | 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() ); |
| | | // æroutingåroutingStepåç» |
| | | routingIds := selectuniquevalues( bomList, Elements, item, true, item.OrganCode() + "_" + item.ProductCode() ); |
| | |
| | | |
| | | } |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | #parent: #root |
| | | Method MappingOperationBOMDataRouting ( |
| | | Routing routing, |
| | | MappingBOMs routingRows, |
| | | StockingPoint_MP stockingPoint, |
| | | Strings keyProductIds |
| | | MappingBOMs routingRows |
| | | ) |
| | | { |
| | | TextBody: |
| | |
| | | if( not isnull( component ) ) { |
| | | // error( "component : " + noAlterRow.ComponentCode() + " not found" ); |
| | | // è¿æ¥äº§åä¸operation |
| | | 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, |
| | |
| | | // } |
| | | traverse( routingStep, Operation, toLink ) { |
| | | // è¿æ¥äº§åä¸operation |
| | | 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, |
| | |
| | | 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 ); |
| | |
| | | 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(), |
| | |
| | | |
| | | //Set the Default values |
| | | unitofmeasurename := "PCS"; |
| | | infinite := "Infinite"; |
| | | capacitytype := "Transport quantity"; |
| | | |
| | | // Get the root data |
| | |
| | | "天马éå¢", |
| | | "天马éå¢", |
| | | "", |
| | | capacitytype, |
| | | infinite, |
| | | unitofmeasurename ); |
| | | |
| | | // Get the sub root data |
| | |
| | | "ç产", |
| | | "ç产", |
| | | "天马éå¢", |
| | | capacitytype, |
| | | infinite, |
| | | unitofmeasurename ); |
| | | |
| | | Unit::CreateOrUpdate( this, |
| | | "ä¾åºå", |
| | | "ä¾åºå", |
| | | "天马éå¢", |
| | | capacitytype, |
| | | infinite, |
| | | unitofmeasurename ); |
| | | |
| | | Unit::CreateOrUpdate( this, |
| | |
| | | item.OrganCode(), |
| | | OrgName, |
| | | "ç产", |
| | | capacitytype, |
| | | infinite, |
| | | unitofmeasurename ); |
| | | |
| | | //Get the second level unit |
| | |
| | | secondlevelid, |
| | | secondlevelid, |
| | | item.OrganCode(), |
| | | capacitytype, |
| | | infinite, |
| | | unitofmeasurename ); |
| | | |
| | | //Get the third level unit |
| | |
| | | // 订åéæ±-18 |
| | | CustomerOrder::DoSync( macroPlan, businessTypes ); |
| | | |
| | | //å é¤å¤ä½æ¥éæ°æ®-19 |
| | | //macroPlan.DeleteSnaityCheck(); |
| | | |
| | | //// todo ä¾åºåè½å |
| | | //info( "ProviderCapacity::DoSync" ) |
| | | |