| | |
| | | { |
| | | throw new Exception("请扫描外箱条码!"); |
| | | } |
| | | var count = Db.Queryable<BllBoxInfo>().Count(m => m.IsDel == "0" && m.Status == "0" && m.BoxNo == model.BoxNo); |
| | | if (count == 0) |
| | | if (!string.IsNullOrWhiteSpace(model.ASNNo)) |
| | | { |
| | | GetBoxInfoByFuMa(model.BoxNo, ""); //从赋码系统获取箱码信息 |
| | | var asnData = Db.Queryable<BllArrivalNotice>().First(m => m.IsDel == "0" && m.ASNNo == model.ASNNo); |
| | | if (asnData != null && (asnData.Type == "0" || asnData.Type == "3")) |
| | | { |
| | | var count = Db.Queryable<BllBoxInfo>().Count(m => m.IsDel == "0" && m.Status == "0" && m.BoxNo == model.BoxNo); |
| | | if (count == 0) |
| | | { |
| | | GetBoxInfoByFuMa(model.BoxNo, ""); //从赋码系统获取箱码信息 |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | string sqlString = $@"SELECT |
| | | ASNNo, |
| | | BoxNo, |
| | |
| | | AND BoxNo = '{model.BoxNo}' |
| | | GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo; "; |
| | | var models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString); |
| | | if (models == null) |
| | | if (models.Count == 0) |
| | | { |
| | | throw new Exception("箱码信息不存在!"); |
| | | } |
| | |
| | | factQty += box.Qty; |
| | | boxFullQty += box.Qty; |
| | | } |
| | | if (boxFullQty > bNum) |
| | | { |
| | | throw new Exception($"绑定失败,{g.Key}箱码绑定数量大于该物品包装数量!"); |
| | | } |
| | | //if (boxFullQty > bNum) |
| | | //{ |
| | | // throw new Exception($"绑定失败,{g.Key}箱码绑定数量大于该物品包装数量!"); |
| | | //} |
| | | } |
| | | Db.Updateable(boxInfoList).ExecuteCommand(); |
| | | |
| | | // 更新托盘绑定表 |
| | | bind.Qty += factQty; |
| | | } |
| | | if (bind.FullQty < bind.Qty && isDeposit == 0 && isTextTable == 0) |
| | | { |
| | | throw new Exception("托盘绑定数量已超出该物料包装数量"); |
| | | } |
| | | //if (bind.FullQty < bind.Qty && isDeposit == 0 && isTextTable == 0) |
| | | //{ |
| | | // throw new Exception("托盘绑定数量已超出该物料包装数量"); |
| | | //} |
| | | |
| | | if (bind.FullQty == bind.Qty) |
| | | if (bind.FullQty <= bind.Qty) |
| | | { |
| | | bind.BitPalletMark = "0"; |
| | | } |
| | | if (bind.Qty > pNum && isDeposit == 0 && isTextTable == 0) |
| | | { |
| | | throw new Exception($"绑定失败,{bind.PalletNo}托盘绑定数量大于该物品托盘包装数量!"); |
| | | } |
| | | //if (bind.Qty > pNum && isDeposit == 0 && isTextTable == 0) |
| | | //{ |
| | | // throw new Exception($"绑定失败,{bind.PalletNo}托盘绑定数量大于该物品托盘包装数量!"); |
| | | //} |
| | | Db.Updateable(bind).Where(m => m.Id == bindId).ExecuteCommand(); |
| | | |
| | | // 更改入库单明细已组数量 |
| | |
| | | PackagNo = sku.PackagNo, |
| | | IsBale = bindInfo.IsBale, |
| | | IsBelt = bindInfo.IsBelt, |
| | | |
| | | Demo = bindInfo.Demo, |
| | | CreateUser = (int)model.CreateUser, |
| | | CreateTime = serverTime |
| | | }; |