|
@@ -219,7 +219,6 @@ namespace OASystem.Infrastructure.Repositories.CRM
|
|
|
#region 交集
|
|
|
List<int> NewClientDataId1 = new List<int>();
|
|
|
List<int> NewClientDataId2 = new List<int>();
|
|
|
- string NewClientDataId = "";
|
|
|
int state = 0;
|
|
|
|
|
|
#region 负责人
|
|
@@ -291,6 +290,13 @@ namespace OASystem.Infrastructure.Repositories.CRM
|
|
|
{
|
|
|
intList = NewClientDataId2;
|
|
|
}
|
|
|
+
|
|
|
+ if (state == -1)
|
|
|
+ {
|
|
|
+ if (intList.Count < 1) intList.Add(-1);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 省域条件
|
|
@@ -337,7 +343,6 @@ namespace OASystem.Infrastructure.Repositories.CRM
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
- if (intList.Count < 1) intList.Add(-1);
|
|
|
|
|
|
var NewClientDataView = new List<NewClientDataView>();
|
|
|
var count = 0;
|
|
@@ -347,7 +352,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
|
|
|
RefAsync<int> total = 0;
|
|
|
var clientDatas = await _sqlSugar.Queryable<Crm_NewClientData>()
|
|
|
.Where(x => x.IsDel == 0)
|
|
|
- .WhereIF(intList.Count > 0, x => intList.Contains(x.Id))
|
|
|
+ .WhereIF(state == -1 && intList.Count > 0, x => intList.Contains(x.Id))
|
|
|
.WhereIF(dto.Lvlid != 0, x => x.Lvlid == dto.Lvlid)
|
|
|
.WhereIF(rangeSetDataList.Count > 0, x => rangeSetDataList.Contains(x.Lvlid))
|
|
|
.WhereIF(dto.Category > 0, x => x.Category == dto.Category)
|
|
@@ -362,7 +367,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
|
|
|
{
|
|
|
var clientDatas = await _sqlSugar.Queryable<Crm_NewClientData>()
|
|
|
.Where(x => x.IsDel == 0)
|
|
|
- .WhereIF(intList.Count > 0, x => intList.Contains(x.Id))
|
|
|
+ .WhereIF(state == -1 && intList.Count > 0, x => intList.Contains(x.Id))
|
|
|
.WhereIF(dto.Lvlid != 0, x => x.Lvlid == dto.Lvlid)
|
|
|
.WhereIF(rangeSetDataList.Count > 0, x => rangeSetDataList.Contains(x.Lvlid))
|
|
|
.WhereIF(dto.Category > 0, x => x.Category == dto.Category)
|
|
@@ -392,7 +397,9 @@ namespace OASystem.Infrastructure.Repositories.CRM
|
|
|
}
|
|
|
else if (dto.PortType == 2 || dto.PortType == 3)
|
|
|
{
|
|
|
- clientDatas = clientDatas.Where(x => x.Contact.Contains(clientDto) || x.Location.Contains(clientDto) || x.Client.Contains(clientDto)).ToList();
|
|
|
+ clientDatas = clientDatas.Where(x => (!string.IsNullOrEmpty(x.Contact) && x.Contact.Contains(clientDto)) ||
|
|
|
+ (!string.IsNullOrEmpty(x.Location) && x.Location.Contains(clientDto)) ||
|
|
|
+ (!string.IsNullOrEmpty(x.Client) && x.Client.Contains(clientDto))).ToList();
|
|
|
}
|
|
|
|
|
|
int pIndex = dto.PageIndex * dto.PageSize - dto.PageSize + 1;
|
|
@@ -400,7 +407,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
|
|
|
int skip = (dto.PageIndex - 1) * dto.PageSize;
|
|
|
count = clientDatas.Count;
|
|
|
var pageData = clientDatas.OrderByDescending(x => x.CreateTime).Skip(skip).Take(dto.PageSize).ToList();
|
|
|
- NewClientDataView = _mapper.Map<List<NewClientDataView>>(clientDatas);
|
|
|
+ NewClientDataView = _mapper.Map<List<NewClientDataView>>(pageData);
|
|
|
}
|
|
|
|
|
|
var setDatas = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0).ToList();
|