| | |
| | | using AutoMapper; |
| | | using Microsoft.AspNetCore.Http.Metadata; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Log; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicService |
| | |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locations, beforeEndStatus, StockChangeType.Relocation.ObjToInt(), "", TaskNum); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 货位警告 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | public WebResponseContent LocationWarning() |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_Warehouse> warehouses = BaseDal.Db.Queryable<Dt_Warehouse>().ToList(); |
| | | List<string> locationWarning = new List<string>(); |
| | | foreach (var item in warehouses) |
| | | { |
| | | |
| | | for(var i = 1; i < 3; i++) |
| | | { |
| | | int inStockNum = 0; |
| | | List<Dt_LocationInfo> locationInfos = BaseDal.QueryData(x => x.WarehouseId == item.WarehouseId && x.Row == i); |
| | | if(locationInfos != null && locationInfos.Count() != 0) |
| | | { |
| | | foreach (var item1 in locationInfos) |
| | | { |
| | | if (item1.LocationStatus == 2) |
| | | { |
| | | inStockNum++; |
| | | } |
| | | } |
| | | if (inStockNum != 0 && (double)inStockNum/locationInfos.Count() >= 0.8) |
| | | { |
| | | var locationName = $"{item.WarehouseName},第{i}排"; |
| | | locationWarning.Add(locationName); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return content.OK(data: locationWarning); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |