|
@@ -163,7 +163,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> PostShareGroupInfos(int portType)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误", Data = new List<object>() { } };
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误", Data = new List<object>() { } };
|
|
|
|
|
|
string sql = string.Format(@"Select Id,TeamName,TourCode,ClientName,VisitCountry,VisitStartDate,VisitEndDate,VisitDays,VisitPNumber
|
|
|
From Grp_DelegationInfo With(NoLock) Where IsDel = 0 Order By VisitStartDate Desc");
|
|
@@ -204,7 +204,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> PostGroupInfo(GroupInfoDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //Web Or Android
|
|
|
{
|
|
@@ -242,7 +242,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
if (!string.IsNullOrEmpty(teamName))
|
|
|
{
|
|
|
str = teamName;
|
|
|
- List<string> searchreplaces = new List<string>() { "|", " ", "/", ",", "," };
|
|
|
+ var searchreplaces = new List<string>() { "|", " ", "/", ",", "," };
|
|
|
foreach (var item in searchreplaces)
|
|
|
{
|
|
|
if (str.Contains(item))
|
|
@@ -263,7 +263,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public List<string> GroupSplitCountry(string visitCountry)
|
|
|
{
|
|
|
- List<string> countrys = new List<string>();
|
|
|
+ var countrys = new List<string>();
|
|
|
|
|
|
if (!string.IsNullOrEmpty(visitCountry))
|
|
|
{
|
|
@@ -281,9 +281,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> GetGroupPageList(GroupCommissionDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
- ListViewBase<DelegationPageListView> groupsInfoPageList = new ListViewBase<DelegationPageListView>()
|
|
|
+ var groupsInfoPageList = new ListViewBase<DelegationPageListView>()
|
|
|
{
|
|
|
ReceiveDt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
|
|
};
|
|
@@ -352,7 +352,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> GetGroupList(GroupListDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
if (dto.PortType == 1)
|
|
|
{
|
|
@@ -415,7 +415,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> GetGroupInfo(GroupInfoDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //Web Or Android
|
|
|
{
|
|
@@ -466,11 +466,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
{
|
|
|
var param = new TourClientListProcessInfo();
|
|
|
var clientInfo = DeleClientArr.FirstOrDefault(x => x.Id == item.ClientId);
|
|
|
- if (clientInfo == null) clientInfo = new Crm_DeleClient();
|
|
|
+ clientInfo ??= new Crm_DeleClient();
|
|
|
var clientIDInfo = _CustomerCerts.FirstOrDefault(x => x.DcId == item.ClientId); //身份证信息
|
|
|
- if (clientIDInfo == null) clientIDInfo = new Crm_CustomerCert();
|
|
|
+ clientIDInfo ??= new Crm_CustomerCert();
|
|
|
var Company = CompanyArr.FirstOrDefault(x => x.Id == clientInfo.CrmCompanyId);
|
|
|
- if (Company == null) Company = new Crm_CustomerCompany();
|
|
|
+ Company ??= new Crm_CustomerCompany();
|
|
|
|
|
|
param.IDCardNo = clientIDInfo.CertNo;
|
|
|
param.Remark = item.Remark;
|
|
@@ -513,11 +513,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
{
|
|
|
var param = new TourClientListProcessInfo();
|
|
|
var clientInfo = DeleClientArr.FirstOrDefault(x => x.Id == item.ClientId);
|
|
|
- if (clientInfo == null) clientInfo = new Crm_DeleClient();
|
|
|
+ clientInfo ??= new Crm_DeleClient();
|
|
|
var clientIDInfo = _CustomerCerts.FirstOrDefault(x => x.DcId == item.ClientId); //身份证信息
|
|
|
- if (clientIDInfo == null) clientIDInfo = new Crm_CustomerCert();
|
|
|
+ clientIDInfo ??= new Crm_CustomerCert();
|
|
|
var Company = CompanyArr.FirstOrDefault(x => x.Id == clientInfo.CrmCompanyId);
|
|
|
- if (Company == null) Company = new Crm_CustomerCompany();
|
|
|
+ Company ??= new Crm_CustomerCompany();
|
|
|
|
|
|
param.IDCardNo = clientIDInfo.CertNo;
|
|
|
param.Remark = item.Remark;
|
|
@@ -659,7 +659,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
return info;
|
|
|
}
|
|
|
|
|
|
- private List<CityTree> MoveElementToFront(List<CityTree> list, string elementName)
|
|
|
+ private static List<CityTree> MoveElementToFront(List<CityTree> list, string elementName)
|
|
|
{
|
|
|
var element = list.FirstOrDefault(x => x.Name_CN == elementName);
|
|
|
if (element != null)
|
|
@@ -678,7 +678,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> GroupEditBasicSource(GroupListDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //web
|
|
|
{
|
|
@@ -764,7 +764,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> GroupOperation(GroupOperationDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //web
|
|
|
{
|
|
@@ -831,7 +831,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Grp_DelegationInfo delegationInfo = new Grp_DelegationInfo()
|
|
|
+ var delegationInfo = new Grp_DelegationInfo()
|
|
|
{
|
|
|
CityId = dto.CityId,
|
|
|
SalesQuoteNo = dto.SalesQuoteNo,
|
|
@@ -975,7 +975,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> GroupDel(GroupDelDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //web
|
|
|
{
|
|
@@ -1007,12 +1007,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> GetGroupSalesQuoteNo()
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
string teamCodeSql = string.Format("Select SalesQuoteNo From Grp_DelegationInfo");
|
|
|
var teamCodeItem = await _sqlSugar.SqlQueryable<SalesQuoteNoView>(teamCodeSql).ToListAsync();
|
|
|
|
|
|
- string teamCode = "";
|
|
|
+ string teamCode;
|
|
|
while (true)
|
|
|
{
|
|
|
teamCode = Tools.CommonFun.GetRandomAllStr(6);
|
|
@@ -1035,12 +1035,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> GroupDeleteById()
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
string teamCodeSql = string.Format("Select TourCode From Grp_DelegationInfo");
|
|
|
var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
|
|
|
|
|
|
- string teamCode = "";
|
|
|
+ string teamCode;
|
|
|
while (true)
|
|
|
{
|
|
|
teamCode = Tools.CommonFun.GetRandomAllStr(6);
|
|
@@ -1063,8 +1063,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> ConfirmationGroup(ConfirmationGroupDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
-
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
string teamCode = "";
|
|
|
if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //web
|
|
@@ -1166,7 +1165,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
mobileSqlWhere += string.Format($@"GroupName Like '%{groupName}%'");
|
|
|
}
|
|
|
|
|
|
- List<int> userIds = new List<int>() { -1, 21 };
|
|
|
+ var userIds = new List<int>() { -1, 21 };
|
|
|
|
|
|
if (!userIds.Contains(userId))
|
|
|
{
|
|
@@ -1229,7 +1228,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> GetGroupNameAndVisaNationality(GroupNameDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ var result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //web
|
|
|
{
|
|
@@ -1265,7 +1264,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <returns></returns>
|
|
|
public async Task<Result> GetCrmByGroupId(ClientByGroupIdDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2 };
|
|
|
+ var result = new Result() { Code = -2 };
|
|
|
if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)
|
|
|
{
|
|
|
string sql = string.Format(@"Select gdjc.GrpDCId grpId,cdc.Id,cdc.LastName+cdc.FirstName clientName,cdc.Tel,ccc.CertNo CerdNo
|