Merge branch 'dev_Kevin' into dev
| | |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | | RelationSide.RightSide MPSync |
| | | { |
| | |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: ImportExcel |
| | | OwningSide: 'Reference' |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | | } |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method HasAllRequiredFilesForImport (output Strings missingFiles_o, Boolean needUserUploadAllFiles) as Boolean |
| | | Method HasAllRequiredFilesForImport ( |
| | | output Strings missingFiles_o, |
| | | Boolean needUserUploadAllFiles |
| | | ) remote as Boolean |
| | | { |
| | | TextBody: |
| | | [* |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method HasAllRequiredFilesForImport (output Strings missingFiles_o) as Boolean |
| | | Method HasAllRequiredFilesForImport ( |
| | | output Strings missingFiles_o |
| | | ) remote as Boolean |
| | | { |
| | | TextBody: |
| | | [* |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method CanImport (output Strings missingFiles_o) as Boolean |
| | | Method CanImport ( |
| | | output Strings missingFiles_o |
| | | ) remote as Boolean |
| | | { |
| | | Description: 'Checks if necessary files are sufficent before starting import.' |
| | | TextBody: |
| | |
| | | system=false |
| | | version.component=2022.3.0.0 |
| | | version.fileformat=2 |
| | | version.quintiq=6.3.3.0 NightlyBuild 247983, build 247983 |
| | | version.quintiq=6.3.3.0 , build 248673 |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | MethodOverride Execute #extension |
| | | { |
| | | TextBody: |
| | | [* |
| | | opt := DatasetFindOptions::Construct( this.MacroPlanDatasetName() ); |
| | | mp := MDSMacroPlan::Find( opt ); |
| | | |
| | | opt := DatasetFindOptions::Construct(); |
| | | scenarioManager := MDSScenarioManager::Find( opt ); |
| | | |
| | | // Only get data source which has all required files uploaded |
| | | dummyMissingFiles := construct( Strings ); |
| | | needUserUploadAllFiles := true; |
| | | validUploadedFiles := selectset( this, LibSOPImpExp_DataSourceChildren, ds, |
| | | ds.HasAllRequiredFilesForImport( dummyMissingFiles, needUserUploadAllFiles ) ); |
| | | |
| | | traverse( validUploadedFiles, Elements, file ) |
| | | { |
| | | this.LibSOPImpExp_UserInput( relnew, Value := file.Name() ); |
| | | } |
| | | |
| | | binaryValues := selectvalues( validUploadedFiles, Elements.LibSOPImpExp_DataSourceFile.LibSOPImpExp_ImportUploadedFile, file, true, file.DataAsBinary() ); |
| | | brokerNames := selectvalues( validUploadedFiles, Elements.LibSOPImpExp_DataSourceFile, file, true, file.BrokerName() ); |
| | | userinputvalues := selectuniquevalues( this, LibSOPImpExp_UserInput, userinput, |
| | | true, |
| | | userinput.Value() ); |
| | | mpsync := this.MPSync(); |
| | | |
| | | // Reactive way to import |
| | | o := this |
| | | ->SetStatusInProgress() |
| | | ->|mp->ImportExcels_Tianma( userinputvalues, binaryValues.Copy(), brokerNames ) |
| | | ->|scenarioManager->ImportExcels_Tianma( userinputvalues, binaryValues.Copy(), brokerNames ) |
| | | ->|mpsync->ImportExcels_Tianma( userinputvalues, binaryValues.Copy(), brokerNames ) |
| | | ->|this->SetStatusDone() |
| | | ->|mp->SetLastImportTime() |
| | | ->Exception(); |
| | | |
| | | this->OnException(o); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization ImportExcel #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod IsDataSourceIncluded_Tianma ( |
| | | Strings userinputvalues, |
| | | String datasource_i |
| | | ) remote as Boolean |
| | | { |
| | | Description: 'If data source selected by user to export' |
| | | TextBody: 'return exists( userinputvalues, Elements, input, input = datasource_i );' |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization LibSOPImpExp_ExportExcel #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method ImportExcels_Tianma ( |
| | | Strings userinputvalues, |
| | | BinaryValues mpBinaryValues_i, |
| | | Strings mpBrokers_i |
| | | ) |
| | | { |
| | | Description: 'Import from Excel, used by web app.' |
| | | TextBody: |
| | | [* |
| | | // @userInput_i - Array of data group that user imports |
| | | // @mpBinaryValues_i - Array of uploaded Excels in binary value. Binary at position x matches @mpBrokers_i at same position |
| | | // @mpBrokers_i - Array of uploaded Excels' broker name |
| | | |
| | | is3DDrive := false; |
| | | |
| | | // Check if each data group has files uploaded by user for import |
| | | this.Import( LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_ImportProfiles() ), |
| | | mpBinaryValues_i, mpBrokers_i, is3DDrive, construct( FileItems), construct( Strings ) ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method ImportExcels_Tianma ( |
| | | Strings userinputvalues, |
| | | BinaryValues mpBinaryValues_i, |
| | | Strings mpBrokers_i |
| | | ) |
| | | { |
| | | Description: 'Import from Excel, used by web app.' |
| | | TextBody: |
| | | [* |
| | | // @userinputvalues - Array of data group that user imports |
| | | // @mpBinaryValues_i - Array of uploaded Excels in binary value. Binary at position x matches @mpBrokers_i at same position |
| | | // @mpBrokers_i - Array of uploaded Excels' broker name |
| | | |
| | | is3DDrive := false; |
| | | |
| | | // Check if each data group has files uploaded by user for import |
| | | this.Synchronize( LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_SupplyChainParameters() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_GlobalParameters() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Periods() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MP_Functionality_InventorySpecifications() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MP_Functionality_InventorySupplies() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Products() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Forecasts() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_ServiceLevels() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Campaigns() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Entities() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Costs() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Lanes() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Routings() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Capacities() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MP_Functionality_SupplySpecifications() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Recipes() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MP_Designer_Actuals() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MP_GlobalParameters_KPIFeedbackName() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_OptimizerPuzzles() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_PostponementSpecAndFulfillmentRestriction() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_CustomerOrder() ), |
| | | false, /* isImportBinary */ |
| | | mpBinaryValues_i, |
| | | mpBrokers_i, |
| | | is3DDrive, |
| | | construct( FileItems ), /* 3ddrive, ignore */ |
| | | construct( Strings ) /* 3ddrive, ignore */ ); |
| | | *] |
| | | } |
| | |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-21-2023 (created) |
| | | |
| | | keyProductList := construct( Strings ); |
| | | if( isKeyProduct ) { |
| | | keyProductList := selectuniquevalues( globalOTDTable, Global_MappingProduct_MP, item, item.ProductMajorType()="æå" or item.ProductMajorType()="åæå", item.ID() ); |
| | |
| | | // ========åç»å¤çè¾å
¥======== |
| | | |
| | | } |
| | | |
| | | if( not isnull( stockingPoint)){ |
| | | if( isKeyProduct){ |
| | | keyRows := selectset( routingRows,Elements,routingrow,keyProductList.Find( routingrow.ComponentCode())>=0); |
| | |
| | | this.MappingOperationBOMDataSupplyPurchase( bom.OrganCode(), bom.ComponentCode(), bom.ComponentType()); |
| | | } |
| | | } |
| | | |
| | | |
| | | // |
| | | //keyProductList := construct( Strings ); |
| | | //if( isKeyProduct ) { |
| | | // keyProductList := selectuniquevalues( globalOTDTable, Global_MappingProduct_MP, item, item.ProductMajorType()="æå" or item.ProductMajorType()="åæå", item.ID() ); |
| | | //} |
| | | //bomList := selectsortedset( globalOTDTable, Global_MappingOperationBOM, 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 ) |
| | | // , |
| | | // item.OrganCode() + "_" + item.ProductCode() + "_" + item.ProcessSection() ); |
| | | //// æroutingåroutingStepåç» |
| | | //routingIds := selectuniquevalues( bomList, Elements, item, true, item.OrganCode() + "_" + item.ProductCode() ); |
| | | //traverse( routingIds, Elements, routingId ) { |
| | | // routingRows := selectset( bomList, Elements, item, true, routingId = item.OrganCode() + "_" + item.ProductCode() ); |
| | | // if( routingRows.Size() > 0 ) { |
| | | // firstRow := routingRows.Element( 0 ); |
| | | //// stockingPointId := firstRow.OrganCode() + "_" + firstRow.ProductType() + "_Stock"; |
| | | //// inputStockingPointId := firstRow.OrganCode() + "_" + firstRow.ComponentType() + "_Stock"; |
| | | // stockingPointId := firstRow.OrganCode() + "_Stock"; |
| | | // |
| | | // // ========æ£æ¥======== |
| | | // product := Product_MP::FindProductTypeIndex( firstRow.ProductCode() ); |
| | | // if( not isnull( product ) ) { |
| | | //// error( "product : " + firstRow.ProductCode() + " not found" ); |
| | | // stockingPoint := StockingPoint_MP::FindStockingPointTypeIndex( stockingPointId ); |
| | | // |
| | | //// info( stockingPointId.AsQUILL() ); |
| | | // // if( isnull( stockingPoint ) ) { |
| | | // // error( "stockingPoint : " + stockingPointId + " not found" ); |
| | | // // } |
| | | // routing := Routing::FindRoutingTypeIndex( routingId ); |
| | | // if( not isnull( routing ) ) { |
| | | //// error( "routing : " + routingId + " not found" ); |
| | | // // ========å¤çè¾åº======== |
| | | // if( not isnull( stockingPoint ) ) { |
| | | //// info( 1 ); |
| | | // operationsInLastSteps := Operation::FindFinalOperationsByRoutingId( this, routingId ); |
| | | // traverse( operationsInLastSteps, Elements, operationsInLastStep ) { |
| | | // operationsInLastStep.CreateOperationBOM( product, stockingPoint, false, true ); |
| | | // operationsInLastStep.GetOperationBOM( product.ID(), stockingPoint.ID(), false ).Quantity( 1 ); |
| | | // } |
| | | // // ========åç»å¤çè¾å
¥======== |
| | | // |
| | | // } |
| | | // if( not isnull( stockingPoint)){ |
| | | // if( isKeyProduct){ |
| | | // keyRows := selectset( routingRows,Elements,routingrow,keyProductList.Find( routingrow.ComponentCode())>=0); |
| | | // this.MappingOperationBOMDataRouting( routing,globalOTDTable,keyRows); |
| | | // }else{ |
| | | // this.MappingOperationBOMDataRouting( routing,globalOTDTable,routingRows); |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | //if( createPurchaseSupplyMaterial ) { |
| | | // toCreateBomList := selectuniquevalues( bomList, Elements, item, |
| | | // item.ComponentType() = "P", item.OrganCode() + item.ComponentCode()); |
| | | // traverse( toCreateBomList, Elements, key ) { |
| | | // boms := selectset( bomList, Elements, item, item.ComponentType() = "P" and item.OrganCode() + item.ComponentCode() = key ); |
| | | // bom := boms.First(); |
| | | // this.MappingOperationBOMDataSupplyPurchase( bom.OrganCode(), bom.ComponentCode(), bom.ComponentType()); |
| | | // } |
| | | //} |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method ImportExcels_Tianma ( |
| | | Strings userinputvalues, |
| | | BinaryValues mpBinaryValues_i, |
| | | Strings mpBrokers_i |
| | | ) |
| | | { |
| | | Description: 'Import from Excel, used by web app.' |
| | | TextBody: |
| | | [* |
| | | // @userinputvalues - Array of data group that user imports |
| | | // @mpBinaryValues_i - Array of uploaded Excels in binary value. Binary at position x matches @mpBrokers_i at same position |
| | | // @mpBrokers_i - Array of uploaded Excels' broker name |
| | | |
| | | is3DDrive := false; |
| | | |
| | | // Check if each data group has files uploaded by user for import |
| | | this.Import( LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Strategies() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Accounts() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_Bookmarks() ), |
| | | LibSOPImpExp_ExportExcel::IsDataSourceIncluded_Tianma( userinputvalues, Translations::MPSync_ObjectGroup_KPISetting() ), |
| | | mpBinaryValues_i.Copy(), |
| | | mpBrokers_i, |
| | | is3DDrive, |
| | | construct( FileItems ), /* 3ddrive, ignore */ |
| | | construct( Strings ) /* 3ddrive, ignore */ ); |
| | | *] |
| | | } |