renhao
2023-10-18 4f426fd0938d68df759fff7570ad6ec2e62bac96
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,
  GlobalOTDTable globalOTDTable,
  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( "找到了!!!" );
      globalOTDTable.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()
                                               );
    }
  *]
}