|
@@ -262,7 +262,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
string sql = string.Format(@"Select Id,SalesQuoteNo,TourCode,JietuanOperator,TeamLevSId,TeamDid,TeamName,ClientName,
|
|
|
ClientUnit,VisitCountry,VisitDate,VisitDays,VisitPNumber,TontractTime,
|
|
|
PayDay,PaymentMoney,VisitPurpose,SpecialNeeds,OtherNeeds,CGRWSPBMMC,CGRWSPWH,
|
|
|
- ZZSCBMMC,ZZSCSPWH,Remark,TellPhone,OpRoyaltyLv,OpRoyaltyRemark,Officialneeds
|
|
|
+ ZZSCBMMC,ZZSCSPWH,Remark,TellPhone,WeChatNo,OpRoyaltyLv,OpRoyaltyRemark,Officialneeds
|
|
|
From Grp_DelegationInfo Where Id = {0} And IsDel = 0", dto.Id);
|
|
|
|
|
|
var _DelegationInfo = await _sqlSugar.SqlQueryable<DelegationInfoWebView>(sql).FirstAsync();
|
|
@@ -388,7 +388,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
{
|
|
|
dynamic? teamTypeData1 = null;
|
|
|
string teamTypeSql = string.Format(@"Select Id,Name From Sys_SetData Where STid = {0} And IsDel = {1}", 10, 0);
|
|
|
- var teamTypeData = await _sqlSugar.SqlQueryable<SetDataInfoView>(teamTypeSql).ToListAsync(); ; //团组分类 10
|
|
|
+ var teamTypeData = _sqlSugar.SqlQueryable<SetDataInfoView>(teamTypeSql).ToList(); ; //团组分类 10
|
|
|
if (teamTypeData.Count > 0)
|
|
|
{
|
|
|
teamTypeData1 = teamTypeData;
|
|
@@ -396,7 +396,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
dynamic? teamLevData1 = null;
|
|
|
string teamLevSql = string.Format(@"Select Id,Name From Sys_SetData Where STid = {0} And IsDel = {1}", 56, 0);
|
|
|
- var teamLevData = await _sqlSugar.SqlQueryable<SetDataInfoView>(teamLevSql).ToListAsync(); ; //团组等级 56
|
|
|
+ var teamLevData = _sqlSugar.SqlQueryable<SetDataInfoView>(teamLevSql).ToList(); ; //团组等级 56
|
|
|
if (teamLevData.Count > 0)
|
|
|
{
|
|
|
teamLevData1 = teamLevData;
|
|
@@ -404,26 +404,36 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
dynamic? userData1 = null;
|
|
|
string userSql = string.Format(@"Select Id,CnName From Sys_Users Where IsDel = {0}", 0);
|
|
|
- var userData = await _sqlSugar.SqlQueryable<UserNameView>(userSql).ToListAsync(); ;
|
|
|
+ var userData = _sqlSugar.SqlQueryable<UserNameView>(userSql).ToList();
|
|
|
if (userData.Count > 0)
|
|
|
{
|
|
|
userData1 = userData;
|
|
|
}
|
|
|
|
|
|
+ //客户单位数据源 来源市场客户资料
|
|
|
+ dynamic? clientData1 = null;
|
|
|
+ string clientSql = $@"Select Client,Contact,Telephone,WeChat From Crm_NewClientData Where IsDel = 0";
|
|
|
+ var clientData = _sqlSugar.SqlQueryable<Crm_NewClientData>(userSql).ToList();
|
|
|
+ if (clientData.Count > 0)
|
|
|
+ {
|
|
|
+ clientData1 = clientData.Select(it => new { it.Client,it.Contact,it.Telephone,it.Wechat }).ToList();
|
|
|
+ }
|
|
|
+
|
|
|
result.Code = 0;
|
|
|
result.Msg = "成功!";
|
|
|
result.Data = new
|
|
|
{
|
|
|
teamTypeData = teamTypeData1,
|
|
|
teamLevData = teamLevData1,
|
|
|
- userData = userData1
|
|
|
+ userData = userData1,
|
|
|
+ clientData = clientData1
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
- catch (Exception)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
|
|
|
- throw;
|
|
|
+ result.Msg = ex.Message;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -441,7 +451,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //web
|
|
|
{
|
|
|
-
|
|
|
#region 添加出访起止时间
|
|
|
var startTime = new DateTime();
|
|
|
var endTime = new DateTime();
|
|
@@ -451,15 +460,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
-
|
|
|
if (dto.Status == 1) //添加
|
|
|
{
|
|
|
string selectSql = string.Format(@"Select * From Grp_DelegationInfo
|
|
|
- Where IsDel = 0
|
|
|
- And TeamName = '{0}'
|
|
|
- And ClientName = '{1}'
|
|
|
- And ClientUnit ='{2}'
|
|
|
- And VisitDate ='{3}'",dto.TeamName, dto.ClientName, dto.ClientUnit, dto.VisitDate);
|
|
|
+ Where IsDel = 0
|
|
|
+ And TeamName = '{0}'
|
|
|
+ And ClientName = '{1}'
|
|
|
+ And ClientUnit ='{2}'
|
|
|
+ And VisitDate ='{3}'",dto.TeamName, dto.ClientName, dto.ClientUnit, dto.VisitDate);
|
|
|
var selectGroupInfo = await _sqlSugar.SqlQueryable<Grp_DelegationInfo>(selectSql).FirstAsync();
|
|
|
if (selectGroupInfo != null)
|
|
|
{
|
|
@@ -469,7 +477,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
//string teamCodeSql = string.Format("Select SalesQuoteNo From Grp_DelegationInfo");
|
|
|
//var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
|
|
|
-
|
|
|
//string SalesQuoteNo = "";
|
|
|
//while (true)
|
|
|
//{
|
|
@@ -510,6 +517,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
Remark = dto.Remark,
|
|
|
JietuanOperator = dto.UserId,
|
|
|
TellPhone = dto.TellPhone,
|
|
|
+ WeChatNo = dto.WeChatNo,
|
|
|
CGRWSPBMMC = dto.CGRWSPBMMC,
|
|
|
CGRWSPWH = dto.CGRWSPWH,
|
|
|
ZZSCBMMC = dto.ZZSCBMMC,
|
|
@@ -573,6 +581,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
Remark = dto.Remark,
|
|
|
JietuanOperator = dto.JietuanOperator,
|
|
|
TellPhone = dto.TellPhone,
|
|
|
+ WeChatNo = dto.WeChatNo,
|
|
|
CGRWSPBMMC = dto.CGRWSPBMMC,
|
|
|
CGRWSPWH = dto.CGRWSPWH,
|
|
|
ZZSCBMMC = dto.ZZSCBMMC,
|