| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 查询出入库明细及物料信息(联查 InOutStorageDetail 和 BASEMaterialView) |
| | | /// </summary> |
| | | /// <returns>返回包含型材编码、船号、分段号、业务标识、库位、时间等信息的列表</returns> |
| | | public List<InOutStorageDetailResultForMes> GetInOutStorageDetailListForMes() |
| | | { |
| | | using (DbModelLog context = new DbModelLog()) |
| | | { |
| | | try |
| | | { |
| | | string sql = @" |
| | | SELECT |
| | | A.id AS Id, |
| | | B.code AS Code, |
| | | B.issueprojectno AS IssueProjectNo, |
| | | B.serialno AS SerialNo, |
| | | A.type AS BusinessFlag, |
| | | A.toplacecode AS PlaceCode, |
| | | A.createtime AS Timestamp, |
| | | A.createtime AS OccurrenceTime |
| | | FROM |
| | | InOutStorageDetail A |
| | | INNER JOIN |
| | | WGQ_WB19011_CORE.[dbo].[BASEMaterialView] B |
| | | ON A.materialid = B.id And A.isSendToMes=1 "; |
| | | |
| | | // 执行 SQL 查询,并映射到自定义类 InOutStorageDetailResult |
| | | var data = context.Database.SqlQuery<InOutStorageDetailResultForMes>(sql).ToList(); |
| | | |
| | | return data; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // 记录异常日志(和你原有方法保持一致) |
| | | LogTextHelper.WriteLine("InOutService", "GetInOutStorageDetailList", ex.ToString()); |
| | | return null; // 或者返回 new List<InOutStorageDetailResult>(),根据你的业务需求 |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |