Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DeductionOfReplacementLoss ( |
| | | MacroPlan macroPlan, |
| | | OfflinePlanTable opt |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // ä¿åä¸ä¸ä»½åæ¡£ |
| | | newOPT := OfflinePlanCell::SaveAsDraft( macroPlan, opt ); |
| | | |
| | | // æ§è¡æ¢åæå¤± |
| | | allProductionLines := selectuniquevalues( newOPT, OfflinePlanRow, tempORR, true, tempORR.ProductionLine() ); |
| | | |
| | | traverse ( allProductionLines, Elements, pl ) { |
| | | oprs := selectset( newOPT, OfflinePlanRow, tempORT, tempORT.ProductionLine() = pl and ( tempORT.Type() = "1" or tempORT.Type() = "2" ) ); |
| | | |
| | | traverse ( newOPT, OfflinePlanColumn, opc, opc.ColumnDate() = macroPlan.StartOfPlanning().Date() ) { |
| | | for ( i := 1; i < 10; i++ ) { |
| | | firstOrderCell := select( oprs, Elements.OfflinePlanCell, tempOPC, tempOPC.OfflinePlanColumn() = opc and tempOPC.Value() = ( "#" + i.Format( "N(LPad0(2))" ) ) ); |
| | | secondOrderCell := select( oprs, Elements.OfflinePlanCell, tempOPC, tempOPC.OfflinePlanColumn() = opc and tempOPC.Value() = ( "#" + ( i + 1 ).Format( "N(LPad0(2))" ) ) ); |
| | | // æ¢åæå¤±åæ° |
| | | cls := select( macroPlan, ChangeLossSetting, tempCLS, |
| | | guard( tempCLS.ProductFirst().ID() = firstOrderCell.OfflinePlanRow().ProductID() , false ) and |
| | | guard( tempCLS.ProductSecond().ID() = secondOrderCell.OfflinePlanRow().ProductID(), false ) and |
| | | guard( tempCLS.StartDate() <= opc.ColumnDate() , false ) and |
| | | guard( tempCLS.EndDate() >= opc.ColumnDate() , false ) |
| | | ); |
| | | if ( not isnull( firstOrderCell ) and not isnull( secondOrderCell ) and not isnull( cls ) ) { |
| | | firstQuantityCell := select( oprs, Elements.OfflinePlanCell, tempOPC, |
| | | tempOPC.OfflinePlanColumn() = opc and |
| | | tempOPC.OfflinePlanRow().Type() = "1" and |
| | | tempOPC.OfflinePlanRow().ProductID() = firstOrderCell.OfflinePlanRow().ProductID() |
| | | ); |
| | | firstQuantityCell.Value( [String] ( [Number]firstQuantityCell.Value() - cls.ChangeLossNr() ) ); |
| | | // info( "å½ååºå·ï¼", i, " åå
æ ¼çå¼ï¼", firstCell.Value(), " 产ååï¼", firstCell.OfflinePlanRow().ProductID(), |
| | | // "ä¸ä¸ä¸ªåºå·ï¼", i + 1, " åå
æ ¼çå¼ï¼", secondCell.Value(), " 产ååï¼", secondCell.OfflinePlanRow().ProductID() ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // éç½®æ»è®¡è¡ |
| | | totalOPRs := selectset( newOPT, OfflinePlanRow, tempOPR, tempOPR.Type() = "3" ); |
| | | traverse ( newOPT, OfflinePlanColumn, opc, opc.OfflinePlanCell( relsize ) > 0 and opc.ColumnDate() >= macroPlan.StartOfPlanning().Date() ) { |
| | | traverse ( totalOPRs, Elements, totalOPR ) { |
| | | total := sum( opc, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanRow().ProductionLine() = totalOPR.ProductionLine() and tempOPC.OfflinePlanRow().Type() = "1", [Real]tempOPC.Value() ); |
| | | totalCell := select( totalOPR, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanColumn() = opc ); |
| | | totalCell.Value( [String]total ); |
| | | } |
| | | } |
| | | *] |
| | | } |
| | |
| | | opt := macroPlan.OfflinePlanTable( relnew, SaveDateTime := DateTime::ActualTime() ); |
| | | |
| | | // çæä¸çº¿è®¡å表 |
| | | traverse ( macroPlan, Unit, u, u.HasCapacityTypeTime() /*and u.Name() = "Body in White Line 1"*/ ) { |
| | | traverse ( macroPlan, Unit, u, u.HasCapacityTypeTime() |
| | | and u.Name() = "eMotor Assy (France)" // æµè¯æ¶å¯ä»¥è¿æ»¤ |
| | | ) { |
| | | // åå»ºäº§çº¿è¡ |
| | | opt.OfflinePlanRow( relnew, ProductionLine := u.ID(), ProductID := "", Type := "0" ); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method Filter ( |
| | | Entitys entitys |
| | | ) declarative remote as Boolean |
| | | { |
| | | TextBody: |
| | | [* |
| | | flag := false; |
| | | |
| | | traverse ( entitys, Elements.astype( Unit ), u, not flag ) { |
| | | flag := u.Name() = this.ProductionLine(); |
| | | } |
| | | |
| | | return flag; |
| | | *] |
| | | } |
| | |
| | | Properties: |
| | | [ |
| | | DataType: 'OfflinePlanTable' |
| | | FilterArguments: 'entities:QLibMacroPlannerWebUI::ApplicationMacroPlanner.DataHolderCheckedEntities' |
| | | FixedFilter: 'object.Filter( entities )' |
| | | Source: 'dhOfflinePlanTable' |
| | | Taborder: 0 |
| | | Transformation: 'OfflinePlanRow' |
| | |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | Label: 'Refresh' |
| | | Image: 'REFRESH' |
| | | Taborder: 0 |
| | | ] |
| | | } |
| | |
| | | #keys: '[413988.0.1297973984]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebButton_OnClick' |
| | | Precondition: |
| | | [* |
| | | return not isnull( MacroPlan ); |
| | | *] |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | OfflinePlanCell::DeductionOfReplacementLoss( MacroPlan, dhOfflinePlanTable.Data() ); |
| | | |
| | | opt := maxselect( MacroPlan, OfflinePlanTable, tempOPT, true, tempOPT.SaveDateTime() ); |
| | | dhOfflinePlanTable.Data( opt ); |
| | | |
| | | WebMessageBox::Success( Translations::A_VWED_Success() ); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |