From 6c663b92b0078aa89657df22ec188dff65599f04 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期二, 21 十月 2025 17:24:38 +0800
Subject: [PATCH] 1
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs | 48 +++++++++++++++++++++++++++++++++++++++---------
1 files changed, 39 insertions(+), 9 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs"
index c0f3c86..9818ca4 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs"
@@ -15,8 +15,6 @@
{
private readonly LogFactory LogFactory = new LogFactory();
private readonly IUnitOfWorkManage _unitOfWorkManage;
- private readonly IDt_TaskRepository _taskRepository;
- private readonly IDt_TaskService _taskService;
private readonly IStockInfoRepository _stockInfoRepository;
private readonly IStockInfoDetailRepository _stockInfoDetailRepository;
private readonly IDt_WareAreaInfoRepository _wareAreaInfoRepository;
@@ -28,26 +26,22 @@
public LocationInfoService(ILocationInfoRepository BaseDal,
IUnitOfWorkManage unitOfWorkManage,
- IDt_TaskRepository taskRepository,
IStockInfoRepository stockInfoRepository,
IDt_WareAreaInfoRepository wareAreaInfoRepository,
ITaskExecuteDetailRepository taskExecuteDetailRepository,
ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository,
IStockInfoDetailRepository stockInfoDetailRepository,
IMapper mapper,
- IDt_TaskService taskService,
IDt_AreaInfoRepository AreaInfoRepository,
ISys_ConfigService configService) : base(BaseDal)
{
_unitOfWorkManage = unitOfWorkManage;
- _taskRepository = taskRepository;
_stockInfoRepository = stockInfoRepository;
_wareAreaInfoRepository = wareAreaInfoRepository;
_taskExecuteDetailRepository = taskExecuteDetailRepository;
_locationStatusChangeRecordRepository = locationStatusChangeRecordRepository;
_stockInfoDetailRepository = stockInfoDetailRepository;
_mapper = mapper;
- _taskService = taskService;
_AreaInfoRepository = AreaInfoRepository;
_configService= configService;
}
@@ -74,21 +68,22 @@
}
#region 鍒濆鍖栧簱浣�
- public async Task<WebResponseContent> initializeLocation(int locationID)
+ public async Task<WebResponseContent> initializeLocation(string locationCode)
{
WebResponseContent content = new WebResponseContent();
try
{
- DtLocationInfo? location = BaseDal.QueryData(x => x.Id == locationID).FirstOrDefault();
+ DtLocationInfo? location = BaseDal.QueryData(x => x.LocationCode == locationCode).FirstOrDefault();
int LastStatus = location.LocationStatus;
if (location == null)
{
return content.Error("鏈壘鍒拌揣浣嶄俊鎭�!");
}
- DtStockInfo stock = _stockInfoRepository.QueryFirst(x => x.LocationId == location.Id);
+ DtStockInfo stock = _stockInfoRepository.QueryFirst(x => x.LocationCode == location.LocationCode);
if(stock == null)
{
location.LocationStatus= (int)LocationEnum.Free;
+ _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, LastStatus, (int)StatusChangeTypeEnum.ManualOperation, 0);
BaseDal.UpdateData(location);
}
else
@@ -170,6 +165,41 @@
return new WebResponseContent().Error();
}
+ public WebResponseContent CreateLocation(string AreaName,int x, int y,int areaId,string Floor)
+ {
+ string[] chineseNumbers = new string[] { "闆�", "涓�", "浜�", "涓�", "鍥�", "浜�", "鍏�", "涓�", "鍏�", "涔�" };
+ var locationList = new List<DtLocationInfo>();
+ var LocationName= _AreaInfoRepository.QueryFirst(a => a.AreaID == areaId).AreaName;
+ for (int line = 1; line <= x; line++)
+ {
+ for (int column = 1; column <= y; column++)
+ {
+ locationList.Add(new DtLocationInfo()
+ {
+ Row = line,
+ Column = column,
+ Layer = 0,
+ LocationCode = AreaName+'-'+line.ToString() + '-' + column.ToString(),
+ LocationName = LocationName,
+ Floor = Floor,
+ LocationType = 1,
+ Remark = "",
+ Depth = column,
+ RoadwayNo = "AGV",
+ LocationStatus = LocationEnum.Free.ObjToInt(),
+ AreaId = areaId,
+ Creater = "System",
+ EnalbeStatus = 1,
+ });
+ }
+ }
+ var isResult = BaseDal.AddData(locationList) > 0;
+ if (isResult)
+ return new WebResponseContent().OK();
+ else
+ return new WebResponseContent().Error();
+ }
+
#endregion 鍒涘缓鍘熷璐т綅鏁版嵁
#region 鍚敤绂佺敤璐т綅
--
Gitblit v1.9.3