From 27daf7546721754a451b5df16bb716c1cbb33458 Mon Sep 17 00:00:00 2001
From: chengsc <Demo@DESKTOP-CPA90BF>
Date: 星期六, 19 十月 2024 19:06:43 +0800
Subject: [PATCH] 修改问题

---
 Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs |   44 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
index 355b71a..4f495a4 100644
--- a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -131,7 +131,7 @@
         }
 
         //鑾峰彇鍏ュ簱鍗曟槑缁嗗墿浣欐墦鍗版暟閲�
-        public string GetAsnDetailQtyList(int id)
+        public LabelPrintInfoDto GetAsnDetailQtyList(int id)
         {
             try
             {
@@ -140,11 +140,29 @@
                 {
                     throw new Exception("鏈煡璇㈠埌鍏ュ簱鍗曟槑缁�");
                 }
+                var data = new LabelPrintInfoDto();
+                
+                var notice = Db.Queryable<BllArrivalNotice>().Where(m => m.IsDel == "0" && m.ASNNo == detail.ASNNo).First();
+                if (notice != null && notice.Type == "4") //鍒ゆ柇鏄惁鏄綑鏂欓��鍥炲崟
+                {
+                    var noticeStr = Db.Queryable<BllArrivalNotice>().Where(m => m.Type == "1").Select(m => m.ASNNo).ToList();
+                    var detailOld = Db.Queryable<BllArrivalNoticeDetail>().Where(m => m.IsDel == "0" && noticeStr.Contains(m.ASNNo) && m.SkuNo == detail.SkuNo && m.LotNo == detail.LotNo).OrderByDescending(m => m.CreateTime).First();
+                    if (detailOld != null)
+                    {
+                        var boxInfo = Db.Queryable<BllBoxInfo>().First(m => m.IsDel == "0" && m.ASNNo == detailOld.ASNNo);
+                        if (boxInfo!= null)
+                        {
+                            data.ProductionTime = boxInfo.ProductionTime!= null ? ((DateTime)boxInfo.ProductionTime).ToString("yyyy-MM-dd"):"";
+                            data.ExpirationTime = boxInfo.ExpirationTime != null ? ((DateTime)boxInfo.ExpirationTime).ToString("yyyy-MM-dd") : "";
+                            data.StoreTime = boxInfo.StoreTime != null ? ((DateTime)boxInfo.StoreTime).ToString("yyyy-MM-dd") : "";
+                        }
+                    }
+                }
 
                 var labelQty = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.ASNDetailNo == id).Sum(m => m.Qty);
                 var qty = detail.Qty - labelQty;
-
-                return qty.ToString();
+                data.Qty = qty.ToString();
+                return data;
             }
             catch (Exception e)
             {
@@ -1051,10 +1069,22 @@
         }
 
         //璁㈠崟鍥炰紶涓婃父绯荤粺
-        public bool FinishAsn(int id, string erpUrl, string mesUrl,string mesTokenUrl, int userId)
+        public bool FinishAsn(int id, string erpUrl, string mesUrl,string mesTokenUrl,string userNo,string pwd, int userId)
         {
             try
             {
+                var loginPwd = Md5Tools.CalcMd5(pwd);
+                var date = Db.Queryable<SysUserInfor>().First(m =>m.IsDel=="0" && m.UserName == userNo && m.PassWord == loginPwd);
+
+                if (date == null) //璐﹀彿瀵嗙爜鏄惁姝g‘
+                {
+                   throw new Exception("璐﹀彿瀵嗙爜涓嶆纭垨娌℃湁姝よ处鍙�");
+                }
+                if (date.Status != "0") //褰撳墠璐﹀彿鏄惁姝e父鍚敤
+                {
+                    throw new Exception("褰撳墠璐﹀彿闈炲惎鐢ㄧ姸鎬�");
+                }
+
                 var notice = Db.Queryable<BllArrivalNotice>().First(m => m.Id == id && m.IsDel == "0");
                 if (notice == null)
                 {
@@ -1069,7 +1099,7 @@
                 {
                     throw new Exception("鏈煡璇㈠埌鍗曟嵁鏄庣粏淇℃伅");
                 }
-                if (userId == notice.UpdateUser)
+                if (date.Id == notice.UpdateUser)
                 {
                     throw new Exception("澶嶆牳澶辫触锛屽鏍镐汉鍛樺拰鍏抽棴璁㈠崟浜哄憳涓嶈兘鐩稿悓锛�");
                 }
@@ -1150,10 +1180,10 @@
 
                 notice.Status = "4";
                 notice.CheckTime = DateTime.Now;
-                notice.CheckUser = userId;
+                notice.CheckUser = date.Id;
                 Db.Updateable(notice).ExecuteCommand();
 
-                new OperationASNServer().AddLogOperationAsn("鍏ュ簱浣滀笟", "鍏ュ簱鍗曟嵁", notice.ASNNo, "澶嶆牳", $"澶嶆牳浜嗗崟鎹彿涓簕notice.ASNNo}鐨勫崟鎹俊鎭�", userId);
+                new OperationASNServer().AddLogOperationAsn("鍏ュ簱浣滀笟", "鍏ュ簱鍗曟嵁", notice.ASNNo, "澶嶆牳", $"{date.RealName}澶嶆牳浜嗗崟鎹彿涓簕notice.ASNNo}鐨勫崟鎹俊鎭�", userId);
                 return true;
             }
             catch (Exception e)

--
Gitblit v1.8.0