var credits = Biz.GetClaimCredit();// IEnumerable<dynamic>
var errorImeis = RequestPara.IMEIs.Where(m => (m.IsCurrORG == 0 && credits.Any(c => c.BlankType == 0 && c.OrgUserId == m.OrgId)) || (m.IsCurrUser == 0 && credits.Any(c => c.BlankType == 1 && c.OrgUserId == RequestPara.UserId)));
if (errorImeis != null && errorImeis.Count() > 0) return FailPara(string.Join(",", errorImeis.Select(d => d.IMEI)) + " 不可认领!");
//判断集合不匹配的数据
var errImei = para.DetailList.Where(i => !gps.Any(g => g.IMEI == i.IMEI));
//分组取最大的一条数据集合
var detail = await _taskDetailDal.Query(i => arr.Contains(i.taskid) && c.Contains(i.shop_code) && i.status == 1);
detail = detail.GroupBy(i => i.shop_code).Select(j => j.OrderByDescending(k => k.taskid).FirstOrDefault()).ToList();
long[] arr = tasks.Select(o => o.id).ToArray();
var detail = await _taskDetailDal.Query(i => arr.Contains(i.taskid) && i.status == 1);
tasks.ForEach(i => { i.Details = detail.Where(j => j.taskid == i.id).ToList(); });
var modelTask = models.Select(i => new TaskHeaderDao { id = i.taskid, driverid = i.driverid, deliver_date = i.deliver_date, redundant = i.redundant.Replace("-", ","), taskname = i.taskname, create_user = userId, update_user = userId }).Distinct().ToList();
//集合拼接
newDetail = newDetail.Union(i.Details).ToList();