lazhen
2024-08-21 9b3d8a44e8a76928b1abf2f18a74ef5051a4b089
客户需求(PPA+IDS)日志添加
已添加3个文件
已修改2个文件
82 ■■■■ 文件已修改
_Main/BL/Relations/Relation_CustomerDemandPPAIDS_InterfaceLoginfo_InterfaceLoginfo_CustomerDema.qbl 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfaceLoginfo/Attribute_IsShow.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfaceLoginfo/DefaultValue_IsShow.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogCustomerDemandPPAIDS/Method_OnOK.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Relations/Relation_CustomerDemandPPAIDS_InterfaceLoginfo_InterfaceLoginfo_CustomerDema.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
Quintiq file version 2.0
#parent: #root
Relation CustomerDemandPPAIDS_InterfaceLoginfo_InterfaceLoginfo_CustomerDemandPPAIDS
{
  #keys: '1[415136.0.1027064726]'
  DefaultRelationStrategy
  {
  }
  RelationSide.LeftSide InterfaceLoginfo
  {
    #keys: '3[415136.0.1027064728][415136.0.1027064727][415136.0.1027064729]'
    Cardinality: '0to1'
    ObjectDefinition: CustomerDemandPPAIDS
    OwningSide: 'Reference'
  }
  RelationSide.RightSide CustomerDemandPPAIDS
  {
    #keys: '3[415136.0.1027064731][415136.0.1027064730][415136.0.1027064732]'
    Cardinality: '1toN'
    ObjectDefinition: InterfaceLoginfo
    OwningSide: 'Reference'
  }
}
_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl
@@ -3,6 +3,7 @@
StaticMethod GenerateData (
  const MacroPlan macroplan,
  InterfaceDataset interfaceDataset,
  String executor,
  Boolean versionflag
)
{
@@ -10,16 +11,37 @@
  TextBody:
  [*
    // ç”„兰鸽 Aug-20-2024 (created)
    interfaceDataset.CustomerDemandPPAIDS( relflush );
    nowdate                     := DateTime::ActualTime();
    traverse( macroplan, SalesDemand.astype( Forecast ), forecast ){
      interfaceDataset.CustomerDemandPPAIDS( relnew, Product           := forecast.ProductID()
                                             , DemandDate              := forecast.StartDate()
                                             , DemandQty               := [Number]forecast.Quantity()
                                             , VersionName             := macroplan.ScenarioName()
                                             , InterfaceTime           := nowdate
                                             , VersionFlag             := versionflag
                                             );
    cdlast                 := maxobject( interfaceDataset, CustomerDemandPPAIDS, cd, cd.InterfaceTime(), cd.DemandDate(), cd.Product() );
    if( not isnull( cdlast ) ){
      loginfo              := cdlast.InterfaceLoginfo();
      if( not loginfo.IsShow() ){
        loginfo.Delete();
      }else{
        loginfo.Last( false );
      }
      interfaceDataset.CustomerDemandPPAIDS( relflush );
    }
    nowdate                := DateTime::ActualTime();
    loginfo                := interfaceDataset.InterfaceLoginfo( relnew, ExecuteUser := executor
                                                                 , Name := Translations::InterfaceDataset_CustomerDemandPPAIDS_Name()
                                                                 , InterfaceDateTime := DateTime::ActualTime()
                                                                 , Message := '客户需求(PPA+IDS)数据推送'
                                                                 , IsShow := false
                                                                 , Last := true
                                                                 , ReturnSuccess := true
                                                                 , ReturnMsg := 'Success'
                                                                 , Success := true
                                                                  );
    traverse( macroplan, SalesDemand.astype( Forecast ), forecast ){
      cd                  :=interfaceDataset.CustomerDemandPPAIDS( relnew, Product           := forecast.ProductID()
                                                                   , DemandDate              := forecast.StartDate()
                                                                   , DemandQty               := [Number]forecast.Quantity()
                                                                   , VersionName             := macroplan.ScenarioName()
                                                                   , InterfaceTime           := nowdate
                                                                   , VersionFlag             := versionflag
                                                                   );
      loginfo.CustomerDemandPPAIDS( relinsert, cd );
    }
    loginfo.TotalRow( loginfo.CustomerDemandPPAIDS( relsize ) );
  *]
}
_Main/BL/Type_InterfaceLoginfo/Attribute_IsShow.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute IsShow
{
  #keys: '3[415136.0.1027064712][415136.0.1027064711][415136.0.1027064713]'
  Description: '是否显示'
  ValueType: Boolean
}
_Main/BL/Type_InterfaceLoginfo/DefaultValue_IsShow.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
DefaultValue
{
  ISOValue: 'true'
  TargetAttribute: IsShow
}
_Main/UI/MacroPlannerWebApp/Component_DialogCustomerDemandPPAIDS/Method_OnOK.def
@@ -9,7 +9,7 @@
    Form.ApplyChanges();
    
    if( efInterfacename.Text() = Translations::InterfaceDataset_CustomerDemandPPAIDS_Name() ){
      CustomerDemandPPAIDS::GenerateData( MacroPlan, InterfaceDataset, ifexpr( rbgVersionFlag.BoundValue() = "true", true, false ) );
      CustomerDemandPPAIDS::GenerateData( MacroPlan, InterfaceDataset, QuintiqUser::CurrentUser().DisplayName(), ifexpr( rbgVersionFlag.BoundValue() = "true", true, false ) );
    }
    
    Form.Close();