获取用户自定义配置

master
douhandong 6 months ago
parent 56d9375cbc
commit bf57a578cd

@ -104,8 +104,42 @@ namespace Myshipping.Core.Service
[HttpGet("/DjyUserConfig/multi")] [HttpGet("/DjyUserConfig/multi")]
public async Task<List<DjyUserConfig>> Multi(string[] typeArr) 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;
} }
} }
} }

Loading…
Cancel
Save