| | |
| | | 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; |
| | | }); |
| | |
| | | component: () => import('@/views/check/ReCheckOrder.vue') |
| | | }, |
| | | { |
| | | path: '/stockInfoDetailByMaterielSum', |
| | | name: 'Dt_StockInfoDetailss', |
| | | path: '/StockDetailByMateriel', |
| | | name: 'StockDetailByMateriel', |
| | | component: () => import('@/views/stock/stockInfoDetailByMaterielSum.vue') |
| | | } |
| | | ] |
| | |
| | | @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> |
| | |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "åºåä¿¡æ¯æç»", |
| | | name: "stockInfoDetail", |
| | | url: "/StockInfoDetail/", |
| | | cnName: "åºåæ±æ»", |
| | | name: "StockDetailByMateriel", |
| | | url: "/StockDetailByMateriel/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | |
| | | { |
| | | 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)) |
| | | { |
| | | try |
| | | { |
| | | searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | options.Filter = searchParametersList; |
| | | } |
| | | catch { } |
| | | } |
| | | //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); |
| | | |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | int totalCount = 0; |
| | | if (searchParametersList.Count > 0) |
| | | { |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | | 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_AllocateOrderDetail>(); |
| | | return new PageGridData<Dt_OutboundOrderDetail>(totalCount, data); |
| | | } |
| | | } |
| | | } |
| | |
| | | public interface IAllocateDetailService : IService<Dt_AllocateOrderDetail> |
| | | { |
| | | IRepository<Dt_AllocateOrderDetail> Repository { get; } |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | |
| | | PageGridData<StockInfoDetailWithPalletDto> GetPageData2(PageDataOptions options); |
| | | |
| | | PageGridData<StockDetailDtO> GetPageDataByMateriel(PageDataOptions options); |
| | | } |
| | | } |
| | |
| | | { |
| | | 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}对åºçåºåè®°å½"); |
| | |
| | | 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; } |
| | | |
| | | } |
| | | } |
| | |
| | | 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>(); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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 }; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | 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; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | return Json(result); |
| | | } |
| | | |
| | | [HttpPost, Route("GetPageDataByMateriel"),AllowAnonymous] |
| | | public PageGridData<StockDetailDtO> GetPageDataByMateriel([FromBody] PageDataOptions options) |
| | | { |
| | | return Service.GetPageDataByMateriel(options); |
| | | } |
| | | } |
| | | } |