From bf1a9a818ffb721aea2709e9409fbb932b07e81d Mon Sep 17 00:00:00 2001
From: yyk <2336760928@qq.com>
Date: 星期四, 18 七月 2024 15:55:54 +0800
Subject: [PATCH] Merge branch 'master' into yyk

---
 Wms/Wms/Controllers/BllAsnController.cs |   90 +++++++++++++++++++++------------------------
 1 files changed, 42 insertions(+), 48 deletions(-)

diff --git a/Wms/Wms/Controllers/BllAsnController.cs b/Wms/Wms/Controllers/BllAsnController.cs
index acaa4b0..d92a29a 100644
--- a/Wms/Wms/Controllers/BllAsnController.cs
+++ b/Wms/Wms/Controllers/BllAsnController.cs
@@ -20,7 +20,7 @@
     [Route("api/[controller]/[action]")]
     [ApiController]
     [Authorize]
-    
+
     public class BllAsnController : ControllerBase
     {
         #region 渚濊禆娉ㄥ叆
@@ -36,7 +36,7 @@
         #endregion
 
         #region 鏋勯�犲嚱鏁�
-        public BllAsnController(IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc,IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc,IOperationASNServer logSvc, IPalletUnbindServer palletUnbind,IAuditLogServer auditLog,IBllLabelBoxNoServer labelBox, IProcurePlanServer procurePlanSvc)
+        public BllAsnController(IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc, IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc, IOperationASNServer logSvc, IPalletUnbindServer palletUnbind, IAuditLogServer auditLog, IBllLabelBoxNoServer labelBox, IProcurePlanServer procurePlanSvc)
         {
             _arrivalNoticeSvc = arrivalNoticeSvc;
             _PalletBindSvc = palletBindSvc;
@@ -57,33 +57,23 @@
         /// <param name="model">鏌ヨ鏉′欢</param>
         /// <returns>鍏ュ簱鍗曚俊鎭�</returns>
         [HttpPost]
-        public IActionResult GetArrivalNoticeList(ArrivalNoticeVm model)
+        [ServiceFilter(typeof(ApiResponseActionFilter))]
+        public async Task<SqlSugarPagedList> GetArrivalNoticeList(ArrivalNoticeVm model)
         {
-            try
-            {
-                var models = _arrivalNoticeSvc.GetArrivalNoticeList(model, out int count);
 
-                return Ok(new { code = 0, count, msg = "鍏ュ簱鍗曚俊鎭�", data = models });
-            }
-            catch (Exception e)
-            {
-                return Ok(new { code = 1, msg = e.Message });
-            }
-        } 
+            RefAsync<int> count = new RefAsync<int>();
+            var bolls = await _arrivalNoticeSvc.GetArrivalNoticeList(model, count);
+            return new SqlSugarPagedList() { Items = bolls, Total = count };
+        }
+
 
         [HttpPost]
-        public IActionResult GetArrivalNoticeDetailList(ArrivalNoticeDetailVm model)
+        [ServiceFilter(typeof(ApiResponseActionFilter))]
+        public async Task<SqlSugarPagedList> GetArrivalNoticeDetailList(ArrivalNoticeDetailVm model)
         {
-            try
-            {
-                var models = _arrivalNoticeSvc.GetArrivalNoticeDetailList(model, out int count);
-
-                return Ok(new { code = 0, count, msg = "鍏ュ簱鍗曟槑缁嗕俊鎭�", data = models });
-            }
-            catch (Exception e)
-            {
-                return Ok(new { code = 1, msg = e.Message });
-            }
+            RefAsync<int> count = new RefAsync<int>();
+            var bolls = await _arrivalNoticeSvc.GetArrivalNoticeDetailList(model, count);
+            return new SqlSugarPagedList() { Items = bolls, Total = count };
         }
 
         /// <summary>
@@ -178,6 +168,10 @@
                 {
                     throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
                 }
+                if (string.IsNullOrWhiteSpace(model.ASNNo)) 
+                {
+                    throw new Exception("鍗曟嵁鍙蜂笉鍙负null!");
+                }
 
                 model.CreateUser = int.Parse(UserId);
                 string strMesage = _arrivalNoticeSvc.EditArrivalNotice(model);
@@ -188,7 +182,7 @@
                 }
                 if (strMesage.Contains("-1"))
                 {
-                    return Ok(new { code = 0, msg = "閮ㄥ垎鎴愬姛 "+ strMesage });
+                    return Ok(new { code = 0, msg = "閮ㄥ垎鎴愬姛 " + strMesage });
                 }
                 else
                 {
@@ -276,7 +270,7 @@
         /// <param name="reason"></param>
         /// <returns></returns>
         [HttpGet]
-        public IActionResult CancelOrder(int id,string reason)
+        public IActionResult CancelOrder(int id, string reason)
         {
             try
             {
@@ -290,12 +284,12 @@
                 {
                     throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
                 }
-                 
-                _arrivalNoticeSvc.CancelOrder(id,reason,int.Parse(userId));
 
-                 
+                _arrivalNoticeSvc.CancelOrder(id, reason, int.Parse(userId));
+
+
                 return Ok(new { code = 0, msg = "鍏ュ簱鍗曟挙閿�鐢宠鎴愬姛" });
-                 
+
             }
             catch (Exception e)
             {
@@ -370,13 +364,13 @@
         }
 
         [HttpGet]
-        public IActionResult GetBoxInfoByBoxNo(string boxNo, string boxNo3,int bindNo=0)
+        public IActionResult GetBoxInfoByBoxNo(string boxNo, string boxNo3, int bindNo = 0)
         {
             try
             {
-                var models = _PalletBindSvc.GetBoxInfoByBoxNo(boxNo, boxNo3,bindNo);
+                var models = _PalletBindSvc.GetBoxInfoByBoxNo(boxNo, boxNo3, bindNo);
 
-                return Ok(new { code = 0, count= models.Count, msg = "绠辨敮鏄庣粏淇℃伅", data = models });
+                return Ok(new { code = 0, count = models.Count, msg = "绠辨敮鏄庣粏淇℃伅", data = models });
             }
             catch (Exception e)
             {
@@ -434,7 +428,7 @@
                 {
                     throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
                 }
-                _PalletBindSvc.DelBindBoxInfo(boxNo,int.Parse(userId));
+                _PalletBindSvc.DelBindBoxInfo(boxNo, int.Parse(userId));
 
                 return Ok(new { code = 0, count = 0, msg = "鍒犻櫎鎴愬姛", data = "" });
             }
@@ -466,7 +460,7 @@
                 {
                     throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
                 }
-                _PalletBindSvc.CancelPalletBind(id, reason,int.Parse(userId));
+                _PalletBindSvc.CancelPalletBind(id, reason, int.Parse(userId));
 
                 return Ok(new { code = 0, count = 0, msg = "鎵樼洏缁戝畾鎾ら攢鐢宠鎴愬姛", data = "" });
             }
@@ -490,7 +484,7 @@
             {
                 var list = _BoxInfoSvc.GetBoxInfoList(boxNo, isContinue, boxNo2);
                 var num = 0;
-                if (list!=null)
+                if (list != null)
                 {
                     num = list.Count;
                 }
@@ -516,7 +510,7 @@
         {
             try
             {
-                var models = _PalletBindSvc.GetLocateList("W01",model.RoadwayNo,model.Row,model.Column,model.Layer,model.LocateNo,model.StockDetailId, model.Page,model.Limit, out int count);
+                var models = _PalletBindSvc.GetLocateList("W01", model.RoadwayNo, model.Row, model.Column, model.Layer, model.LocateNo, model.StockDetailId, model.Page, model.Limit, out int count);
 
                 return Ok(new { code = 0, count, msg = "鑾峰彇鎸囧畾鍌ㄤ綅淇℃伅", data = models });
             }
@@ -546,7 +540,7 @@
                 {
                     throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
                 }
-                _PalletBindSvc.SaveAppointSlot(model.BindId,model.LocateId,int.Parse(userId));
+                _PalletBindSvc.SaveAppointSlot(model.BindId, model.LocateId, int.Parse(userId));
 
                 return Ok(new { code = 0, count = 0, msg = "鎸囧畾鍌ㄤ綅鎴愬姛", data = "" });
             }
@@ -698,7 +692,7 @@
                 RefAsync<int> count = new RefAsync<int>();
                 var bolls = await _taskSvc.GetTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, count);
 
-                return Ok(new { code = 0, count, msg = "鍏ュ簱浠诲姟淇℃伅", data = bolls });
+                return Ok(new { code = 0, count = count.Value, msg = "鍏ュ簱浠诲姟淇℃伅", data = bolls });
             }
             catch (Exception e)
             {
@@ -867,9 +861,9 @@
                 {
                     return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
                 }
-                _auditLog.EditAudit(model.Id,model.Status,model.Opinion, int.Parse(userId));
+                _auditLog.EditAudit(model.Id, model.Status, model.Opinion, int.Parse(userId));
 
-                return Ok(new { code = 0, count=0, msg = "瀹℃牳璁板綍鍒楄〃", data = "" });
+                return Ok(new { code = 0, count = 0, msg = "瀹℃牳璁板綍鍒楄〃", data = "" });
             }
             catch (Exception e)
             {
@@ -926,7 +920,7 @@
                     return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
                 }
                 var list = _BoxInfoSvc.AddLabelBox(model.Id, model.IsReset, decimal.Parse(model.ArriveQty), model.ProductionTime, model.ExpirationTime, model.StoreTime, model.SupplierLot, int.Parse(userId));
-                return Ok(new { code = 0,  msg = "鐢熸垚绠辩爜鏍囩鎴愬姛", data = list });
+                return Ok(new { code = 0, msg = "鐢熸垚绠辩爜鏍囩鎴愬姛", data = list });
             }
             catch (Exception e)
             {
@@ -951,7 +945,7 @@
                 {
                     return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
                 }
-                var list = _BoxInfoSvc.GetBuDaLabelList(model.BoxNo, model.EndBoxNo, model.BoxNo2, model.EndBoxNo2,model.Type,int.Parse(userId));
+                var list = _BoxInfoSvc.GetBuDaLabelList(model.BoxNo, model.EndBoxNo, model.BoxNo2, model.EndBoxNo2, model.Type, int.Parse(userId));
                 return Ok(new { code = 0, msg = "鑾峰彇琛ユ墦绠辩爜鏍囩淇℃伅", data = list });
             }
             catch (Exception e)
@@ -992,7 +986,7 @@
                 {
                     return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
                 }
-                _BoxInfoSvc.DelLabelByAsnNo(model.AsnNo,model.LotNo,int.Parse(userId));
+                _BoxInfoSvc.DelLabelByAsnNo(model.AsnNo, model.LotNo, int.Parse(userId));
                 return Ok(new { code = 0, msg = "鍒犻櫎鎴愬姛", data = "" });
             }
             catch (Exception e)
@@ -1134,7 +1128,7 @@
         {
             try
             {
-                var type = new List<string>() { "0","1","2" };
+                var type = new List<string>() { "0", "1", "2" };
                 var bolls = _taskSvc.GetArchivingTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, out int count);
 
                 return Ok(new { code = 0, count, msg = "浠诲姟淇℃伅", data = bolls });
@@ -1155,7 +1149,7 @@
         {
             try
             {
-                var bolls = _logSvc.GetArchivingLogOperationList(model.ComeFrom,model.MenuName, model.Type, model.Msg, model.StartTime, model.EndTime, model.Page, model.Limit, out int count);
+                var bolls = _logSvc.GetArchivingLogOperationList(model.ComeFrom, model.MenuName, model.Type, model.Msg, model.StartTime, model.EndTime, model.Page, model.Limit, out int count);
 
                 return Ok(new { code = 0, count, msg = "鍏ュ簱鎿嶄綔鏃ュ織淇℃伅", data = bolls });
             }
@@ -1174,7 +1168,7 @@
         /// <returns>閲囪喘鍗曚俊鎭�</returns>
         [HttpPost]
         [ServiceFilter(typeof(ApiResponseActionFilter))]
-        public async Task<SqlSugarPagedList>  GetProcurePlanNoticeList(ProcurePlanNoticeVm model)
+        public async Task<SqlSugarPagedList> GetProcurePlanNoticeList(ProcurePlanNoticeVm model)
         {
             RefAsync<int> count = new RefAsync<int>();
             var bolls = await _procurePlanSvc.GetProcurePlanNoticeList(model, count);
@@ -1221,7 +1215,7 @@
                 {
                     throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
                 }
-               
+
                 _procurePlanSvc.CreateAsnByProcurePlan(Convert.ToInt32(model.Id), int.Parse(UserId));
 
                 return Ok(new { code = 0, msg = "娣诲姞鎴愬姛" });

--
Gitblit v1.8.0