From 0eaa55a507f09c22a65b962d726872ece93acff5 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周四, 21 11月 2024 21:26:34 +0800 Subject: [PATCH] 222 --- SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvDBForWrite.cs | 89 -------- SDA/iWareSda/Devices/4-Station/StationService/StationService.cs | 32 +++ SDA/iWareSda/Devices/4-Station/StationService/IStationService.cs | 9 CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Inbound/2、DataProcess_RobotBuffer_FinishTask.cs | 15 + SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs | 7 CC/iWareCC_ASRS/Connected Services/StationService/StationService.wsdl | 19 + CC/iWareCC_ASRS/Connected Services/StationService/item2.xsd | 23 + SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs | 65 ------ SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvDBForRead.cs | 76 ------- CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Inbound/1、DataProcess_BZ39.cs | 3 CC/iWareCC_ASRS/Connected Services/StationService/item3.xsd | 1 CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs | 30 +++ SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs | 207 ++++---------------- CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Outbound/1、DataProcess_RobotBuffer_AutoQiTaoOutbound.cs | 3 14 files changed, 180 insertions(+), 399 deletions(-) diff --git a/CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs b/CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs index e493826..647c159 100644 --- a/CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs +++ b/CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs @@ -472,6 +472,9 @@ private short W_HeightField; [System.Runtime.Serialization.OptionalFieldAttribute()] + private bool W_InboundFinishConfirmField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] private bool W_IsRotateField; [System.Runtime.Serialization.OptionalFieldAttribute()] @@ -598,6 +601,19 @@ if ((this.W_HeightField.Equals(value) != true)) { this.W_HeightField = value; this.RaisePropertyChanged("W_Height"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public bool W_InboundFinishConfirm { + get { + return this.W_InboundFinishConfirmField; + } + set { + if ((this.W_InboundFinishConfirmField.Equals(value) != true)) { + this.W_InboundFinishConfirmField = value; + this.RaisePropertyChanged("W_InboundFinishConfirm"); } } } @@ -1419,6 +1435,12 @@ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStationService/WriteQiTaoInfo", ReplyAction="http://tempuri.org/IStationService/WriteQiTaoInfoResponse")] System.Threading.Tasks.Task<iWareCC.StationService.SdaResEntity> WriteQiTaoInfoAsync(int deviceId, string stationCode, bool value); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStationService/InboundFinishConfirm", ReplyAction="http://tempuri.org/IStationService/InboundFinishConfirmResponse")] + iWareCC.StationService.SdaResEntity InboundFinishConfirm(int deviceId, string stationCode); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStationService/InboundFinishConfirm", ReplyAction="http://tempuri.org/IStationService/InboundFinishConfirmResponse")] + System.Threading.Tasks.Task<iWareCC.StationService.SdaResEntity> InboundFinishConfirmAsync(int deviceId, string stationCode); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IStationService/WriteInStoreTaskInfo", ReplyAction="http://tempuri.org/IStationService/WriteInStoreTaskInfoResponse")] iWareCC.StationService.SdaResEntity WriteInStoreTaskInfo(int deviceId, string stationCode, string toPlaceNo, short length, short width, short height); @@ -1551,6 +1573,14 @@ return base.Channel.WriteQiTaoInfoAsync(deviceId, stationCode, value); } + public iWareCC.StationService.SdaResEntity InboundFinishConfirm(int deviceId, string stationCode) { + return base.Channel.InboundFinishConfirm(deviceId, stationCode); + } + + public System.Threading.Tasks.Task<iWareCC.StationService.SdaResEntity> InboundFinishConfirmAsync(int deviceId, string stationCode) { + return base.Channel.InboundFinishConfirmAsync(deviceId, stationCode); + } + public iWareCC.StationService.SdaResEntity WriteInStoreTaskInfo(int deviceId, string stationCode, string toPlaceNo, short length, short width, short height) { return base.Channel.WriteInStoreTaskInfo(deviceId, stationCode, toPlaceNo, length, width, height); } diff --git a/CC/iWareCC_ASRS/Connected Services/StationService/StationService.wsdl b/CC/iWareCC_ASRS/Connected Services/StationService/StationService.wsdl index 4cb8537..abb88a5 100644 --- a/CC/iWareCC_ASRS/Connected Services/StationService/StationService.wsdl +++ b/CC/iWareCC_ASRS/Connected Services/StationService/StationService.wsdl @@ -69,6 +69,12 @@ <wsdl:message name="IStationService_WriteQiTaoInfo_OutputMessage"> <wsdl:part name="parameters" element="tns:WriteQiTaoInfoResponse" /> </wsdl:message> + <wsdl:message name="IStationService_InboundFinishConfirm_InputMessage"> + <wsdl:part name="parameters" element="tns:InboundFinishConfirm" /> + </wsdl:message> + <wsdl:message name="IStationService_InboundFinishConfirm_OutputMessage"> + <wsdl:part name="parameters" element="tns:InboundFinishConfirmResponse" /> + </wsdl:message> <wsdl:message name="IStationService_WriteInStoreTaskInfo_InputMessage"> <wsdl:part name="parameters" element="tns:WriteInStoreTaskInfo" /> </wsdl:message> @@ -133,6 +139,10 @@ <wsdl:operation name="WriteQiTaoInfo"> <wsdl:input wsaw:Action="http://tempuri.org/IStationService/WriteQiTaoInfo" message="tns:IStationService_WriteQiTaoInfo_InputMessage" /> <wsdl:output wsaw:Action="http://tempuri.org/IStationService/WriteQiTaoInfoResponse" message="tns:IStationService_WriteQiTaoInfo_OutputMessage" /> + </wsdl:operation> + <wsdl:operation name="InboundFinishConfirm"> + <wsdl:input wsaw:Action="http://tempuri.org/IStationService/InboundFinishConfirm" message="tns:IStationService_InboundFinishConfirm_InputMessage" /> + <wsdl:output wsaw:Action="http://tempuri.org/IStationService/InboundFinishConfirmResponse" message="tns:IStationService_InboundFinishConfirm_OutputMessage" /> </wsdl:operation> <wsdl:operation name="WriteInStoreTaskInfo"> <wsdl:input wsaw:Action="http://tempuri.org/IStationService/WriteInStoreTaskInfo" message="tns:IStationService_WriteInStoreTaskInfo_InputMessage" /> @@ -243,6 +253,15 @@ <soap:body use="literal" /> </wsdl:output> </wsdl:operation> + <wsdl:operation name="InboundFinishConfirm"> + <soap:operation soapAction="http://tempuri.org/IStationService/InboundFinishConfirm" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> <wsdl:operation name="WriteInStoreTaskInfo"> <soap:operation soapAction="http://tempuri.org/IStationService/WriteInStoreTaskInfo" 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 67c7087..b2b4a80 100644 --- a/CC/iWareCC_ASRS/Connected Services/StationService/item2.xsd +++ b/CC/iWareCC_ASRS/Connected Services/StationService/item2.xsd @@ -155,6 +155,21 @@ </xs:sequence> </xs:complexType> </xs:element> + <xs:element name="InboundFinishConfirm"> + <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:sequence> + </xs:complexType> + </xs:element> + <xs:element name="InboundFinishConfirmResponse"> + <xs:complexType> + <xs:sequence> + <xs:element xmlns:q11="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="InboundFinishConfirmResult" nillable="true" type="q11:SdaResEntity" /> + </xs:sequence> + </xs:complexType> + </xs:element> <xs:element name="WriteInStoreTaskInfo"> <xs:complexType> <xs:sequence> @@ -170,7 +185,7 @@ <xs:element name="WriteInStoreTaskInfoResponse"> <xs:complexType> <xs:sequence> - <xs:element xmlns:q11="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteInStoreTaskInfoResult" nillable="true" type="q11:SdaResEntity" /> + <xs:element xmlns:q12="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteInStoreTaskInfoResult" nillable="true" type="q12:SdaResEntity" /> </xs:sequence> </xs:complexType> </xs:element> @@ -186,7 +201,7 @@ <xs:element name="WriteStation_FinishACKResponse"> <xs:complexType> <xs:sequence> - <xs:element xmlns:q12="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteStation_FinishACKResult" nillable="true" type="q12:SdaResEntity" /> + <xs:element xmlns:q13="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteStation_FinishACKResult" nillable="true" type="q13:SdaResEntity" /> </xs:sequence> </xs:complexType> </xs:element> @@ -204,7 +219,7 @@ <xs:element name="WriteScanValidateACKResponse"> <xs:complexType> <xs:sequence> - <xs:element xmlns:q13="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteScanValidateACKResult" nillable="true" type="q13:SdaResEntity" /> + <xs:element xmlns:q14="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteScanValidateACKResult" nillable="true" type="q14:SdaResEntity" /> </xs:sequence> </xs:complexType> </xs:element> @@ -222,7 +237,7 @@ <xs:element name="WriteStation_XigangGetDataForOutResponse"> <xs:complexType> <xs:sequence> - <xs:element xmlns:q14="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteStation_XigangGetDataForOutResult" nillable="true" type="q14:SdaResEntity" /> + <xs:element xmlns:q15="http://schemas.datacontract.org/2004/07/iWareSda" minOccurs="0" name="WriteStation_XigangGetDataForOutResult" nillable="true" type="q15: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 24ff9ab..c44b458 100644 --- a/CC/iWareCC_ASRS/Connected Services/StationService/item3.xsd +++ b/CC/iWareCC_ASRS/Connected Services/StationService/item3.xsd @@ -41,6 +41,7 @@ <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_Height" type="xs:short" /> + <xs:element minOccurs="0" name="W_InboundFinishConfirm" type="xs:boolean" /> <xs:element minOccurs="0" name="W_IsRotate" type="xs:boolean" /> <xs:element minOccurs="0" name="W_KittingInfo" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="W_Length" type="xs:short" /> diff --git "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Inbound/1\343\200\201DataProcess_BZ39.cs" "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Inbound/1\343\200\201DataProcess_BZ39.cs" index a2e042f..12475a8 100644 --- "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Inbound/1\343\200\201DataProcess_BZ39.cs" +++ "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Inbound/1\343\200\201DataProcess_BZ39.cs" @@ -92,10 +92,11 @@ //璁板綍浠诲姟 var _id = Yitter.IdGenerator.YitIdHelper.NextId(); + var plcTaskNo = BusinessHelper.CreatePlcTaskIdForSrmTask(); var task = new wms_rbline_task() { Id = _id, - TaskNo = _id.ToString(), + TaskNo = plcTaskNo, UPI = upiObj.UPI, Length = upiObj.Length, diff --git "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Inbound/2\343\200\201DataProcess_RobotBuffer_FinishTask.cs" "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Inbound/2\343\200\201DataProcess_RobotBuffer_FinishTask.cs" index aa9dbd8..0748d2f 100644 --- "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Inbound/2\343\200\201DataProcess_RobotBuffer_FinishTask.cs" +++ "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Inbound/2\343\200\201DataProcess_RobotBuffer_FinishTask.cs" @@ -95,6 +95,21 @@ var place = StationHandler.GetPlaceByPlaceCode(task.PlaceCode, wmsDB); place.PlaceStatus = (int)PlaceStatusEnum.姝e父; + //缁橮LC鎺ㄩ�佷换鍔″畬鎴愮‘璁や俊鍙� + using (StationServiceClient client = new StationServiceClient()) + { + var res = await client.InboundFinishConfirmAsync((int)EDevice.Station, rgvLocation); + if (!res.result) + { + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTask = $"{rgvLocation.ToString()}-涓嬪彂鍏ュ簱浠诲姟 澶辫触,InboundFinishConfirmAsync 杩斿洖:{res.resMsg}"; + continue; + } + else + { + Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-涓嬪彂鍏ュ簱浠诲姟 鎴愬姛,InboundFinishConfirmAsync锛屽弬鏁�: 绔欑偣{rgvLocation}"); + } + } + wmsDB.SaveChanges(); } } diff --git "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/1\343\200\201DataProcess_RobotBuffer_AutoQiTaoOutbound.cs" "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/1\343\200\201DataProcess_RobotBuffer_AutoQiTaoOutbound.cs" index 745dbde..a63b897 100644 --- "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/1\343\200\201DataProcess_RobotBuffer_AutoQiTaoOutbound.cs" +++ "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/1\343\200\201DataProcess_RobotBuffer_AutoQiTaoOutbound.cs" @@ -60,10 +60,11 @@ //鐢熸垚鍑哄簱浠诲姟 //璁板綍浠诲姟 var _id = Yitter.IdGenerator.YitIdHelper.NextId(); + var plcTaskNo = BusinessHelper.CreatePlcTaskIdForSrmTask(); var new_task = new wms_rbline_task() { Id = _id, - TaskNo = _id.ToString(), + TaskNo = plcTaskNo, UPI = x.Upi, Length = x.Length, diff --git a/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs b/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs index b47ac53..bbd757c 100644 --- a/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs +++ b/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs @@ -118,6 +118,13 @@ /// </summary> [Description("鏀炬枡Y鍋忕Щ")] public string W_Y_Offset { get; set; } + + /// <summary> + /// 鍏ュ簱瀹屾垚宸茬‘璁� + /// </summary> + [Description("鍏ュ簱瀹屾垚宸茬‘璁�")] + public bool W_InboundFinishConfirm { get; set; } + } /// <summary> diff --git a/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvDBForRead.cs b/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvDBForRead.cs index 3b76f37..a4f0d62 100644 --- a/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvDBForRead.cs +++ b/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvDBForRead.cs @@ -17,81 +17,7 @@ /// </summary> [Description("蹇冭烦")] public string R_HandShake { get; set; } - - - /// <summary> - /// 1015鎵爜 - /// </summary> - [Description("1015鎵爜")] - public string R_1015_Scan { get; set; } - - /// <summary> - /// 1019鎵爜 - /// </summary> - [Description("1019鎵爜")] - public string R_1019_Scan { get; set; } - - /// <summary> - /// 1019鍙戝姩鏈虹殑鎵爜 - /// </summary> - [Description("1019鍙戝姩鏈虹殑鎵爜")] - public string R_1019_CargoNoScan { get; set; } - - /// <summary> - /// 1002鎵爜 - /// </summary> - [Description("1002鎵爜")] - public string R_1002_Scan { get; set; } - - /// <summary> - /// 1004鎵爜 - /// </summary> - [Description("1004鎵爜")] - public string R_1004_Scan { get; set; } - - /// <summary> - /// 1006鎵爜 - /// </summary> - [Description("1006鎵爜")] - public string R_1006_Scan { get; set; } - - - /// <summary> - /// 1007鎵爜 - /// </summary> - [Description("1007鎵爜")] - public string R_1007_Scan { get; set; } - - /// <summary> - /// 1009鐨�1灞傛娴嬪厜鐢� - /// </summary> - [Description("1009鐨�1灞傛娴嬪厜鐢�")] - public string R_1009_High1 { get; set; } - - /// <summary> - /// 1009鐨�2灞傛娴嬪厜鐢� - /// </summary> - [Description("1009鐨�2灞傛娴嬪厜鐢�")] - public string R_1009_High2 { get; set; } - - /// <summary> - /// 1009鐨�3灞傛娴嬪厜鐢� - /// </summary> - [Description("1009鐨�3灞傛娴嬪厜鐢�")] - public string R_1009_High3 { get; set; } - - /// <summary> - /// Station浠诲姟瀹屾垚 - /// </summary> - [Description("Station浠诲姟瀹屾垚")] - public string R_Station_Finish { get; set; } - - - /// <summary> - /// Station褰撳墠鍧愭爣 - /// </summary> - [Description("Station褰撳墠鍧愭爣")] - public string R_Station_Coordinate { get; set; } + #region 璇荤殑绔欑偣 diff --git a/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvDBForWrite.cs b/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvDBForWrite.cs index 2c463ce..e37082f 100644 --- a/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvDBForWrite.cs +++ b/SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvDBForWrite.cs @@ -19,95 +19,6 @@ [Description("蹇冭烦")] public string W_HandShake { get; set; } - /// <summary> - /// 1015閲嶆柊鎵爜锛屽啓涓簍rue琛ㄧず閲嶆柊鎵爜锛屽啓涓篺alse锛岃〃绀哄叧闂噸鏂版壂鐮併�傚綋wcs璇诲埌鍊煎悗锛屽氨鍐欎负false - /// </summary> - [Description("1015閲嶆柊鎵爜")] - public string W_1015_ReScan { get; set; } - - /// <summary> - /// 1019閲嶆柊鎵爜锛屽啓涓簍rue琛ㄧず閲嶆柊鎵爜锛屽啓涓篺alse锛岃〃绀哄叧闂噸鏂版壂鐮併�傚綋wcs璇诲埌鍊煎悗锛屽氨鍐欎负false - /// </summary> - [Description("1019閲嶆柊鎵爜")] - public string W_1019_ReScan { get; set; } - - /// <summary> - /// Station_瀹屾垚ACK - /// </summary> - [Description("Station_瀹屾垚ACK")] - public string W_Station_FinishACK { get; set; } - - - /// <summary> - /// 1002鎵弿澶辫触淇″彿 - /// </summary> - [Description("1002鎵弿澶辫触淇″彿")] - public string W_1002_ScanFailACK { get; set; } - - /// <summary> - /// 1004鎵弿澶辫触淇″彿 - /// </summary> - [Description("1004鎵弿澶辫触淇″彿")] - public string W_1004_ScanFailACK { get; set; } - - /// <summary> - /// 1006鎵弿澶辫触淇″彿 - /// </summary> - [Description("1006鎵弿澶辫触淇″彿")] - public string W_1006_ScanFailACK { get; set; } - - /// <summary> - /// 1007鎵弿澶辫触淇″彿 - /// </summary> - [Description("1007鎵弿澶辫触淇″彿")] - public string W_1007_ScanFailACK { get; set; } - - - /// <summary> - /// 1002鎵弿鎴愬姛淇″彿 - /// </summary> - [Description("1002鎵弿鎴愬姛淇″彿")] - public string W_1002_ScanSuccessACK { get; set; } - - /// <summary> - /// 1004鎵弿鎴愬姛淇″彿 - /// </summary> - [Description("1004鎵弿鎴愬姛淇″彿")] - public string W_1004_ScanSuccessACK { get; set; } - - /// <summary> - /// 1006鎵弿鎴愬姛淇″彿 - /// </summary> - [Description("1006鎵弿鎴愬姛淇″彿")] - public string W_1006_ScanSuccessACK { get; set; } - - /// <summary> - /// 1007鎵弿鎴愬姛淇″彿 - /// </summary> - [Description("1007鎵弿鎴愬姛淇″彿")] - public string W_1007_ScanSuccessACK { get; set; } - - - /// <summary> - /// 鍑哄簱鍙戝姩鏈虹殑鍨嬪彿 銆怑ditby shaocx,2023-07-23銆� - /// </summary> - [Description("鍑哄簱鍙戝姩鏈虹殑鍨嬪彿")] - public string W_Out_MaterialModel { get; set; } - - /// <summary> - /// 鍑哄簱鍙戝姩鏈虹殑璁㈣揣鍙� 銆怑ditby shaocx,2023-07-23銆� - /// </summary> - [Description("鍑哄簱鍙戝姩鏈虹殑璁㈣揣鍙�")] - public string W_Out_OrderNo { get; set; } - - /// <summary> - /// 鍑哄簱鍙戝姩鏈虹殑缂栧彿 銆怑ditby shaocx,2023-07-23銆� - /// </summary> - [Description("鍑哄簱鍙戝姩鏈虹殑缂栧彿")] - public string W_Out_SerialNumber { get; set; } - - - #region 鍐欑殑绔欑偣 diff --git a/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs b/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs index 8d0dff3..5841fab 100644 --- a/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs +++ b/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs @@ -199,7 +199,7 @@ if (!b2.result) { msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + true + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - this.DBBlockForWrite.W_1015_ReScan); + stationObj.W_DataFinish); return false; } int i_result = 0; @@ -215,7 +215,7 @@ if (!b2.result) { msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + value + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - this.DBBlockForWrite.W_1015_ReScan); + stationObj.W_DataFinish); return false; } return true; @@ -224,7 +224,36 @@ { msg = ex.Message; var logcontext = string.Format("鍚慡tation鍦板潃{0} " + value + "鍑虹幇寮傚父:" + JsonConvert.SerializeObject(ex), - this.DBBlockForWrite.W_1015_ReScan); + ""); + Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, logcontext, ex); + return false; + } + } + + + public bool InboundFinishConfirm(string stationCode, 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_InboundFinishConfirm, true, view_stationObj.W_DataFinish); + if (!b2.result) + { + msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + true + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, + stationObj.W_InboundFinishConfirm); + 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; } @@ -242,7 +271,7 @@ if (!b2.result) { msg = string.Format("鍚慡tation鍦板潃{0} 鍐� 璇荤爜瑙f瀽瀹屾垚 " + true + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - this.DBBlockForWrite.W_1015_ReScan); + stationObj.W_DataFinish); return false; } @@ -250,7 +279,7 @@ if (!b2.result) { msg = string.Format("鍚慡tation鍦板潃{0} 鍐� 搴撲綅鍙� " + toPlaceNo + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - this.DBBlockForWrite.W_1015_ReScan); + stationObj.W_Destination_In); return false; } @@ -258,21 +287,21 @@ if (!b2.result) { msg = string.Format("鍚慡tation鍦板潃{0} 鍐� 闀垮害 " + length + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - this.DBBlockForWrite.W_1015_ReScan); + 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, - this.DBBlockForWrite.W_1015_ReScan); + 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, - this.DBBlockForWrite.W_1015_ReScan); + stationObj.W_Height); return false; } @@ -298,51 +327,8 @@ /// <returns></returns> public bool WriteStation_FinishACK(int deviceId, bool value, int plcTaskId, out string msg) { - try - { - msg = ""; - Thread.Sleep(1000);//鍋滅暀2绉� - MessageModel b2 = this.plcService.WriteValuePoint(this.DBBlockForWrite.W_Station_FinishACK, value, this.View.W_Station_FinishACK); - if (!b2.result) - { - msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + value + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - this.DBBlockForWrite.W_Station_FinishACK); - Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, msg, null); - return false; - } - //閲嶆柊鍐嶈鍙栵紝鍒ゆ柇鏄惁鍐欏叆姝g‘锛屽鏋滃啓鍏ヤ笉姝g‘锛屽氨璁や负澶辫触 銆怑ditby shaocx,2023-04-03銆� - Thread.Sleep(1000);//鍋滅暀3绉� - bool finishStation = (bool)this.plcService.ReadValuePoint(this.DBBlockForRead.R_Station_Finish, typeof(bool)); - bool finisAck = (bool)this.plcService.ReadValuePoint(this.DBBlockForWrite.W_Station_FinishACK, typeof(bool)); - if (finisAck == false && finishStation == true) - { - this.plcService.WriteValuePoint(this.DBBlockForWrite.W_Station_FinishACK, value, this.View.W_Station_FinishACK);//閲嶅彂涓�娆� 20230503 鐜嬮摦 - Thread.Sleep(1000);//鍋滅暀2绉� - finishStation = (bool)this.plcService.ReadValuePoint(this.DBBlockForRead.R_Station_Finish, typeof(bool)); - finisAck = (bool)this.plcService.ReadValuePoint(this.DBBlockForWrite.W_Station_FinishACK, typeof(bool)); - if (finisAck == false && finishStation == true) - { - - msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + value + "澶辫触,SDA杩斿洖缁撴灉:true锛屼絾鏄疭DA鍐嶆璇诲彇PLC鐨勫湴鍧�鏃讹紝鑾峰彇鐨勭粨鏋滄槸FALSE锛屽嵆璁ゅ畾涓哄啓鍏ュけ璐�", - this.DBBlockForWrite.W_Station_FinishACK); - Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, msg, null); - return false; - } - - - } - - Log4NetHelper.WriteInfoLog(Station_CacheEntity.curLogType, "鍐欏叆W_Station_FinishACK锛�" + this.DBBlockForWrite.W_Station_FinishACK + "锛夊�间负" + value + "鎴愬姛锛佸洜涓篜LC浠诲姟鍙�:" + plcTaskId); - return true; - } - catch (Exception ex) - { - msg = ex.Message; - var logcontext = string.Format("鍚慡tation鍦板潃{0} " + value + "鍑虹幇寮傚父:" + JsonConvert.SerializeObject(ex), - this.DBBlockForWrite.W_Station_FinishACK); - Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, logcontext, ex); - return false; - } + msg = ""; + return false; } @@ -356,93 +342,7 @@ public bool WriteScanValidateACK(bool isReset, int deviceId, string stationCode, bool value, int plcTaskId, out string msg) { msg = ""; - MessageModel b2 = null; - string address_fail = ""; - string address_success = ""; - try - { - switch (stationCode) - { - case "1002": - address_fail = this.DBBlockForWrite.W_1002_ScanFailACK; - address_success = this.DBBlockForWrite.W_1002_ScanSuccessACK; - break; - case "1004": - address_fail = this.DBBlockForWrite.W_1004_ScanFailACK; - address_success = this.DBBlockForWrite.W_1004_ScanSuccessACK; - break; - case "1006": - address_fail = this.DBBlockForWrite.W_1006_ScanFailACK; - address_success = this.DBBlockForWrite.W_1006_ScanSuccessACK; - break; - case "1007": - address_fail = this.DBBlockForWrite.W_1007_ScanFailACK; - address_success = this.DBBlockForWrite.W_1007_ScanSuccessACK; - break; - default: - throw new Exception("涓嶆敮鎸佺殑绔欑偣"); - } - if (isReset) - {//鏄噸缃� - b2 = this.plcService.WriteValuePoint(address_success, false, this.View.W_1002_ScanSuccessACK); - if (!b2.result) - { - msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + false + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - address_success); - Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, msg, null); - return false; - } - b2 = this.plcService.WriteValuePoint(address_fail, false, this.View.W_1002_ScanFailACK); - if (!b2.result) - { - msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + false + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - address_fail); - Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, msg, null); - return false; - } - } - else - {//涓嶆槸閲嶇疆 - if (value) - {//琛ㄧず鎵弿楠岃瘉閫氳繃 - b2 = this.plcService.WriteValuePoint(address_success, true, this.View.W_1002_ScanSuccessACK); - if (!b2.result) - { - msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + true + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - address_success); - Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, msg, null); - return false; - } - } - else - {//琛ㄧず鎵弿楠岃瘉涓嶉�氳繃 - b2 = this.plcService.WriteValuePoint(address_fail, true, this.View.W_1002_ScanFailACK); - if (!b2.result) - { - msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + true + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - address_fail); - Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, msg, null); - return false; - } - } - } - - Log4NetHelper.WriteInfoLog(Station_CacheEntity.curLogType, "WriteScanFailACK鏂规硶锛屽啓鍏� 鍥涗釜鍏ュ簱鍙f壂鎻忓け璐CK璧嬪�� ScanFailACK锛�" + address_fail + "锛夊�间负" + value + "鎴愬姛锛佸洜涓篜LC浠诲姟鍙�:" + plcTaskId + ",isReset:" + isReset); - return true; - } - catch (Exception ex) - { - msg = ex.Message; - var logcontext = string.Format("WriteScanFailACK鏂规硶锛屽悜Station鍦板潃{0} " + value + "鍑虹幇寮傚父:" + JsonConvert.SerializeObject(ex), - address_fail); - if (value) - { - logcontext = string.Format("WriteScanFailACK鏂规硶锛屽悜Station鍦板潃{0} " + value + "鍑虹幇寮傚父:" + JsonConvert.SerializeObject(ex), - address_success); - } - Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, logcontext, ex); - return false; - } + return false; } @@ -646,33 +546,6 @@ try { msg = ""; - MessageModel b2 = this.plcService.WriteValuePoint(this.DBBlockForWrite.W_Out_MaterialModel, value__Out_MaterialModel, this.View.W_Out_MaterialModel); - if (!b2.result) - { - msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + value__Out_MaterialModel + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - this.DBBlockForWrite.W_Out_MaterialModel); - Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, msg, null); - return false; - } - b2 = this.plcService.WriteValuePoint(this.DBBlockForWrite.W_Out_OrderNo, value_Out_OrderNo, this.View.W_Out_OrderNo); - if (!b2.result) - { - msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + value_Out_OrderNo + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - this.DBBlockForWrite.W_Out_OrderNo); - Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, msg, null); - return false; - } - b2 = this.plcService.WriteValuePoint(this.DBBlockForWrite.W_Out_SerialNumber, value_Out_SerialNumber, this.View.W_Out_SerialNumber); - if (!b2.result) - { - msg = string.Format("鍚慡tation鍦板潃{0} 鍐� " + value_Out_SerialNumber + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, - this.DBBlockForWrite.W_Out_SerialNumber); - Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, msg, null); - return false; - } - - - Log4NetHelper.WriteInfoLog(Station_CacheEntity.curLogType, $"鍐欏叆 鍙戝姩鏈哄嚭搴擄紝缁欒タ娓疨LC鍙戦�佸彂鍔ㄦ満鏁版嵁鎴愬姛锛佷换鍔″彿{plcTaskId},鏈哄瀷{value__Out_MaterialModel}锛岃璐у彿{value_Out_OrderNo},缂栧彿{value_Out_SerialNumber}" + plcTaskId); return true; } catch (Exception ex) diff --git a/SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs b/SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs index 11d0cda..2298f85 100644 --- a/SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs +++ b/SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs @@ -137,6 +137,7 @@ #region 鍐欏叆 // W_HandShake = W_DBHeaderWithSeparate + "0.0", + #endregion }; @@ -178,51 +179,6 @@ return _dbBlockForWrite; } - ///// <summary> - ///// 璇诲彇鍦板潃闆嗗悎璧嬪�� - ///// </summary> - ///// <param name="_dbBlockForWrite"></param> - ///// <param name="_dbBlockForRead"></param> - //private static StationDBForWrite SetW_StationForWriteCommList2() - //{ - // StationDBForWrite _dbBlockForRead = new StationDBForWrite() - // { - // //TODO:杩欓噷鍐欓厤缃殑DB鍦板潃 - // #region 璇诲彇 - // W_HandShake = "0.0", - - // #endregion - // }; - - // //璇诲彇鍦板潃 - // double default_STP = 2.0; - // double default_Destination = 4.0; - // double default_TaskID = 6.0; - - // int addValue = 16; - // _dbBlockForRead.W_StationForWriteCommList = new List<StationDBForWriteComm>(); - // for (int i = 0; i < WareSdaStruct.StationStationList.Count; i++) - // { - // var stationCode = WareSdaStruct.StationStationList[i]; - // if (i > 0) - // { - // default_STP += addValue; - // default_Destination += addValue; - // default_TaskID += addValue; - // } - // _dbBlockForRead.W_StationForWriteCommList.Add(new StationDBForWriteComm() - // { - // StationCode = stationCode, - // W_STP = default_STP.ToString("0.0"), - // W_Destination = default_Destination.ToString("0.0"), - // W_TaskID = default_TaskID.ToString("0.0"), - // }); - - // } - - // return _dbBlockForRead; - - //} /// <summary> /// 璇诲彇鍦板潃闆嗗悎璧嬪�� @@ -235,24 +191,9 @@ { //TODO:杩欓噷鍐欓厤缃殑DB鍦板潃 #region 璇诲彇 - R_HandShake = R_DBHeaderWithSeparate + "0.0", + // R_HandShake = R_DBHeaderWithSeparate + "0.0", - //娉ㄦ剰锛氳繖閲岀敤鐨勬壂鎻忕殑鍦板潃鍧� - R_1015_Scan = R_DBHeader_ScanWithSeparate + "48.0", - R_1019_Scan = R_DBHeader_ScanWithSeparate + "356.0", - R_1019_CargoNoScan = R_DBHeader_ScanWithSeparate + "378.0", - R_1002_Scan = R_DBHeader_ScanWithSeparate + "108.0", - R_1004_Scan = R_DBHeader_ScanWithSeparate + "168.0", - R_1006_Scan = R_DBHeader_ScanWithSeparate + "228.0", - R_1007_Scan = R_DBHeader_ScanWithSeparate + "288.0", - R_1009_High1 = R_DBHeader_ScanWithSeparate + "300.0", - R_1009_High2 = R_DBHeader_ScanWithSeparate + "300.1", - R_1009_High3 = R_DBHeader_ScanWithSeparate + "300.2", - - R_Station_Finish = R_DBHeaderWithSeparate + "349.0", - - R_Station_Coordinate = R_DBHeader_ScanWithSeparate + "304.0" - + R_StationForReadCommList = new List<StationDBForReadComm>() #endregion }; diff --git a/SDA/iWareSda/Devices/4-Station/StationService/IStationService.cs b/SDA/iWareSda/Devices/4-Station/StationService/IStationService.cs index 96edda3..7a1538b 100644 --- a/SDA/iWareSda/Devices/4-Station/StationService/IStationService.cs +++ b/SDA/iWareSda/Devices/4-Station/StationService/IStationService.cs @@ -93,6 +93,15 @@ SdaResEntity WriteQiTaoInfo(int deviceId, string stationCode, bool value); /// <summary> + /// 鍏ュ簱瀹屾垚宸茬‘璁� + /// </summary> + /// <param name="deviceId"></param> + /// <param name="value"></param> + /// <returns></returns> + [OperationContract] + SdaResEntity InboundFinishConfirm(int deviceId, string stationCode); + + /// <summary> /// 鍐欏叆鍏ュ簱浠诲姟淇℃伅 /// </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 992ebbe..b7eb1da 100644 --- a/SDA/iWareSda/Devices/4-Station/StationService/StationService.cs +++ b/SDA/iWareSda/Devices/4-Station/StationService/StationService.cs @@ -439,6 +439,38 @@ } /// <summary> + /// 鍏ュ簱瀹屾垚宸茬‘璁� + /// </summary> + /// <param name="deviceId"></param> + /// <param name="value"></param> + /// <returns></returns> + public SdaResEntity InboundFinishConfirm(int deviceId, 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.InboundFinishConfirm(stationCode, 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> -- Gitblit v1.9.3