From 738302071e079a214ded04c79b36e59f4326909c Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期五, 05 九月 2025 17:11:53 +0800
Subject: [PATCH] 修改申请巷道接口问题;优化PDA组托页面
---
Wms/Wms/Controllers/PdaCrController.cs | 187 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 185 insertions(+), 2 deletions(-)
diff --git a/Wms/Wms/Controllers/PdaCrController.cs b/Wms/Wms/Controllers/PdaCrController.cs
index 86c1d5e..8faedc6 100644
--- a/Wms/Wms/Controllers/PdaCrController.cs
+++ b/Wms/Wms/Controllers/PdaCrController.cs
@@ -15,6 +15,8 @@
using Model.ModelDto.PdaDto;
using Microsoft.AspNetCore.Identity;
using System.Security.Cryptography;
+using Wms.Tools;
+using Microsoft.Extensions.Options;
namespace Wms.Controllers
{
@@ -23,11 +25,13 @@
[Authorize]
public class PdaCrController : ControllerBase
{
+ private readonly ApiUrlConfig _config; //鎺ュ彛浜や簰璺緞
private readonly IPdaCrServer _pdaCrSvc;
private readonly UserManager _userManager;
- public PdaCrController(IPdaCrServer pdaCrSvc, UserManager userManager)
+ public PdaCrController(IOptions<ApiUrlConfig> setting, IPdaCrServer pdaCrSvc, UserManager userManager)
{
+ _config = setting.Value;
_pdaCrSvc = pdaCrSvc;
_userManager = userManager;
}
@@ -231,7 +235,19 @@
[UnitOfWork]
public async Task AgvTransport(PdaAgvTransportVm model)
{
- await _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, _userManager.UserId);
+ await _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, _config.WcsHost+ _config.IssueComApiUrl, _userManager.UserId);
+ }
+ /// <summary>
+ /// 鍛煎彨agv杞繍绌烘墭鐩�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ [ServiceFilter(typeof(ApiResponseActionFilter))]
+ [UnitOfWork]
+ public async Task AgvNullPallet(PdaAgvTransportVm model)
+ {
+ await _pdaCrSvc.AgvNullPallet(model.PalletNo, model.AreaNo, model.LocatNo, _config.WcsHost + _config.IssueComApiUrl, _userManager.UserId);
}
/// <summary>
/// agv杞繍鍛煎彨灏忚溅鍙栬揣
@@ -282,5 +298,172 @@
}
}
#endregion
+
+ #region 鎷嗙璐存爣
+
+ /// <summary>
+ /// 鎷嗙璐存爣
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult AddLableByDevanning(PdaDevaningVm model)
+ {
+ try
+ {
+ //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D
+ var claimsIdentity = this.User.Identity as ClaimsIdentity;
+ if (claimsIdentity == null)
+ {
+ return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+ }
+ var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
+ if (string.IsNullOrWhiteSpace(userId))
+ {
+ return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+ }
+
+ var uId = int.Parse(userId);
+ var list = _pdaCrSvc.AddLableByDevanning(model.BoxNo, model.DevanQty,uId);
+
+ return Ok(new { data = list, code = 0, msg = "鎴愬姛" });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+ }
+ }
+ #endregion
+
+ #region 纭鏀惰揣
+
+ /// <summary>
+ /// 鏍规嵁鏀惰揣鎵樼洏鑾峰彇鍑哄簱鍗曚俊鎭�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult GetReceiptSoNoByPallet(PdaReceiptVm model)
+ {
+ try
+ {
+
+ var soNo = _pdaCrSvc.GetReceiptSoNoByPallet(model.PalletNo);
+
+ return Ok(new { data = soNo, code = 0, msg = "鎴愬姛" });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+ }
+ }
+
+ /// <summary>
+ /// 纭鏀惰揣
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult ConfirmReceipt(PdaReceiptVm model)
+ {
+ try
+ {
+ _pdaCrSvc.ConfirmReceipt(model.PalletNo, _userManager.UserId);
+
+ return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+ }
+ }
+
+ #endregion
+
+
+ #region 鐗╂枡鎷嗘墭
+
+ /// <summary>
+ /// 鏌ヨ绠变俊鎭�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult GetBoxInfo(PdaUpPalletVm model)
+ {
+ try
+ {
+ _pdaCrSvc.GetBoxInfo(model.BoxNo, model.PalletNo);
+
+ return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+ }
+ }
+
+ /// <summary>
+ /// 鐗╂枡鎷嗘墭
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult UpPalletByBox(PdaUpPalletVm model)
+ {
+ try
+ {
+ _pdaCrSvc.UpPalletByBox(model.BoxNo, model.PalletNo,model.PalletNoNew,_userManager.UserId);
+
+ return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+ }
+ }
+
+ /// <summary>
+ /// 鏍规嵁鎵樼洏鑾峰彇鎵樼洏涓婄殑鐗╂枡鎵规淇℃伅
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult GetSelectSkuLotNo(PdaUpPalletVm model)
+ {
+ try
+ {
+ var list = _pdaCrSvc.GetSelectSkuLotNo(model.PalletNo);
+
+ return Ok(new { data = list, code = 0, msg = "鎴愬姛" });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+ }
+ }
+
+ /// <summary>
+ /// 鐗╂枡鎷嗘墭 - 鏁伴噺椤电
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult UpPalletByQty(PdaUpPalletVm model)
+ {
+ try
+ {
+ _pdaCrSvc.UpPalletByQty(model.PalletNo, model.PalletNoNew, model.DetailId,model.Qty, _userManager.UserId);
+
+ return Ok(new { data = "", code = 0, msg = "鎴愬姛" });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" });
+ }
+ }
+
+ #endregion
+
}
}
--
Gitblit v1.8.0