lazhen
2024-11-11 b3976ea2e22df28a4225377c1bf3f6fc1b27ec72
Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg
已添加3个文件
已修改4个文件
已删除3个文件
261 ■■■■■ 文件已修改
_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_DL_EngineRackCell/StaticMethod_CreateData.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | 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 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftPlan/StaticMethod_Publish.qbl 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl 13 ●●●● 补丁 | 查看 | 原始文档 | 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_DL_EngineRackCell/StaticMethod_CreateData.qbl
@@ -201,6 +201,9 @@
      cell.DLExternalRentalWarehouseTransportationCosts( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.DLExternalRentalWarehouseTransportationCosts() ) );
      cell.DLRentalWarehouseStorageFees( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.DLRentalWarehouseStorageFees() ) );
      cell.CleaningCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CleaningCost() ) );
      cell.CCCleaningCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CCCleaningCost() ) ); // CC外租库清洗费用
      cell.DLRentalWarehouseMaterialRackCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.DLRentalWarehouseMaterialRackCost() ) ); // å¤§è¿žå¤–租库料架费用
      cell.CCExternalRentalWarehouseDLMaterialRackCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CCExternalRentalWarehouseDLMaterialRackCost() ) ); // CC外租库DL料架费用
      cell.EstimatedTotalCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.EstimatedTotalCost() ) );
      cell.Coefficient( 1.05 );
      cell.TotalCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.TotalCost() ) );
@@ -224,6 +227,9 @@
      cell.DLExternalRentalWarehouseTransportationCosts( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.DLExternalRentalWarehouseTransportationCosts() ) );    
      cell.DLRentalWarehouseStorageFees( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.DLRentalWarehouseStorageFees() ) );    
      cell.CleaningCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CleaningCost() ) );    
      cell.CCCleaningCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CCCleaningCost() ) ); // CC外租库清洗费用
      cell.DLRentalWarehouseMaterialRackCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.DLRentalWarehouseMaterialRackCost() ) ); // å¤§è¿žå¤–租库料架费用
      cell.CCExternalRentalWarehouseDLMaterialRackCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CCExternalRentalWarehouseDLMaterialRackCost() ) ); // CC外租库DL料架费用
      cell.EstimatedTotalCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.EstimatedTotalCost() ) );    
      cell.Coefficient( 1.05 );
      cell.TotalCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.TotalCost() ) );                        
_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(),
         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 );
       }
    }
    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 ){//装配上线计划
_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl
@@ -26,7 +26,9 @@
    }
    
    // åˆ›å»ºå•元格
    traverse ( macroPlan, MachineLogisticsCostReportRow, mlcrr ) { // å¾ªçŽ¯è¡Œ
    traverse ( macroPlan, MachineLogisticsCostReportRow, mlcrr
    //           , mlcrr.Factory() = "长春工厂"
              ) { // å¾ªçŽ¯è¡Œ
      info( "当前遍历的行:", mlcrr.Factory(), " ", mlcrr.Category() );
      traverse ( macroPlan, MachineLogisticsCostReportColumn, mlcrc ) { // å¾ªçŽ¯åˆ—
      
@@ -39,6 +41,12 @@
                        tempLCT.Product()     = mlcrr.Category()                                                                                                                         and
                        tempLCT.Origin()      = ifexpr( mlcrr.Category() = "AGW", "DL AGW", ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "外租库" )     and
                        tempLCT.Destination() = ifexpr( mlcrr.Category() = "AGW", "CC AGW库房", ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "线边库" ) );
        // è¿è¾“成本参数(调拨费用)
        lct1  := select( macroPlan, LogisticsCostTransport, tempLCT,
                         tempLCT.Product()     = mlcrr.Category()                                                                                                                         and
                         tempLCT.Origin()      = ifexpr( mlcrr.Category() = "AGW", "DL AGW", ifexpr( mlcrr.Factory() = "大连工厂", "CC", "DL" ) + " " + mlcrr.Category() )                and
                         tempLCT.Destination() = ifexpr( mlcrr.Category() = "AGW", "CC AGW库房", ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "外租库" ) );
    
         // å½“前月末最后一天日期
        lastDayOfThisMonth := mlcrc.StartDate().StartOfNextMonth() - 1;
@@ -76,7 +84,8 @@
                                 guard( tempTPC.TransferPlanColumn().ColumnDate().Year()   = mlcrc.StartDate().Year(), false )                              and
                                 guard(  tempTPC.TransferPlanColumn().ColumnDate().Month() = mlcrc.StartDate().Month(), false ),
                                 [Number]tempTPC.Value() );
        cell.TransferCost( [Number] ( [Number] ( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) ) / guard( lct.LoadingCapacity(), 1 ) ) * guard( lct.TransportPrice(), 1 ) );
    //    info( "调拨数量:", transferQuantity, "    åŒ…装容量:", guard( lcm.PackagingCapacity(), 1 ), "    è£…载容量:", guard( lct1.LoadingCapacity(), 1 ), "    è¿è¾“单价:",guard( lct1.TransportPrice(), 1 )  );
        cell.TransferCost( [Number] ( ceil( ceil( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) ) / guard( lct1.LoadingCapacity(), 1 ) ) * guard( lct1.TransportPrice(), 1 ) ) );
    
        // å¤–租库入库费用(入库量[包装量] / åŒ…装容量 * å…¥åº“单价)
        cell.StorageFeesForRentedWarehouses( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) );