| | |
| | | { |
| | | public dynamic GetSectionName(WarehouseQuery query) |
| | | { |
| | | var sectionName = Db.Queryable<MesDepotSections, MesDepots>( |
| | | (a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, |
| | | a.DepotGuid == b.Guid)) // 确保Guid类型正确比较 |
| | | var sectionName = Db.Queryable<MesDepotSections, MesDepots>((a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, |
| | | a.DepotGuid == b.Guid)) // 确保Guid类型正确比较 |
| | | .Where((a, b) => a.DepotSectionCode == query.sectionCode) |
| | | .Select((a, b) => new // 改用匿名类型替代dynamic |
| | | .Select((a, b) => new // 改用匿名类型替代dynamic |
| | | { |
| | | a.DepotSectionName, |
| | | DepotName = b.DepotName, // 显式指定字段别名 |
| | | DepotCode = b.DepotCode |
| | | b.DepotName, // 显式指定字段别名 |
| | | b.DepotCode |
| | | }).Single(); |
| | | |
| | | if (sectionName == null) |
| | |
| | | if (string.IsNullOrEmpty(query.sectionCode)) |
| | | throw new Exception("请扫库位条码!"); |
| | | |
| | | var mesDepotSections = Db.Queryable<MesDepotSections, MesDepots>( |
| | | (a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, |
| | | a.DepotGuid == b.Guid)) |
| | | var mesDepotSections = Db |
| | | .Queryable<MesDepotSections, MesDepots>((a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, |
| | | a.DepotGuid == b.Guid)) |
| | | .Where((a, b) => a.DepotSectionCode == query.sectionCode) |
| | | .Select((a, b) => new MesDepotSections |
| | | { |
| | |
| | | if (string.IsNullOrEmpty(entity.sectionCode)) |
| | | throw new Exception("请扫库位条码!"); |
| | | |
| | | var mesDepotSections = Db.Queryable<MesDepotSections, MesDepots>( |
| | | (a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, |
| | | a.Zuid.ToString() == b.Zuid)) |
| | | var mesDepotSections = Db |
| | | .Queryable<MesDepotSections, MesDepots>((a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, |
| | | a.Zuid.ToString() == b.Zuid)) |
| | | .Where((a, b) => a.DepotSectionCode == entity.sectionCode) |
| | | .First(); |
| | | if (mesDepotSections == null) |