From 0b87b08ef12e2293cf073f75f7ee73b9423686fa Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期六, 08 十一月 2025 10:12:48 +0800
Subject: [PATCH] 1
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 55 insertions(+), 4 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs"
index cd50907..450f6a7 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs"
@@ -1,5 +1,9 @@
-锘縰sing WIDESEA_Core.BaseRepository;
+锘縰sing SqlSugar;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
+using WIDESEA_Core.HttpContextUser;
+using WIDESEA_DTO.Stock;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
@@ -7,10 +11,12 @@
{
public partial class StockInfoDetailService : ServiceBase<Dt_StockInfoDetail, IRepository<Dt_StockInfoDetail>>, IStockInfoDetailService
{
- public StockInfoDetailService(IRepository<Dt_StockInfoDetail> BaseDal) : base(BaseDal)
+ public StockInfoDetailService(IRepository<Dt_StockInfoDetail> BaseDal, IRepository<Dt_StockInfo> stockinfoRepository) : base(BaseDal)
{
+ _stockinfoRepository = stockinfoRepository;
}
+ public IRepository<Dt_StockInfo> _stockinfoRepository;
public IRepository<Dt_StockInfoDetail> Repository => BaseDal;
public bool ExistBarcodes(string barcode)
@@ -20,7 +26,52 @@
public bool ExistBarcodes(List<string> barcodes)
{
- return BaseDal.QueryFirst(x =>!string.IsNullOrEmpty( x.Barcode) && barcodes.Contains(x.Barcode)) != null;
+ return BaseDal.QueryFirst(x => !string.IsNullOrEmpty(x.Barcode) && barcodes.Contains(x.Barcode)) != null;
+ }
+
+ public PageGridData<StockInfoDetailWithPalletDto> GetPageData2(PageDataOptions options)
+ {
+ PageGridData<Dt_StockInfoDetail> lists = base.GetPageData (options);
+
+ List<int> stockIds = lists.Rows.Select(detail => detail.StockId).Distinct().ToList();
+ var stocks= _stockinfoRepository.QueryData(x => stockIds.Contains(x.Id)).ToList();
+
+
+ List<StockInfoDetailWithPalletDto> dtoList = lists.Rows
+ .Select(detail => new StockInfoDetailWithPalletDto
+ {
+
+ Id = detail.Id,
+ StockId = detail.StockId,
+ MaterielCode = detail.MaterielCode,
+ MaterielName = detail.MaterielName,
+ OrderNo = detail.OrderNo,
+ BatchNo = detail.BatchNo,
+ ProductionDate = detail.ProductionDate,
+ EffectiveDate = detail.EffectiveDate,
+ SerialNumber = detail.SerialNumber,
+ StockQuantity = detail.StockQuantity,
+ OutboundQuantity = detail.OutboundQuantity,
+ Status = detail.Status,
+ Unit = detail.Unit,
+ InboundOrderRowNo = detail.InboundOrderRowNo,
+ SupplyCode = detail.SupplyCode,
+ WarehouseCode = detail.WarehouseCode,
+ Barcode = detail.Barcode,
+ BusinessType = detail.BusinessType,
+ Remark = detail.Remark,
+ Creater = detail.Creater,
+ CreateDate = detail.CreateDate,
+ Modifier = detail.Modifier,
+ ModifyDate = detail.ModifyDate,
+ PalletCode= stocks
+ .FirstOrDefault(stock => stock.Id == detail.StockId)?
+ .PalletCode ?? "鏃犳墭鐩樼紪鍙�"
+ })
+ .ToList();
+
+ return new PageGridData<StockInfoDetailWithPalletDto> { Rows = dtoList, Total = lists.Total, Summary = lists.Summary };
}
}
-}
+ }
+
--
Gitblit v1.9.3