| | |
| | | |
| | | unitIndexTree.Root().AddChild( unitIndexTree.GetHandle( unit.ID() ),i ); |
| | | } |
| | | |
| | | shiftPlanIndexTree := NamedValueTree::Create(); |
| | | for( i := 0 ; i<shiftPlans.Size(); i++ ){ |
| | | shiftPlan := shiftPlans.Element( i ); |
| | | period := shiftPlan.UnitPeriodTime().Period_MP(); |
| | | rowKey := shiftPlan.UnitPeriodTime().Unit().ID(); |
| | | columnKey := period.StartDate().AsQUILL() + period.EndDate().AsQUILL(); |
| | | shiftPlanHanlde := shiftPlanIndexTree.GetHandle( rowKey + columnKey ); |
| | | shiftPlanIndexTree.Root().AddChild( shiftPlanHanlde, i ); |
| | | } |
| | | |
| | | traverse( shiftPlans,Elements,shiftPlan ){ |
| | | rowKey := shiftPlan.UnitPeriodTime().Unit().ID(); |
| | | row := rows.Element( rowIndexTree.Root().Child( rowIndexTree.GetHandle( rowKey )).GetValueAsNumber() ); |
| | | nextShiftPlan := constnull( ShiftPlan ); |
| | | { |
| | | nextPeriod := shiftPlan.UnitPeriodTime().Period_MP().NextPeriod(); |
| | | if( not isnull( nextPeriod )){ |
| | | columnKey := nextPeriod.StartDate().AsQUILL() + nextPeriod.EndDate().AsQUILL(); |
| | | nextShiftPlanHanlde := shiftPlanIndexTree.GetHandle( rowKey + columnKey ); |
| | | nextShiftPlanIndex := guard( shiftPlanIndexTree.Root().Child( nextShiftPlanHanlde ),null( NamedValue )); |
| | | if( not isnull( nextShiftPlanIndex )){ |
| | | nextShiftPlan := shiftPlans.Element( nextShiftPlanIndex.GetValueAsNumber() ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // gongchangCell := LocalCell_Default::GetCell( rowKey + column1.Name(), cellIndexTree, cells, row, column1 ); |
| | | // chanxianxCell := LocalCell_Default::GetCell( rowKey + column2.Name(), cellIndexTree, cells, row, column2 ); |
| | | |
| | | shengchanCell := LocalCell_Default::GetCell( rowKey + column3.Name(), cellIndexTree, cells, row, column3 ); |
| | | week := shiftPlan.UnitPeriodTime().Period_MP().StartDate().DayOfWeek(); |
| | | // 工使¥ |
| | | workingDayCell := LocalCell_Default::GetCell( rowKey + column3.Name(), cellIndexTree, cells, row, column3 ); |
| | | // è忥å ç |
| | | holidayOvertimeHourCell := LocalCell_Default::GetCell( rowKey + column6.Name(), cellIndexTree, cells, row, column6 ); |
| | | // 伿¯æ¥å ç |
| | | breakDayOvertimeHourCell := LocalCell_Default::GetCell( rowKey + column5.Name(), cellIndexTree, cells, row, column5 ); |
| | | // å¹³æ¶å ç |
| | | defaultDayOvertimeHourCell := LocalCell_Default::GetCell( rowKey + column4.Name(), cellIndexTree, cells, row, column4 ); |
| | | |
| | | if( shiftPlan.Outcome() <> "" ){ |
| | | shengchanCell.RealValue( shengchanCell.RealValue() + 1 ); |
| | | workingDayCell.RealValue( workingDayCell.RealValue() + 1 ); |
| | | if( shiftPlan.IsHoliday() ){ |
| | | // è忥å ç |
| | | jiejiariCell := LocalCell_Default::GetCell( rowKey + column6.Name(), cellIndexTree, cells, row, column6 ); |
| | | jiejiariCell.SetBreakDayOverTimeDurction( shiftPlan.Outcome() ); |
| | | }else if( week = 6 or week = 7 ){ |
| | | // 伿¯æ¥å ç |
| | | xiuxiCell := LocalCell_Default::GetCell( rowKey + column5.Name(), cellIndexTree, cells, row, column5 ); |
| | | xiuxiCell.SetBreakDayOverTimeDurction( shiftPlan.Outcome() ); |
| | | // è忥å ç |
| | | overtime := shiftPlan.GetBreakDayOvertimeHour( false ); |
| | | holidayOvertimeHourCell.RealValue( holidayOvertimeHourCell.RealValue() + overtime ); |
| | | if( not isnull( nextShiftPlan )){ |
| | | nextDayOvertime := shiftPlan.GetBreakDayOvertimeHour( true ); |
| | | if( nextShiftPlan.IsHoliday()){ |
| | | // ä¸ä¸å¤©æ¯è忥 |
| | | holidayOvertimeHourCell.RealValue( holidayOvertimeHourCell.RealValue() + nextDayOvertime ); |
| | | }else if( shiftPlan.DefaultRemark().LikeUserLocale( "å¨å
" ) or shiftPlan.DefaultRemark().LikeUserLocale( "卿¥" ) ){ |
| | | // ä¸ä¸å¤©æ¯å¨å
æå¨æ¥ |
| | | breakDayOvertimeHourCell.RealValue( breakDayOvertimeHourCell.RealValue() + nextDayOvertime ); |
| | | }else{ |
| | | // ä¸ä¸å¤©æ¯å¹³å¸¸ç工使¥ |
| | | nextDayOvertime := shiftPlan.GetDefaultDayOvertimeHour( true ); |
| | | defaultDayOvertimeHourCell.RealValue( defaultDayOvertimeHourCell.RealValue() + nextDayOvertime ); |
| | | } |
| | | } |
| | | }else if( shiftPlan.DefaultRemark().LikeUserLocale( "å¨å
" ) or shiftPlan.DefaultRemark().LikeUserLocale( "卿¥" ) ){ |
| | | // 伿¯æ¥å ç |
| | | overtime := shiftPlan.GetBreakDayOvertimeHour( false ); |
| | | breakDayOvertimeHourCell.RealValue( breakDayOvertimeHourCell.RealValue() + overtime ); |
| | | if( not isnull( nextShiftPlan )){ |
| | | nextDayOvertime := shiftPlan.GetBreakDayOvertimeHour( true ); |
| | | if( nextShiftPlan.IsHoliday()){ |
| | | // ä¸ä¸å¤©æ¯è忥 |
| | | holidayOvertimeHourCell.RealValue( holidayOvertimeHourCell.RealValue() + nextDayOvertime ); |
| | | }else if( shiftPlan.DefaultRemark().LikeUserLocale( "å¨å
" ) or shiftPlan.DefaultRemark().LikeUserLocale( "卿¥" ) ){ |
| | | // ä¸ä¸å¤©æ¯å¨å
æå¨æ¥ |
| | | breakDayOvertimeHourCell.RealValue( breakDayOvertimeHourCell.RealValue() + nextDayOvertime ); |
| | | }else{ |
| | | // ä¸ä¸å¤©æ¯å¹³å¸¸ç工使¥ |
| | | nextDayOvertime := shiftPlan.GetDefaultDayOvertimeHour( true ); |
| | | defaultDayOvertimeHourCell.RealValue( defaultDayOvertimeHourCell.RealValue() + nextDayOvertime ); |
| | | } |
| | | } |
| | | }else{ |
| | | // å¹³æ¶å ç |
| | | jiabanCell := LocalCell_Default::GetCell( rowKey + column4.Name(), cellIndexTree, cells, row, column4 ); |
| | | jiabanCell.SetOvertimeDurction( shiftPlan.Outcome() ); |
| | | overtime := shiftPlan.GetDefaultDayOvertimeHour( false ); |
| | | defaultDayOvertimeHourCell.RealValue( defaultDayOvertimeHourCell.RealValue() + overtime ); |
| | | if( not isnull( nextShiftPlan )){ |
| | | nextDayOvertime := shiftPlan.GetBreakDayOvertimeHour( true ); |
| | | if( nextShiftPlan.IsHoliday()){ |
| | | // ä¸ä¸å¤©æ¯è忥 |
| | | holidayOvertimeHourCell.RealValue( holidayOvertimeHourCell.RealValue() + nextDayOvertime ); |
| | | }else if( shiftPlan.DefaultRemark().LikeUserLocale( "å¨å
" ) or shiftPlan.DefaultRemark().LikeUserLocale( "卿¥" ) ){ |
| | | // ä¸ä¸å¤©æ¯å¨å
æå¨æ¥ |
| | | breakDayOvertimeHourCell.RealValue( breakDayOvertimeHourCell.RealValue() + nextDayOvertime ); |
| | | }else{ |
| | | // ä¸ä¸å¤©æ¯å¹³å¸¸ç工使¥ |
| | | nextDayOvertime := shiftPlan.GetDefaultDayOvertimeHour( true ); |
| | | defaultDayOvertimeHourCell.RealValue( defaultDayOvertimeHourCell.RealValue() + nextDayOvertime ); |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | if( not shiftPlan.IsHoliday() and not ( week = 6 or week = 7 )){ |
| | | if( not shiftPlan.IsHoliday() and not ( shiftPlan.DefaultRemark().LikeUserLocale( "å¨å
" ) or shiftPlan.DefaultRemark().LikeUserLocale( "卿¥" ) )){ |
| | | qiangongCell := LocalCell_Default::GetCell( rowKey + column7.Name(), cellIndexTree, cells, row, column7 ); |
| | | qiangongCell.RealValue( qiangongCell.RealValue() + 8 ); |
| | | } |
| | |
| | | qiangongCell := LocalCell_Default::GetCell( rowKey + column7.Name(), cellIndexTree, cells, row, column7 ); |
| | | qiangongfeiCell := LocalCell_Default::GetCell( rowKey + column11.Name(), cellIndexTree, cells, row, column11 ); |
| | | qiangongfeiCell.RealValue( EmployeeCost::GetSalary( unit,defaultMultiplier,qiangongCell.RealValue() )); |
| | | |
| | | |
| | | // 工使¥ |
| | | workingDayCell := LocalCell_Default::GetCell( rowKey + column3.Name(), cellIndexTree, cells, row, column3 ); |
| | | workingDayCell.RealValue( workingDayCell.RealValue() + 1 ); |
| | | } |
| | | |
| | | return table; |