From 996acccd51e8fd31a26d92b012e34b6fbbcf2237 Mon Sep 17 00:00:00 2001
From: bklLiudl <673013083@qq.com>
Date: 星期四, 22 八月 2024 14:40:59 +0800
Subject: [PATCH] Merge branch 'master' into Liudl
---
Wms/Wms/Controllers/BllAsnController.cs | 83 +++++++++++++++++++++++++++--------------
1 files changed, 54 insertions(+), 29 deletions(-)
diff --git a/Wms/Wms/Controllers/BllAsnController.cs b/Wms/Wms/Controllers/BllAsnController.cs
index 964115f..c921231 100644
--- a/Wms/Wms/Controllers/BllAsnController.cs
+++ b/Wms/Wms/Controllers/BllAsnController.cs
@@ -14,13 +14,14 @@
using System.Threading.Tasks;
using SqlSugar;
using System.Diagnostics;
+using Model.ModelDto.SysDto;
+using static System.Reflection.Metadata.BlobBuilder;
namespace Wms.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
[Authorize]
-
public class BllAsnController : ControllerBase
{
#region 渚濊禆娉ㄥ叆
@@ -33,10 +34,11 @@
private readonly IAuditLogServer _auditLog; // 瀹℃牳璁板綍
private readonly IBllLabelBoxNoServer _labelBox; // 绠辩爜鏍囩
private readonly IProcurePlanServer _procurePlanSvc; // 绠辩爜鏍囩
+ private readonly IPalletUpShelfServer _palletUpShelfSvc; // 涓婃灦璁板綍
#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, IPalletUpShelfServer palletUpShelfSvc)
{
_arrivalNoticeSvc = arrivalNoticeSvc;
_PalletBindSvc = palletBindSvc;
@@ -47,6 +49,7 @@
_auditLog = auditLog;
_labelBox = labelBox;
_procurePlanSvc = procurePlanSvc;
+ _palletUpShelfSvc = palletUpShelfSvc;
}
#endregion
@@ -64,7 +67,7 @@
RefAsync<int> count = new RefAsync<int>();
var bolls = await _arrivalNoticeSvc.GetArrivalNoticeList(model, count);
return new SqlSugarPagedList() { Items = bolls, Total = count };
- }
+ }
[HttpPost]
@@ -168,6 +171,10 @@
{
throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
}
+ if (string.IsNullOrWhiteSpace(model.ASNNo))
+ {
+ throw new Exception("鍗曟嵁鍙蜂笉鍙负null!");
+ }
model.CreateUser = int.Parse(UserId);
string strMesage = _arrivalNoticeSvc.EditArrivalNotice(model);
@@ -178,7 +185,7 @@
}
if (strMesage.Contains("-1"))
{
- return Ok(new { code = 0, msg = "閮ㄥ垎鎴愬姛 "+ strMesage });
+ return Ok(new { code = 0, msg = "閮ㄥ垎鎴愬姛 " + strMesage });
}
else
{
@@ -266,7 +273,7 @@
/// <param name="reason"></param>
/// <returns></returns>
[HttpGet]
- public IActionResult CancelOrder(int id,string reason)
+ public IActionResult CancelOrder(int id, string reason)
{
try
{
@@ -280,12 +287,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)
{
@@ -360,13 +367,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)
{
@@ -424,7 +431,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 = "" });
}
@@ -456,7 +463,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 = "" });
}
@@ -480,7 +487,7 @@
{
var list = _BoxInfoSvc.GetBoxInfoList(boxNo, isContinue, boxNo2);
var num = 0;
- if (list!=null)
+ if (list != null)
{
num = list.Count;
}
@@ -506,7 +513,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 });
}
@@ -536,7 +543,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 = "" });
}
@@ -680,14 +687,15 @@
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
- public IActionResult GetArrivalTaskList(GetTaskVm model)
+ public async Task<IActionResult> GetArrivalTaskList(GetTaskVm model)
{
try
{
var type = new List<string>() { "0" };
- var bolls = _taskSvc.GetTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, out int count);
+ 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)
{
@@ -856,9 +864,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)
{
@@ -915,7 +923,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)
{
@@ -940,7 +948,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)
@@ -981,7 +989,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)
@@ -1123,7 +1131,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 });
@@ -1144,7 +1152,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 });
}
@@ -1163,7 +1171,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);
@@ -1210,7 +1218,7 @@
{
throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
}
-
+
_procurePlanSvc.CreateAsnByProcurePlan(Convert.ToInt32(model.Id), int.Parse(UserId));
return Ok(new { code = 0, msg = "娣诲姞鎴愬姛" });
@@ -1252,6 +1260,23 @@
}
}
#endregion
+
+ #region 涓婃灦浠诲姟璁板綍
+
+ /// <summary>
+ /// 鑾峰彇涓婃灦浠诲姟璁板綍淇℃伅鍒嗛〉闆嗗悎
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<SqlSugarPagedList> GetPalletUpShelfList(PalletUpShelfVm model)
+ {
+ RefAsync<int> count = new RefAsync<int>();
+ var data = await _palletUpShelfSvc.GetPalletUpShelfList(model.TraceNo, model.TaskNo,model.PalletNo,model.SkuNo,model.SkuName,model.LotNo,model.Status,model.Page,model.Limit, count);
+ return new SqlSugarPagedList() { Items = data, Total = count };
+ }
+ #endregion
}
}
--
Gitblit v1.8.0