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() );
|
}
|
}
|
}
|
*]
|
}
|