using HslCommunication.WebSocket; using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEA_Core; using WIDESEA_Core.Enums; using WIDESEAWCS_Common; using WIDESEAWCS_Common.WareHouseEnum; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseRepository; using WIDESEAWCS_Core.BaseServices; using WIDESEAWCS_Core.Helper; using WIDESEAWCS_IBasicInfoRepository; using WIDESEAWCS_IBasicInfoService; using WIDESEAWCS_Model.Models; namespace WIDESEAWCS_BasicInfoService { public partial class LocationInfoService : ServiceBase, ILocationInfoService { private readonly IUnitOfWorkManage _unitOfWorkManage; public ILocationInfoRepository Repository => BaseDal; public LocationInfoService(ILocationInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) { _unitOfWorkManage = unitOfWorkManage; } /// /// 批量启用货位 /// /// 货位主键数组 /// public WebResponseContent LocationEnableStatus(int[] keys) { List locationInfos = Repository.QueryData(x => keys.Contains(x.Id)); locationInfos.ForEach(x => { x.EnableStatus = EnableStatusEnum.Normal.ObjToInt(); }); Repository.UpdateData(locationInfos); return WebResponseContent.Instance.OK(); } /// /// 批量禁用货位 /// /// 货位主键数组 /// public WebResponseContent LocationDisableStatus(int[] keys) { List locationInfos = Repository.QueryData(x => keys.Contains(x.Id)); locationInfos.ForEach(x => { x.EnableStatus = EnableStatusEnum.Disable.ObjToInt(); }); Repository.UpdateData(locationInfos); return WebResponseContent.Instance.OK(); } /// /// 单个启用货位 /// /// 货位主键 /// public WebResponseContent LocationEnableStatus(int key) { return LocationEnableStatus(new int[] { key }); } /// /// 单个禁用货位 /// /// 货位主键 /// public WebResponseContent LocationDisableStatus(int key) { return LocationDisableStatus(new int[] { key }); } /// /// 分配货位 /// public Dt_LocationInfo? AssignLocation(string roadwayNo, int palletType, int warehouseId) { return new Dt_LocationInfo(); } } }