From 1282ec1b406f0cd04e6e1d0d22b020cb269df0ee Mon Sep 17 00:00:00 2001
From: admin <admin@admin.com>
Date: 星期一, 28 十月 2024 19:05:35 +0800
Subject: [PATCH] 上线计划优化

---
 _Main/BL/Type_NewAssemblyOnlinePlanCell/Attribute_LineLayingOrEmptying.qbl             |    2 +-
 _Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl                   |    6 ++++++
 _Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_SetLineLayingOrEmptyingStatus.qbl |   22 ++++++++++++++++++++++
 3 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/_Main/BL/Type_NewAssemblyOnlinePlanCell/Attribute_LineLayingOrEmptying.qbl b/_Main/BL/Type_NewAssemblyOnlinePlanCell/Attribute_LineLayingOrEmptying.qbl
index 75060ce..4be362b 100644
--- a/_Main/BL/Type_NewAssemblyOnlinePlanCell/Attribute_LineLayingOrEmptying.qbl
+++ b/_Main/BL/Type_NewAssemblyOnlinePlanCell/Attribute_LineLayingOrEmptying.qbl
@@ -3,6 +3,6 @@
 Attribute LineLayingOrEmptying
 {
   #keys: '3[415754.0.554840210][415754.0.554840209][415754.0.554840211]'
-  Description: '閾虹嚎鎴栬�呮帓绌�'
+  Description: '閾虹嚎鎴栬�呮媺绌�'
   ValueType: String
 }
diff --git a/_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl b/_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl
index 7496189..3392f2e 100644
--- a/_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl
+++ b/_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl
@@ -68,6 +68,9 @@
     //  info( "褰撳墠浜х嚎锛�", pl, "    澶勭悊鎷夌┖--------------------------" );
       traverse ( drainPs, Elements, p ) {
         traverse ( p, ExplicitTimeInterval, eti ) {
+          // 璁剧疆鍗曞厓鏍间负鎷夌┖
+          NewAssemblyOnlinePlanCell::SetLineLayingOrEmptyingStatus( macroPlan, eti.Start().Date(), "鎷夌┖", pl );
+          
     //      info( "寮�濮嬫椂闂达細", eti.Start().Format( "Y-M2-D2" ), "    缁撴潫鏃堕棿锛�", eti.End().Format( "Y-M2-D2" ) );
           naopc := select( macroPlan, NewAssemblyOnlinePlanColumn, tempNAOPC, tempNAOPC.StartDate() = ( eti.Start().Date() - 1 ) );
           
@@ -97,6 +100,9 @@
       // 澶勭悊閾虹嚎
       traverse ( lineLyingPs, Elements, p ) {
         traverse ( p, ExplicitTimeInterval, eti ) {
+          // 璁剧疆鍗曞厓鏍间负鎷夌┖
+          NewAssemblyOnlinePlanCell::SetLineLayingOrEmptyingStatus( macroPlan, eti.Start().Date(), "閾虹嚎", pl );
+          
           info( "寮�濮嬫椂闂达細", eti.Start().Format( "Y-M2-D2" ), "    缁撴潫鏃堕棿锛�", eti.End().Format( "Y-M2-D2" ) );
           
           cell  := minselect( macroPlan, NewAssemblyOnlinePlanRow.NewAssemblyOnlinePlanCell, tempNAOPCell, 
diff --git a/_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_SetLineLayingOrEmptyingStatus.qbl b/_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_SetLineLayingOrEmptyingStatus.qbl
new file mode 100644
index 0000000..b4ff60f
--- /dev/null
+++ b/_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_SetLineLayingOrEmptyingStatus.qbl
@@ -0,0 +1,22 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SetLineLayingOrEmptyingStatus (
+  MacroPlan macroPlan,
+  Date date,
+  String status,
+  String pl
+)
+{
+  Description: '璁剧疆鍗曞厓鏍奸摵绾挎垨鑰呮媺绌虹姸鎬�'
+  TextBody:
+  [*
+    cells := selectset( macroPlan, NewAssemblyOnlinePlanRow.NewAssemblyOnlinePlanCell, tempNAOPCell, 
+                        tempNAOPCell.NewAssemblyOnlinePlanRow().ProductionLine() = pl   and 
+                        tempNAOPCell.NewAssemblyOnlinePlanColumn().StartDate()   = date and
+                        tempNAOPCell.NewAssemblyOnlinePlanRow().Type()           = "1" ); 
+    
+    traverse ( cells, Elements, c ) {
+      c.LineLayingOrEmptying( status );
+    }
+  *]
+}

--
Gitblit v1.9.3