_Main/BL/EDI/Broker_MP_ExportSingleShiftConfigBroker.qbl
@@ -9,11 +9,14 @@ { EDIMLTable SingleShiftConfig { PrimaryKeyColumns: ID TargetType: SingleShiftConfig TypeIndex: SingleShiftConfigTypeIndex EDIMLColumn FirstSingleShiftQuantity { Attribute: FirstSingleShiftQuantity ValueType: Real } EDIMLColumn ID { Attribute: ID ValueType: String } EDIMLColumn SecondSingleShiftQuantity { Attribute: SecondSingleShiftQuantity ValueType: Real } EDIMLColumn ShiftName { Attribute: ShiftName ValueType: String } EDIMLColumn SingleShiftName { Attribute: SingleShiftName ValueType: String } EDIMLColumn StandardYield { Attribute: StandardYield ValueType: Real } EDIMLColumn ThirdSingleShiftQuantity { Attribute: ThirdSingleShiftQuantity ValueType: Real } EDIMLColumn UnitID { Attribute: UnitID ValueType: String } } } @@ -23,10 +26,11 @@ { InputTable: SingleShiftConfig OutputTable: SingleShiftConfig EDIColumnMatch { InputColumn: FirstSingleShiftQuantity OutputColumn: FirstSingleShiftQuantity } EDIColumnMatch { InputColumn: ID OutputColumn: ID } EDIColumnMatch { InputColumn: SecondSingleShiftQuantity OutputColumn: SecondSingleShiftQuantity } EDIColumnMatch { InputColumn: ShiftName OutputColumn: ShiftName } EDIColumnMatch { InputColumn: SingleShiftName OutputColumn: SingleShiftName } EDIColumnMatch { InputColumn: StandardYield OutputColumn: StandardYield } EDIColumnMatch { InputColumn: ThirdSingleShiftQuantity OutputColumn: ThirdSingleShiftQuantity } EDIColumnMatch { InputColumn: UnitID OutputColumn: UnitID } } } @@ -38,10 +42,11 @@ Columns: [ EDIXLSLinkColumn ID { ValueType: String } EDIXLSLinkColumn ShiftName { ValueType: String } EDIXLSLinkColumn SingleShiftName { ValueType: String } EDIXLSLinkColumn StandardYield { ValueType: Real } EDIXLSLinkColumn UnitID { ValueType: String } EDIXLSLinkColumn ShiftName { ValueType: String } EDIXLSLinkColumn FirstSingleShiftQuantity { ValueType: Real } EDIXLSLinkColumn SecondSingleShiftQuantity { ValueType: Real } EDIXLSLinkColumn ThirdSingleShiftQuantity { ValueType: Real } ] } } _Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
@@ -165,24 +165,26 @@ singleShiftVolume2 := 0.0; singleShiftVolume3 := 0.0; singleShiftConfigs := selectset( unit,SingleShiftConfig,config,config.ShiftName() = "3" ); traverse( singleShiftConfigs,Elements,singleShiftConfig ){ singleShiftConfig := select( unit,SingleShiftConfig,config,config.ShiftName() = "3" ); if( not isnull( singleShiftConfig ) ){ if( line.Tips().LikeUserLocale( "ä¿å »" )){ if( singleShiftConfig.SingleShiftName() = "ç½ç"){ singleShiftVolume1 := 0.0; }else if( singleShiftConfig.SingleShiftName() = "äºç"){ singleShiftVolume2 := singleShiftConfig.StandardYield(); }else if( singleShiftConfig.SingleShiftName() = "ä¸ç"){ singleShiftVolume3 := singleShiftConfig.StandardYield(); } singleShiftVolume1 := 0.0; singleShiftVolume2 := singleShiftConfig.SecondSingleShiftQuantity(); singleShiftVolume3 := singleShiftConfig.ThirdSingleShiftQuantity(); }else{ if( singleShiftConfig.SingleShiftName() = "ç½ç"){ singleShiftVolume1 := singleShiftConfig.StandardYield(); }else if( singleShiftConfig.SingleShiftName() = "äºç"){ singleShiftVolume2 := singleShiftConfig.StandardYield(); }else if( singleShiftConfig.SingleShiftName() = "ä¸ç"){ singleShiftVolume3 := singleShiftConfig.StandardYield(); } singleShiftVolume1 := singleShiftConfig.FirstSingleShiftQuantity(); singleShiftVolume2 := singleShiftConfig.SecondSingleShiftQuantity(); singleShiftVolume3 := singleShiftConfig.ThirdSingleShiftQuantity(); } }else{ if( line.Tips().LikeUserLocale( "ä¿å »" )){ singleShiftVolume1 := 0.0; singleShiftVolume2 := lineQuantity / 2; singleShiftVolume3 := lineQuantity / 2; }else{ singleShiftVolume1 := lineQuantity / 3; singleShiftVolume2 := lineQuantity / 3; singleShiftVolume3 := lineQuantity / 3; } } @@ -219,20 +221,22 @@ singleShiftVolume1 := 0.0; singleShiftVolume2 := 0.0; singleShiftConfigs := selectset( unit,SingleShiftConfig,config,config.ShiftName() = line.ShiftName() ); traverse( singleShiftConfigs,Elements,singleShiftConfig ){ singleShiftConfig := select( unit,SingleShiftConfig,config,config.ShiftName() = line.ShiftName() ); if( not isnull( singleShiftConfig )){ if( line.Tips().LikeUserLocale( "ä¿å »" )){ if( singleShiftConfig.SingleShiftName() = "ç½ç"){ singleShiftVolume1 := 0.0; }else if( singleShiftConfig.SingleShiftName() = "äºç"){ singleShiftVolume2 := singleShiftConfig.StandardYield(); } singleShiftVolume1 := 0.0; singleShiftVolume2 := singleShiftConfig.SecondSingleShiftQuantity(); }else{ if( singleShiftConfig.SingleShiftName() = "ç½ç"){ singleShiftVolume1 := singleShiftConfig.StandardYield(); }else if( singleShiftConfig.SingleShiftName() = "äºç"){ singleShiftVolume2 := singleShiftConfig.StandardYield(); } singleShiftVolume1 := singleShiftConfig.FirstSingleShiftQuantity(); singleShiftVolume2 := singleShiftConfig.SecondSingleShiftQuantity(); } }else{ if( line.Tips().LikeUserLocale( "ä¿å »" )){ singleShiftVolume1 := 0.0; singleShiftVolume2 := lineQuantity; }else{ singleShiftVolume1 := lineQuantity / 2; singleShiftVolume2 := lineQuantity / 2; } } @@ -260,13 +264,7 @@ } }else if( line.ShiftName() = "1" ){ singleShiftVolume1 := lineQuantity / 1; if( line.Tips().LikeUserLocale( "ä¿å »" )){ singleShiftVolume1 := lineQuantity / 1; }else{ singleShiftVolume1 := lineQuantity / 1; } singleShiftVolume1 := lineQuantity; for( i := tempProducts.Size() - 1;i >= 0; i-- ){ product := tempProducts.Element( i ); @@ -280,7 +278,7 @@ } }else{ info( "䏿¯æççæ¬¡åç§°ã" + line.ShiftName() + "ã"); } } _Main/BL/Type_MP_Cell_ScheduleSummary0/StaticMethod_CreateFullTable.qbl
@@ -10,18 +10,30 @@ [* // rislai Aug-7-2024 (created) // è·ååæ¡£æ°æ® tables := selectset( archive,ArchiveTable,table,table.Name() = ArchiveCell_ScheduleSummary::GetTableName() ); //tables := selectset( archive,ArchiveTable,table,table.Name() = ArchiveCell_ScheduleSummary::GetTableName() ); // è·åå®é çäº§æ°æ® // è·åå¯¼å ¥çäº§æ°æ® scheduleSummaryOutputDataIndexTree := NamedValueTree::Create(); scheduleSummaryOutputDatas := selectset( archive,ScheduleSummaryOutputLine.ScheduleSummaryOutputData,data, exists( tables,Elements.ArchiveRow,row,row.CustomName() = data.ScheduleSummaryOutputLine().LineName() )); // æå»ºå®é çäº§æ°æ®ç´¢å¼ scheduleSummaryOutputDatas := selectset( archive,ScheduleSummaryOutputLine.ScheduleSummaryOutputData,data, true ); // exists( tables,Elements.ArchiveRow,row,row.CustomName() = data.ScheduleSummaryOutputLine().LineName() )); // æå»ºå¯¼å ¥çäº§æ°æ®ç´¢å¼ for( i :=0;i < scheduleSummaryOutputDatas.Size();i++ ){ scheduleSummaryOutputData := scheduleSummaryOutputDatas.Element( i ); scheduleSummaryOutputDataKey := scheduleSummaryOutputData.ScheduleSummaryOutputLine().LineName() + scheduleSummaryOutputData.Date().AsQUILL(); scheduleSummaryOutputDataHandle := scheduleSummaryOutputDataIndexTree.GetHandle( scheduleSummaryOutputDataKey ); scheduleSummaryOutputDataIndexTree.Root().AddChild( scheduleSummaryOutputDataHandle,i ); } // è·åå®é çäº§æ°æ® actualDailyProductionDataIndexTree := NamedValueTree::Create(); actualDailyProductionDatas := selectset( archive,ActualDailyProductionData,data, true ); // exists( tables,Elements.ArchiveRow,row,row.CustomName() = data.LineName() )); // æå»ºå®é çäº§æ°æ®ç´¢å¼ for( i :=0;i < actualDailyProductionDatas.Size();i++ ){ actualDailyProductionData := actualDailyProductionDatas.Element( i ); actualDailyProductionDataKey := actualDailyProductionData.LineName() + actualDailyProductionData.ProductionDate().AsQUILL(); actualDailyProductionDataHandle := actualDailyProductionDataIndexTree.GetHandle( actualDailyProductionDataKey ); actualDailyProductionDataIndexTree.Root().AddChild( actualDailyProductionDataHandle,i ); } // æ¸ é¤å岿°æ® @@ -31,8 +43,8 @@ localTable := recycleBin.LocalTable( relnew,Name := ArchiveCell_ScheduleSummary::GetTableName() ); // è·åå¼å§æ¶é´åç»ææ¶é´ startDate := minselect( tables,Elements.ArchiveColumn,column,column.CustomDate() ).CustomDate(); endDate := maxselect( tables,Elements.ArchiveColumn,column,column.CustomDate() ).CustomDate(); startDate := minselect( archive,ActualDailyProductionData,data,data.ProductionDate() ).ProductionDate(); endDate := maxselect( macroPlan,Period_MP,period,period.EndDate() ).EndDate(); // æå»ºLocalColumnçç´¢å¼ localColumns := construct( LocalColumns ); @@ -61,73 +73,62 @@ unitIndexTree.Root().AddChild( unitHandle,i ); } // å¼å§æ¼æ¥åæ¡£æ°æ® traverse( tables,Elements.ArchiveRow,row ){ // å 寻æ¾localRowï¼æ¾ä¸å°å°±æ°å»ºï¼å¹¶åå»ºç´¢å¼ localRow := null( LocalRow ); { localRowHandle := localRowIndexTree.GetHandle( row.Name() ); localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue )); if( isnull( localRowIndex )){ localRow := localTable.LocalRow( relnew,CustomName := row.Name(),Index := localTable.GetRowIndexCache() ); localRows.Add( localRow ); localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 ); }else{ localRow := localRows.Element( localRowIndex.GetValueAsNumber()); } } // 循ç¯åå»ºææ°æ® traverse( localColumns,Elements,localColumn ){ archiveCells := selectset( row,ArchiveCell.astype( ArchiveCell_ScheduleSummary ),cell, cell.IsFristWeekData() and cell.ArchiveColumn().CustomDate() >= localColumn.CustomDate() and cell.ArchiveColumn().CustomDate() < localColumn.CustomDate().StartOfNextMonth() ); isFuture := macroPlan.StartOfPlanning().Date() <= localColumn.CustomDate(); workingDay := 0; capacity := 0.0; output := 0.0; shiftPatterns := construct( Strings ); if( not isFuture ){ scheduleSummaryOutputDataKey := row.Name() + localColumn.CustomDate().AsQUILL(); scheduleSummaryOutputDataHandle := scheduleSummaryOutputDataIndexTree.GetHandle( scheduleSummaryOutputDataKey ); scheduleSummaryOutputDataIndex := guard( scheduleSummaryOutputDataIndexTree.Root().Child( scheduleSummaryOutputDataHandle ),null( NamedValue )); if( not isnull( scheduleSummaryOutputDataIndex )){ scheduleSummaryOutputData := scheduleSummaryOutputDatas.Element( scheduleSummaryOutputDataIndex.GetValueAsNumber() ); output := scheduleSummaryOutputData.Output(); } } traverse( archiveCells,Elements,cell,cell.IsFristWeekData() ){ workingDay := workingDay + cell.WorkingDay(); capacity := capacity + cell.Capacity(); if( cell.ShiftPattern() <> "" ){ shiftPatterns.Add( cell.ShiftPattern() ); } } localCell := null( LocalCell_ScheduleSummary ); { localCellHandle := localCellIndexTree.GetHandle( row.Name() + localColumn.CustomDate().AsQUILL() ); localCellIndex := guard( localCellIndexTree.Root().Child( localCellHandle ),null( NamedValue )); if( isnull( localCellIndex )){ localCell := localRow.LocalCell( relnew,LocalCell_ScheduleSummary,LocalColumn := localColumn ); localCells.Add( localCell ); localCellIndexTree.Root().AddChild( localCellHandle , localCells.Size() - 1 ); }else{ localCell := localCells.Element( localCellIndex.GetValueAsNumber() ); } } localCell.ShiftPattern( selectuniquevalues( shiftPatterns,Elements,element,element ).Concatenate( "/" ) ); localCell.WorkingDay( localCell.WorkingDay() + workingDay ); localCell.Capacity( localCell.Capacity() + capacity ); localCell.Output( localCell.Output() + output ); } } //// å¼å§æ¼æ¥åæ¡£æ°æ® //traverse( tables,Elements.ArchiveRow,row ){ // // å 寻æ¾localRowï¼æ¾ä¸å°å°±æ°å»ºï¼å¹¶åå»ºç´¢å¼ // localRow := null( LocalRow ); // { // localRowHandle := localRowIndexTree.GetHandle( row.Name() ); // localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue )); // if( isnull( localRowIndex )){ // localRow := localTable.LocalRow( relnew,CustomName := row.Name(),Index := localTable.GetRowIndexCache() ); // localRows.Add( localRow ); // localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 ); // }else{ // localRow := localRows.Element( localRowIndex.GetValueAsNumber()); // } // } // // 循ç¯åå»ºææ°æ® // traverse( localColumns,Elements,localColumn ){ // archiveCells := selectset( row,ArchiveCell.astype( ArchiveCell_ScheduleSummary ),cell, // cell.IsFristWeekData() and // cell.ArchiveColumn().CustomDate() >= localColumn.CustomDate() and // cell.ArchiveColumn().CustomDate() < localColumn.CustomDate().StartOfNextMonth() ); // // isFuture := macroPlan.StartOfPlanning().Date() <= localColumn.CustomDate(); // // workingDay := 0; // capacity := 0.0; // output := 0.0; // shiftPatterns := construct( Strings ); // // localCell := null( LocalCell_ScheduleSummary ); // { // localCellHandle := localCellIndexTree.GetHandle( row.Name() + localColumn.CustomDate().AsQUILL() ); // localCellIndex := guard( localCellIndexTree.Root().Child( localCellHandle ),null( NamedValue )); // if( isnull( localCellIndex )){ // localCell := localRow.LocalCell( relnew,LocalCell_ScheduleSummary,LocalColumn := localColumn ); // localCells.Add( localCell ); // localCellIndexTree.Root().AddChild( localCellHandle , localCells.Size() - 1 ); // }else{ // localCell := localCells.Element( localCellIndex.GetValueAsNumber() ); // } // } // // traverse( archiveCells,Elements,cell,cell.IsFristWeekData() ){ // workingDay := workingDay + cell.WorkingDay(); // capacity := capacity + cell.Capacity(); // if( cell.ShiftPattern() <> "" ){ // shiftPatterns.Add( cell.ShiftPattern() ); // } // } // // localCell.ShiftPattern( selectuniquevalues( shiftPatterns,Elements,element,element ).Concatenate( "/" ) ); // localCell.WorkingDay( localCell.WorkingDay() + workingDay ); // localCell.Capacity( localCell.Capacity() + capacity ); // localCell.Output( localCell.Output() + output ); // } //} tempArchiveTable := ArchiveCell_ScheduleSummary::CreateTempTable( macroPlan,recycleBin ); traverse( tempArchiveTable,LocalRow,row ){ @@ -153,22 +154,34 @@ capacity := 0.0; output := 0.0; shiftPatterns := construct( Strings ); isFuture := macroPlan.StartOfPlanning().Date() <= localColumn.CustomDate(); startDate := ifexpr( macroPlan.StartOfPlanning().Date() >= localColumn.CustomDate(), macroPlan.StartOfPlanning().Date(), localColumn.CustomDate() ); if( isFuture ){ { unitHandle := unitIndexTree.GetHandle( row.CustomName() ); unitIndex := guard( unitIndexTree.Root().Child( unitHandle ),null( NamedValue )); if( not isnull( unitIndex )){ unit := units.Element( unitIndex.GetValueAsNumber() ); output := sum( unit,StockingPoint_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod.astype( ProductInStockingPointInPeriodPlanningLeaf ).NewSupply,newSupply, newSupply.PeriodTask_MP().istype( PeriodTaskOperation ) and not newSupply.PeriodTask_MP().astype( PeriodTaskOperation ).IsSupplier() and // åè¡¨è¿æ»¤æ¡ä»¶ï¼FormProductionPlanDetails newSupply.ProductInStockingPointInPeriodPlanning().Period_MP().StartDate() >= localColumn.CustomDate() and newSupply.ProductInStockingPointInPeriodPlanning().Period_MP().StartDate() >= startDate and newSupply.ProductInStockingPointInPeriodPlanning().Period_MP().StartDate() < localColumn.CustomDate().StartOfNextMonth() and newSupply.ProductInStockingPointInPeriodPlanning().Period_MP().TimeUnit() = "Day", newSupply.Quantity()); } } // 计åå¼å§ä¹åç产åºåå®é æ¯æ¥ç产æ¥å£ if( localColumn.CustomDate() < macroPlan.StartOfPlanning().Date() ){ historyStartDate := ifexpr( macroPlan.StartOfPlanning().Date() <= localColumn.CustomDate(), macroPlan.StartOfPlanning().Date(), localColumn.CustomDate() ); historyEndDate := ifexpr( macroPlan.StartOfPlanning().Date() > localColumn.CustomDate().StartOfNextMonth() and macroPlan.StartOfPlanning().Date().Month() = localColumn.CustomDate().Month() and macroPlan.StartOfPlanning().Date().Year() = localColumn.CustomDate().Year() ,macroPlan.StartOfPlanning().Date(), localColumn.CustomDate().StartOfNextMonth() ); { actualOut := sum( archive,ActualDailyProductionData,data,data.LineName() = row.CustomName() and data.ProductionDate() >= historyStartDate and data.ProductionDate() < historyEndDate,data.ActualOut() ); output := output + actualOut; } } traverse( archiveCells,Elements,cell ){ @@ -201,8 +214,38 @@ } } traverse( localTable,LocalRow.LocalCell.astype( LocalCell_ScheduleSummary ),cell,cell.WorkingDay() <> 0 ){ cell.Capacity( cell.Capacity() / cell.WorkingDay() ); traverse( localTable,LocalRow.LocalCell.astype( LocalCell_ScheduleSummary ),cell ){ if( cell.WorkingDay() <> 0 ){ cell.Capacity( cell.Capacity() / cell.WorkingDay() ); } // åå¯¼å ¥çæ°æ® row := cell.LocalRow(); localColumn := cell.LocalColumn(); { scheduleSummaryOutputDataKey := row.CustomName() + localColumn.CustomDate().AsQUILL(); scheduleSummaryOutputDataHandle := scheduleSummaryOutputDataIndexTree.GetHandle( scheduleSummaryOutputDataKey ); scheduleSummaryOutputDataIndex := guard( scheduleSummaryOutputDataIndexTree.Root().Child( scheduleSummaryOutputDataHandle ),null( NamedValue )); if( not isnull( scheduleSummaryOutputDataIndex )){ scheduleSummaryOutputData := scheduleSummaryOutputDatas.Element( scheduleSummaryOutputDataIndex.GetValueAsNumber() ); if( scheduleSummaryOutputData.Output() <> -1 ){ output := scheduleSummaryOutputData.Output(); cell.Output( output ); } if( scheduleSummaryOutputData.WorkingDay() <> -1 ){ workingDay := scheduleSummaryOutputData.WorkingDay(); cell.WorkingDay( workingDay ); } if( scheduleSummaryOutputData.Capacity() <> -1 ){ capacity := scheduleSummaryOutputData.Capacity(); cell.Capacity( capacity ); } if( scheduleSummaryOutputData.ShiftPattern() <> "-1"){ shiftPattern := scheduleSummaryOutputData.ShiftPattern(); cell.ShiftPattern( shiftPattern ); } } } } AsyncFlag::Success( recycleBin,ArchiveCell_ScheduleSummary::GetTableName() ); _Main/BL/Type_MP_Cell_ScheduleSummary0/StaticMethod_CreateTempTable.qbl
@@ -12,7 +12,7 @@ table := recycleBin.LocalTable( relnew,Name := ArchiveCell_ScheduleSummary::GetTableName()); startDate := macroPlan.StartOfPlanning().Date() + 8; startDate := macroPlan.StartOfPlanning().Date(); endDate := maxselect( macroPlan,Unit.UnitPeriod.astype( UnitPeriodTime ).Period_MP,period,period.TimeUnit() = Translations::MP_GlobalParameters_Day(),period.EndDate()).EndDate(); columns := construct( LocalColumns ); _Main/BL/Type_MP_Cell_ScheduleSummary0/StaticMethod_ExportOutputTemplate.qbl
@@ -8,19 +8,45 @@ TextBody: [* // rislai Aug-6-2024 (created) // Akari May-18-2024 (created) // rislai Jan-19-2024 (created) sheetName := "产åº"; xmlTemplate := '<?xml version="1.0" encoding="UTF-16"?><table><name>'+ sheetName +'</name>'; xmlTemplate := xmlTemplate + "<column><name>产线</name><type>String</type>"; // xmlTemplate := xmlTemplate + '<cell value=" "/>'; xmlTemplate := xmlTemplate + '<cell value="示ä¾äº§çº¿"/>'; xmlTemplate := xmlTemplate + '<cell value=" "/>'; xmlTemplate := xmlTemplate + '<cell value=" "/>'; xmlTemplate := xmlTemplate + '<cell value=" "/>'; xmlTemplate := xmlTemplate + "</column>"; xmlTemplate := xmlTemplate + "<column><name>屿§</name><type>String</type>"; xmlTemplate := xmlTemplate + '<cell value="çæ¬¡"/>'; xmlTemplate := xmlTemplate + '<cell value="工使¥"/>'; xmlTemplate := xmlTemplate + '<cell value="产è½"/>'; xmlTemplate := xmlTemplate + '<cell value="产åº"/>'; xmlTemplate := xmlTemplate + "</column>"; for( i := 6 ; i <= 12 ; i++ ){ xmlTemplate := xmlTemplate + "<column><name>" + Date::Construct( year - 1,i,1 ).Format( "Y/M/D" ) + "</name><type>Number</type>"; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + "</column>"; } for( i := 1 ; i <= 12 ; i++ ){ xmlTemplate := xmlTemplate + "<column><name>" + Date::Construct( year,i,1 ).Format( "Y/M/D" ) + "</name><type>Number</type>"; // xmlTemplate := xmlTemplate + '<cell value=" "/>'; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + "</column>"; } for( i := 1 ; i <= 6 ; i++ ){ xmlTemplate := xmlTemplate + "<column><name>" + Date::Construct( year + 1,i,1 ).Format( "Y/M/D" ) + "</name><type>Number</type>"; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + '<cell value="0"/>'; xmlTemplate := xmlTemplate + "</column>"; } _Main/BL/Type_MP_Cell_ScheduleSummary0/StaticMethod_ImportOutput.qbl
@@ -25,13 +25,14 @@ lineIndexTree.Root().AddChild( lineHandle,lines.Size() - 1 ); } countRow := 0; line := null( ScheduleSummaryOutputLine ); datas := construct( ScheduleSummaryOutputDatas ); dataIndexTree := NamedValueTree::Create(); traverse( outputTable,GeneralExcelImportAndExportDataRow,row ){ count := 0; line := null( ScheduleSummaryOutputLine ); datas := construct( ScheduleSummaryOutputDatas ); dataIndexTree := NamedValueTree::Create(); traverse( row,GeneralExcelImportAndExportDataCell,cell ){ if( count = 0 ){ if( count = 0 and countRow mod 4 = 0){ lineName := cell.Value(); lineHandle := lineIndexTree.GetHandle( lineName ); lineIndex := guard( lineIndexTree.Root().Child( lineHandle ),null( NamedValue )); @@ -47,22 +48,33 @@ dataIndexTree.Root().AddChild( dataHandle,datas.Size() - 1 ); } } }else{ }else if( count <> 1 and count <> 0 ){ stringsDate := cell.GeneralExcelImportAndExportDataColumn().Name().Tokenize( "/" ); date := guard( Date::Construct( [Number]stringsDate.Element( 0 ),[Number]stringsDate.Element( 1 ),[Number]stringsDate.Element( 2 )),Date::MinDate() ); dataHandle := dataIndexTree.GetHandle( date.AsQUILL() ); dataIndex := guard( dataIndexTree.Root().Child( dataHandle ),null( NamedValue )); data := null( ScheduleSummaryOutputData ); if( isnull( dataIndex )){ data := line.ScheduleSummaryOutputData( relnew,Date := date,Output := [Real]cell.Value() ); data := line.ScheduleSummaryOutputData( relnew,Date := date ); datas.Add( data ); dataIndexTree.Root().AddChild( dataHandle,datas.Size() - 1 ); }else{ data := datas.Element( dataIndex.GetValueAsNumber() ); } if( countRow mod 4 = 0 ){ data.ShiftPattern( cell.Value() ); }else if( countRow mod 4 = 1 ){ data.WorkingDay( [Number]cell.Value() ); }else if( countRow mod 4 = 2 ){ data.Capacity( [Real]cell.Value() ); }else if( countRow mod 4 = 3 ){ data.Output( [Real]cell.Value() ); } } count ++; } } countRow ++; } *] } _Main/BL/Type_ScheduleSummaryOutputData/Attribute_Capacity.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,8 @@ Quintiq file version 2.0 #parent: #root Attribute Capacity { #keys: '3[414996.1.259744817][414996.1.259744816][414996.1.259744818]' Description: '产è½' ValueType: Real } _Main/BL/Type_ScheduleSummaryOutputData/Attribute_ShiftPattern.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,7 @@ Quintiq file version 2.0 #parent: #root Attribute ShiftPattern { #keys: '3[414996.1.259744814][414996.1.259744813][414996.1.259744815]' ValueType: String } _Main/BL/Type_ScheduleSummaryOutputData/Attribute_WorkingDay.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,8 @@ Quintiq file version 2.0 #parent: #root Attribute WorkingDay { #keys: '3[414996.1.259744811][414996.1.259744810][414996.1.259744812]' Description: '工使¥' ValueType: Number } _Main/BL/Type_ScheduleSummaryOutputData/DefaultValue_ShiftPattern.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,6 @@ Quintiq file version 2.0 #parent: #root DefaultValue { TargetAttribute: ShiftPattern } _Main/BL/Type_SingleShiftConfig/Attribute_FirstSingleShiftQuantity.qbl
ÎļþÃû´Ó _Main/BL/Type_SingleShiftConfig/Attribute_SingleShiftName.qbl ÐÞ¸Ä @@ -1,7 +1,7 @@ Quintiq file version 2.0 #parent: #root Attribute SingleShiftName Attribute FirstSingleShiftQuantity { #keys: '3[414996.1.251280114][414996.1.251280113][414996.1.251280115]' ValueType: String ValueType: Real } _Main/BL/Type_SingleShiftConfig/Attribute_SecondSingleShiftQuantity.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,7 @@ Quintiq file version 2.0 #parent: #root Attribute SecondSingleShiftQuantity { #keys: '3[414996.1.260510622][414996.1.260510621][414996.1.260510623]' ValueType: Real } _Main/BL/Type_SingleShiftConfig/Attribute_ThirdSingleShiftQuantity.qbl
ÎļþÃû´Ó _Main/BL/Type_SingleShiftConfig/Attribute_StandardYield.qbl ÐÞ¸Ä @@ -1,6 +1,6 @@ Quintiq file version 2.0 #parent: #root Attribute StandardYield Attribute ThirdSingleShiftQuantity { #keys: '3[414996.1.251280101][414996.1.251280100][414996.1.251280102]' ValueType: Real _Main/BL/Type_SingleShiftConfig/StaticMethod_Import.qbl
@@ -28,11 +28,12 @@ traverse( rows,Elements,row ){ // idCell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 0 ); shiftNameCell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 1 ); singleShiftNameCell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 2 ); standardYieldCell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 3 ); unitIDCell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 4 ); unitIDCell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 1 ); shiftNameCell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 2 ); firstSingleShiftQuantityCell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 3 ); secondSingleShiftQuantityCell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 4 ); thirdSingleShiftQuantityCell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 5 ); unitID := guard( unitIDCell.Value(), "" ); if( unitID = "" ){ @@ -45,8 +46,9 @@ unit.SingleShiftConfig( relnew, ID := IDHolder::GetGUID(), ShiftName := guard( shiftNameCell.Value(), "" ), SingleShiftName := guard( singleShiftNameCell.Value(), "" ), StandardYield := [Real]guard( standardYieldCell.Value(), "0" )); FirstSingleShiftQuantity := guard( [Real]firstSingleShiftQuantityCell.Value(), 0.0 ), SecondSingleShiftQuantity := guard( [Real]secondSingleShiftQuantityCell.Value(), 0.0 ), ThirdSingleShiftQuantity := guard( [Real]thirdSingleShiftQuantityCell.Value(), 0.0 ) ); }else{ error( "æ æ³å¨ã" + macroPlan.MDSMacroPlan().Description() + "ãå æ¾å°äº§çº¿ã" + unitID + "ãã"); }