diff --git a/WCS.BLL/DbModels/STZL/LocationAreaInfo.cs b/WCS.BLL/DbModels/STZL/LocationAreaInfo.cs
index 447ec18..6c10e7d 100644
--- a/WCS.BLL/DbModels/STZL/LocationAreaInfo.cs
+++ b/WCS.BLL/DbModels/STZL/LocationAreaInfo.cs
@@ -17,6 +17,6 @@ namespace WCS.BLL.DbModels
public int Id { get; set; }
[SugarColumn(ColumnName = "location_area", Length = 64, IsNullable = false, ColumnDescription = "库位区域")]
- public string LocationArea { get; set; }
+ public string LocationAreaName { get; set; }
}
}
diff --git a/WCS.BLL/DbModels/STZL/LocationInfo.cs b/WCS.BLL/DbModels/STZL/LocationInfo.cs
index a1cef89..00596da 100644
--- a/WCS.BLL/DbModels/STZL/LocationInfo.cs
+++ b/WCS.BLL/DbModels/STZL/LocationInfo.cs
@@ -43,8 +43,8 @@ namespace WCS.DAL.DbModels
///
/// 可放置货架类型
///
- [SugarColumn(ColumnName = "allow_shelf_types", Length = 512, IsNullable = true, ColumnDescription = "可放置货架类型")]
- public string AllowShelfTypes { get; set; }
+ [SugarColumn(ColumnName = "allow_shelf_types", Length = 256, IsNullable = true, ColumnDescription = "可放置货架类型", IsJson = true)]
+ public List AllowShelfTypes { get; set; }
///
/// 更新人
diff --git a/WCS.BLL/Services/IService/ILocationInfoService.cs b/WCS.BLL/Services/IService/ILocationInfoService.cs
new file mode 100644
index 0000000..ae61173
--- /dev/null
+++ b/WCS.BLL/Services/IService/ILocationInfoService.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WCS.Model.ApiModel.User;
+using WCS.Model;
+using WCS.DAL.DbModels;
+using WCS.Model.ApiModel.StoreInfo;
+using WCS.BLL.DbModels;
+using WCS.Model.ApiModel.MatBaseInfo;
+
+namespace WCS.BLL.Services.IService
+{
+ public interface ILocationInfoService
+ {
+ ///
+ /// 查询货架列表
+ ///
+ ///
+ ///
+ public Task> GetLocationInfos(GetLocationInfosRequest request);
+ ///
+ /// 添加、更新、删除货架
+ ///
+ ///
+ ///
+ public Task> addOrUpdateLocationInfo(AddLocaionInfoRequest request);
+
+ public Task> deleteLocationInfo(DeleteInfosRequest request);
+ }
+}
diff --git a/WCS.BLL/Services/Service/LocationInfoService.cs b/WCS.BLL/Services/Service/LocationInfoService.cs
new file mode 100644
index 0000000..895b242
--- /dev/null
+++ b/WCS.BLL/Services/Service/LocationInfoService.cs
@@ -0,0 +1,217 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using TouchSocket.Core;
+using WCS.BLL.Config;
+using WCS.BLL.DbModels;
+using WCS.BLL.HardWare;
+using WCS.BLL.Manager;
+using WCS.BLL.Services.IService;
+using WCS.DAL;
+using WCS.DAL.Db;
+using WCS.DAL.DbModels;
+using WCS.Model;
+using WCS.Model.ApiModel;
+using WCS.Model.ApiModel.InOutRecord;
+using WCS.Model.ApiModel.MatBaseInfo;
+using WCS.Model.ApiModel.StoreInfo;
+using WCS.Model.ApiModel.User;
+
+namespace WCS.BLL.Services.Service
+{
+ public class LocationInfoService : ILocationInfoService
+ {
+
+ public async Task> GetLocationInfos(GetLocationInfosRequest request)
+ {
+ try
+ {
+ var recordsQueryable = DbHelp.db.Queryable()
+ .WhereIF(request.LocationAreaId != null, t => t.LocationAreaId == request.LocationAreaId)
+ .WhereIF(request.IsEnable != null, t => t.IsEnable == request.IsEnable)
+ .WhereIF(!string.IsNullOrEmpty(request.LocationCode), t => t.LocationCode.Contains(request.LocationCode));
+
+ //分页
+ var totalCount = await recordsQueryable.CountAsync();
+ var records = await recordsQueryable
+ .Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
+ .ToListAsync();
+ //生成序号
+ for (int i = 0; i < records.Count; i++)
+ {
+ records[i].RowNumber = (request.PageNumber - 1) * request.PageSize + i + 1;
+ }
+ return new PageQueryResponse()
+ {
+ Code = 200,
+ Message = $"success",
+ Data = new PageQueryResponseData()
+ {
+ TotalCount = totalCount,
+ MaxPage = request.PageSize == 0 ? 0 : (int)Math.Ceiling((decimal)totalCount / request.PageSize),
+ Count = records.Count,
+ Lists = records.ToList()
+ }
+ };
+ }
+ catch (Exception ex)
+ {
+ return new PageQueryResponse()
+ {
+ Code = 300,
+ Message = $"操作失败:{ex.Message}",
+ };
+ }
+ }
+
+ public async Task> addOrUpdateLocationInfo(AddLocaionInfoRequest request)
+ {
+ try
+ {
+ var locationInfo = await DbHelp.db.Queryable()
+ .Where(t => t.LocationCode == request.LocationInfo.LocationCode)
+ .FirstAsync();
+ //修改位置信息
+ if (request.AddOrUpdate == AddOrUpdate.Update)
+ {
+ var existId = locationInfo == null ? 0 : locationInfo.Id;
+
+ locationInfo = await DbHelp.db.Queryable()
+ .Where(t => t.Id == request.LocationInfo.Id)
+ .FirstAsync();
+ if (locationInfo == null)
+ {
+ return new ResponseCommon