|
@@ -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,6 +343,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+
|
|
|
var NewClientDataView = new List<NewClientDataView>();
|
|
|
var count = 0;
|
|
|
string contact = dto.Contact, location = dto.Location, clientDto = dto.Client;
|
|
@@ -345,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) //客户类别
|
|
@@ -360,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) //客户类别
|
|
@@ -390,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;
|
|
@@ -398,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();
|
|
@@ -434,7 +443,17 @@ namespace OASystem.Infrastructure.Repositories.CRM
|
|
|
int index = 1;
|
|
|
foreach (var item in NewClientDataView)
|
|
|
{
|
|
|
- EncryptionProcessor.DecryptProperties(item); //解密
|
|
|
+ //EncryptionProcessor.DecryptProperties(item); //解密
|
|
|
+
|
|
|
+ item.Wechat = AesEncryptionHelper.Decrypt(item.Wechat);
|
|
|
+ item.Job = AesEncryptionHelper.Decrypt(item.Job);
|
|
|
+ item.Phone = AesEncryptionHelper.Decrypt(item.Phone);
|
|
|
+ item.Telephone = AesEncryptionHelper.Decrypt(item.Telephone);
|
|
|
+ item.Remark = AesEncryptionHelper.Decrypt(item.Remark);
|
|
|
+ if(string.IsNullOrEmpty(contact)) item.Contact = AesEncryptionHelper.Decrypt(item.Contact);
|
|
|
+ if (string.IsNullOrEmpty(clientDto)) item.Client = AesEncryptionHelper.Decrypt(item.Client);
|
|
|
+ if (string.IsNullOrEmpty(location)) item.Location = AesEncryptionHelper.Decrypt(item.Location);
|
|
|
+
|
|
|
item.RowNumber = index;
|
|
|
item.CategoryStr = setDatas.Find(x => x.Id == item.Category)?.Name ?? "-";
|
|
|
item.LvlidStr = setDatas.Find(x => x.Id == item.Lvlid)?.Name ?? "-";
|