| | |
| | | using WMS.Entity.SysEntity; |
| | | using WMS.IBLL.IBllAsnServer; |
| | | using WMS.Entity.BllQualityEntity; |
| | | using WMS.Entity.BllCheckEntity; |
| | | |
| | | namespace WMS.BLL.BllAsnServer |
| | | { |
| | |
| | | //判断托盘绑定信息中是否有 |
| | | var bind = Db.Queryable<BllPalletBind>().First(m => m.IsDel == "0" && m.ASNDetailNo == detail.Id && m.PalletNo == model.PalletNo && m.Status != "2"); |
| | | var bindId = 0; |
| | | var boxQtyZong = model.Detail.Sum(m => m.Qty); |
| | | if (bind == null) |
| | | { |
| | | bind = new BllPalletBind |
| | |
| | | PalletNo = model.PalletNo, |
| | | PalletNo2 = "", |
| | | PalletNo3 = "", |
| | | Qty = model.Qty, |
| | | Qty = boxQtyZong, |
| | | FullQty = pNum, |
| | | Status = "0",//等待执行 |
| | | Type = model.Type, //托盘类型 0物料托 1空托盘托 |
| | |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("组盘信息重复"); |
| | | //throw new Exception("组盘信息重复"); |
| | | return; |
| | | } |
| | | |
| | | |
| | |
| | | Standard = box.Standard, |
| | | PackageStandard = box.PackageStandard, |
| | | StoreTime = box.StoreTime, |
| | | QtyCount = (int)box.QtyCount, |
| | | QtyOrd = (int)box.QtyOrd, |
| | | QtyCount = box.QtyCount.HasValue? (int)box.QtyCount : 0, |
| | | QtyOrd = box.QtyOrd.HasValue ? (int)box.QtyOrd : 0, |
| | | CreateUser = userId, |
| | | CreateTime = comTime, |
| | | }; |
| | |
| | | .GroupBy((a, b) => new |
| | | { |
| | | a.PalletNo, |
| | | a.BindNo, |
| | | a.BoxNo, |
| | | a.SkuNo, |
| | | a.SkuName, |
| | |
| | | .Select((a, b) => new BoxInfoDto() |
| | | { |
| | | BoxNo = a.BoxNo, |
| | | BindNo = a.BindNo, |
| | | PalletNo = a.PalletNo, |
| | | Qty = SqlFunc.AggregateSum(a.Qty), |
| | | FullQty = a.FullQty, |
| | |
| | | /// <param name="boxNo">箱码</param> |
| | | /// <param name="boxNo3">支码</param> |
| | | /// <returns></returns> |
| | | public List<BoxInfoDto> GetBoxInfoByBoxNo(string boxNo, string boxNo3) |
| | | public List<BoxInfoDto> GetBoxInfoByBoxNo(string bindNo, string boxNo, string boxNo3) |
| | | { |
| | | Expression<Func<BllBoxInfo, bool>> item = Expressionable.Create<BllBoxInfo>() |
| | | .AndIF(!string.IsNullOrWhiteSpace(bindNo), it => it.BindNo == int.Parse(bindNo)) |
| | | .AndIF(!string.IsNullOrWhiteSpace(boxNo), it => it.BoxNo == boxNo.Trim()) |
| | | .AndIF(!string.IsNullOrWhiteSpace(boxNo3), it => it.BoxNo3.Contains(boxNo3.Trim())) |
| | | .And(m => m.IsDel == "0") |
| | |
| | | EndLocate = beingTask.EndLocat, // 目标位置 |
| | | EndRoadway = beingTask.EndRoadway, // 目标巷道 |
| | | TaskNo = beingTask.TaskNo, // 任务号 |
| | | TaskType = "0",// 任务类型 (出库) |
| | | TaskType = "0",// 任务类型 (入库) |
| | | OutMode = "", //目标地址 |
| | | Order = 1 |
| | | }; |
| | |
| | | EndLocate = beingTask.EndLocat, // 目标位置 |
| | | EndRoadway = beingTask.EndRoadway, // 目标巷道 |
| | | TaskNo = beingTask.TaskNo, // 任务号 |
| | | TaskType = "0",// 任务类型 (出库) |
| | | TaskType = "0",// 任务类型 (出库) |
| | | OutMode = "", //目标地址 |
| | | Order = 1 |
| | | Order = 1 |
| | | }; |
| | | if (beingTask.IsSuccess == 0) |
| | | { |
| | |
| | | SkuName = boxInfo.SkuName, |
| | | Standard = sku.Standard, |
| | | ProductionTime = boxInfo.ProductionTime, |
| | | ExpirationTime = boxInfo.ExpirationTime, |
| | | SupplierLot = boxInfo.SupplierLot, |
| | | InspectStatus = boxInfo.InspectStatus, |
| | | InspectMark = boxInfo.InspectMark, |
| | |
| | | SkuName = demo.SkuName, |
| | | Standard = noticeDetail.Standard, |
| | | ProductionTime = demo.ProductionTime, |
| | | ExpirationTime = demo.ExpirationTime, |
| | | SupplierLot = demo.SupplierLot, |
| | | InspectStatus = demo.InspectStatus, |
| | | InspectMark = demo.InspectMark, |
| | |
| | | } |
| | | |
| | | |
| | | //申请缠膜入库 |
| | | public int RequestPackWcs(string palletNo) |
| | | { |
| | | try |
| | | { |
| | | int t = -1; |
| | | //验证托盘条码是否为空 |
| | | if (string.IsNullOrEmpty(palletNo)) |
| | | { |
| | | throw new Exception("未找到该托盘条码:"+ palletNo); |
| | | } |
| | | var palletBindList = Db.Queryable<BllPalletBind>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Status == "1").OrderByDescending(m=>m.CreateTime).First(); |
| | | if (palletBindList.IsBale == "1") |
| | | { |
| | | t = 1; |
| | | } |
| | | return t; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw new Exception(e.Message); |
| | | |
| | | } |
| | | } |
| | | |
| | | //申请拆膜出库 |
| | | public int RequestUnPackWcs(string palletNo) |
| | | { |
| | | try |
| | | { |
| | | int t = -1; |
| | | //验证托盘条码是否为空 |
| | | if (string.IsNullOrEmpty(palletNo)) |
| | | { |
| | | throw new Exception("未找到该托盘条码:" + palletNo); |
| | | } |
| | | var palletBindList = Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.LocatNo.Substring(0,1) != "B").First(); |
| | | if (palletBindList.IsBale == "2") |
| | | { |
| | | palletBindList.IsBale = "0"; |
| | | Db.Updateable(palletBindList).ExecuteCommand(); |
| | | t = 1; |
| | | } |
| | | |
| | | return t; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw new Exception(e.Message); |
| | | |
| | | } |
| | | } |
| | | |
| | | //缠膜完成 |
| | | public int RequestPackedWcs(string palletNo) |
| | | { |
| | | try |
| | | { |
| | | int t = -1; |
| | | //验证托盘条码是否为空 |
| | | if (string.IsNullOrEmpty(palletNo)) |
| | | { |
| | | throw new Exception("未找到该托盘条码:" + palletNo); |
| | | } |
| | | var palletBindList = Db.Queryable<BllPalletBind>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Status == "1").OrderByDescending(m => m.CreateTime).First(); |
| | | if (palletBindList.IsBale == "1") |
| | | { |
| | | palletBindList.IsBale = "2"; |
| | | Db.Updateable(palletBindList).ExecuteCommand(); |
| | | t = 1; |
| | | } |
| | | |
| | | return t; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw new Exception(e.Message); |
| | | |
| | | } |
| | | } |
| | | |
| | | ////重新下发入库任务 |
| | | //public OutCommandDto AgainSendAsnTask(string taskNo, int userId, string url) |