| | |
| | | throw new Exception("此条码不属于到货条码,无法用采购入库!"); |
| | | |
| | | var inventory = Db.Queryable<MesInvItemArn>() |
| | | .Where(it => it.BillNo == itemBarcodeDetails.BillNo) |
| | | .Where(it => it.BillNo == itemBarcodeDetails.BillNo && it.Fstatus == true ) |
| | | .First(); |
| | | |
| | | if (inventory == null) |
| | | throw new Exception("此条码找不到对应收货单!"); |
| | | throw new Exception("此条码找不到对应收货单或未审核!"); |
| | | |
| | | // var inventoryDetails = Db.Queryable<MesInvItemArnDetail>() |
| | | // .Where(it => it.ParentGuid == inventory.Guid |
| | |
| | | if (inventoryDetails == null) |
| | | throw new Exception("此条码找不到对应收货单明细!"); |
| | | |
| | | //if (string.IsNullOrEmpty(inventoryDetails.CheckRes) || inventoryDetails.CheckRes != "Y:合格") |
| | | //{ |
| | | // throw new Exception("该条码对应的收料单检验不合格或未检验!"); |
| | | //} |
| | | //获取到货检验明细 |
| | | var sqlParams = new List<SugarParameter> { new("@dhmxGuid", itemBarcodeDetails.AboutGuid) }; |
| | | var sql1 = @"SELECT *FROM v_dhmx WHERE dhmxGuid = @dhmxGuid "; |
| | | var dhjymx = Db.Ado.SqlQuery<vDhmx>(sql1, sqlParams).First(); |
| | | //判定检验能否入库 |
| | | if (dhjymx.CanStore!= 1) |
| | | { |
| | | throw new Exception($"该条码对应的收料单检验结果:【{dhjymx.InspectionResult}】,判定结果:【{dhjymx.JudgmentResult}】,处理意见:【{dhjymx.HandlingSuggestion}】,无法入库"); |
| | | } |
| | | |
| | | var depotCode = Db.Queryable<MesDepotSections>() |
| | | .Where(it => it.DepotSectionCode == sectionCode) |
| | |
| | | if (mesInvItemInCDetails == null) |
| | | throw new Exception("物料入库条码明细不存在"); // 抛出异常以供前台处理 |
| | | |
| | | // 创建 插入日志 |
| | | var logService = new LogService(); |
| | | var LogMsg = "【PDA】采购入库。条码【" + entity.barcode + "】 入库单号【" + cBillNo + "】"; |
| | | logService.CreateLog(db, entity.userName, inventory.Guid.ToString(), "MES_INV_ITEM_ARN", LogMsg, inventory.BillNo); |
| | | |
| | | return 1; |
| | | }); |
| | | |