From d89732b82ff7fc047628ca3772311a0fbeea3553 Mon Sep 17 00:00:00 2001
From: zongzhibin <zongzhibin@weben-smart.com>
Date: 周日, 24 11月 2024 14:19:14 +0800
Subject: [PATCH] add

---
 CC/iWareSql/DataAccess/TaskHandler.cs                                                |   15 
 CC/iWareCC_ASRS/Common/SystemWarningMsg.cs                                           |    5 
 SDA/iWareSda/Devices/4-Station/StationService/StationService.cs                      |   60 +++
 SDA/iWareSda/Devices/4-Station/StationService/IStationService.cs                     |   19 +
 CC/iWareCommon/Utils/Log4Net/LogType.cs                                              |    6 
 CC/iWareCC_ASRS/FormCC.cs                                                            |    4 
 SDA/iWareSda/Common/Struct/WareSdaStruct.cs                                          |    3 
 SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs                            |  115 +++++++
 CC/iWareCC_ASRS/Connected Services/StationService/StationService.wsdl                |   38 ++
 CC/iWareCC_ASRS/Connected Services/StationService/item2.xsd                          |   46 ++
 SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs                   |   38 ++
 LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Entity/WmsTask/WmsRbLineRunMode.cs |   10 
 CC/iWareCC_ASRS/ThreadService/03_BZ12(机器人码包工位)/DataProcess_BZ12_FinishTask.cs        |   12 
 CC/iWareSql/WmsDBModel/wms_rbline_runmode.cs                                         |   10 
 CC/iWareCC_ASRS/Connected Services/StationService/item3.xsd                          |   11 
 CC/iWareCC_ASRS/ThreadService/03_BZ12(机器人码包工位)/DataProcess_BZ12.cs                   |  181 +++++++++++
 CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs                       |  204 ++++++++++++
 SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs                         |  146 +++++++++
 CC/iWareCC_ASRS/iWareCC.csproj                                                       |    5 
 SDA/iWareSda/Model/StationLocationEnum.cs                                            |    6 
 20 files changed, 924 insertions(+), 10 deletions(-)

diff --git a/CC/iWareCC_ASRS/Common/SystemWarningMsg.cs b/CC/iWareCC_ASRS/Common/SystemWarningMsg.cs
index fa60209..2121757 100644
--- a/CC/iWareCC_ASRS/Common/SystemWarningMsg.cs
+++ b/CC/iWareCC_ASRS/Common/SystemWarningMsg.cs
@@ -118,7 +118,10 @@
         /// 鑷姩缁勭洏浠诲姟 鐨勮鍛婃秷鎭�
         /// </summary>
         public static string _lbl_alert_DataProcess_BZ39 = string.Empty;
-
+        /// <summary>
+        /// 鑷姩鐮佹澘浠诲姟 鐨勮鍛婃秷鎭�
+        /// </summary>
+        public static string _lbl_alert_DataProcess_BZ12 = string.Empty;
 
         /// <summary>
         /// 鑷姩缁勭洏浠诲姟涓嬪彂 鐨勮鍛婃秷鎭�
diff --git a/CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs b/CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs
index 5a6b0be..4c79d93 100644
--- a/CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs
+++ b/CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs
@@ -215,6 +215,18 @@
         private short R_Outbound_TaskIDField;
         
         [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private bool R_PalletizingFinishField;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private short R_PalletizingStation1Field;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private short R_PalletizingStation2Field;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private short R_PalletizingTaskNoField;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
         private string R_ReadCodeResultField;
         
         [System.Runtime.Serialization.OptionalFieldAttribute()]
@@ -386,6 +398,58 @@
         }
         
         [System.Runtime.Serialization.DataMemberAttribute()]
+        public bool R_PalletizingFinish {
+            get {
+                return this.R_PalletizingFinishField;
+            }
+            set {
+                if ((this.R_PalletizingFinishField.Equals(value) != true)) {
+                    this.R_PalletizingFinishField = value;
+                    this.RaisePropertyChanged("R_PalletizingFinish");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
+        public short R_PalletizingStation1 {
+            get {
+                return this.R_PalletizingStation1Field;
+            }
+            set {
+                if ((this.R_PalletizingStation1Field.Equals(value) != true)) {
+                    this.R_PalletizingStation1Field = value;
+                    this.RaisePropertyChanged("R_PalletizingStation1");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
+        public short R_PalletizingStation2 {
+            get {
+                return this.R_PalletizingStation2Field;
+            }
+            set {
+                if ((this.R_PalletizingStation2Field.Equals(value) != true)) {
+                    this.R_PalletizingStation2Field = value;
+                    this.RaisePropertyChanged("R_PalletizingStation2");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
+        public short R_PalletizingTaskNo {
+            get {
+                return this.R_PalletizingTaskNoField;
+            }
+            set {
+                if ((this.R_PalletizingTaskNoField.Equals(value) != true)) {
+                    this.R_PalletizingTaskNoField = value;
+                    this.RaisePropertyChanged("R_PalletizingTaskNo");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
         public string R_ReadCodeResult {
             get {
                 return this.R_ReadCodeResultField;
@@ -501,6 +565,9 @@
         private string W_Destination_OutField;
         
         [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private bool W_EndMarkField;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
         private short W_HeightField;
         
         [System.Runtime.Serialization.OptionalFieldAttribute()]
@@ -531,7 +598,25 @@
         private string W_PackageWidthField;
         
         [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private short W_PalletizingPlaceXField;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private short W_PalletizingPlaceYField;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private short W_PalletizingStationField;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private bool W_PalletizingTaskFinishField;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private short W_PalletizingTaskIDField;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
         private bool W_ReqOutField;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private short W_RotateField;
         
         [System.Runtime.Serialization.OptionalFieldAttribute()]
         private short W_WidthField;
@@ -626,6 +711,19 @@
                 if ((object.ReferenceEquals(this.W_Destination_OutField, value) != true)) {
                     this.W_Destination_OutField = value;
                     this.RaisePropertyChanged("W_Destination_Out");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
+        public bool W_EndMark {
+            get {
+                return this.W_EndMarkField;
+            }
+            set {
+                if ((this.W_EndMarkField.Equals(value) != true)) {
+                    this.W_EndMarkField = value;
+                    this.RaisePropertyChanged("W_EndMark");
                 }
             }
         }
@@ -761,6 +859,71 @@
         }
         
         [System.Runtime.Serialization.DataMemberAttribute()]
+        public short W_PalletizingPlaceX {
+            get {
+                return this.W_PalletizingPlaceXField;
+            }
+            set {
+                if ((this.W_PalletizingPlaceXField.Equals(value) != true)) {
+                    this.W_PalletizingPlaceXField = value;
+                    this.RaisePropertyChanged("W_PalletizingPlaceX");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
+        public short W_PalletizingPlaceY {
+            get {
+                return this.W_PalletizingPlaceYField;
+            }
+            set {
+                if ((this.W_PalletizingPlaceYField.Equals(value) != true)) {
+                    this.W_PalletizingPlaceYField = value;
+                    this.RaisePropertyChanged("W_PalletizingPlaceY");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
+        public short W_PalletizingStation {
+            get {
+                return this.W_PalletizingStationField;
+            }
+            set {
+                if ((this.W_PalletizingStationField.Equals(value) != true)) {
+                    this.W_PalletizingStationField = value;
+                    this.RaisePropertyChanged("W_PalletizingStation");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
+        public bool W_PalletizingTaskFinish {
+            get {
+                return this.W_PalletizingTaskFinishField;
+            }
+            set {
+                if ((this.W_PalletizingTaskFinishField.Equals(value) != true)) {
+                    this.W_PalletizingTaskFinishField = value;
+                    this.RaisePropertyChanged("W_PalletizingTaskFinish");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
+        public short W_PalletizingTaskID {
+            get {
+                return this.W_PalletizingTaskIDField;
+            }
+            set {
+                if ((this.W_PalletizingTaskIDField.Equals(value) != true)) {
+                    this.W_PalletizingTaskIDField = value;
+                    this.RaisePropertyChanged("W_PalletizingTaskID");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
         public bool W_ReqOut {
             get {
                 return this.W_ReqOutField;
@@ -769,6 +932,19 @@
                 if ((this.W_ReqOutField.Equals(value) != true)) {
                     this.W_ReqOutField = value;
                     this.RaisePropertyChanged("W_ReqOut");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
+        public short W_Rotate {
+            get {
+                return this.W_RotateField;
+            }
+            set {
+                if ((this.W_RotateField.Equals(value) != true)) {
+                    this.W_RotateField = value;
+                    this.RaisePropertyChanged("W_Rotate");
                 }
             }
         }
@@ -1523,6 +1699,18 @@
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStationService/WriteOutStoreTaskInfo", ReplyAction="http://tempuri.org/IStationService/WriteOutStoreTaskInfoResponse")]
         System.Threading.Tasks.Task<iWareCC.StationService.SdaResEntity> WriteOutStoreTaskInfoAsync(int deviceId, string stationCode, string sourcePlaceNo, int outbound_TaskID);
         
+        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStationService/WritePalletizingTaskInfo", ReplyAction="http://tempuri.org/IStationService/WritePalletizingTaskInfoResponse")]
+        iWareCC.StationService.SdaResEntity WritePalletizingTaskInfo(int deviceId, string stationCode, int taskID, bool isLast, short length, short width, short height, short rotate, short toplace, short placeX, short placeY);
+        
+        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStationService/WritePalletizingTaskInfo", ReplyAction="http://tempuri.org/IStationService/WritePalletizingTaskInfoResponse")]
+        System.Threading.Tasks.Task<iWareCC.StationService.SdaResEntity> WritePalletizingTaskInfoAsync(int deviceId, string stationCode, int taskID, bool isLast, short length, short width, short height, short rotate, short toplace, short placeX, short placeY);
+        
+        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStationService/SetPalletizingTaskFinishAck", ReplyAction="http://tempuri.org/IStationService/SetPalletizingTaskFinishAckResponse")]
+        iWareCC.StationService.SdaResEntity SetPalletizingTaskFinishAck(int deviceId, bool value, string stationCode);
+        
+        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStationService/SetPalletizingTaskFinishAck", ReplyAction="http://tempuri.org/IStationService/SetPalletizingTaskFinishAckResponse")]
+        System.Threading.Tasks.Task<iWareCC.StationService.SdaResEntity> SetPalletizingTaskFinishAckAsync(int deviceId, bool value, string stationCode);
+        
         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStationService/WriteStation_FinishACK", ReplyAction="http://tempuri.org/IStationService/WriteStation_FinishACKResponse")]
         iWareCC.StationService.SdaResEntity WriteStation_FinishACK(int deviceId, bool value, int plcTaskId);
         
@@ -1681,6 +1869,22 @@
             return base.Channel.WriteOutStoreTaskInfoAsync(deviceId, stationCode, sourcePlaceNo, outbound_TaskID);
         }
         
+        public iWareCC.StationService.SdaResEntity WritePalletizingTaskInfo(int deviceId, string stationCode, int taskID, bool isLast, short length, short width, short height, short rotate, short toplace, short placeX, short placeY) {
+            return base.Channel.WritePalletizingTaskInfo(deviceId, stationCode, taskID, isLast, length, width, height, rotate, toplace, placeX, placeY);
+        }
+        
+        public System.Threading.Tasks.Task<iWareCC.StationService.SdaResEntity> WritePalletizingTaskInfoAsync(int deviceId, string stationCode, int taskID, bool isLast, short length, short width, short height, short rotate, short toplace, short placeX, short placeY) {
+            return base.Channel.WritePalletizingTaskInfoAsync(deviceId, stationCode, taskID, isLast, length, width, height, rotate, toplace, placeX, placeY);
+        }
+        
+        public iWareCC.StationService.SdaResEntity SetPalletizingTaskFinishAck(int deviceId, bool value, string stationCode) {
+            return base.Channel.SetPalletizingTaskFinishAck(deviceId, value, stationCode);
+        }
+        
+        public System.Threading.Tasks.Task<iWareCC.StationService.SdaResEntity> SetPalletizingTaskFinishAckAsync(int deviceId, bool value, string stationCode) {
+            return base.Channel.SetPalletizingTaskFinishAckAsync(deviceId, value, stationCode);
+        }
+        
         public iWareCC.StationService.SdaResEntity WriteStation_FinishACK(int deviceId, bool value, int plcTaskId) {
             return base.Channel.WriteStation_FinishACK(deviceId, value, plcTaskId);
         }
diff --git a/CC/iWareCC_ASRS/Connected Services/StationService/StationService.wsdl b/CC/iWareCC_ASRS/Connected Services/StationService/StationService.wsdl
index b205f97..3b9e7fb 100644
--- a/CC/iWareCC_ASRS/Connected Services/StationService/StationService.wsdl
+++ b/CC/iWareCC_ASRS/Connected Services/StationService/StationService.wsdl
@@ -93,6 +93,18 @@
   <wsdl:message name="IStationService_WriteOutStoreTaskInfo_OutputMessage">
     <wsdl:part name="parameters" element="tns:WriteOutStoreTaskInfoResponse" />
   </wsdl:message>
+  <wsdl:message name="IStationService_WritePalletizingTaskInfo_InputMessage">
+    <wsdl:part name="parameters" element="tns:WritePalletizingTaskInfo" />
+  </wsdl:message>
+  <wsdl:message name="IStationService_WritePalletizingTaskInfo_OutputMessage">
+    <wsdl:part name="parameters" element="tns:WritePalletizingTaskInfoResponse" />
+  </wsdl:message>
+  <wsdl:message name="IStationService_SetPalletizingTaskFinishAck_InputMessage">
+    <wsdl:part name="parameters" element="tns:SetPalletizingTaskFinishAck" />
+  </wsdl:message>
+  <wsdl:message name="IStationService_SetPalletizingTaskFinishAck_OutputMessage">
+    <wsdl:part name="parameters" element="tns:SetPalletizingTaskFinishAckResponse" />
+  </wsdl:message>
   <wsdl:message name="IStationService_WriteStation_FinishACK_InputMessage">
     <wsdl:part name="parameters" element="tns:WriteStation_FinishACK" />
   </wsdl:message>
@@ -167,6 +179,14 @@
     <wsdl:operation name="WriteOutStoreTaskInfo">
       <wsdl:input wsaw:Action="http://tempuri.org/IStationService/WriteOutStoreTaskInfo" message="tns:IStationService_WriteOutStoreTaskInfo_InputMessage" />
       <wsdl:output wsaw:Action="http://tempuri.org/IStationService/WriteOutStoreTaskInfoResponse" message="tns:IStationService_WriteOutStoreTaskInfo_OutputMessage" />
+    </wsdl:operation>
+    <wsdl:operation name="WritePalletizingTaskInfo">
+      <wsdl:input wsaw:Action="http://tempuri.org/IStationService/WritePalletizingTaskInfo" message="tns:IStationService_WritePalletizingTaskInfo_InputMessage" />
+      <wsdl:output wsaw:Action="http://tempuri.org/IStationService/WritePalletizingTaskInfoResponse" message="tns:IStationService_WritePalletizingTaskInfo_OutputMessage" />
+    </wsdl:operation>
+    <wsdl:operation name="SetPalletizingTaskFinishAck">
+      <wsdl:input wsaw:Action="http://tempuri.org/IStationService/SetPalletizingTaskFinishAck" message="tns:IStationService_SetPalletizingTaskFinishAck_InputMessage" />
+      <wsdl:output wsaw:Action="http://tempuri.org/IStationService/SetPalletizingTaskFinishAckResponse" message="tns:IStationService_SetPalletizingTaskFinishAck_OutputMessage" />
     </wsdl:operation>
     <wsdl:operation name="WriteStation_FinishACK">
       <wsdl:input wsaw:Action="http://tempuri.org/IStationService/WriteStation_FinishACK" message="tns:IStationService_WriteStation_FinishACK_InputMessage" />
@@ -309,6 +329,24 @@
         <soap:body use="literal" />
       </wsdl:output>
     </wsdl:operation>
+    <wsdl:operation name="WritePalletizingTaskInfo">
+      <soap:operation soapAction="http://tempuri.org/IStationService/WritePalletizingTaskInfo" style="document" />
+      <wsdl:input>
+        <soap:body use="literal" />
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal" />
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="SetPalletizingTaskFinishAck">
+      <soap:operation soapAction="http://tempuri.org/IStationService/SetPalletizingTaskFinishAck" style="document" />
+      <wsdl:input>
+        <soap:body use="literal" />
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal" />
+      </wsdl:output>
+    </wsdl:operation>
     <wsdl:operation name="WriteStation_FinishACK">
       <soap:operation soapAction="http://tempuri.org/IStationService/WriteStation_FinishACK" style="document" />
       <wsdl:input>
diff --git a/CC/iWareCC_ASRS/Connected Services/StationService/item2.xsd b/CC/iWareCC_ASRS/Connected Services/StationService/item2.xsd
index 8da0c43..b096074 100644
--- a/CC/iWareCC_ASRS/Connected Services/StationService/item2.xsd
+++ b/CC/iWareCC_ASRS/Connected Services/StationService/item2.xsd
@@ -224,6 +224,46 @@
       </xs:sequence>
     </xs:complexType>
   </xs:element>
+  <xs:element name="WritePalletizingTaskInfo">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="deviceId" type="xs:int" />
+        <xs:element minOccurs="0" name="stationCode" nillable="true" type="xs:string" />
+        <xs:element minOccurs="0" name="taskID" type="xs:int" />
+        <xs:element minOccurs="0" name="isLast" type="xs:boolean" />
+        <xs:element minOccurs="0" name="length" type="xs:short" />
+        <xs:element minOccurs="0" name="width" type="xs:short" />
+        <xs:element minOccurs="0" name="height" type="xs:short" />
+        <xs:element minOccurs="0" name="rotate" type="xs:short" />
+        <xs:element minOccurs="0" name="toplace" type="xs:short" />
+        <xs:element minOccurs="0" name="placeX" type="xs:short" />
+        <xs:element minOccurs="0" name="placeY" type="xs:short" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="WritePalletizingTaskInfoResponse">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element xmlns:q15="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WritePalletizingTaskInfoResult" nillable="true" type="q15:SdaResEntity" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="SetPalletizingTaskFinishAck">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="deviceId" type="xs:int" />
+        <xs:element minOccurs="0" name="value" type="xs:boolean" />
+        <xs:element minOccurs="0" name="stationCode" nillable="true" type="xs:string" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="SetPalletizingTaskFinishAckResponse">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element xmlns:q16="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="SetPalletizingTaskFinishAckResult" nillable="true" type="q16:SdaResEntity" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
   <xs:element name="WriteStation_FinishACK">
     <xs:complexType>
       <xs:sequence>
@@ -236,7 +276,7 @@
   <xs:element name="WriteStation_FinishACKResponse">
     <xs:complexType>
       <xs:sequence>
-        <xs:element xmlns:q15="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteStation_FinishACKResult" nillable="true" type="q15:SdaResEntity" />
+        <xs:element xmlns:q17="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteStation_FinishACKResult" nillable="true" type="q17:SdaResEntity" />
       </xs:sequence>
     </xs:complexType>
   </xs:element>
@@ -254,7 +294,7 @@
   <xs:element name="WriteScanValidateACKResponse">
     <xs:complexType>
       <xs:sequence>
-        <xs:element xmlns:q16="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteScanValidateACKResult" nillable="true" type="q16:SdaResEntity" />
+        <xs:element xmlns:q18="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteScanValidateACKResult" nillable="true" type="q18:SdaResEntity" />
       </xs:sequence>
     </xs:complexType>
   </xs:element>
@@ -272,7 +312,7 @@
   <xs:element name="WriteStation_XigangGetDataForOutResponse">
     <xs:complexType>
       <xs:sequence>
-        <xs:element xmlns:q17="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteStation_XigangGetDataForOutResult" nillable="true" type="q17:SdaResEntity" />
+        <xs:element xmlns:q19="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteStation_XigangGetDataForOutResult" nillable="true" type="q19:SdaResEntity" />
       </xs:sequence>
     </xs:complexType>
   </xs:element>
diff --git a/CC/iWareCC_ASRS/Connected Services/StationService/item3.xsd b/CC/iWareCC_ASRS/Connected Services/StationService/item3.xsd
index 6a02b02..ca24714 100644
--- a/CC/iWareCC_ASRS/Connected Services/StationService/item3.xsd
+++ b/CC/iWareCC_ASRS/Connected Services/StationService/item3.xsd
@@ -19,6 +19,10 @@
       <xs:element minOccurs="0" name="R_OutboundFinish" type="xs:boolean" />
       <xs:element minOccurs="0" name="R_OutboundNumber" nillable="true" type="xs:string" />
       <xs:element minOccurs="0" name="R_Outbound_TaskID" type="xs:short" />
+      <xs:element minOccurs="0" name="R_PalletizingFinish" type="xs:boolean" />
+      <xs:element minOccurs="0" name="R_PalletizingStation1" type="xs:short" />
+      <xs:element minOccurs="0" name="R_PalletizingStation2" type="xs:short" />
+      <xs:element minOccurs="0" name="R_PalletizingTaskNo" type="xs:short" />
       <xs:element minOccurs="0" name="R_ReadCodeResult" nillable="true" type="xs:string" />
       <xs:element minOccurs="0" name="R_ReqParseData" type="xs:boolean" />
       <xs:element minOccurs="0" name="R_Shape" type="xs:short" />
@@ -42,6 +46,7 @@
       <xs:element minOccurs="0" name="W_DataFinish" type="xs:boolean" />
       <xs:element minOccurs="0" name="W_Destination_In" type="xs:int" />
       <xs:element minOccurs="0" name="W_Destination_Out" nillable="true" type="xs:string" />
+      <xs:element minOccurs="0" name="W_EndMark" type="xs:boolean" />
       <xs:element minOccurs="0" name="W_Height" type="xs:short" />
       <xs:element minOccurs="0" name="W_InboundFinishConfirm" type="xs:boolean" />
       <xs:element minOccurs="0" name="W_Inbound_TaskID" type="xs:int" />
@@ -52,7 +57,13 @@
       <xs:element minOccurs="0" name="W_Outbound_TaskID" type="xs:int" />
       <xs:element minOccurs="0" name="W_PackageLength" nillable="true" type="xs:string" />
       <xs:element minOccurs="0" name="W_PackageWidth" nillable="true" type="xs:string" />
+      <xs:element minOccurs="0" name="W_PalletizingPlaceX" type="xs:short" />
+      <xs:element minOccurs="0" name="W_PalletizingPlaceY" type="xs:short" />
+      <xs:element minOccurs="0" name="W_PalletizingStation" type="xs:short" />
+      <xs:element minOccurs="0" name="W_PalletizingTaskFinish" type="xs:boolean" />
+      <xs:element minOccurs="0" name="W_PalletizingTaskID" type="xs:short" />
       <xs:element minOccurs="0" name="W_ReqOut" type="xs:boolean" />
+      <xs:element minOccurs="0" name="W_Rotate" type="xs:short" />
       <xs:element minOccurs="0" name="W_Width" type="xs:short" />
       <xs:element minOccurs="0" name="W_X_Offset" nillable="true" type="xs:string" />
       <xs:element minOccurs="0" name="W_Y_Offset" nillable="true" type="xs:string" />
diff --git a/CC/iWareCC_ASRS/FormCC.cs b/CC/iWareCC_ASRS/FormCC.cs
index dae98d6..6d5a151 100644
--- a/CC/iWareCC_ASRS/FormCC.cs
+++ b/CC/iWareCC_ASRS/FormCC.cs
@@ -5,6 +5,7 @@
 using iWareCC.SrmService;
 using iWareCC.StationService;
 using iWareCC.ThreadService;
+using iWareCC.ThreadService._03_BZ12_鏈哄櫒浜虹爜鍖呭伐浣峗;
 using iWareCC.WCF;
 using iWareCommon.Common.Globle;
 using iWareCommon.Utils;
@@ -231,10 +232,11 @@
 
             //閲嶆柊鑾峰彇鍙戝姩鏈轰俊鎭�
             new Thread(DataProcess_269.Handler).Start();
-
+            
             //1014搴撲綅杞繍鍒�1020绾跨▼
             new Thread(DataProcess_BZ39.Handler).Start();
 
+            new Thread(DataProcess_BZ12.Hander).Start();
 
             new Thread(DeleteData).Start();
 
diff --git "a/CC/iWareCC_ASRS/ThreadService/03_BZ12\050\346\234\272\345\231\250\344\272\272\347\240\201\345\214\205\345\267\245\344\275\215\051/DataProcess_BZ12.cs" "b/CC/iWareCC_ASRS/ThreadService/03_BZ12\050\346\234\272\345\231\250\344\272\272\347\240\201\345\214\205\345\267\245\344\275\215\051/DataProcess_BZ12.cs"
new file mode 100644
index 0000000..0d53e87
--- /dev/null
+++ "b/CC/iWareCC_ASRS/ThreadService/03_BZ12\050\346\234\272\345\231\250\344\272\272\347\240\201\345\214\205\345\267\245\344\275\215\051/DataProcess_BZ12.cs"
@@ -0,0 +1,181 @@
+锘縰sing Admin.NET.Application;
+using iWareCC.StationService;
+using iWareCommon.Common.Globle;
+using iWareCommon.Utils;
+using iWareModel;
+using iWareSql.DataAccess;
+using iWareSql.WmsDBModel;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace iWareCC.ThreadService._03_BZ12_鏈哄櫒浜虹爜鍖呭伐浣峗
+{
+    public class DataProcess_BZ12
+    {
+        public static void Hander()
+        {
+            var alertMsg = "";
+            LogType logType = LogType.DataProcess_BZ12;
+            while (true)
+            {
+                Thread.Sleep(2000);//浼戠湢2绉掞紝灏嗕紤鐪犲啓鍒板墠闈紝鏄负浜嗕笅闈㈢殑continue鏂规硶鎵ц鍚庝笉鏄剧ず閿欒淇℃伅鐨勬彁绀猴紒锛侊紒銆怑ditBy shaocx,2022-05-24銆�
+                SystemWarningMsg._lbl_alert_DataProcess_BZ12 = string.Empty;
+                try
+                {
+                    if (SystemValue.isAllowRuning_DataProcess_BZ39 && SystemValue.isStartedModel)
+                    {
+                        var rgvLocation = StationLocationEnum.BZ12.ToString();
+                        /*
+                         * 1銆佷粠鏁版嵁搴撲腑鍒ゆ柇鏄惁榻愬
+                         * 2銆佹牴鎹綈濂楃粨鏋滐紝鎺ㄩ�佺粰PLC
+                         */
+                        var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault();
+                        if (obj.R_ReqParseData)
+                        {
+                            var result = obj.R_ReadCodeResult;
+                            if (string.IsNullOrEmpty(result))
+                            {
+                                SystemWarningMsg._lbl_alert_DataProcess_BZ39 = $"{rgvLocation.ToString()}-璇锋眰浜嗚В鐮侊紝浣嗘槸缁撴灉鏄┖鐨�,姝ゆ寰幆缁撴潫";
+                                continue;
+                            }
+                            var upiCode = result;
+                            bool islast = false;//鏄惁鏈澘
+                            short isrotate = 0;//鏄惁鏃嬭浆
+                            short placeX = 0;
+                            short placeY = 0;
+                            string place = "";
+                            using (WmsDBModel wmsDB = new WmsDBModel())
+                            {
+                                //瑕佹槸鏈夊凡涓嬪彂鐨勪换鍔★紝灏变笉瑕佹墽琛�
+                                var isValidate = TaskHandler.ValidateIssueTaskForBZ12(wmsDB);
+                                if (!isValidate)
+                                {
+                                    SystemWarningMsg._lbl_alert_DataProcess_BZ12 = $"{rgvLocation.ToString()}-鏈夆�樺凡涓嬪彂鈥欑殑浠诲姟锛屼笉鑳藉鐞�,姝ゆ寰幆缁撴潫";
+                                    continue;
+                                }
+                                var upiObj = wmsDB.mes_batchOrderUPI_new.Where(x => x.UPI == upiCode).FirstOrDefault();
+                                if (upiObj == null)
+                                {
+                                    SystemWarningMsg._lbl_alert_DataProcess_BZ12 = $"{rgvLocation.ToString()},鏍规嵁UPI:{upiCode}娌℃湁鎵惧埌瀵硅薄 ";
+                                    continue;
+                                }
+                                isrotate = 1;
+                                placeX = (short)upiObj.MachineXCenter;
+                                placeY = (short)upiObj.MachineYCenter;
+                                //鏌ュ杩欏寘鎵�鏈夌殑鏁伴噺
+                                var upiList = wmsDB.mes_batchOrderUPI_new.Where(x => x.PackageCode == upiObj.PackageCode).ToList();
+                                //鏌ヨ鏄惁鏈澘骞朵笖鍒ゆ柇鏈夋病鏈夋贩鎵�
+                                var wms_rbline_runmode = wmsDB.wms_rbline_runmode.FirstOrDefault();
+                                if (wms_rbline_runmode != null)
+                                {
+                                    //鏌ヨ鏄惁娣锋壒
+                                    if (!string.IsNullOrEmpty(wms_rbline_runmode.PalletizingUPI))
+                                    {
+                                        if (upiCode != wms_rbline_runmode.PalletizingUPI)
+                                        {
+                                            SystemWarningMsg._lbl_alert_DataProcess_BZ12 = $"{rgvLocation.ToString()},UPI:{upiCode}鐮佸寘閮ㄤ欢娣锋壒 ";
+                                            continue;
+                                        }
+                                    }
+                                    //鑾峰彇鐮佸灈鐩爣浣�
+                                    if (wms_rbline_runmode.PalletizingStation != 0)
+                                    {
+                                        place = wms_rbline_runmode.PalletizingStation.ToString();
+                                    }
+                                    else
+                                    {
+                                        if (obj.R_PalletizingStation1 == 1)
+                                        {
+                                            place = "1";
+                                        }
+                                        else if (obj.R_PalletizingStation2 == 1)
+                                        {
+                                            place = "2";
+
+                                        }
+                                        else
+                                        {
+                                            SystemWarningMsg._lbl_alert_DataProcess_BZ12 = $"{rgvLocation.ToString()},UPI:{upiCode}鏃犲彲鐢ㄧ爜鍨涚洰鏍囦綅 ";
+                                            continue;
+                                        }
+                                    }
+                                    //濡傛灉娆″簭绛変簬褰撻挶鍖呮�绘暟閲忥紝鏄惁鏈澘缃负true
+                                    if (upiObj.Shelf == upiList.Count())
+                                    {
+                                        islast = true;
+                                        wms_rbline_runmode.PalletizingUPI = null;
+                                        wms_rbline_runmode.PalletizingStation = 0;
+                                    }
+
+                                }
+                                //鏌ヨ鏈夋病鏈夋搴忓皬浜庡綋鍓嶆搴忓苟涓旀病鏈夌爜鍨涚殑
+                                var oldupi = upiList.Where(x => x.Shelf < upiObj.Shelf && x.UpiStatus != (int)UpiStatusEnum.宸茬爜鍨�).FirstOrDefault();
+                                if (oldupi != null)
+                                {
+                                    SystemWarningMsg._lbl_alert_DataProcess_BZ12 = $"{rgvLocation.ToString()},UPI:{upiCode}鐮佸寘椤哄簭閿欒 ";
+                                    continue;
+                                }
+
+                                //璁板綍浠诲姟
+                                var _id = Yitter.IdGenerator.YitIdHelper.NextId();
+                                var plcTaskNo = BusinessHelper.CreatePlcTaskIdForSrmTask();
+                                var task = new wms_rbline_task()
+                                {
+                                    Id = _id,
+                                    TaskNo = plcTaskNo,
+                                    UPI = upiObj.UPI,
+                                    Length = upiObj.Length,
+                                    Width = upiObj.Width,
+                                    Thk = upiObj.Thk,
+                                    IssueTime = DateTime.Now,
+                                    PlanNo = upiObj.PlanNo,
+                                    OrderId = upiObj.OrderId,
+                                    PackageCode = upiObj.PackageCode,
+                                    RbTaskType = (int)RbTaskTypeEnum.鐮佹澘浠诲姟,
+                                    RbTaskTypeEnumName = RbTaskTypeEnum.鐮佹澘浠诲姟.ToString(),
+                                    TaskStatus = (int)TaskStatusEnum.宸蹭笅鍙�,
+                                    TaskStatusName = TaskStatusEnum.宸蹭笅鍙�.ToString(),
+                                    TaskMsg = "鐮佹澘",
+                                    CreateTime = DateTime.Now,
+                                    CreateUserName = "CC",
+                                    UpdateTime = DateTime.Now,
+                                    UpdateUserName = "CC",
+                                    PlaceCode=place
+                                };
+
+                                wmsDB.wms_rbline_task.Add(task);
+
+                                using (StationServiceClient client = new StationServiceClient())
+                                {
+
+                                    var res = client.WritePalletizingTaskInfo((int)EDevice.Station, rgvLocation, Convert.ToInt32(task.TaskNo), islast,
+                                          (short)upiObj.Length, (short)upiObj.Width, (short)upiObj.Thk, isrotate, short.Parse(task.PlaceCode), placeX, placeY);
+                                    if (!res.result)
+                                    {
+                                        SystemWarningMsg._lbl_alert_DataProcess_BZ12 = $"{rgvLocation.ToString()}-涓嬪彂鍏ュ簱浠诲姟 澶辫触,WriteInStoreTaskInfoAsync 杩斿洖:{res.resMsg}";
+                                        continue;
+                                    }
+                                    else
+                                    {
+                                        Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-涓嬪彂鍏ュ簱浠诲姟 鎴愬姛,WriteInStoreTaskInfoAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
+                                    }
+                                }
+
+                                wmsDB.SaveChanges();
+                            }
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    SystemWarningMsg._lbl_alert_DataProcess_BZ39 += " 鍑虹幇寮傚父:" + ex.Message + SysGloble.SPLIT_STR;
+                    Log4NetHelper.WriteErrorLog(logType, " 鍑虹幇寮傚父锛�" + ex.Message, ex);
+                }
+            }
+        }
+    }
+}
diff --git "a/CC/iWareCC_ASRS/ThreadService/03_BZ12\050\346\234\272\345\231\250\344\272\272\347\240\201\345\214\205\345\267\245\344\275\215\051/DataProcess_BZ12_FinishTask.cs" "b/CC/iWareCC_ASRS/ThreadService/03_BZ12\050\346\234\272\345\231\250\344\272\272\347\240\201\345\214\205\345\267\245\344\275\215\051/DataProcess_BZ12_FinishTask.cs"
new file mode 100644
index 0000000..2ff0bc3
--- /dev/null
+++ "b/CC/iWareCC_ASRS/ThreadService/03_BZ12\050\346\234\272\345\231\250\344\272\272\347\240\201\345\214\205\345\267\245\344\275\215\051/DataProcess_BZ12_FinishTask.cs"
@@ -0,0 +1,12 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace iWareCC.ThreadService._03_BZ12_鏈哄櫒浜虹爜鍖呭伐浣峗
+{
+    internal class DataProcess_BZ12_FinishTask
+    {
+    }
+}
diff --git a/CC/iWareCC_ASRS/iWareCC.csproj b/CC/iWareCC_ASRS/iWareCC.csproj
index c71096e..9739ab6 100644
--- a/CC/iWareCC_ASRS/iWareCC.csproj
+++ b/CC/iWareCC_ASRS/iWareCC.csproj
@@ -161,6 +161,7 @@
     <Compile Include="ThreadService\02_BZ39宸ヤ綅锛堣ˉ鏉垮悗宸ヤ綅锛塡Outbound\3銆丏ataProcess_RobotBuffer_FinishTaskForOutbound.cs" />
     <Compile Include="ThreadService\02_BZ39宸ヤ綅锛堣ˉ鏉垮悗宸ヤ綅锛塡Inbound\2銆丏ataProcess_RobotBuffer_FinishTask.cs" />
     <Compile Include="ThreadService\02_BZ39宸ヤ綅锛堣ˉ鏉垮悗宸ヤ綅锛塡Inbound\1銆丏ataProcess_BZ39.cs" />
+    <Compile Include="ThreadService\03_BZ12%28鏈哄櫒浜虹爜鍖呭伐浣�%29\DataProcess_BZ12.cs" />
     <Compile Include="ThreadService\04_BZ21锛堟惉杩愭暣鍨涙満鍣ㄤ汉锛塡DataProcess_BZ21.cs" />
     <Compile Include="WCF\CCWcfService.cs" />
     <Compile Include="WCF\ICCWcfService.cs" />
@@ -353,8 +354,6 @@
     <None Include="Resources\绌挎姣嶈溅1.jpg" />
     <None Include="Resources\绌挎瀛愭瘝杞�%28褰╄壊%29.jpg" />
   </ItemGroup>
-  <ItemGroup>
-    <Folder Include="ThreadService\03_BZ12%28鏈哄櫒浜虹爜鍖呭伐浣�%29\" />
-  </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>
\ No newline at end of file
diff --git a/CC/iWareCommon/Utils/Log4Net/LogType.cs b/CC/iWareCommon/Utils/Log4Net/LogType.cs
index 85eaa52..18fb3b6 100644
--- a/CC/iWareCommon/Utils/Log4Net/LogType.cs
+++ b/CC/iWareCommon/Utils/Log4Net/LogType.cs
@@ -103,6 +103,10 @@
         /// <summary>
         /// 閲嶆柊鑾峰彇鍙戝姩鏈轰俊鎭�
         /// </summary>
-        DataProcess_269 = 308
+        DataProcess_269 = 308,
+        /// <summary>
+        /// 鐮佹澘浠诲姟涓嬪彂
+        /// </summary>
+        DataProcess_BZ12 = 309,
     }
 }
diff --git a/CC/iWareSql/DataAccess/TaskHandler.cs b/CC/iWareSql/DataAccess/TaskHandler.cs
index 9a4526a..19a4fbf 100644
--- a/CC/iWareSql/DataAccess/TaskHandler.cs
+++ b/CC/iWareSql/DataAccess/TaskHandler.cs
@@ -35,6 +35,21 @@
             return true;
         }
 
+        /// <summary>
+        /// 楠岃瘉 鐮佹澘鏄惁鏈夋墽琛屼腑浠诲姟
+        /// </summary>
+        /// <param name="wmsDB"></param>
+        /// <returns></returns>
+        public static bool ValidateIssueTaskForBZ12(WmsDBModel.WmsDBModel wmsDB)
+        {
+            var isExist = wmsDB.wms_rbline_task.Where(x => x.TaskStatus == (int)TaskStatusEnum.宸蹭笅鍙�
+                && x.RbTaskType == (int)RbTaskTypeEnum.鐮佹澘浠诲姟).ToList();
 
+            if (isExist?.Count() > 0)
+            {
+                return false;
+            }
+            return true;
+        }
     }
 }
\ No newline at end of file
diff --git a/CC/iWareSql/WmsDBModel/wms_rbline_runmode.cs b/CC/iWareSql/WmsDBModel/wms_rbline_runmode.cs
index f719ea4..05254f5 100644
--- a/CC/iWareSql/WmsDBModel/wms_rbline_runmode.cs
+++ b/CC/iWareSql/WmsDBModel/wms_rbline_runmode.cs
@@ -43,5 +43,15 @@
         public string UpdateUserName { get; set; }
 
         public bool IsDelete { get; set; }
+
+        /// <summary>
+        /// 上一次码垛编号
+        /// </summary>
+        public string PalletizingUPI { get; set; }
+
+        /// <summary>
+        /// 上一次码垛站点
+        /// </summary>
+        public int? PalletizingStation { get; set; }
     }
 }
diff --git a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Entity/WmsTask/WmsRbLineRunMode.cs b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Entity/WmsTask/WmsRbLineRunMode.cs
index 695ad1b..6436079 100644
--- a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Entity/WmsTask/WmsRbLineRunMode.cs
+++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Entity/WmsTask/WmsRbLineRunMode.cs
@@ -53,7 +53,17 @@
 
         public string? LineRunModeName { get; set; }
 
+        /// <summary>
+        /// 涓婁竴娆$爜鍨涚紪鍙�
+        /// </summary>
+        [SugarColumn(ColumnName = "PalletizingUPI", ColumnDescription = "涓婁竴娆$爜鍨涚紪鍙�", Length = 50)]
+        public string? PalletizingUPI { get; set; }
 
+        /// <summary>
+        /// 涓婁竴娆$爜鍨涚珯鐐�
+        /// </summary>
+        [SugarColumn(ColumnName = "PalletizingStation", ColumnDescription = "涓婁竴娆$爜鍨涚珯鐐�")]
+        public int? PalletizingStation { get; set; }
 
     }
 }
\ No newline at end of file
diff --git a/SDA/iWareSda/Common/Struct/WareSdaStruct.cs b/SDA/iWareSda/Common/Struct/WareSdaStruct.cs
index bc05fef..162acff 100644
--- a/SDA/iWareSda/Common/Struct/WareSdaStruct.cs
+++ b/SDA/iWareSda/Common/Struct/WareSdaStruct.cs
@@ -100,6 +100,9 @@
            StationLocationEnum.棣栨鎵爜宸ヤ綅.ToString(),
            StationLocationEnum.BZ01.ToString(),
            StationLocationEnum.BZ39.ToString(),
+           StationLocationEnum.BZ21.ToString(),
+           StationLocationEnum.BZ12.ToString(),
+
         };
 
 
diff --git a/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs b/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs
index 520c357..3aefa22 100644
--- a/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs
+++ b/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs
@@ -137,6 +137,43 @@
         [Description("鍑哄簱瀹屾垚宸茬‘璁�")]
         public bool W_OutboundFinishConfirm { get; set; }
 
+        /// <summary>
+        /// 鐮佸灈鏈澘鏍囧織
+        /// </summary>
+        [Description("鐮佸灈鏈澘鏍囧織")]
+        public bool W_EndMark { get; set; }
+
+        /// <summary>
+        /// 鐮佸灈浠诲姟鍙�
+        /// </summary>
+        [Description("鐮佸灈浠诲姟鍙�")]
+        public short W_PalletizingTaskID { get; set; }
+        /// <summary>
+        /// 鐮佸灈鏄惁鏃嬭浆
+        /// </summary>
+        [Description("鐮佸灈鏄惁鏃嬭浆")]
+        public short W_Rotate { get; set; }
+        /// <summary>
+        /// 鐮佸灈鐩爣宸ヤ綅
+        /// </summary>
+        [Description("鐮佸灈鐩爣宸ヤ綅")]
+        public short W_PalletizingStation { get; set; }
+        /// <summary>
+        /// 鐮佸灈浣嶇疆鍧愭爣X
+        /// </summary>
+        [Description("鐮佸灈浣嶇疆鍧愭爣X")]
+        public short W_PalletizingPlaceX { get; set; }
+        /// <summary>
+        /// 鐮佸灈浣嶇疆鍧愭爣Y
+        /// </summary>
+        [Description("鐮佸灈浣嶇疆鍧愭爣Y")]
+        public short W_PalletizingPlaceY { get; set; }
+        /// <summary>
+        /// 鐮佸灈浠诲姟瀹屾垚纭
+        /// </summary>
+        [Description("鐮佸灈浠诲姟瀹屾垚纭")]
+        public bool W_PalletizingTaskFinish { get; set; }
+
     }
 
     /// <summary>
@@ -155,7 +192,43 @@
         /// </summary>
         [Description("璇荤爜鏁版嵁瑙f瀽瀹屾垚")]
         public string W_DataFinish { get; set; }
+        
+        /// <summary>
+        /// 鐮佸灈鏈澘鏍囧織
+        /// </summary>
+        [Description("鐮佸灈鏈澘鏍囧織")]
+        public string W_EndMark { get; set; }
 
+        /// <summary>
+        /// 鐮佸灈浠诲姟鍙�
+        /// </summary>
+        [Description("鐮佸灈浠诲姟鍙�")]
+        public string W_PalletizingTaskID { get; set; }
+        /// <summary>
+        /// 鐮佸灈鏄惁鏃嬭浆
+        /// </summary>
+        [Description("鐮佸灈鏄惁鏃嬭浆")]
+        public string W_Rotate { get; set; }
+        /// <summary>
+        /// 鐮佸灈鐩爣宸ヤ綅
+        /// </summary>
+        [Description("鐮佸灈鐩爣宸ヤ綅")]
+        public string W_PalletizingStation { get; set; }
+        /// <summary>
+        /// 鐮佸灈浣嶇疆鍧愭爣X
+        /// </summary>
+        [Description("鐮佸灈浣嶇疆鍧愭爣X")]
+        public string W_PalletizingPlaceX { get; set; }
+        /// <summary>
+        /// 鐮佸灈浣嶇疆鍧愭爣Y
+        /// </summary>
+        [Description("鐮佸灈浣嶇疆鍧愭爣Y")]
+        public string W_PalletizingPlaceY { get; set; }
+        /// <summary>
+        /// 鐮佸灈浠诲姟瀹屾垚纭
+        /// </summary>
+        [Description("鐮佸灈浠诲姟瀹屾垚纭")]
+        public string W_PalletizingTaskFinish { get; set; }
         /// <summary>
         /// 榻愬淇℃伅锛�998榻愬锛�999寮傚父鍑哄簱锛�
         /// </summary>
@@ -401,6 +474,27 @@
         /// </summary>
         [Description("鍑哄簱浠诲姟鍙�")]
         public short R_Outbound_TaskID { get; set; }
+
+        /// <summary>
+        /// 鐮佸灈鏀捐揣瀹屾垚
+        /// </summary>
+        [Description("鐮佸灈鏀捐揣瀹屾垚")]
+        public bool R_PalletizingFinish { get; set; }
+        /// <summary>
+        /// 鐮佸灈璇诲彇浠诲姟鍙�
+        /// </summary>
+        [Description("鐮佸灈璇诲彇浠诲姟鍙�")]
+        public short R_PalletizingTaskNo { get; set; }
+        /// <summary>
+        /// 鐮佸灈浣嶇疆1鐘舵��
+        /// </summary>
+        [Description("鐮佸灈浣嶇疆1鐘舵��")]
+        public short R_PalletizingStation1 { get; set; }
+        /// <summary>
+        /// 鐮佸灈浣嶇疆2鐘舵��
+        /// </summary>
+        [Description("鐮佸灈浣嶇疆2鐘舵��")]
+        public short R_PalletizingStation2 { get; set; }
     }
 
     public class StationDBForReadComm
@@ -460,6 +554,25 @@
         /// </summary>
         [Description("鍑哄簱浠诲姟鍙�")]
         public string R_Outbound_TaskID { get; set; }
-
+        /// <summary>
+        /// 鐮佸灈鏀捐揣瀹屾垚
+        /// </summary>
+        [Description("鐮佸灈鏀捐揣瀹屾垚")]
+        public string R_PalletizingFinish { get; set; }
+        /// <summary>
+        /// 鐮佸灈璇诲彇浠诲姟鍙�
+        /// </summary>
+        [Description("鐮佸灈璇诲彇浠诲姟鍙�")]
+        public string R_PalletizingTaskNo { get; set; }
+        /// <summary>
+        /// 鐮佸灈浣嶇疆1鐘舵��
+        /// </summary>
+        [Description("鐮佸灈浣嶇疆1鐘舵��")]
+        public string R_PalletizingStation1 { get; set; }
+        /// <summary>
+        /// 鐮佸灈浣嶇疆2鐘舵��
+        /// </summary>
+        [Description("鐮佸灈浣嶇疆2鐘舵��")]
+        public string R_PalletizingStation2 { get; set; }
     }
 }
diff --git a/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs b/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs
index 368ac29..3cf12bb 100644
--- a/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs
+++ b/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs
@@ -358,7 +358,153 @@
                 return false;
             }
         }
+        /// <summary>
+        /// 鍐欏叆鐮佸灈浠诲姟淇℃伅
+        /// </summary>
+        /// <param name="stationCode"></param>
+        /// <param name=""></param>
+        /// <param name="taskID"></param>
+        /// <param name="isLast"></param>
+        /// <param name="length"></param>
+        /// <param name="width"></param>
+        /// <param name="height"></param>
+        /// <param name="rotate"></param>
+        /// <param name="toplace"></param>
+        /// <param name="placeX"></param>
+        /// <param name="placeY"></param>
+        /// <param name=""></param>
+        /// <param name=""></param>
+        /// <returns></returns>
+        public bool WritePalletizingTaskInfo(string stationCode, int taskID, bool isLast, short length, short width, short height, short rotate, short toplace, short placeX, short placeY, out string msg)
+        {
+            try
+            {
+                msg = "";
+                var stationObj = this.DBBlockForWrite.W_StationForWriteCommList.Where(x => x.StationCode == stationCode).FirstOrDefault();
 
+                var view_stationObj = this.View.W_StationForWriteCommList.Where(x => x.StationCode == stationCode).FirstOrDefault();
+
+                MessageModel b2 = this.plcService.WriteValuePoint(stationObj.W_PalletizingTaskID, taskID, view_stationObj.W_PalletizingTaskID);
+                if (!b2.result)
+                {
+                    msg = string.Format("鍚慡tation鍦板潃{0} 鍐� 鐮佸灈浠诲姟鍙� " + taskID + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg,
+                      stationObj.W_Inbound_TaskID);
+                    return false;
+                }
+
+                b2 = this.plcService.WriteValuePoint(stationObj.W_EndMark, isLast, view_stationObj.W_EndMark);
+                if (!b2.result)
+                {
+                    msg = string.Format("鍚慡tation鍦板潃{0} 鍐� 鏄惁鏈澘 " + isLast + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg,
+                      stationObj.W_Destination_In);
+                    return false;
+                }
+
+                b2 = this.plcService.WriteValuePoint(stationObj.W_Length, length, view_stationObj.W_Length);
+                if (!b2.result)
+                {
+                    msg = string.Format("鍚慡tation鍦板潃{0} 鍐� 闀垮害 " + length + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg,
+                      stationObj.W_Length);
+                    return false;
+                }
+                b2 = this.plcService.WriteValuePoint(stationObj.W_Width, width, view_stationObj.W_Width);
+                if (!b2.result)
+                {
+                    msg = string.Format("鍚慡tation鍦板潃{0} 鍐� 瀹藉害 " + width + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg,
+                      stationObj.W_Width);
+                    return false;
+                }
+                b2 = this.plcService.WriteValuePoint(stationObj.W_Height, height, view_stationObj.W_Height);
+                if (!b2.result)
+                {
+                    msg = string.Format("鍚慡tation鍦板潃{0} 鍐� 楂樺害 " + height + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg,
+                     stationObj.W_Height);
+                    return false;
+                }
+                b2 = this.plcService.WriteValuePoint(stationObj.W_PalletizingStation, toplace, view_stationObj.W_PalletizingStation);
+                if (!b2.result)
+                {
+                    msg = string.Format("鍚慡tation鍦板潃{0} 鍐� 鐩爣浣� " + toplace + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg,
+                     stationObj.W_Height);
+                    return false;
+                }
+                b2 = this.plcService.WriteValuePoint(stationObj.W_Rotate, rotate, view_stationObj.W_Rotate);
+                if (!b2.result)
+                {
+                    msg = string.Format("鍚慡tation鍦板潃{0} 鍐� 鏄惁鏃嬭浆 " + rotate + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg,
+                     stationObj.W_Height);
+                    return false;
+                }
+                b2 = this.plcService.WriteValuePoint(stationObj.W_PalletizingPlaceX, placeX, view_stationObj.W_PalletizingPlaceX);
+                if (!b2.result)
+                {
+                    msg = string.Format("鍚慡tation鍦板潃{0} 鍐� X鍧愭爣 " + placeX + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg,
+                     stationObj.W_Height);
+                    return false;
+                }
+                b2 = this.plcService.WriteValuePoint(stationObj.W_PalletizingPlaceY, placeY, view_stationObj.W_PalletizingPlaceY);
+                if (!b2.result)
+                {
+                    msg = string.Format("鍚慡tation鍦板潃{0} 鍐� Y鍧愭爣 " + placeY + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg,
+                     stationObj.W_Height);
+                    return false;
+                }
+
+                b2 = this.plcService.WriteValuePoint(stationObj.W_DataFinish, true, view_stationObj.W_DataFinish);
+                if (!b2.result)
+                {
+                    msg = string.Format("鍚慡tation鍦板潃{0} 鍐� 璇荤爜瑙f瀽瀹屾垚 " + true + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg,
+                       stationObj.W_DataFinish);
+                    return false;
+                }
+
+
+                return true;
+            }
+            catch (Exception ex)
+            {
+                msg = ex.Message;
+                var logcontext = string.Format("WriteInStoreTaskInfo鍑虹幇寮傚父:" + JsonConvert.SerializeObject(ex),
+                        "");
+                Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, logcontext, ex);
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 鍐欏叆绔欑偣浠诲姟瀹屾垚纭
+        /// </summary>
+        /// <param name="stationCode"></param>
+        /// <param name="value"></param>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        public bool WriteStation_FinishACK(string stationCode, bool value, out string msg)
+        {
+            try
+            {
+                msg = "";
+                var stationObj = this.DBBlockForWrite.W_StationForWriteCommList.Where(x => x.StationCode == stationCode).FirstOrDefault();
+
+                var view_stationObj = this.View.W_StationForWriteCommList.Where(x => x.StationCode == stationCode).FirstOrDefault();
+                MessageModel b2 = this.plcService.WriteValuePoint(stationObj.W_PalletizingTaskFinish, value, view_stationObj.W_PalletizingTaskFinish);
+                if (!b2.result)
+                {
+                    msg = string.Format("鍚慡tation"+stationCode+" 鍐欏叆浠诲姟瀹屾垚纭 鍦板潃{0} 鍐�  " + value + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg,
+                        stationObj.W_OutboundFinishConfirm);
+                    return false;
+                }
+
+                return true;
+            }
+            catch (Exception ex)
+            {
+                msg = ex.Message;
+                var logcontext = string.Format("鍚慡tatio 鍑哄簱浠诲姟瀹屾垚纭 鍑虹幇寮傚父:" + JsonConvert.SerializeObject(ex),
+                        "");
+                Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, logcontext, ex);
+                return false;
+            }
+        }
 
         public bool WriteOutStoreTaskInfo(string stationCode, string sourcePlaceNo, out string msg, int outbound_TaskID)
         {
diff --git a/SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs b/SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs
index 61b8c06..446480d 100644
--- a/SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs
+++ b/SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs
@@ -20,6 +20,7 @@
         /// 鍐欏叆DB
         /// </summary>
         public static string W_DBHeaderWithSeparate_BZ39 = "3002" + WareSdaStruct.PLCDBADDRESS_SEPARATE;
+        public static string W_DBHeaderWithSeparate_BZ12 = "3003" + WareSdaStruct.PLCDBADDRESS_SEPARATE;
         public static string W_DBHeaderWithSeparate_BZ01 = "3001" + WareSdaStruct.PLCDBADDRESS_SEPARATE;
 
         /// <summary>
@@ -180,6 +181,26 @@
 
             });
 
+            _dbBlockForWrite.W_StationForWriteCommList.Add(new StationDBForWriteComm()
+            {
+                StationCode = StationLocationEnum.BZ12.ToString(),
+
+                W_DataFinish = W_DBHeaderWithSeparate_BZ12 + "0.0",
+                W_EndMark = W_DBHeaderWithSeparate_BZ12 + "0.1",
+                W_PalletizingPlaceX = W_DBHeaderWithSeparate_BZ12 + "12.0",
+                W_PalletizingPlaceY = W_DBHeaderWithSeparate_BZ12 + "14.0",
+
+                W_PalletizingTaskID = W_DBHeaderWithSeparate_BZ12 + "20.0",
+                W_Rotate = W_DBHeaderWithSeparate_BZ12 + "8.0",
+
+                W_Length = W_DBHeaderWithSeparate_BZ12 + "2.0",
+                W_Width = W_DBHeaderWithSeparate_BZ12 + "4.0",
+                W_Height = W_DBHeaderWithSeparate_BZ12 + "6.0",
+
+                W_PalletizingStation = W_DBHeaderWithSeparate_BZ12 + "10.0",
+
+            });
+
             return _dbBlockForWrite;
         }
 
@@ -226,6 +247,23 @@
             });
 
 
+            _dbBlockForRead.R_StationForReadCommList.Add(new StationDBForReadComm()
+            {
+                StationCode = StationLocationEnum.BZ12.ToString(),
+
+                R_ReqParseData = W_DBHeaderWithSeparate_BZ12 + "50.0",
+                R_PalletizingFinish = W_DBHeaderWithSeparate_BZ12 + "50.1",
+                R_PalletizingTaskNo = W_DBHeaderWithSeparate_BZ12 + "50.2",
+                R_ReadCodeResult = W_DBHeaderWithSeparate_BZ12 + "52.0",
+                R_PalletizingStation1 = W_DBHeaderWithSeparate_BZ12 + "104.0",
+                R_PalletizingStation2 = W_DBHeaderWithSeparate_BZ12 + "106.0",
+
+                //R_Inbound_TaskID = W_DBHeaderWithSeparate_BZ12 + "112.0",
+                //R_Outbound_TaskID = W_DBHeaderWithSeparate_BZ12 + "114.0",
+
+            });
+
+
             return _dbBlockForRead;
 
         }
diff --git a/SDA/iWareSda/Devices/4-Station/StationService/IStationService.cs b/SDA/iWareSda/Devices/4-Station/StationService/IStationService.cs
index ab94395..14f0541 100644
--- a/SDA/iWareSda/Devices/4-Station/StationService/IStationService.cs
+++ b/SDA/iWareSda/Devices/4-Station/StationService/IStationService.cs
@@ -131,6 +131,25 @@
         SdaResEntity WriteOutStoreTaskInfo(int deviceId, string stationCode, string sourcePlaceNo, int outbound_TaskID);
 
         /// <summary>
+        /// 鍐欏叆鐮佹澘浠诲姟淇℃伅
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="value"></param>
+        /// <returns></returns>
+        [OperationContract]
+
+        SdaResEntity WritePalletizingTaskInfo(int deviceId, string stationCode, int taskID, bool isLast, short length, short width, short height, short rotate, short toplace, short placeX, short placeY);
+        
+            /// <summary>
+            /// 鐮佸灈瀹屾垚宸茬‘璁�
+            /// </summary>
+            /// <param name="deviceId"></param>
+            /// <param name="value"></param>
+            /// <returns></returns
+            [OperationContract]
+        SdaResEntity SetPalletizingTaskFinishAck(int deviceId, bool value, string stationCode);
+
+        /// <summary>
         /// Station鐨勪换鍔″畬鎴怉CK璧嬪��
         /// </summary>
         /// <param name="deviceId"></param>
diff --git a/SDA/iWareSda/Devices/4-Station/StationService/StationService.cs b/SDA/iWareSda/Devices/4-Station/StationService/StationService.cs
index 90b9047..31e2d98 100644
--- a/SDA/iWareSda/Devices/4-Station/StationService/StationService.cs
+++ b/SDA/iWareSda/Devices/4-Station/StationService/StationService.cs
@@ -533,8 +533,68 @@
                 return _SdaResEntity;
             }
         }
+        /// <summary>
+        /// 鍐欏叆鐮佹澘浠诲姟淇℃伅
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="value"></param>
+        /// <returns></returns>
+        public SdaResEntity WritePalletizingTaskInfo(int deviceId, string stationCode,int taskID, bool isLast, short length, short width, short height,short rotate,short toplace,short placeX,short placeY)
+        {
+            SdaResEntity _SdaResEntity = new SdaResEntity();
+            try
+            {
+                var StationResult = Station_CacheEntity.GetDeviceObj(deviceId);
+                if (!StationResult.result)
+                {
+                    return StationResult;
+                }
+                var Station = StationResult.resData as StationEntity;
 
+                string msg = "";
+                var result = Station.WritePalletizingTaskInfo(stationCode, taskID,isLast, length, width, height,rotate,toplace,placeX,placeY,out msg);
+                _SdaResEntity.result = result;
+                _SdaResEntity.resMsg = msg;
+                return _SdaResEntity;
+            }
+            catch (Exception ex)
+            {
+                _SdaResEntity.result = false;
+                _SdaResEntity.resMsg = ex.Message;
+                return _SdaResEntity;
+            }
+        }
+        /// <summary>
+        /// 鐮佸灈瀹屾垚宸茬‘璁�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="value"></param>
+        /// <returns></returns>
+        public SdaResEntity SetPalletizingTaskFinishAck(int deviceId, bool value, string stationCode)
+        {
+            SdaResEntity _SdaResEntity = new SdaResEntity();
+            try
+            {
+                var StationResult = Station_CacheEntity.GetDeviceObj(deviceId);
+                if (!StationResult.result)
+                {
+                    return StationResult;
+                }
+                var Station = StationResult.resData as StationEntity;
 
+                string msg = "";
+                var result = Station.WriteStation_FinishACK(stationCode, value, out msg);
+                _SdaResEntity.result = result;
+                _SdaResEntity.resMsg = msg;
+                return _SdaResEntity;
+            }
+            catch (Exception ex)
+            {
+                _SdaResEntity.result = false;
+                _SdaResEntity.resMsg = ex.Message;
+                return _SdaResEntity;
+            }
+        }
         /// <summary>
         /// 鍐欏叆鍑哄簱浠诲姟淇℃伅
         /// </summary>
diff --git a/SDA/iWareSda/Model/StationLocationEnum.cs b/SDA/iWareSda/Model/StationLocationEnum.cs
index fae8af5..ed977df 100644
--- a/SDA/iWareSda/Model/StationLocationEnum.cs
+++ b/SDA/iWareSda/Model/StationLocationEnum.cs
@@ -26,8 +26,14 @@
         /// </summary>
         BZ39 = 102,
 
+        /// <summary>
+        /// 鍙犵増宸ヤ綅
+        /// </summary>
         BZ12 = 103,
 
+        /// <summary>
+        /// 鍚堝寘宸ヤ綅
+        /// </summary>
         BZ21 = 104
     }
 }

--
Gitblit v1.9.3