| | |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using HslCommunication.WebSocket; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | |
| | | { |
| | | public partial class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService |
| | | { |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IBasicRepository _basicRepository; |
| | | |
| | | public ILocationInfoRepository Repository => BaseDal; |
| | | |
| | | public LocationInfoService(ILocationInfoRepository BaseDal, IBasicRepository basicRepository) : base(BaseDal) |
| | | public LocationInfoService(ILocationInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, IBasicRepository basicRepository) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _basicRepository = basicRepository; |
| | | } |
| | | |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | | { |
| | | Dt_LocationInfo locationInfo = saveModel.MainData.DicToModel<Dt_LocationInfo>(); |
| | | return base.AddData(locationInfo); |
| | | } |
| | | |
| | | public override WebResponseContent UpdateData(SaveModel saveModel) |
| | | { |
| | | return base.UpdateData(saveModel); |
| | | } |
| | | |
| | | public override WebResponseContent DeleteData(object[] keys) |
| | | { |
| | | return base.DeleteData(keys); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éå¯ç¨è´§ä½ |
| | | /// </summary> |
| | | /// <param name="keys">è´§ä½ä¸»é®æ°ç»</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent LocationEnableStatus(int[] keys) |
| | | { |
| | | List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => keys.Contains(x.Id)); |
| | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éç¦ç¨è´§ä½ |
| | | /// </summary> |
| | | /// <param name="keys">è´§ä½ä¸»é®æ°ç»</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent LocationDisableStatus(int[] keys) |
| | | { |
| | | List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => keys.Contains(x.Id)); |
| | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å个å¯ç¨è´§ä½ |
| | | /// </summary> |
| | | /// <param name="key">è´§ä½ä¸»é®</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent LocationEnableStatus(int key) |
| | | { |
| | | return LocationEnableStatus(new int[] { key }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å个ç¦ç¨è´§ä½ |
| | | /// </summary> |
| | | /// <param name="key">è´§ä½ä¸»é®</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent LocationDisableStatus(int key) |
| | | { |
| | | return LocationDisableStatus(new int[] { key }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åå§åè´§ä½ |
| | | /// </summary> |
| | | /// <param name="initializationLocationDTO"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent InitializationLocation(InitializationLocationDTO initializationLocationDTO) |
| | | { |
| | | try |
| | |
| | | List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>(); |
| | | for (int i = 0; i < initializationLocationDTO.MaxRow; i++) |
| | | { |
| | | if((i + 1) % initializationLocationDTO.MaxRow == 1) |
| | | if ((i + 1) % initializationLocationDTO.MaxRow == 1) |
| | | { |
| | | depth = initializationLocationDTO.Depth; |
| | | } |
| | |
| | | { |
| | | Dt_LocationInfo locationInfo = new Dt_LocationInfo() |
| | | { |
| | | AreaId = 0, |
| | | WarehouseId = 0, |
| | | Column = j + 1, |
| | | EnableStatus = EnableStatusEnum.Normal.ObjToInt(), |
| | | Layer = k + 1, |
| | | LocationStatus = LocationStatusEnum.Free.ObjToInt(), |
| | | LocationType = LocationTypeEnum.Undefined.ObjToInt(), |
| | | RoadwayNo = $"R{initializationLocationDTO.Roadway.ToString()}", |
| | | RoadwayNo = $"{initializationLocationDTO.Roadway.ToString()}", |
| | | Row = i + 1, |
| | | Depth = depth, |
| | | }; |