| | |
| | | throw new Exception("-1:当前托盘正在执行中,绑定失败,请核实!"); |
| | | } |
| | | bindId = bind.Id; |
| | | bind.Qty += model.SkuQty; |
| | | } |
| | | |
| | | #region 箱码信息 |
| | |
| | | |
| | | // 更改箱支关系表 |
| | | decimal factQty = 0.00m;//托盘总数量 |
| | | //成品组托 |
| | | if (model.SkuQty == 0) |
| | | { |
| | | var boxGroup = boxInfoList.GroupBy(m => m.BoxNo).ToList(); |
| | |
| | | var sqlString = string.Empty; |
| | | if (factQty == 0) |
| | | { |
| | | sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{bind.Qty}' where id = '{model.AsnDetailId}';"; |
| | | sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{model.SkuQty}' where id = '{model.AsnDetailId}';"; |
| | | } |
| | | else |
| | | { |
| | |
| | | Db.BeginTran();//开启事务 |
| | | if (iscount == 0)//正常入库 |
| | | { |
| | | #region 箱码信息 |
| | | var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList(); |
| | | //验证箱码信息是否存在 |
| | | if (boxInfoList.Count <= 0) |
| | | { |
| | | throw new Exception("箱码信息不存在,请核查!"); |
| | | } |
| | | foreach (var item in boxInfoList) |
| | | { |
| | | item.Status = "2"; // 改变箱支关系表状态:已入库 |
| | | item.UpdateTime = serverTime; |
| | | item.UpdateUser = model.CreateUser; |
| | | } |
| | | Db.Updateable(boxInfoList).ExecuteCommand(); |
| | | #endregion |
| | | |
| | | #region 入库总单信息 |
| | | var notice = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.Status != "3" && a.ASNNo == model.ASNNo); |
| | | //验证入库单总单是否关闭 |
| | |
| | | if (notice.Status == "3") |
| | | { |
| | | throw new Exception("入库单总单已关闭,请核查!"); |
| | | } |
| | | #endregion |
| | | |
| | | #region 箱码信息 |
| | | var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList(); |
| | | // type 0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料退回入库 5:其它入库 6:代储入库 7:寄存入库 |
| | | if (notice.Type == "2" || notice.Type == "6" || notice.Type == "7") |
| | | { |
| | | // 不贴码物料 无需验证箱码信息 |
| | | } |
| | | else |
| | | { |
| | | //验证箱码信息是否存在 |
| | | if (boxInfoList.Count <= 0) |
| | | { |
| | | throw new Exception("箱码信息不存在,请核查!"); |
| | | } |
| | | foreach (var item in boxInfoList) |
| | | { |
| | | item.Status = "2"; // 改变箱支关系表状态:已入库 |
| | | item.UpdateTime = serverTime; |
| | | item.UpdateUser = model.CreateUser; |
| | | } |
| | | Db.Updateable(boxInfoList).ExecuteCommand(); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | ASNDetailNo = (int)bindInfo.ASNDetailNo, |
| | | WareHouseNo = "W02", |
| | | RoadwayNo = "", |
| | | AreaNo = "", |
| | | AreaNo = storageLocat.AreaNo, |
| | | LocatNo = model.LocatNo, |
| | | PalletNo = model.PalletNo, |
| | | PalletNo2 = bindInfo.PalletNo2, |
| | |
| | | { |
| | | stId = detailModel.Id; |
| | | detailModel.LocatNo = model.LocatNo; |
| | | detailModel.AreaNo = storageLocat.AreaNo; |
| | | detailModel.UpdateTime = serverTime; |
| | | detailModel.UpdateUser = (int)model.CreateUser; |
| | | // 变更储位地址 |