提交代码

This commit is contained in:
hehaibing-1996
2024-05-03 11:04:59 +08:00
parent 97888c6978
commit d283924ae1
48 changed files with 802 additions and 509 deletions

View File

@ -23,7 +23,25 @@ namespace WCS.BLL.Services.Service
public ResponseBase shelfGoInInStore(ShelfGoInInstoreRequest request)
{
//校验货架编码规则
bool isValid = Regex.IsMatch(request.ModuleCode, LocalFile.ModuleCodePattern);
//取配置文件中得货架编码规则
bool isValid = false;
var patterns = LocalFile.Config.ModuleCodePatterns;
if (patterns != null && patterns.Count > 0)
{
foreach (var pattern in patterns)
{
isValid = Regex.IsMatch(request.ModuleCode, pattern);
//匹配到第一个符合条件的货架码 就直接退出循环 认为匹配成功
if (isValid)
break;
}
}
//如果配置文件缺失 使用默认正则进行匹配
else
{
isValid = Regex.IsMatch(request.ModuleCode, LocalFile.DefaultModuleCodePattern);
}
if (!isValid)
{
return new ResponseBase()
@ -50,7 +68,7 @@ namespace WCS.BLL.Services.Service
return new ShelfGoInInstoreResponse()
{
Code = 200,
Message = "货架进入入库模式成功!",
Message = $"货架进入入库模式成功!{string.Join(",", shelf.ExceptionMessages)}",
Data = new ShelfGoInInstoreDto()
{
ShelfCode = shelf.ShelfCode,
@ -130,7 +148,7 @@ namespace WCS.BLL.Services.Service
};
}
#region //调用接口或者直接查询数据库
//调用接口
//TODO做成配置 调用接口
if (1 != 1)
{
@ -141,7 +159,7 @@ namespace WCS.BLL.Services.Service
var matInfo = await DbHelp.db.Queryable<MatInfo>().Where(t => t.MatSn == request.MatSn).FirstAsync();
if (matInfo != null)
{
//TODO 改成wcs的实体
shelf.InStoreData = new MatInfoResponse()
{
materialBar = matInfo.MatSn,
@ -198,7 +216,7 @@ namespace WCS.BLL.Services.Service
};
}
//这个时间相当于需要入库扫码后需要等待的时间
//TODO 配置这个时间相当于需要入库扫码后需要等待的时间
var timeOut = 5000;
var timeSpan = TimeSpan.FromMilliseconds(0);
var beginTime = DateTime.Now;