已重命名2个文件
已修改49个文件
已添加64个文件
已删除34个文件
| | |
| | | #keys: '3[138186.0.341081382][138186.0.341081381][138186.0.341081383]' |
| | | Description: 'Customer unique ID' |
| | | ValueType: String |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | #keys: '3[138186.0.341081370][138186.0.341081369][138186.0.341081371]' |
| | | Description: 'Name of the customer' |
| | | ValueType: String |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | #keys: '3[138186.0.341081379][138186.0.341081378][138186.0.341081380]' |
| | | Description: 'Unique order ID' |
| | | ValueType: String |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | #keys: '3[138186.0.341081373][138186.0.341081372][138186.0.341081374]' |
| | | Description: 'Unique ID of the order line' |
| | | ValueType: String |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | |
| | | return ioproduct; |
| | | *] |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | #keys: '3[138186.0.341091998][138186.0.341091997][138186.0.341091999]' |
| | | Description: 'Foreign key' |
| | | ValueType: String |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | This percentage is used to calculate StandardDeviationDemand on PISPIP. |
| | | *] |
| | | ValueType: Real |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | InterfaceProperties { Accessibility: 'Module' Visibility: 'BusinessModel' } |
| | | } |
| | |
| | | { |
| | | #keys: '3[138186.0.341091995][138186.0.341091994][138186.0.341091996]' |
| | | ValueType: Date |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | Description: 'Sales Demand ID' |
| | | IsReadOnly: true |
| | | ValueType: String |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | { |
| | | #keys: '3[138186.0.341061308][138186.0.341061307][138186.0.341061309]' |
| | | ValueType: Real |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | { |
| | | #keys: '3[138186.0.341061314][138186.0.341061313][138186.0.341061315]' |
| | | ValueType: String |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | { |
| | | #keys: '3[138186.0.341061311][138186.0.341061310][138186.0.341061312]' |
| | | ValueType: String |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | { |
| | | #keys: '3[138186.0.341061305][138186.0.341061304][138186.0.341061306]' |
| | | ValueType: Real |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | { |
| | | #keys: '3[138186.0.341061299][138186.0.341061298][138186.0.341061300]' |
| | | ValueType: String |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | { |
| | | #keys: '3[138186.0.341061302][138186.0.341061301][138186.0.341061303]' |
| | | ValueType: Date |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | { |
| | | #keys: '3[138186.0.341061317][138186.0.341061316][138186.0.341061318]' |
| | | ValueType: String |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | #keys: '3[138186.0.341061321][138186.0.341061320][138186.0.341061322]' |
| | | Description: 'Unit of measure for sales demand' |
| | | ValueType: String |
| | | InterfaceProperties { Accessibility: 'Module' } |
| | | } |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_ActualPISPIP |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_ActualPISPIP |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_BOM |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_MappingBOM |
| | |
| | | EDIMLTable MappingBOM |
| | | { |
| | | PrimaryKeyColumns: AlternativeMaterialCode |
| | | PrimaryKeyColumns: BusinessType |
| | | PrimaryKeyColumns: ComponentCode |
| | | PrimaryKeyColumns: OrganCode |
| | | PrimaryKeyColumns: ProcessSection |
| | |
| | | EDIMLColumn ComponentType { Attribute: ComponentType ValueType: String } |
| | | EDIMLColumn ComponentUnit { Attribute: ComponentUnit ValueType: String } |
| | | EDIMLColumn ComponentUnitDescription { Attribute: ComponentUnitDescription ValueType: String } |
| | | EDIMLColumn DescriptionOfAlternativeMaterial { Attribute: DescriptionOfAlternativeMaterial ValueType: String } |
| | | EDIMLColumn DescriptionOfAlternativeMaterialUnits { Attribute: DescriptionOfAlternativeMaterialUnits ValueType: String } |
| | | EDIMLColumn DescriptionOfAlternativeMaterials { Attribute: DescriptionOfAlternativeMaterials ValueType: String } |
| | | EDIMLColumn MaterialSystem { Attribute: MaterialSystem ValueType: String } |
| | | EDIMLColumn OrganCode { Attribute: OrganCode ValueType: String } |
| | | EDIMLColumn ProcessSection { Attribute: ProcessSection ValueType: String } |
| | |
| | | OthersMayDropTable: true |
| | | OthersMayFlushTable: true |
| | | OthersMayInsertRow: true |
| | | Parameters: '/owner="TIANMA"' |
| | | Parameters: '/owner="YUXTEST"' |
| | | RecordModificationHintStrategy: 'None' |
| | | EDIODBCLinkColumn ALTERNATIVEMATERIALCODE |
| | | { |
| | |
| | | OthersMayUpdateColumn: true |
| | | ValueType: String |
| | | } |
| | | EDIODBCLinkColumn DESCRIPTIONOFALTERNATIVEMATERIAL |
| | | EDIODBCLinkColumn DESCRIPTIONOFALTERNATIVEMATERIALS |
| | | { |
| | | OthersMayUpdateColumn: true |
| | | ValueType: String |
| | | } |
| | | EDIODBCLinkColumn DESCRIPTIONOFALTERNATIVEMATERIALUNIT |
| | | EDIODBCLinkColumn DESCRIPTIONOFALTERNATIVEMATERIALUNITS |
| | | { |
| | | OthersMayUpdateColumn: true |
| | | ValueType: String |
| | |
| | | EDIColumnMatch { InputColumn: COMPONENTTYPE OutputColumn: ComponentType } |
| | | EDIColumnMatch { InputColumn: COMPONENTUNIT OutputColumn: ComponentUnit } |
| | | EDIColumnMatch { InputColumn: COMPONENTUNITDESCRIPTION OutputColumn: ComponentUnitDescription } |
| | | EDIColumnMatch { InputColumn: DESCRIPTIONOFALTERNATIVEMATERIAL OutputColumn: DescriptionOfAlternativeMaterial } |
| | | EDIColumnMatch { InputColumn: DESCRIPTIONOFALTERNATIVEMATERIALUNIT OutputColumn: DescriptionOfAlternativeMaterialUnits } |
| | | EDIColumnMatch { InputColumn: DESCRIPTIONOFALTERNATIVEMATERIALS OutputColumn: DescriptionOfAlternativeMaterials } |
| | | EDIColumnMatch { InputColumn: DESCRIPTIONOFALTERNATIVEMATERIALUNITS OutputColumn: DescriptionOfAlternativeMaterialUnits } |
| | | EDIColumnMatch { InputColumn: MATERIALSYSTEM OutputColumn: MaterialSystem } |
| | | EDIColumnMatch { InputColumn: ORGANCODE OutputColumn: OrganCode } |
| | | EDIColumnMatch { InputColumn: PROCESSSECTION OutputColumn: ProcessSection } |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_BaseConversionFactor |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_BaseConversionFactor |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_CustomerOrder |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_CustomerOrder |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_ExternalSupply |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_ExternalSupply |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_Forecast |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_Forecast |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_InventoryCost |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_InventoryCost |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_Operation |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_Operation |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_OperationCost |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_MappingOperationCost |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_Product |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_MappingProduct |
| | |
| | | OthersMayFlushTable: true |
| | | OthersMayInsertRow: true |
| | | Parameters: '/owner="TIANMA"' |
| | | PrimaryKeyColumns: ID |
| | | RecordModificationHintStrategy: 'None' |
| | | EDIODBCLinkColumn BUSINESSTYPE |
| | | { |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_ProductInLane |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_MappingProductInLane |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_SalesSegment |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_SalesSegment |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_Unit |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_Unit |
| | |
| | | OthersMayDropTable: true |
| | | OthersMayFlushTable: true |
| | | OthersMayInsertRow: true |
| | | Parameters: '/owner="OTD"' |
| | | Parameters: '/owner="TIANMA"' |
| | | RecordModificationHintStrategy: 'None' |
| | | EDIODBCLinkColumn EQUIPMENT |
| | | { |
| | |
| | | #parent: #root |
| | | EDIBroker Broker_OTD_UnitOfMeasure |
| | | { |
| | | MDSDefinition: MacroPlan |
| | | MDSDefinition: MPSync |
| | | TimeZone: 'ACT' |
| | | UseOSTimeZone: false |
| | | EDIModelLink.Destination Des_UnitOfMeasure |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingActualPISPIP_MPSync_MPSync_MappingActualPISPIP |
| | | { |
| | | #keys: '1[414384.0.737300004]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.737300006][414384.0.737300005][414384.0.737300007]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingActualPISPIP |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingActualPISPIP |
| | | { |
| | | #keys: '3[414384.0.737300009][414384.0.737300008][414384.0.737300010]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingBOM_MPSync_MPSync_MappingBOM |
| | | { |
| | | #keys: '1[414384.0.737300037]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.737300039][414384.0.737300038][414384.0.737300040]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingBOM |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingBOM |
| | | { |
| | | #keys: '3[414384.0.737300042][414384.0.737300041][414384.0.737300043]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingBaseConversionFactor_MPSync_MPSync_MappingBaseConversionFactor |
| | | { |
| | | #keys: '1[414384.0.737300021]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.737300023][414384.0.737300022][414384.0.737300024]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingBaseConversionFactor |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingBaseConversionFactor |
| | | { |
| | | #keys: '3[414384.0.737300026][414384.0.737300025][414384.0.737300027]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingCustomerOrder_MPSync_MPSync_MappingCustomerOrder |
| | | { |
| | | #keys: '1[414384.0.737300053]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.737300055][414384.0.737300054][414384.0.737300056]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingCustomerOrder |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingCustomerOrder |
| | | { |
| | | #keys: '3[414384.0.737300058][414384.0.737300057][414384.0.737300059]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingExternalSupply_MPSync_MPSync_MappingExternalSupply |
| | | { |
| | | #keys: '1[414384.0.737300069]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.737300071][414384.0.737300070][414384.0.737300072]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingExternalSupply |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingExternalSupply |
| | | { |
| | | #keys: '3[414384.0.737300074][414384.0.737300073][414384.0.737300075]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingForecast_MPSync_MPSync_MappingForecast |
| | | { |
| | | #keys: '1[414384.0.737300085]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.737300087][414384.0.737300086][414384.0.737300088]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingForecast |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingForecast |
| | | { |
| | | #keys: '3[414384.0.737300090][414384.0.737300089][414384.0.737300091]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingInventoryValueAndCost_MPSync_MPSync_MappingInventoryValueAndCost |
| | | { |
| | | #keys: '1[414384.0.737300101]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.737300103][414384.0.737300102][414384.0.737300104]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingInventoryValueAndCost |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingInventoryValueAndCost |
| | | { |
| | | #keys: '3[414384.0.737300106][414384.0.737300105][414384.0.737300107]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingOperationCost_MPSync_MPSync_MappingOperationCost |
| | | { |
| | | #keys: '1[414384.0.736080617]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.736080619][414384.0.736080618][414384.0.736080620]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingOperationCost |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingOperationCost |
| | | { |
| | | #keys: '3[414384.0.736080622][414384.0.736080621][414384.0.736080623]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingOperation_MPSync_MPSync_MappingOperation |
| | | { |
| | | #keys: '1[414384.0.737300117]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.737300119][414384.0.737300118][414384.0.737300120]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingOperation |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingOperation |
| | | { |
| | | #keys: '3[414384.0.737300122][414384.0.737300121][414384.0.737300123]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingProductInLane_MPSync_MPSync_MappingProductInLane |
| | | { |
| | | #keys: '1[414384.0.736080646]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.736080648][414384.0.736080647][414384.0.736080649]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingProductInLane |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingProductInLane |
| | | { |
| | | #keys: '3[414384.0.736080651][414384.0.736080650][414384.0.736080652]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingProduct_MPSync_MPSync_MappingProduct |
| | | { |
| | | #keys: '1[414384.0.736080633]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.736080635][414384.0.736080634][414384.0.736080636]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingProduct |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingProduct |
| | | { |
| | | #keys: '3[414384.0.736080638][414384.0.736080637][414384.0.736080639]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingSalesSegment_MPSync_MPSync_MappingSalesSegment |
| | | { |
| | | #keys: '1[414384.0.736080662]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.736080664][414384.0.736080663][414384.0.736080665]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingSalesSegment |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingSalesSegment |
| | | { |
| | | #keys: '3[414384.0.736080667][414384.0.736080666][414384.0.736080668]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingUnitOfMeasure_MPSync_MPSync_MappingUnitOfMeasure |
| | | { |
| | | #keys: '1[414384.0.736080697]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.736080699][414384.0.736080698][414384.0.736080700]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingUnitOfMeasure |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingUnitOfMeasure |
| | | { |
| | | #keys: '3[414384.0.736080702][414384.0.736080701][414384.0.736080703]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation MappingUnit_MPSync_MPSync_MappingUnit |
| | | { |
| | | #keys: '1[414384.0.736080678]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MPSync |
| | | { |
| | | #keys: '3[414384.0.736080680][414384.0.736080679][414384.0.736080681]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: MappingUnit |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide MappingUnit |
| | | { |
| | | #keys: '3[414384.0.736080683][414384.0.736080682][414384.0.736080684]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MPSync |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DeleteIfExist ( |
| | | MPSync mpSync, |
| | | String from, |
| | | String to, |
| | | String productId |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-1-2023 (created) |
| | | toDel := select( mpSync, IOBaseConversionFactor, item, |
| | | item.SourceUnitOfMeasureName() = from and item.TargetUnitOfMeasureName() = to and item.ProductID() = productId ); |
| | | if( not isnull( toDel ) ) { |
| | | toDel.Delete(); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization IOBaseConversionFactor #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DeleteIfExist ( |
| | | MPSync mpSync, |
| | | String currencyId, |
| | | Date start |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-1-2023 (created) |
| | | toDel := select( mpSync, IOCurrencyRate_MP, item, |
| | | item.CurrencyID() = currencyId and item.Start() = start ); |
| | | if( not isnull( toDel ) ) { |
| | | toDel.Delete(); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization IOCurrencyRate_MP #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DeleteIfExist ( |
| | | MPSync mpSync, |
| | | String id |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-1-2023 (created) |
| | | toDel := select( mpSync, IOCurrency_MP, item, item.ID() = id ); |
| | | if( not isnull( toDel ) ) { |
| | | toDel.Delete(); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization IOCurrency_MP #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DeleteIfExist ( |
| | | MPSync mpSync, |
| | | String id |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-1-2023 (created) |
| | | toDel := select( mpSync, IOLane, item, item.ID() = id ); |
| | | if( not isnull( toDel ) ) { |
| | | toDel.Delete(); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization IOLane #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateIfNotExist ( |
| | | MPSync mpSync, |
| | | String id |
| | | ) as IOOperation |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-5-2023 (created) |
| | | result := select( mpSync, IOOperation, op, op.ID() = id ); |
| | | if( isnull( result ) ) { |
| | | result := mpSync.IOOperation( relnew, |
| | | ID := id ); |
| | | } |
| | | return result; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization IOOperation #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateIfNotExist ( |
| | | MPSync mpSync, |
| | | String id, |
| | | String name, |
| | | String parentId, |
| | | String uom |
| | | ) as IOProduct_MP |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-1-2023 (created) |
| | | value := IOProduct_MP::FindById( mpSync, id ); |
| | | if( isnull( value ) ) { |
| | | value := IOProduct_MP::Create( mpSync, id, name, "", uom ); |
| | | if( parentId <> "" ) { |
| | | value.ParentID( parentId ); |
| | | } |
| | | } |
| | | return value; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod FindById ( |
| | | MPSync mpSync, |
| | | String id |
| | | ) as IOProduct_MP |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-1-2023 (created) |
| | | result := select( mpSync, IOProduct_MP, item, item.ID() = id ); |
| | | return result; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization IOProduct_MP #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateIfNotExist ( |
| | | MPSync mpSync, |
| | | String routingId, |
| | | String name, |
| | | Number seq |
| | | ) as IORoutingStep |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-5-2023 (created) |
| | | value := select( mpSync, IORoutingStep, item, item.RoutingID() = routingId and item.Name() = name and item.SequenceNumberForExcel() = seq ); |
| | | if( isnull( value ) ) { |
| | | mpSync.IORoutingStep( relnew, |
| | | RoutingID := routingId, |
| | | Name := name, |
| | | SequenceNumberForExcel := seq ); |
| | | } |
| | | return value; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization IORoutingStep #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateIfNotExistByTree ( |
| | | MPSync mpSync, |
| | | String id, |
| | | String name, |
| | | String parentId, |
| | | String UOMName, |
| | | String currencyId, |
| | | Date startDate, |
| | | Date endDate, |
| | | String capacityType |
| | | ) as IOUnit |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-6-2023 (created) |
| | | value := IOUnit::FindById( mpSync, id ); |
| | | if( isnull( value ) ) { |
| | | value := mpSync.IOUnit( relnew, |
| | | ID := id, |
| | | Name := name, |
| | | ParentUnitID := parentId, |
| | | UnitOfMeasureName := UOMName, |
| | | CurrencyID := currencyId, |
| | | StartDate := startDate, |
| | | EndDate := endDate, |
| | | CapacityType := capacityType ); |
| | | } |
| | | return value; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod FindById ( |
| | | MPSync mpSync, |
| | | String id |
| | | ) as IOUnit |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-6-2023 (created) |
| | | value := select( mpSync, IOUnit, item, item.ID() = id ); |
| | | return value; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization IOUnit #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DeleteIfExist ( |
| | | MPSync mpSync, |
| | | String name |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-1-2023 (created) |
| | | toDel := select( mpSync, IOUnitOfMeasure_MP, item, |
| | | item.Name() = name ); |
| | | if( not isnull( toDel ) ) { |
| | | toDel.Delete(); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method GetProductTypeByProductId ( |
| | | String productId |
| | | ) as String |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Sep-5-2023 (created) |
| | | values := selectvalues( this, MappingBOM, item, item.ProductCode() = productId, item.ProductType() ); |
| | | value := ""; |
| | | if( values.Size() > 0 ) { |
| | | value := values.Element( 0 ); |
| | | } |
| | | return value; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method ImportDBDataCustom ( |
| | | MacroPlan macroPlan, |
| | | Strings businessTypes, |
| | | Boolean isKeyProduct, |
| | | Boolean createPurchaseSupplyMaterial |
| | | ) |
| | | { |
| | | Description: 'å°è¡¨çæ°æ®è½¬ä¸ºIOxxxxçæ°æ®' |
| | | TextBody: |
| | | [* |
| | | // Import data from DB |
| | | |
| | | // æ°æ®å¤ç |
| | | |
| | | // éå®çº§å«åéå®é¨é¨ |
| | | this.MappingSalesLevelData(); |
| | | this.Broker_OTD_SalesSegment().Execute(); |
| | | this.MappingSalesSegmentData( businessTypes ); |
| | | |
| | | // åä½åå使¢ç® |
| | | this.Broker_OTD_UnitOfMeasure().Execute(); |
| | | this.MappingUnitOfMeasureData(); |
| | | this.Broker_OTD_BaseConversionFactor().Execute(); |
| | | this.MappingBaseConversionFactorData(); |
| | | |
| | | // è´§å¸åè´§å¸æ±ç |
| | | this.MappingCurrencyData(); |
| | | this.MappingCurrencyRateData(); |
| | | |
| | | // åºåç¹ |
| | | this.MappingStockingPointData(); |
| | | |
| | | // 产å |
| | | this.Broker_OTD_Product().Execute(); |
| | | this.MappingProductData( businessTypes, isKeyProduct ); |
| | | |
| | | // 订å颿µ |
| | | this.Broker_OTD_Forecast().Execute(); |
| | | this.MappingForecastData( businessTypes ); |
| | | |
| | | // 订åéæ± |
| | | this.Broker_OTD_CustomerOrder().Execute(); |
| | | this.MappingCustomerOrderData( businessTypes ); |
| | | |
| | | // 车é |
| | | this.MappingLaneData(); |
| | | // 车éè¿è¾æ®µ |
| | | this.MappingLaneLegData(); |
| | | // ä¾åºç½ç»ï¼è½¦éï¼ |
| | | this.Broker_OTD_ProductInLane().Execute(); |
| | | this.MappingProductInLaneData(); |
| | | |
| | | // routing routingStep unit operation operationLink operationInputGroup operationBOM |
| | | this.Broker_OTD_Operation().Execute(); |
| | | this.Broker_OTD_BOM().Execute(); |
| | | // æ¸
çæ§æ°æ® |
| | | this.IOUnit( relflush ); |
| | | this.IOOperation( relflush ); |
| | | this.IOOperationLink( relflush ); |
| | | this.IOOperationInputGroup( relflush ); |
| | | // å¤çæ°æ® |
| | | this.MappingUnitData( businessTypes ); |
| | | this.MappingOperationData( businessTypes ); |
| | | // æ¸
çæ§æ°æ® |
| | | this.IOOperationBOM( relflush ); |
| | | // å¤çæ°æ® |
| | | this.MappingOperationBOMData( businessTypes, isKeyProduct, createPurchaseSupplyMaterial ); |
| | | |
| | | // åºåææ¬ |
| | | this.Broker_OTD_InventoryCost().Execute(); |
| | | this.MappingInventoryValueAndCostData(); |
| | | |
| | | // åºåæ°æ® |
| | | this.Broker_OTD_ActualPISPIP().Execute(); |
| | | this.MappingActualPISPIPData( businessTypes, isKeyProduct ) |
| | | |
| | | // Update the LastImportFromDatabase time |
| | | this.LastImportTime( DateTime::ActualTime() ); |
| | | // sync to mp |
| | | if( not isnull( macroPlan ) ) { |
| | | macroPlan.SynchronizeFromMPSync( this, false, |
| | | true, true, true, true, true, |
| | | true, true, true, true, true, |
| | | true, true, true, true, true, |
| | | true, true, true, true, true, |
| | | true, true, true, true ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingActualPISPIPData ( |
| | | Strings businessTypes, |
| | | Boolean nuclear |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | this.IOActualProductInStockingPointInPeriod( relflush ); |
| | | // å
æå
³é®ç©æï¼åæbusinessTypeçé产å |
| | | productList := selectset( this, MappingProduct, item, item.KeyProduct() = nuclear ); |
| | | if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | productList := selectset( productList, Elements, item, businessTypes.Find( item.BusinessType() ) >= 0 ); |
| | | } |
| | | productIdList := selectvalues( productList, Elements, item, item.ID() ); |
| | | // æ ¹æ®äº§åçéåºåæ°æ® |
| | | traverse( this, MappingActualPISPIP, item, productIdList.Find( item.ProductID() ) >= 0 ) { |
| | | this.IOActualProductInStockingPointInPeriod( relnew, |
| | | ActualInventoryLevelEnd := item.ActualInventoryLevelEnd(), |
| | | // todo 确认使ç¨å½åæ¥æè¿æ¯æ°æ®åºæ¥æ |
| | | Date := item.Date(), |
| | | Description := item.Description(), |
| | | ManufacturedDate := item.ManufacturedDate(), |
| | | ProductID := item.ProductID(), |
| | | StockingPointID := item.StockingPointID() ); |
| | | |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingBaseConversionFactorData |
| | | { |
| | | Description: 'ETLæ°æ®è½¬æ¨¡åæ°æ®' |
| | | TextBody: |
| | | [* |
| | | this.IOBaseConversionFactor( relflush ); |
| | | traverse( this, MappingBaseConversionFactor, item ) { |
| | | // IOBaseConversionFactor::DeleteIfExist( this, item.SourceUnitOfMeasureName(), item.TargetUnitOfMeasureName(), item.ProductId() ); |
| | | this.IOBaseConversionFactor( relnew, |
| | | SourceUnitOfMeasureName := item.SourceUnitOfMeasureName(), |
| | | TargetUnitOfMeasureName := item.TargetUnitOfMeasureName(), |
| | | ProductID := item.ProductId(), |
| | | UserFactor := item.Factor(), |
| | | IsEnabled := item.IsEnabled() ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingCurencyRatesData ( |
| | | JSON data |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | data_length := data.Size(); |
| | | for( i := 0; i < data_length; i++ ) |
| | | { |
| | | datarow := data.Get( i ); |
| | | currencyId := datarow.Get( "currencyid" ).GetString(); |
| | | rate := [Real]datarow.Get( "rate" ).GetString(); |
| | | startString := datarow.Get( "start" ).GetString(); |
| | | years := [Number]startString.SubString( 0, 4 ); |
| | | month := [Number]startString.SubString( 5, 2 ); |
| | | day := [Number]startString.SubString( 8, 2 ); |
| | | start := Date::Construct( years, month, day ); |
| | | // å é¤å·²æç |
| | | // IOCurrencyRate_MP::DeleteIfExist( this, currencyId, start ); |
| | | this.IOCurrencyRate_MP( relnew, |
| | | CurrencyID := currencyId, |
| | | Rate := rate, |
| | | Start := start ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingCurrencyData ( |
| | | JSON data |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | data_length := data.Size(); |
| | | for( i := 0; i < data_length; i++ ) |
| | | { |
| | | datarow := data.Get( i ); |
| | | id := datarow.Get( "id" ).GetString(); |
| | | isBase := [Boolean]datarow.Get( "isbase" ).GetString(); |
| | | name := datarow.Get( "name" ).GetString(); |
| | | symbol := " "; |
| | | // å é¤å·²æç |
| | | // IOCurrency_MP::DeleteIfExist( this, id ); |
| | | this.IOCurrency_MP( relnew, |
| | | ID := id, IsBase := isBase, Name := name, Symbol := symbol ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingCurrencyData |
| | | { |
| | | TextBody: |
| | | [* |
| | | this.IOCurrency_MP( relflush ); |
| | | // è´§å¸ä¿¡æ¯ |
| | | bodyNumber := "1"; |
| | | postRequestBody := MPSync::ApiBuildPostRequestBody( bodyNumber ); |
| | | address := "api-uat-sgc.tianma.cn"; |
| | | url := "/otdService/https/GetCurrenciesInfo"; |
| | | port := 443; |
| | | data := MPSync::ApiResponesCheck( address, port, url, postRequestBody ); |
| | | this.MappingCurrencyData( data ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingCurrencyRateData |
| | | { |
| | | TextBody: |
| | | [* |
| | | this.IOCurrencyRate_MP( relflush ); |
| | | // è´§å¸æ±çä¿¡æ¯ |
| | | bodynumber := "5"; |
| | | postrequestbody := MPSync::ApiBuildPostRequestBody( bodynumber ); |
| | | address := "api-uat-sgc.tianma.cn"; |
| | | url := "/otdService/https/GetCurrencyRatesInfo"; |
| | | port := 443; |
| | | data := MPSync::ApiResponesCheck( address, port, url, postrequestbody ); |
| | | this.MappingCurencyRatesData( data ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingCustomerOrderData ( |
| | | Strings businessTypes |
| | | ) |
| | | { |
| | | Description: 'ETL订å颿µ' |
| | | TextBody: |
| | | [* |
| | | toDels := selectset( this, IOSalesDemandBase, item, item.istype( IOCustomerOrder ) ); |
| | | traverse( toDels, Elements, toDel ) { |
| | | toDel.Delete(); |
| | | } |
| | | // å¾
å¤çæ°æ® |
| | | toDealList := selectset( this, MappingCustomerOrder, item, true ); |
| | | if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | toDealList := selectset( toDealList, Elements, item, businessTypes.Find( item.BusinessType() ) >= 0 ); |
| | | } |
| | | // todo 没macroPlanæä¹æ |
| | | //queryStartDate := guard( DateTime::Now() - Duration::Days( 30 ), DateTime::MinDateTime() ).Date(); |
| | | //queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() ); |
| | | //listToDeal := selectset( listToDeal, Elements, item, item.StartDate() >= queryStartDate and item.EndDate() <= queryEndDate ); |
| | | // å¤ç |
| | | traverse( toDealList, Elements, item ) { |
| | | this.IOSalesDemandBase( relnew, |
| | | IOCustomerOrder, |
| | | ID := item.ID(), |
| | | CurrencyID := item.CurrencyID(), |
| | | PriorityName := item.PriorityName(), |
| | | ProductID := item.ProductID(), |
| | | SalesSegmentName := item.SalesSegmentName(), |
| | | StockingPointID := item.StockPointID(), |
| | | UnitOfMeasureName := item.UnitOfMeasureName(), |
| | | CustomerID := item.CustomerID(), |
| | | CustomerName := item.Customer(), |
| | | OrderID := item.OrderID(), |
| | | OrderLineID := item.OrderLineID(), |
| | | Price := item.Price(), |
| | | Quantity := item.Quantity(), |
| | | StartDate := item.OrderDate() ); |
| | | |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingExternalSupplyData ( |
| | | Strings businessTypes, |
| | | Boolean nuclear |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | //// renhao Aug-14-2023 (created) |
| | | // |
| | | //traverse( this,MappingExternalSupply,externalSupply){ |
| | | // product := select( this,MappingProduct,product,product.ID() = externalSupply.ProductID() and product.KeyProduct() = nuclear,true); |
| | | // |
| | | // if( not isnull( product)){ |
| | | // productMP := select( this,Product_MP,productMP,productMP.ID() = externalSupply.ProductID() ,true); |
| | | // stockingpoint := select( this,StockingPoint_MP,st,st.ID() = externalSupply.StockingPointID(),true); |
| | | // if( not isnull(businessTypes)){ |
| | | // |
| | | // for( i :=0 ;i < businessTypes.Size();i++ ){ |
| | | // businessType := businessTypes.Element( i); |
| | | // if( product.BusinessType() = businessType and not product.IsCommon()){ |
| | | // InventorySupply::Create(externalSupply.ID(),productMP,stockingpoint,externalSupply.Date(),externalSupply.ManufacturedDate(),externalSupply.UserQuantity(),"å¨éå¨å¶",true); |
| | | // } |
| | | // } |
| | | // |
| | | // }else{ |
| | | // InventorySupply::Create(externalSupply.ID(),productMP,stockingpoint,externalSupply.Date(),externalSupply.ManufacturedDate(),externalSupply.UserQuantity(),"å¨éå¨å¶",true); |
| | | // } |
| | | // |
| | | // } |
| | | //} |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingForecastData ( |
| | | Strings businessTypes |
| | | ) |
| | | { |
| | | Description: 'ETL订å颿µ' |
| | | TextBody: |
| | | [* |
| | | toDels := selectset( this, IOSalesDemandBase, item, item.istype( IOForecast ) ); |
| | | traverse( toDels, Elements, toDel ) { |
| | | toDel.Delete(); |
| | | } |
| | | // å¾
å¤çæ°æ® |
| | | listToDeal := selectset( this, MappingForecast, item, true ); |
| | | if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | listToDeal := selectset( listToDeal, Elements, item, businessTypes.Find( item.BusinessType() ) >= 0 ); |
| | | } |
| | | // todo 没macroPlanæä¹æ |
| | | //queryStartDate := guard( DateTime::Now() - Duration::Days( 30 ), DateTime::MinDateTime() ).Date(); |
| | | //queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() ); |
| | | //listToDeal := selectset( listToDeal, Elements, item, item.StartDate() >= queryStartDate and item.EndDate() <= queryEndDate ); |
| | | // å¤ç |
| | | traverse( listToDeal, Elements, item ) { |
| | | this.IOSalesDemandBase( relnew, |
| | | IOForecast, |
| | | ID := item.ID(), |
| | | CurrencyID := item.CurrencyID(), |
| | | PriorityName := item.PriorityName(), |
| | | SalesSegmentName := item.SalesSegmentName(), |
| | | StockingPointID := item.StockingPointID(), |
| | | UnitOfMeasureName := item.UnitOfMeasureName(), |
| | | ProductID := item.ProductID(), |
| | | StartDate := item.StartDate(), |
| | | EndDate := item.EndDate(), |
| | | Quantity := item.Quantity(), |
| | | Price := item.Price()); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingInventoryValueAndCostData |
| | | { |
| | | TextBody: |
| | | [* |
| | | this.IOInventoryValueAndCost( relflush ); |
| | | traverse( this, MappingInventoryValueAndCost, item ) { |
| | | this.IOInventoryValueAndCost( relnew, |
| | | ID := item.ID(), |
| | | AccountName := item.AccountName(), |
| | | Cost := item.Cost(), |
| | | CostDriver := item.CostDriver(), |
| | | ProductID := item.ProductID(), |
| | | Start := item.Start(), |
| | | StockingPointID := item.StockingPointID() ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingLaneData ( |
| | | JSON data |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | dataLength := data.Size(); |
| | | for( i := 0; i < dataLength; i++ ) { |
| | | dataRow := data.Get( i ); |
| | | id := dataRow.Get( "id" ).GetString(); |
| | | unitId := dataRow.Get( "unitid" ).GetString(); |
| | | name := dataRow.Get( "name" ).GetString(); |
| | | userLeadTimeHours := [Number]dataRow.Get( "userleadtime" ).GetString(); |
| | | this.IOLane( relnew, |
| | | ID := id, |
| | | Name := name, |
| | | UnitID := unitId, |
| | | UserLeadTime := Duration::Hours( userLeadTimeHours ) ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingLaneData |
| | | { |
| | | TextBody: |
| | | [* |
| | | this.IOLane( relflush ); |
| | | bodyNumber := "3"; |
| | | postRequestBody := MPSync::ApiBuildPostRequestBody( bodyNumber ); |
| | | address := "api-uat-sgc.tianma.cn"; |
| | | url := "/otdService/https/GetLanesInfo"; |
| | | port := 443; |
| | | data := MPSync::ApiResponesCheck( address, port, url, postRequestBody ); |
| | | this.MappingLaneData( data ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingLaneLegData ( |
| | | JSON data |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | dataLength := data.Size(); |
| | | for( i := 0; i < dataLength; i++ ) { |
| | | dataRow := data.Get( i ); |
| | | laneId := dataRow.Get( "laneid" ).GetString(); |
| | | originStockingPointId := dataRow.Get( "originstockingpointid" ).GetString(); |
| | | destinationStockingPointId := dataRow.Get( "destinationstockingpointid" ).GetString(); |
| | | name := dataRow.Get( "name" ).GetString(); |
| | | userLeadTimeHours := [Number]dataRow.Get( "userleadtime" ).GetString(); |
| | | this.IOLaneLeg( relnew, |
| | | LaneID := laneId, |
| | | OriginStockingPointID := originStockingPointId, |
| | | DestinationStockingPointID := destinationStockingPointId, |
| | | Name := name, |
| | | HasUserLeadTime := true, |
| | | UserLeadTime := Duration::Hours( userLeadTimeHours ), |
| | | Start := Date::MinDate(), |
| | | End := Date::MaxDate(), |
| | | PreferenceBonus := 0.0, |
| | | CO2Emission := 0.0 ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingLaneLegData |
| | | { |
| | | TextBody: |
| | | [* |
| | | this.IOLaneLeg( relflush ); |
| | | bodynumber := "4"; |
| | | postRequestBody := MPSync::ApiBuildPostRequestBody( bodynumber ); |
| | | address := "api-uat-sgc.tianma.cn"; |
| | | url := "/otdService/https/GetLaneLegsInfo"; |
| | | port := 443; |
| | | data := MPSync::ApiResponesCheck( address, port, url, postRequestBody ); |
| | | this.MappingLaneLegData( data ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingOperationBOMData ( |
| | | Strings businessTypes, |
| | | Boolean isKeyProduct, |
| | | Boolean createPurchaseSupplyMaterial |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // keyProduct |
| | | keyProductIds := selectuniquevalues( this, MappingProduct, prod, prod.KeyProduct() = true, prod.ID() ); |
| | | // è·åæåºçå¾
å¤çè®°å½ |
| | | toDealOps := construct( MappingOperations ); |
| | | toDealBoms := construct( MappingBOMs ); |
| | | if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | toDealOps := selectsortedset( this, MappingOperation, item, |
| | | businessTypes.Find( item.BusinessType() ) >= 0 |
| | | and ( not isKeyProduct or keyProductIds.Find( item.ProductID() ) >= 0 ), |
| | | item.SequenceNumber() ); |
| | | toDealBoms := selectset( this, MappingBOM, item, |
| | | businessTypes.Find( item.BusinessType() ) >= 0 |
| | | and ( not isKeyProduct or keyProductIds.Find( item.ComponentCode() ) >= 0 ) ); |
| | | } else { |
| | | toDealOps := selectsortedset( this, MappingOperation, item, |
| | | not isKeyProduct or keyProductIds.Find( item.ProductID() ) >= 0 , |
| | | item.SequenceNumber() ); |
| | | toDealBoms := selectset( this, MappingBOM, item, |
| | | businessTypes.Find( item.BusinessType() ) >= 0 |
| | | and ( not isKeyProduct or keyProductIds.Find( item.ComponentCode() ) >= 0 ) ); |
| | | } |
| | | // 对æ¯ä¸ªrouting计ç®inputGroupId |
| | | inputGroupId := 1 |
| | | // 对æ¯ä¸ªRoutingè¿è¡æå
¥äº§åºå¤ç |
| | | routingKeys := selectuniquevalues( toDealOps, Elements, item, item.OrganCode() + "_" + item.ProductID() ); |
| | | traverse( routingKeys, Elements, routingKey ) { |
| | | // ==== äº§åº ==== |
| | | // æ¾æå¤§seq |
| | | maxSeq := max( toDealOps, Elements, item, item.OrganCode() + "_" + item.ProductID() = routingKey, item.SequenceNumber() ); |
| | | maxSeqElements := selectset( toDealOps, Elements, item, |
| | | item.OrganCode() + "_" + item.ProductID() = routingKey and item.SequenceNumber() = maxSeq ); |
| | | traverse( maxSeqElements, Elements, maxSeqELement ) { |
| | | operationId := maxSeqELement.OrganCode() + "_" + maxSeqELement.ProductID() + "_" + maxSeqELement.ProcessSection(); |
| | | if( maxSeqELement.Line() <> "" ) { |
| | | operationId := operationId + "_" + maxSeqELement.Line(); |
| | | } |
| | | this.IOOperationBOM( relnew, |
| | | OperationID := operationId, |
| | | ProductID := maxSeqELement.ProductID(), |
| | | StockingPointID := maxSeqELement.OrganCode() + "_" + this.GetProductTypeByProductId( maxSeqELement.ProductID() ) + "_STOCK", |
| | | Quantity := 1, |
| | | IsInput := false ); |
| | | } |
| | | // ==== æå
¥ ==== |
| | | // 对Operationä¸çæ¯ä¸ªProcessSectionï¼ æ¾seqæå°çlistï¼æ¯æ¡bom对该listçæoperationBOM |
| | | processSectionList := selectuniquevalues( toDealOps, Elements, toDeal, |
| | | toDeal.OrganCode() + "_" + toDeal.ProductID() = routingKey, |
| | | toDeal.ProcessSection() ); |
| | | traverse( processSectionList, Elements, processSection ) { |
| | | minSeq := min( toDealOps, Elements, item, |
| | | item.OrganCode() + "_" + item.ProductID() = routingKey |
| | | and item.ProcessSection() = processSection, |
| | | item.SequenceNumber() ); |
| | | operationRecordsWithMinSeq := selectset( toDealOps, Elements, minSeqWithProcessSectionElement, |
| | | minSeqWithProcessSectionElement.OrganCode() + "_" + minSeqWithProcessSectionElement.ProductID() = routingKey |
| | | and minSeqWithProcessSectionElement.ProcessSection() = processSection |
| | | and minSeqWithProcessSectionElement.SequenceNumber() = minSeq ); |
| | | bomRecords := selectset( toDealBoms, Elements, bom, |
| | | bom.OrganCode() + "_" + bom.ProductCode() = routingKey |
| | | and bom.ProcessSection() = processSection ); |
| | | // ææ¯å¦ææ¿æ¢æåç» |
| | | bomWithoutAlters := selectset( bomRecords, Elements, bomRecord, bomRecord.AlternativeMaterialCode() = "" ); |
| | | bomWithAlters := selectset( bomRecords, Elements, bomRecord, bomRecord.AlternativeMaterialCode() <> "" ); |
| | | // å¤çä¸å¸¦æ¿æ¢æçinput |
| | | traverse( operationRecordsWithMinSeq, Elements, op ) { |
| | | traverse( bomWithoutAlters, Elements, bom ) { |
| | | operationId := op.OrganCode() + "_" + op.ProductID() + "_" + op.ProcessSection(); |
| | | if( op.Line() <> "" ) { |
| | | operationId := operationId + "_" + op.Line(); |
| | | } |
| | | this.IOOperationBOM( relnew, |
| | | OperationID := operationId, |
| | | ProductID := op.ProductID(), |
| | | StockingPointID := op.OrganCode() + "_" + bom.ComponentType() + "_STOCK", |
| | | IsInput := true, |
| | | Quantity := bom.UnitUsageOfComponents() / bom.ComponentOutputRate() ); |
| | | } |
| | | } |
| | | // å¤çå¸¦æ¿æ¢æçï¼ælineå主æåç» |
| | | lineList := selectuniquevalues( operationRecordsWithMinSeq, Elements, item, item.Line() ); |
| | | mainProdList := selectuniquevalues( bomWithAlters, Elements, item, item.ComponentCode() ); |
| | | traverse( lineList, Elements, line ) { |
| | | opWithLine := select( operationRecordsWithMinSeq, Elements, item, item.Line() = line ); |
| | | opId := opWithLine.OrganCode() + "_" + opWithLine.ProductID() + "_" + opWithLine.ProcessSection(); |
| | | if( opWithLine.Line() <> "" ) { |
| | | opId := opId + "_" + opWithLine.Line(); |
| | | } |
| | | traverse( mainProdList, Elements, mainProd ) { |
| | | // æ¯ç§ä¸»æä¸ä¸ªgroup |
| | | inputGroupId := inputGroupId + 1; |
| | | bomWithMainProdList := selectset( bomWithAlters, Elements, item, item.ComponentCode() = mainProd ); |
| | | bomRandom := bomWithMainProdList.First(); |
| | | // æ»æ°é |
| | | maxQuantityInGroup := bomRandom.UnitUsageOfComponents() / bomRandom.ComponentOutputRate(); |
| | | // æ¿ä»£ææ»æ¯ä¾ |
| | | alterRateTotal := sum( bomWithMainProdList, Elements, item, item.AlternativeRate() ); |
| | | // å建inputGroup |
| | | this.IOOperationInputGroup( relnew, InputGroupID := inputGroupId, OperationID := opId, InputGroupQuantity := maxQuantityInGroup ); |
| | | // å建主æçinput bom |
| | | this.IOOperationBOM( relnew, |
| | | OperationID := opId, |
| | | InputGroupID := inputGroupId, |
| | | ProductID := bomRandom.ComponentCode(), |
| | | StockingPointID := bomRandom.OrganCode() + "_" + bomRandom.ComponentType() + "_STOCK", |
| | | IsInput := true, |
| | | Quantity := maxQuantityInGroup * ( 1 - alterRateTotal ), |
| | | MinQuantityInGroup := 0.0, |
| | | MaxQuantityInGroup := maxQuantityInGroup ); |
| | | // æ¿ä»£æinput bom |
| | | traverse( bomWithMainProdList, Elements, bom ) { |
| | | this.IOOperationBOM( relnew, |
| | | OperationID := opId, |
| | | InputGroupID := inputGroupId, |
| | | ProductID := bom.AlternativeMaterialCode(), |
| | | StockingPointID := bom.OrganCode() + "_" + bom.ComponentType() + "_STOCK", |
| | | IsInput := true, |
| | | Quantity := maxQuantityInGroup * bom.AlternativeRate(), |
| | | MinQuantityInGroup := 0.0, |
| | | MaxQuantityInGroup := maxQuantityInGroup ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // é对æ¯ä¸ªrouting éç½® inputGroupId |
| | | inputGroupId := 1; |
| | | } |
| | | // 对æ¯ä¸ªOrgCode_ComponentCodeç»åï¼å建éè´routing |
| | | if( createPurchaseSupplyMaterial ) { |
| | | toCreateKeys := selectuniquevalues( toDealBoms, Elements, bom, |
| | | bom.ComponentType() = "P", |
| | | bom.OrganCode() + "_" + bom.ComponentCode() ); |
| | | traverse( toCreateKeys, Elements, toCreateKey ) { |
| | | bomRandom := selectset( toDealBoms, Elements, bom, bom.ComponentType() = "P" and bom.OrganCode() + "_" + bom.ComponentCode() = toCreateKey ).First(); |
| | | routingId := bomRandom.OrganCode() + "_" + bomRandom.ComponentCode(); |
| | | routingName := routingId; |
| | | routingStepName := "éè´"; |
| | | routingStepSeq := 1; |
| | | operationId := "PR_" + bomRandom.OrganCode() + bomRandom.ComponentCode(); |
| | | operationName := operationId; |
| | | unitId := "ä¾åºå"; |
| | | // ==== å建 ==== |
| | | // å建routing |
| | | this.IORouting( relnew, |
| | | ID := routingId, Name := routingName, IsEnabled := true, Start := Date::MinDate(), End := Date::MaxDate() ); |
| | | // å建routingStep |
| | | IORoutingStep::CreateIfNotExist( this, |
| | | routingId, |
| | | routingStepName, |
| | | routingStepSeq ); |
| | | // å建op |
| | | ioOp := IOOperation::CreateIfNotExist( this, operationId ); |
| | | ioOp.UnitID( unitId ); |
| | | ioOp.RoutingID( routingId ); |
| | | ioOp.RoutingStepName( routingStepName ); |
| | | ioOp.Name( operationName ); |
| | | ioOp.UserLeadTime( Duration::Zero() ); |
| | | ioOp.Throughput( 1.0 ); |
| | | ioOp.HasUserMaximumQuantity( false ); |
| | | ioOp.UserMinimumQuantity( Real::MinReal() ); |
| | | ioOp.UserMaximumQuantity( Real::MaxReal() ); |
| | | // å建opBOM |
| | | this.IOOperationBOM( relnew, |
| | | OperationID := operationId, |
| | | ProductID := bomRandom.ComponentCode(), |
| | | StockingPointID := bomRandom.OrganCode() + "_" + bomRandom.ProductType() + "_STOCK", |
| | | IsInput := true, |
| | | Quantity := 1 ); |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingOperationCostData ( |
| | | Strings businesstypes |
| | | ) |
| | | { |
| | | Description: 'Get operation cost data from operation mapping' |
| | | TextBody: |
| | | [* |
| | | //// Administrator Aug-21-2023 (created) |
| | | //// list to deal |
| | | //listtodeal := construct( structured[MappingOperation] ); |
| | | // |
| | | //if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | // listtodeal := selectset( this, MappingOperation, item, true ); |
| | | //} else { |
| | | // listtodeal := selectset( this, MappingOperation, item, businesstypes.Find( item.BusinessType() ) <> -1 ); |
| | | //} |
| | | // |
| | | //// Get the list to deal with max sequence number |
| | | //listtodealwithmaxsn := construct( structured[MappingOperation] ); |
| | | //traverse( listtodeal, Elements, item ){ |
| | | // maxsn := maxselect( this, |
| | | // MappingOperation, |
| | | // moperation, |
| | | // moperation.OrganCode() = item.OrganCode(), |
| | | // moperation.ProductID() = item.ProductID(), |
| | | // moperation.SequenceNumber() ).SequenceNumber() |
| | | // if( item.SequenceNumber() = maxsn ){ |
| | | // listtodealwithmaxsn.Add( item ); |
| | | // } |
| | | // } |
| | | // |
| | | //// Get the operation cost data |
| | | //traverse( listtodealwithmaxsn, Elements, item ){ |
| | | // id := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection() + "_" + item.Line(); |
| | | // operation := Operation::FindOperationTypeIndex( id ); |
| | | // account := Account_MP::FindByName( this, "Operation cost" ); |
| | | // isfromdb := false; |
| | | // existoperationcost := OperationCost::FindOperationCostTypeIndex( id ); |
| | | // if( isnull( existoperationcost ) ){ |
| | | // connecteditem := select( this, |
| | | // 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 ); |
| | | // } |
| | | // } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingOperationData ( |
| | | Strings businessTypes |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // è·åæåºçå¾
å¤çè®°å½ |
| | | toDealList := construct( MappingOperations ); |
| | | if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | toDealList := selectsortedset( this, MappingOperation, item, |
| | | businessTypes.Find( item.BusinessType() ) >= 0, |
| | | item.SequenceNumber() ); |
| | | } else { |
| | | toDealList := selectsortedset( this, MappingOperation, item, |
| | | true, |
| | | item.SequenceNumber() ); |
| | | } |
| | | // å é¤åærouting |
| | | this.IORouting( relflush ); |
| | | // æ°routing |
| | | routingIdList := selectuniquevalues( toDealList, Elements, item, item.OrganCode() + "_" + item.ProductID() ); |
| | | traverse( routingIdList, Elements, routingId ) { |
| | | this.IORouting( relnew, |
| | | ID := routingId, Name := routingId, IsEnabled := true ); |
| | | } |
| | | // å é¤åæroutingStep |
| | | this.IORoutingStep( relflush ); |
| | | // æ°routingStep |
| | | traverse( toDealList, Elements, op ) { |
| | | routingId := op.OrganCode() + "_" + op.ProductID(); |
| | | routingStepName := op.ProcessSection() + "_" + [String]op.SequenceNumber(); |
| | | IORoutingStep::CreateIfNotExist( this, |
| | | routingId, |
| | | routingStepName, |
| | | op.SequenceNumber() ); |
| | | } |
| | | // æ°operation |
| | | traverse( toDealList, Elements, op ) { |
| | | // æ±æ»æ°æ® |
| | | routingId := op.OrganCode() + "_" + op.ProductID(); |
| | | routingStepName := op.ProcessSection() + "_" + [String]op.SequenceNumber(); |
| | | opId := op.OrganCode() + "_" + op.ProductID() + "_" + op.ProcessSection(); |
| | | unitId := op.OrganCode() + "_" + op.PlantName() + "_" + op.ProcessSection(); |
| | | if( op.Line() <> "" ) { |
| | | opId := opId + "_" + op.Line(); |
| | | unitId := unitId + "_" + op.Line(); |
| | | } |
| | | opName := opId; |
| | | // æ°å»º |
| | | ioOp := IOOperation::CreateIfNotExist( this, opId ); |
| | | ioOp.UnitID( unitId ); |
| | | ioOp.RoutingID( routingId ); |
| | | ioOp.RoutingStepName( routingStepName ); |
| | | ioOp.Name( opName ); |
| | | ioOp.UserLeadTime( Duration::Hours( op.UserLeadTime() ) ); |
| | | ioOp.Throughput( op.ActualCapacity() ); |
| | | ioOp.UserMinimumQuantity( op.MinimumQuantity() ); |
| | | ioOp.UserMaximumQuantity( op.MaximumQuantity() ); |
| | | ioOp.HasUserMaximumQuantity( op.MaximumQuantity() <> 0.0 ); |
| | | } |
| | | // æ OrganCode + ProductID åç» + æåº |
| | | keyList := selectuniquevalues( toDealList, Elements, op, |
| | | op.OrganCode() + "_" + op.ProductID() ); |
| | | keyList := selectsortedset( keyList, Elements, str, str ); |
| | | traverse( keyList, Elements, key ) { |
| | | previousList := construct( MappingOperations ); |
| | | // æ SequenceNumber åç» + æåº |
| | | subKeyList := selectuniquevalues( toDealList, Elements, op, |
| | | key = op.OrganCode() + "_" + op.ProductID(), |
| | | op.SequenceNumber() ); |
| | | subKeyList := selectsortedset( subKeyList, Elements, seq, seq ); |
| | | // éåæ¯ä¸ªSeqï¼ä¸åä¸ä¸ªlistè¿è¡è¿æ¥ï¼åæ¶å建group |
| | | traverse( subKeyList, Elements, seq ) { |
| | | elementList := selectset( this, MappingOperation, op, |
| | | op.OrganCode() + "_" + op.ProductID() = key and op.SequenceNumber() = seq ); |
| | | if( not isnull( previousList ) and previousList.Size() > 0 ) { |
| | | // 对æ¯ä¸ªç®æ å建inputGroup |
| | | if( previousList.Size() > 1 ) { |
| | | traverse( elementList, Elements, targetOp ) { |
| | | targetOpId := targetOp.OrganCode() + "_" + targetOp.ProductID() + "_" + targetOp.ProcessSection(); |
| | | this.IOOperationInputGroup( relnew, InputGroupID := 1, OperationID := targetOpId, InputGroupQuantity := 1 ); |
| | | } |
| | | } |
| | | // æºä¸ç®æ 两两å建operationLink |
| | | traverse( elementList, Elements, targetOp ) { |
| | | traverse( previousList, Elements, sourceOp ) { |
| | | sourceOpId := sourceOp.OrganCode() + "_" + sourceOp.ProductID() + "_" + sourceOp.ProcessSection(); |
| | | targetOpId := targetOp.OrganCode() + "_" + targetOp.ProductID() + "_" + targetOp.ProcessSection(); |
| | | this.IOOperationLink( relnew, |
| | | SourceOperationID := sourceOpId, DestOperationID := targetOpId, |
| | | SourceGroupID := 1, DestGroupID := 1, SourceQuantity := 1, DestQuantity := 1 / previousList.Size(), |
| | | DestHasUserQuantity := false, DestMinQuantity := 0, DestMaxQuantity := 1 ); |
| | | } |
| | | } |
| | | } |
| | | previousList := elementList; |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingProductData ( |
| | | Strings businesstypes, |
| | | Boolean iskeyproduct |
| | | ) |
| | | { |
| | | Description: 'Method to get needed data from mapping product data' |
| | | TextBody: |
| | | [* |
| | | // æ¸
餿§æ°æ® |
| | | this.IOProduct_MP( relflush ); |
| | | // list to deal |
| | | listToDeal := construct( structured[MappingProduct] ); |
| | | if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | if( iskeyproduct = true ){ |
| | | listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true ); |
| | | } else { |
| | | listToDeal := selectset( this, MappingProduct, item, true ); |
| | | } |
| | | } else { |
| | | if( iskeyproduct = true ){ |
| | | listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true, businesstypes.Find( item.BusinessType() ) <> -1 or businesstypes.Find( item.CommonBusiness() ) <> -1 ); |
| | | } else { |
| | | listToDeal := selectset( this, MappingProduct, item, businesstypes.Find( item.BusinessType() ) <> -1 or businesstypes.Find( item.CommonBusiness() ) <> -1 ); |
| | | } |
| | | } |
| | | // åå»ºæ ¹äº§å |
| | | IOProduct_MP::CreateIfNotExist( this, "å
¨é¨ç©æäº§å", "å
¨é¨ç©æäº§å", "", "PCS" ); |
| | | // å¤çæ°ä¿¡æ¯ |
| | | traverse( listToDeal, Elements, item ) { |
| | | // å建ç¶äº§å |
| | | IOProduct_MP::CreateIfNotExist( this, item.ProductMajorType(), item.ProductMajorType(), "å
¨é¨ç©æ", "PCS" ); |
| | | IOProduct_MP::CreateIfNotExist( this, item.ProductSubclassType(), item.ProductSubclassType(), item.ProductMajorType(), "PCS" ); |
| | | // å建产å |
| | | this.IOProduct_MP( relnew, |
| | | ID := item.ID(), |
| | | Name := item.Name(), |
| | | ParentID := item.ProductSubclassType(), |
| | | UOMName := item.UnitOfMeasureName(), |
| | | // todo ? |
| | | HasShelfLife := true, |
| | | ShelfLife := item.ShelfLife(), |
| | | Notes := item.Notes() ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingProductInLaneData |
| | | { |
| | | Description: 'Get Product In Line data' |
| | | TextBody: |
| | | [* |
| | | this.IOProductInLane( relflush ); |
| | | traverse( this, MappingProductInLane, item ){ |
| | | this.IOProductInLane( relnew, |
| | | LaneID := item.LineID(), |
| | | ProductID := item.ProductID() ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingSalesLevelData |
| | | { |
| | | TextBody: |
| | | [* |
| | | this.IOSalesLevel_MP( relflush ); |
| | | this.IOSalesLevel_MP( relnew, |
| | | Level := 0, |
| | | Name := "è¥éä¸å¿" ); |
| | | this.IOSalesLevel_MP( relnew, |
| | | Level := 1, |
| | | Name := "éå®ç§" ); |
| | | this.IOSalesLevel_MP( relnew, |
| | | Level := 2, |
| | | Name := "客æ·" ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingSalesSegmentData ( |
| | | Strings businessTypes |
| | | ) |
| | | { |
| | | Description: 'ETLéå®é¨é¨' |
| | | TextBody: |
| | | [* |
| | | this.IOSalesSegment_MP( relflush ); |
| | | toDealList := selectset( this, MappingSalesSegment, item, true ); |
| | | if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | toDealList := selectset( toDealList, Elements, item, businessTypes.Find( item.BusinessType() ) >= 0 ); |
| | | } |
| | | traverse( toDealList, Elements, item ) { |
| | | this.IOSalesSegment_MP( relnew, |
| | | Name := item.Name(), |
| | | ParentName := item.ParentName(), |
| | | DisplayIndex := item.DisplayIndex() ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingStockingPointData ( |
| | | JSON data |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | dataLength := data.Size(); |
| | | for( i:=0; i < dataLength; i++ ) |
| | | { |
| | | dataRow := data.Get( i ); |
| | | id := dataRow.Get( "id" ).GetString(); |
| | | unitId := dataRow.Get( "unitid" ).GetString(); |
| | | name := dataRow.Get( "name" ).GetString(); |
| | | this.IOStockingPoint_MP( relnew, |
| | | ID := id, |
| | | Name := name, |
| | | UnitID := unitId, |
| | | CurrencyID := "CNY", |
| | | UnitOfMeasureName := "PCS", |
| | | IsPlannedInfinite := false, |
| | | GroupName := " ", |
| | | Notes := " ", |
| | | Start := Date::MinDate(), |
| | | End := Date::MaxDate() ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingStockingPointData |
| | | { |
| | | TextBody: |
| | | [* |
| | | this.IOStockingPoint_MP( relflush ); |
| | | bodyNumber := "2"; |
| | | postRequestBody := MPSync::ApiBuildPostRequestBody( bodyNumber ); |
| | | address := "api-uat-sgc.tianma.cn"; |
| | | port := 443; |
| | | url := "/otdService/https/GetStockingPointsInfo"; |
| | | data := MPSync::ApiResponesCheck( address, port, url, postRequestBody ); |
| | | this.MappingStockingPointData( data ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingUnitData ( |
| | | Strings businessTypes |
| | | ) |
| | | { |
| | | Description: 'Get unit data from operation mapping' |
| | | TextBody: |
| | | [* |
| | | listToDeal := selectset( this, MappingOperation, item, true ); |
| | | if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | listToDeal := selectset( this, MappingOperation, item, businessTypes.Find( item.BusinessType() ) >= 0 ); |
| | | } |
| | | // 常é |
| | | unitOfMeasureName := "PCS"; |
| | | currencyId := "CNY"; |
| | | startDate := Date::Date( 1900, 1, 1 ); |
| | | endDate := Date::Date( 9999, 12, 31 ); |
| | | capacityType := "Infinite"; |
| | | // é级å建 |
| | | IOUnit::CreateIfNotExistByTree( this, "天马éå¢", "天马éå¢", "", unitOfMeasureName, currencyId, startDate, endDate, capacityType ); |
| | | IOUnit::CreateIfNotExistByTree( this, "ç产", "ç产", "天马éå¢", unitOfMeasureName, currencyId, startDate, endDate, capacityType ); |
| | | IOUnit::CreateIfNotExistByTree( this, "ä¾åºå", "ä¾åºå", "天马éå¢", unitOfMeasureName, currencyId, startDate, endDate, capacityType ); |
| | | IOUnit::CreateIfNotExistByTree( this, "æ´è½¦è¿è¾", "æ´è½¦è¿è¾", "天马éå¢", unitOfMeasureName, currencyId, startDate, endDate, capacityType ); |
| | | // æ ¹æ®operationå建 |
| | | traverse( listToDeal, Elements, op ) { |
| | | // ä¸çº§ orgCode |
| | | levelOne := op.OrganCode(); |
| | | IOUnit::CreateIfNotExistByTree( this, |
| | | levelOne, op.OrganName(), "ç产", |
| | | unitOfMeasureName, currencyId, startDate, endDate, capacityType ); |
| | | // äºçº§ orgCode + plantName |
| | | levelTwo := op.OrganCode() + "_" + op.PlantName(); |
| | | IOUnit::CreateIfNotExistByTree( this, |
| | | levelTwo, levelTwo, levelOne, |
| | | unitOfMeasureName, currencyId, startDate, endDate, capacityType ); |
| | | // ä¸çº§ äºçº§ + processSection |
| | | levelThree := levelTwo + "_" + op.ProcessSection(); |
| | | IOUnit::CreateIfNotExistByTree( this, |
| | | levelThree, levelThree, levelTwo, |
| | | unitOfMeasureName, currencyId, startDate, endDate, capacityType ); |
| | | // å级 ä¸çº§ + line |
| | | if( op.Line() <> "" ) { |
| | | levelFour := levelThree + "_" + op.Line(); |
| | | IOUnit::CreateIfNotExistByTree( this, |
| | | levelFour, levelFour, levelThree, |
| | | unitOfMeasureName, currencyId, startDate, endDate, capacityType ); |
| | | } |
| | | |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method MappingUnitOfMeasureData |
| | | { |
| | | Description: 'ETLæ°æ®è½¬æ¨¡åæ°æ®' |
| | | TextBody: |
| | | [* |
| | | this.IOUnitOfMeasure_MP( relflush ); |
| | | traverse( this, MappingUnitOfMeasure, item ) { |
| | | // IOUnitOfMeasure_MP::DeleteIfExist( this, item.Name() ); |
| | | this.IOUnitOfMeasure_MP( relnew, IsDefault := item.IsDefault(), Name := item.Name() ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod ApiBuildPostRequestBody ( |
| | | String bodynumber |
| | | ) as String |
| | | { |
| | | TextBody: |
| | | [* |
| | | postrequestbody := JSON::Object() |
| | | .Add( "serviceInterfaceCode", "ESBOTDH000" + bodynumber ) |
| | | .Add( "fromSystemCode", "OTDH000" + bodynumber ) |
| | | .Add( "toInterfaceCode", "QIDH000" + bodynumber ) |
| | | .Add( "ouZone", "OU_TMSH" ) |
| | | .Add( "uuid", "1617355496bb588e353e80147eea5f45" ) |
| | | .Add( "requestTime", DateTime::Now().Format( "Y-M2-D2 H:m:s" ) ) |
| | | .Add( "dataType", "JSON" ) |
| | | .Add( "data", JSON::Object() |
| | | .Add( "pageIndex", "1" ) ).Build(); |
| | | |
| | | info( DateTime::Now().Format( "Y-M2-D2 H:m:s" ) ); |
| | | postrequestbodystring := postrequestbody.AsString(); |
| | | |
| | | return postrequestbodystring; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod ApiResponesCheck ( |
| | | String address, |
| | | Number port, |
| | | String path, |
| | | String postrequestbody |
| | | ) as owning JSON |
| | | { |
| | | TextBody: |
| | | [* |
| | | // for HTTPS requests: |
| | | i := HTTPInterface::Create( address, port ); |
| | | //i := HTTPInterface::Create( address ,443); |
| | | info( address, port, path, postrequestbody ); |
| | | |
| | | i.URL(path); |
| | | //i.SSL(false); |
| | | i.SSL(true); |
| | | i.SSLKeystore('MyKeystore'); // created in the Config Utility |
| | | |
| | | i.PostMethod(true); //it's a POST method |
| | | |
| | | i.Call(postrequestbody); // Call's argument is for POST method's content. |
| | | htmlresult := i.Result(); |
| | | |
| | | htmlresponse := JSON::Parse( htmlresult ); |
| | | |
| | | code := htmlresponse.Get( "resultCode" ).GetString(); |
| | | message := htmlresponse.Get( "resultMsg" ); |
| | | data := htmlresponse.Get( "responseData" ); |
| | | datalist := data.Get( "dataList" ); |
| | | |
| | | if( code = "1" ) |
| | | { |
| | | info( "Data have been written into table" ); |
| | | } |
| | | else |
| | | { |
| | | messagestring := " "; |
| | | if ( message.IsNull() ) |
| | | { |
| | | messagestring := "No message returns!"; |
| | | } |
| | | else |
| | | { |
| | | messagestring := message.GetString(); |
| | | } |
| | | info( "Error! error code: " + code + ", error message: " + messagestring ); |
| | | } |
| | | |
| | | return &datalist; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | Type MPSync #extension |
| | | { |
| | | } |
| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | // renhao Aug-14-2023 (created) |
| | | date := Date :: Today(); |
| | | listtodeal := selectset( this,MappingActualPISPIP,actual,not isnull( Product_MP::FindById( this, actual.ProductID() ) ) ); |
| | | totalcount := listtodeal.Size(); |
| | | info( "ActualPISPIP has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | traverse( listtodeal,Elements,actual){ |
| | | count := count + 1; |
| | | if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | info( "Now is dealing with the " + count.AsQUILL() + "ActualPISPIP " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | } |
| | | product := select( this,MappingProduct,product,product.ID() = actual.ProductID() and product.KeyProduct() = nuclear,true); |
| | | if( not isnull( product)){ |
| | | if( not isnull(businessTypes)){ |
| | | |
| | | for( i :=0 ;i < businessTypes.Size();i++ ){ |
| | | businessType := businessTypes.Element( i); |
| | | if( product.BusinessType() = businessType and not product.IsCommon()){ |
| | | ActualProductInStockingPointInPeriod::CreateOrUpdate( this, |
| | | actual.ProductID(), |
| | | actual.StockingPointID(), |
| | | actual.Description(), |
| | | actual.ActualInventoryLevelEnd(), |
| | | actual.ManufacturedDate()); |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | ActualProductInStockingPointInPeriod::CreateOrUpdate( this, |
| | | actual.ProductID(), |
| | | actual.StockingPointID(), |
| | | actual.Description(), |
| | | actual.ActualInventoryLevelEnd(), |
| | | actual.ManufacturedDate()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //// renhao Aug-14-2023 (created) |
| | | //date := Date :: Today(); |
| | | //listtodeal := selectset( this,MappingActualPISPIP,actual,not isnull( Product_MP::FindById( this, actual.ProductID() ) ) ); |
| | | //totalcount := listtodeal.Size(); |
| | | //info( "ActualPISPIP has " + totalcount.AsQUILL() + " rows in total" ); |
| | | // |
| | | //count := 0; |
| | | //traverse( listtodeal,Elements,actual){ |
| | | // count := count + 1; |
| | | // if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | // info( "Now is dealing with the " + count.AsQUILL() + "ActualPISPIP " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | // } |
| | | // product := select( this,MappingProduct,product,product.ID() = actual.ProductID() and product.KeyProduct() = nuclear,true); |
| | | // if( not isnull( product)){ |
| | | // if( not isnull(businessTypes)){ |
| | | // |
| | | // for( i :=0 ;i < businessTypes.Size();i++ ){ |
| | | // businessType := businessTypes.Element( i); |
| | | // if( product.BusinessType() = businessType and not product.IsCommon()){ |
| | | // ActualProductInStockingPointInPeriod::CreateOrUpdate( this, |
| | | // actual.ProductID(), |
| | | // actual.StockingPointID(), |
| | | // actual.Description(), |
| | | // actual.ActualInventoryLevelEnd(), |
| | | // actual.ManufacturedDate()); |
| | | // } |
| | | // } |
| | | // |
| | | // }else{ |
| | | // ActualProductInStockingPointInPeriod::CreateOrUpdate( this, |
| | | // actual.ProductID(), |
| | | // actual.StockingPointID(), |
| | | // actual.Description(), |
| | | // actual.ActualInventoryLevelEnd(), |
| | | // actual.ManufacturedDate()); |
| | | // } |
| | | // |
| | | // } |
| | | //} |
| | | *] |
| | | } |
| | |
| | | Description: 'ETLæ°æ®è½¬æ¨¡åæ°æ®' |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | traverse( this, MappingBaseConversionFactor, item ) { |
| | | //妿ProductIDä¸ä¸ºç©ºï¼ä¸å¹é
ä¸å°Productï¼åä¸å建ï¼è¿å为空 |
| | | // info( item.ProductId().AsQUILL() ); |
| | | BaseConversionFactor::CreateOrUpdate( this, |
| | | item.SourceUnitOfMeasureName(), |
| | | item.TargetUnitOfMeasureName(), |
| | | item.IsEnabled(), |
| | | item.ProductId(), |
| | | item.Factor() ); |
| | | } |
| | | //// yypsybs Aug-15-2023 (created) |
| | | //traverse( this, MappingBaseConversionFactor, item ) { |
| | | // //妿ProductIDä¸ä¸ºç©ºï¼ä¸å¹é
ä¸å°Productï¼åä¸å建ï¼è¿å为空 |
| | | //// info( item.ProductId().AsQUILL() ); |
| | | // BaseConversionFactor::CreateOrUpdate( this, |
| | | // item.SourceUnitOfMeasureName(), |
| | | // item.TargetUnitOfMeasureName(), |
| | | // item.IsEnabled(), |
| | | // item.ProductId(), |
| | | // item.Factor() ); |
| | | //} |
| | | *] |
| | | } |
| | |
| | | Description: 'ETL订å颿µ' |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | // å¾
å¤çæ°æ® |
| | | listToDeal := construct( structured[MappingCustomerOrder] ); |
| | | if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | listToDeal := selectset( this, MappingCustomerOrder, item, true ); |
| | | } else { |
| | | listToDeal := selectset( this, MappingCustomerOrder, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | } |
| | | 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( listToDeal, Elements, item, item.OrderDate() >= queryStartDate and item.OrderDate() <= queryEndDate, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) ); |
| | | |
| | | totalcount := listToDeal.Size(); |
| | | info( "CustomerOrder has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | // å¤ç |
| | | traverse( listToDeal, Elements, item ) { |
| | | count := count + 1; |
| | | if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | info( "Now is dealing with the " + count.AsQUILL() + "CustomerOrder " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | } |
| | | // if( not isnull( Product_MP::FindById( this, item.ProductID() ) ) ){ |
| | | // 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(), |
| | | item.StockPointID(), |
| | | item.SalesSegmentName(), |
| | | item.Quantity(), item.UnitOfMeasureName(), item.OrderType(), item.IsAvailable()); |
| | | //// yypsybs Aug-15-2023 (created) |
| | | //// å¾
å¤çæ°æ® |
| | | //listToDeal := construct( structured[MappingCustomerOrder] ); |
| | | //if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | // listToDeal := selectset( this, MappingCustomerOrder, item, true ); |
| | | // }else{ |
| | | // info( "invaild product: " + item.ProductID().AsQUILL() ); |
| | | // listToDeal := selectset( this, MappingCustomerOrder, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | // } |
| | | } |
| | | //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( listToDeal, Elements, item, item.OrderDate() >= queryStartDate and item.OrderDate() <= queryEndDate, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) ); |
| | | // |
| | | //totalcount := listToDeal.Size(); |
| | | //info( "CustomerOrder has " + totalcount.AsQUILL() + " rows in total" ); |
| | | // |
| | | //count := 0; |
| | | //// å¤ç |
| | | //traverse( listToDeal, Elements, item ) { |
| | | // count := count + 1; |
| | | // if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | // info( "Now is dealing with the " + count.AsQUILL() + "CustomerOrder " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | // } |
| | | //// if( not isnull( Product_MP::FindById( this, item.ProductID() ) ) ){ |
| | | //// 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(), |
| | | // item.StockPointID(), |
| | | // item.SalesSegmentName(), |
| | | // item.Quantity(), item.UnitOfMeasureName(), item.OrderType(), item.IsAvailable()); |
| | | //// }else{ |
| | | //// info( "invaild product: " + item.ProductID().AsQUILL() ); |
| | | //// } |
| | | //} |
| | | *] |
| | | } |
| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | // renhao Aug-14-2023 (created) |
| | | |
| | | listtodeal := selectset( this,MappingExternalSupply,externalSupply, |
| | | not isnull( StockingPoint_MP::FindById( this, externalSupply.StockingPointID() ) ) and not isnull( Product_MP::FindById( this, externalSupply.ProductID() ) ) ); |
| | | totalcount := listtodeal.Size(); |
| | | info( "ExternalSupply has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | traverse( listtodeal,Elements,externalSupply){ |
| | | count := count + 1; |
| | | if( count - [Number](count/100) * 100 = 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() and product.KeyProduct() = nuclear,true); |
| | | |
| | | if( not isnull( product)){ |
| | | productMP := select( this,Product_MP,productMP,productMP.ID() = externalSupply.ProductID() ,true); |
| | | stockingpoint := select( this,StockingPoint_MP,st,st.ID() = externalSupply.StockingPointID(),true); |
| | | if( not isnull(businessTypes)){ |
| | | |
| | | for( i :=0 ;i < businessTypes.Size();i++ ){ |
| | | businessType := businessTypes.Element( i); |
| | | if( product.BusinessType() = businessType and not product.IsCommon()){ |
| | | InventorySupply::CreateOrUpdate( externalSupply.ID(), |
| | | productMP, |
| | | stockingpoint, |
| | | externalSupply.Date(), |
| | | externalSupply.ManufacturedDate(), |
| | | externalSupply.UserQuantity(),"å¨éå¨å¶"); |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | if( not isnull( stockingpoint) and not isnull( productMP)){ |
| | | InventorySupply::CreateOrUpdate( externalSupply.ID(), |
| | | productMP, |
| | | stockingpoint, |
| | | externalSupply.Date(), |
| | | externalSupply.ManufacturedDate(), |
| | | externalSupply.UserQuantity(),"å¨éå¨å¶"); |
| | | } |
| | | |
| | | } |
| | | |
| | | }else{ |
| | | info( "Invaild product" ); |
| | | } |
| | | } |
| | | //// renhao Aug-14-2023 (created) |
| | | // |
| | | //listtodeal := selectset( this,MappingExternalSupply,externalSupply, |
| | | // not isnull( StockingPoint_MP::FindById( this, externalSupply.StockingPointID() ) ) and not isnull( Product_MP::FindById( this, externalSupply.ProductID() ) ) ); |
| | | //totalcount := listtodeal.Size(); |
| | | //info( "ExternalSupply has " + totalcount.AsQUILL() + " rows in total" ); |
| | | // |
| | | //count := 0; |
| | | //traverse( listtodeal,Elements,externalSupply){ |
| | | // count := count + 1; |
| | | // if( count - [Number](count/100) * 100 = 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() and product.KeyProduct() = nuclear,true); |
| | | // |
| | | // if( not isnull( product)){ |
| | | // productMP := select( this,Product_MP,productMP,productMP.ID() = externalSupply.ProductID() ,true); |
| | | // stockingpoint := select( this,StockingPoint_MP,st,st.ID() = externalSupply.StockingPointID(),true); |
| | | // if( not isnull(businessTypes)){ |
| | | // |
| | | // for( i :=0 ;i < businessTypes.Size();i++ ){ |
| | | // businessType := businessTypes.Element( i); |
| | | // if( product.BusinessType() = businessType and not product.IsCommon()){ |
| | | // InventorySupply::CreateOrUpdate( externalSupply.ID(), |
| | | // productMP, |
| | | // stockingpoint, |
| | | // externalSupply.Date(), |
| | | // externalSupply.ManufacturedDate(), |
| | | // externalSupply.UserQuantity(),"å¨éå¨å¶"); |
| | | // } |
| | | // } |
| | | // |
| | | // }else{ |
| | | // if( not isnull( stockingpoint) and not isnull( productMP)){ |
| | | // InventorySupply::CreateOrUpdate( externalSupply.ID(), |
| | | // productMP, |
| | | // stockingpoint, |
| | | // externalSupply.Date(), |
| | | // externalSupply.ManufacturedDate(), |
| | | // externalSupply.UserQuantity(),"å¨éå¨å¶"); |
| | | // } |
| | | // |
| | | // } |
| | | // |
| | | // }else{ |
| | | // info( "Invaild product" ); |
| | | // } |
| | | //} |
| | | *] |
| | | } |
| | |
| | | Description: 'ETL订å颿µ' |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | // å¾
å¤çæ°æ® |
| | | listToDeal := construct( structured[MappingForecast] ); |
| | | if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | listToDeal := selectset( this, MappingForecast, item, true ); |
| | | } else { |
| | | listToDeal := selectset( this, MappingForecast, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | } |
| | | 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( listToDeal, Elements, item, item.StartDate() >= queryStartDate and item.EndDate() <= queryEndDate, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockingPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) ); |
| | | |
| | | totalcount := listToDeal.Size(); |
| | | info( "Forecast has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | // å¤ç |
| | | traverse( listToDeal, Elements, item ) { |
| | | count := count + 1; |
| | | if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | info( "Now is dealing with the " + count.AsQUILL() + "Forecast " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | } |
| | | // if( not isnull( Product_MP::FindById( this, item.ProductID() ) ) ){ |
| | | Forecast::CreateOrUpdate( this, |
| | | item.ProductID(), item.SalesSegmentName(), item.StockingPointID(), item.PriorityName(), |
| | | item.CurrencyID(), item.UnitOfMeasureName(), |
| | | item.ID(), item.StartDate(), item.EndDate(), item.Quantity(), item.Price()); |
| | | //// yypsybs Aug-15-2023 (created) |
| | | //// å¾
å¤çæ°æ® |
| | | //listToDeal := construct( structured[MappingForecast] ); |
| | | //if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | // listToDeal := selectset( this, MappingForecast, item, true ); |
| | | // }else{ |
| | | // info( "invaild product" + item.ProductID().AsQUILL() ); |
| | | // listToDeal := selectset( this, MappingForecast, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | // } |
| | | } |
| | | //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( listToDeal, Elements, item, item.StartDate() >= queryStartDate and item.EndDate() <= queryEndDate, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockingPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) ); |
| | | // |
| | | //totalcount := listToDeal.Size(); |
| | | //info( "Forecast has " + totalcount.AsQUILL() + " rows in total" ); |
| | | // |
| | | //count := 0; |
| | | //// å¤ç |
| | | //traverse( listToDeal, Elements, item ) { |
| | | // count := count + 1; |
| | | // if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | // info( "Now is dealing with the " + count.AsQUILL() + "Forecast " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | // } |
| | | //// if( not isnull( Product_MP::FindById( this, item.ProductID() ) ) ){ |
| | | // Forecast::CreateOrUpdate( this, |
| | | // item.ProductID(), item.SalesSegmentName(), item.StockingPointID(), item.PriorityName(), |
| | | // item.CurrencyID(), item.UnitOfMeasureName(), |
| | | // item.ID(), item.StartDate(), item.EndDate(), item.Quantity(), item.Price()); |
| | | //// }else{ |
| | | //// info( "invaild product" + item.ProductID().AsQUILL() ); |
| | | //// } |
| | | //} |
| | | *] |
| | | } |
| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | listtodeal := selectset( this,MappingInventoryValueAndCost,item,not isnull( Product_MP::FindById( this, item.ProductID() ) ), not isnull( StockingPoint_MP::FindById( this, item.StockingPointID() ) ) ); |
| | | totalcount := listtodeal.Size(); |
| | | info( "InventoryCost has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | traverse( listtodeal, Elements, item ) { |
| | | count := count + 1; |
| | | if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | info( "Now is dealing with the " + count.AsQUILL() + "InventoryCost " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | } |
| | | if( not isnull( Product_MP::FindById( this, item.ProductID() ) ) ){ |
| | | InventoryValueAndCost::CreateOrUpdate( this, item.ID(), item.ProductID(), |
| | | item.StockingPointID(), |
| | | item.AccountName(), item.CostDriver(), item.Start(), item.Cost() ); |
| | | }else{ |
| | | info( "invaild product: " + item.ProductID().AsQUILL() ); |
| | | } |
| | | } |
| | | //// yypsybs Aug-15-2023 (created) |
| | | //listtodeal := selectset( this,MappingInventoryValueAndCost,item,not isnull( Product_MP::FindById( this, item.ProductID() ) ), not isnull( StockingPoint_MP::FindById( this, item.StockingPointID() ) ) ); |
| | | //totalcount := listtodeal.Size(); |
| | | //info( "InventoryCost has " + totalcount.AsQUILL() + " rows in total" ); |
| | | // |
| | | //count := 0; |
| | | //traverse( listtodeal, Elements, item ) { |
| | | // count := count + 1; |
| | | // if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | // info( "Now is dealing with the " + count.AsQUILL() + "InventoryCost " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | // } |
| | | // if( not isnull( Product_MP::FindById( this, item.ProductID() ) ) ){ |
| | | // InventoryValueAndCost::CreateOrUpdate( this, item.ID(), item.ProductID(), |
| | | // item.StockingPointID(), |
| | | // item.AccountName(), item.CostDriver(), item.Start(), item.Cost() ); |
| | | // }else{ |
| | | // info( "invaild product: " + item.ProductID().AsQUILL() ); |
| | | // } |
| | | //} |
| | | *] |
| | | } |
| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-21-2023 (created) |
| | | |
| | | keyProductList := construct( Strings ); |
| | | if( isKeyProduct ) { |
| | | keyProductList := selectuniquevalues( this, MappingProduct, item, item.KeyProduct(), item.ID() ); |
| | | } |
| | | bomList := selectsortedset( this, MappingBOM, item, |
| | | ifexpr( isnull( businessTypes ) or businessTypes.Size() = 0, |
| | | true, |
| | | businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 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"; |
| | | // ========æ£æ¥======== |
| | | product := Product_MP::FindById( this, firstRow.ProductCode() ); |
| | | if( not isnull( product ) ) { |
| | | // error( "product : " + firstRow.ProductCode() + " not found" ); |
| | | stockingPoint := StockingPoint_MP::FindById( this, stockingPointId ); |
| | | inputStockingPoint := StockingPoint_MP::FindById( this, inputStockingPointId ); |
| | | // info( stockingPointId.AsQUILL() ); |
| | | // if( isnull( stockingPoint ) ) { |
| | | // error( "stockingPoint : " + stockingPointId + " not found" ); |
| | | //// yypsybs Aug-21-2023 (created) |
| | | // |
| | | //keyProductList := construct( Strings ); |
| | | //if( isKeyProduct ) { |
| | | // keyProductList := selectuniquevalues( this, MappingProduct, item, item.KeyProduct(), item.ID() ); |
| | | // } |
| | | routing := Routing::FindById( this, 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( inputStockingPoint)){ |
| | | this.MappingOperationBOMDataRouting( routing,routingRows,inputStockingPoint,keyProductList); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if( createPurchaseSupplyMaterial ) { |
| | | toCreateBomList := selectuniquevalues( bomList, Elements, item, |
| | | item.ProductType() = "P", item.OrganCode() + item.ComponentCode()); |
| | | traverse( toCreateBomList, Elements, key ) { |
| | | boms := selectset( bomList, Elements, item, item.ProductType() = "P" and item.OrganCode() + item.ComponentCode() = key ); |
| | | bom := boms.First(); |
| | | this.MappingOperationBOMDataSupplyPurchase( bom.OrganCode(), bom.ComponentCode(), bom.ComponentType()); |
| | | } |
| | | } |
| | | //bomList := selectsortedset( this, MappingBOM, item, |
| | | // ifexpr( isnull( businessTypes ) or businessTypes.Size() = 0, |
| | | // true, |
| | | // businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 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"; |
| | | // // ========æ£æ¥======== |
| | | // product := Product_MP::FindById( this, firstRow.ProductCode() ); |
| | | // if( not isnull( product ) ) { |
| | | //// error( "product : " + firstRow.ProductCode() + " not found" ); |
| | | // stockingPoint := StockingPoint_MP::FindById( this, stockingPointId ); |
| | | // inputStockingPoint := StockingPoint_MP::FindById( this, inputStockingPointId ); |
| | | //// info( stockingPointId.AsQUILL() ); |
| | | // // if( isnull( stockingPoint ) ) { |
| | | // // error( "stockingPoint : " + stockingPointId + " not found" ); |
| | | // // } |
| | | // routing := Routing::FindById( this, 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( inputStockingPoint)){ |
| | | // this.MappingOperationBOMDataRouting( routing,routingRows,inputStockingPoint,keyProductList); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | //if( createPurchaseSupplyMaterial ) { |
| | | // toCreateBomList := selectuniquevalues( bomList, Elements, item, |
| | | // item.ProductType() = "P", item.OrganCode() + item.ComponentCode()); |
| | | // traverse( toCreateBomList, Elements, key ) { |
| | | // boms := selectset( bomList, Elements, item, item.ProductType() = "P" and item.OrganCode() + item.ComponentCode() = key ); |
| | | // bom := boms.First(); |
| | | // this.MappingOperationBOMDataSupplyPurchase( bom.OrganCode(), bom.ComponentCode(), bom.ComponentType()); |
| | | // } |
| | | //} |
| | | *] |
| | | } |
| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-21-2023 (created) |
| | | |
| | | // æ ¹æ®å·¥èºæ®µæ±æ»å¤ç |
| | | processSections := selectuniquevalues( routingRows, Elements, row, true, row.ProcessSection() ); |
| | | traverse( processSections, Elements, processSection ) { |
| | | rows := selectset( routingRows, Elements, row, row.ProcessSection() = processSection ); |
| | | firstRow := rows.Element( 0 ); |
| | | // æ¾orgCode/productId/processSectionå¹é
ä¸sequenceæå°çä¸ç»æ°æ® |
| | | minSeq := MappingOperation::FindMinSeq( this, firstRow.OrganCode(), firstRow.ProductCode(), processSection ); |
| | | routingStepId := processSection + "_" + [String]minSeq; |
| | | // æ¾å¯¹åºroutingStep |
| | | routingStep := RoutingStep::FindByName( routing, routingStepId ); |
| | | if( not isnull( routingStep ) ) { |
| | | // error( "routing step : " + routing.ID() + "|" + routingStepId + " not found" ); |
| | | // ä»
主æï¼ç»ä¸å¤ç |
| | | noAlterRows := selectset( rows, Elements, noAlterRow, noAlterRow.AlternativeMaterialCode() = "" ); |
| | | traverse( noAlterRows, Elements, noAlterRow ) { |
| | | traverse( routingStep, Operation, toLink ) { |
| | | // æ£æ¥ä¸»æ |
| | | component := Product_MP::FindById( this, noAlterRow.ComponentCode() ); |
| | | if( not isnull( component ) ) { |
| | | // error( "component : " + noAlterRow.ComponentCode() + " not found" ); |
| | | // è¿æ¥äº§åä¸operation |
| | | pisp := ProductInStockingPoint_MP::CreateIfNotFound( component, stockingPoint ); |
| | | trash := construct( OperationBOMs ); |
| | | operationBOM := toLink.LinkProduct( component, true, BaseOperationLink::GetGroupID( toLink, true, false ), pisp, |
| | | true, trash ); |
| | | operationBOM.MinQuantityInGroup( 0 ); |
| | | operationBOM.Quantity( noAlterRow.UnitUsageOfComponents() / noAlterRow.ComponentOutputRate() ); |
| | | operationBOM.MaxQuantityInGroup( noAlterRow.UnitUsageOfComponents() / noAlterRow.ComponentOutputRate() ); |
| | | } |
| | | } |
| | | } |
| | | // æ¿æ¢æï¼æä¸»æåç»å¤ç |
| | | alterComponentIds := selectuniquevalues( rows, Elements, row, row.AlternativeMaterialCode() <> "", row.ComponentCode() ); |
| | | traverse( alterComponentIds, Elements, alterComponentId ) { |
| | | alterRows := selectset( rows, Elements, row, row.ComponentCode() = alterComponentId ); |
| | | firstAlterRow := alterRows.Element( 0 ); |
| | | // æ£æ¥ä¸»æ |
| | | component := Product_MP::FindById( this, firstAlterRow.ComponentCode() ); |
| | | if( not isnull( component ) ) { |
| | | // error( "component : " + firstAlterRow.ComponentCode() + " not found" ); |
| | | //// yypsybs Aug-21-2023 (created) |
| | | // |
| | | //// æ ¹æ®å·¥èºæ®µæ±æ»å¤ç |
| | | //processSections := selectuniquevalues( routingRows, Elements, row, true, row.ProcessSection() ); |
| | | //traverse( processSections, Elements, processSection ) { |
| | | // rows := selectset( routingRows, Elements, row, row.ProcessSection() = processSection ); |
| | | // firstRow := rows.Element( 0 ); |
| | | // // æ¾orgCode/productId/processSectionå¹é
ä¸sequenceæå°çä¸ç»æ°æ® |
| | | // minSeq := MappingOperation::FindMinSeq( this, firstRow.OrganCode(), firstRow.ProductCode(), processSection ); |
| | | // routingStepId := processSection + "_" + [String]minSeq; |
| | | // // æ¾å¯¹åºroutingStep |
| | | // routingStep := RoutingStep::FindByName( routing, routingStepId ); |
| | | // if( not isnull( routingStep ) ) { |
| | | //// error( "routing step : " + routing.ID() + "|" + routingStepId + " not found" ); |
| | | // // ä»
主æï¼ç»ä¸å¤ç |
| | | // noAlterRows := selectset( rows, Elements, noAlterRow, noAlterRow.AlternativeMaterialCode() = "" ); |
| | | // traverse( noAlterRows, Elements, noAlterRow ) { |
| | | // traverse( routingStep, Operation, toLink ) { |
| | | // // æ£æ¥ä¸»æ |
| | | // component := Product_MP::FindById( this, noAlterRow.ComponentCode() ); |
| | | // if( not isnull( component ) ) { |
| | | //// error( "component : " + noAlterRow.ComponentCode() + " not found" ); |
| | | // // è¿æ¥äº§åä¸operation |
| | | // pisp := ProductInStockingPoint_MP::CreateIfNotFound( component, stockingPoint ); |
| | | // trash := construct( OperationBOMs ); |
| | | // operationBOM := toLink.LinkProduct( component, true, BaseOperationLink::GetGroupID( toLink, true, false ), pisp, |
| | | // true, trash ); |
| | | // operationBOM.MinQuantityInGroup( 0 ); |
| | | // operationBOM.Quantity( noAlterRow.UnitUsageOfComponents() / noAlterRow.ComponentOutputRate() ); |
| | | // operationBOM.MaxQuantityInGroup( noAlterRow.UnitUsageOfComponents() / noAlterRow.ComponentOutputRate() ); |
| | | // } |
| | | traverse( routingStep, Operation, toLink ) { |
| | | // è¿æ¥äº§åä¸operation |
| | | pisp := ProductInStockingPoint_MP::CreateIfNotFound( component, stockingPoint ); |
| | | trash := construct( OperationBOMs ); |
| | | mainBOM := toLink.LinkProduct( component, true, BaseOperationLink::GetGroupID( toLink, true, false ), pisp, |
| | | true, trash ); |
| | | mainBOM.Quantity( firstAlterRow.UnitUsageOfComponents() / firstAlterRow.ComponentOutputRate() ); |
| | | mainBOM.MaxQuantityInGroup( firstAlterRow.UnitUsageOfComponents() / firstAlterRow.ComponentOutputRate() ); |
| | | mainQty := mainBOM.Quantity(); |
| | | Transaction::Transaction().Propagate(); |
| | | // æ·»å è¾
æ |
| | | traverse( alterRows, Elements, alterRow ) { |
| | | alterProd := Product_MP::FindById( this, alterRow.AlternativeMaterialCode() ); |
| | | if( not isnull( alterProd ) ) { |
| | | // error( "alterProd : " + alterRow.AlternativeMaterialCode() + " not found" ); |
| | | stockingPointIdAlter := alterRow.OrganCode() + "_" + alterRow.ProductType() + "_STOCK"; |
| | | stockingPointAlter := StockingPoint_MP::FindById( this, stockingPointIdAlter ); |
| | | if( isnull( stockingPointAlter ) ) { |
| | | error( "stockingPoint : " + stockingPointIdAlter + " not found" ); |
| | | } |
| | | pispAlter := ProductInStockingPoint_MP::CreateIfNotFound( alterProd, stockingPointAlter ); |
| | | mainInput := toLink.LastOperationInput(); |
| | | trash := construct( OperationBOMs ); |
| | | if( not isnull( mainInput ) ) { |
| | | alterBom := mainInput.Operation().LinkPISP( pispAlter, true, mainInput.OperationLinkGroupID(), trash ); |
| | | alterBom.Quantity( mainBOM.MaxQuantityInGroup() * alterRow.AlternativeRate() ); |
| | | alterBom.MaxQuantityInGroup( mainBOM.MaxQuantityInGroup() ); |
| | | // info( "Quantity" + [String]alterBom.Quantity() ) |
| | | // info( "MaxQuantityInGroup" + [String]alterBom.MaxQuantityInGroup() ) |
| | | mainQty := mainQty - alterBom.Quantity(); |
| | | } |
| | | } |
| | | mainBOM.Quantity( mainQty ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // } |
| | | // } |
| | | // // æ¿æ¢æï¼æä¸»æåç»å¤ç |
| | | // alterComponentIds := selectuniquevalues( rows, Elements, row, row.AlternativeMaterialCode() <> "", row.ComponentCode() ); |
| | | // traverse( alterComponentIds, Elements, alterComponentId ) { |
| | | // alterRows := selectset( rows, Elements, row, row.ComponentCode() = alterComponentId ); |
| | | // firstAlterRow := alterRows.Element( 0 ); |
| | | // // æ£æ¥ä¸»æ |
| | | // component := Product_MP::FindById( this, firstAlterRow.ComponentCode() ); |
| | | // if( not isnull( component ) ) { |
| | | //// error( "component : " + firstAlterRow.ComponentCode() + " not found" ); |
| | | //// } |
| | | // traverse( routingStep, Operation, toLink ) { |
| | | // // è¿æ¥äº§åä¸operation |
| | | // pisp := ProductInStockingPoint_MP::CreateIfNotFound( component, stockingPoint ); |
| | | // trash := construct( OperationBOMs ); |
| | | // mainBOM := toLink.LinkProduct( component, true, BaseOperationLink::GetGroupID( toLink, true, false ), pisp, |
| | | // true, trash ); |
| | | // mainBOM.Quantity( firstAlterRow.UnitUsageOfComponents() / firstAlterRow.ComponentOutputRate() ); |
| | | // mainBOM.MaxQuantityInGroup( firstAlterRow.UnitUsageOfComponents() / firstAlterRow.ComponentOutputRate() ); |
| | | // mainQty := mainBOM.Quantity(); |
| | | // Transaction::Transaction().Propagate(); |
| | | // // æ·»å è¾
æ |
| | | // traverse( alterRows, Elements, alterRow ) { |
| | | // alterProd := Product_MP::FindById( this, alterRow.AlternativeMaterialCode() ); |
| | | // if( not isnull( alterProd ) ) { |
| | | // // error( "alterProd : " + alterRow.AlternativeMaterialCode() + " not found" ); |
| | | // stockingPointIdAlter := alterRow.OrganCode() + "_" + alterRow.ProductType() + "_STOCK"; |
| | | // stockingPointAlter := StockingPoint_MP::FindById( this, stockingPointIdAlter ); |
| | | // if( isnull( stockingPointAlter ) ) { |
| | | // error( "stockingPoint : " + stockingPointIdAlter + " not found" ); |
| | | // } |
| | | // pispAlter := ProductInStockingPoint_MP::CreateIfNotFound( alterProd, stockingPointAlter ); |
| | | // mainInput := toLink.LastOperationInput(); |
| | | // trash := construct( OperationBOMs ); |
| | | // if( not isnull( mainInput ) ) { |
| | | // alterBom := mainInput.Operation().LinkPISP( pispAlter, true, mainInput.OperationLinkGroupID(), trash ); |
| | | // alterBom.Quantity( mainBOM.MaxQuantityInGroup() * alterRow.AlternativeRate() ); |
| | | // alterBom.MaxQuantityInGroup( mainBOM.MaxQuantityInGroup() ); |
| | | //// info( "Quantity" + [String]alterBom.Quantity() ) |
| | | //// info( "MaxQuantityInGroup" + [String]alterBom.MaxQuantityInGroup() ) |
| | | // mainQty := mainQty - alterBom.Quantity(); |
| | | // } |
| | | // } |
| | | // mainBOM.Quantity( mainQty ); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | *] |
| | | } |
| | |
| | | Description: 'Get operation cost data from operation mapping' |
| | | TextBody: |
| | | [* |
| | | // Administrator Aug-21-2023 (created) |
| | | // list to deal |
| | | listtodeal := construct( structured[MappingOperation] ); |
| | | |
| | | if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | listtodeal := selectset( this, MappingOperation, item, true ); |
| | | } else { |
| | | listtodeal := selectset( this, MappingOperation, item, businesstypes.Find( item.BusinessType() ) <> -1 ); |
| | | } |
| | | |
| | | // Get the list to deal with max sequence number |
| | | listtodealwithmaxsn := construct( structured[MappingOperation] ); |
| | | traverse( listtodeal, Elements, item ){ |
| | | maxsn := maxselect( this, |
| | | MappingOperation, |
| | | moperation, |
| | | moperation.OrganCode() = item.OrganCode(), |
| | | moperation.ProductID() = item.ProductID(), |
| | | moperation.SequenceNumber() ).SequenceNumber() |
| | | if( item.SequenceNumber() = maxsn ){ |
| | | listtodealwithmaxsn.Add( item ); |
| | | } |
| | | } |
| | | |
| | | totalcount := listtodealwithmaxsn.Size(); |
| | | info( "OperationCost has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | // Get the operation cost data |
| | | traverse( listtodealwithmaxsn, Elements, item ){ |
| | | count := count + 1; |
| | | if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | info( "Now is dealing with the " + count.AsQUILL() + "OperationCost " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | } |
| | | id := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection() + "_" + item.Line(); |
| | | operation := Operation::FindOperationTypeIndex( id ); |
| | | account := Account_MP::FindByName( this, "Operation cost" ); |
| | | isfromdb := false; |
| | | existoperationcost := OperationCost::FindOperationCostTypeIndex( id ); |
| | | if( isnull( existoperationcost ) ){ |
| | | connecteditem := select( this, |
| | | 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 ); |
| | | } |
| | | } |
| | | //// Administrator Aug-21-2023 (created) |
| | | //// list to deal |
| | | //listtodeal := construct( structured[MappingOperation] ); |
| | | // |
| | | //if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | // listtodeal := selectset( this, MappingOperation, item, true ); |
| | | //} else { |
| | | // listtodeal := selectset( this, MappingOperation, item, businesstypes.Find( item.BusinessType() ) <> -1 ); |
| | | //} |
| | | // |
| | | //// Get the list to deal with max sequence number |
| | | //listtodealwithmaxsn := construct( structured[MappingOperation] ); |
| | | //traverse( listtodeal, Elements, item ){ |
| | | // maxsn := maxselect( this, |
| | | // MappingOperation, |
| | | // moperation, |
| | | // moperation.OrganCode() = item.OrganCode(), |
| | | // moperation.ProductID() = item.ProductID(), |
| | | // moperation.SequenceNumber() ).SequenceNumber() |
| | | // if( item.SequenceNumber() = maxsn ){ |
| | | // listtodealwithmaxsn.Add( item ); |
| | | // } |
| | | // } |
| | | // |
| | | //totalcount := listtodealwithmaxsn.Size(); |
| | | //info( "OperationCost has " + totalcount.AsQUILL() + " rows in total" ); |
| | | // |
| | | //count := 0; |
| | | //// Get the operation cost data |
| | | //traverse( listtodealwithmaxsn, Elements, item ){ |
| | | // count := count + 1; |
| | | // if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | // info( "Now is dealing with the " + count.AsQUILL() + "OperationCost " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | // } |
| | | // id := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection() + "_" + item.Line(); |
| | | // operation := Operation::FindOperationTypeIndex( id ); |
| | | // account := Account_MP::FindByName( this, "Operation cost" ); |
| | | // isfromdb := false; |
| | | // existoperationcost := OperationCost::FindOperationCostTypeIndex( id ); |
| | | // if( isnull( existoperationcost ) ){ |
| | | // connecteditem := select( this, |
| | | // 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 ); |
| | | // } |
| | | // } |
| | | *] |
| | | } |
| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-18-2023 (created) |
| | | // è·åæåºçå¾
å¤çè®°å½ |
| | | toDealList := construct( MappingOperations ); |
| | | if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | toDealList := selectsortedset( this, MappingOperation, item, |
| | | // businessTypes.Find( item.BusinessType() ) >= 0, |
| | | businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0, |
| | | item.SequenceNumber() ); |
| | | } else { |
| | | toDealList := selectsortedset( this, MappingOperation, item, |
| | | true, |
| | | item.SequenceNumber() ); |
| | | } |
| | | // éæ¡å¤çï¼é¦æ¬¡å¤çæ¶å é¤steps |
| | | dealtRoutingIds := construct( Strings ); |
| | | routingList := construct( Routings ); |
| | | traverse( toDealList, Elements, item ) { |
| | | routingId := item.OrganCode() + "_" + item.ProductID(); |
| | | unitId := item.OrganCode() + "_" + item.PlantName() + "_" + item.ProcessSection(); |
| | | routingStepName := item.ProcessSection() + "_" + [String]item.SequenceNumber(); |
| | | operationId := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection(); |
| | | //// yypsybs Aug-18-2023 (created) |
| | | //// è·åæåºçå¾
å¤çè®°å½ |
| | | //toDealList := construct( MappingOperations ); |
| | | //if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | // toDealList := selectsortedset( this, MappingOperation, item, |
| | | //// businessTypes.Find( item.BusinessType() ) >= 0, |
| | | // businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0, |
| | | // item.SequenceNumber() ); |
| | | //} else { |
| | | // toDealList := selectsortedset( this, MappingOperation, item, |
| | | // true, |
| | | // item.SequenceNumber() ); |
| | | //} |
| | | //// éæ¡å¤çï¼é¦æ¬¡å¤çæ¶å é¤steps |
| | | //dealtRoutingIds := construct( Strings ); |
| | | //routingList := construct( Routings ); |
| | | //traverse( toDealList, Elements, item ) { |
| | | // routingId := item.OrganCode() + "_" + item.ProductID(); |
| | | // unitId := item.OrganCode() + "_" + item.PlantName() + "_" + item.ProcessSection(); |
| | | // routingStepName := item.ProcessSection() + "_" + [String]item.SequenceNumber(); |
| | | // operationId := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection(); |
| | | //// info( "========" ) |
| | | //// info( "routingId:" + routingId ); |
| | | //// info( "unitId:" + unitId ); |
| | | //// info( "routingStepName:" + routingStepName ); |
| | | //// info( "operationId:" + operationId ); |
| | | // if( guard( item.Line(), "" ).Length() > 0 ) { |
| | | // unitId := unitId + "_" + item.Line(); |
| | | // operationId := operationId + "_" + item.Line() |
| | | // } |
| | | // routing := Routing::CreateOrUpdate( this, routingId ); |
| | | // if( routingList.Find( routing ) < 0 ) { |
| | | // routingList.Add( routing ); |
| | | // } |
| | | // // å é¤steps(unitså
³ç³»ãoperationsä¹ä¼å é¤) |
| | | // if( dealtRoutingIds.Find( routingId ) < 0 ) { |
| | | // toDeleteSteps := selectset( routing, RoutingStep, routingStep, true ); |
| | | // RoutingStep::Delete( toDeleteSteps ); |
| | | // dealtRoutingIds.Add( routingId ); |
| | | // } |
| | | // // RoutingStep |
| | | // routingStep := RoutingStep::FindByName( routing, routingStepName ); |
| | | // if( isnull( routingStep ) ) { |
| | | // routingStep := RoutingStep::Create( routing, routingStepName, "", true ); |
| | | // } |
| | | // // UnitOfMeasure |
| | | // unitOfMeasure := UnitOfMeasure_MP::FindByName( this, item.UnitOfMeasureName() ); |
| | | // if( isnull( unitOfMeasure ) ) { |
| | | // error( "unit of measure [" + item.UnitOfMeasureName() + "] not found for routing [" + routingId + "]" ); |
| | | // } |
| | | // // Unit |
| | | // unit := Unit::FindById( this, unitId ); |
| | | // if( isnull( unit ) ) { |
| | | // unit := this.Unit( relnew, |
| | | // ID := unitId, Name := unitId, CapacityType := "Infinite", |
| | | // DefaultGridX := 0, DefaultGridY := 0, |
| | | // IsManuallyConfigured := false, |
| | | // Currency_MP := this.BaseCurrency(), UnitOfMeasure_MP := unitOfMeasure ); |
| | | // } |
| | | // // Operation |
| | | // haveMaxQty := item.MaximumQuantity() <> 0.0; |
| | | // op := Operation::FindOperationTypeIndex( operationId ); |
| | | // if( isnull( op)){ |
| | | // op := Operation::Create( operationId, unit, operationId, routingStep, |
| | | // Duration::Hours( item.UserLeadTime() ), Duration::Zero(), item.ActualCapacity(), false, |
| | | // [Real]item.MinimumQuantity(), haveMaxQty, guard( [Real]item.MaximumQuantity(), Real::MaxReal() ), |
| | | // 0.0, 0.0, false, true ); |
| | | // } |
| | | // |
| | | // ManufactureLTProcessSection::CreateOrUpdate( op ); |
| | | //} |
| | | // info( "========" ) |
| | | // info( "routingId:" + routingId ); |
| | | // info( "unitId:" + unitId ); |
| | | // info( "routingStepName:" + routingStepName ); |
| | | // info( "operationId:" + operationId ); |
| | | if( guard( item.Line(), "" ).Length() > 0 ) { |
| | | unitId := unitId + "_" + item.Line(); |
| | | operationId := operationId + "_" + item.Line() |
| | | } |
| | | routing := Routing::CreateOrUpdate( this, routingId ); |
| | | if( routingList.Find( routing ) < 0 ) { |
| | | routingList.Add( routing ); |
| | | } |
| | | // å é¤steps(unitså
³ç³»ãoperationsä¹ä¼å é¤) |
| | | if( dealtRoutingIds.Find( routingId ) < 0 ) { |
| | | toDeleteSteps := selectset( routing, RoutingStep, routingStep, true ); |
| | | RoutingStep::Delete( toDeleteSteps ); |
| | | dealtRoutingIds.Add( routingId ); |
| | | } |
| | | // RoutingStep |
| | | routingStep := RoutingStep::FindByName( routing, routingStepName ); |
| | | if( isnull( routingStep ) ) { |
| | | routingStep := RoutingStep::Create( routing, routingStepName, "", true ); |
| | | } |
| | | // UnitOfMeasure |
| | | unitOfMeasure := UnitOfMeasure_MP::FindByName( this, item.UnitOfMeasureName() ); |
| | | if( isnull( unitOfMeasure ) ) { |
| | | error( "unit of measure [" + item.UnitOfMeasureName() + "] not found for routing [" + routingId + "]" ); |
| | | } |
| | | // Unit |
| | | unit := Unit::FindById( this, unitId ); |
| | | if( isnull( unit ) ) { |
| | | unit := this.Unit( relnew, |
| | | ID := unitId, Name := unitId, CapacityType := "Infinite", |
| | | DefaultGridX := 0, DefaultGridY := 0, |
| | | IsManuallyConfigured := false, |
| | | Currency_MP := this.BaseCurrency(), UnitOfMeasure_MP := unitOfMeasure ); |
| | | } |
| | | // Operation |
| | | haveMaxQty := item.MaximumQuantity() <> 0.0; |
| | | op := Operation::FindOperationTypeIndex( operationId ); |
| | | if( isnull( op)){ |
| | | op := Operation::Create( operationId, unit, operationId, routingStep, |
| | | Duration::Hours( item.UserLeadTime() ), Duration::Zero(), item.ActualCapacity(), false, |
| | | [Real]item.MinimumQuantity(), haveMaxQty, guard( [Real]item.MaximumQuantity(), Real::MaxReal() ), |
| | | 0.0, 0.0, false, true ); |
| | | } |
| | | |
| | | ManufactureLTProcessSection::CreateOrUpdate( op ); |
| | | } |
| | | info( "========" ) |
| | | // éåroutingï¼è¿è¡link |
| | | lastStep := null( RoutingStep ); |
| | | traverse( routingList, Elements.RoutingStep, step ) { |
| | | // åå·¥èºè·¯çº¿æ¶è¿æ¥ |
| | | if( not isnull( lastStep ) and lastStep.Routing() = step.Routing() ) { |
| | | toLink := construct( RoutingSteps ); |
| | | toLink.Add( lastStep ); |
| | | // todo åç |
| | | step.LinkOperations( toLink ); |
| | | } |
| | | lastStep := step; |
| | | } |
| | | //// éåroutingï¼è¿è¡link |
| | | //lastStep := null( RoutingStep ); |
| | | //traverse( routingList, Elements.RoutingStep, step ) { |
| | | // // åå·¥èºè·¯çº¿æ¶è¿æ¥ |
| | | // if( not isnull( lastStep ) and lastStep.Routing() = step.Routing() ) { |
| | | // toLink := construct( RoutingSteps ); |
| | | // toLink.Add( lastStep ); |
| | | // // todo åç |
| | | // step.LinkOperations( toLink ); |
| | | // } |
| | | // lastStep := step; |
| | | //} |
| | | *] |
| | | } |
| | |
| | | Description: 'Method to get needed data from mapping product data' |
| | | TextBody: |
| | | [* |
| | | // Administrator Aug-16-2023 (created) |
| | | // list to deal |
| | | //info( "Get list to deal of product" ); |
| | | listToDeal := construct( structured[MappingProduct] ); |
| | | |
| | | if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | if( iskeyproduct = true ){ |
| | | listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true ); |
| | | } |
| | | else{ |
| | | listToDeal := selectset( this, MappingProduct, item, true ); |
| | | } |
| | | } else { |
| | | if( iskeyproduct = true ){ |
| | | listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true, businesstypes.Difference( businesstypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 ); |
| | | } |
| | | else{ |
| | | listToDeal := selectset( this, MappingProduct, item, businesstypes.Difference( businesstypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 ); |
| | | } |
| | | } |
| | | totalcount := listToDeal.Size(); |
| | | info( "Product has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | // Get the root data |
| | | Product_MP::CreateOrUpdate( this, |
| | | "å
¨é¨ç©æäº§å", |
| | | "", |
| | | "å
¨é¨ç©æäº§å", |
| | | "PCS", |
| | | "å
¨é¨ç©æäº§å", |
| | | 0.0 |
| | | ); |
| | | count := 0; |
| | | // Get the ProductMajorType list & ProductSubclassType list |
| | | traverse( listToDeal, Elements, item ){ |
| | | count := count + 1; |
| | | if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | info( "Now is dealing with the " + count.AsQUILL() + "Product " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | } |
| | | if( not item.ProductMajorType() = "" ){ |
| | | Product_MP::CreateOrUpdate( this, |
| | | item.ProductMajorType(), |
| | | "å
¨é¨ç©æäº§å", |
| | | item.ProductMajorType(), |
| | | "PCS", |
| | | item.ProductMajorType(), |
| | | 0.0 |
| | | ); |
| | | } |
| | | productmajortype := item.ProductMajorType(); |
| | | if( productmajortype="" ){ |
| | | productmajortype := "å
¨é¨ç©æäº§å"; |
| | | } |
| | | |
| | | if( not item.ProductSubclassType() = "" ){ |
| | | Product_MP::CreateOrUpdate( this, |
| | | item.ProductSubclassType(), |
| | | productmajortype, |
| | | item.ProductSubclassType(), |
| | | "PCS", |
| | | item.ProductSubclassType(), |
| | | 0.0 |
| | | ); |
| | | } |
| | | productsubclasstype := item.ProductSubclassType(); |
| | | if( productsubclasstype="" ){ |
| | | productsubclasstype := productmajortype; |
| | | } |
| | | |
| | | if( not item.ID() = "" ){ |
| | | Product_MP::CreateOrUpdate( this, |
| | | item.ID(), |
| | | productsubclasstype, |
| | | item.ID(), |
| | | item.UnitOfMeasureName(), |
| | | item.Name(), |
| | | item.ShelfLife() |
| | | ); |
| | | } |
| | | } |
| | | //// Administrator Aug-16-2023 (created) |
| | | //// list to deal |
| | | ////info( "Get list to deal of product" ); |
| | | //listToDeal := construct( structured[MappingProduct] ); |
| | | // |
| | | //if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | // if( iskeyproduct = true ){ |
| | | // listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true ); |
| | | // } |
| | | // else{ |
| | | // listToDeal := selectset( this, MappingProduct, item, true ); |
| | | // } |
| | | //} else { |
| | | // if( iskeyproduct = true ){ |
| | | // listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true, businesstypes.Difference( businesstypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 ); |
| | | // } |
| | | // else{ |
| | | // listToDeal := selectset( this, MappingProduct, item, businesstypes.Difference( businesstypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 ); |
| | | // } |
| | | //} |
| | | //totalcount := listToDeal.Size(); |
| | | //info( "Product has " + totalcount.AsQUILL() + " rows in total" ); |
| | | // |
| | | //// Get the root data |
| | | //Product_MP::CreateOrUpdate( this, |
| | | // "å
¨é¨ç©æäº§å", |
| | | // "", |
| | | // "å
¨é¨ç©æäº§å", |
| | | // "PCS", |
| | | // "å
¨é¨ç©æäº§å", |
| | | // 0.0 |
| | | // ); |
| | | //count := 0; |
| | | //// Get the ProductMajorType list & ProductSubclassType list |
| | | //traverse( listToDeal, Elements, item ){ |
| | | // count := count + 1; |
| | | // if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | // info( "Now is dealing with the " + count.AsQUILL() + "Product " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | // } |
| | | // if( not item.ProductMajorType() = "" ){ |
| | | // Product_MP::CreateOrUpdate( this, |
| | | // item.ProductMajorType(), |
| | | // "å
¨é¨ç©æäº§å", |
| | | // item.ProductMajorType(), |
| | | // "PCS", |
| | | // item.ProductMajorType(), |
| | | // 0.0 |
| | | // ); |
| | | // } |
| | | // productmajortype := item.ProductMajorType(); |
| | | // if( productmajortype="" ){ |
| | | // productmajortype := "å
¨é¨ç©æäº§å"; |
| | | // } |
| | | // |
| | | // if( not item.ProductSubclassType() = "" ){ |
| | | // Product_MP::CreateOrUpdate( this, |
| | | // item.ProductSubclassType(), |
| | | // productmajortype, |
| | | // item.ProductSubclassType(), |
| | | // "PCS", |
| | | // item.ProductSubclassType(), |
| | | // 0.0 |
| | | // ); |
| | | // } |
| | | // productsubclasstype := item.ProductSubclassType(); |
| | | // if( productsubclasstype="" ){ |
| | | // productsubclasstype := productmajortype; |
| | | // } |
| | | // |
| | | // if( not item.ID() = "" ){ |
| | | // Product_MP::CreateOrUpdate( this, |
| | | // item.ID(), |
| | | // productsubclasstype, |
| | | // item.ID(), |
| | | // item.UnitOfMeasureName(), |
| | | // item.Name(), |
| | | // item.ShelfLife() |
| | | // ); |
| | | // } |
| | | // } |
| | | *] |
| | | } |
| | |
| | | Description: 'Get Product In Line data' |
| | | TextBody: |
| | | [* |
| | | // Administrator Aug-17-2023 (created) |
| | | // list to deal |
| | | listtodeal := selectset( this, MappingProductInLane, item, not isnull( Product_MP::FindById( this, item.ProductID() ) ), not isnull( Lane::FindLaneTypeIndex( item.LineID() ) ) ); |
| | | totalcount := listtodeal.Size(); |
| | | info( "ProductInLane has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | // Create ProductInLane |
| | | traverse( listtodeal, Elements, item ){ |
| | | count := count + 1; |
| | | if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | info( "Now is dealing with the " + count.AsQUILL() + "ProductInLane " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | } |
| | | ProductInLane::CreateOrUpdate( this, item.ProductID(), item.LineID() ); |
| | | } |
| | | //// Administrator Aug-17-2023 (created) |
| | | //// list to deal |
| | | //listtodeal := selectset( this, MappingProductInLane, item, not isnull( Product_MP::FindById( this, item.ProductID() ) ), not isnull( Lane::FindLaneTypeIndex( item.LineID() ) ) ); |
| | | //totalcount := listtodeal.Size(); |
| | | //info( "ProductInLane has " + totalcount.AsQUILL() + " rows in total" ); |
| | | // |
| | | //count := 0; |
| | | //// Create ProductInLane |
| | | //traverse( listtodeal, Elements, item ){ |
| | | // count := count + 1; |
| | | // if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | // info( "Now is dealing with the " + count.AsQUILL() + "ProductInLane " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | // } |
| | | // ProductInLane::CreateOrUpdate( this, item.ProductID(), item.LineID() ); |
| | | // } |
| | | *] |
| | | } |
| | |
| | | Description: 'ETLéå®é¨é¨' |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | // å¾
å¤çæ°æ® |
| | | listToDeal := construct( structured[MappingSalesSegment] ); |
| | | if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | listToDeal := selectset( this, MappingSalesSegment, item, true ); |
| | | } else { |
| | | listToDeal := selectset( this, MappingSalesSegment, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | } |
| | | //nameList := construct( structured[String] ); |
| | | //nameList := selectvalues( listToDeal, Elements, item, true, item.Name() ); |
| | | //// æ£æ¥parent |
| | | //traverse( listToDeal, Elements, item, item.ParentName() <> "" ) { |
| | | // if( nameList.Find( item.ParentName() ) = -1 ) { |
| | | // error( "sales segment parent not found: " + item.Name().AsQUILL() ); |
| | | //// yypsybs Aug-15-2023 (created) |
| | | //// å¾
å¤çæ°æ® |
| | | //listToDeal := construct( structured[MappingSalesSegment] ); |
| | | //if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | // listToDeal := selectset( this, MappingSalesSegment, item, true ); |
| | | //} else { |
| | | // listToDeal := selectset( this, MappingSalesSegment, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | // } |
| | | //} |
| | | //// éå±éåï¼ç´è³å¤ç宿 |
| | | //dealtNameList := construct( structured[String] ); |
| | | //while( listToDeal.Size() <> dealtNameList.Size() ) { |
| | | ////nameList := construct( structured[String] ); |
| | | ////nameList := selectvalues( listToDeal, Elements, item, true, item.Name() ); |
| | | ////// æ£æ¥parent |
| | | ////traverse( listToDeal, Elements, item, item.ParentName() <> "" ) { |
| | | //// if( nameList.Find( item.ParentName() ) = -1 ) { |
| | | //// error( "sales segment parent not found: " + item.Name().AsQUILL() ); |
| | | //// } |
| | | ////} |
| | | ////// éå±éåï¼ç´è³å¤ç宿 |
| | | ////dealtNameList := construct( structured[String] ); |
| | | ////while( listToDeal.Size() <> dealtNameList.Size() ) { |
| | | //// traverse( listToDeal, Elements, item ) { |
| | | //// // æªå¤çè¿ |
| | | //// if( dealtNameList.Find( item.Name() ) < 0 ){ |
| | | //// // æ ç¶é¨é¨ï¼ç´æ¥å¤ç |
| | | //// if( item.ParentName() = "" ) { |
| | | //// SalesSegment_MP::CreateOrUpdate( this, item.Name(), item.DisplayIndex(), item.ParentName() ); |
| | | //// dealtNameList.Add( item.Name() ); |
| | | //// } |
| | | //// // æç¶é¨é¨ä¸ç¶é¨é¨å·²å¤ç |
| | | //// else if( item.ParentName() <> "" and dealtNameList.Find(item.ParentName()) >= 0 ) { |
| | | //// SalesSegment_MP::CreateOrUpdate( this, item.Name(), item.DisplayIndex(), item.ParentName() ); |
| | | //// dealtNameList.Add( item.Name() ); |
| | | //// } |
| | | //// // æç¶é¨é¨ä¸ç¶é¨é¨æªå¤çï¼ä¸ä¸è½®å¤ç |
| | | //// } |
| | | //// } |
| | | ////} |
| | | // traverse( listToDeal, Elements, item ) { |
| | | // // æªå¤çè¿ |
| | | // if( dealtNameList.Find( item.Name() ) < 0 ){ |
| | | // // æ ç¶é¨é¨ï¼ç´æ¥å¤ç |
| | | // if( item.ParentName() = "" ) { |
| | | // if( item.ParentName() <> "" and isnull( SalesSegment_MP::FindByName( this, item.ParentName() ) ) ){ |
| | | // SalesSegment_MP::CreateOrUpdate( this, item.ParentName(), item.DisplayIndex(), "" ); |
| | | // } |
| | | // } |
| | | // |
| | | //traverse( listToDeal,Elements,item ){ |
| | | // SalesSegment_MP::CreateOrUpdate( this, item.Name(), item.DisplayIndex(), item.ParentName() ); |
| | | // dealtNameList.Add( item.Name() ); |
| | | // } |
| | | // // æç¶é¨é¨ä¸ç¶é¨é¨å·²å¤ç |
| | | // else if( item.ParentName() <> "" and dealtNameList.Find(item.ParentName()) >= 0 ) { |
| | | // SalesSegment_MP::CreateOrUpdate( this, item.Name(), item.DisplayIndex(), item.ParentName() ); |
| | | // dealtNameList.Add( item.Name() ); |
| | | // } |
| | | // // æç¶é¨é¨ä¸ç¶é¨é¨æªå¤çï¼ä¸ä¸è½®å¤ç |
| | | // } |
| | | // } |
| | | //} |
| | | traverse( listToDeal,Elements,item ){ |
| | | if( item.ParentName() <> "" and isnull( SalesSegment_MP::FindByName( this, item.ParentName() ) ) ){ |
| | | SalesSegment_MP::CreateOrUpdate( this, item.ParentName(), item.DisplayIndex(), "" ); |
| | | } |
| | | } |
| | | |
| | | traverse( listToDeal,Elements,item ){ |
| | | SalesSegment_MP::CreateOrUpdate( this, item.Name(), item.DisplayIndex(), item.ParentName() ); |
| | | } |
| | | *] |
| | | } |
| | |
| | | Description: 'Get unit data from operation mapping' |
| | | TextBody: |
| | | [* |
| | | // Administrator Aug-21-2023 (created) |
| | | // list to deal |
| | | listtodeal := construct( structured[MappingOperation] ); |
| | | |
| | | if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | listtodeal := selectset( this, MappingOperation, item, true ); |
| | | } else { |
| | | listtodeal := selectset( this, MappingOperation, item, |
| | | businesstypes.Difference( businesstypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 |
| | | ); |
| | | } |
| | | |
| | | //Set the Default values |
| | | unitofmeasurename := "PCS"; |
| | | capacitytype := "Infinite"; |
| | | |
| | | // Get the root data |
| | | Unit::CreateOrUpdate( this, |
| | | "天马éå¢", |
| | | "天马éå¢", |
| | | "", |
| | | capacitytype, |
| | | unitofmeasurename ); |
| | | |
| | | // Get the sub root data |
| | | Unit::CreateOrUpdate( this, |
| | | "ç产", |
| | | "ç产", |
| | | "天马éå¢", |
| | | capacitytype, |
| | | unitofmeasurename ); |
| | | |
| | | Unit::CreateOrUpdate( this, |
| | | "ä¾åºå", |
| | | "ä¾åºå", |
| | | "天马éå¢", |
| | | capacitytype, |
| | | unitofmeasurename ); |
| | | |
| | | Unit::CreateOrUpdate( this, |
| | | "æ´è½¦è¿è¾", |
| | | "æ´è½¦è¿è¾", |
| | | "天马éå¢", |
| | | capacitytype, |
| | | unitofmeasurename ); |
| | | |
| | | // Get the unit list |
| | | traverse( listtodeal, Elements, item){ |
| | | OrgName := item.OrganName(); |
| | | if( OrgName = ''){ |
| | | OrgName := item.OrganCode(); |
| | | } |
| | | //Get the first level unit |
| | | Unit::CreateOrUpdate( this, |
| | | item.OrganCode(), |
| | | OrgName, |
| | | "ç产", |
| | | capacitytype, |
| | | unitofmeasurename ); |
| | | |
| | | //Get the second level unit |
| | | secondlevelid := item.OrganCode() + "_" + item.PlantName(); |
| | | Unit::CreateOrUpdate( this, |
| | | secondlevelid, |
| | | secondlevelid, |
| | | item.OrganCode(), |
| | | capacitytype, |
| | | unitofmeasurename ); |
| | | |
| | | //Get the third level unit |
| | | thirdlevelid := secondlevelid + "_" + item.ProcessSection(); |
| | | Unit::CreateOrUpdate( this, |
| | | thirdlevelid, |
| | | thirdlevelid, |
| | | secondlevelid, |
| | | "Time", |
| | | item.UnitOfMeasureName() ); |
| | | |
| | | //Get the last level unit |
| | | if( item.Line()<>"" ){ |
| | | lastlevelid := thirdlevelid + "_" + item.Line(); |
| | | Unit::CreateOrUpdate( this, |
| | | lastlevelid, |
| | | lastlevelid, |
| | | thirdlevelid, |
| | | "Time", |
| | | item.UnitOfMeasureName() ); |
| | | } |
| | | } |
| | | //// Administrator Aug-21-2023 (created) |
| | | //// list to deal |
| | | //listtodeal := construct( structured[MappingOperation] ); |
| | | // |
| | | //if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | // listtodeal := selectset( this, MappingOperation, item, true ); |
| | | //} else { |
| | | // listtodeal := selectset( this, MappingOperation, item, |
| | | // businesstypes.Difference( businesstypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 |
| | | // ); |
| | | //} |
| | | // |
| | | ////Set the Default values |
| | | //unitofmeasurename := "PCS"; |
| | | //capacitytype := "Infinite"; |
| | | // |
| | | //// Get the root data |
| | | //Unit::CreateOrUpdate( this, |
| | | // "天马éå¢", |
| | | // "天马éå¢", |
| | | // "", |
| | | // capacitytype, |
| | | // unitofmeasurename ); |
| | | // |
| | | //// Get the sub root data |
| | | //Unit::CreateOrUpdate( this, |
| | | // "ç产", |
| | | // "ç产", |
| | | // "天马éå¢", |
| | | // capacitytype, |
| | | // unitofmeasurename ); |
| | | // |
| | | //Unit::CreateOrUpdate( this, |
| | | // "ä¾åºå", |
| | | // "ä¾åºå", |
| | | // "天马éå¢", |
| | | // capacitytype, |
| | | // unitofmeasurename ); |
| | | // |
| | | //Unit::CreateOrUpdate( this, |
| | | // "æ´è½¦è¿è¾", |
| | | // "æ´è½¦è¿è¾", |
| | | // "天马éå¢", |
| | | // capacitytype, |
| | | // unitofmeasurename ); |
| | | // |
| | | //// Get the unit list |
| | | //traverse( listtodeal, Elements, item){ |
| | | // OrgName := item.OrganName(); |
| | | // if( OrgName = ''){ |
| | | // OrgName := item.OrganCode(); |
| | | // } |
| | | // //Get the first level unit |
| | | // Unit::CreateOrUpdate( this, |
| | | // item.OrganCode(), |
| | | // OrgName, |
| | | // "ç产", |
| | | // capacitytype, |
| | | // unitofmeasurename ); |
| | | // |
| | | // //Get the second level unit |
| | | // secondlevelid := item.OrganCode() + "_" + item.PlantName(); |
| | | // Unit::CreateOrUpdate( this, |
| | | // secondlevelid, |
| | | // secondlevelid, |
| | | // item.OrganCode(), |
| | | // capacitytype, |
| | | // unitofmeasurename ); |
| | | // |
| | | // //Get the third level unit |
| | | // thirdlevelid := secondlevelid + "_" + item.ProcessSection(); |
| | | // Unit::CreateOrUpdate( this, |
| | | // thirdlevelid, |
| | | // thirdlevelid, |
| | | // secondlevelid, |
| | | // "Time", |
| | | // item.UnitOfMeasureName() ); |
| | | // |
| | | // //Get the last level unit |
| | | // if( item.Line()<>"" ){ |
| | | // lastlevelid := thirdlevelid + "_" + item.Line(); |
| | | // Unit::CreateOrUpdate( this, |
| | | // lastlevelid, |
| | | // lastlevelid, |
| | | // thirdlevelid, |
| | | // "Time", |
| | | // item.UnitOfMeasureName() ); |
| | | // } |
| | | // } |
| | | *] |
| | | } |
| | |
| | | Description: 'ETLæ°æ®è½¬æ¨¡åæ°æ®' |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | |
| | | defaultOld := UnitOfMeasure_MP::FindDefault( this ); |
| | | defaultNew := select( this, MappingUnitOfMeasure, item, true, item.IsDefault() ); |
| | | |
| | | if( not isnull( defaultOld ) and not isnull( defaultNew ) |
| | | and defaultOld.Name() <> defaultNew.Name() ) { |
| | | defaultOld.IsDefault(false); |
| | | //error( "multi default unit of measure" ) |
| | | } |
| | | |
| | | traverse( this, MappingUnitOfMeasure, item ) { |
| | | UnitOfMeasure_MP::CreateOrUpdate( this, item.Name(), item.IsDefault() ); |
| | | } |
| | | //// yypsybs Aug-15-2023 (created) |
| | | // |
| | | //defaultOld := UnitOfMeasure_MP::FindDefault( this ); |
| | | //defaultNew := select( this, MappingUnitOfMeasure, item, true, item.IsDefault() ); |
| | | // |
| | | //if( not isnull( defaultOld ) and not isnull( defaultNew ) |
| | | // and defaultOld.Name() <> defaultNew.Name() ) { |
| | | // defaultOld.IsDefault(false); |
| | | // //error( "multi default unit of measure" ) |
| | | //} |
| | | // |
| | | //traverse( this, MappingUnitOfMeasure, item ) { |
| | | // UnitOfMeasure_MP::CreateOrUpdate( this, item.Name(), item.IsDefault() ); |
| | | //} |
| | | *] |
| | | } |
ÎļþÃû´Ó _Main/BL/Type_MacroPlan/StaticMethod_DoSync#618.qbl ÐÞ¸Ä |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DoSync ( |
| | | StaticMethod DoSyncNew ( |
| | | MacroPlan macroPlan, |
| | | MPSync mpSync, |
| | | String businessTypeStr, |
| | | Boolean isKeyProduct, |
| | | Boolean createPurchaseSupplyMaterial |
| | |
| | | if( businessTypeStr.Length() > 0 ) { |
| | | businessTypes := businessTypeStr.Tokenize( ',' ); |
| | | } |
| | | MacroPlan::DoSync( macroPlan, businessTypes, isKeyProduct, createPurchaseSupplyMaterial ); |
| | | MacroPlan::DoSyncNew( macroPlan, mpSync, businessTypes, isKeyProduct, createPurchaseSupplyMaterial ); |
| | | *] |
| | | } |
ÎļþÃû´Ó _Main/BL/Type_MacroPlan/StaticMethod_DoSync.qbl ÐÞ¸Ä |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DoSync ( |
| | | StaticMethod DoSyncNew ( |
| | | MacroPlan macroPlan, |
| | | MPSync mpSync, |
| | | Boolean isKeyProduct, |
| | | Boolean createPurchaseSupplyMaterial |
| | | ) |
| | |
| | | [* |
| | | // yypsybs Aug-17-2023 (created) |
| | | businessTypes := construct( Strings ); |
| | | MacroPlan::DoSync( macroPlan, businessTypes, isKeyProduct, createPurchaseSupplyMaterial ); |
| | | MacroPlan::DoSyncNew( macroPlan, mpSync, businessTypes, isKeyProduct, createPurchaseSupplyMaterial ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DoSyncNew ( |
| | | MacroPlan macroPlan, |
| | | MPSync mpSync, |
| | | Strings businessTypes, |
| | | Boolean isKeyProduct, |
| | | Boolean createPurchaseSupplyMaterial |
| | | ) |
| | | { |
| | | Description: '忬¡åæ¥' |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-31-2023 (created) |
| | | mpSync.ImportDBDataCustom( macroPlan, businessTypes, isKeyProduct, createPurchaseSupplyMaterial ); |
| | | *] |
| | | } |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod FindMinSeq ( |
| | | MacroPlan macroPlan, |
| | | MPSync mpSync, |
| | | String orgCode, |
| | | String productId, |
| | | String processSection |
| | |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-22-2023 (created) |
| | | return guard (min( macroPlan, MappingOperation, item, |
| | | return guard (min( mpSync, MappingOperation, item, |
| | | item.OrganCode() = orgCode and item.ProductID() = productId and item.ProcessSection() = processSection, |
| | | item.SequenceNumber() ), Number::MinNumber() ); |
| | | *] |
| | |
| | | #keys: '[414384.0.605664178]' |
| | | Body: |
| | | [* |
| | | MacroPlan::DoSync( MacroPlan,false,false); |
| | | MacroPlan::DoSyncNew( MacroPlan, MPSync, false,false ); |
| | | *] |
| | | DefinitionID: 'Responsedef_Menu_OnClick' |
| | | Precondition: |
| | | [* |
| | | return not isnull( MacroPlan ); |
| | | return not isnull( MacroPlan ) and not isnull( MPSync ); |
| | | *] |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | macroPlanNew := MacroPlan; |
| | | ManufactureLTImputation::Transfer( macroPlanOld, macroPlanNew ); |
| | | |
| | | // sync data |
| | | if( data.EnableSync() ) { |
| | | MacroPlan::DoSync( macroPlanNew, |
| | | MacroPlan::DoSyncNew( DataHolderMacroPlanner.Data(), MPSync, |
| | | data.BusinessType(), data.IsKeyProduct(), data.CreatePurchaseSupplyMaterial() ); |
| | | } |
| | | |
| | | macroPlanNew := MacroPlan; |
| | | ManufactureLTImputation::Transfer( macroPlanOld, macroPlanNew ); |
| | | |
| | | this.Close(); |
| | | *] |
| | | } |