xiaoding721
2024-11-11 ba839054c67bfd5b456494a1505e104a0d59d630
添加班次计划下发方法
已添加3个文件
已修改2个文件
已删除3个文件
254 ■■■■■ 文件已修改
_Main/BL/EDI/Broker_RB_DispatchShiftPlanBroker.qbl 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Relations/Relation_DispatchShiftPlan_Archive_Archive_DispatchShiftPlan.qbl 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Relations/Relation_DispatchShiftPlan_InterfaceLoginfo_InterfaceLoginfo_DispatchShiftPl.qbl 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftPlan/Attribute_ShiftQty.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftPlan/Attribute_VersionFlag.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftPlan/StaticMethod_Publish.qbl 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/EDI/Broker_RB_DispatchShiftPlanBroker.qbl
ÎļþÒÑɾ³ý
_Main/BL/Relations/Relation_DispatchShiftPlan_Archive_Archive_DispatchShiftPlan.qbl
ÎļþÒÑɾ³ý
_Main/BL/Relations/Relation_DispatchShiftPlan_InterfaceLoginfo_InterfaceLoginfo_DispatchShiftPl.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
Quintiq file version 2.0
#parent: #root
Relation DispatchShiftPlan_InterfaceLoginfo_InterfaceLoginfo_DispatchShiftPlan
{
  #keys: '1[414996.1.203950081]'
  DefaultRelationStrategy
  {
  }
  RelationSide.LeftSide InterfaceLoginfo
  {
    #keys: '3[414996.1.203950083][414996.1.203950082][414996.1.203950084]'
    Cardinality: '0to1'
    ObjectDefinition: DispatchShiftPlan
    OwningSide: 'Reference'
  }
  RelationSide.RightSide DispatchShiftPlan
  {
    #keys: '3[414996.1.203950086][414996.1.203950085][414996.1.203950087]'
    Cardinality: '1toN'
    ObjectDefinition: InterfaceLoginfo
    OwningSide: 'Owned'
  }
}
_Main/BL/Type_DispatchShiftPlan/Attribute_ShiftQty.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute ShiftQty
{
  #keys: '3[414996.1.206760016][414996.1.206760015][414996.1.206760017]'
  ValueType: String
}
_Main/BL/Type_DispatchShiftPlan/Attribute_VersionFlag.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
@@ -1,18 +1,33 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Dispatch (
  InterfaceDataset interfaceDataset,
  const MacroPlan macroPlan,
  Archive owner,
  String versionFlag
  String executor
)
{
  TextBody:
  [*
    // Akari Aug-21-2024 (created)
    // owner.DispatchShiftPlan( relflush );
    // owner.RB_DispatchShiftPlanBroker().Source().FlatQuery( "truncate table A_DispatchShiftPlan" );
    now := DateTime::Now();
    
    dispatchShiftPlans := selectset( owner,DispatchShiftPlan,dispatchShiftPlan,true );
    interfaceLoginfo := maxselect( interfaceDataset,InterfaceLoginfo,loginfo,loginfo.Name() = Translations::InterfaceDataset_ShiftPlanPPPSPush_Name() ,loginfo.InterfaceDateTime() );
    if( not isnull( interfaceLoginfo )){
      if( not interfaceLoginfo.IsShow() ){
        interfaceLoginfo.Delete();
      }else{
        interfaceLoginfo.Last( false );
      }
    }
    interfaceLoginfo := interfaceDataset.InterfaceLoginfo( relnew,
                                                           ExecuteUser := executor,
                                                           Name := Translations::InterfaceDataset_ShiftPlanPPPSPush_Name(),
                                                           InterfaceDateTime := now,
                                                           Last := true,
                                                           Message := '班次计划(PPA+IDS)数据推送' );
    dispatchShiftPlans := selectset( interfaceLoginfo,DispatchShiftPlan,dispatchShiftPlan,true );
    dispatchShiftPlanIndexTree := NamedValueTree::Create();
    for( i := 0 ; i < dispatchShiftPlans.Size() ; i++){
      dispatchShiftPlan := dispatchShiftPlans.Element( i );
@@ -41,21 +56,20 @@
         dispatchShiftPlan := dispatchShiftPlans.Element( dispatchShiftPlanIndex.GetValueAsNumber() );
         dispatchShiftPlan.Tips( shiftPlan.Remark() );
         dispatchShiftPlan.VersionName( macroPlanName );
         dispatchShiftPlan.VersionFlag( versionFlag );
         dispatchShiftPlan.InterfaceTime( now );
       }else{
         owner.DispatchShiftPlan( relnew,ID := OS:: GenerateGUIDAsString(),
                                  ProductLine := productLine,
                                  FactoryName := factory.ID(),
         interfaceLoginfo.DispatchShiftPlan( relnew,ID := OS:: GenerateGUIDAsString(),
                                             ProductLine := productLine,
                                             FactoryName := factory.ID(),
                                             ShiftQty := shiftPlan.Outcome(),
                                  
                                  ShiftDate := shiftDate,
                                  Tips := shiftPlan.Remark(),
                                  VersionName := macroPlanName,
                                  VersionFlag := versionFlag,
                                  InterfaceTime := now );
                                             ShiftDate := shiftDate,
                                             Tips := shiftPlan.Remark(),
                                             VersionName := macroPlanName,
                                             InterfaceTime := now );
       }
    }
    DispatchShiftPlan::Publish( interfaceLoginfo );
    // owner.RB_DispatchShiftPlanBroker().AsyncExecute();
  *]
}
_Main/BL/Type_DispatchShiftPlan/StaticMethod_Publish.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Publish (
  InterfaceLoginfo loginfo
)
{
  TextBody:
  [*
    //// ç”„兰鸽 Jul-17-2024 (created)
    jsonarray          := JSON::Array();
    traverse( loginfo, DispatchShiftPlan, shiftPlan ){
      shiftPlanjson          := JSON::Object()
                                    .Add( "productLine", shiftPlan.ProductLine() )
                                    .Add( "shiftDate", shiftPlan.ShiftDate().Format( 'Y-M2-D2' ) )//"2024-10-01"
                                    .Add( "shiftQty", shiftPlan.ShiftQty() )
                                    .Add( "tips", shiftPlan.Tips() )
                                    .Add( "versionName", shiftPlan.VersionName() )
                                    .Add( "factoryName", shiftPlan.FactoryName() )
                                    .Add( "fac", shiftPlan.Fac() )
                                    .Add( "interfaceTime", shiftPlan.InterfaceTime().Format( 'Y-M2-D2 H:m:s' ) )/*"2024-10-01 12:00:00" )*/
                                    .Build();
      jsonarray.Add( shiftPlanjson );
    }
    loginfo.RequestBody( jsonarray.Build().AsString() );
    info( loginfo.RequestBody() );
    data     := InterfaceLoginfo::CallInterfaceForDataCenter( loginfo.InterfaceDataset(), loginfo );
    info( '----------------', data.AsString() );
  *]
}
_Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl
@@ -21,6 +21,7 @@
    //  OfflinePlanArchiveVersion::RefreshData( this, macroplan, archive );
    }
    if( isshiftplan ){//班次计划
      DispatchShiftPlan::Dispatch(this, macroplan,executor );
    //  CustomerDemandIDS::GenerateData( this, recyclebin, archive );
    }
    if( isassembleonlineplan ){//装配上线计划