limj
2023-10-08 fd58c70e0631bdd09806ead43a573ced43f704f1
Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lmj
已添加13个文件
已修改12个文件
1070 ■■■■ 文件已修改
_Main/BL/Type_FillingCapacityOrder/Attribute_CurrencyID.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FillingCapacityOrder/Attribute_UnitOfMeasure_MPID.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_SynchronizeDataToMacroPlan#127.qbl 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_CreateCustomOrder.qbl 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetCurrency_MP.qbl 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetProduct_MP.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetSalesSegment_MP.qbl 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetStockingPoing_MP.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetUnitOfMeasure_MP.qbl 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_SynchronizeMacroPlanData.qbl 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderReverseOrAuthorize.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Component_pnlContent.def 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Response_pnlActions_btnOk_OnClick.def 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormFillingCapacityOrder/Response_PanelFillingCapacityOrder_ButtonDeduct_OnClick.def 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_ListInterfaceTest_MenuCreateShowData_OnClick.def 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_PanelInterfaceTest_ButtonSynchronizeDataToMacroPlan_OnClick.def 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Order/Response_OnCreated.def 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_List710.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_Panel391.def 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Response_Panel391_Button655_OnClick.def 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/_ROOT_Component_FrmErrorLogs.def 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Views/Test.vw 521 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FillingCapacityOrder/Attribute_CurrencyID.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute CurrencyID
{
  #keys: '3[414502.0.397320037][414502.0.397320036][414502.0.397320038]'
  ValueType: String
}
_Main/BL/Type_FillingCapacityOrder/Attribute_UnitOfMeasure_MPID.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute UnitOfMeasure_MPID
{
  #keys: '3[414502.0.397254634][414502.0.397254633][414502.0.397254635]'
  ValueType: String
}
_Main/BL/Type_GlobalDTOTable/Method_SynchronizeDataToMacroPlan#127.qbl
@@ -2,7 +2,9 @@
#parent: #root
Method SynchronizeDataToMacroPlan (
  MacroPlan macroPlan,
  Boolean isUnitOfMeasure_MP
  String executionUser,
  Boolean isUnitOfMeasure_MP,
  Boolean isCustomOrder
)
{
  TextBody:
@@ -10,5 +12,9 @@
    if ( isUnitOfMeasure_MP ) {
      Global_MappingUnitOfMeasure_MP::SynchronizeMacroPlanData( this, macroPlan );
    }
    if ( isCustomOrder ) {
      Global_MappingCustomOrder::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    }
  *]
}
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_CreateCustomOrder.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateCustomOrder (
  GlobalOTDTable globalOTDTable,
  MacroPlan macroPlan
)
{
  TextBody:
  [*
    traverse ( globalOTDTable, Global_MappingCustomOrder, gmco ) {
      targetProduct_MP := Global_MappingCustomOrder::GetProduct_MP( macroPlan, gmco );
      targetStockingPoint_MP := Global_MappingCustomOrder::GetStockingPoing_MP( macroPlan, gmco );
      Global_MappingCustomOrder::GetSalesSegment_MP( macroPlan, gmco );
      Global_MappingCustomOrder::GetCurrency_MP( macroPlan, gmco );
      Global_MappingCustomOrder::GetUnitOfMeasure_MP( macroPlan, gmco );
      targetCustomerOrder := CustomerOrder::Create( targetProduct_MP,
                                                    targetStockingPoint_MP,
                                                    gmco.ID(),
                                                    gmco.OrderDate(),
                                                    gmco.Quantity(),
                                                    gmco.Price(),
                                                    "Normal",
                                                    gmco.SalesSegmentName(),
                                                    gmco.CurrencyID(),
                                                    gmco.UnitOfMeasureName(),
                                                    false,
                                                    gmco.Customer(),
                                                    gmco.CustomerID(),
                                                    gmco.OrderID(),
                                                    gmco.OrderLineID(),
                                                    true,
                                                    true,
                                                    false
                                                   );
      targetCustomerOrder.BusinessType( gmco.BusinessType() );
      targetCustomerOrder.OrderType( gmco.OrderType() );
      targetCustomerOrder.IsAvailable( gmco.IsAvailable() );
      targetCustomerOrder.ProductGrade( gmco.ProductGrade() );
      targetCustomerOrder.SegmentPriority( gmco.SegmentPriority() );
      targetCustomerOrder.SheetProfitability( gmco.SheetProfitability() );
      targetCustomerOrder.OrderTime( gmco.OrderTime() );
    }
  *]
}
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetCurrency_MP.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetCurrency_MP (
  MacroPlan macroPlan,
  Global_MappingCustomOrder gmco
)
{
  TextBody:
  [*
    isExists := exists( macroPlan, Currency_MP, tempCMP, tempCMP.ID() = gmco.CurrencyID() );
    if ( not isExists ) {
      Currency_MP::Create( gmco.CurrencyID(), macroPlan, gmco.CurrencyID(), "", false, false );
    }
  *]
}
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetProduct_MP.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetProduct_MP (
  MacroPlan macroPlan,
  Global_MappingCustomOrder gmco
) as Product_MP
{
  TextBody:
  [*
    targetProduct_MP := select( macroPlan, Product_MP, tempPMP, tempPMP.ID() = gmco.ProductID() );
    if ( isnull( targetProduct_MP ) ) {
      targetProduct_MP := Product_MP::Create( gmco.ProductID(), macroPlan, null( Product_MP ), gmco.ProductID(), null( SupplyChainView ), 0, 0, false );
    }
    return targetProduct_MP;
  *]
}
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetSalesSegment_MP.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetSalesSegment_MP (
  MacroPlan macroPlan,
  Global_MappingCustomOrder gmco
)
{
  TextBody:
  [*
    isExists := exists( macroPlan, SalesSegment_MP, tempSSMP, tempSSMP.Name() = gmco.SalesSegmentName() );
    if ( not isExists ) {
      SalesSegment_MP::Create( macroPlan, "", gmco.SalesSegmentName(), 0, false );
    }
  *]
}
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetStockingPoing_MP.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetStockingPoing_MP (
  MacroPlan macroPlan,
  Global_MappingCustomOrder gmco
) as StockingPoint_MP
{
  TextBody:
  [*
    targetStockingPoint_MP := select( macroPlan, StockingPoint_MP, tempSPMP, tempSPMP.ID() = gmco.StockingPointID() );
    if ( isnull( targetStockingPoint_MP ) ) {
      targetStockingPoint_MP := StockingPoint_MP::Create( gmco.StockingPointID(), macroPlan, null( Unit ), gmco.StockingPointID(), null( SupplyChainView ), 0, 0, false );
    }
    return targetStockingPoint_MP;
  *]
}
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetUnitOfMeasure_MP.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetUnitOfMeasure_MP (
  MacroPlan macroPlan,
  Global_MappingCustomOrder gmco
)
{
  TextBody:
  [*
    isExists := exists( macroPlan, UnitOfMeasure_MP, tempUOMMP, tempUOMMP.Name() = gmco.UnitOfMeasureName() );
    if ( not isExists ) {
      UnitOfMeasure_MP::Create( macroPlan, gmco.UnitOfMeasureName(), false, false );
    }
  *]
}
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_SynchronizeMacroPlanData.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
Quintiq file version 2.0
#parent: #root
StaticMethod SynchronizeMacroPlanData (
  GlobalOTDTable globalOTDTable,
  MacroPlan macroPlan,
  String executionUser
)
{
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步订单数据",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
      Global_MappingCustomOrder::CreateCustomOrder( globalOTDTable, macroPlan );
    try {
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
    } onerror {
      global_BrokerExecuteLog.IsSuccess( false );
      global_BrokerExecuteLog.ErrorNo( e.ErrorNr() );
      global_BrokerExecuteLog.ErrorMessage( e.GeneralInformation() );
      global_BrokerExecuteLog.ErrorDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
    }
  *]
}
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl
@@ -24,10 +24,10 @@
    strMsg :="";
    
    try{
      if( Owner.MappingBOM(relsize )>0)
      if( GlobData.Global_MappingOperationBOM(relsize )>0)
      {
        // å¾—到下一级数据
        AllData:= selectset( GlobData, Global_MappingOperationBOM,object,object.ComponentCode()=ParentSKU);
        AllData:= selectset( GlobData, Global_MappingOperationBOM,object,object.ProductCode()=ParentSKU);
        ObjProduct := null( Product_MP,constcontent );
        ObjUnit := null( Unit,constcontent );
        MaterialType:="";
@@ -51,24 +51,24 @@
          traverse( AllData,Elements,Obj,not isnull( Obj))
          {
            // å¾—到当前已存在的物料信息(订单ID + SKU)
            ObjMaterial := select( Owner,H_MaterialInfo,ObjM,ObjM.ForecastID()=ForecastId and ObjM.SKU()=Obj.ProductCode());
            ObjMaterial := select( Owner,H_MaterialInfo,ObjM,ObjM.ForecastID()=ForecastId and ObjM.SKU()=Obj.ComponentCode());
            if( isnull( ObjMaterial))
            {
              // ç‰©æ–™ç±»åž‹
              MaterialType := Obj.ProductType();
              // å¾—到物料信息
              ObjProduct:= H_FunctionClass::SM_GetProductInfo(Owner,Obj.ProductCode());
              ObjProduct:= H_FunctionClass::SM_GetProductInfo(Owner,Obj.ComponentCode());
              if( not isnull( ObjProduct))
              {
                MaterialType:= ObjProduct.ParentID();
                MaterialName:=ObjProduct.Name();
              }
              ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ProductCode());
              ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ComponentCode());
              if( not isnull( ObjUnit))
              {
                StockPoint:= ObjUnit.Name();
              }
              Owner.H_MaterialInfo(relnew,ParentSKU := Obj.ComponentCode(),SKU := Obj.ProductCode(),ForecastID := ForecastId,OrgCode := Obj.OrganCode(),VCode := VCode
              Owner.H_MaterialInfo(relnew,ParentSKU := ParentSKU,SKU := Obj.ComponentCode(),ForecastID := ForecastId,OrgCode := Obj.OrganCode(),VCode := VCode
                                    ,ID := H_FunctionClass::SM_GenerateID( "MI"),MaterialType := MaterialType,NeedDate := NDate
                                    ,NeedQty := [Number](ProductQty/NRate*NComponentsUsed).Round( 0),Unit := Obj.UnitOfMeasureName()
                                    ,StockPoint :=StockPoint,MaterialName := MaterialName );
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,181 @@
Quintiq file version 2.0
#parent: #root
StaticMethod SM_OrderHedgingEx (
  MacroPlan Owner,
  String Operator
) as owning JSON
{
  Description: '填产后冲减'
  TextBody:
  [*
    /*******************************填产后订单冲减***********************
    *函数名称:SM_OrderHedgingEx
    *创 å»º äººï¼šyunying
    *创建时间:2023-09-27
    *描    è¿°ï¼šå¡«äº§åŽè®¢å•冲减,填产后的表:Owner.FillingCapacityOrder
    *参    æ•°ï¼šOperator æ“ä½œäºº
    *返 å›ž å€¼ï¼šJSON {Status: true æˆåŠŸ/false å¤±è´¥,Msg:"提示消息",Count: 0(冲减订单的数量)}
    *******************************************************************/
    // åˆå§‹åŒ–结果
    bStatus := false;
    strMsg :="";
    // å†²å‡æˆåŠŸæ¡æ•°
    nCount:=0;
    try
    {
      if(not isnull( Owner))
      {
        // èŽ·å–æ“ä½œè®¢å•
        NewOrders := selectset( Owner,FillingCapacityOrder,Obj,Obj.State() = "未冲减" or Obj.State() ="");
        if(NewOrders.Size()>0)
        {
          // æ–°è®¢å•与原订单冲减
          traverse( NewOrders,Elements,Obj)
          {
            if( (Obj.OrderType()="反签" or Obj.OrderType()="授权") and Obj.Quantity()>0 )
            {
              // å¾—到操作相关的反签订单
              ROrders:= select( Owner,SalesDemand.astype( CustomerOrder ),ObjOrder,
                                   ObjOrder.CustomerName() = Obj.Customer()
                                   and ObjOrder.ProductID()=Obj.ProductID()
                                   and ObjOrder.OrderTag() ="反签"
                                   );
              // åç­¾æ— å†²å‡ï¼Œç›´æŽ¥å‘订单中加入反签数据
              if( Obj.OrderType()="反签")
              {
                if( not isnull( ROrders))
                {
                  ROrders.Quantity(ROrders.Quantity()+Obj.Quantity());
                }
                else
                {
                  // æ–°å¢žè®¢å•
                  error( "----------------请实现新增反签订单功能代码---------------------");
                  // è®¢å•必要信息如下:
                  // OrderTag = "反签"
                  // Quantity = Obj.Quantity()
                  // å…¶ä»–信息继承当前的订单
                }
              }
              else if(Obj.OrderType()="授权")
              {
                // å¾—到操作相关的授权订单
                AOrders:= select( Owner,SalesDemand.astype( CustomerOrder ),ObjOrder,
                                   ObjOrder.CustomerName() = Obj.Customer()
                                   and ObjOrder.ProductID()=Obj.ProductID()
                                   and ObjOrder.OrderTag() ="授权"
                                   );
                if( not isnull( ROrders))
                {
                  // å½“前反签数量
                  RQty:=ROrders.Quantity();
                  // è®¡ç®—新的授权数量
                  AQty:= Obj.Quantity() - ROrders.Quantity();
                  // æŽˆæƒå¤§äºŽ0,反签被冲没,否则授权被冲,反签等于AQty的绝对值
                  if( AQty>=0)
                  {
                    RQty:=0;
                  }
                  else
                  {
                    RQty :=ROrders.Quantity() - Obj.Quantity();
                    AQty :=0;
                  }
                  // æ›´æ–°åç­¾æ•°æ®
                  if( RQty>=0)
                  {
                    ROrders.Quantity(RQty);
                  }
                  else
                  {
                    ROrders.Delete();
                  }
                  // æ›´æ–°æŽˆæƒæ•°æ®
                  if(AQty>0 )
                  {
                    if( not isnull( AOrders))
                    {
                      AOrders.Quantity(AOrders.Quantity()+AQty);
                    }
                    // æ–°å¢žæŽˆæƒè®¢å•
                    // error( "----------------请实现新增授权订单功能代码---------------------");
                    customOrder := CustomerOrder::Create( select( Owner, Product_MP, tmepPMP, tmepPMP.ID() = Obj.ProductID() ),
                                                          select( Owner, StockingPoint_MP, tempSPMP, tempSPMP.ID() = Obj.StockingPointID() ),
                                                          OS::GenerateGUIDAsString(),
                                                          Obj.OrderDate(),
                                                          AQty,
                                                          0.0,
                                                          "Normal",
                                                          Obj.SalesSegmentName(),
                                                          Obj.CurrencyID(),
                                                          Obj.UnitOfMeasureName(),
                                                          false,
                                                          Obj.Customer(),
                                                          Obj.CustomerID(),
                                                          "",
                                                          "",
                                                          true,
                                                          true,
                                                          false
                                                         );
                    customOrder.OrderTag( "授权" );
                    // è®¢å•必要信息如下:
                    // OrderTag = "授权"
                    // Quantity = AQty
                    // å…¶ä»–信息继承当前的订单
                  }
                }
                else
                {
                  // å°†æ–°æŽˆæƒæ•°æ®ç´¯åŠ åˆ°è®¢å•ä¸­
                  if( not isnull( AOrders))
                  {
                    AOrders.Quantity(AOrders.Quantity()+Obj.Quantity());
                  }
                  else
                  {
                    // æ–°å¢žæŽˆæƒè®¢å•
                    error( "----------------请实现新增授权订单功能代码---------------------");
                    // è®¢å•必要信息如下:
                    // OrderTag = "授权"
                    // Quantity = Obj.Quantity()
                    // å…¶ä»–信息继承当前的订单
                  }
                }
              }
              // æ›´æ–°å†²å‡çŠ¶æ€
              Obj.State("已冲减");
              nCount++;
            }
            else
            {
              // æ— æ³•识别的类型,或数量为0时暂不处理
              //strMsg :="订单类型:" + Obj.OrderType() + "无法冲减!";
            }
          }
          bStatus:=true;
          strMsg :="填产后冲减完成!";
        }
        else
        {
          strMsg :="无可冲减的数据!";
        }
      }
      else
      {
        strMsg :="加载数据失败,请创建或选择场景后再操作!";
      }
    }
    onerror
    {
      strMsg :="填产后订单冲减发生错误,请联系系统管理员!";
      // è®°å½•错误日志
    //  Owner.H_ErrorLogs(relnew,EClassName := "H_FunctionClass",EDateTime := DateTime::ActualGMTTime(),EFunctionName := "SM_OrderHedgingEx",
    //                     DeveloperInformation :=  e.DeveloperInformation(),ErrorNr := e.ErrorNr(),DetailedInformation := e.DetailedInformation(),
    //                     GeneralInformation := e.GeneralInformation());
    }
    return JSON::Object().Add( "Status",bStatus)
                         .Add( "Count",nCount)
                         .Add( "Msg",strMsg).Build();
  *]
}
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderReverseOrAuthorize.qbl
@@ -39,7 +39,7 @@
        nReverseQtyNew :=0;   //计算后的反签数量
        nAuthorizeQtyNew :=0; //计算后的授权数量
        nHaveForecastQty :=0; //有预测数量
        nNoHaveForecastQty:=0;//五预测数量
        nNoHaveForecastQty:=0;//无预测数量
        // èŽ·å–é¢„æµ‹æ•°é‡ï¼ˆå®¢æˆ·+SKU+月份 ç†è®ºæ˜¯æ²¡æœ‰ç‰©æ–™é¢„测)
        OrderForecast := select(Owner, H_OrderForecastRealQty , Obj, Obj.SKU() = SKU 
                                              and Obj.CustomCode() = CustomerCode 
_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
@@ -10,24 +10,22 @@
  [*
    // Administrator Aug-21-2023 (created)
    // list to deal
    listtodeal := construct( structured[MappingOperation] );
    listtodeal := construct( structured[Global_MappingOperation] );
    
    if( isnull( businesstypes ) or businesstypes.Size() = 0 ) {
        listtodeal := selectset( this, MappingOperation, item, true );
        listtodeal := selectset( globalOTDTable, Global_MappingOperation, item, true );
    } else {
        organcodelist := selectvalues( globalOTDTable, BusinessType.OrganCode, organ, businesstypes.Find( organ.BusinessType().BusinessTypeName() ) <> -1, organ.OrganCodeName() );
        listtodeal := selectset( this,
                                 MappingOperation,
        listtodeal := selectset( globalOTDTable, Global_MappingOperation,
                                 item, 
                                 ( businesstypes.Find( item.BusinessType() ) <> -1 ) and 
                                 ( organcodelist.Find( item.OrganCode() ) >= 0 ) );
    }
    
    // Get the list to deal with max sequence number
    listtodealwithmaxsn := construct( structured[MappingOperation] );
    listtodealwithmaxsn := construct( structured[Global_MappingOperation] );
    traverse( listtodeal, Elements, item ){
      maxsn := maxselect( this,
                          MappingOperation,
      maxsn := maxselect( globalOTDTable, Global_MappingOperation,
                          moperation, 
                          moperation.OrganCode() = item.OrganCode(), 
                          moperation.ProductID() = item.ProductID(), 
@@ -47,7 +45,7 @@
      if( count - [Number](count/1000) * 1000 = 0 or count = totalcount ){
        info( "Now is dealing with the " + count.AsQUILL() + "OperationCost " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" );
        }
      id := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection();
      id := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection()+"_" + [String]item.SequenceNumber();
      if( guard( item.Line(), "" ).Length() > 0 ) {
          id := id + "_" + item.Line();
        }
@@ -56,8 +54,8 @@
      isfromdb := false;
      existoperationcost := OperationCost::FindOperationCostTypeIndex( id );
      if( isnull( existoperationcost ) ){
        connecteditem := select( this,
                                 MappingOperationCost,
        connecteditem := select( globalOTDTable,
                                 Global_MappingOperationCost,
                                 moperationcost, 
                                 moperationcost.OrgCode() = item.OrganCode(), 
                                 moperationcost.ProductID() = item.ProductID() );
_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Component_pnlContent.def
@@ -70,7 +70,7 @@
        DataBinding: 'DataHolderFillingCapacityOrder.Data.Quantity'
        Label: '数量'
        Mask: 'REAL'
        Taborder: 12
        Taborder: 13
      ]
    }
    Component dropDownStringListUnitOfMeasureName id:dropDownStringListUnitOfMeasureName_750
@@ -97,7 +97,7 @@
        DataBinding: 'DataHolderFillingCapacityOrder.Data.SalesAmount'
        Label: '销售额'
        Mask: 'NUMBER'
        Taborder: 13
        Taborder: 14
      ]
    }
    Component dsDemandDate
@@ -108,7 +108,7 @@
      [
        DataBinding: 'DataHolderFillingCapacityOrder.Data.DemandDate'
        Label: '需求日期'
        Taborder: 15
        Taborder: 16
      ]
    }
    Component dsForecastDemandDate
@@ -119,7 +119,7 @@
      [
        DataBinding: 'DataHolderFillingCapacityOrder.Data.ForecastDemandDate'
        Label: '预期需求日期'
        Taborder: 14
        Taborder: 15
      ]
    }
    Component ddlSalesSegment
@@ -268,7 +268,7 @@
      [
        DataBinding: 'DataHolderFillingCapacityOrder.Data.Customer'
        Label: 'Customer name'
        Taborder: 10
        Taborder: 11
      ]
    }
    Component efCustomID
@@ -278,7 +278,7 @@
      Properties:
      [
        Label: 'Customer ID'
        Taborder: 11
        Taborder: 12
      ]
    }
    Component ddslOrderType
@@ -290,7 +290,34 @@
        DataBinding: 'DataHolderFillingCapacityOrder.Data.OrderType'
        Label: '订单类型'
        Strings: '反签;授权'
        Taborder: 16
        Taborder: 17
      ]
    }
    Component ddlCurrency_MP
    {
      #keys: '[414502.0.395021898]'
      BaseType: 'WebDropDownList'
      Databinding: 'Currency_MP'
      Children:
      [
        Component deContent593
        {
          #keys: '[414502.0.395021900]'
          BaseType: 'WebDataExtractor'
          Properties:
          [
            DataType: 'MacroPlan'
            Source: 'MacroPlan'
            Taborder: 0
            Transformation: 'Currency_MP'
          ]
        }
      ]
      Properties:
      [
        DisplayField: 'Name'
        Label: '货币'
        Taborder: 10
      ]
    }
  ]
_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Response_pnlActions_btnOk_OnClick.def
@@ -35,7 +35,8 @@
                                        ForecastDemandDate := dsForecastDemandDate.Date(),
                                        DemandDate         := dsDemandDate.Date(),
                                        OrderType          := ddslOrderType.Text(),
                                        SalesAmount        := [Number]edtSalesAmount.Text()
                                        SalesAmount        := [Number]edtSalesAmount.Text(),
                                        CurrencyID         := ddlCurrency_MP.Data().ID()
                                       );
      } else {
        data.ProductID( guard( ddlProduct_MP.Data().ID(), "null" ) );
@@ -49,6 +50,7 @@
        data.DemandDate( dsDemandDate.Date() );
        data.OrderType( ddslOrderType.Text() );
        data.SalesAmount( [Number]edtSalesAmount.Text() );
        data.CurrencyID( ddlCurrency_MP.Data().ID() );
      }
      
      Form.Close();
_Main/UI/MacroPlannerWebApp/Component_FormFillingCapacityOrder/Response_PanelFillingCapacityOrder_ButtonDeduct_OnClick.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
Quintiq file version 2.0
#parent: PanelFillingCapacityOrder/ButtonDeduct
Response OnClick () id:Response_PanelFillingCapacityOrder_ButtonDeduct_OnClick
{
  #keys: '[414502.0.395021805]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    return not isnull( MacroPlan );
  *]
  QuillAction
  {
    Body:
    [*
      H_FunctionClass::SM_OrderHedgingEx( MacroPlan, ApplicationMacroPlanner.GetUserName() );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_ListInterfaceTest_MenuCreateShowData_OnClick.def
@@ -8,6 +8,16 @@
  CanBindMultiple: false
  DefinitionID => /ListInterfaceTest/Responsedef_ListInterfaceTest_WebMenu_OnClick
  Initiator: 'MenuCreateShowData'
  Precondition:
  [*
    flag := selection.BrokerName() = "GlobalOTDTable_CustomOrder"
    if ( not flag ) {
      feedback := "暂不支持!!!";
    }
    return flag;
  *]
  QuillAction
  {
    Body:
_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_PanelInterfaceTest_ButtonSynchronizeDataToMacroPlan_OnClick.def
@@ -14,7 +14,9 @@
    Body:
    [*
      GlobalOTDTable.SynchronizeDataToMacroPlan( MacroPlan, 
                                                 CheckboxUnitOfMeasure_MP.Checked()
                                                 ApplicationMacroPlanner.GetUserName(),
                                                 CheckboxUnitOfMeasure_MP.Checked(),
                                                 CheckboxCustomOrder.Checked()
                                                );
      
      WebMessageBox::Success( "同步成功!", true );
_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Order/Response_OnCreated.def
@@ -23,18 +23,10 @@
          lb_SKUCode_FAAC.Text(SelForecast.Get( "SKU").GetString());
          lb_SKUName_FAAC.Text("产品");
          lb_Util_FAAC.Text(SelForecast.Get( "Util").GetString());
          lb_SKUName_FAAC.Text(SelForecast.Get( "SKUName").GetString());
          txt_CustomID_FAAC.Text(SelForecast.Get( "CustomCode").GetString());
          txt_CustomName_FAAC.Text(SelForecast.Get( "CustomName").GetString());
          lb_Operator_FAAC.Text(ApplicationMacroPlanner.GetUserName());
      //    StrValue := SelectItem.Value().Tokenize( ";");
      //    lb_SKUCode_FAAC.Text(StrValue.Element( 0));
      //    lb_SKUName_FAAC.Text("产品");
      //    lb_Operator_FAAC.Text("");
      //    lb_Util_FAAC.Text(StrValue.Element( 1));
      //    txt_CustomID_FAAC.Text(StrValue.Element( 2));
      //    txt_CustomName_FAAC.Text(StrValue.Element( 3));
      //    lb_Operator_FAAC.Text(ApplicationMacroPlanner.GetUserName());
        }
      }
    *]
_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_List710.def
@@ -36,6 +36,6 @@
  ]
  Properties:
  [
    Taborder: 1
    Taborder: 2
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_Panel391.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
Quintiq file version 2.0
Component Panel391
{
  #keys: '[414724.0.193860534]'
  BaseType: 'WebPanel'
  Children:
  [
    Component Button655
    {
      #keys: '[414724.0.193860558]'
      BaseType: 'WebButton'
      Properties:
      [
        Image: 'BULL'
        Label: '填产冲减'
        Taborder: 0
      ]
    }
  ]
  Properties:
  [
    Taborder: 0
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Response_Panel391_Button655_OnClick.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
Quintiq file version 2.0
#parent: Panel391/Button655
Response OnClick () id:Response_Panel391_Button655_OnClick
{
  #keys: '[414724.0.194975663]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    return not isnull( MacroPlan);
  *]
  QuillAction
  {
    Body:
    [*
      HResult := H_FunctionClass::SM_OrderHedgingEx( MacroPlan,"测试用户" );
      Msg := HResult.Get( "Msg").GetString();
      if( HResult.Get( "Status").GetBoolean())
      {
        if( Msg.Length()>0)
        {
          WebMessageBox::Information(Msg);
        }
      }
      else
      {
        if( Msg.Length()>0)
        {
          WebMessageBox::Warning(Msg);
        }
        else
        {
          WebMessageBox::Information("运行错误!");
        }
      }
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/_ROOT_Component_FrmErrorLogs.def
@@ -30,9 +30,10 @@
      ]
      Properties:
      [
        Taborder: 0
        Taborder: 1
      ]
    }
    #child: Panel391
  ]
  Properties:
  [
_Main/UI/MacroPlannerWebApp/Views/Test.vw
@@ -310,6 +310,10 @@
        }
        components
        {
          FormFillingCapacityOrder_PanelFillingCapacityOrder
          {
            sizeRatio: 1
          }
          FormFillingCapacityOrder_ListFillingCapacityOrder
          {
          }
@@ -430,523 +434,6 @@
              dataPath: 'OrderType'
              dataType: 'string'
              index: 12
              subtotals: ''
              width: 150
            }
          }
        }
      }
      form_FormPriorityPolicy
      {
        title: 'QTIANMA_JITUAN::FormPriorityPolicy'
        shown: true
        componentID: 'QTIANMA_JITUAN::FormPriorityPolicy'
        layout
        {
          mode: 'open'
          rowPosition: 32
          rowSpan: 13
          columnPosition: 5
          columnSpan: 8
        }
        components
        {
          FormPriorityPolicy_ListPriorityPolicy
          {
          }
          FormPriorityPolicy_DataSetLevelPriorityPolicy
          {
            groupDepth: -1
            column_Name
            {
              columnId: 'Name'
              dataPath: 'Name'
              dataType: 'string'
              index: 0
              subtotals: ''
              width: 150
            }
            column_Formula
            {
              columnId: 'Formula'
              dataPath: 'Formula'
              dataType: 'string'
              index: 1
              subtotals: ''
              width: 150
            }
            column_CalculateValue
            {
              columnId: 'CalculateValue'
              dataPath: 'CalculateValue'
              dataType: 'string'
              index: 2
              subtotals: ''
              width: 150
            }
            column_Desc
            {
              columnId: 'Desc'
              dataPath: 'Desc'
              dataType: 'string'
              index: 3
              subtotals: ''
              width: 150
            }
          }
          FormPriorityPolicy_PanelPriorityPolicyOperation
          {
            sizeRatio: 1
          }
          FormPriorityPolicy_PanelPriorityPolicyOperationButton
          {
            sizeRatio: 1
          }
          FormPriorityPolicy_PanelPriorityPolicyCoefficient
          {
            sizeRatio: 1
          }
        }
      }
      form_FormPriorityResult
      {
        title: 'QTIANMA_JITUAN::FormPriorityResult'
        shown: true
        componentID: 'QTIANMA_JITUAN::FormPriorityResult'
        layout
        {
          mode: 'open'
          rowPosition: 45
          rowSpan: 17
          columnPosition: 1
          columnSpan: 12
        }
        components
        {
          FormPriorityResult_PanelPriorityResult
          {
            sizeRatio: 1
          }
          FormPriorityResult_ListPriorityResult
          {
          }
          FormPriorityResult_DataSetLevelPriorityResult
          {
            groupDepth: -1
            column_SalesSegmentName
            {
              columnId: 'SalesSegmentName'
              dataPath: 'SalesSegmentName'
              dataType: 'string'
              index: 0
              subtotals: ''
              width: 150
            }
            column_ProductID
            {
              columnId: 'ProductID'
              dataPath: 'ProductID'
              dataType: 'string'
              index: 1
              subtotals: ''
              width: 150
            }
            column_StockingPointID
            {
              columnId: 'StockingPointID'
              dataPath: 'StockingPointID'
              dataType: 'string'
              index: 2
              subtotals: ''
              width: 150
            }
            column_Customer
            {
              columnId: 'Customer'
              dataPath: 'Customer'
              dataType: 'string'
              index: 3
              subtotals: ''
              width: 150
            }
            column_BusinessType
            {
              columnId: 'BusinessType'
              dataPath: 'BusinessType'
              dataType: 'string'
              index: 4
              subtotals: ''
              width: 150
            }
            column_Quantity
            {
              columnId: 'Quantity'
              dataPath: 'Quantity'
              dataType: 'real'
              index: 5
              subtotals: ''
              width: 150
            }
            column_UnitOfMeasureName
            {
              columnId: 'UnitOfMeasureName'
              dataPath: 'UnitOfMeasureName'
              dataType: 'string'
              index: 6
              subtotals: ''
              width: 150
            }
            column_DemandDate
            {
              columnId: 'DemandDate'
              dataPath: 'DemandDate'
              dataType: 'date'
              index: 7
              subtotals: ''
              width: 150
            }
            column_PriorityResultScore
            {
              columnId: 'PriorityResultScore'
              dataPath: 'PriorityResultScore'
              dataType: 'real'
              index: 8
              subtotals: ''
              width: 150
            }
          }
          FormPriorityResult_PanelPriorityResultDetails
          {
            sizeRatio: 1
          }
          FormPriorityResult_ListPriorityResultBusinessTypeDetails
          {
          }
          FormPriorityResult_DataSetLevelPriorityResultDetails
          {
            groupDepth: -1
            column_SalesSegmentName
            {
              columnId: 'SalesSegmentName'
              dataPath: 'SalesSegmentName'
              dataType: 'string'
              index: 0
              subtotals: ''
              width: 150
            }
            column_StockingPointID
            {
              columnId: 'StockingPointID'
              dataPath: 'StockingPointID'
              dataType: 'string'
              index: 1
              subtotals: ''
              width: 150
            }
            column_Customer
            {
              columnId: 'Customer'
              dataPath: 'Customer'
              dataType: 'string'
              index: 2
              subtotals: ''
              width: 150
            }
            column_BusinessType
            {
              columnId: 'BusinessType'
              dataPath: 'BusinessType'
              dataType: 'string'
              index: 3
              subtotals: ''
              width: 150
            }
            column_Quantity
            {
              columnId: 'Quantity'
              dataPath: 'Quantity'
              dataType: 'real'
              index: 4
              subtotals: ''
              width: 150
            }
            column_UnitOfMeasureName
            {
              columnId: 'UnitOfMeasureName'
              dataPath: 'UnitOfMeasureName'
              dataType: 'string'
              index: 5
              subtotals: ''
              width: 150
            }
            column_DemandDate
            {
              columnId: 'DemandDate'
              dataPath: 'DemandDate'
              dataType: 'date'
              index: 6
              subtotals: ''
              width: 150
            }
            column_PriorityResultScore
            {
              columnId: 'PriorityResultScore'
              dataPath: 'PriorityResultScore'
              dataType: 'real'
              index: 7
              subtotals: ''
              width: 150
            }
            column_PriorityPolicyName
            {
              columnId: 'PriorityPolicyName'
              dataPath: 'PriorityPolicyName'
              dataType: 'string'
              index: 8
              subtotals: ''
              width: 150
            }
            column_PriorityFactorName
            {
              columnId: 'PriorityFactorName'
              dataPath: 'PriorityFactorName'
              dataType: 'string'
              index: 9
              subtotals: ''
              width: 150
            }
            column_PriorityFactorGradingName
            {
              columnId: 'PriorityFactorGradingName'
              dataPath: 'PriorityFactorGradingName'
              dataType: 'string'
              index: 10
              subtotals: ''
              width: 150
            }
            column_PriorityTotalScore
            {
              columnId: 'PriorityTotalScore'
              dataPath: 'PriorityTotalScore'
              dataType: 'real'
              index: 11
              subtotals: ''
              width: 150
            }
          }
          FormPriorityResult_ListPriorityResultGroupDetails
          {
          }
          FormPriorityResult_DataSetLevelPriorityResultDetails872
          {
            groupDepth: -1
            column_SalesSegmentName
            {
              columnId: 'SalesSegmentName'
              dataPath: 'SalesSegmentName'
              dataType: 'string'
              index: 0
              subtotals: ''
              width: 150
            }
            column_StockingPointID
            {
              columnId: 'StockingPointID'
              dataPath: 'StockingPointID'
              dataType: 'string'
              index: 1
              subtotals: ''
              width: 150
            }
            column_Customer
            {
              columnId: 'Customer'
              dataPath: 'Customer'
              dataType: 'string'
              index: 2
              subtotals: ''
              width: 150
            }
            column_BusinessType
            {
              columnId: 'BusinessType'
              dataPath: 'BusinessType'
              dataType: 'string'
              index: 3
              subtotals: ''
              width: 150
            }
            column_Quantity
            {
              columnId: 'Quantity'
              dataPath: 'Quantity'
              dataType: 'real'
              index: 4
              subtotals: ''
              width: 150
            }
            column_UnitOfMeasureName
            {
              columnId: 'UnitOfMeasureName'
              dataPath: 'UnitOfMeasureName'
              dataType: 'string'
              index: 5
              subtotals: ''
              width: 150
            }
            column_DemandDate
            {
              columnId: 'DemandDate'
              dataPath: 'DemandDate'
              dataType: 'date'
              index: 6
              subtotals: ''
              width: 150
            }
            column_PriorityResultScore
            {
              columnId: 'PriorityResultScore'
              dataPath: 'PriorityResultScore'
              dataType: 'real'
              index: 7
              subtotals: ''
              width: 150
            }
            column_PriorityPolicyName
            {
              columnId: 'PriorityPolicyName'
              dataPath: 'PriorityPolicyName'
              dataType: 'string'
              index: 8
              subtotals: ''
              width: 150
            }
            column_PriorityFactorName
            {
              columnId: 'PriorityFactorName'
              dataPath: 'PriorityFactorName'
              dataType: 'string'
              index: 9
              subtotals: ''
              width: 150
            }
            column_PriorityFactorGradingName
            {
              columnId: 'PriorityFactorGradingName'
              dataPath: 'PriorityFactorGradingName'
              dataType: 'string'
              index: 10
              subtotals: ''
              width: 150
            }
            column_PriorityTotalScore
            {
              columnId: 'PriorityTotalScore'
              dataPath: 'PriorityTotalScore'
              dataType: 'real'
              index: 11
              subtotals: ''
              width: 150
            }
          }
        }
      }
      form_FormPriorityFactor
      {
        title: 'QTIANMA_JITUAN::FormPriorityFactor'
        shown: true
        componentID: 'QTIANMA_JITUAN::FormPriorityFactor'
        layout
        {
          mode: 'open'
          rowPosition: 37
          rowSpan: 8
          columnPosition: 1
          columnSpan: 4
        }
        components
        {
          FormPriorityFactor_ListPriorityFactor
          {
          }
          FormPriorityFactor_DataSetLevelPriorityFactor
          {
            groupDepth: -1
            column_Name
            {
              columnId: 'Name'
              dataPath: 'Name'
              dataType: 'string'
              index: 0
              subtotals: ''
              width: 150
            }
            column_Coefficient
            {
              columnId: 'Coefficient'
              dataPath: 'Coefficient'
              dataType: 'real'
              index: 1
              subtotals: ''
              width: 150
            }
            column_Desc
            {
              columnId: 'Desc'
              dataPath: 'Desc'
              dataType: 'string'
              index: 2
              subtotals: ''
              width: 150
            }
          }
        }
      }
      form_FormPriorityFactorGrading
      {
        title: 'QTIANMA_JITUAN::FormPriorityFactorGrading'
        shown: true
        componentID: 'QTIANMA_JITUAN::FormPriorityFactorGrading'
        layout
        {
          mode: 'open'
          rowPosition: 32
          rowSpan: 5
          columnPosition: 1
          columnSpan: 4
        }
        components
        {
          FormPriorityFactorGrading_ListPriorityFactorGrading
          {
          }
          FormPriorityFactorGrading_DataSetLevelPriorityFactorGrading
          {
            groupDepth: -1
            column_GradingName
            {
              columnId: 'GradingName'
              dataPath: 'GradingName'
              dataType: 'string'
              index: 0
              subtotals: ''
              width: 150
            }
            column_GradeValueStr
            {
              columnId: 'GradeValueStr'
              dataPath: 'GradeValueStr'
              dataType: 'string'
              index: 1
              subtotals: ''
              width: 150
            }
            column_GradeDesc
            {
              columnId: 'GradeDesc'
              dataPath: 'GradeDesc'
              dataType: 'string'
              index: 2
              subtotals: ''
              width: 150
            }