From 17e8b649951cd9dbfa7ad77173f5830a678de313 Mon Sep 17 00:00:00 2001
From: zongzhibin <zongzhibin@weben-smart.com>
Date: 周六, 30 11月 2024 17:26:24 +0800
Subject: [PATCH] add

---
 CC/iWareCC_ASRS/ThreadService/04_BZ21(搬运整垛机器人)/DataProcess_BZ21.cs |   77 +++++++++++++++++++++++++++++---------
 1 files changed, 58 insertions(+), 19 deletions(-)

diff --git "a/CC/iWareCC_ASRS/ThreadService/04_BZ21\357\274\210\346\220\254\350\277\220\346\225\264\345\236\233\346\234\272\345\231\250\344\272\272\357\274\211/DataProcess_BZ21.cs" "b/CC/iWareCC_ASRS/ThreadService/04_BZ21\357\274\210\346\220\254\350\277\220\346\225\264\345\236\233\346\234\272\345\231\250\344\272\272\357\274\211/DataProcess_BZ21.cs"
index 20fa695..5778a5c 100644
--- "a/CC/iWareCC_ASRS/ThreadService/04_BZ21\357\274\210\346\220\254\350\277\220\346\225\264\345\236\233\346\234\272\345\231\250\344\272\272\357\274\211/DataProcess_BZ21.cs"
+++ "b/CC/iWareCC_ASRS/ThreadService/04_BZ21\357\274\210\346\220\254\350\277\220\346\225\264\345\236\233\346\234\272\345\231\250\344\272\272\357\274\211/DataProcess_BZ21.cs"
@@ -1,4 +1,5 @@
 锘縰sing Admin.NET.Application;
+using iWareCC.Common.Helper;
 using iWareCC.StationService;
 using iWareCommon.Common.Globle;
 using iWareCommon.Utils;
@@ -64,7 +65,6 @@
                                 SystemWarningMsg._lbl_alert_DataProcess_BZ21 = $"{rgvLocation.ToString()}-璇锋眰浜嗚В鐮侊紝浣嗘槸缁撴灉鏄┖鐨�,姝ゆ寰幆缁撴潫";
                                 continue;
                             }
-                            var upiCode = result.Replace("/r", ""); ;
                             short cartonwidth = 0;//绾哥瀹�
                             short cartonhigh = 0;//绾哥楂�
                             string place = "22";
@@ -77,27 +77,54 @@
                                     SystemWarningMsg._lbl_alert_DataProcess_BZ21 = $"{rgvLocation.ToString()}-鏈夆�樺凡涓嬪彂鈥欑殑浠诲姟锛屼笉鑳藉鐞�,姝ゆ寰幆缁撴潫";
                                     continue;
                                 }
-                                var upiObj = wmsDB.mes_batchOrderUPI_new.Where(x => x.UPI == upiCode).FirstOrDefault();
+                                var upiObj = wmsDB.mes_batchOrderUPI_new.Where(x => x.UPI == result).FirstOrDefault();
                                 if (upiObj == null)
                                 {
-                                    SystemWarningMsg._lbl_alert_DataProcess_BZ21 = $"{rgvLocation.ToString()},鏍规嵁UPI:{upiCode}娌℃湁鎵惧埌瀵硅薄 ";
+                                    SystemWarningMsg._lbl_alert_DataProcess_BZ21 = $"{rgvLocation.ToString()},鏍规嵁UPI:{result}娌℃湁鎵惧埌瀵硅薄 ";
                                     continue;
                                 }
-                                string upi = "LS070700101B0001GS";
-                                var res =new HTTPService("http://172.17.1.22:44374/api/LuLi/").getContent<Respone>("cartons-machine?PackageCode="+upi, Guid.NewGuid(),10000);
-                                if (res.iState == 0)
-                                {
-                                    var papercut = ClassHelper.RotationMapping<mes_push_papercut, mes_batchOrderUPI_new>(upiObj);
-                                    papercut.Id = Yitter.IdGenerator.YitIdHelper.NextId();
-                                    papercut.ApiMessage = res.message;
-                                    papercut.PushStatus = (int)PushStatusEnum.PushSuccess;
-                                    wmsDB.mes_push_papercut.Add(papercut);
-                                }
-                                else
-                                {
-
-                                    continue;
-                                }
+                                //string upi = "LS070700101B0001GS";
+                                ////璋冪敤鍑虹焊鏈烘帴鍙�
+                                //var res =new HTTPService("http://172.17.1.22:44374/api/LuLi/").getContent<Respone>("cartons-machine?PackageCode="+upi, Guid.NewGuid(),10000);
+                                //if (res.iState == 0)
+                                //{
+                                //    var papertable = wmsDB.mes_push_papercut.Where(x => x.PackageCode == upiObj.PackageCode).OrderByDescending(x => x.Id).FirstOrDefault();
+                                //    if (papertable != null)
+                                //    {
+                                //        papertable.PushStatus = (int)PushStatusEnum.PushSuccess;
+                                //        papertable.ApiMessage = res.message;
+                                //        papertable.PushNum++;
+                                //    }
+                                //    else
+                                //    {
+                                //        var papercut = ClassHelper.RotationMapping<mes_push_papercut, mes_batchOrderUPI_new>(upiObj);
+                                //        papercut.Id = Yitter.IdGenerator.YitIdHelper.NextId();
+                                //        papercut.ApiMessage = res.message;
+                                //        papercut.PushNum = 0;
+                                //        papercut.PushStatus = (int)PushStatusEnum.PushSuccess;
+                                //        wmsDB.mes_push_papercut.Add(papercut);
+                                //    }
+                                //}
+                                //else
+                                //{
+                                //    var papertable = wmsDB.mes_push_papercut.Where(x => x.PackageCode == upiObj.PackageCode).OrderByDescending(x => x.Id).FirstOrDefault();
+                                //    if (papertable != null)
+                                //    {
+                                //        papertable.PushStatus = (int)PushStatusEnum.PushFail;
+                                //        papertable.ApiMessage = res.message;
+                                //        papertable.PushNum++;
+                                //    }
+                                //    else
+                                //    {
+                                //        var papercut = ClassHelper.RotationMapping<mes_push_papercut, mes_batchOrderUPI_new>(upiObj);
+                                //        papercut.Id = Yitter.IdGenerator.YitIdHelper.NextId();
+                                //        papercut.ApiMessage = res.message;
+                                //        papercut.PushNum = 0;
+                                //        papercut.PushStatus = (int)PushStatusEnum.PushFail;
+                                //        wmsDB.mes_push_papercut.Add(papercut);
+                                //    }
+                                //    continue;
+                                //}
                                 //鏇存柊琛�
                                 var mesgather = wmsDB.mes_package_gather.Where(x => x.PackageCode == upiObj.PackageCode).FirstOrDefault();
                                 if (mesgather != null)
@@ -165,6 +192,7 @@
                                 print.PrintNum= 0;
                                 print.PrintStatus = (int)PrintStatuEnum.鏈墦鍗�;
                                 print.IsAllowPrint= true;
+                                print.CreateTime = print.UpdateTime = DateTime.Now;
                                 wmsDB.wms_record_print.Add(print);
                                 wms_record_print printtwo = print;
                                 printtwo.Id= Yitter.IdGenerator.YitIdHelper.NextId();
@@ -173,6 +201,17 @@
                                 wmsDB.mes_package_linequeue.Add(mesinequeue);
                                 wmsDB.wms_rbline_task.Add(task); 
                                 wmsDB.mes_push_packagecode.Add(putpakegecode);
+
+                                //澶勭悊琛�  mes_order_gather
+                                var errmsg = "";
+                                var package = wmsDB.mes_package_gather.Where(x => x.PackageCode == upiObj.PackageCode).FirstOrDefault();
+                                var resultAlert = MyExtendHelper.HandlerOrderGather(wmsDB, package, "", "", out errmsg);
+                                if (resultAlert == false)
+                                {
+                                    SystemWarningMsg._lbl_alert_DataProcess_BZ21 = errmsg;
+                                    continue;
+                                }
+
                                 using (StationServiceClient client = new StationServiceClient())
                                 {
 
@@ -196,7 +235,7 @@
                 }
                 catch (Exception ex)
                 {
-                    SystemWarningMsg._lbl_alert_DataProcess_BZ39 += " 鍑虹幇寮傚父:" + ex.Message + SysGloble.SPLIT_STR;
+                    SystemWarningMsg._lbl_alert_DataProcess_BZ21 += " 鍑虹幇寮傚父:" + ex.Message + SysGloble.SPLIT_STR;
                     Log4NetHelper.WriteErrorLog(logType, " 鍑虹幇寮傚父锛�" + ex.Message, ex);
                 }
             }

--
Gitblit v1.9.3