lazhen
2024-11-07 98666fb3add2c1b2529318d1aec463c7360f2be3
Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg
已修改6个文件
已添加1个文件
159 ■■■■ 文件已修改
_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfaceDataset/StaticMethod_PushPlanInventoryData.qbl 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfaceLoginfo/StaticMethod_CallInterfaceForDataCenter_PlanInventory.qbl 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/StaticMethod_GetColumnXML.qbl 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_OfflinePlanComparison/_ROOT_Type_LocalCell_OfflinePlanComparison.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl
@@ -60,17 +60,21 @@
        
        // ç©ºæ–™æž¶æ•°é‡ï¼šã€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()                                       =  ccerr.Generation() and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().MQBMLB()                                           =  ccerr.MLB_MQB()    and
                                 tempPISPIP.Start().Date()                                                                              >= ccerc.StartDate()  and
                                 tempPISPIP.End().Date()                                                                                <= lastDayOfThisMonth,
                                 tempPISPIP.PlannedInventoryLevelEnd() );
                                 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()                                       = ccerr.Generation()        and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().MQBMLB()                                           = ccerr.MLB_MQB()           and
                                 tempPISPIP.Start().Date().Year()                                                                       = ccerc.StartDate().Year()  and
                                 tempPISPIP.Start().Date().Month()                                                                      = ccerc.StartDate().Month(),
                                 tempPISPIP.PlannedInventoryLevelEnd() ) / ( ccerc.StartDate().StartOfNextMonth() - ccerc.StartDate() );
        cell.PackagingCapacity( guard( lce.PackagingCapacity(), 1 ) );
        cell.PlannedInventory( plannedInventory );
        cell.NumberOfEmptyShelves( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - ( plannedInventory / lce.PackagingCapacity() ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ), 0 ) );
        if ( ccerr.Generation() = "350bar" and ccerr.MLB_MQB() = "MQB" ) {
          cell.NumberOfEmptyShelves( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - ( plannedInventory / lce.PackagingCapacity() ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ), 0 ) );
        } else {
          cell.NumberOfEmptyShelves( [Number] guard( cell.TotalQuantityOfMaterialRacks() - ( plannedInventory / lce.PackagingCapacity() ), 0 ) );
        }
        
        // å¤–租库入库费用(发动机销量 / åŒ…装容量[向上取整] * æ–™æž¶å…¥åº“单价)
        engineSales := sum( macroPlan, FSImportData, tempFSID, 
@@ -107,7 +111,11 @@
             
        // å¤–租库仓储费用:【350bar MQB料架总数量 - æ‰€æœ‰350bar MQB总库存 / åŒ…装容量 - å®¢æˆ·åº“料架数量】* é•¿æ˜¥å¤–租库空料架比例*料架仓储单价。发动机库存取Actual inventories里取到长春外租库该发动机的仓储量,料架总数量需要手动维护。
        cell.UnitPriceOfEmptyShelfStorage( lcmr.StoragePrice() );
        cell.RentalWarehouseStorageFees( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - [Number]( plannedInventory / lce.PackagingCapacity() ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ) * lcmr.StoragePrice(), 0 ) );
        if ( ccerr.Generation() = "350bar" and ccerr.MLB_MQB() = "MQB" ) {
          cell.RentalWarehouseStorageFees( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - ceil( plannedInventory / lce.PackagingCapacity() ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ) * lcmr.StoragePrice() * ( ccerc.StartDate().StartOfNextMonth() - ccerc.StartDate() ), 0 ) );
        } else {
          cell.RentalWarehouseStorageFees( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - ceil( plannedInventory / lce.PackagingCapacity() ) ) * lcmr.StoragePrice()* ( ccerc.StartDate().StartOfNextMonth() - ccerc.StartDate() ), 0 ) );
        }
        
        // æ¸…洗费用:发动机入库量 / åŒ…装容量 * æ–™æž¶æ¸…洗单价。发动机入库量取发动机销量,包装容量取自发动机成本表。料架清洗单价取料架成本表。
        cell.CleaningCost( [Number] ( engineProductions / guard( lce.PackagingCapacity(), 1 ) * lcmr.CleanPrice() ) );
_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
@@ -159,19 +159,19 @@
        
        // DL外租库清洗费用:发动机入库量 / åŒ…装容量 * æ–™æž¶æ¸…洗单价。发动机入库量取发动机销量,包装容量取自发动机成本表。料架清洗单价取料架成本表。
        cell.CleaningCost( [Number] ( guard( outboundQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmrDL.CleanPrice(), 1 ) ) );
        // é¢„计总费用
        cell.EstimatedTotalCost( cell.CCStorageFeesForRentedWarehouses() + cell.CCOutboundExpensesForRentedWarehouses() + cell.CCRentalWarehouseStorageFees() + cell.CCLineHaulCost() +
                                 cell.CCShortDistanceTransportationCosts() + cell.DLStorageFeesForRentedWarehouses() + cell.DLOutboundExpensesForRentedWarehouses() +
                                 cell.DLExternalRentalWarehouseTransportationCosts() + cell.DLRentalWarehouseStorageFees() + cell.CleaningCost() );
        // å¤§è¿žå¤–租库料架费用
        cell.DLRentalWarehouseMaterialRackCost( cell.DLStorageFeesForRentedWarehouses() + cell.DLOutboundExpensesForRentedWarehouses() +
                                                cell.DLExternalRentalWarehouseTransportationCosts() );
                                                cell.DLExternalRentalWarehouseTransportationCosts() + cell.DLRentalWarehouseStorageFees() + cell.CleaningCost() );
        
        // CC外租库DL料架费用
        cell.CCExternalRentalWarehouseDLMaterialRackCost( cell.CCStorageFeesForRentedWarehouses() + cell.CCOutboundExpensesForRentedWarehouses() +
                                                          cell.CCRentalWarehouseStorageFees() + cell.CCShortDistanceTransportationCosts() );
                                                          cell.CCShortDistanceTransportationCosts() + cell.CCCleaningCost() );
        // é¢„计总费用
        cell.EstimatedTotalCost( cell.CCStorageFeesForRentedWarehouses() + cell.CCOutboundExpensesForRentedWarehouses() + cell.CCLineHaulCost() + cell.CCCleaningCost() +
                                 cell.CCShortDistanceTransportationCosts() + cell.DLStorageFeesForRentedWarehouses() + cell.DLOutboundExpensesForRentedWarehouses() +
                                 cell.DLExternalRentalWarehouseTransportationCosts() + cell.DLRentalWarehouseStorageFees() + cell.CleaningCost() );
        
        // ç³»æ•°
        cell.Coefficient( 1.05 );
_Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl
@@ -27,7 +27,7 @@
      AssemblyOnlinePlanPPPSPush::GenerateData( this, macroplan, executor );
    }
    if ( isinventoryplan ) { // è®¡åˆ’库存数据
      InterfaceDataset::PushPlanInventoryData( macroplan, this );
      InterfaceDataset::PushPlanInventoryData( macroplan, this, executor );
    }
  *]
}
_Main/BL/Type_InterfaceDataset/StaticMethod_PushPlanInventoryData.qbl
@@ -2,7 +2,8 @@
#parent: #root
StaticMethod PushPlanInventoryData (
  const MacroPlan macroPlan,
  InterfaceDataset interfaceDataset
  InterfaceDataset interfaceDataset,
  String executor
)
{
  Description: '发送计划库存数据接口'
@@ -10,7 +11,8 @@
  [*
    table         := selectobject( interfaceDataset, InventoryPlanArchiveVersion, version, not version.IsShow() );
    
    interfaceTime := DateTime::ActualTime().Format( "Y-M2-D2 h2:m:s" );
    totalRow      := 0;
    interfaceTime := DateTime::ActualTime().Format( "Y-M2-D2 H2:m:s" );
    
    jsonarray     := JSON::Array();
    
@@ -27,19 +29,23 @@
                                   .Add( "fac", ifexpr( r.Unit().Regex( "CC" ), "CC", "DL" ) )
                                   .Add( "interfaceTime", interfaceTime ).Build();
          jsonarray.Add( idsjson );
          totalRow++;
        }
      }
    }
    
    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() );
    //info(  requestbody );
    loginfo := interfaceDataset.InterfaceLoginfo( relnew,
                                                  ExecuteUser       := executor,
                                                  Name              := "Plan inventory data",
                                                  InterfaceDateTime := DateTime::ActualTime(),
                                                  Message           := "计划库存数据",
                                                  RequestBody       := requestbody,
                                                  TotalRow          := totalRow );
    InterfaceLoginfo::CallInterfaceForDataCenter_PlanInventory( interfaceDataset, loginfo );
  *]
}
_Main/BL/Type_InterfaceLoginfo/StaticMethod_CallInterfaceForDataCenter_PlanInventory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CallInterfaceForDataCenter_PlanInventory (
  InterfaceDataset owner,
  InterfaceLoginfo loginfo
)
{
  Description: '调用数据中台接口【计划库存】'
  TextBody:
  [*
    address       := Translations::InterfaceDataset_DataCenter_Address();
    httpinterface := HTTPInterface::Create( address,80 );
    httpinterface.PostMethod( true );
    httpinterface.URL( "/api/plan-stock/saveList" );
    httpinterface.MediaType( Translations::InterfaceDataset_ContentType() );
    httpinterface.AddHeader( "clientId", Translations::InterfaceDataset_DataCenter_ClientId() );
    httpinterface.AddHeader( "clientSecret", Translations::InterfaceDataset_DataCenter_ClientSecret() );
    try {
      httpinterface.Call( loginfo.RequestBody() );
      result := httpinterface.Result();
      loginfo.Response( result );
      loginfo.Success( true );
    } onerror {
      loginfo.ReturnMsg( e.GeneralInformation() );
    }
    // åŽç»­å…¬å…±å¤„理
    loginfo.FinishTime( DateTime::ActualTime() );
    if ( loginfo.Success() ) {
      resultJson := JSON::Parse( loginfo.Response() );
      code       := resultJson.Get( "code" ).GetNumber();
      msg        := resultJson.Get( "message" ).GetString();
      loginfo.ReturnMsg( msg );
      if ( code = 200 ) {
        loginfo.ReturnSuccess( true );
        loginfo.UpdateLast();
      }
    }
  *]
}
_Main/BL/Type_LocalCell_OfflinePlanComparison/StaticMethod_GetColumnXML.qbl
@@ -32,9 +32,9 @@
    }
    if( type = "attribute" ){
    //  columnXML0_1 := "<column><name>Sales Segment</name><type>String</type>";
    //  columnXML0_2 := "<column><name>Generation</name><type>String</type>";
    //  columnXML0_3 := "<column><name>MQB/MLB</name><type>String</type>";
    //  columnXML0_4 := "<column><name>功率</name><type>String</type>";
      columnXML0_2 := "<column><name>Generation</name><type>String</type>";
      columnXML0_3 := "<column><name>MQB/MLB</name><type>String</type>";
      columnXML0_4 := "<column><name>功率</name><type>String</type>";
      
      columnXML1 := "<column><name>Line</name><type>String</type>";
      columnXML2 := "<column><name>Attribute</name><type>String</type>";
@@ -46,16 +46,43 @@
            cellXML := '<cell value="' + cell.LocalRow().Name() + '"/>'
            columnXML1 := columnXML1 + cellXML;
            
            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() + '"/>';
              cellXML0_4 := '<cell value="' + product.Power() + '"/>';
              columnXML0_2 := columnXML0_2 + cellXML0_2;
              columnXML0_3 := columnXML0_3 + cellXML0_3;
              columnXML0_4 := columnXML0_4 + cellXML0_4;
            }else{
              cellXML0_2 := '<cell value="  "/>';
              cellXML0_3 := '<cell value="  "/>';
              cellXML0_4 := '<cell value="  "/>';
              columnXML0_2 := columnXML0_2 + cellXML0_2;
              columnXML0_3 := columnXML0_3 + cellXML0_3;
              columnXML0_4 := columnXML0_4 + cellXML0_4;
            }
            flag := false;
          }else{
            cellXML := '<cell value="  "/>'
            columnXML1 := columnXML1 + cellXML;
    //        cellXML0_1 := '<cell value="  "/>'
    //        columnXML0_1 := columnXML0_1 + cellXML0_1;
            cellXML0_2 := '<cell value="  "/>';
            cellXML0_3 := '<cell value="  "/>';
            cellXML0_4 := '<cell value="  "/>';
            columnXML0_2 := columnXML0_2 + cellXML0_2;
            columnXML0_3 := columnXML0_3 + cellXML0_3;
            columnXML0_4 := columnXML0_4 + cellXML0_4;
          }
          cellXML := '<cell value="' + e + '"/>'
          columnXML2 := columnXML2 + cellXML;
        }
      }
      columnXML := columnXML1 + "</column>" + columnXML2 + "</column>";
      columnXML := columnXML1 + "</column>" + columnXML0_2 + "</column>" + columnXML0_3 + "</column>" + columnXML0_4 + "</column>" + columnXML2 + "</column>";
    }
     
    return columnXML;
_Main/BL/Type_LocalCell_OfflinePlanComparison/_ROOT_Type_LocalCell_OfflinePlanComparison.qbl
@@ -4,7 +4,7 @@
TypeSpecialization LocalCell_OfflinePlanComparison
{
  #keys: '2[412672.1.76654683][412672.1.76654682]'
  Description: '下线计划对比报表'
  Description: '下线计划对比报表_生产计划变更'
  Parent: LocalCell
  StructuredName: 'LocalCell_OfflinePlanComparisons'
}