|
|
@ -52,20 +52,7 @@ namespace Myshipping.Application
|
|
|
|
public async Task<dynamic> Page([FromQuery] QueryBookingGoodsStatusConfigInput input)
|
|
|
|
public async Task<dynamic> Page([FromQuery] QueryBookingGoodsStatusConfigInput input)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//初次使用没有数据,进行初始化
|
|
|
|
//初次使用没有数据,进行初始化
|
|
|
|
if (_rep.AsQueryable().Count(x => x.CreatedUserId == UserManager.UserId) == 0)
|
|
|
|
InitGoodsStatusConfig();
|
|
|
|
{
|
|
|
|
|
|
|
|
var dicData = await _cache.GetAllDictData();
|
|
|
|
|
|
|
|
var listGoodsStatus = dicData.Where(x => x.TypeCode == "booking_goods_status").ToList();
|
|
|
|
|
|
|
|
listGoodsStatus.ForEach(async itm =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await _rep.InsertAsync(new BookingGoodsStatusConfig()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
StatusName = itm.Value,
|
|
|
|
|
|
|
|
Sort = itm.Sort,
|
|
|
|
|
|
|
|
SystemCode = itm.Code
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var entities = await _rep.AsQueryable()
|
|
|
|
var entities = await _rep.AsQueryable()
|
|
|
|
.Where(m => m.CreatedUserId == UserManager.UserId)
|
|
|
|
.Where(m => m.CreatedUserId == UserManager.UserId)
|
|
|
@ -136,5 +123,26 @@ namespace Myshipping.Application
|
|
|
|
return await _rep.FirstOrDefaultAsync(u => u.Id == id);
|
|
|
|
return await _rep.FirstOrDefaultAsync(u => u.Id == id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 初始化当前用户的货物状态配置
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
|
|
|
public async void InitGoodsStatusConfig()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (_rep.AsQueryable().Count(x => x.CreatedUserId == UserManager.UserId) == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var dicData = await _cache.GetAllDictData();
|
|
|
|
|
|
|
|
var listGoodsStatus = dicData.Where(x => x.TypeCode == "booking_goods_status").ToList();
|
|
|
|
|
|
|
|
listGoodsStatus.ForEach(async itm =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await _rep.InsertAsync(new BookingGoodsStatusConfig()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
StatusName = itm.Value,
|
|
|
|
|
|
|
|
Sort = itm.Sort,
|
|
|
|
|
|
|
|
SystemCode = itm.Code
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|