pan
8 天以前 cd7253920c5e597f6a8eefe813dd039bf1a5894b
Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu
已添加1个文件
已修改14个文件
334 ■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/router/viewGird.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/stock/stockInfoDetailByMaterielSum.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateDetailService.cs 73 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IAllocateService/IAllocateDetailService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IStockService/IStockDetailByMaterielService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoDetailService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/StockDetailByMateriel.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockDetailByMaterielService.cs 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderDetailController.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockDetailByMaterielController.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoDetailController.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue
@@ -326,7 +326,7 @@
        wheres: JSON.stringify(wheres), // æŸ¥è¯¢æ¡ä»¶ï¼Œæ ¼å¼ä¸º[{ name: "字段", value: "xx" }]
      };
      this.http
        .post("api/AllocateOrderDetail/GetPageData", param, "查询中")
        .post("api/AllocateOrderDetail/GetDetailPage", param, "查询中")
        .then((x) => {
          this.tableData = x.rows;
        });
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/router/viewGird.js
@@ -219,8 +219,8 @@
    component: () => import('@/views/check/ReCheckOrder.vue')
  },
  {
    path: '/stockInfoDetailByMaterielSum',
    name: 'Dt_StockInfoDetailss',
    path: '/StockDetailByMateriel',
    name: 'StockDetailByMateriel',
    component: () => import('@/views/stock/stockInfoDetailByMaterielSum.vue')
  }
]
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue
@@ -27,8 +27,8 @@
            @keyup.enter.native="onBarcodeScan">
          </el-input>
          <el-button type="success" @click="confirmPicking">确认拣选</el-button>
          <el-button type="warning" @click="openSplitDialog">拆包</el-button>
          <el-button type="info" @click="openRevertSplitDialog">撤销拆包</el-button>
          <!-- <el-button type="warning" @click="openSplitDialog">拆包</el-button>
          <el-button type="info" @click="openRevertSplitDialog">撤销拆包</el-button> -->
          <el-button type="info" @click="handleEmptyPallet">取空箱</el-button>
          <el-button type="primary" @click="openBatchReturnDialog">回库</el-button>
        </div>
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/stock/stockInfoDetailByMaterielSum.vue
@@ -12,9 +12,9 @@
    const table = ref({
      key: "id",
      footer: "Foots",
      cnName: "库存信息明细",
      name: "stockInfoDetail",
      url: "/StockInfoDetail/",
      cnName: "库存汇总",
      name: "StockDetailByMateriel",
      url: "/StockDetailByMateriel/",
      sortName: "id",
    });
    const editFormFields = ref({
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateDetailService.cs
@@ -15,37 +15,72 @@
{
    public class AllocateDetailService : ServiceBase<Dt_AllocateOrderDetail, IRepository<Dt_AllocateOrderDetail>>, IAllocateDetailService
    {
        public AllocateDetailService(IRepository<Dt_AllocateOrderDetail> BaseDal) : base(BaseDal)
        public readonly IRepository<Dt_AllocateOrder> _allocateOrderRepository;
        public AllocateDetailService(IRepository<Dt_AllocateOrderDetail> BaseDal, IRepository<Dt_AllocateOrder> allocateOrderRepository) : base(BaseDal)
        {
            _allocateOrderRepository = allocateOrderRepository;
        }
        IRepository<Dt_AllocateOrderDetail> IAllocateDetailService.Repository => BaseDal;
        public override PageGridData<Dt_AllocateOrderDetail> GetPageData(PageDataOptions options)
        public override PageGridData<Dt_OutboundOrderDetail> GetDetailPage(PageDataOptions options)
        {
            string wheres = ValidatePageOptions(options);
            //获取排序字段
            Dictionary<string, SqlSugar.OrderByType> orderbyDic = GetPageDataSort(options, TProperties);
            List<OrderByModel> orderByModels = new List<OrderByModel>();
            foreach (var item in orderbyDic)
            {
                OrderByModel orderByModel = new()
                {
                    FieldName = item.Key,
                    OrderByType = item.Value
                };
                orderByModels.Add(orderByModel);
            }
            ISugarQueryable<Dt_AllocateOrderDetail> sugarQueryable1 = BaseDal.Db.Queryable<Dt_AllocateOrderDetail>();
            int totalCount = 0;
            List<SearchParameters> searchParametersList = new List<SearchParameters>();
            if (!string.IsNullOrEmpty(options.Wheres))
            {
                List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
                int totalCount = 0;
                if (searchParametersList.Count > 0)
                try
                {
                    {
                        SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_AllocateOrderDetail.OrderId).FirstLetterToLower());
                        if (searchParameters != null)
                        {
                            sugarQueryable1 = sugarQueryable1.Where(x => x.OrderId == searchParameters.Value.ObjToInt());
                            var dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount);
                            return new PageGridData<Dt_AllocateOrderDetail>(totalCount, dataList);
                        }
                    }
                    searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
                    options.Filter = searchParametersList;
                }
                catch { }
            }
            return new PageGridData<Dt_AllocateOrderDetail>();
            //var data = BaseDal.Db.Queryable<Dt_AllocateOrderDetail>()
            //    .WhereIF(!wheres.IsNullOrEmpty(), wheres)
            //    .OrderBy(orderByModels)
            //    .ToPageList(options.Page, options.Rows, ref totalCount);
            //Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.Id == (int)options.Value);
            //Dt_InboundOrder _InboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == allocateOrder.UpperOrderNo).First();
            //var details = _inboundOrderDetailRepository.QueryData(x => x.OrderId == _InboundOrder.Id );
            //foreach (var item in data)
            //{
            //    var detail = details.Where(x => x.MaterielCode == item.MaterielCode).FirstOrDefault();
            //    if (detail != null)
            //    {
            //        item.OrderQuantity = detail.OrderQuantity;
            //        item.ReceiptQuantity = detail.ReceiptQuantity;
            //        item.OverInQuantity = detail.OverInQuantity;
            //        item.OrderDetailStatus = detail.OrderDetailStatus;
            //    }
            //}
            //return new PageGridData<Dt_AllocateOrderDetail>(totalCount, data);
            Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.Id == options.Filter.FirstOrDefault().Value.ObjToInt());
            Dt_OutboundOrder _InboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == allocateOrder.UpperOrderNo).First();
            var data = BaseDal.Db.Queryable<Dt_OutboundOrderDetail>()
                .WhereIF(!_InboundOrder.IsNullOrEmpty(), x => x.OrderId == _InboundOrder.Id)
                .OrderBy(orderByModels)
                .ToPageList(options.Page, options.Rows, ref totalCount);
            return new PageGridData<Dt_OutboundOrderDetail>(totalCount, data);
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_IAllocateService/IAllocateDetailService.cs
@@ -12,5 +12,6 @@
    public interface IAllocateDetailService : IService<Dt_AllocateOrderDetail>
    {
        IRepository<Dt_AllocateOrderDetail> Repository { get; }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_IStockService/IStockDetailByMaterielService.cs
@@ -11,10 +11,8 @@
namespace WIDESEA_IStockService
{
    public interface IStockDetailByMaterielService : IService<StockDetailByMateriel>
    public interface IStockDetailByMaterielService : IDependency
    {
        IRepository<StockDetailByMateriel> Repository { get; }
        PageGridData<StockDetailByMateriel> GetPageData2(PageDataOptions options);
        PageGridData<StockDetailByMateriel> GetPageGridData(PageDataOptions options);
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoDetailService.cs
@@ -15,6 +15,5 @@
        PageGridData<StockInfoDetailWithPalletDto> GetPageData2(PageDataOptions options);
        PageGridData<StockDetailDtO> GetPageDataByMateriel(PageDataOptions options);
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs
@@ -652,7 +652,7 @@
            {
                return WebResponseContent.Instance.Error("托盘号不能为空");
            }
            var stock = _stockRepository.Db.Queryable<Dt_StockInfo>().Includes(o => o.Details).First(x => x.PalletCode == palletCode && x.StockStatus == (int)StockStatusEmun.组盘暂存);
            var stock = _stockRepository.Db.Queryable<Dt_StockInfo>().Includes(o => o.Details).First(x => x.PalletCode == palletCode && (x.StockStatus == (int)StockStatusEmun.组盘暂存|| x.StockStatus == StockStatusEmun.入库确认.ObjToInt()));
            if (stock == null)
            {
                return WebResponseContent.Instance.Error($"未找到托盘号{palletCode}对应的库存记录");
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/StockDetailByMateriel.cs
@@ -70,5 +70,12 @@
        public DateTime? ValidDate { get; set; }
        public string Remark { get; set; }
        public string Creater { get; set; }
        public DateTime? CreateDate { get; set; }
        public string Modifier { get; set; }
        public DateTime? ModifyDate { get; set; }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_StockService/StockDetailByMaterielService.cs
@@ -1,12 +1,164 @@
using System;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Helper;
using WIDESEA_DTO.Stock;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
namespace WIDESEA_StockService
{
    internal class StockDetailByMaterielService
    public class StockDetailByMaterielService :IStockDetailByMaterielService
    {
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly SqlSugarClient _dbBase;
        public StockDetailByMaterielService(IUnitOfWorkManage unitOfWorkManage)
        {
            _unitOfWorkManage = unitOfWorkManage;
            _dbBase = unitOfWorkManage.GetDbClient();
        }
        public virtual PageGridData<StockDetailByMateriel> GetPageGridData(PageDataOptions options)
        {
            try
            {
                List<StockDetailByMateriel> materielnfoStatistics = new List<StockDetailByMateriel>();
                ISugarQueryable<Dt_StockInfoDetail> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfoDetail>();
                ISugarQueryable<Dt_StockInfo> sugarQueryable = _dbBase.Queryable<Dt_StockInfo>();
                if (!string.IsNullOrEmpty(options.Wheres))
                {
                    try
                    {
                        List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
                        if (searchParametersList.Count > 0)
                        {
                            {
                                SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.MaterielCode).FirstLetterToLower());
                                if (searchParameters != null)
                                {
                                    sugarQueryable1 = sugarQueryable1.Where(x => x.MaterielCode.Contains(searchParameters.Value));
                                }
                            }
                            {
                                SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfo.WarehouseId).FirstLetterToLower());
                                if (searchParameters != null)
                                {
                                    sugarQueryable = sugarQueryable.Where(x => x.WarehouseId.Equals(searchParameters.Value));
                                }
                            }
                            {
                                SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfo.StockStatus).FirstLetterToLower());
                                if (searchParameters != null)
                                {
                                    sugarQueryable = sugarQueryable.Where(x => x.StockStatus.Equals(searchParameters.Value));
                                }
                            }
                            {
                                SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.MaterielName).FirstLetterToLower());
                                if (searchParameters != null)
                                {
                                    sugarQueryable1 = sugarQueryable1.Where(x => x.MaterielName.Contains(searchParameters.Value));
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
                ISugarQueryable<StockDetailByMateriel> sugarQueryable2 = sugarQueryable1.InnerJoin(sugarQueryable, (b, a) => b.StockId == a.Id).Where((b, a) => a.LocationCode != "" && a.LocationCode != null).Select((b, a)
                    => new StockDetailByMateriel
                    {
                       StockId = b.StockId,
                        MaterielCode = b.MaterielCode,
                        MaterielName = b.MaterielName,
                        StockQuantity = (decimal)b.StockQuantity,
                        OutboundQuantity = (decimal)b.OutboundQuantity,
                        OrderNo = b.OrderNo,
                        BatchNo = b.BatchNo,
                        SerialNumber = b.SerialNumber,
                        SupplyCode = b.SupplyCode,
                        WarehouseCode = b.WarehouseCode,
                        Barcode = b.Barcode,
                        Unit = b.Unit,
                        Creater = b.Creater,
                        CreateDate= b.CreateDate,
                        Modifier = b.Modifier,
                        ModifyDate = b.ModifyDate,
                        Remark = a.Remark,
                    });
                // èŽ·å–æ‰€æœ‰æ•°æ®
                var allData = sugarQueryable2.ToList();
                // ä½¿ç”¨å­—典进行分组汇总
                var groupedData = new Dictionary<string, StockDetailByMateriel>();
                foreach (var item in allData)
                {
                    // ç¡®ä¿åˆå§‹å€¼ä¸ºdecimal类型
                    if (groupedData.ContainsKey(item.MaterielCode))
                    {
                        groupedData[item.MaterielCode].StockQuantity += Convert.ToDecimal(item.StockQuantity);
                        groupedData[item.MaterielCode].OutboundQuantity += Convert.ToDecimal(item.OutboundQuantity);
                    }
                    else
                    {
                        groupedData[item.MaterielCode] = new StockDetailByMateriel
                        {
                            StockId = item.StockId,
                            MaterielCode = item.MaterielCode,
                            MaterielName = item.MaterielName,
                            StockQuantity = Convert.ToDecimal(item.StockQuantity),
                            OutboundQuantity = Convert.ToDecimal(item.OutboundQuantity),
                            OrderNo = item.OrderNo,
                            BatchNo = item.BatchNo,
                            SerialNumber = item.SerialNumber,
                            SupplyCode = item.SupplyCode,
                            WarehouseCode = item.WarehouseCode,
                            Barcode = item.Barcode,
                            Creater = item.Creater,
                            CreateDate = item.CreateDate,
                            Modifier = item.Modifier,
                            ModifyDate = item.ModifyDate,
                            Unit = item.Unit,
                            Remark = item.Remark
                        };
                    }
                }
                // è½¬æ¢ä¸ºåˆ—表
                materielnfoStatistics = groupedData.Values.ToList();
                // åˆ†é¡µå¤„理
                int startIndex = (options.Page - 1) * options.Rows;
                int endIndex = Math.Min(startIndex + options.Rows, materielnfoStatistics.Count);
                materielnfoStatistics = materielnfoStatistics.GetRange(startIndex, endIndex - startIndex);
                int count = groupedData.Count;
                return new PageGridData<StockDetailByMateriel>(count, materielnfoStatistics);
            }
            catch (Exception ex)
            {
            }
            return new PageGridData<StockDetailByMateriel>();
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs
@@ -73,41 +73,6 @@
            return new PageGridData<StockInfoDetailWithPalletDto> { Rows = dtoList, Total = lists.Total, Summary = lists.Summary  };
        }
        public PageGridData<StockDetailDtO> GetPageDataByMateriel(PageDataOptions options)
        {
            PageGridData<Dt_StockInfoDetail> lists = base.GetPageData(options);
            List<StockDetailDtO> dtoList = lists.Rows.GroupBy(detail => new { detail.MaterielCode, detail.BatchNo, detail.SupplyCode }).Select(group =>
            {
                var firstItem = group.First();
                return new StockDetailDtO
                {
                    Id = firstItem.Id,
                    StockId = firstItem.StockId,
                    MaterielCode = group.Key.MaterielCode,
                    MaterielName = firstItem.MaterielName,
                    OrderNo = firstItem.OrderNo,
                    BatchNo = group.Key.BatchNo,
                    ProductionDate = firstItem.ProductionDate,
                    EffectiveDate = firstItem.EffectiveDate,
                    SerialNumber = firstItem.SerialNumber,
                    // æ ¸å¿ƒï¼šå¯¹å½“前分组的StockQuantity求和
                    StockQuantity = group.Sum(item => item.StockQuantity),
                    OutboundQuantity = firstItem.OutboundQuantity,
                    Status = firstItem.Status,
                    Unit = firstItem.Unit,
                    InboundOrderRowNo = firstItem.InboundOrderRowNo,
                    SupplyCode = group.Key.SupplyCode,
                    WarehouseCode = firstItem.WarehouseCode,
                    Barcode = firstItem.Barcode,
                    BusinessType = firstItem.BusinessType,
                    Remark = firstItem.Remark
                };
            }).ToList();
            return new PageGridData<StockDetailDtO> { Rows = dtoList, Total = lists.Total, Summary = lists.Summary };
        }
    }
 }
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderDetailController.cs
@@ -1,5 +1,9 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_Core.Attributes;
using WIDESEA_Core.BaseController;
using WIDESEA_DTO.Inbound;
using WIDESEA_IAllocateService;
using WIDESEA_Model.Models;
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockDetailByMaterielController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_DTO.Stock;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
using WIDESEA_StockService;
namespace WIDESEA_WMSServer.Controllers.Stock
{
    [Route("api/StockDetailByMateriel")]
    [Authorize, ApiController]
    public class StockDetailByMaterielController:Controller
    {
        public readonly IStockDetailByMaterielService _stockDetailByMaterielService;
        public StockDetailByMaterielController(IStockDetailByMaterielService stockDetailByMaterielService)
        {
            _stockDetailByMaterielService = stockDetailByMaterielService;
        }
        [HttpPost, Route("GetPageData")]
        public PageGridData<StockDetailByMateriel> GetPageData([FromBody] PageDataOptions options)
        {
            return _stockDetailByMaterielService.GetPageGridData(options);
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoDetailController.cs
@@ -31,10 +31,5 @@
            return Json(result);
        }
        [HttpPost, Route("GetPageDataByMateriel"),AllowAnonymous]
        public PageGridData<StockDetailDtO> GetPageDataByMateriel([FromBody] PageDataOptions options)
        {
            return Service.GetPageDataByMateriel(options);
        }
    }
}