|
@@ -208,11 +208,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
{
|
|
{
|
|
string selectSql = string.Format(@"Select * From Grp_DelegationInfo
|
|
string selectSql = string.Format(@"Select * From Grp_DelegationInfo
|
|
Where IsDel = 0
|
|
Where IsDel = 0
|
|
- And SalesQuoteNo = '{0}'
|
|
|
|
- And TeamName = '{1}'
|
|
|
|
- And ClientName = '{2}'
|
|
|
|
- And ClientUnit ='{3}'
|
|
|
|
- And VisitDate ='{4}'", dto.SalesQuoteNo, dto.TeamName, dto.ClientName, dto.ClientUnit, dto.VisitDate);
|
|
|
|
|
|
+ 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();
|
|
var selectGroupInfo = await _sqlSugar.SqlQueryable<Grp_DelegationInfo>(selectSql).FirstAsync();
|
|
if (selectGroupInfo != null)
|
|
if (selectGroupInfo != null)
|
|
{
|
|
{
|
|
@@ -220,21 +219,21 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- string teamCodeSql = string.Format("Select TourCode From Grp_DelegationInfo");
|
|
|
|
- var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
|
|
|
|
-
|
|
|
|
- string teamCode = "";
|
|
|
|
- while (true)
|
|
|
|
- {
|
|
|
|
- teamCode = Tools.CommonFun.GetRandomStr(6);
|
|
|
|
-
|
|
|
|
- if (!teamCodeItem.Equals(teamCode))
|
|
|
|
- {
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- groupInfo.TourCode = teamCode;
|
|
|
|
|
|
+ //string teamCodeSql = string.Format("Select SalesQuoteNo From Grp_DelegationInfo");
|
|
|
|
+ //var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
|
|
|
|
+
|
|
|
|
+ //string SalesQuoteNo = "";
|
|
|
|
+ //while (true)
|
|
|
|
+ //{
|
|
|
|
+ // SalesQuoteNo = Tools.CommonFun.GetRandomStr(6);
|
|
|
|
+ // if (!teamCodeItem.Equals(SalesQuoteNo))
|
|
|
|
+ // {
|
|
|
|
+ // break;
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ groupInfo.SalesQuoteNo = dto.SalesQuoteNo;
|
|
|
|
+ groupInfo.TourCode = "";
|
|
groupInfo.SalesDate = DateTime.Now;
|
|
groupInfo.SalesDate = DateTime.Now;
|
|
groupInfo.IsState = 0; //默认团组未完成 0
|
|
groupInfo.IsState = 0; //默认团组未完成 0
|
|
groupInfo.JietuanTime = DateTime.Now;
|
|
groupInfo.JietuanTime = DateTime.Now;
|
|
@@ -262,7 +261,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- } //增加
|
|
|
|
|
|
+ }
|
|
else if (dto.Status == 2) //修改
|
|
else if (dto.Status == 2) //修改
|
|
{
|
|
{
|
|
var updateStatus = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_DelegationInfo
|
|
var updateStatus = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_DelegationInfo
|
|
@@ -327,7 +326,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// 团组信息操作
|
|
|
|
|
|
+ /// 团组信息操作 - 删除
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
@@ -367,8 +366,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
{
|
|
{
|
|
Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
- string teamCodeSql = string.Format("Select TourCode From Grp_DelegationInfo");
|
|
|
|
- var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
|
|
|
|
|
|
+ string teamCodeSql = string.Format("Select SalesQuoteNo From Grp_DelegationInfo");
|
|
|
|
+ var teamCodeItem = await _sqlSugar.SqlQueryable<SalesQuoteNoView>(teamCodeSql).ToListAsync();
|
|
|
|
|
|
string teamCode = "";
|
|
string teamCode = "";
|
|
while (true)
|
|
while (true)
|
|
@@ -415,6 +414,59 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 团组确认出团
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public async Task<Result> ConfirmationGroup(ConfirmationGroupDto dto)
|
|
|
|
+ {
|
|
|
|
+ Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ string teamCode = "";
|
|
|
|
+ if (dto.PortType == 1 || dto.PortType == 2) //web
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ string teamCodeSql = string.Format("Select TourCode From Grp_DelegationInfo");
|
|
|
|
+ var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
|
|
|
|
+
|
|
|
|
+ while (true)
|
|
|
|
+ {
|
|
|
|
+ teamCode = Tools.CommonFun.GetRandomAllStr(6);
|
|
|
|
+
|
|
|
|
+ if (!teamCodeItem.Equals(teamCode))
|
|
|
|
+ {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ var deleteStatus = await UpdateAsync(a => a.Id == dto.GroupId, a => new Grp_DelegationInfo
|
|
|
|
+ {
|
|
|
|
+ TourCode = teamCode,
|
|
|
|
+ GroupsOperator = dto.GroupsOperator,
|
|
|
|
+ GroupsTime = DateTime.Now
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (deleteStatus)
|
|
|
|
+ {
|
|
|
|
+ result.Code = 0;
|
|
|
|
+ result.Msg = "确认出团成功!";
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ result.Msg = "确认出团失败!";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ result.Code = 0;
|
|
|
|
+ result.Msg = "成功!";
|
|
|
|
+ result.Data = teamCode;
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 获取接团名称List
|
|
/// 获取接团名称List
|
|
/// </summary>
|
|
/// </summary>
|