| | |
| | | |
| | | public class MesDepotSectionsManager : Repository<MesDepotSections> |
| | | { |
| | | public string GetSectionName(WarehouseQuery query) |
| | | public dynamic GetSectionName(WarehouseQuery query) |
| | | { |
| | | var sectionName = Db.Queryable<MesDepotSections, MesDepots>( |
| | | (a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, |
| | | a.DepotGuid == b.Guid)) |
| | | a.DepotGuid == b.Guid)) // 确保Guid类型正确比较 |
| | | .Where((a, b) => a.DepotSectionCode == query.sectionCode) |
| | | .Select((a, b) => a.DepotSectionName).Single(); |
| | | .Select((a, b) => new // 改用匿名类型替代dynamic |
| | | { |
| | | a.DepotSectionName, |
| | | DepotName = b.DepotName, // 显式指定字段别名 |
| | | DepotCode = b.DepotCode |
| | | }).Single(); |
| | | |
| | | if (sectionName == null) |
| | | throw new Exception("库位编码 " + query.sectionCode + " 不存在,请确认!"); |