hongji.li
2023-10-19 b51233c005f97c52054a4f1d63a745b76d351f85
异步分发BusinessType修改
已修改6个文件
已删除1个文件
127 ■■■■■ 文件已修改
_Main/BL/Type_MacroPlan/StaticMethod_DoASync#253.qbl 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/StaticMethod_DoASync#896.qbl 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/StaticMethod_DoASync.qbl 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_TIANMA_JITUAN_DataHolderAllScenario_OnDataChanged.def 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogDataDistribution/Component_pnlContent.def 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogDataDistribution/Method_DataDistribution.def 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogDataDistribution/Response_pnlActions_btnOk_OnClick.def 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/StaticMethod_DoASync#253.qbl
@@ -2,11 +2,11 @@
#parent: #root
StaticMethod DoASync (
  MacroPlan macroPlan,
  Strings businessTypes,
  BusinessType businessType,
  Boolean isKeyProduct,
  Boolean createPurchaseSupplyMaterial,
  const GlobalOTDTable globalOTDTable
)
) as stream[MacroPlan]
{
  Description: '单次同步'
  TextBody:
@@ -16,20 +16,8 @@
    //Currency_MP::CreateCurrencyFromJson( macroPlan, jsonDataRow );
    info( "Prepare to do sync" )
    info( "Get organ code list" )
    organcodelist := selectvalues( globalOTDTable, Global_MappingOperationBOM, bom,true, bom.OrganCode() );
    if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) {
        traverse( businessTypes, Elements, item ) {
            info( "Business type : " + item )
        }
        organcodelist := selectvalues( globalOTDTable, BusinessType.OrganCode, organ, businessTypes.Find( organ.BusinessType().BusinessTypeName() ) <> -1, organ.OrganCodeName() );
    }
    else{
      if( businessTypes.Size() = 0 ){
        if( not isnull( selectset( globalOTDTable, BusinessType, b, b.BusinessTypeName() = "" ) ) ){
          organcodelist := selectvalues( globalOTDTable, BusinessType.OrganCode, organ, organ.BusinessType().BusinessTypeName() = "", organ.OrganCodeName() );
          }
        }
      }
    businessTypeName := businessType.BusinessTypeName().Tokenize( "," );
    organcodelist := selectvalues( businessType, OrganCode, organ, true, organ.OrganCodeName() );
    
    if( organcodelist.Size() = 0 ){
      organcodelist := selectvalues( globalOTDTable, Global_MappingOperationBOM, bom,true, bom.OrganCode() );
@@ -46,14 +34,14 @@
    UnitOfMeasure_MP::DoASync( globalOTDTable, macroPlan );
    
    // é”€å”®éƒ¨é—¨-2
    SalesSegment_MP::DoASync( macroPlan, businessTypes,globalOTDTable );
    SalesSegment_MP::DoASync( macroPlan, businessTypeName,globalOTDTable );
    
    // Unit-9 
    // ä¸ŽOperation一同处理
    //info( "BaseConversionFactor Finished, Start Operation Data Broker" );
    //macroPlan.Broker_OTD_Operation().Execute();
    info( "Operation Data Broker Finished, Start Unit Mapping" );
    macroPlan.DoASyncMappingUnitData( businessTypes ,globalOTDTable, organcodelist);
    macroPlan.DoASyncMappingUnitData( businessTypeName ,globalOTDTable, organcodelist);
    
    // åº“存点-3
    info( "Sales Segment Finished, Start Get StockingPoint From Api" )
@@ -90,18 +78,18 @@
    //macroPlan.Broker_OTD_Product().Execute();
    info( "Product Data Broker Finished, Start Product Mapping" );
    //testproduct := construct( Strings );
    macroPlan.DoASyncMappingProductData( businessTypes, globalOTDTable,isKeyProduct );
    macroPlan.DoASyncMappingProductData( businessTypeName, globalOTDTable,isKeyProduct );
    
    //单位转换-7
    BaseConversionFactor::DoASync( macroPlan ,globalOTDTable);
    
    // å·¥è‰ºè·¯çº¿ + BOM-9
    info( "Unit Finished, Start Operation Mapping" );
    macroPlan.DoASyncMappingOperationData( businessTypes ,globalOTDTable, organcodelist );
    macroPlan.DoASyncMappingOperationData( businessTypeName ,globalOTDTable, organcodelist );
    //info( "Operation Finished, Start BOM Data Broker" );
    //macroPlan.Broker_OTD_BOM().Execute();
    info( "BOM Data Broker Finished, Start BOM Mapping" );
    macroPlan.DoASyncMappingOperationBOMData( businessTypes, isKeyProduct, createPurchaseSupplyMaterial,globalOTDTable, organcodelist );
    macroPlan.DoASyncMappingOperationBOMData( businessTypeName, isKeyProduct, createPurchaseSupplyMaterial,globalOTDTable, organcodelist );
    
    //车道信息-10
    info( "BOM Finished, Start Get Lanes From Api" );
@@ -133,26 +121,26 @@
    //info( "ProductInLane Finished, Start ActualPISPIP Data Broker" );
    //macroPlan.Broker_OTD_ActualPISPIP().Execute();
    info( "ActualPISPIP Data Broker Finished, Start ActualPISPIP Mapping" );
    macroPlan.DoASyncMappingActualPISPIPData( businessTypes, globalOTDTable,isKeyProduct, organcodelist );
    macroPlan.DoASyncMappingActualPISPIPData( businessTypeName, globalOTDTable,isKeyProduct, organcodelist );
    
    // åœ¨é€”库存-14
    //info( "ActualPISPIP Finished, Start ExternalSupply Data Broker" );
    //macroPlan.Broker_OTD_ExternalSupply().Execute();
    info( "ExternalSupply Data Broker Finished, Start ExternalSupply Mapping" );
    macroPlan.DoASyncMappingExternalSupplyData( businessTypes, isKeyProduct ,globalOTDTable, organcodelist );
    macroPlan.DoASyncMappingExternalSupplyData( businessTypeName, isKeyProduct ,globalOTDTable, organcodelist );
    
    // åº“存成本-15
    InventoryValueAndCost::DoASync( macroPlan,globalOTDTable );
    
    // todo åˆ¶é€ æˆæœ¬-16
    info( "InventoryCost Finished, Start OperationCost Mapping" );
    macroPlan.DoASyncMappingOperationCostData( globalOTDTable, businessTypes, organcodelist );
    macroPlan.DoASyncMappingOperationCostData( globalOTDTable, businessTypeName, organcodelist );
    
    // è®¢å•预测-17
    Forecast::DoASync( macroPlan, businessTypes, globalOTDTable, organcodelist );
    Forecast::DoASync( macroPlan, businessTypeName, globalOTDTable, organcodelist );
    
    // è®¢å•需求-18
    CustomerOrder::DoASync( macroPlan, businessTypes, globalOTDTable, organcodelist );
    CustomerOrder::DoASync( macroPlan, businessTypeName, globalOTDTable, organcodelist );
    
    //删除多余报错数据-19
    macroPlan.DeleteSnaityCheck();
@@ -162,5 +150,7 @@
    
    //// todo ä¾›åº”商回复
    //info( "ProviderReply::DoSync" )
    return emit( macroPlan );
  *]
}
_Main/BL/Type_MacroPlan/StaticMethod_DoASync#896.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_MacroPlan/StaticMethod_DoASync.qbl
@@ -2,7 +2,7 @@
#parent: #root
StaticMethod DoASync (
  Scenario scenario,
  String businessTypeStr,
  BusinessType businessType,
  Boolean isKeyProduct,
  Boolean createPurchaseSupplyMaterial,
  const GlobalOTDTable globalOTDTable
@@ -10,10 +10,10 @@
{
  TextBody:
  [*
    info( scenario.DatasetMDSID(), "    äº‹ä¸šéƒ¨ï¼š", businessTypeStr, "    isKeyProduct:", isKeyProduct, "    createPurchaseSupplyMaterial:", createPurchaseSupplyMaterial );
    info( scenario.DatasetMDSID(), "    äº‹ä¸šéƒ¨ï¼š", businessType.BusinessTypeName(), "    isKeyProduct:", isKeyProduct, "    createPurchaseSupplyMaterial:", createPurchaseSupplyMaterial );
    
    MDSMacroPlan::Root( scenario.DatasetMDSID() )
    -> MacroPlan::DoASync( businessTypeStr,
    -> MacroPlan::DoASync( businessType,
                           isKeyProduct,
                           createPurchaseSupplyMaterial,
                           globalOTDTable
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_TIANMA_JITUAN_DataHolderAllScenario_OnDataChanged.def
@@ -6,10 +6,6 @@
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebComponent_OnDataChanged'
  GroupServerCalls: true
  Precondition:
  [*
  *]
  QuillAction
  {
    Body:
_Main/UI/MacroPlannerWebApp/Component_DialogDataDistribution/Component_pnlContent.def
@@ -5,18 +5,6 @@
  BaseType: 'WebPanel'
  Children:
  [
    Component dropDownStringListGeneral id:dropDownStringListGeneral_549
    {
      #keys: '[414702.1.87540205]'
      BaseType: 'WebDropDownStringList'
      Properties:
      [
        AllowEmpty: true
        DataBinding: 'DataHolderScenario.Data.ScenarioName'
        Label: 'Scenario Name'
        Taborder: 0
      ]
    }
    Component checkboxIsKeyProduct id:checkboxIsKeyProduct_593
    {
      #keys: '[414702.1.87540263]'
@@ -49,6 +37,33 @@
        Taborder: 3
      ]
    }
    Component ddlBusinessType
    {
      #keys: '[414702.1.169614090]'
      BaseType: 'WebDropDownList'
      Databinding: 'BusinessType'
      Children:
      [
        Component deContent
        {
          #keys: '[414702.1.169614092]'
          BaseType: 'WebDataExtractor'
          Properties:
          [
            DataType: 'GlobalOTDTable'
            Source: 'GlobalOTDTable'
            Taborder: 0
            Transformation: 'BusinessType'
          ]
        }
      ]
      Properties:
      [
        DisplayField: 'ScenarioName'
        Label: 'Scenario Name'
        Taborder: 0
      ]
    }
  ]
  Properties:
  [
_Main/UI/MacroPlannerWebApp/Component_DialogDataDistribution/Method_DataDistribution.def
@@ -9,8 +9,6 @@
  [*
    DataHolderScenario.Data( scenario );
    
    dropDownStringListGeneral.Strings( GlobalOTDTable::GetBusnessStrings( GlobalOTDTable ) );
    ApplicationMacroPlanner.ShowFormModal( this );
  *]
}
_Main/UI/MacroPlannerWebApp/Component_DialogDataDistribution/Response_pnlActions_btnOk_OnClick.def
@@ -10,8 +10,9 @@
    
    activeScenario := DataHolderActiveScenario.Data();
    currentScenario := DataHolderScenario.Data();
    businessType := ddlBusinessType.Data();
    
    if ( activeScenario = currentScenario ) {
    if ( activeScenario = currentScenario or isnull( businessType ) ) {
      flag := false;
      feedback := "无法对当前选中场景进行分发";
    }
@@ -30,15 +31,9 @@
    [*
      Form.ApplyChanges();
      
      businessType := select( GlobalOTDTable,
                              BusinessType,
                              b,
                              b.ScenarioName() = dropDownStringListGeneral.Text()
                             );
      DataDistributionLog::Create( GlobalOTDLog, ApplicationMacroPlanner.GetUserName(), DataHolderScenario.Data().DatasetMDSID(), DataHolderScenario.Data().Name() );
      MacroPlan::DoASync( DataHolderScenario.Data(), 
                          businessType.BusinessTypeName(),
                          ddlBusinessType.Data(),
                          checkboxIsKeyProduct.Checked(), 
                          checkboxCreatePurchaseSupplyProduct.Checked(),
                          GlobalOTDTable );