From 638b471ad73bce1c701d9f9c8d02effe6a38c7ca Mon Sep 17 00:00:00 2001
From: chengsc <Demo@DESKTOP-CPA90BF>
Date: 星期一, 22 七月 2024 16:57:20 +0800
Subject: [PATCH] 修改托盘绑定方法
---
Wms/Wms/Controllers/BllAsnController.cs | 140 ++++++++++++++++++++++++++--------------------
1 files changed, 79 insertions(+), 61 deletions(-)
diff --git a/Wms/Wms/Controllers/BllAsnController.cs b/Wms/Wms/Controllers/BllAsnController.cs
index 235d44d..c921231 100644
--- a/Wms/Wms/Controllers/BllAsnController.cs
+++ b/Wms/Wms/Controllers/BllAsnController.cs
@@ -13,13 +13,15 @@
using Model.ModelDto.BllAsnDto;
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 渚濊禆娉ㄥ叆
@@ -32,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;
@@ -46,6 +49,7 @@
_auditLog = auditLog;
_labelBox = labelBox;
_procurePlanSvc = procurePlanSvc;
+ _palletUpShelfSvc = palletUpShelfSvc;
}
#endregion
@@ -56,33 +60,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>
@@ -177,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);
@@ -187,7 +185,7 @@
}
if (strMesage.Contains("-1"))
{
- return Ok(new { code = 0, msg = "閮ㄥ垎鎴愬姛 "+ strMesage });
+ return Ok(new { code = 0, msg = "閮ㄥ垎鎴愬姛 " + strMesage });
}
else
{
@@ -275,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
{
@@ -289,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)
{
@@ -369,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)
{
@@ -433,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 = "" });
}
@@ -465,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 = "" });
}
@@ -489,7 +487,7 @@
{
var list = _BoxInfoSvc.GetBoxInfoList(boxNo, isContinue, boxNo2);
var num = 0;
- if (list!=null)
+ if (list != null)
{
num = list.Count;
}
@@ -515,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 });
}
@@ -545,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 = "" });
}
@@ -689,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)
{
@@ -865,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)
{
@@ -924,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)
{
@@ -949,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)
@@ -990,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)
@@ -1132,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 });
@@ -1153,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 });
}
@@ -1172,31 +1171,33 @@
/// <returns>閲囪喘鍗曚俊鎭�</returns>
[HttpPost]
[ServiceFilter(typeof(ApiResponseActionFilter))]
- public async Task<SqlSugarPagedList<ProcurePlanNoticeDto>> GetProcurePlanNoticeList(ProcurePlanNoticeVm model)
+ public async Task<SqlSugarPagedList> GetProcurePlanNoticeList(ProcurePlanNoticeVm model)
{
RefAsync<int> count = new RefAsync<int>();
var bolls = await _procurePlanSvc.GetProcurePlanNoticeList(model, count);
- return new SqlSugarPagedList<ProcurePlanNoticeDto>() { Items = bolls, Total = count };
+ return new SqlSugarPagedList() { Items = bolls, Total = count };
}
+
/// <summary>
/// 鑾峰彇閲囪喘鍗曟槑缁嗕俊鎭�
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
- public IActionResult GetProcurePlanNoticeDetailList(ProcurePlanNoticeDetailVm model)
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ public async Task<SqlSugarPagedList> GetProcurePlanNoticeDetailList(ProcurePlanNoticeDetailVm model)
{
- try
- {
- var models = _procurePlanSvc.GetProcurePlanNoticeDetailList(model, out int count);
+ Stopwatch stopwatch = new Stopwatch();
+ stopwatch.Start();
+ RefAsync<int> count = new RefAsync<int>();
+ var bolls = await _procurePlanSvc.GetProcurePlanNoticeDetailList(model, count);
+ stopwatch.Stop();
- return Ok(new { code = 0, count, msg = "鍏ュ簱鍗曟槑缁嗕俊鎭�", data = models });
- }
- catch (Exception e)
- {
- return Ok(new { code = 1, msg = e.Message });
- }
+ var time = stopwatch.ElapsedMilliseconds;
+ return new SqlSugarPagedList() { Items = bolls, Total = count };
}
+
+
/// <summary>
/// 閫氳繃閲囪喘鍗曠敓鎴愬叆搴撳崟鎹�
/// </summary>
@@ -1217,7 +1218,7 @@
{
throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
}
-
+
_procurePlanSvc.CreateAsnByProcurePlan(Convert.ToInt32(model.Id), int.Parse(UserId));
return Ok(new { code = 0, msg = "娣诲姞鎴愬姛" });
@@ -1259,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