| | |
| | | sqlString = $"select * from BllArrivalNoticeDetail where ASNNo = '{model.ASNNo}' and isdel='0' order by CreateTime;"; |
| | | var modelList = Db.Ado.SqlQuery<ArrivalNoticeDetailDto>(sqlString); |
| | | |
| | | return modelList; |
| | | List<ArrivalNoticeDetailDto> list = new List<ArrivalNoticeDetailDto>(); |
| | | foreach (var item in modelList) |
| | | { |
| | | string str = BySkuNoGetPackInfo(item.SkuNo); |
| | | if (str == "不存在") |
| | | { |
| | | list.Add(item); |
| | | } |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | return noticeList; |
| | | List<ArrivalNoticeDetailDto> list = new List<ArrivalNoticeDetailDto>(); |
| | | foreach (var item in noticeList) |
| | | { |
| | | string str = BySkuNoGetPackInfo(item.SkuNo); |
| | | if (str == "存在") |
| | | { |
| | | list.Add(item); |
| | | } |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | //根据物料获取是否存在包装信息 |
| | | public string BySkuNoGetPackInfo(string skuNo) |
| | | { |
| | | try |
| | | { |
| | | //获取物料信息 |
| | | var sku = Db.Queryable<SysMaterials>().First(a => a.IsDel == "0" && a.SkuNo == skuNo); |
| | | //判断物料信息是否为空 |
| | | if (!string.IsNullOrWhiteSpace(sku.PackagNo)) |
| | | { |
| | | return "存在"; |
| | | } |
| | | else |
| | | { |
| | | return "不存在"; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ex.Message; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | //判断物料数量是否为0 为0判断箱码信息 不为0继续 |
| | | if (model.SkuQty == 0) |
| | | if (model.TableType == 0) |
| | | { |
| | | if (string.IsNullOrEmpty(model.BoxNo)) |
| | | { |
| | |
| | | |
| | | } |
| | | } |
| | | int isTextTable = model.TableType; |
| | | int isDeposit = 0; |
| | | //判断总单单据是否为寄存单据 |
| | | if (notice.Type == "7") |
| | |
| | | var bNum = 0;//箱码物品数量 |
| | | |
| | | //判断是否为寄存物料 |
| | | if (isDeposit == 0) |
| | | if (isDeposit == 0 && isTextTable == 0) |
| | | { |
| | | if (pack == null) |
| | | { |
| | |
| | | Demo = model.Demo, |
| | | |
| | | }; |
| | | if (model.SkuQty > pNum && isDeposit == 0) |
| | | if (model.TableType == 0 && isDeposit == 0 && isTextTable == 0) |
| | | { |
| | | throw new Exception($"绑定失败,{model.PalletNo}托盘绑定数量大于该物品托盘包装数量!"); |
| | | } |
| | |
| | | // 更改箱支关系表 |
| | | decimal factQty = 0.00m;//托盘总数量 |
| | | //成品组托 |
| | | if (model.SkuQty == 0) |
| | | if (isTextTable == 0) |
| | | { |
| | | var boxGroup = boxInfoList.GroupBy(m => m.BoxNo).ToList(); |
| | | foreach (var g in boxGroup) |
| | |
| | | // 更新托盘绑定表 |
| | | bind.Qty += factQty; |
| | | } |
| | | if (bind.FullQty < bind.Qty && isDeposit == 0) |
| | | if (bind.FullQty < bind.Qty && isDeposit == 0 && isTextTable == 0) |
| | | { |
| | | throw new Exception("托盘绑定数量已超出该物料包装数量"); |
| | | } |
| | |
| | | { |
| | | bind.BitPalletMark = "0"; |
| | | } |
| | | if (bind.Qty > pNum && isDeposit == 0) |
| | | if (bind.Qty > pNum && isDeposit == 0 && isTextTable == 0) |
| | | { |
| | | throw new Exception($"绑定失败,{bind.PalletNo}托盘绑定数量大于该物品托盘包装数量!"); |
| | | } |