Quintiq file version 2.0
|
#parent: #root
|
StaticMethod CheckImport (
|
MacroPlan macroplan
|
)
|
{
|
TextBody:
|
[*
|
// 甄兰鸽 Aug-22-2024 (created)
|
if( exists( macroplan, ChangeLossSettingExcel, excel, excel.Product1() = ''
|
or excel.Product2() = ''
|
or excel.Unit() = ''
|
or excel.ChangeLossNumber() = '' ) ){
|
error( Translations::MP_ChangeLossSettingExcel_Import_NullInputRequiredField() );
|
}
|
//导入的数量小于0
|
if( exists( macroplan, ChangeLossSettingExcel, excel, [Real]excel.ChangeLossNumber() > 0 and ceil( [Real]excel.ChangeLossNumber() ) <> floor( [Real]excel.ChangeLossNumber() ) ) ){
|
error( Translations::MP_ChangeLossSettingExcel_Import_PositiveInteger() );
|
}
|
//导入产品是否存在
|
if( exists( macroplan, ChangeLossSettingExcel, excel, not exists( macroplan, Product_MP, product, product.ID() = excel.Product1() or product.ID() = excel.Product2() ) ) ){
|
error( Translations::MP_ChangeLossSettingExcel_Import_ProductNoExist() );
|
}
|
//导入产线是否存在
|
if( exists( macroplan, ChangeLossSettingExcel, excel, not exists( macroplan, Unit, unit, unit.ID() = excel.Unit() ) ) ){
|
error( Translations::MP_ChangeLossSettingExcel_Import_UnitNoExist() );
|
}
|
//导入的两个产品相等
|
if( exists( macroplan, ChangeLossSettingExcel, excel, excel.Product1() = excel.Product2() ) ){
|
error( Translations::MP_ChangeLossSetting_SameProduct() );
|
}
|
//重复导入校验
|
//if( selectduplicates( owner, LaneExcel, excel, excel.StartFrom(),
|
// excel.EndTo(),
|
// excel.StartStockingPoint(),
|
// excel.EndStockingPoint(),
|
// excel.TransporationType(),
|
// excel.Product(),
|
// excel.TransporationTime() ).Size() > 0 ){
|
// error( Translations::MP_LaneExcel_Import_RepeatKey() );
|
//}
|
*]
|
}
|