xiaoding721
2024-11-25 d729cf0951344771245befd9ae8b0b97d133c7f7
班次计划下发添加保养班次剔除
已添加2个文件
已修改2个文件
95 ■■■■■ 文件已修改
_Main/BL/Type_DispatchShiftSchedulingInformation/Attribute_Remark.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalTool/StaticMethod_IsAnyDurationContained.qbl 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ShiftPlan/StaticMethod_CalculateRemark.qbl 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftSchedulingInformation/Attribute_Remark.qbl
对比新文件
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute Remark
{
  #keys: '3[414996.1.248479382][414996.1.248479381][414996.1.248479383]'
  ValueType: String
}
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
@@ -41,6 +41,7 @@
    traverse( offlinePlan,NewOfflinePlanRow,row ,not row.ProductionLine().ToUpper().LikeUserLocale( "MOMO" )){
      line := null( DispatchShiftSchedulingLine );
      factory := constnull( Unit );
      unit := constnull( Unit );
      {
        unitHandle := unitIndexTree.GetHandle( row.ProductionLine() );
        unitIndex := guard( unitIndexTree.Root().Child( unitHandle ), null( NamedValue ));
@@ -52,12 +53,16 @@
      
      traverse( row,NewOfflinePlanCell,cell, startDate <= cell.NewOfflinePlanColumn().StartDate() and endDate >= cell.NewOfflinePlanColumn().EndDate()){
        product := null( DispatchShiftSchedulingProduct );
        remark := "";
        if( not isnull( unit )){
          remark := ShiftPlan::CalculateRemark( unit,cell.NewOfflinePlanColumn().StartDate(),cell.NewOfflinePlanColumn().EndDate() );
        }
        {
          lineKey := row.ProductionLine() + cell.NewOfflinePlanColumn().StartDate().AsQUILL();
          lineHandle := lineIndexTree.GetHandle( lineKey );
          lineIndex := guard( lineIndexTree.Root().Child( lineHandle ),null( NamedValue ));
          if( isnull( lineIndex )){
            line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewOfflinePlanColumn().StartDate() );
            line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewOfflinePlanColumn().StartDate(),Remark := remark );
            line.FactoryName( factory.Name() );
            line.InterfaceTime( now );
            line.VersionName( macroPlan.MDSMacroPlan().Description() );
@@ -85,6 +90,7 @@
    traverse( macroPlan,NewAssemblyOnlinePlanRow,row , row.ProductionLine().ToUpper().LikeUserLocale( "MOMO" )){
      line := null( DispatchShiftSchedulingLine );
      factory := constnull( Unit );
      unit := constnull( Unit );
      {
        unitHandle := unitIndexTree.GetHandle( row.ProductionLine() );
        unitIndex := guard( unitIndexTree.Root().Child( unitHandle ), null( NamedValue ));
@@ -102,12 +108,16 @@
      
      traverse( row,NewAssemblyOnlinePlanCell,cell, startDate <= cell.NewAssemblyOnlinePlanColumn().StartDate() and endDate >= cell.NewAssemblyOnlinePlanColumn().EndDate()){
        product := null( DispatchShiftSchedulingProduct );
        remark := "";
        if( not isnull( unit )){
          remark := ShiftPlan::CalculateRemark( unit,cell.NewAssemblyOnlinePlanColumn().StartDate(),cell.NewAssemblyOnlinePlanColumn().EndDate() );
        }
        {
          lineKey := row.ProductionLine() + cell.NewAssemblyOnlinePlanColumn().StartDate().AsQUILL();
          lineHandle := lineIndexTree.GetHandle( lineKey );
          lineIndex := guard( lineIndexTree.Root().Child( lineHandle ),null( NamedValue ));
          if( isnull( lineIndex )){
            line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewAssemblyOnlinePlanColumn().StartDate() );
            line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewAssemblyOnlinePlanColumn().StartDate(),Remark := remark );
            line.FactoryName( factory.Name() );
            line.InterfaceTime( now );
            line.VersionName( macroPlan.MDSMacroPlan().Description() );
@@ -141,9 +151,21 @@
      tempProducts := selectsortedset( line,DispatchShiftSchedulingProduct,object,object.ProductionQuantity() );
      
      if( line.ShiftName() = "3" ){
        singleShiftVolume1 := lineQuantity / 3;
        singleShiftVolume2 := lineQuantity / 3;
        singleShiftVolume3 := lineQuantity / 3;
        singleShiftVolume1 := 0.0;
        singleShiftVolume2 := 0.0;
        singleShiftVolume3 := 0.0;
        if( line.Remark().LikeUserLocale( "淇濆吇" )){
          singleShiftVolume1 := 0.0;
          singleShiftVolume2 := lineQuantity / 2;
          singleShiftVolume3 := lineQuantity / 2;
        }else{
          singleShiftVolume1 := lineQuantity / 3;
          singleShiftVolume2 := lineQuantity / 3;
          singleShiftVolume3 := lineQuantity / 3;
        }
        for( i := tempProducts.Size() - 1;i >= 0; i-- ){
          product := tempProducts.Element( i );
          productionQuantity := product.ProductionQuantity();
@@ -168,8 +190,16 @@
        
      }else if( line.ShiftName() = "2" ){    
        // 240.5
        singleShiftVolume1 := lineQuantity / 2;
        singleShiftVolume2 := lineQuantity / 2;
        singleShiftVolume1 := 0.0;
        singleShiftVolume2 := 0.0;
        if( line.Remark().LikeUserLocale( "淇濆吇" )){
          singleShiftVolume1 := 0.0;
          singleShiftVolume2 := lineQuantity;
        }else{
          singleShiftVolume1 := lineQuantity / 2;
          singleShiftVolume2 := lineQuantity / 2;
        }
        for( i := tempProducts.Size() - 1;i >= 0; i-- ){
          product := tempProducts.Element( i );
          // 288
@@ -192,6 +222,13 @@
        
      }else if( line.ShiftName() = "1" ){
        singleShiftVolume1 := lineQuantity / 1;
        if( line.Remark().LikeUserLocale( "淇濆吇" )){
          singleShiftVolume1 := lineQuantity / 1;
        }else{
          singleShiftVolume1 := lineQuantity / 1;
        }
        for( i := tempProducts.Size() - 1;i >= 0; i-- ){
          product := tempProducts.Element( i );
          productionQuantity := product.ProductionQuantity();
_Main/BL/Type_LocalTool/StaticMethod_IsAnyDurationContained.qbl
@@ -10,6 +10,8 @@
  TextBody:
  [*
    // rislai Jun-19-2024 (created)
    return ( start1 <= start2 and end1 >= end2 ) or ( start2 <= start1 and end2 >= end1 );
    //return ( start1 <= start2 and end1 >= end2 ) or ( start2 <= start1 and end2 >= end1 );
    return not (end1 < start2 or end2 < start1)
  *]
}
_Main/BL/Type_ShiftPlan/StaticMethod_CalculateRemark.qbl
对比新文件
@@ -0,0 +1,33 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CalculateRemark (
  const Unit unit,
  Date startDate,
  Date endDate
) as String
{
  TextBody:
  [*
    // Akari Nov-25-2024 (created)
    values := construct( Strings );
    traverse( unit.UnitCalendar(),Participation,participation,participation.Event().Type() = LibCal_Event::TYPE_UNAVAILABLE()){
        event := participation.Event();
        if( startDate >= event.EarliestStart() and endDate <= event.LatestEnd() ){
          intervals := selectset( event,LeadingParticipation.ExplicitTimeInterval,interval,LocalTool::IsAnyDurationContained( interval.Start(),interval.End(),startDate.DateTime(),endDate.DateTime() ));
          traverse( intervals,Elements,interval){
            values.Add( interval.Participation().Event().Subject() );
          }
        }
    }
    values := selectuniquevalues( values,Elements,value,true,value );
    result := "";
    traverse( values,Elements,value ){
      result := result + value + ";";
    }
    return ifexpr( result = "",result,result.SubString( 0,result.Length() - 1 ) );
  *]
}