From 586d3f703f5dd28c5ab6265338e75028cc8a40af Mon Sep 17 00:00:00 2001
From: admin <admin@admin.com>
Date: 星期三, 28 八月 2024 17:49:15 +0800
Subject: [PATCH] 生产排产计划接口优化

---
 _Main/BL/Type_InterfaceProductionSchedulingPlanPush/Attribute_VersionFlag.qbl                                                                  |   12 ++++++++++++
 _Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuInterface_mInterfaceProductionSchedulingPla.def |    2 +-
 _Main/BL/Type_InterfaceProductionSchedulingPlanPush/Attribute_InterfaceTime.qbl                                                                |    8 ++++++++
 _Main/BL/Type_InterfaceProductionSchedulingPlanPush/StaticMethod_GenerateData.qbl                                                              |   12 +++++++++---
 _Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl                                                                              |    4 ++--
 _Main/BL/Type_OfflinePlanRow/Attribute_Notes.qbl                                                                                               |    7 +++++++
 6 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/_Main/BL/Type_InterfaceProductionSchedulingPlanPush/Attribute_InterfaceTime.qbl b/_Main/BL/Type_InterfaceProductionSchedulingPlanPush/Attribute_InterfaceTime.qbl
new file mode 100644
index 0000000..3ef0aff
--- /dev/null
+++ b/_Main/BL/Type_InterfaceProductionSchedulingPlanPush/Attribute_InterfaceTime.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute InterfaceTime
+{
+  #keys: '3[415754.0.175798548][415754.0.175798547][415754.0.175798549]'
+  Description: '鎺ュ彛鎺ㄩ�佹椂闂�'
+  ValueType: DateTime
+}
diff --git a/_Main/BL/Type_InterfaceProductionSchedulingPlanPush/Attribute_VersionFlag.qbl b/_Main/BL/Type_InterfaceProductionSchedulingPlanPush/Attribute_VersionFlag.qbl
new file mode 100644
index 0000000..69ea598
--- /dev/null
+++ b/_Main/BL/Type_InterfaceProductionSchedulingPlanPush/Attribute_VersionFlag.qbl
@@ -0,0 +1,12 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute VersionFlag
+{
+  #keys: '3[415754.0.176284753][415754.0.176284752][415754.0.176284754]'
+  Description:
+  [*
+    1锛氬彂甯冪増鏈�
+    0锛氭眹鎶ョ増鏈�
+  *]
+  ValueType: Number
+}
diff --git a/_Main/BL/Type_InterfaceProductionSchedulingPlanPush/StaticMethod_GenerateData.qbl b/_Main/BL/Type_InterfaceProductionSchedulingPlanPush/StaticMethod_GenerateData.qbl
index 28ee031..76c27c4 100644
--- a/_Main/BL/Type_InterfaceProductionSchedulingPlanPush/StaticMethod_GenerateData.qbl
+++ b/_Main/BL/Type_InterfaceProductionSchedulingPlanPush/StaticMethod_GenerateData.qbl
@@ -2,12 +2,16 @@
 #parent: #root
 StaticMethod GenerateData (
   MacroPlan macroPlan,
-  InterfaceDataset interfaceDataset
+  InterfaceDataset interfaceDataset,
+  Number versionFlag
 )
 {
   TextBody:
   [*
-    interfaceDataset.InterfaceProductionSchedulingPlanPush( relflush );
+    ipspps := selectset( interfaceDataset, InterfaceProductionSchedulingPlanPush, tempIPSPP, tempIPSPP.VersionFlag() = versionFlag );
+    MacroPlan::DeleteObjects( ipspps );
+    
+    actualDateTime := DateTime::ActualTime();
     
     traverse ( macroPlan, Product_MP.ProductInStockingPoint_MP, pispmp, not pispmp.IsSystem() and pispmp.IsLeaf() and ( pispmp.StockingPointID() = "DL-MoMo" or pispmp.StockingPointID() = "CC-MoMo" ) ) {
       info( pispmp.Name() );
@@ -18,7 +22,9 @@
                                                                 PlanningQty  := [Number]pispippl.NewSupplyQuantity(),
                                                                 VersionName  := macroPlan.ScenarioName(),
                                                                 FactoryName  := ifexpr( pispmp.StockingPointID().Regex( "澶ц繛" ) or pispmp.StockingPointID().Regex( "DL" ), "澶ц繛宸ュ巶", "闀挎槬宸ュ巶" ),
-                                                                Fac          := ifexpr( pispmp.StockingPointID().Regex( "澶ц繛" ) or pispmp.StockingPointID().Regex( "DL" ), "DL", "CC" )
+                                                                Fac          := ifexpr( pispmp.StockingPointID().Regex( "澶ц繛" ) or pispmp.StockingPointID().Regex( "DL" ), "DL", "CC" ),
+                                                                InterfaceTime     := actualDateTime,
+                                                                VersionFlag       := versionFlag
                                                                );
       } 
     }
diff --git a/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl b/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
index fd28df5..0e5721d 100644
--- a/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
+++ b/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
@@ -21,7 +21,7 @@
           oprQuantity := select( opt, OfflinePlanRow, tempOPR, tempOPR.ProductionLine() = u.ID() and tempOPR.ProductID() = ns.AsProductionSupply().ProductInStockingPoint_MP().ProductID() and tempOPR.Type() = "1" );
           oprOrder    := select( opt, OfflinePlanRow, tempOPR, tempOPR.ProductionLine() = u.ID() and tempOPR.ProductID() = ns.AsProductionSupply().ProductInStockingPoint_MP().ProductID() and tempOPR.Type() = "2" );
           if ( isnull( oprQuantity ) and isnull( oprOrder ) ) {
-            oprQuantity := opt.OfflinePlanRow( relnew, ProductionLine := u.ID(), ProductID := ns.AsProductionSupply().ProductInStockingPoint_MP().ProductID(), Type := "1" );
+            oprQuantity := opt.OfflinePlanRow( relnew, ProductionLine := u.ID(), ProductID := ns.AsProductionSupply().ProductInStockingPoint_MP().ProductID(), Type := "1", Notes := ns.AsProductionSupply().ProductInStockingPoint_MP().Product_MP().Notes() );
             oprOrder    := opt.OfflinePlanRow( relnew, ProductionLine := u.ID(), ProductID := ns.AsProductionSupply().ProductInStockingPoint_MP().ProductID(), Type := "2" );
           }
           
@@ -59,7 +59,7 @@
         productLineCell := productOPC.OfflinePlanCell( relnew, Value := opr.ProductionLine() );
         productLineCell.OfflinePlanRow( relset, opr );
       } else if( opr.Type() = "1" ) {
-        productCell := productOPC.OfflinePlanCell( relnew, Value := opr.ProductID() );
+        productCell := productOPC.OfflinePlanCell( relnew, Value := opr.ProductID() + ifexpr( opr.Notes() = "", "", "-" + opr.Notes() ) );
         productCell.OfflinePlanRow( relset, opr );
         typeCell    := typeOPC.OfflinePlanCell( relnew, Value :=  "Quantity" );
         typeCell.OfflinePlanRow( relset, opr );
diff --git a/_Main/BL/Type_OfflinePlanRow/Attribute_Notes.qbl b/_Main/BL/Type_OfflinePlanRow/Attribute_Notes.qbl
new file mode 100644
index 0000000..b3d7f68
--- /dev/null
+++ b/_Main/BL/Type_OfflinePlanRow/Attribute_Notes.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Notes
+{
+  #keys: '3[415754.0.180041713][415754.0.180041712][415754.0.180041714]'
+  ValueType: String
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuInterface_mInterfaceProductionSchedulingPla.def b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuInterface_mInterfaceProductionSchedulingPla.def
index dd980dc..a702496 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuInterface_mInterfaceProductionSchedulingPla.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuInterface_mInterfaceProductionSchedulingPla.def
@@ -13,7 +13,7 @@
   {
     Body:
     [*
-      InterfaceProductionSchedulingPlanPush::GenerateData( MacroPlan, InterfaceDataset );
+      InterfaceProductionSchedulingPlanPush::GenerateData( MacroPlan, InterfaceDataset, Number::Random( 0, 1 ) );
       
       WebMessageBox::Success( "鎺ㄩ�佹垚鍔燂紒" );
     *]

--
Gitblit v1.9.3