陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Quintiq file version 2.0
#parent: #root
Method UpdateValue (
  String attrName,
  Real value
)
{
  TextBody:
  [*
    if ( attrName = "Package" ) { // 包装
      this.Package( value );
    }
    
    if ( attrName = "Unpacking" ) { // 拆包
     this.Unpacking( value );
    }
    
    if ( this.PackagingPlanRow().Factory() = "长春工厂" and ( attrName = "Package" or attrName = "Unpacking" ) ) {
      u := select( this.PackagingPlanRow().MacroPlan(), Unit, tempU, tempU.ID() = "CC " + this.PackagingPlanRow().Category() + " 线边和外租库间" );
      
      t := select( u, Lane.LaneLeg.Trip, tempT, tempT.Departure().Date() = this.PackagingPlanColumn().StartDate() and
                   ifexpr( attrName = "Package", 
                           tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "线边库" ) and tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "外租库" ),
                           tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "外租库" ) and tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "线边库" ) )
                  );
      
      pit := select( t, ProductInTrip, tempPIT, tempPIT.ProductID() = this.PackagingPlanRow().ProductID() );
      
      pit.Update( value, true );
    }
    
    //if ( attrName = "Out" ) { // 调出
    //  unitID := ifexpr( this.PackagingPlanRow().Factory() = "大连工厂", "DL to CC", "CC to DL" ) + " " + this.PackagingPlanRow().Category() + " Transport";
    //  
    //  pit     := select( this.PackagingPlanRow().MacroPlan(), Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT,
    //                     tempPIT.Trip().LaneLeg().Lane().UnitID() = unitID                                 and
    //                     tempPIT.Trip().Departure().Date()        = this.PackagingPlanColumn().StartDate() and
    //                     tempPIT.ProductID()                      = this.PackagingPlanRow().ProductID() );
    //
    //  pit.Update( value, true );
    //  this.Out( value );
    //  
    //  cell := select( this.PackagingPlanRow().MacroPlan(), PackagingPlanRow.PackagingPlanCell, tempPPCell, 
    //                  tempPPCell.PackagingPlanRow().Factory()      = ifexpr( this.PackagingPlanRow().Factory() = "大连工厂", "长春工厂", "大连工厂" ) and
    //                  tempPPCell.PackagingPlanRow().ProductID()    = this.PackagingPlanRow().ProductID()                                              and
    //                  tempPPCell.PackagingPlanColumn().StartDate() = pit.Trip().Arrival().Date() );
    //  cell.TransferIn( value );
    //}
  *]
}