HTML/js/public.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Pda/js/public.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Wms/Model/ModelVm/BllCheckVm/StockCheckVm.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Wms/Wms/Controllers/DownApiController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Wms/Wms/Controllers/PdaSoController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
HTML/js/public.js
@@ -38,8 +38,15 @@ if (url!=IP+"/WeatherForecast/Login") { if (!$.cookie('token')) { callbackFun("登录人信息已失效"); try{ parent.window.location.href = '/views/Login.html'; } if(isExpired = isTokenExpired($.cookie('token'))){ catch(error){ window.location.href = '/views/Login.html'; } return; } if(isTokenExpired($.cookie('token'))){ try{ parent.window.location.href = '/views/Login.html'; } Pda/js/public.js
@@ -10,7 +10,6 @@ function sendData(url, data, type, callbackFun) { // callbackFun("{}"); // return; var deferred = $.Deferred(); if (type != "get") { data = JSON.stringify(data); @@ -18,6 +17,22 @@ if (url!=IP+"/WeatherForecast/Login") { if (!$.cookie('token')) { callbackFun("登录人信息已失效"); try { parent.window.location.href = '/views/Login.html'; } catch (error) { window.location.href = '/views/Login.html'; } return; } if (isTokenExpired($.cookie('token'))) { try { parent.window.location.href = '/views/Login.html'; } catch (error) { window.location.href = '/views/Login.html'; } return; } } $.ajax({ @@ -52,6 +67,22 @@ if (url!=IP+"/WeatherForecast/Login") { if (!$.cookie('token')) { callbackFun("登录人信息已失效"); try { parent.window.location.href = '/view/Login.html'; } catch (error) { window.location.href = '/view/Login.html'; } return; } if (isTokenExpired($.cookie('token'))) { try { parent.window.location.href = '/view/Login.html'; } catch (error) { window.location.href = '/view/Login.html'; } return; } } $.ajax({ @@ -99,3 +130,21 @@ return newobj } function isTokenExpired(token) { const tokenParts = token.split('.'); if (tokenParts.length !== 3) { return true; // JWT 格式不正确 } const payloadBase64 = tokenParts[1]; const payload = JSON.parse(atob(payloadBase64)); if (!payload || !payload.exp) { return true; // 没有有效载荷或者没有过期时间 } const now = Date.now() / 1000; // 当前时间戳(秒) const expiration = payload.exp; return now >= expiration; } Wms/Model/ModelVm/BllCheckVm/StockCheckVm.cs
@@ -99,4 +99,32 @@ { public string taskNo { get; set; } } public class CheckVm { /// <summary> /// 单据号 /// </summary> public string CrNo { get; set; } /// <summary> /// 物料编码 /// </summary> public string SkuNo { get; set; } /// <summary> /// 批次 /// </summary> public string LotNo { get; set; } /// <summary> /// 托盘号 /// </summary> public string PalletNo { get; set; } /// <summary> /// 箱码号 /// </summary> public string BoxNo { get; set; } /// <summary> /// 支码号 /// </summary> public List<string> BoxNo3 { get; set; } } } Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs
@@ -1423,9 +1423,8 @@ #endregion if (locate.Status == "1") //有物品 { #region 添加出库任务 #region 添加视觉盘点任务 var taskNo = new Common().GetMaxNo("TK"); //添加出库任务 var exTask = new LogTask { TaskNo = taskNo, @@ -1440,7 +1439,7 @@ IsFinish = 1,//是否可完成 Type = "1",//任务类型 0 入库任务 1 出库任务 2 移库任务 Status = "0",//任务状态0:等待执行1正在执行2执行完成 OrderType = "5",////0 入库单 1 出库单 2 盘点单 3 移库单 4 取样出库单 5视觉盘点 OrderType = "6",////0 入库单 1 出库单 2 盘点单 3 移库单 4 取样出库单 6视觉盘点 Msg = $"{locateNo}的视觉盘点任务", CreateTime = time }; @@ -1471,7 +1470,7 @@ await Db.Updateable(notice).ExecuteCommandAsync(); } } locate.Status = "3"; //要出库的储位改变状态 正在出库 //locate.Status = "3"; //要出库的储位改变状态 正在出库 await Db.Updateable(locate).ExecuteCommandAsync(); item.TaskNo = exTask.TaskNo; // 出库分配信息中更新任务号 @@ -1572,6 +1571,42 @@ return outDtoList; #endregion } /// <summary> /// 视觉盘点传结果 /// </summary> /// <param name="crNo"></param> /// <param name="url"></param> /// <param name="str"></param> /// <returns></returns> public async Task CheckVision(CheckVm model) { if (string.IsNullOrWhiteSpace(model.CrNo)) { throw Oops.Bah("盘点单据不能为空"); } if (string.IsNullOrWhiteSpace(model.SkuNo)) { throw Oops.Bah("物料不能为空"); } if (string.IsNullOrWhiteSpace(model.LotNo)) { throw Oops.Bah("物料批次不能为空"); } if (string.IsNullOrWhiteSpace(model.PalletNo)) { throw Oops.Bah("托盘码不能为空"); } //盘点明细 var checkDetail = await Db.Queryable<BllStockCheckDetail>().FirstAsync(m => m.IsDel == "0" && m.CRNo == model.CrNo && m.PalletNo == model.PalletNo && m.SkuNo == model.SkuNo && m.LotNo == model.LotNo); if (checkDetail == null) { throw Oops.Bah("未查询到未盘点的盘点明细信息"); } var modSku = await Db.Queryable<SysMaterials>().Where(s => s.SkuNo == model.SkuNo).FirstAsync(); } //盘点出库完成 public async Task CheckSuccess(string taskNo, int userId) { @@ -1600,6 +1635,8 @@ task.IsFinish = 0; task.FinishDate = DateTime.Now;//完成时间 await Db.Updateable(task).ExecuteCommandAsync(); if(task.OrderType != "6")//视觉盘点不更改状态 { locate.Status = "0"; // 更改当前任务中的储位状态(改为0空储位) await Db.Updateable(locate).ExecuteCommandAsync(); foreach (var item in stockDetail) @@ -1610,6 +1647,7 @@ item.AreaNo = "";//所属区域更改(改为空) await Db.Updateable(item).ExecuteCommandAsync(); } } //盘点明细(更改状态) var checkDetails = await Db.Queryable<BllStockCheckDetail>().Where(m => m.IsDel == "0" && (m.TaskNo == taskNo || (m.Status == 1 && m.PalletNo == task.PalletNo))).ToListAsync(); Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
@@ -20,6 +20,8 @@ using WMS.Entity.LogEntity; using WMS.Entity.BllQualityEntity; using WMS.Entity.BllAsnEntity; using System.Threading.Tasks; using Utility; namespace WMS.BLL.BllPdaServer { @@ -28,59 +30,49 @@ private static readonly SqlSugarScope Db = DataContext.Db; //验证托盘是否存在并是否可出库 public string IsEnableOkPalletNo(string palletNo) { try public async Task<string> IsEnableOkPalletNo(string palletNo) { string sqlMsg = ""; var models = Db.Queryable<SysPallets>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo).ToList(); var models = await Db.Queryable<SysPallets>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo).ToListAsync(); if (models.Count > 1) { sqlMsg = "-1:存在重复托盘号,请检查!"; return sqlMsg; throw Oops.Bah("-1:存在重复托盘号,请检查!"); } if (models.Count > 0) { if (models[0].Status == "0") { sqlMsg = "-1:托盘号状态为未使用!"; throw Oops.Bah("-1:托盘号状态为未使用!"); } } else { sqlMsg = "-1:托盘号不存在!"; throw Oops.Bah("-1:托盘号不存在!"); } return sqlMsg; } catch (Exception ex) { throw new Exception(ex.Message); } } //获取托盘中含有的执行中的单据 public List<string> GetRunSoNoticeList(string palletNo, string type) { try public async Task<List<string>> GetRunSoNoticeList(string palletNo, string type) { if (string.IsNullOrWhiteSpace(palletNo))//判断托盘是否为空 { throw new Exception("托盘码为空,请输入托盘码"); throw Oops.Bah("托盘码为空,请输入托盘码"); } var palletInfo = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo); var palletInfo = await Db.Queryable<DataStockDetail>().FirstAsync(w => w.IsDel == "0" && w.PalletNo == palletNo); if (!string.IsNullOrEmpty(palletInfo.WareHouseNo) && type != "1") { throw new Exception("该托盘还未出库"); throw Oops.Bah("该托盘还未出库"); } if (type == "1")//平库出库获取单据 { var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.Status == "1" && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToList(); var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.Status == "1" && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync(); return allotList; } //获取状态为待拣货或者部分拣货的出库单 var allotList2 = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "2" || m.Status == "3") && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToList(); var allotList2 = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "2" || m.Status == "3") && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync(); //var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToList(); //获取出库单据不为待拣货 执行完毕 订单关闭 等待执行的单据 @@ -88,20 +80,13 @@ return allotList2; } catch (Exception ex) { throw new Exception(ex.Message); } } //获取出库托盘上的物料批次(根据托盘码) public List<DetailIdSkuLotNo> GetSoSkuLotNoListByPallet(string palletNo, string soNo) { try public async Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListByPallet(string palletNo, string soNo) { if (string.IsNullOrWhiteSpace(palletNo))//判断托盘是否为空 { throw new Exception("托盘码为空,请输入托盘码"); throw Oops.Bah("托盘码为空,请输入托盘码"); } //获取状态为待拣货或者部分拣货的出库单 var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "2" || m.Status == "3") && m.PalletNo == palletNo); @@ -111,37 +96,29 @@ allotList = allotList.Where(m => m.SONo == soNo); } var list = allotList.GroupBy(m => new { m.SODetailNo, m.PalletNo, m.SkuNo, m.SkuName, m.LotNo }).Select(m => new DetailIdSkuLotNo() var list = await allotList.GroupBy(m => new { m.SODetailNo, m.PalletNo, m.SkuNo, m.SkuName, m.LotNo }).Select(m => new DetailIdSkuLotNo() { SoDetailId = m.SODetailNo, PalletNo = m.PalletNo, SkuNo = m.SkuNo, SkuName = m.SkuName, LotNo = m.LotNo, }).ToList(); }).ToListAsync(); return list; } catch (Exception ex) { throw new Exception(ex.Message); } } //获取出库口、规格、待拣及已拣数量(根据出库单明细ID、托盘号) public OutPdaInfo GetOutlets(string soDetailId, string palletNo) public async Task<OutPdaInfo> GetOutlets(string soDetailId, string palletNo) { try { var allotInfo = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SODetailNo == int.Parse(soDetailId) && m.PalletNo == palletNo && (m.Status == "2" || m.Status == "3")).ToList(); var allotInfo = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SODetailNo == int.Parse(soDetailId) && m.PalletNo == palletNo && (m.Status == "2" || m.Status == "3")).ToListAsync(); if (allotInfo.Count == 0) { throw new Exception($"{palletNo}托盘上未查询到分配信息,请核实"); throw Oops.Bah($"{palletNo}托盘上未查询到分配信息,请核实"); } if (allotInfo.Count > 1) { throw new Exception($"{palletNo}托盘上存在多条相同的分配信息,请核实"); throw Oops.Bah($"{palletNo}托盘上存在多条相同的分配信息,请核实"); } var data = allotInfo.First(); var data2 = new OutPdaInfo() @@ -153,21 +130,14 @@ }; return data2; } catch (Exception e) { throw new Exception(e.Message); } } //获取出库单的计划数量和完成 public OutPdaInfo GetPlanAndFinishQty(string soDetailId) public async Task<OutPdaInfo> GetPlanAndFinishQty(string soDetailId) { try { var detail = Db.Queryable<BllExportNoticeDetail>().First(m => m.Id == int.Parse(soDetailId) && m.IsDel == "0"); var detail = await Db.Queryable<BllExportNoticeDetail>().FirstAsync(m => m.Id == int.Parse(soDetailId) && m.IsDel == "0"); if (detail == null) { throw new Exception("未查询到出库单的明细"); throw Oops.Bah("未查询到出库单的明细"); } var data = new OutPdaInfo() { @@ -176,20 +146,13 @@ }; return data; } catch (Exception e) { throw new Exception(e.Message); } } //获取箱码信息(根据箱码在库存箱码明细中查询及拣货明细中拣货数量) public List<Model.ModelDto.BoxInfo> GetDataComBoxInfo(string soDetailId, string palletNo, string boxNo, string boxNo3) { try public async Task<List<BoxInfo>> GetDataComBoxInfo(string soDetailId, string palletNo, string boxNo, string boxNo3) { if (string.IsNullOrWhiteSpace(palletNo)) { throw new Exception("托盘号不能为空"); throw Oops.Bah("托盘号不能为空"); } Expression<Func<DataBoxInfo, bool>> item = Expressionable.Create<DataBoxInfo>() .And(it => it.PalletNo == palletNo) @@ -200,14 +163,14 @@ var info = Db.Queryable<DataBoxInfo>().Where(item); if (info.Count() == 0) { throw new Exception("未在库存中查询到信息"); throw Oops.Bah("未在库存中查询到信息"); } var type = "0";//0:查箱码或支码不分组 1:查托盘分组 显示箱 var list = new List<BoxInfo>(); if (!string.IsNullOrWhiteSpace(boxNo3) || !string.IsNullOrWhiteSpace(boxNo))//判断支码是否为空 { foreach (var demo in info.ToList()) foreach (var demo in await info.ToListAsync()) { var t = new BoxInfo() { @@ -223,26 +186,26 @@ } else if (!string.IsNullOrWhiteSpace(palletNo)) { list = info.GroupBy(m => new { m.BoxNo }).Select(it => new BoxInfo list = await info.GroupBy(m => new { m.BoxNo }).Select(it => new BoxInfo { BoxNo = it.BoxNo, Qty = SqlFunc.AggregateSum(it.Qty) }).ToList(); }).ToListAsync(); type = "1"; } if (!string.IsNullOrWhiteSpace(soDetailId)) { var allotInfos = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SODetailNo == int.Parse(soDetailId) && m.PalletNo == palletNo && (m.Status == "2" || m.Status == "3")).ToList(); var allotInfos = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SODetailNo == int.Parse(soDetailId) && m.PalletNo == palletNo && (m.Status == "2" || m.Status == "3")).ToListAsync(); if (allotInfos.Count == 0) { throw new Exception($"{palletNo}托盘上未查询到分配信息,请核实"); throw Oops.Bah($"{palletNo}托盘上未查询到分配信息,请核实"); } if (allotInfos.Count > 1) { throw new Exception($"{palletNo}托盘上存在多条相同的分配信息,请核实"); throw Oops.Bah($"{palletNo}托盘上存在多条相同的分配信息,请核实"); } var allotInfo = allotInfos.First(); var comInfo = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.ExportAllotId == allotInfo.Id).ToList(); var comInfo = await Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.ExportAllotId == allotInfo.Id).ToListAsync(); if (comInfo.Count != 0) { if (type == "0") @@ -291,59 +254,52 @@ return list; } catch (Exception e) { throw new Exception(e.Message); } } //获取库内无箱码的托盘分配信息 public List<Model.ModelDto.BoxInfo> GetAllotPlnInfo(string soDetailId, string palletNo) { try public async Task<List<BoxInfo>> GetAllotPlnInfo(string soDetailId, string palletNo) { #region 判断 //根据id及托盘获取出库单和托盘拣货信息 if (string.IsNullOrWhiteSpace(palletNo)) { throw new Exception("托盘号不能为空"); throw Oops.Bah("托盘号不能为空"); } //获取对应托盘下是否存在箱码信息 var boxInfo = Db.Queryable<DataBoxInfo>().First(b => b.IsDel == "0" && b.PalletNo == palletNo); var boxInfo = await Db.Queryable<DataBoxInfo>().FirstAsync(b => b.IsDel == "0" && b.PalletNo == palletNo); if (boxInfo != null) { throw new Exception($"{palletNo}托盘上存在箱码信息,无法在数量拣货进行操作!"); throw Oops.Bah($"{palletNo}托盘上存在箱码信息,无法在数量拣货进行操作!"); } BllExportAllot allot = null; if (!string.IsNullOrWhiteSpace(soDetailId)) { //出库单明细 var noticeDetail = Db.Queryable<BllExportNoticeDetail>().First(a => a.Id == int.Parse(soDetailId) && a.IsDel == "0"); var noticeDetail = await Db.Queryable<BllExportNoticeDetail>().FirstAsync(a => a.Id == int.Parse(soDetailId) && a.IsDel == "0"); if (noticeDetail == null) { throw new Exception($"未查询到对应出库单明细信息,请核实!"); throw Oops.Bah($"未查询到对应出库单明细信息,请核实!"); } //出库单总单 var notice = Db.Queryable<BllExportNotice>().First(a => a.IsDel == "0" && a.SONo == noticeDetail.SONo); var notice = await Db.Queryable<BllExportNotice>().FirstAsync(a => a.IsDel == "0" && a.SONo == noticeDetail.SONo); if (notice == null) { throw new Exception($"未查询到对应出库单总单信息,请核实!"); throw Oops.Bah($"未查询到对应出库单总单信息,请核实!"); } //分配信息 allot = Db.Queryable<BllExportAllot>().First(a => a.IsDel == "0" && a.SONo == notice.SONo && a.SODetailNo == noticeDetail.Id && a.PalletNo == palletNo && (a.Status == "2" || a.Status == "3")); allot = await Db.Queryable<BllExportAllot>().FirstAsync(a => a.IsDel == "0" && a.SONo == notice.SONo && a.SODetailNo == noticeDetail.Id && a.PalletNo == palletNo && (a.Status == "2" || a.Status == "3")); if (allot == null) { throw new Exception($"未查询到对应分配信息,请核实!"); throw Oops.Bah($"未查询到对应分配信息,请核实!"); } } //库存明细 var detail = Db.Queryable<DataStockDetail>().First(a => a.IsDel == "0" && a.PalletNo == palletNo); var detail = await Db.Queryable<DataStockDetail>().FirstAsync(a => a.IsDel == "0" && a.PalletNo == palletNo); if (detail == null) { throw new Exception($"未查询到库存明细信息,请核实!"); throw Oops.Bah($"未查询到库存明细信息,请核实!"); } #endregion @@ -360,12 +316,6 @@ pdaInfo.Add(info); return pdaInfo; } catch (Exception e) { throw new Exception(e.Message); } } //出库pda拣货 Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs
@@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using Model.InterFaceModel; using Model.ModelDto; using Model.ModelVm.PdaVm; @@ -14,7 +15,7 @@ /// </summary> /// <param name="palletNo">托盘号</param> /// <returns>"":可使用 -1:不可使用(原因)</returns> string IsEnableOkPalletNo(string palletNo); Task<string> IsEnableOkPalletNo(string palletNo); /// <summary> /// 获取执行中的出库单(根据托盘码) @@ -22,7 +23,7 @@ /// <param name="palletNo">托盘码</param> /// <param name="type">类型 区分是否是平库出库获取单据</param> /// <returns></returns> List<string> GetRunSoNoticeList(string palletNo, string type); Task<List<string>> GetRunSoNoticeList(string palletNo, string type); /// <summary> /// 获取出库托盘上的物料批次(根据托盘码) @@ -30,7 +31,7 @@ /// <param name="palletNo">托盘码</param> /// <param name="soNo">单据号</param> /// <returns></returns> List<DetailIdSkuLotNo> GetSoSkuLotNoListByPallet(string palletNo,string soNo); Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListByPallet(string palletNo, string soNo); /// <summary> /// 获取出库口、规格、待拣及已拣数量(根据出库单明细ID、托盘号) @@ -38,14 +39,14 @@ /// <param name="soDetailId">出库单明细ID</param> /// <param name="palletNo">托盘号</param> /// <returns></returns> OutPdaInfo GetOutlets(string soDetailId, string palletNo); Task<OutPdaInfo> GetOutlets(string soDetailId, string palletNo); /// <summary> /// 获取出库单的计划数量和完成 /// </summary> /// <param name="soDetailId">出库单明细ID</param> /// <returns></returns> OutPdaInfo GetPlanAndFinishQty(string soDetailId); Task<OutPdaInfo> GetPlanAndFinishQty(string soDetailId); /// <summary> /// 获取箱码信息(根据箱码在库存箱码明细中查询) @@ -55,7 +56,7 @@ /// <param name="boxNo">箱码</param> /// <param name="boxNo3">支/袋码</param> /// <returns></returns> List<BoxInfo> GetDataComBoxInfo(string soDetailId,string palletNo, string boxNo, string boxNo3); Task<List<BoxInfo>> GetDataComBoxInfo(string soDetailId, string palletNo, string boxNo, string boxNo3); /// <summary> /// 获取库内无箱码的托盘分配信息 @@ -63,7 +64,7 @@ /// <param name="soDetailId">出库单明细ID</param> /// <param name="palletNo">托盘号</param> /// <returns></returns> List<BoxInfo> GetAllotPlnInfo(string soDetailId,string palletNo); Task<List<BoxInfo>> GetAllotPlnInfo(string soDetailId, string palletNo); /// <summary> /// 出库pda拣货 Wms/Wms/Controllers/DownApiController.cs
@@ -18,6 +18,7 @@ using Model.ModelVm.BllTaskVm; using Utility; using System.Threading.Tasks; using Model.ModelVm.BllCheckVm; namespace Wms.Controllers { Wms/Wms/Controllers/PdaSoController.cs
@@ -12,6 +12,7 @@ using Model.ModelDto; using Model.ModelVm; using Wms.Tools; using Utility; namespace Wms.Controllers { @@ -23,14 +24,15 @@ #region 依赖注入 private readonly ApiUrlConfig _config; //接口交互路径 private readonly IPdaSoServer _pdaSoSvc; private readonly UserManager _userManager; public PdaSoController(IOptions<ApiUrlConfig> setting,IPdaSoServer pdaSoSvc) public PdaSoController(IOptions<ApiUrlConfig> setting, IPdaSoServer pdaSoSvc, UserManager userManager) { _config = setting.Value; _pdaSoSvc = pdaSoSvc; _userManager = userManager; } #endregion /// <summary> @@ -39,25 +41,10 @@ /// <param name="model">PalletNo:托盘条码</param> /// <returns></returns> [HttpPost] public IActionResult IsEnableOkPalletNo(PdaSoVm model) [ServiceFilter(typeof(ApiResponseActionFilter))] public async Task IsEnableOkPalletNo(PdaSoVm model) { try { var strMsg = _pdaSoSvc.IsEnableOkPalletNo(model.PalletNo); if (strMsg == "") { return Ok(new { code = 0, msg = "托盘可用!" }); } else { return Ok(new { code = 1, msg = strMsg }); } } catch (Exception e) { return Ok(new { code = 1, msg = e.Message }); } await _pdaSoSvc.IsEnableOkPalletNo(model.PalletNo); } /// <summary> @@ -66,18 +53,10 @@ /// <param name="model">PalletNo:托盘号</param> /// <returns></returns> [HttpPost] public IActionResult GetRunSoNoticeList(PdaSoVm model) [ServiceFilter(typeof(ApiResponseActionFilter))] public async Task<List<string>> GetRunSoNoticeList(PdaSoVm model) { try { var list = _pdaSoSvc.GetRunSoNoticeList(model.PalletNo,model.Type); return Ok(new { code = 0, msg = "出库单信息", data = list }); } catch (Exception e) { return Ok(new { code = 1, msg = e.Message }); } return await _pdaSoSvc.GetRunSoNoticeList(model.PalletNo, model.Type); } /// <summary> @@ -86,18 +65,10 @@ /// <param name="model">PalletNo:托盘码、SoNo:单据号</param> /// <returns></returns> [HttpPost] public IActionResult GetSoSkuLotNoListByPallet(PdaSoVm model) [ServiceFilter(typeof(ApiResponseActionFilter))] public async Task GetSoSkuLotNoListByPallet(PdaSoVm model) { try { var models = _pdaSoSvc.GetSoSkuLotNoListByPallet(model.PalletNo, model.SoNo); return Ok(new { code = 0, msg = "物料-批次信息", data = models }); } catch (Exception e) { return Ok(new { code = 1, msg = e.Message }); } var models = await _pdaSoSvc.GetSoSkuLotNoListByPallet(model.PalletNo, model.SoNo); } /// <summary> @@ -106,18 +77,10 @@ /// <param name="model">SoDetailId:出库单明细ID、PalletNo:托盘码</param> /// <returns></returns> [HttpPost] public IActionResult GetOutlets(PdaSoVm model) [ServiceFilter(typeof(ApiResponseActionFilter))] public async Task<OutPdaInfo> GetOutlets(PdaSoVm model) { try { var models = _pdaSoSvc.GetOutlets(model.SoDetailId, model.PalletNo); return Ok(new { code = 0, msg = "托盘上物料等信息", data = models }); } catch (Exception e) { return Ok(new { code = 1, msg = e.Message }); } return await _pdaSoSvc.GetOutlets(model.SoDetailId, model.PalletNo); } /// <summary> @@ -126,18 +89,10 @@ /// <param name="model">SoDetailId:出库单明细ID</param> /// <returns></returns> [HttpPost] public IActionResult GetPlanAndFinishQty(PdaSoVm model) [ServiceFilter(typeof(ApiResponseActionFilter))] public async Task<OutPdaInfo> GetPlanAndFinishQty(PdaSoVm model) { try { var models = _pdaSoSvc.GetPlanAndFinishQty(model.SoDetailId); return Ok(new { code = 0, msg = "出库单明细数量信息", data = models }); } catch (Exception e) { return Ok(new { code = 1, msg = e.Message }); } return await _pdaSoSvc.GetPlanAndFinishQty(model.SoDetailId); } /// <summary> @@ -146,18 +101,10 @@ /// <param name="model">BoxNo:箱码号</param> /// <returns></returns> [HttpPost] public IActionResult GetDataComBoxInfo(PdaSoVm model) [ServiceFilter(typeof(ApiResponseActionFilter))] public async Task<List<BoxInfo>> GetDataComBoxInfo(PdaSoVm model) { try { var models = _pdaSoSvc.GetDataComBoxInfo(model.SoDetailId,model.PalletNo, model.BoxNo, model.BoxNo3); return Ok(new { code = 0, msg = "箱码信息", data = models }); } catch (Exception e) { return Ok(new { code = 1, msg = e.Message }); } return await _pdaSoSvc.GetDataComBoxInfo(model.SoDetailId, model.PalletNo, model.BoxNo, model.BoxNo3); } /// <summary> @@ -166,18 +113,10 @@ /// <param name="model">BoxNo:箱码号</param> /// <returns></returns> [HttpPost] public IActionResult GetAllotPlnInfo(PdaSoVm model) [ServiceFilter(typeof(ApiResponseActionFilter))] public async Task<List<BoxInfo>> GetAllotPlnInfo(PdaSoVm model) { try { var models = _pdaSoSvc.GetAllotPlnInfo(model.SoDetailId, model.PalletNo); return Ok(new { code = 0, msg = "箱码信息", data = models }); } catch (Exception e) { return Ok(new { code = 1, msg = e.Message }); } return await _pdaSoSvc.GetAllotPlnInfo(model.SoDetailId, model.PalletNo); }