|
|
|
@ -104,8 +104,42 @@ namespace Myshipping.Core.Service
|
|
|
|
|
[HttpGet("/DjyUserConfig/multi")]
|
|
|
|
|
public async Task<List<DjyUserConfig>> Multi(string[] typeArr)
|
|
|
|
|
{
|
|
|
|
|
return await _rep.ToListAsync(u => u.CreatedUserId == UserManager.UserId && typeArr.Contains(u.Type));
|
|
|
|
|
|
|
|
|
|
//return await _rep.ToListAsync(u => u.CreatedUserId == UserManager.UserId && typeArr.Contains(u.Type));
|
|
|
|
|
|
|
|
|
|
List<DjyUserConfig> data = new List<DjyUserConfig>();
|
|
|
|
|
|
|
|
|
|
string[] typelist = { "BC", "PER_BILL", "TRUCK_DISPATCH", "CUT_MODIFY", "ROLLING_NOMINATION", "DRAFT", "ROUTE_CUT_CHANGE", "CAUTION_NOTICE", "POD_DISCHARGE_FULL" };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var type in typeArr)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (typelist.Contains(type))
|
|
|
|
|
{
|
|
|
|
|
var datainfo = _rep.Where(u => u.CreatedUserId == UserManager.UserId && u.Type == type).First();
|
|
|
|
|
if (datainfo == null)
|
|
|
|
|
{
|
|
|
|
|
data.Add(_rep.Where(u =>u.Type ==(type+"_default")).First());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (datainfo != null) data.Add(datainfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var userconfig = _rep.Where(u => u.CreatedUserId == UserManager.UserId && u.Type == type).First();
|
|
|
|
|
|
|
|
|
|
if (userconfig != null)
|
|
|
|
|
{
|
|
|
|
|
data.Add(userconfig);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|