Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateData ( |
| | | MacroPlan macroPlan, |
| | | String factory |
| | | MacroPlan macroPlan |
| | | ) |
| | | { |
| | | TextBody: |
| | |
| | | and tempLCM.StartDate() <= mlcrc.StartDate() and tempLCM.EndDate() >= mlcrc.StartDate().StartOfNextMonth() ); |
| | | |
| | | // è¿è¾ææ¬åæ° |
| | | lct := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Product() = mlcrr.Category() and |
| | | tempLCT.Origin() = "é¿æ¥å¤ç§åº" and tempLCT.Destination() = "CC åå
åº" ); |
| | | lct := select( macroPlan, LogisticsCostTransport, tempLCT, |
| | | tempLCT.Product() = mlcrr.Category() and |
| | | tempLCT.Origin() = ifexpr( mlcrr.Factory() = "大è¿å·¥å", "é¿æ¥å¤ç§åº", "大è¿åå
åº" ) and |
| | | tempLCT.Destination() = ifexpr( mlcrr.Factory() = "大è¿å·¥å", "大è¿åºå
åº", "é¿æ¥å¤ç§åº" ) ); |
| | | lct1 := select( macroPlan, LogisticsCostTransport, tempLCT, |
| | | tempLCT.Product() = mlcrr.Category() and |
| | | tempLCT.Origin() = ifexpr( mlcrr.Factory() = "大è¿å·¥å", "大è¿åå
åº", "CC åå
åº" ) and |
| | | tempLCT.Destination() = ifexpr( mlcrr.Factory() = "大è¿å·¥å", "大è¿å¤ç§åº", "é¿æ¥å¤ç§åº" ) ); |
| | | |
| | | // å½åææ«æåä¸å¤©æ¥æ |
| | | lastDayOfThisMonth := mlcrc.StartDate().StartOfNextMonth() - 1; |
| | | |
| | | cell := mlcrr.MachineLogisticsCostReportCell( relnew ); |
| | | |
| | | // 设置å
è£
è´¹ç¨ï¼å
è£
é * å
è£
åä»·ï¼ |
| | | packageQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC, |
| | | tempPPC.PackagingPlanRow().Category() = mlcrr.Category() and |
| | | tempPPC.PackagingPlanRow().Factory() = factory and |
| | | tempPPC.PackagingPlanRow().Factory() = mlcrr.Factory() and |
| | | tempPPC.PackagingPlanColumn().StartDate().Year() = mlcrc.StartDate().Year() and |
| | | tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(), |
| | | tempPPC.Package() ); |
| | |
| | | // 设置æå
è´¹ç¨ï¼æå
é * æå
åä»·ï¼ |
| | | unpackingQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC, |
| | | tempPPC.PackagingPlanRow().Category() = mlcrr.Category() and |
| | | tempPPC.PackagingPlanRow().Factory() = factory and |
| | | tempPPC.PackagingPlanRow().Factory() = mlcrr.Factory() and |
| | | tempPPC.PackagingPlanColumn().StartDate().Year() = mlcrc.StartDate().Year() and |
| | | tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(), |
| | | tempPPC.Unpacking() ); |
| | |
| | | // è®¾ç½®è°æ¨è´¹ç¨ï¼è°æ¨æ°é / å
è£
容é / è£
载容é * è¿è¾åä»·ï¼ |
| | | transferQuantity := sum( macroPlan, TransferPlanRow.TransferPlanCell, tempTPC, |
| | | tempTPC.TransferPlanRow().Category() = mlcrr.Category() and |
| | | tempTPC.TransferPlanRow().Name() = ifexpr( factory = "大è¿å·¥å", "CC to DL", "DL to CC" ) and |
| | | tempTPC.TransferPlanColumn().ColumnDate().Year() = mlcrc.StartDate().Year() and |
| | | tempTPC.TransferPlanColumn().ColumnDate().Month() = mlcrc.StartDate().Month(), |
| | | tempTPC.TransferPlanRow().Name() = ifexpr( mlcrr.Factory() = "大è¿å·¥å", "CC to DL", "DL to CC" ) and |
| | | guard( tempTPC.TransferPlanColumn().ColumnDate().Year() = mlcrc.StartDate().Year(), false ) and |
| | | guard( tempTPC.TransferPlanColumn().ColumnDate().Month() = mlcrc.StartDate().Month(), false ), |
| | | [Number]tempTPC.Value() ); |
| | | cell.TransferCost( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct.LoadingCapacity(), 1 ) * guard( lct.TransportPrice(), 1 ) ); |
| | | |
| | | // å¤ç§åºå
¥åºè´¹ç¨ï¼å
¥åºé[å
è£
é] / å
è£
容é * å
¥åºåä»·ï¼ |
| | | // cell.StorageFeesForRentedWarehouses( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) ); |
| | | cell.StorageFeesForRentedWarehouses( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) ); |
| | | |
| | | // å¤ç§åºåºåºè´¹ç¨ï¼åºåºé[æå
é] / å
è£
容é * åºåºåä»·ï¼ |
| | | // cell.OutboundExpensesForRentedWarehouses( unpackingQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.OutboundPrice(), 1 ) ); |
| | | cell.OutboundExpensesForRentedWarehouses( unpackingQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.OutboundPrice(), 1 ) ); |
| | | |
| | | // å¤ç§åºè¿è¾è´¹ç¨ï¼è¿è¾æ°é / å
è£
容é / è£
载容é * è¿è¾åä»·ï¼ |
| | | transportationQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, |
| | | tempPIT.Product_MP().ParentID() = mlcrr.Category() and |
| | | tempPIT.Trip().Departure().Date() >= mlcrc.StartDate() and |
| | | tempPIT.Trip().Arrival().Date() <= lastDayOfThisMonth and |
| | | tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID() = "CC åå
åº" and |
| | | tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = "é¿æ¥å¤ç§åº", |
| | | tempPIT.Quantity() |
| | | ); |
| | | cell.ExternalRentalWarehouseTransportationCosts( transportationQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct1.LoadingCapacity(), 1 ) * guard( lct1.TransportPrice(), 1 ) ); |
| | | |
| | | // å¤ç§åºä»å¨è´¹ç¨ï¼ä»å¨æ°é/å
è£
容é*ä»å¨åä»· |
| | | plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP, |
| | | tempPISPIP.ProductInStockingPoint_MP().Product_MP().IsLeaf() and |
| | | exists( tempPISPIP.ProductInStockingPoint_MP().Product_MP(), AllParent.AsParent, tempPMP, tempPMP.ID() = "æºå ä»¶" ) and |
| | | tempPISPIP.ProductInStockingPoint_MP().Product_MP().ParentID() = mlcrr.Category() and |
| | | tempPISPIP.Start().Date() >= mlcrc.StartDate() and |
| | | tempPISPIP.End().Date() <= lastDayOfThisMonth and |
| | | tempPISPIP.ProductInStockingPoint_MP().StockingPointID() = ifexpr( mlcrr.Factory() = "大è¿å·¥å", "大è¿å¤ç§åº", "é¿æ¥å¤ç§åº" ), |
| | | tempPISPIP.PlannedInventoryLevelEnd() ); |
| | | cell.RentalWarehouseStorageFees( plannedInventory / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.StoragePrice(), 1 ) ); |
| | | |
| | | cell.MachineLogisticsCostReportColumn( relset, mlcrc ); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method Filter ( |
| | | String factory |
| | | ) declarative remote as Boolean |
| | | { |
| | | TextBody: 'return this.Factory() = factory;' |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute NewSupply |
| | | { |
| | | #keys: '3[415754.0.436130246][415754.0.436130245][415754.0.436130247]' |
| | | Description: 'ä¾åº' |
| | | ValueType: Real |
| | | } |
| | |
| | | cell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = ppc ); |
| | | if ( isnull( cell ) ) { |
| | | cell := ppr.PackagingPlanCell( relnew ); |
| | | cell.NetDemand( pispipl.InventoryLevelEnd() + pispipl.NewSupplyQuantity() - pispipl.DependentDemandAndSalesDemandQuantity() ); |
| | | cell.EndingInventory( pispipl.InventoryLevelEnd() ); |
| | | cell.PackagingPlanColumn( relset, ppc ); |
| | | } else { |
| | | cell.NetDemand( cell.NetDemand() + ( pispipl.InventoryLevelEnd() + pispipl.NewSupplyQuantity() - pispipl.DependentDemandAndSalesDemandQuantity() ) ); |
| | | cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() ); |
| | | } |
| | | |
| | | // 设置è°åº |
| | |
| | | cell.TransferIn( cell.TransferIn() + pit.Quantity() ); |
| | | } |
| | | |
| | | // é¿æ¥å·¥åç¹æ®æ
åµè®¾ç½®å
è£
åºååéå
è£
åºå |
| | | // 大è¿å·¥åè®¾ç½®å¼ |
| | | if ( factory = "大è¿å·¥å" ) { |
| | | // åéæ±&å©ä½åºå&ä¾åºé |
| | | cell.NetDemand( cell.NetDemand() + pispipl.DependentDemandAndSalesDemandQuantity() ); |
| | | cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() ); |
| | | cell.NewSupply( cell.NewSupply() + pispipl.NewSupplyQuantity() ); |
| | | } |
| | | |
| | | // é¿æ¥å·¥åè®¾ç½®å¼ |
| | | if ( factory = "é¿æ¥å·¥å" ) { |
| | | // å©ä½åºå&ä¾åºé |
| | | cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() ); |
| | | cell.NewSupply( cell.NewSupply() + pispipl.NewSupplyQuantity() ); |
| | | |
| | | // åéæ±ãåªå线边åºã&å
è£
åºå&éå
è£
åºå |
| | | if ( pisp.StockingPointID().Regex( "å¤ç§åº" ) ) { |
| | | cell.CC_PackagingInventory( pispipl.InventoryLevelEnd() ); |
| | | } else if ( pisp.StockingPointID().Regex( "线边åº" ) ) { |
| | | cell.CC_UnpackagedInventory( pispipl.InventoryLevelEnd() ); |
| | | cell.NetDemand( cell.NetDemand() + pispipl.DependentDemandAndSalesDemandQuantity() ); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 设置æå
å¼ï¼ç¬¦ålotsizeå䏿¥æå¤§å
è£
éï¼ |
| | | traverse ( macroPlan, PackagingPlanRow, ppr/*, ppr.Factory() = "大è¿å·¥å" and ppr.ProductID() = "06K103011CM"*/ ) { |
| | | traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) { |
| | | // Product_MP |
| | | pmp := select( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf() and tempPMP.ID() = ppr.ProductID() ); |
| | | // å
è£
lotsize |
| | | ppls := select( macroPlan, PackagingPlanLotSize, tempPPLS, tempPPLS.Factory() = ppr.Factory() and |
| | | tempPPLS.ProductID() = ifexpr( exists( macroPlan, PackagingPlanLotSize, tempPPLS1, tempPPLS1.ProductID() = pmp.ID() ), |
| | | pmp.ID(), |
| | | pmp.ParentID() ) ); |
| | | // 䏿¥å
è£
容é |
| | | ppnc := select( macroPlan, PackagingPlanNewCapability, tempPPNC, tempPPNC.Factory() = ppr.Factory() and |
| | | tempPPNC.ProductID() = ifexpr( exists( macroPlan, PackagingPlanNewCapability, tempPPNC1, tempPPNC1.ProductID() = pmp.ID() ), |
| | | pmp.ID(), |
| | | pmp.ParentID() ) ); |
| | | // Unit |
| | | us := selectset( macroPlan, Unit, tempU, tempU.ID().Regex( ppr.FactoryAbbreviation() + " " + ppr.Category() ) ); |
| | | |
| | | // å½åéå
è£
åºå + ä¸ä¸å¤©çNewSupply < ä¸ä¸å¤©çåéæ± |
| | | if ( ppcell.UnpackagedInventory() < guard( ppcell.Next().NetDemand(), 0 ) and not isnull( ppls ) and not isnull( ppnc ) ) { |
| | | // éè¦å
è£
çæ°é |
| | | needPackagingQuantity := abs( ppcell.PackagingInventory() ).Round( 0 ); |
| | | // å
è£
å¼å§çç´¢å¼ |
| | | indexPPCell := ppcell.Previous(); |
| | | |
| | | // info( "产线个æ°ï¼", us.Size(), " å¼å§æ¶é´ï¼", ppcell.StartDate().Format( "Y-M2-D2" ), " å
è£
åºåæ°éï¼", ppcell.PackagingInventory(), " éè¦å
è£
çæ°éï¼", needPackagingQuantity, |
| | | // " å
è£
lotsizeï¼",guard( ppls.LotSize(), 0 ), " æå¤§å
è£
容éï¼", ppnc.MaximumDailyPackagingQuantity() ); |
| | | |
| | | while ( not isnull( indexPPCell ) and |
| | | indexPPCell.StartDate() >= plannedStartDate and |
| | | exists( us, Elements.UnitPeriod.astype( UnitPeriodTime ).ShiftPlan, tempSP, |
| | | tempSP.UnitPeriodTime().StartDate() = indexPPCell.StartDate(), |
| | | tempSP.Outcome() <> "" ) and |
| | | needPackagingQuantity > 0 ) { |
| | | // è½å
è£
çæ°é |
| | | canPackagingQuantity := ifexpr( ceil( needPackagingQuantity / ppls.LotSize() ) < floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ), |
| | | ceil( needPackagingQuantity / ppls.LotSize() ), |
| | | floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ) ) * ppls.LotSize(); |
| | | // info( "å¼å§å
è£
çæ¥æï¼", indexPPCell.StartDate().Format( "Y-M2-D2" ), " è½å
è£
çæ°é:", canPackagingQuantity ); |
| | | |
| | | indexPPCell.Package( canPackagingQuantity ); |
| | | Transaction::Transaction().Propagate( attribute( PackagingPlanCell, PackagingInventory ) ); |
| | | Transaction::Transaction().Propagate( attribute( PackagingPlanCell, UnpackagedInventory ) ); |
| | | |
| | | needPackagingQuantity := needPackagingQuantity - canPackagingQuantity; |
| | | indexPPCell := indexPPCell.Previous(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | TypeRepresentation PackagingPlanCell |
| | | { |
| | | AttributeRepresentation EndingInventory |
| | | { |
| | | AttributeKey: '[413988.0.1393320114]' |
| | | Synonym: 'Inventory end' |
| | | } |
| | | AttributeRepresentation NetDemand |
| | | { |
| | | AttributeKey: '[413988.0.1393320104]' |
| | | Synonym: 'Demand' |
| | | } |
| | | AttributeRepresentation NewSupply |
| | | { |
| | | AttributeKey: '[415754.0.436130245]' |
| | | Synonym: 'New supply' |
| | | } |
| | | AttributeRepresentation Out |
| | | { |
| | | AttributeKey: '[413988.0.1393320156]' |
| | | Synonym: 'Transport-out' |
| | | } |
| | | AttributeRepresentation Package |
| | | { |
| | | AttributeKey: '[413988.0.1393320188]' |
| | | Synonym: 'Package' |
| | | } |
| | | AttributeRepresentation PackagingInventory |
| | | { |
| | | AttributeKey: '[413988.0.1393320143]' |
| | | Synonym: 'Packaged' |
| | | } |
| | | AttributeRepresentation TransferIn |
| | | { |
| | | AttributeKey: '[413988.0.1393320166]' |
| | | Synonym: 'Transport-in' |
| | | } |
| | | AttributeRepresentation UnpackagedInventory |
| | | { |
| | | AttributeKey: '[413988.0.1393320130]' |
| | | Synonym: 'Unpackaged' |
| | | } |
| | | AttributeRepresentation Unpacking |
| | | { |
| | | AttributeKey: '[413988.0.1393320198]' |
| | | Synonym: 'Unpackage' |
| | | } |
| | | RelationRepresentation AsFirst { RelationKey: '[413988.0.1425205682]' Visibility: 'Normal' } |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialogData.Data.MaximumDailyPackagingQuantity' |
| | | Label: 'Maximum daily packaging quantity' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialogData.Data.MaximumDailyUnpackingQuantity' |
| | | Label: 'Maximum daily unpacking quantity' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 3 |
| | | ] |
| | | } |
| | |
| | | DefinitionID: 'Responsedef_WebButton_OnClick' |
| | | Precondition: |
| | | [* |
| | | return not exists( MacroPlan, PackagingPlanNewCapability, tempPPNC, true, tempPPNC.ProductionLine() = ddslFactory.Text() ); |
| | | return not exists( MacroPlan, PackagingPlanNewCapability, tempPPNC, true, |
| | | tempPPNC.Factory() = ddslFactory.Text() and |
| | | tempPPNC.ProductID() = ddslProductID.Text() ); |
| | | *] |
| | | QuillAction |
| | | { |
| | |
| | | Properties: |
| | | [ |
| | | Label: 'Lot size' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialog.Data.CC_ZKG' |
| | | Label: 'ZKG(pcs)' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 0 |
| | | ] |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialog.Data.CC_ZKM' |
| | | Label: 'ZKM(pcs)' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialog.Data.CC_PL' |
| | | Label: 'PL(pcs)' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialog.Data.CC_KW' |
| | | Label: 'KW(pcs)' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 3 |
| | | ] |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialog.Data.CC_AGW' |
| | | Label: 'AGW(pcs)' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 4 |
| | | ] |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialog.Data.DL_ZKG' |
| | | Label: 'ZKG(pcs)' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 0 |
| | | ] |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialog.Data.DL_ZKM' |
| | | Label: 'ZKM(pcs)' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialog.Data.DL_PL' |
| | | Label: 'PL(pcs)' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialog.Data.DL_KW' |
| | | Label: 'KW(pcs)' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 3 |
| | | ] |
| | | } |
| | |
| | | [ |
| | | DataBinding: 'DataHolderDialog.Data.DL_AGW' |
| | | Label: 'AGW(pcs)' |
| | | Mask: 'NUMBER' |
| | | Min: '0' |
| | | Taborder: 4 |
| | | ] |
| | | } |
| | |
| | | Properties: |
| | | [ |
| | | DataType: 'MacroPlan' |
| | | FilterArguments: 'factory:QLibMacroPlannerWebUI::ApplicationMacroPlanner.dhSelectedFactoryMCRR' |
| | | FixedFilter: 'object.Filter( factory )' |
| | | Source: 'MacroPlan' |
| | | Taborder: 0 |
| | | Transformation: 'MachineLogisticsCostReportRow' |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | MachineLogisticsCostReportCell::CreateData( MacroPlan, ddslFactory.Text() ); |
| | | MachineLogisticsCostReportCell::CreateData( MacroPlan ); |
| | | |
| | | WebMessageBox::Success( Translations::A_VWED_Success() ); |
| | | *] |
| | |
| | | ] |
| | | Properties: |
| | | [ |
| | | Attributes: 'NetDemand;EndingInventory;UnpackagedInventory;PackagingInventory;Out;TransferIn;Package;Unpacking' |
| | | Attributes: 'NetDemand;NewSupply;EndingInventory;Out;TransferIn;UnpackagedInventory;PackagingInventory;Package;Unpacking' |
| | | Column: 'PackagingPlanColumn' |
| | | Row: 'PackagingPlanRow' |
| | | Taborder: 0 |