renhao
2023-09-19 15162ab40eea1e4c760faa1b352b935d74d3c032
运输路线的UnitID
已修改2个文件
20 ■■■■■ 文件已修改
_Main/BL/Type_Lane/StaticMethod_CreateLaneFromJson.qbl 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_ApiLanesData.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Lane/StaticMethod_CreateLaneFromJson.qbl
@@ -1,7 +1,8 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateLaneFromJson (
  JSON datarow
  JSON datarow,
  MacroPlan macroplan
) as Lane
{
  Description: 'Read the json data and use it to create lane data'
@@ -14,6 +15,11 @@
    userleadtime := datarow.Get( "userleadtime" );
    processingtime := Duration::Zero();
    
    unitofmeasurename := "PCS";
    currencyid := "CNY";
    startdate := Date::Date( 1900, 1, 1 );
    enddate := Date::Date( 9999, 12, 31 );
    capacitytype := "Transport quantity";
    if( userleadtime.IsNull() )
    {
      processingtime := Duration::Zero(); 
@@ -24,6 +30,16 @@
      };
    
    unit := Unit::FindUnitTypeIndex( unitid );
    if( isnull( unit)){
      unit :=macroplan.Unit( relnew,
                 ID := unitid,
                 Name := unitid,
                 UnitOfMeasureName := unitofmeasurename,
                 CurrencyID := currencyid,
                 StartDate := startdate,
                 EndDate := enddate,
                 CapacityType := capacitytype );
    }
    
    result := Lane::CreateLane( unit, id, name, processingtime);
    
_Main/BL/Type_MacroPlan/Method_ApiLanesData.qbl
@@ -14,7 +14,7 @@
    for( i:=0; i<data_length; i++ )
    {
      datarow := data.Get( i );
      a := Lane::CreateLaneFromJson( datarow );
      a := Lane::CreateLaneFromJson( datarow ,this);
      updates.Add( a );
      }
    origindataset := selectset( this, Unit.Lane, l, true );