yypsybs
2023-10-18 5fa4a6a06c62fd41731ff6cc1f1f6e031bd7436f
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
Quintiq file version 2.0
#parent: #root
StaticMethod CreateDate1 (
  MacroPlan macroPlan,
  GlobalOTDSOP globalOTDSOP,
  DependentDemand dependentDemand,
  NewSupply newSupply,
  Supply_MP firstNewSupply,
  CapacityAllocationResultsRuleConfiguration capacityAllocationResultsRuleConfiguration,
  Real fulfillmentQuantity
)
{
  TextBody:
  [*
    panelPISP := dependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP();
    info( "产品ID:", panelPISP.ProductID(), "    库存点ID:", panelPISP.StockingPointID() );
    productID := dependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID();
    
    if ( capacityAllocationResultsRuleConfiguration.PanelMaterialCode() = productID ) {
      info( "找到了!!!" );
      globalOTDSOP.CapacityAllocationResults( relnew,
                                              PanelBase             := panelPISP.StockingPointID(),
                                              PanelMaterialCode     := panelPISP.ProductID(),
                                              NumberOfPanels        := fulfillmentQuantity,
                                              PanelMeasurementUnit  := panelPISP.UnitOfMeasure_MP().Name(),
                                              ModuleMaterialCode    := firstNewSupply.ProductInStockingPointInPeriodPlanning().ProductInStockingPoint_MP().ProductID(),
                                              NumberOfModules       := firstNewSupply.Quantity(),
                                              ModuleMeasurementUnit := firstNewSupply.ProductInStockingPointInPeriodPlanning().ProductInStockingPoint_MP().UnitOfMeasureName(),
                                              ModuleBase            := firstNewSupply.ProductInStockingPointInPeriodPlanning().ProductInStockingPoint_MP().StockingPointID(),
                                              RequirementDate       := dependentDemand.Start().Date(),
                                              // 导出外部供应字段
                                              Date                  := dependentDemand.Start().Date(),
                                              Description           := "",
                                              ID                    := OS::GenerateGUIDAsString(),
                                              ProductID             := panelPISP.ProductID(),
                                              StockingPointID       := panelPISP.StockingPointID(),
                                              UserQuantity          := fulfillmentQuantity,
                                              ManufacturedDate      := Date::MinDate()
                                             );
    }
  *]
}