Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg
| | |
| | | Relation NewOfflinePlanTable_NewOfflinePlanColumn_NewOfflinePlanColumn_NewOfflinePlanTable |
| | | { |
| | | #keys: '1[413988.0.1603460118]' |
| | | DefaultRelationStrategy |
| | | DeclarativeSequenceRelationStrategy |
| | | { |
| | | #keys: '13[0.0.0][413988.0.1648701086][413988.0.1648701080][413988.0.1648701087][413988.0.1648701081][413988.0.1648701088][413988.0.1648701082][413988.0.1648701089][413988.0.1648701083][413988.0.1648701090][413988.0.1648701084][413988.0.1648701091][413988.0.1648701085]' |
| | | SequenceElementSuffix: 'NOPColumn' |
| | | SequenceSuffix: 'NOPColumn' |
| | | SortAttributes: |
| | | [ |
| | | DeclarativeSequenceRelationSortAttribute |
| | | { |
| | | #keys: '1[413988.0.1648701093]' |
| | | Attribute: 'StartDate' |
| | | } |
| | | ] |
| | | } |
| | | RelationSide.LeftSide NewOfflinePlanColumn |
| | | { |
| | |
| | | } |
| | | |
| | | // å¹³æ¶å çåç |
| | | defaultMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "å¹³æ¶å çåç" ); |
| | | defaultMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "å¹³æ¶å ç" ); |
| | | if( isnull( defaultMultiplier )){ |
| | | defaultMultiplier := macroPlan.OvertimeMultiplier( relnew,Name := "å¹³æ¶å çåç",Multiplier := 1 ); |
| | | defaultMultiplier := macroPlan.OvertimeMultiplier( relnew,Name := "å¹³æ¶å çåç",Multiplier := 1.5 ); |
| | | } |
| | | |
| | | // 伿¯æ¥å çåç |
| | | breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "伿¯æ¥å çåç"); |
| | | breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "卿«å ç"); |
| | | if( isnull( breakDayMultiplier )){ |
| | | breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "伿¯æ¥å çåç",Multiplier := 2 ); |
| | | breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "卿«å ç",Multiplier := 2 ); |
| | | } |
| | | // 伿¯æ¥å çåç |
| | | breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "è°ä¼å ç"); |
| | | if( isnull( breakDayMultiplier )){ |
| | | breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "è°ä¼å ç",Multiplier := 2 ); |
| | | } |
| | | |
| | | // è忥å çåç |
| | | holidayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "è忥å çåç"); |
| | | holidayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "æ³å®è忥å ç"); |
| | | if( isnull( holidayMultiplier )){ |
| | | holidayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "è忥å çåç",Multiplier := 3 ); |
| | | holidayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "æ³å®è忥å ç",Multiplier := 3 ); |
| | | } |
| | | |
| | | traverse( table,LocalRow,row ){ |
| | |
| | | } |
| | | |
| | | // å¹³æ¶å çåç |
| | | defaultMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "å¹³æ¶å çåç" ); |
| | | defaultMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "å¹³æ¶å ç" ); |
| | | if( isnull( defaultMultiplier )){ |
| | | defaultMultiplier := macroPlan.OvertimeMultiplier( relnew,Name := "å¹³æ¶å çåç",Multiplier := 1 ); |
| | | defaultMultiplier := macroPlan.OvertimeMultiplier( relnew,Name := "å¹³æ¶å çåç",Multiplier := 1.5 ); |
| | | } |
| | | |
| | | // 伿¯æ¥å çåç |
| | | breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "伿¯æ¥å çåç"); |
| | | breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "卿«å ç"); |
| | | if( isnull( breakDayMultiplier )){ |
| | | breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "伿¯æ¥å çåç",Multiplier := 2 ); |
| | | breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "卿«å ç",Multiplier := 2 ); |
| | | } |
| | | // 伿¯æ¥å çåç |
| | | breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "è°ä¼å ç"); |
| | | if( isnull( breakDayMultiplier )){ |
| | | breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "è°ä¼å ç",Multiplier := 2 ); |
| | | } |
| | | |
| | | // è忥å çåç |
| | | holidayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "è忥å çåç"); |
| | | holidayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "æ³å®è忥å ç"); |
| | | if( isnull( holidayMultiplier )){ |
| | | holidayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "è忥å çåç",Multiplier := 3 ); |
| | | holidayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "æ³å®è忥å ç",Multiplier := 3 ); |
| | | } |
| | | |
| | | traverse( table,LocalRow,row ){ |
| | |
| | | jiabanfeiCell.RealValue( EmployeeCost::GetSalary( unit,holidayMultiplier,jiabanCell.RealValue())); |
| | | |
| | | qiangongCell := LocalCell_Default::GetCell( rowKey + column7.Name(), cellIndexTree, cells, row, column7 ); |
| | | qiangongCell.RealValue( qiangongCell.RealValue() - 1 ); |
| | | |
| | | qiangongfeiCell := LocalCell_Default::GetCell( rowKey + column11.Name(), cellIndexTree, cells, row, column11 ); |
| | | qiangongfeiCell.RealValue( EmployeeCost::GetSalary( unit,defaultMultiplier,qiangongCell.RealValue() )); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method FindProductionLineAndType ( |
| | | String productionLine, |
| | | String type |
| | | ) as Boolean |
| | | { |
| | | TextBody: 'return this.NewOfflinePlanRow().ProductionLine() = productionLine and this.NewOfflinePlanRow().Type() = type and this.Quantity() > 0.0;' |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateOldOfflinePlanData ( |
| | | MacroPlan macroPlan |
| | | ) as OfflinePlanTable |
| | | { |
| | | TextBody: |
| | | [* |
| | | nopt := maxselect( macroPlan, NewOfflinePlanTable, tempNOPT, true, tempNOPT.SaveDateTime() ); |
| | | |
| | | macroPlan.OfflinePlanTable( relflush ); |
| | | |
| | | opt := macroPlan.OfflinePlanTable( relnew, SaveDateTime := nopt.SaveDateTime() ); |
| | | |
| | | // å建å |
| | | firstColumn := opt.OfflinePlanColumn( relnew, ColumnDate := macroPlan.StartOfPlanning().Date() - 2 ); |
| | | secondColumn := opt.OfflinePlanColumn( relnew, ColumnDate := macroPlan.StartOfPlanning().Date() - 1 ); |
| | | traverse ( nopt, NewOfflinePlanColumn, nopc ) { |
| | | opt.OfflinePlanColumn( relnew, ColumnDate := nopc.StartDate() ); |
| | | } |
| | | |
| | | pls := selectuniquevalues( nopt, NewOfflinePlanRow, tempNOPR, true, tempNOPR.ProductionLine() ); |
| | | |
| | | traverse ( pls, Elements, pl ) { |
| | | // å建æç»è¡ |
| | | detailNOPRs := selectsortedset( nopt, NewOfflinePlanRow, tempNOPR, tempNOPR.ProductionLine() = pl and tempNOPR.Type() = "1", tempNOPR.ProductionLine(), tempNOPR.ProductID() ); |
| | | traverse ( detailNOPRs, Elements, nopr ) { |
| | | quantityOPR := opt.OfflinePlanRow( relnew, ProductionLine := nopr.ProductionLine(), ProductID := nopr.ProductID(), Type := "1" ); |
| | | orderOPR := opt.OfflinePlanRow( relnew, ProductionLine := nopr.ProductionLine(), ProductID := nopr.ProductID(), Type := "2" ); |
| | | |
| | | // 第ä¸å |
| | | quantityOPR.OfflinePlanCell( relnew, OfflinePlanColumn := firstColumn, Value := nopr.Name() ); |
| | | orderOPR.OfflinePlanCell( relnew, OfflinePlanColumn := firstColumn, Value := "" ); |
| | | |
| | | // 第äºå |
| | | quantityOPR.OfflinePlanCell( relnew, OfflinePlanColumn := secondColumn, Value := "Quantity" ); |
| | | orderOPR.OfflinePlanCell( relnew, OfflinePlanColumn := secondColumn, Value := "Order" ); |
| | | |
| | | // æ¶é´å |
| | | traverse ( nopr, NewOfflinePlanCell, nopcell ) { |
| | | opc := select( opt, OfflinePlanColumn, tempOPC, tempOPC.ColumnDate() = nopcell.StartDate() ); |
| | | quantityOPR.OfflinePlanCell( relnew, OfflinePlanColumn := opc, Value := [String]nopcell.Quantity() ); |
| | | orderOPR.OfflinePlanCell( relnew, OfflinePlanColumn := opc, Value := nopcell.Order() ); |
| | | } |
| | | } |
| | | |
| | | // å建åè®¡è¡ |
| | | totalNOPR := select( nopt, NewOfflinePlanRow, tempNOPR, tempNOPR.ProductionLine() = pl and tempNOPR.Type() = "2" ); |
| | | |
| | | totalOPR := opt.OfflinePlanRow( relnew, ProductionLine := totalNOPR.ProductionLine(), ProductID := "Z", Type := "3" ); |
| | | shiftPatternNameOPR := opt.OfflinePlanRow( relnew, ProductionLine := totalNOPR.ProductionLine(), ProductID := "Z", Type := "4" ); |
| | | shiftPatternStartOPR := opt.OfflinePlanRow( relnew, ProductionLine := totalNOPR.ProductionLine(), ProductID := "Z", Type := "5" ); |
| | | shiftPatternEndOPR := opt.OfflinePlanRow( relnew, ProductionLine := totalNOPR.ProductionLine(), ProductID := "Z", Type := "6" ); |
| | | |
| | | // 第ä¸å |
| | | totalOPR.OfflinePlanCell( relnew, OfflinePlanColumn := firstColumn, Value := "å计" ); |
| | | shiftPatternNameOPR.OfflinePlanCell( relnew, OfflinePlanColumn := firstColumn, Value := "" ); |
| | | shiftPatternStartOPR.OfflinePlanCell( relnew, OfflinePlanColumn := firstColumn, Value := "" ); |
| | | shiftPatternEndOPR.OfflinePlanCell( relnew, OfflinePlanColumn := firstColumn, Value := "" ); |
| | | |
| | | // 第äºå |
| | | totalOPR.OfflinePlanCell( relnew, OfflinePlanColumn := secondColumn, Value := "æ»é" ); |
| | | shiftPatternNameOPR.OfflinePlanCell( relnew, OfflinePlanColumn := secondColumn, Value := "çæ¬¡" ); |
| | | shiftPatternStartOPR.OfflinePlanCell( relnew, OfflinePlanColumn := secondColumn, Value := "çæ¬¡å¼å§æ¶é´" ); |
| | | shiftPatternEndOPR.OfflinePlanCell( relnew, OfflinePlanColumn := secondColumn, Value := "çæ¬¡ç»ææ¶é´" ); |
| | | |
| | | // æ¶é´å |
| | | traverse ( totalNOPR, NewOfflinePlanCell, nopcell ) { |
| | | opc := select( opt, OfflinePlanColumn, tempOPC, tempOPC.ColumnDate() = nopcell.StartDate() ); |
| | | totalOPR.OfflinePlanCell( relnew, OfflinePlanColumn := opc, Value := [String]nopcell.TotalQuantity() ); |
| | | shiftPatternNameOPR.OfflinePlanCell( relnew, OfflinePlanColumn := opc, Value := nopcell.ShiftPatternName() ); |
| | | shiftPatternStartOPR.OfflinePlanCell( relnew, OfflinePlanColumn := opc, Value := nopcell.ShiftPatternStart() ); |
| | | shiftPatternEndOPR.OfflinePlanCell( relnew, OfflinePlanColumn := opc, Value := nopcell.ShiftPatternEnd() ); |
| | | } |
| | | } |
| | | |
| | | return opt; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Download ( |
| | | MacroPlan macroPlan, |
| | | NewOfflinePlanRows selectedNOPRs |
| | | ) as BinaryValue |
| | | { |
| | | TextBody: |
| | | [* |
| | | opt := NewOfflinePlanCell::CreateOldOfflinePlanData( macroPlan ); |
| | | |
| | | oprs := selectset( opt, OfflinePlanRow, tempOPR, exists( selectedNOPRs, Elements, tempNOPR, tempNOPR.ProductionLine() = tempOPR.ProductionLine() ) ); |
| | | |
| | | return NewOfflinePlanCell::OldDownload( macroPlan, oprs ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Import ( |
| | | NewOfflinePlanTable nopt, |
| | | GeneralExcelImportAndExportDataTable table |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | cnv2 := StringToDate::StandardConverter(); |
| | | cnv2.SetCustomConversion(); |
| | | cnv2.CustomFormatString( 'yyyy/MM/dd' ); |
| | | |
| | | productionLine := ""; |
| | | productID := ""; |
| | | isUpdateQuantity := false; |
| | | isUpdateOrder := false; |
| | | |
| | | traverse ( table, GeneralExcelImportAndExportDataRow, row ) { |
| | | traverse ( table, GeneralExcelImportAndExportDataColumn, column ) { |
| | | // åå
æ ¼å¼ |
| | | cell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDCell, tempGEIAEDCell.GeneralExcelImportAndExportDataColumn() = column ); |
| | | |
| | | // 第ä¸å夿 |
| | | if ( cell.Value().Tokenize( "_" ).Size() = 2 and column.ColumnIndex() = 0 ) { |
| | | productionLine := cell.Value().Tokenize( "_" ).Element( 0 ); |
| | | productID := cell.Value().Tokenize( "_" ).Element( 1 ); |
| | | } |
| | | |
| | | // 第äºå夿 |
| | | if ( cell.Value() = "Quantity" and column.ColumnIndex() = 1 ) { |
| | | isUpdateQuantity := true; |
| | | isUpdateOrder := false; |
| | | } else if ( cell.Value() = "Order" and column.ColumnIndex() = 1 ) { |
| | | isUpdateQuantity := false; |
| | | isUpdateOrder := true; |
| | | } else if ( cell.Value() <> "Quantity" and cell.Value() <> "Order" and column.ColumnIndex() = 1 ) { |
| | | isUpdateQuantity := false; |
| | | isUpdateOrder := false; |
| | | } |
| | | |
| | | // æ¶é´åæ´æ° |
| | | if ( isUpdateQuantity and cnv2.CanConvert( column.Name() ) and column.ColumnIndex() > 1 ) { |
| | | noopcell := select( nopt, NewOfflinePlanRow.NewOfflinePlanCell, tempNOPCell, |
| | | tempNOPCell.NewOfflinePlanRow().ProductionLine() = productionLine and |
| | | tempNOPCell.NewOfflinePlanRow().ProductID() = productID and |
| | | tempNOPCell.NewOfflinePlanRow().Type() = "1" and |
| | | tempNOPCell.NewOfflinePlanColumn().StartDate() = cnv2.Convert( column.Name() ) ); |
| | | noopcell.Quantity( [Number]cell.Value() ); |
| | | } else if ( isUpdateOrder and cnv2.CanConvert( column.Name() ) and column.ColumnIndex() > 1 ) { |
| | | noopcell := select( nopt, NewOfflinePlanRow.NewOfflinePlanCell, tempNOPCell, |
| | | tempNOPCell.NewOfflinePlanRow().ProductionLine() = productionLine and |
| | | tempNOPCell.NewOfflinePlanRow().ProductID() = productID and |
| | | tempNOPCell.NewOfflinePlanRow().Type() = "1" and |
| | | tempNOPCell.NewOfflinePlanColumn().StartDate() = cnv2.Convert( column.Name() ) ); |
| | | noopcell.Order( cell.Value() ); |
| | | } |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod OldDownload ( |
| | | MacroPlan macroPlan, |
| | | OfflinePlanRows selectedOPRs |
| | | ) as BinaryValue |
| | | { |
| | | TextBody: |
| | | [* |
| | | xmlDOMI := XMLDOMImplementation::Create(); |
| | | xmlDOM := xmlDOMI.CreateDocumentFromString( '<?xml version="1.0" encoding="UTF-16"?><table><name>Sheet1</name></table>' ); |
| | | |
| | | tableElement := xmlDOM.GetElementByTagName( "table", 0 ); |
| | | |
| | | opt := maxselect( macroPlan, OfflinePlanTable, tempOPT, true, tempOPT.SaveDateTime() ); |
| | | opcs := selectsortedset( opt, OfflinePlanColumn, tempOPC, true, tempOPC.ColumnDate() ); |
| | | oprs := selectsortedset( selectedOPRs, Elements, tempOPR, true, tempOPR.ProductionLine(), tempOPR.ProductID(), tempOPR.Type() ); |
| | | traverse ( opcs, Elements, opc ) { |
| | | column := xmlDOM.CreateElement( "column" ); |
| | | name := xmlDOM.CreateElement( "name" ); |
| | | type := xmlDOM.CreateElement( "type" ); |
| | | name.TextContent( ifexpr( opc.ColumnDate() < macroPlan.StartOfPlanning().Date(), "*", opc.ColumnDate().Format( "Y/M2/D2" ) ) ); |
| | | type.TextContent( "String" ); |
| | | column.AppendChild( name ); |
| | | column.AppendChild( type ); |
| | | |
| | | traverse ( oprs, Elements, opr ) { |
| | | c := select( opc, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanRow() = opr ); |
| | | cell := xmlDOM.CreateElement( "cell" ); |
| | | cell.SetAttribute( "value", guard( c.Value(), "" ) ); |
| | | column.AppendChild( cell ); |
| | | } |
| | | |
| | | tableElement.AppendChild( column ); |
| | | } |
| | | |
| | | xmlString := xmlDOMI.CreateSerializer().WriteToString( xmlDOM ) |
| | | |
| | | //info( xmlString ); |
| | | |
| | | tableGroupHandle := TableGroupHandle::Create( "Sheet1" ); |
| | | tableHandle := TableHandle::ImportXML( BinaryValue::Construct( xmlString ) ); |
| | | tableGroupHandle.Add( tableHandle ); |
| | | |
| | | binaryData := XLS::SaveTableGroupToBinaryData( tableGroupHandle, true ); |
| | | |
| | | return binaryData.AsBinaryValue(); |
| | | *] |
| | | } |
| | |
| | | |
| | | nopt := macroPlan.NewOfflinePlanTable( relnew, SaveDateTime := DateTime::ActualTime() ); |
| | | |
| | | // 计åå¼å§æ¶é´ |
| | | planningDate := macroPlan.StartOfPlanning().Date() |
| | | |
| | | // åå§åä¸çº¿è®¡åå |
| | | traverse ( macroPlan, Period_MP, pmp, pmp.IsPlanning() and not pmp.IsHistorical() ) { |
| | | nopt.NewOfflinePlanColumn( relnew, StartDate := pmp.StartDate(), EndDate := pmp.EndDate() ); |
| | | } |
| | | |
| | | // çæä¸çº¿è®¡å表ã䏿¡äº§çº¿å¨åä¸å¤©ä¸ä¼äº§ç两次ç¸å产åç卿任å¡ã |
| | | traverse ( macroPlan, Unit, u, u.HasCapacityTypeTime() |
| | | // and u.Name() = "eMotor Assy (France)" // æµè¯æ¬å°åºæ¯æ¶å¯ä»¥è¿æ»¤ |
| | |
| | | detaileNOPCell := detailedNOPR.NewOfflinePlanCell( relnew, |
| | | Quantity := ns.Quantity().Round( 0 ), |
| | | InventoryWeight := pispippl.InventoryLevelEnd() - pispippl.MinInventoryLevel(), |
| | | ShiftPatternName := guard( sdt.Name(), "" ), |
| | | ShiftPatternName := guard( sp.Name(), "" ), |
| | | ShiftPatternStart := guard( sdt.StartDateTime().Format( "H:m" ), "" ), |
| | | ShiftPatternEnd := guard( sdt.EndDateTIme().Format( "H:m" ), "" ) ); |
| | | detaileNOPCell.NewOfflinePlanColumn( relset, nopc ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 设置ç产顺åºã对ä¸çº¿è®¡åæç»çæã |
| | | |
| | | |
| | | // ãçæå计ä¸çº¿è®¡åã |
| | | totalNOPR := nopt.NewOfflinePlanRow( relnew, ProductID := "All", ProductionLine := u.ID(), Type := "2" ); |
| | | detailNOPRs := selectset( nopt, NewOfflinePlanRow, tempNOPR, tempNOPR.ProductionLine() = u.ID() and tempNOPR.Type() = "1" ); |
| | | traverse ( detailNOPRs, Elements, detailNOPR ) { |
| | | traverse ( detailNOPR, NewOfflinePlanCell, detailNOPCell ) { |
| | | // ç产ä¸çº¿è®¡åã产线å计ãåå
æ ¼ |
| | | totalNOPRCell := select( totalNOPR, NewOfflinePlanCell, tempNOPCell, tempNOPCell.NewOfflinePlanColumn() = detailNOPCell.NewOfflinePlanColumn() ); |
| | | if ( isnull( totalNOPRCell ) ) { |
| | | totalNOPRCell := totalNOPR.NewOfflinePlanCell( relnew ); |
| | | totalNOPRCell.NewOfflinePlanColumn( relset, detailNOPCell.NewOfflinePlanColumn() ); // 设置å |
| | | // å°æç»åå
æ ¼å
³èå°å计åå
æ ¼ |
| | | totalNOPRCell.Detailed( relinsert, detailNOPCell ); |
| | | } else { |
| | | // å°æç»åå
æ ¼å
³èå°å计åå
æ ¼ |
| | | totalNOPRCell.Detailed( relinsert, detailNOPCell ); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // ãçæå计ä¸çº¿è®¡åã |
| | | totalNOPR := nopt.NewOfflinePlanRow( relnew, ProductID := "All", ProductionLine := u.ID(), Type := "2" ); |
| | | detailNOPRs := selectset( nopt, NewOfflinePlanRow, tempNOPR, tempNOPR.ProductionLine() = u.ID() and tempNOPR.Type() = "1" ); |
| | | traverse ( detailNOPRs, Elements, detailNOPR ) { |
| | | shiftPatternNOPCell := select( detailNOPR, NewOfflinePlanCell, tempNOPCell, tempNOPCell.ShiftPatternName() <> "" ); |
| | | traverse ( detailNOPR, NewOfflinePlanCell, detailNOPCell ) { |
| | | // ç产ä¸çº¿è®¡åã产线å计ãåå
æ ¼ |
| | | totalNOPRCell := select( totalNOPR, NewOfflinePlanCell, tempNOPCell, tempNOPCell.NewOfflinePlanColumn() = detailNOPCell.NewOfflinePlanColumn() ); |
| | | if ( isnull( totalNOPRCell ) ) { |
| | | totalNOPRCell := totalNOPR.NewOfflinePlanCell( relnew, |
| | | ShiftPatternName := shiftPatternNOPCell.ShiftPatternName(), |
| | | ShiftPatternStart := shiftPatternNOPCell.ShiftPatternStart(), |
| | | ShiftPatternEnd := shiftPatternNOPCell.ShiftPatternEnd() ); |
| | | totalNOPRCell.NewOfflinePlanColumn( relset, detailNOPCell.NewOfflinePlanColumn() ); // 设置å |
| | | // å°æç»åå
æ ¼å
³èå°å计åå
æ ¼ |
| | | totalNOPRCell.Detailed( relinsert, detailNOPCell ); |
| | | } else { |
| | | // å°æç»åå
æ ¼å
³èå°å计åå
æ ¼ |
| | | totalNOPRCell.Detailed( relinsert, detailNOPCell ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 设置ç产顺åºã对ä¸çº¿è®¡åæç»çæã |
| | | indexColumn := select( nopt, NewOfflinePlanColumn, tempNOPC, tempNOPC.StartDate() = planningDate ); |
| | | previousColumn := indexColumn.PreviousNOPColumn(); |
| | | nextColumn := indexColumn.NextNOPColumn(); |
| | | while ( not isnull( indexColumn.NextNOPColumn() ) |
| | | // and indexColumn.ColumnDate() <= Date::Construct( 2020, 4, 1 ) // æµè¯å®é
åºæ¯æ¶å¯ä»¥è¿æ»¤ |
| | | ) |
| | | { |
| | | orderNr := 1; |
| | | nopcells := selectsortedset( indexColumn, NewOfflinePlanCell, tempNOPCell, tempNOPCell.FindProductionLineAndType( u.ID(), "1" ), tempNOPCell.InventoryWeight() ); |
| | | initialSize := nopcells.Size(); |
| | | // info( "计åå¼å§æ¶é´ï¼", planningDate.Format( "Y-M2-D2" ), " ç´¢å¼æ¶é´ï¼", indexColumn.StartDate().Format( "Y-M2-D2" ), " 个æ°ï¼", nopcells.Size() ); |
| | | |
| | | if ( nopcells.Size() > 0 ) { |
| | | |
| | | // å¤å®1 |
| | | previousOPCell := maxselect( previousColumn, NewOfflinePlanCell, tempNOPCell, tempNOPCell.FindProductionLineAndType( u.ID(), "1" ), tempNOPCell.OrderNr() ); |
| | | if ( isnull( previousOPCell ) or indexColumn.StartDate() = planningDate ) { |
| | | nopcell := nopcells.Element( 0 ); |
| | | nopcell.Order( "#" + orderNr.Format( "N(LPad0(2))" ) ); |
| | | nopcell.OrderNr( orderNr ); |
| | | orderNr++; |
| | | nopcells.Remove( nopcell ); |
| | | } else { |
| | | nopcell := select( nopcells, Elements, tempNOPCell, tempNOPCell.NewOfflinePlanRow().ProductID() = previousOPCell.NewOfflinePlanRow().ProductID() ); |
| | | if ( not isnull( nopcell ) ) { |
| | | nopcell.Order( "#" + orderNr.Format( "N(LPad0(2))" ) ); |
| | | nopcell.OrderNr( orderNr ); |
| | | orderNr++; |
| | | nopcells.Remove( nopcell ); |
| | | } |
| | | } |
| | | |
| | | // å¤å®2 |
| | | nextNOPCells := selectset( nopcells, Elements, tempOPC, |
| | | exists( nextColumn, NewOfflinePlanCell, nextOPCell, nextOPCell.FindProductionLineAndType( u.ID(), "1" ) and |
| | | nextOPCell.NewOfflinePlanRow().ProductID() = tempOPC.NewOfflinePlanRow().ProductID() ) ); // æ¾ä¸ä¸åæ¯å¦æå½ååç产ç产å |
| | | if ( nextNOPCells.Size() = 1 ) { |
| | | nopcell := nextNOPCells.Element( 0 ); |
| | | nopcell.Order( "#" + initialSize.Format( "N(LPad0(2))" ) ); |
| | | nopcell.OrderNr( initialSize ); |
| | | nopcells.Remove( nopcell ); |
| | | } |
| | | |
| | | // å¤å®3 |
| | | traverse ( nopcells, Elements, opcell ) { |
| | | opcell.Order( "#" + orderNr.Format( "N(LPad0(2))" ) ); |
| | | opcell.OrderNr( orderNr ); |
| | | orderNr++; |
| | | nopcells.Remove( opcell ); |
| | | } |
| | | } |
| | | |
| | | indexColumn := indexColumn.NextNOPColumn(); |
| | | previousColumn := indexColumn.PreviousNOPColumn(); |
| | | nextColumn := indexColumn.NextNOPColumn(); |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod SaveAsDraft ( |
| | | MacroPlan macroPlan, |
| | | NewOfflinePlanTable nopt |
| | | ) as NewOfflinePlanTable |
| | | { |
| | | TextBody: |
| | | [* |
| | | newTable := nopt.DeepCopy().astype( NewOfflinePlanTable ); |
| | | newNOPT := macroPlan.NewOfflinePlanTable( relinsert, &newTable ); |
| | | newNOPT.SaveDateTime( DateTime::ActualTime() ); |
| | | |
| | | return newNOPT; |
| | | *] |
| | | } |
| | |
| | | if( this.EventType() = "卿¥"){ |
| | | value := "LightBlue"; |
| | | } |
| | | if( this.EventType() = "卿«"){ |
| | | value := "LightBlue"; |
| | | } |
| | | if( this.EventType() = "æ³å®è忥"){ |
| | | value := "Red"; |
| | | } |
| | |
| | | result := ""; |
| | | flag := true; |
| | | traverse( values,Elements,value ,flag){ |
| | | if( value = "è°ä¼" and result <> "è°ä¼"){ |
| | | if( value = "è°ä¼" and result <> "æ³å®è忥"){ |
| | | result := "è°ä¼"; |
| | | }else if( value = "æ³å®è忥" and result <> "æ³å®è忥"){ |
| | | result := "æ³å®è忥"; |
| | | }else if( value = "å¨å
" and result <> "å¨å
"){ |
| | | }else if( value = "å¨å
" and result <> "æ³å®è忥"){ |
| | | result := "å¨å
"; |
| | | }else if( value = "卿¥" and result <> "卿¥"){ |
| | | }else if( value = "卿¥" and result <> "æ³å®è忥"){ |
| | | result := "卿¥"; |
| | | }else if( value = "卿«" and result <> "æ³å®è忥"){ |
| | | result := "卿«"; |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | TypeRepresentation LocalCell_Default |
| | | { |
| | | AttributeRepresentation RealValue |
| | | { |
| | | AttributeKey: '[412672.1.5620866]' |
| | | Conditional: |
| | | [ |
| | | ] |
| | | DataRepresentation.Default |
| | | { |
| | | FormatString: 'N(Dec(1))' |
| | | InheritFormatting: false |
| | | } |
| | | } |
| | | RelationRepresentation LocalColumn { RelationKey: '[412672.0.1084249679]' Visibility: 'Normal' } |
| | | } |
| | |
| | | #parent: #root |
| | | TypeRepresentation NewOfflinePlanCell |
| | | { |
| | | AttributeRepresentation Order |
| | | { |
| | | Alignment: 'Right' |
| | | AttributeKey: '[413988.0.1603460356]' |
| | | } |
| | | AttributeRepresentation Quantity |
| | | { |
| | | AttributeKey: '[413988.0.1603460346]' |
| | | Conditional: |
| | | [ |
| | | DataRepresentation.Conditional |
| | | { |
| | | BackgroundColor: '$FF3399' |
| | | ConversionBody: '' |
| | | DefaultBackgroundColor: false |
| | | InheritConversion: false |
| | | } |
| | | ] |
| | | } |
| | | AttributeRepresentation ShiftPatternEnd |
| | | { |
| | | Alignment: 'Right' |
| | | AttributeKey: '[413988.0.1603460414]' |
| | | Synonym: 'çæ¬¡ç»ææ¶é´' |
| | | } |
| | | AttributeRepresentation ShiftPatternName |
| | | { |
| | | Alignment: 'Right' |
| | | AttributeKey: '[413988.0.1603460388]' |
| | | Synonym: 'çæ¬¡' |
| | | } |
| | | AttributeRepresentation ShiftPatternStart |
| | | { |
| | | Alignment: 'Right' |
| | | AttributeKey: '[413988.0.1603460401]' |
| | | Synonym: 'çæ¬¡å¼å§æ¶é´' |
| | | } |
| | |
| | | AllowMultipleAttributes: true |
| | | Columns: 'MatrixEditorColumns473' |
| | | ContextMenu: 'matrixeditorContextMenu267' |
| | | Editable: false |
| | | Rows: 'MatrixEditorRows569' |
| | | Taborder: 0 |
| | | ] |
| | |
| | | { |
| | | #keys: '[413988.0.1607432887]' |
| | | BaseType: 'matrixeditorContextMenu' |
| | | Children: |
| | | [ |
| | | Component mSeparator |
| | | { |
| | | #keys: '[413988.0.1651491148]' |
| | | BaseType: 'WebMenu' |
| | | Properties: |
| | | [ |
| | | Separator: true |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | | Component mShowOrHide |
| | | { |
| | | #keys: '[413988.0.1651491174]' |
| | | BaseType: 'WebMenu' |
| | | Properties: |
| | | [ |
| | | Image: 'POWER' |
| | | Taborder: 3 |
| | | Title: 'Show/Hide total' |
| | | ] |
| | | } |
| | | ] |
| | | Properties: |
| | | [ |
| | | Taborder: 4 |
| | |
| | | Taborder: 0 |
| | | ] |
| | | } |
| | | Component bDownload id:bDownload_141 |
| | | { |
| | | #keys: '[413988.0.1652609611]' |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | Label: 'Download' |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | | Component bImport id:bImport_217 |
| | | { |
| | | #keys: '[413988.0.1654241348]' |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | Label: 'Import' |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | | Component bDeductChangeoverLoss id:bDeductChangeoverLoss_737 |
| | | { |
| | | #keys: '[413988.0.1652941817]' |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | Label: 'Deduct changeover loss' |
| | | Taborder: 3 |
| | | ] |
| | | } |
| | | Component bRestore id:bRestore_778 |
| | | { |
| | | #keys: '[413988.0.1654260514]' |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | Label: 'Restore' |
| | | Taborder: 4 |
| | | ] |
| | | } |
| | | Component bSaveAsDraft id:bSaveAsDraft_870 |
| | | { |
| | | #keys: '[413988.0.1654260654]' |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | Label: 'Save as draft' |
| | | Taborder: 5 |
| | | ] |
| | | } |
| | | Component bConfirm id:bConfirm_978 |
| | | { |
| | | #keys: '[413988.0.1654260807]' |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | Label: 'Confirm' |
| | | Taborder: 6 |
| | | ] |
| | | } |
| | | ] |
| | | Properties: |
| | | [ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: matrixeditorContextMenu229/mShowOrHide |
| | | Response OnClick () id:Response_matrixeditorContextMenu229_mShowOrHide_OnClick |
| | | { |
| | | #keys: '[413988.0.1651491239]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebMenu_OnClick' |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | pTotal.Visible( not pTotal.Visible() ); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: pHeader/bDownload_141 |
| | | Response OnClick () id:Response_pHeader1_799_bDownload_OnClick_870 |
| | | { |
| | | #keys: '[413988.0.1652609610]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebButton_OnClick' |
| | | Precondition: |
| | | [* |
| | | return not isnull( MacroPlan ); |
| | | *] |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | binaryValue := NewOfflinePlanCell::Download( MacroPlan, dhSelectedDetailNewOfflinePlanRow.Data() ); |
| | | |
| | | Application.Download( "Output plan.xlsx", binaryValue.AsBinaryData() ); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: pHeader/bImport_217 |
| | | Response OnClick () id:Response_pHeader1_799_bImport_OnClick_568 |
| | | { |
| | | #keys: '[413988.0.1654241347]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebButton_OnClick' |
| | | Precondition: |
| | | [* |
| | | return not isnull( MacroPlan ); |
| | | *] |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | try { |
| | | uploadJsonString := Application.GetFile(); |
| | | if ( uploadJsonString <> "" ) { |
| | | uploadJson := JSON::Parse( uploadJsonString ); |
| | | Archive::VerifyTheFileName( uploadJson ); |
| | | |
| | | fileName := uploadJson.Get( "name" ).GetString(); |
| | | base64String := uploadJson.Get( "data" ).GetString(); |
| | | |
| | | webFileBinaryData := BinaryData::FromBase64EncodedString( base64String ).AsBinaryValue(); |
| | | |
| | | generalExcelImportAndExportDataSource := GeneralExcelImportAndExportDataSource::Upload( RecycleBin, webFileBinaryData, fileName ); |
| | | generalExcelImportAndExportDataSource.ReadStructure(); |
| | | |
| | | selection := select( generalExcelImportAndExportDataSource, GeneralExcelImportAndExportDataTable, tempGEIAEDT, tempGEIAEDT.Name() = "Sheet1" ); |
| | | |
| | | NewOfflinePlanCell::Import( dhNewOfflinePlanTable.Data(), selection ); |
| | | |
| | | // åç»å é¤ |
| | | generalExcelImportAndExportDataSource.Delete(); |
| | | |
| | | WebMessageBox::Success( Translations::A_VWED_Success() ); |
| | | } |
| | | } onerror { |
| | | WebMessageBox::Error( e.GeneralInformation() ); |
| | | } |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: pHeader/bRestore_778 |
| | | Response OnClick () id:Response_pHeader1_799_bRestore_OnClick_141 |
| | | { |
| | | #keys: '[413988.0.1654260513]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebButton_OnClick' |
| | | Precondition: |
| | | [* |
| | | return not isnull( MacroPlan ); |
| | | *] |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | currentNOPT := dhNewOfflinePlanTable.Data(); |
| | | targetNOPT := maxselect( MacroPlan, NewOfflinePlanTable, tempNOPT, tempNOPT <> currentNOPT, tempNOPT.SaveDateTime() ); |
| | | if ( not isnull( targetNOPT ) ) { |
| | | currentNOPT.Delete(); |
| | | dhNewOfflinePlanTable.Data( targetNOPT ); |
| | | } |
| | | |
| | | WebMessageBox::Success( Translations::A_VWED_Success() ); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: pHeader/bSaveAsDraft_870 |
| | | Response OnClick () id:Response_pHeader1_799_bSaveAsDraft_OnClick_870 |
| | | { |
| | | #keys: '[413988.0.1654260653]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebButton_OnClick' |
| | | Precondition: |
| | | [* |
| | | return not isnull( MacroPlan ); |
| | | *] |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | nopt := NewOfflinePlanCell::SaveAsDraft( MacroPlan, dhNewOfflinePlanTable.Data() ); |
| | | dhNewOfflinePlanTable.Data( nopt ); |
| | | |
| | | WebMessageBox::Success( Translations::A_VWED_Success() ); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
| | |
| | | { |
| | | #keys: '[413988.0.1296803057]' |
| | | BaseType: 'matrixeditorContextMenu' |
| | | Children: |
| | | [ |
| | | Component mCreateData |
| | | { |
| | | #keys: '[413988.0.1652900385]' |
| | | BaseType: 'WebMenu' |
| | | Properties: |
| | | [ |
| | | Image: 'DATA' |
| | | Taborder: 3 |
| | | Title: 'ææ°åå»ºæ°æ®æ¹æ³' |
| | | ] |
| | | } |
| | | Component mSparator |
| | | { |
| | | #keys: '[413988.0.1652900411]' |
| | | BaseType: 'WebMenu' |
| | | Properties: |
| | | [ |
| | | Separator: true |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | | ] |
| | | Properties: |
| | | [ |
| | | Taborder: 4 |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: matrixeditorContextMenu204/mCreateData |
| | | Response OnClick () id:Response_matrixeditorContextMenu204_mCreateData_OnClick |
| | | { |
| | | #keys: '[413988.0.1652970833]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebMenu_OnClick' |
| | | Precondition: |
| | | [* |
| | | return not isnull( MacroPlan ); |
| | | *] |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | NewOfflinePlanCell::CreateOldOfflinePlanData( MacroPlan ); |
| | | |
| | | opt := maxselect( MacroPlan, OfflinePlanTable, tempOPT, true, tempOPT.SaveDateTime() ); |
| | | dhOfflinePlanTable.Data( opt ); |
| | | |
| | | WebMessageBox::Success( Translations::A_VWED_Success() ); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |