| | |
| | | traverse( offlinePlan,NewOfflinePlanRow,row ,not row.ProductionLine().ToUpper().LikeUserLocale( "MOMO" )){ |
| | | line := null( DispatchShiftSchedulingLine ); |
| | | factory := constnull( Unit ); |
| | | unit := constnull( Unit ); |
| | | { |
| | | unitHandle := unitIndexTree.GetHandle( row.ProductionLine() ); |
| | | unitIndex := guard( unitIndexTree.Root().Child( unitHandle ), null( NamedValue )); |
| | |
| | | |
| | | traverse( row,NewOfflinePlanCell,cell, startDate <= cell.NewOfflinePlanColumn().StartDate() and endDate >= cell.NewOfflinePlanColumn().EndDate()){ |
| | | product := null( DispatchShiftSchedulingProduct ); |
| | | remark := ""; |
| | | if( not isnull( unit )){ |
| | | remark := ShiftPlan::CalculateRemark( unit,cell.NewOfflinePlanColumn().StartDate(),cell.NewOfflinePlanColumn().EndDate() ); |
| | | } |
| | | { |
| | | lineKey := row.ProductionLine() + cell.NewOfflinePlanColumn().StartDate().AsQUILL(); |
| | | lineHandle := lineIndexTree.GetHandle( lineKey ); |
| | | lineIndex := guard( lineIndexTree.Root().Child( lineHandle ),null( NamedValue )); |
| | | if( isnull( lineIndex )){ |
| | | line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewOfflinePlanColumn().StartDate() ); |
| | | line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewOfflinePlanColumn().StartDate(),Remark := remark ); |
| | | line.FactoryName( factory.Name() ); |
| | | line.InterfaceTime( now ); |
| | | line.VersionName( macroPlan.MDSMacroPlan().Description() ); |
| | |
| | | traverse( macroPlan,NewAssemblyOnlinePlanRow,row , row.ProductionLine().ToUpper().LikeUserLocale( "MOMO" )){ |
| | | line := null( DispatchShiftSchedulingLine ); |
| | | factory := constnull( Unit ); |
| | | unit := constnull( Unit ); |
| | | { |
| | | unitHandle := unitIndexTree.GetHandle( row.ProductionLine() ); |
| | | unitIndex := guard( unitIndexTree.Root().Child( unitHandle ), null( NamedValue )); |
| | |
| | | |
| | | traverse( row,NewAssemblyOnlinePlanCell,cell, startDate <= cell.NewAssemblyOnlinePlanColumn().StartDate() and endDate >= cell.NewAssemblyOnlinePlanColumn().EndDate()){ |
| | | product := null( DispatchShiftSchedulingProduct ); |
| | | remark := ""; |
| | | if( not isnull( unit )){ |
| | | remark := ShiftPlan::CalculateRemark( unit,cell.NewAssemblyOnlinePlanColumn().StartDate(),cell.NewAssemblyOnlinePlanColumn().EndDate() ); |
| | | } |
| | | { |
| | | lineKey := row.ProductionLine() + cell.NewAssemblyOnlinePlanColumn().StartDate().AsQUILL(); |
| | | lineHandle := lineIndexTree.GetHandle( lineKey ); |
| | | lineIndex := guard( lineIndexTree.Root().Child( lineHandle ),null( NamedValue )); |
| | | if( isnull( lineIndex )){ |
| | | line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewAssemblyOnlinePlanColumn().StartDate() ); |
| | | line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewAssemblyOnlinePlanColumn().StartDate(),Remark := remark ); |
| | | line.FactoryName( factory.Name() ); |
| | | line.InterfaceTime( now ); |
| | | line.VersionName( macroPlan.MDSMacroPlan().Description() ); |
| | |
| | | tempProducts := selectsortedset( line,DispatchShiftSchedulingProduct,object,object.ProductionQuantity() ); |
| | | |
| | | if( line.ShiftName() = "3" ){ |
| | | |
| | | singleShiftVolume1 := 0.0; |
| | | singleShiftVolume2 := 0.0; |
| | | singleShiftVolume3 := 0.0; |
| | | |
| | | if( line.Remark().LikeUserLocale( "淇濆吇" )){ |
| | | singleShiftVolume1 := 0.0; |
| | | singleShiftVolume2 := lineQuantity / 2; |
| | | singleShiftVolume3 := lineQuantity / 2; |
| | | }else{ |
| | | singleShiftVolume1 := lineQuantity / 3; |
| | | singleShiftVolume2 := lineQuantity / 3; |
| | | singleShiftVolume3 := lineQuantity / 3; |
| | | } |
| | | |
| | | for( i := tempProducts.Size() - 1;i >= 0; i-- ){ |
| | | product := tempProducts.Element( i ); |
| | | productionQuantity := product.ProductionQuantity(); |
| | |
| | | |
| | | }else if( line.ShiftName() = "2" ){ |
| | | // 240.5 |
| | | singleShiftVolume1 := 0.0; |
| | | singleShiftVolume2 := 0.0; |
| | | if( line.Remark().LikeUserLocale( "淇濆吇" )){ |
| | | singleShiftVolume1 := 0.0; |
| | | singleShiftVolume2 := lineQuantity; |
| | | }else{ |
| | | singleShiftVolume1 := lineQuantity / 2; |
| | | singleShiftVolume2 := lineQuantity / 2; |
| | | } |
| | | |
| | | for( i := tempProducts.Size() - 1;i >= 0; i-- ){ |
| | | product := tempProducts.Element( i ); |
| | | // 288 |
| | |
| | | |
| | | }else if( line.ShiftName() = "1" ){ |
| | | singleShiftVolume1 := lineQuantity / 1; |
| | | |
| | | if( line.Remark().LikeUserLocale( "淇濆吇" )){ |
| | | singleShiftVolume1 := lineQuantity / 1; |
| | | }else{ |
| | | singleShiftVolume1 := lineQuantity / 1; |
| | | } |
| | | |
| | | for( i := tempProducts.Size() - 1;i >= 0; i-- ){ |
| | | product := tempProducts.Element( i ); |
| | | productionQuantity := product.ProductionQuantity(); |