| | |
| | | MES_DEPOTS b ON a.depot_guid = b.Guid |
| | | WHERE a.depot_section_code = @sectionCode;"; |
| | | |
| | | dynamic depotInfo; |
| | | try |
| | | { |
| | | depotInfo = Db.Ado.SqlQuery<dynamic>(sql2, sqlParams).First(); |
| | | } |
| | | catch |
| | | { |
| | | var depotInfo = Db.Ado.SqlQuery<dynamic>(sql2, sqlParams).First(); |
| | | |
| | | if (depotInfo is null) |
| | | throw new Exception($"库位编码 {sectionCode} 不存在,请确认!"); |
| | | } |
| | | |
| | | // 5. 返回成功信息 |
| | | return depotInfo; |
| | |
| | | throw new Exception("请扫库位条码!"); |
| | | |
| | | // 2. 查询库位对应的仓库编码和仓库ID |
| | | var depotInfo2 = new { DepotCode = "", DepotId = (int?)0 }; // 匹配数据库返回的可空类型 |
| | | try |
| | | { |
| | | depotInfo2 = Db.Queryable<MesDepotSections, MesDepots>( |
| | | (a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, a.DepotGuid == b.Guid)) |
| | | .Where((a, b) => a.DepotSectionCode == p_section_code) |
| | | .Select((a, b) => new { b.DepotCode, b.DepotId }) |
| | | .First(); |
| | | } |
| | | catch |
| | | { |
| | | throw new Exception($"库位编码 {p_section_code} 不存在,请确认!"); |
| | | } |
| | | var depotInfo = Db.Queryable<MesDepotSections, MesDepots>( |
| | | (a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, a.DepotGuid == b.Guid)) |
| | | .Where((a, b) => a.DepotSectionCode == p_section_code) |
| | | .Select((a, b) => new { b.DepotCode, b.DepotId }) |
| | | .First(); |
| | | |
| | | var c_depot_code = depotInfo2.DepotCode; |
| | | var c_depot_id = depotInfo2.DepotId; |
| | | if (depotInfo == null) |
| | | throw new Exception($"库位编码 {p_section_code} 不存在,请确认!"); |
| | | |
| | | var c_depot_code = depotInfo.DepotCode; |
| | | var c_depot_id = depotInfo.DepotId; |
| | | |
| | | var sqlParams = new List<SugarParameter> { new("@barcode", p_item_barcode), new("@billNo", p_bill_no) }; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | MesDepots mesDepost; |
| | | try |
| | | { |
| | | mesDepost = Db.Queryable<MesDepots>() |
| | | var mesDepost = Db.Queryable<MesDepots>() |
| | | .Where(s => s.DepotId == c_depot_id).First(); |
| | | } |
| | | catch |
| | | { |
| | | throw new Exception($"仓库ID {c_depot_id} 对应的仓库信息不存在,请确认!"); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | if (qtrk == null) throw new Exception("其他入库申请单不存在!"); |
| | | |
| | | if(p_bill_no != barcode.BillNo) |
| | | throw new Exception($"该条码对应的申请单【{barcode.BillNo}】与当前申请单号不匹配!"); |
| | | |
| | | if (qtrk.Qt008 != c_depot_id.ToString()) |
| | | throw new Exception($"该 {p_section_code} 对应的仓库 与 检验判定的入库仓库不一致,请确认!"); |