提交代码

This commit is contained in:
hehaibing-1996
2024-07-16 16:45:18 +08:00
parent ed3673db03
commit 7b8a885669
64 changed files with 1389 additions and 176 deletions

View File

@ -240,7 +240,7 @@ namespace WCS.BLL.Services.Service
}
/// <summary>
/// TODO HardCode 根据模组信息生成库位
///
/// </summary>
/// <returns></returns>
public async Task<ResponseCommon<object>> GenerateStoreInfo()
@ -248,32 +248,32 @@ namespace WCS.BLL.Services.Service
//var shelfInfos = DbHelp.db.Queryable<ShelfInfo>().ToList();
//foreach (var shelfInfo in shelfInfos)
//{
var ModuleInfos = await DbHelp.db.Queryable<ModuleInfo>().ToListAsync();
ModuleInfos.ForEach(moduleInfo =>
var ModuleInfos = await DbHelp.db.Queryable<ModuleInfo>().ToListAsync();
ModuleInfos.ForEach(moduleInfo =>
{
for (int i = 1; i <= moduleInfo.LightCount; i++)
{
for (int i = 1; i <= moduleInfo.LightCount; i++)
var storeInfo = new StoreInfo()
{
var storeInfo = new StoreInfo()
{
StoreCode = moduleInfo.ModuleCode + "-" + i.ToString(),
ShelfTypeId = 1,
ModuleId = moduleInfo.Id,
ModuleCode = moduleInfo.ModuleCode,
ShelfId = moduleInfo.ShelfId,
ShelfCode = moduleInfo.ShelfCode,
BoardId = moduleInfo.BoardId,
LightNumber = i,
Priority = 1,
CurrentMatSn = string.Empty,
BigShelfCode = moduleInfo.Bigshelfcode,
R = moduleInfo.R,
C = moduleInfo.C,
Wei = i.ToString(),
GroupName = moduleInfo.GroupName,
};
DbHelp.db.Insertable(storeInfo).ExecuteCommand();
}
});
StoreCode = moduleInfo.ModuleCode + "-" + i.ToString(),
ShelfTypeId = 1,
ModuleId = moduleInfo.Id,
ModuleCode = moduleInfo.ModuleCode,
ShelfId = moduleInfo.ShelfId,
ShelfCode = moduleInfo.ShelfCode,
BoardId = moduleInfo.BoardId,
LightNumber = i,
Priority = 1,
CurrentMatSn = string.Empty,
BigShelfCode = moduleInfo.Bigshelfcode,
R = moduleInfo.R,
C = moduleInfo.C,
Wei = i.ToString(),
GroupName = moduleInfo.GroupName,
};
DbHelp.db.Insertable(storeInfo).ExecuteCommand();
}
});
//}
return new ResponseCommon<object>() { Message = "111" };
}
@ -443,6 +443,44 @@ namespace WCS.BLL.Services.Service
}
}
public async Task<ResponseCommon> calibrationSetOffset(CalibrationSetOffsetRequest request)
{
try
{
var modules = await DbHelp.db.Queryable<ModuleInfo>().Where(t => request.MouduleIds.Contains(t.Id)).ToListAsync();
var isSend = false;
foreach (var module in modules)
{
var shelf = ShelfManager.Shelves.Where(t => t.ShelfId == module.ShelfId).FirstOrDefault();
if (shelf != null && shelf is SmartShelf)
{
var smartShelf = (SmartShelf)shelf;
smartShelf.CalibrationSetOffset(module.Id, request.OffSet);
isSend = true;
}
}
if (isSend)
return new ResponseCommon()
{
Code = 200,
Message = "Success"
};
else
return new ResponseCommon()
{
Code = 201,
Message = "操作失败:未找到对应模组"
};
}
catch (Exception ex)
{
return new ResponseCommon()
{
Code = 300,
Message = "操作失败:" + ex.Message
};
}
}
#endregion
#region
@ -580,7 +618,6 @@ namespace WCS.BLL.Services.Service
}
}
#endregion
}
}