limj
2023-09-21 89c96171bb971dcaed7cf289b58ef44ca689523c
_Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning#662.qbl
@@ -1,6 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod FromSupplyPlanning (
  GlobalOTDTable otdTable,
  MacroPlan macroPlan,
  MacroPlan mappingRoot,
  ProductInStockingPointInPeriod pispip
@@ -17,12 +18,13 @@
    stockingPoint := pisp.StockingPoint_MP();
    period := pispip.Period_MP();
    mappingProduct := MappingProduct::GetByProductId( mappingRoot, product.ID() );
    matAttrSetting := MatAttrSettingAndPlanStrategy::GetExistByMatCode( otdTable, product.ID() );
    // 接口/中间表暂无
    mappingProviderCapacity := "暂无";
    erpData := "暂无";
    
    // 根据pispip
    result.MRPCalverNo( pispip.MRPCalverNo() );
    result.MRPCalverNo( ifexpr( pispip.MRPCalverNo() = "", "暂无", pispip.MRPCalverNo() ) );
    result.Quantity( pispip.NewSupplyQuantity() );
    
    // 根据product
@@ -37,14 +39,34 @@
    result.PRSuggestionDate( ifexpr( (result.ProduceRequiredDate() - Duration::Days( 7 )).Date() >= Date::Today(),
                                     Date::Today(), (result.ProduceRequiredDate() - Duration::Days( 7 )).Date() ) );
    
    // 根据 物料属性标签设定&物料计划策略
    result.IsPanelMaterial( "暂无" );
    if( isnull( matAttrSetting ) ) {
      result.IsGenericMaterial( "暂无" );
      result.IsLongLeadItem( "暂无" );
      result.MaterialMRPType( "暂无" );
    } else {
      result.IsGenericMaterial( matAttrSetting.FlagGeneric() );
      result.IsLongLeadItem( matAttrSetting.FlagLongTerm() );
      result.MaterialMRPType( ifexpr( matAttrSetting.PlanningStrategyCustom() <> "", matAttrSetting.PlanningStrategyCustom(), matAttrSetting.PlanningStrategyAuto() ) );
    }
    // 根据product中间表
    result.BusinessType( mappingProduct.BusinessType() );
    result.OrganCode( mappingProduct.OrgCode() );
    result.UnitOfMeasure( mappingProduct.UnitOfMeasureName() );
    if( isnull( mappingProduct ) ) {
      result.BusinessType( "暂无" );
      result.OrganCode( "暂无" );
      result.UnitOfMeasure( "暂无" );
    } else {
      result.BusinessType( mappingProduct.BusinessType() );
      result.OrganCode( mappingProduct.OrgCode() );
      result.UnitOfMeasure( mappingProduct.UnitOfMeasureName() );
    }
    
    // 根据供应商能力中间表
    result.ProviderCode( mappingProviderCapacity );
    result.ProductName( mappingProviderCapacity );
    result.LeadTime( 0.0 );
    
    // 根据erp接口 固定值
    result.RequisitionType( "PURCHASE" );
@@ -68,7 +90,7 @@
    // 发送信息
    result.SendStatus( "" );
    result.SendBy( "" );
    result.SendTIme( DateTime::MinDateTime() );
    result.SendTime( DateTime::MinDateTime() );
    
    return result;
  *]