lazhen
2024-11-07 90a740cc4096e26c0669deced09b8d51e7dcdee5
Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg
已修改11个文件
已添加1个文件
131 ■■■■■ 文件已修改
_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfaceDataset/StaticMethod_PushPlanInventoryData.qbl 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetColumnXML.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_Form701/Response_pMQBMLB_653_dhMQBMLB_OnCreated.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_Form701/Response_pPower_969_dhPowers_OnCreated.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormAnnualPlanReport/Response_pMQBMLB_dhMQBMLB_OnCreated.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormAnnualPlanReport/Response_pPower_dhPowers_OnCreated.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pMQBMLB_653_dhMQBMLB_OnCreated.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pPower_969_dhPowers_OnCreated.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanComparison/Response_pMQBMLB_653_dhMQBMLB_OnCreated.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanComparison/Response_pPower_969_dhPowers_OnCreated.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
@@ -12,8 +12,8 @@
    // åˆ›å»ºè¡Œ
    genrations := selectuniquevalues( macroPlan, Product_MP, tempPMP, tempPMP.Generation().TrimBoth() <> "", tempPMP.Generation() );
    mqbmlbs    := selectuniquevalues( macroPlan, Product_MP, tempPMP, tempPMP.MQBMLB().TrimBoth() <> "", tempPMP.MQBMLB() );
    traverse ( genrations, Elements, g ) {
      traverse ( mqbmlbs, Elements, m ) {
    traverse ( genrations, Elements, g, g = "350bar" ) {
      traverse ( mqbmlbs, Elements, m, m = "MQB" ) {
        macroPlan.DL_EngineRackRow( relnew, Generation := g, MLB_MQB := m );
      }
    }
@@ -67,13 +67,13 @@
        // å¤§è¿žå¤–租库空料架数量:【350bar MQB料架总数量 - æ‰€æœ‰350bar MQB总库存 / åŒ…装容量 - å®¢æˆ·åº“料架数量】* å¤§è¿žå¤–租库空料架比例
        plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().IsLeaf()                                                                       and
                                 exists( tempPISPIP.ProductInStockingPoint_MP().Product_MP(), AllParent.AsParent, tempPMP, tempPMP.ID() =  "发动机" )               and
                                 tempPISPIP.ProductInStockingPoint_MP().StockingPointID()                                               =  "大连发动机的长春外租库" and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().Generation()                                       =  dlerr.Generation()       and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().MQBMLB()                                           =  dlerr.MLB_MQB()          and
                                 tempPISPIP.Start().Date()                                                                              >= dlerc.StartDate()        and
                                 tempPISPIP.End().Date()                                                                                <= lastDayOfThisMonth,
                                 tempPISPIP.PlannedInventoryLevelEnd() ) / ( lastDayOfThisMonth - dlerc.StartDate() );
                                 exists( tempPISPIP.ProductInStockingPoint_MP().Product_MP(), AllParent.AsParent, tempPMP, tempPMP.ID() = "发动机" )                and
                                 //tempPISPIP.ProductInStockingPoint_MP().StockingPointID()                                             = "大连发动机的长春外租库"  and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().Generation()                                       = dlerr.Generation()        and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().MQBMLB()                                           = dlerr.MLB_MQB()           and
                                 tempPISPIP.Start().Date().Year()                                                                       = dlerc.StartDate().Year()  and
                                 tempPISPIP.Start().Date().Month()                                                                      = dlerc.StartDate().Month(),
                                 tempPISPIP.PlannedInventoryLevelEnd() ) / ( dlerc.StartDate().StartOfNextMonth() - dlerc.StartDate() );
        cell.PackagingCapacity( guard( lce.PackagingCapacity(), 1 ) );
        cell.PlannedInventory( plannedInventory );
        cell.NumberOfEmptyShelves( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - guard( cell.PlannedInventory() / cell.PackagingCapacity(), 0 ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ), 0 ) );
@@ -107,7 +107,7 @@
                                        tempPIT.Quantity()
                                       );
    //    info( "数量:", transportationQuantity2 );
        cell.CCLineHaulCost( [Number] ( guard( transportationQuantity2 / lce.PackagingCapacity() / lct1.LoadingCapacity(), 0 ) * guard( lct1.TransportPrice(), 1 ) ) );
        cell.CCLineHaulCost( [Number] ( guard( ceil( ceil( transportationQuantity2 / lce.PackagingCapacity() ) / lct1.LoadingCapacity() ), 0 ) * guard( lct1.TransportPrice(), 1 ) ) );
        
        // CC短途运输费用:调拨数量 / åŒ…装容量 / è£…载容量 * æ–™æž¶è¿è¾“单价
        cell.CCShortDistanceTransportationCosts( [Number] ( guard( transportationQuantity1 / lce.PackagingCapacity() / lct3.LoadingCapacity(), 0 ) * guard( lct3.TransportPrice(), 1 ) ) )
@@ -120,8 +120,9 @@
                                  tempF.StartDate()                       >= ( dlerc.StartDate() - 2 )  and
                                  tempF.StartDate()                       <= ( lastDayOfThisMonth - 2 ),
                                  tempF.FulfilledQuantity() );
    //                   info( "时间:", dlerc.StartDate().Format( "Y-M2-D2" ), "    å…¥åº“数量:", inventoryQuantity, "    åŒ…装容量:", guard( lce.PackagingCapacity(), 0 ),
    //                         "    å…¥åº“单价:", guard( lcmr.WarehousingPrice(), 0 ) ); // æµ‹è¯•输出
    //                   info( "时间:", dlerc.StartDate().Format( "Y-M2-D2" ), "  æ—¶é—´åŒºåŸŸï¼š", ( dlerc.StartDate() - 2 ).Format( "Y-M2-D2" ), "    ", ( lastDayOfThisMonth - 2 ).Format( "Y-M2-D2" ),
    //                         "    å…¥åº“数量:", inventoryQuantity, "    åŒ…装容量:", guard( lce.PackagingCapacity(), 0 ),
    //                         "    å…¥åº“单价:", guard( lcmrDL.WarehousingPrice(), 0 ) ); // æµ‹è¯•输出
        cell.DLStorageFeesForRentedWarehouses( [Number] ( guard( inventoryQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmrDL.WarehousingPrice(), 1 ) ) );
        
        // DL外租库出库费用:发动机出库量 / æ–™æž¶å®¹é‡ï¼ˆå‘上取整)* æ–™æž¶å‡ºåº“单价
@@ -132,42 +133,29 @@
                                 tempPISPIPPL.Start().Date()                                        >= dlerc.StartDate()  and
                                 tempPISPIPPL.End().Date()                                          <= lastDayOfThisMonth,
                                 tempPISPIPPL.NewSupplyQuantity() );
    //    info( "数量:", outboundQuantity, "    åŒ…装融创:", guard( lce.PackagingCapacity(), 0 ), "    å‡ºåº“单价:", guard( lcmr.OutboundPrice(), 0 ) );
    //    info( "数量:", outboundQuantity, "    åŒ…装容量:", guard( lce.PackagingCapacity(), 0 ), "    å‡ºåº“单价:", guard( lcmr.OutboundPrice(), 0 ) );
        cell.DLOutboundExpensesForRentedWarehouses( [Number] ( guard( outboundQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmrDL.OutboundPrice(), 1 ) ) );
        
        // DL外租库运输费用:发动机运输量 / åŒ…装容量 / è£…载容量(向上取整)* æ–™æž¶è¿è¾“单价
        outboundQuantity1 := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), tempPISPIPPL,
                                 tempPISPIPPL.ProductInStockingPoint_MP().Product_MP().Generation() = dlerr.Generation()  and
                                 tempPISPIPPL.ProductInStockingPoint_MP().Product_MP().MQBMLB()     = dlerr.MLB_MQB()     and
                                 tempPISPIPPL.ProductInStockingPoint_MP().StockingPointID()         = "大连外租库"        and
                                 tempPISPIPPL.Start().Date()                                        >= dlerc.StartDate()  and
                                 tempPISPIPPL.End().Date()                                          <= lastDayOfThisMonth,
                                 tempPISPIPPL.ProductInStockingPoint_MP().Product_MP().Generation() = dlerr.Generation()        and
                                 tempPISPIPPL.ProductInStockingPoint_MP().Product_MP().MQBMLB()     = dlerr.MLB_MQB()           and
                                 tempPISPIPPL.ProductInStockingPoint_MP().StockingPointID()         = "大连外租库"              and
                                 tempPISPIPPL.Start().Date().Year()                                 = dlerc.StartDate().Year()  and
                                 tempPISPIPPL.Start().Date().Month()                                = dlerc.StartDate().Month(),
                                 tempPISPIPPL.NewSupplyQuantity() );
        cell.DLExternalRentalWarehouseTransportationCosts( [Number] ( guard( outboundQuantity1 / lce.PackagingCapacity() / lct2.LoadingCapacity(), 0 ) * guard( lct2.TransportPrice(), 1 ) ) );
    //    info( "数量:", outboundQuantity1, "    åŒ…装容量:", guard( lce.PackagingCapacity(), 0 ), "    è£…载容量:", guard( lct2.LoadingCapacity(), 0 ), "    è¿è¾“单价:", guard( lct2.TransportPrice(), 1 ) );
        cell.DLExternalRentalWarehouseTransportationCosts( [Number] ( guard( ceil( ceil( outboundQuantity1 / lce.PackagingCapacity() ) / lct2.LoadingCapacity() ), 0 ) * guard( lct2.TransportPrice(), 1 ) ) );
        
        // å¤§è¿žå¤–租库仓储费用:【350bar MQB料架总数量-所有350bar MQB总库存/包装容量-客户库料架数量】*大连外租库空料架比例
        // DL外租库仓储费用:料架总数量 - å‘动机库存 / åŒ…装容量(向上取整)* ç©ºæ–™æž¶ä»“储单价
        plannedInventory1 := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
                                  tempPISPIP.ProductInStockingPoint_MP().Product_MP().IsLeaf()                                                                       and
                                  exists( tempPISPIP.ProductInStockingPoint_MP().Product_MP(), AllParent.AsParent, tempPMP, tempPMP.ID() =  "发动机" )               and
                                  tempPISPIP.ProductInStockingPoint_MP().StockingPointID()                                               =  "大连外租库"             and
                                  tempPISPIP.ProductInStockingPoint_MP().Product_MP().Generation()                                       =  dlerr.Generation()       and
                                  tempPISPIP.ProductInStockingPoint_MP().Product_MP().MQBMLB()                                           =  dlerr.MLB_MQB()          and
                                  tempPISPIP.Start().Date()                                                                              >= dlerc.StartDate()        and
                                  tempPISPIP.End().Date()                                                                                <= lastDayOfThisMonth,
                                  tempPISPIP.PlannedInventoryLevelEnd() );
        cell.DLRentalWarehouseStorageFees( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - guard( plannedInventory1  / lce.PackagingCapacity(), 0 ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ) * guard( lcmrDL.StoragePrice(), 1 ), 0 ) );
    //    info( "空料架数量:", cell.TotalQuantityOfMaterialRacks(), "    åº“存:", cell.PlannedInventory(), "    å¤©æ•°ï¼š", dlerc.StartDate().StartOfNextMonth() - dlerc.StartDate(),
    //          "    åŒ…装容量:", guard( lce.PackagingCapacity(), 0 ) );
        cell.DLRentalWarehouseStorageFees( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - ceil( guard( cell.PlannedInventory() / lce.PackagingCapacity(), 0 ) ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ) * guard( lcmrDL.StoragePrice(), 1 ) * ( dlerc.StartDate().StartOfNextMonth() - dlerc.StartDate() ), 0 ) );
        
        // CC外租库清洗费用:发动机入库量 / åŒ…装容量 * æ–™æž¶æ¸…洗单价。发动机入库量取发动机销量,包装容量取自发动机成本表。料架清洗单价取料架成本表。
        clearnQuantity := sum( macroPlan, SalesDemand.astype( Forecast ), tempF,
                               tempF.Product_MP().Generation()         =  dlerr.Generation()       and
                               tempF.Product_MP().MQBMLB()             =  dlerr.MLB_MQB()          and
                               tempF.StockingPointID()                 =  "大连发动机的长春外租库" and
                               tempF.StartDate().Year()                = dlerc.StartDate().Year()  and
                               tempF.StartDate().Month()               = dlerc.StartDate().Month(),
                               tempF.Quantity() );
    //    info( "数量:", clearnQuantity, "    åŒ…装容量:", guard( lce.PackagingCapacity(), 0 ), "    æ¸…洗单价:", guard( lcmr.CleanPrice(), 0 ) );
        cell.CCCleaningCost( [Number] ( guard( clearnQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmrCC.CleanPrice(), 1 ) ) );
    //    info( "数量:", transportationQuantity1, "    åŒ…装容量:", guard( lce.PackagingCapacity(), 0 ), "    æ¸…洗单价:", guard( lcmrCC.CleanPrice(), 0 ) );
        cell.CCCleaningCost( [Number] ( guard( transportationQuantity1 / lce.PackagingCapacity(), 0 ) * guard( lcmrCC.CleanPrice(), 1 ) ) );
        
        // DL外租库清洗费用:发动机入库量 / åŒ…装容量 * æ–™æž¶æ¸…洗单价。发动机入库量取发动机销量,包装容量取自发动机成本表。料架清洗单价取料架成本表。
        cell.CleaningCost( [Number] ( guard( outboundQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmrDL.CleanPrice(), 1 ) ) );
_Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl
@@ -26,8 +26,8 @@
    if( isassembleonlineplan ){//装配上线计划
      AssemblyOnlinePlanPPPSPush::GenerateData( this, macroplan, executor );
    }
    if( isinventoryplan ){//库存计划
    //  CustomerDemandIDS::GenerateData( this, recyclebin, archive );
    if ( isinventoryplan ) { // è®¡åˆ’库存数据
      InterfaceDataset::PushPlanInventoryData( macroplan, this );
    }
  *]
}
_Main/BL/Type_InterfaceDataset/StaticMethod_PushPlanInventoryData.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
Quintiq file version 2.0
#parent: #root
StaticMethod PushPlanInventoryData (
  const MacroPlan macroPlan,
  InterfaceDataset interfaceDataset
)
{
  Description: '发送计划库存数据接口'
  TextBody:
  [*
    table         := selectobject( interfaceDataset, InventoryPlanArchiveVersion, version, not version.IsShow() );
    interfaceTime := DateTime::ActualTime().Format( "Y-M2-D2 h2:m:s" );
    jsonarray     := JSON::Array();
    traverse ( table, Row, r ){
      traverse ( table, Column, c, c.TimeUnit() = Translations::MP_GlobalParameters_Day() ) {
        cell := select( r, Cell, tempC, tempC.Column() = c );
        if ( not isnull( cell ) ) {
          idsjson := JSON::Object().Add( "product", r.ProductID() )
                                   .Add( "inventoryDate", c.StartDate().Format( 'Y-M2-D2' ) )
                                   .Add( "planningInventory", cell.PlanQuantity() )
                                   .Add( "versionName", macroPlan.ScenarioName() )
                                   .Add( "factoryName", ifexpr( r.Unit().Regex( "CC" ), "长春工厂", "大连工厂" ) )
                                   .Add( "fac", ifexpr( r.Unit().Regex( "CC" ), "CC", "DL" ) )
                                   .Add( "interfaceTime", interfaceTime ).Build();
          jsonarray.Add( idsjson );
        }
      }
    }
    requestbody := jsonarray.Build().AsString();
    info(  requestbody );
    //loginfo := owner.InterfaceLoginfo( relnew, ExecuteUser := executor
    //                                   , Name := Translations::InterfaceDataset_CustomerDemandPPAIDS_Name()
    //                                   , InterfaceDateTime := DateTime::ActualTime()
    //                                   , Message := '客户需求(PPA+IDS)'
    //                                   , RequestBody := requestbody);
    ////error( '--------------------', requestbody );
    //data     := InterfaceLoginfo::CallInterfaceForDataCenter( owner, loginfo );
    //info( '----------------', data.AsString() );
  *]
}
_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_GetColumnXML.qbl
@@ -55,7 +55,7 @@
              columnXML0_1 := columnXML0_1 + cellXML0_1;
            }
            
            product := select( macroPlan,Product_MP,product,product.ID() = cell.LocalRow().Name() );
            product := select( macroPlan,Product_MP,product,product.ID() = cell.LocalRow().ProductID() );
            if( not isnull( product )){
              cellXML0_2 := '<cell value="' + product.Generation() + '"/>';
              cellXML0_3 := '<cell value="' + product.MQBMLB() + '"/>';
_Main/UI/MacroPlannerWebApp/Component_Form701/Response_pMQBMLB_653_dhMQBMLB_OnCreated.def
@@ -9,7 +9,7 @@
  {
    Body:
    [*
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"generation" );
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"mqbmlb" );
      this.Data( &generations );
    *]
    GroupServerCalls: false
_Main/UI/MacroPlannerWebApp/Component_Form701/Response_pPower_969_dhPowers_OnCreated.def
@@ -9,7 +9,7 @@
  {
    Body:
    [*
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"generation" );
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"power" );
      this.Data( &generations );
    *]
    GroupServerCalls: false
_Main/UI/MacroPlannerWebApp/Component_FormAnnualPlanReport/Response_pMQBMLB_dhMQBMLB_OnCreated.def
@@ -9,7 +9,7 @@
  {
    Body:
    [*
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"generation" );
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"mqbmlb" );
      this.Data( &generations );
    *]
    GroupServerCalls: false
_Main/UI/MacroPlannerWebApp/Component_FormAnnualPlanReport/Response_pPower_dhPowers_OnCreated.def
@@ -9,7 +9,7 @@
  {
    Body:
    [*
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"generation" );
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"power" );
      this.Data( &generations );
    *]
    GroupServerCalls: false
_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pMQBMLB_653_dhMQBMLB_OnCreated.def
@@ -9,7 +9,7 @@
  {
    Body:
    [*
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"generation" );
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"mqbmlb" );
      this.Data( &generations );
    *]
    GroupServerCalls: false
_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_pPower_969_dhPowers_OnCreated.def
@@ -9,7 +9,7 @@
  {
    Body:
    [*
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"generation" );
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"power" );
      this.Data( &generations );
    *]
    GroupServerCalls: false
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanComparison/Response_pMQBMLB_653_dhMQBMLB_OnCreated.def
@@ -9,7 +9,7 @@
  {
    Body:
    [*
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"generation" );
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"mqbmlb" );
      this.Data( &generations );
    *]
    GroupServerCalls: false
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanComparison/Response_pPower_969_dhPowers_OnCreated.def
@@ -9,7 +9,7 @@
  {
    Body:
    [*
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"generation" );
      generations := LocalValue::CreateProduct_MPAttribute( RecycleBin,MacroPlan,"power" );
      this.Data( &generations );
    *]
    GroupServerCalls: false