haorenhui
2023-10-30 6d6cc10d9e8e242661da7fd655dec155a09d676c
_Main/UI/MacroPlannerWebApp/Component_FormOrderLock/Response_PanelOrderLockHeader_545_ButtonOrderLockHeaderLock_OnClick.def
@@ -5,14 +5,33 @@
  #keys: '[412960.0.245380616]'
  DefinitionID: 'Responsedef_WebButton_OnClick'
  GroupServerCalls: true
  Precondition:
  [*
    checkorders := DataHolderOrderLockCheckedOrder.Data();
    pispips := construct( ProductInStockingPointInPeriods );
    traverse( checkorders, Elements, order ){
      pispips.Add( selectset( order, ProductInStockingPoint_MP.ProductInStockingPointInPeriod, pispip, true ) );
      }
    return ProductInStockingPointInPeriod::CanLockUnlock( pispips, feedback );
  *]
  QuillAction
  {
    Body:
    [*
      checkorders := DataHolderOrderLockCheckedOrder.Data();
      pispips := construct( ProductInStockingPointInPeriods );
      macroplan := MacroPlan;
      traverse( checkorders, Elements, order ){
        info( order.ProductID() );
        pispips := pispips.Add( selectset( order, ProductInStockingPoint_MP.ProductInStockingPointInPeriod, pispip, pispip.SupplyQuantity() > 0 ) );
        }
      pispipLeafs := selectset( pispips,
                                Elements.astype( ProductInStockingPointInPeriodPlanningLeaf ),
                                pispip,
                                true );
      CustomerOrder::LockUnlock( macroplan, checkorders, true );
      ProductInStockingPointInPeriod::LockUnlockPlanning( pispipLeafs, true, true );
    *]
  }
}