From 51f7eb771322a65ee552ca9b60280632f72760e6 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期三, 15 十月 2025 16:55:08 +0800
Subject: [PATCH] 修改物料管理列表
---
Wms/Wms/Controllers/PdaAsnController.cs | 192 ++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 184 insertions(+), 8 deletions(-)
diff --git a/Wms/Wms/Controllers/PdaAsnController.cs b/Wms/Wms/Controllers/PdaAsnController.cs
index ced30b5..e2b9bc7 100644
--- a/Wms/Wms/Controllers/PdaAsnController.cs
+++ b/Wms/Wms/Controllers/PdaAsnController.cs
@@ -1,16 +1,23 @@
锘縰sing Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Options;
using Model.InterFaceModel;
+using Model.ModelDto;
using Model.ModelDto.BllAsnDto;
using Model.ModelDto.DataDto;
using Model.ModelVm;
using Model.ModelVm.BllAsnVm;
using Model.ModelVm.PdaVm;
+using Model.ModelVm.SysVm;
using Newtonsoft.Json;
using System;
+using System.Collections.Generic;
+using System.Linq;
using System.Security.Claims;
using Utility;
using Utility.Tools;
+using Wms.Tools;
using WMS.BLL.LogServer;
using WMS.Entity.BllAsnEntity;
using WMS.Entity.DataEntity;
@@ -23,13 +30,16 @@
[Authorize]
public class PdaAsnController : ControllerBase
{
+ private readonly ApiUrlConfig _config; //鎺ュ彛浜や簰璺緞
private readonly IPdaAsnServer _PdaAsnSvc;
+ private readonly UserManager _userManager;
- public PdaAsnController(IPdaAsnServer pdaAsnSvc)
+ public PdaAsnController(IOptions<ApiUrlConfig> setting, IPdaAsnServer pdaAsnSvc,UserManager userManager)
{
- _PdaAsnSvc = pdaAsnSvc;
+ _config = setting.Value;
+ _PdaAsnSvc = pdaAsnSvc;
+ _userManager = userManager;
}
-
#region JC34
@@ -175,7 +185,27 @@
{
try
{
- var models = _PdaAsnSvc.GetBindBoxInfos(model);
+ var models = _PdaAsnSvc.GetBindBoxInfos(model, _config.BoxHost + _config.GetBoxUrl);
+
+ return Ok(new { code = 0, msg = "鏍囩绠辩爜淇℃伅", data = models });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { code = 1, msg = e.Message });
+ }
+ }
+
+ /// <summary>
+ /// 鏍规嵁绠辩爜鑾峰彇鏍囩绠辩爜淇℃伅锛堣溅闂村叆搴�-鑾峰彇WMS鐢熸垚鐨勭淇℃伅锛�
+ /// </summary>
+ /// <param name="boxNo">BoxNo:绠卞彿</param>
+ /// <returns></returns>
+ [HttpGet]
+ public IActionResult GetWmsBoxInfos(string boxNo)
+ {
+ try
+ {
+ var models = _PdaAsnSvc.GetWmsBoxInfos(boxNo);
return Ok(new { code = 0, msg = "鏍囩绠辩爜淇℃伅", data = models });
}
@@ -234,16 +264,68 @@
return Ok(new { code = 1, msg = e.Message });
}
}
-
+
+
+ /// <summary>
+ /// 杞﹂棿鍏ュ簱
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult ChejianIn(PdaPalletBindVm model)
+ {
+ try
+ {
+
+ if (_userManager.UserId ==0)
+ {
+ throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+ }
+
+ if (model.TableType == 0)
+ {
+ _PdaAsnSvc.ChejianIn(model.PalletNo,model.BoxNo,model.SkuQty,model.AreaNo, _userManager.UserId);
+ }
+ else if (model.TableType == 1)
+ {
+ _PdaAsnSvc.ChejianQtyIn(model.PalletNo,model.SkuNo,model.LotNo,model.SkuQty,model.AreaNo, _userManager.UserId);
+ }
+
+ return Ok(new { code = 0, msg = "缁戝畾鎴愬姛!" });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { code = 1, msg = e.Message });
+ }
+ }
+
//---------------------------------------------鐢宠鍏ュ簱椤甸潰----------------------------------------------------------------------
+ /// <summary>
+ /// 淇濆瓨鎸囧畾鐨勫偍浣�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult SaveAppointLocate(PalletBindVm model)
+ {
+ try
+ {
+ _PdaAsnSvc.SaveAppointLocate(model.PalletNo, model.LocatNo, _userManager.UserId);
+
+ return Ok(new HttpReturnModel{ Success = "0", Message = "鎴愬姛鎸囧畾鍌ㄤ綅" });
+
+ }
+ catch (Exception e)
+ {
+ return Ok(new HttpReturnModel { Success = "1", Message = e.Message });
+ }
+ }
#endregion
-
-
#region 鍏敤鏂规硶
/// <summary>
@@ -677,7 +759,6 @@
#endregion
-
#region 骞冲簱鍏ュ簱
/// <summary>
/// 骞冲簱纭鍏ュ簱
@@ -795,5 +876,100 @@
#endregion
+
+ #region 绾跨紪鏍囩
+ /// <summary>
+ /// 骞冲簱纭鍏ュ簱
+ /// </summary>
+ /// <param name="model">鐗╂枡缂栫爜锛涚墿鏂欏悕绉�</param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult GetSkuInfo(GetMaterialsVm model)
+ {
+ try
+ {
+ var models = _PdaAsnSvc.GetSkuInfo(model);
+
+ return Ok(new { code = 0, msg = "鑾峰彇鐗╂枡淇℃伅鎴愬姛!", data = models });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { code = 1, msg = e.Message });
+ }
+ }
+
+ /// <summary>
+ /// 鐢熸垚鏂版爣绛� 骞惰繑鍥炴墦鍗版暟鎹�
+ /// </summary>
+ /// <param name="model">鏍囩淇℃伅</param>
+ /// <returns>鎵撳嵃鏁版嵁</returns>
+ [HttpPost]
+ public IActionResult AddLabels(LabelsVm model)
+ {
+ try
+ {
+ var claimsIdentity = this.User.Identity as ClaimsIdentity;
+ if (claimsIdentity == null)
+ {
+ throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+ }
+ string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
+ if (string.IsNullOrWhiteSpace(UserId))
+ {
+ throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+ }
+ model.userId = int.Parse(UserId);
+ var models = _PdaAsnSvc.AddLabels(model);
+
+ var data = new BoxListInfoDto();
+ data.SkuNo = model.SkuNo;
+ data.SkuName = model.SkuName;
+ data.LotNo = model.LotNo;
+ data.Date1 = model.TimeFrom == null ? "" : Convert.ToDateTime(model.TimeFrom).ToString("yyyy-MM-dd");
+ data.Date2 = model.TimeEnd == null ? "" : Convert.ToDateTime(model.TimeEnd).ToString("yyyy-MM-dd");
+ data.BoxNoList = models.Select(m => m.BoxNo).ToList();
+
+
+ return Ok(new { code = 0, msg = "绠辩爜鐢熸垚鎴愬姛!", data = data });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { code = 1, msg = e.Message });
+ }
+ }
+ #endregion
+
+ #region 浠撳簱鏀惰揣
+ /// <summary>
+ /// 浠撳簱纭鏀惰揣
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost]
+ public IActionResult ConfirmTakeOf(PalletBindVm model)
+ {
+ try
+ {
+ var claimsIdentity = this.User.Identity as ClaimsIdentity;
+ if (claimsIdentity == null)
+ {
+ throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+ }
+ string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
+ if (string.IsNullOrWhiteSpace(UserId))
+ {
+ throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+ }
+
+ _PdaAsnSvc.ConfirmTakeOf(model.PalletNo, int.Parse(UserId));
+
+ return Ok(new { code = 0, msg = "鏀惰揣鎴愬姛!" });
+ }
+ catch (Exception e)
+ {
+ return Ok(new { code = 1, msg = e.Message });
+ }
+ }
+ #endregion
}
}
--
Gitblit v1.8.0