|
@@ -9,6 +9,7 @@ using OASystem.Domain.ViewModels.Groups;
|
|
|
using OASystem.Infrastructure.Tools;
|
|
|
using SqlSugar.Extensions;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Reflection;
|
|
|
|
|
|
namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
{
|
|
@@ -188,7 +189,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
var groupResult = carTouristGuides.GroupBy(x => x.SId).ToDictionary(x => x.Key, x => x.ToList());
|
|
|
foreach (var item in groupResult.Keys)
|
|
|
{
|
|
|
- while (groupResult[item].Count < day)
|
|
|
+ while (groupResult[item].Count <= day)
|
|
|
{
|
|
|
groupResult[item] = groupResult[item].OrderByDescending(x => x.DatePrice).ToList();
|
|
|
if (groupResult[item][0]?.DatePrice is not null)
|
|
@@ -415,7 +416,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
catch (Exception)
|
|
|
{
|
|
|
return result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
- throw;
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
@@ -455,16 +455,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
Grp_CarTouristGuideGroundReservationsContent QueryData = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().First(a => a.SId == item.SId && a.Id == item.Id && a.DiId == item.DiId && a.IsDel==0);
|
|
|
if (QueryData==null)
|
|
|
{
|
|
|
- if (item.Price!=0)
|
|
|
+ int id = await _sqlSugar.Insertable(item).ExecuteReturnIdentityAsync();
|
|
|
+ if (id == 0)
|
|
|
{
|
|
|
- int id = await _sqlSugar.Insertable(item).ExecuteReturnIdentityAsync();
|
|
|
- if (id == 0)
|
|
|
- {
|
|
|
- RollbackTran();
|
|
|
- return result = new Result() { Code = -2, Msg = "添加失败" };
|
|
|
- }
|
|
|
+ RollbackTran();
|
|
|
+ return result = new Result() { Code = -2, Msg = "添加失败" };
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
else
|
|
|
{
|