| | |
| | | traverse ( nopt, NewOfflinePlanColumn, nopc ) { |
| | | cell := select( nopr, NewOfflinePlanCell, tempNOPCell, tempNOPCell.NewOfflinePlanColumn() = nopc ); |
| | | if ( isnull( cell ) ) { |
| | | cell := nopr.NewOfflinePlanCell( relnew ); |
| | | uptb := select( macroPlan, Unit.UnitPeriod.astype( UnitPeriodTimeBase ), tempUPTB, |
| | | tempUPTB.UnitID() = nopr.ProductionLine() and tempUPTB.StartDate() = nopc.StartDate() and tempUPTB.End().Date() = nopc.EndDate() ); |
| | | // ShiftPattern |
| | | sp := uptb.ShiftPattern(); |
| | | // ShiftDayTime |
| | | sdt := select( sp, ShiftDayTime, tempSDT, tempSDT.Name() = tempSDT.ShiftPattern().Name() ); |
| | | cell := nopr.NewOfflinePlanCell( relnew, |
| | | ShiftPatternName := guard( sp.Name(), "" ), |
| | | ShiftPatternStart := guard( sdt.StartDateTime().Format( "H:m" ), "" ), |
| | | ShiftPatternEnd := guard( sdt.EndDateTIme().Format( "H:m" ), "" ) ); |
| | | cell.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 ) { |
| | | 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() ); |
| | | ShiftPatternName := detailNOPCell.ShiftPatternName(), |
| | | ShiftPatternStart := detailNOPCell.ShiftPatternStart(), |
| | | ShiftPatternEnd := detailNOPCell.ShiftPatternEnd() ); |
| | | totalNOPRCell.NewOfflinePlanColumn( relset, detailNOPCell.NewOfflinePlanColumn() ); // 设置列 |
| | | // 将明细单元格关联到合计单元格 |
| | | totalNOPRCell.Detailed( relinsert, detailNOPCell ); |