Commit 2fb7ea3c authored by 黄奎's avatar 黄奎

订单查询报错处理

parent 10d97747
...@@ -2134,100 +2134,113 @@ namespace Edu.WebApi.Controllers.Course ...@@ -2134,100 +2134,113 @@ namespace Edu.WebApi.Controllers.Course
demodel.Group_Id = userInfo.Group_Id; demodel.Group_Id = userInfo.Group_Id;
var orderList = orderModule.GetMyOrderPageList(pageModel.PageIndex, pageModel.PageSize, out long count, demodel); var orderList = orderModule.GetMyOrderPageList(pageModel.PageIndex, pageModel.PageSize, out long count, demodel);
var orderS = orderModule.GetMyOrderStatisticsModule(demodel); List<object> list = new List<object>();
pageModel.Count = Convert.ToInt32(count); foreach (var item in orderList)
var obj = new
{ {
Statistics = new List<object> ClassList = new List<object>();
if (item.ClassList != null && item.ClassList.Count > 0)
{ {
PreferPrice = orderS?.PreferPrice ?? 0, foreach (var cItem in item.ClassList)
Income = orderS?.Income ?? 0, {
DueInMoney = orderS?.DueInMoney ?? 0, try
GuestNum = orderS?.GuestNum ?? 0, {
CancelNum = orderS?.CancelNum ?? 0, ClassList.Add(new
CommissionMoney = (orderS?.CommissionMoney ?? 0) > 0 ? (orderS?.CommissionMoney ?? 0) : 0, {
ExtraRewardMoney = orderS?.ExtraRewardMoney ?? 0, cItem.ClassId,
BrokerageMoney = orderS?.BrokerageMoney ?? 0 cItem.ClassName,
}, cItem.CouseId,
List = orderList?.Select(x => new cItem.CourseSubjectName,
cItem.CourseName,
cItem.TeacherName,
cItem.Teacher_Id,
OpenTimeStr = Common.ConvertHelper.FormatDate(cItem.OpenTime)
});
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetOrderPageListStatistics-Item:" + Common.Plugin.JsonHelper.Serialize(item));
}
}
}
list.Add(new
{ {
ClassList = x.ClassList?.Select(z => new { z.ClassId, z.ClassName, z.CouseId, z.CourseSubjectName, z.CourseName, z.TeacherName, z.Teacher_Id, OpenTimeStr = StringHelper.FormatDate(z.OpenTime) }), ClassList,
x.OrderId, item.OrderId,
x.ClassId, item.ClassId,
x.ClassNo, item.ClassNo,
x.OrderType, item.OrderType,
x.SourceId, item.SourceId,
x.ClassSchoolId, item.ClassSchoolId,
x.ClassName, item.ClassName,
OpenTime = Common.ConvertHelper.FormatDate(x.OpenTime), OpenTime = Common.ConvertHelper.FormatDate(item.OpenTime),
x.JoinType, item.JoinType,
JoinTypeName = x.JoinType.ToName(), JoinTypeName = item.JoinType.ToName(),
x.TargetJoinType, item.TargetJoinType,
TargetJoinTypeName = x.TargetJoinType.ToName(), TargetJoinTypeName = item.TargetJoinType.ToName(),
x.SourceOrderId, item.SourceOrderId,
x.SourceClassName, item.SourceClassName,
x.TargetOrderId, item.TargetOrderId,
x.TargetClassName, item.TargetClassName,
x.StartClassHours, item.StartClassHours,
x.CourseName, item.CourseName,
x.TradeWay, item.TradeWay,
x.Class_Price, item.Class_Price,
x.Unit_Price, item.Unit_Price,
x.GuestNum, item.GuestNum,
x.PreferPrice, item.PreferPrice,
x.Income, item.Income,
x.Refund, item.Refund,
x.DiscountMoney, item.DiscountMoney,
x.PlatformTax, item.PlatformTax,
DueInMoney = x.PreferPrice - (x.Income - x.Refund + x.PlatformTax + x.DiscountMoney), DueInMoney = item.PreferPrice - (item.Income - item.Refund + item.PlatformTax + item.DiscountMoney),
x.OrderState, item.OrderState,
OrderStateName = x.OrderState.ToName(), OrderStateName = item.OrderState.ToName(),
x.OrderSource, item.OrderSource,
OrderSourceName = x.OrderSource.ToName(), OrderSourceName = item.OrderSource.ToName(),
x.EnterID, item.EnterID,
EnterName = UserReidsCache.GetUserLoginInfo(x.EnterID)?.AccountName ?? "", EnterName = UserReidsCache.GetUserLoginInfo(item.EnterID)?.AccountName ?? "",
x.CreateBy, item.CreateBy,
CreateByName = UserReidsCache.GetUserLoginInfo(x.CreateBy)?.AccountName ?? "", CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "",
x.CourseConsultantId, item.CourseConsultantId,
ConsultantName = UserReidsCache.GetUserLoginInfo(x.CourseConsultantId)?.AccountName ?? "", ConsultantName = UserReidsCache.GetUserLoginInfo(item.CourseConsultantId)?.AccountName ?? "",
IsAchievements = x.YFCommission > 0 ? 1 : 2, IsAchievements = item.YFCommission > 0 ? 1 : 2,
YFCommissionMoney = x.YFCommission > 0 ? x.YFCommission : GetOrderYFCommission(x), YFCommissionMoney = item.YFCommission > 0 ? item.YFCommission : GetOrderYFCommission(item),
x.CommissionMoney, item.CommissionMoney,
x.ExtraCommissionMoney, item.ExtraCommissionMoney,
x.ExtraRewardMoney, item.ExtraRewardMoney,
x.ExtraDeductMoney, item.ExtraDeductMoney,
IsCommissionGive = x.YFCommission > 0 ? 1 : x.IsCommissionGive, IsCommissionGive = item.YFCommission > 0 ? 1 : item.IsCommissionGive,
x.CommissionBack, item.CommissionBack,
CreateTime = x.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), CreateTime = item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
SaleRemark = x?.SaleRemark ?? "", SaleRemark = item?.SaleRemark ?? "",
TeacherRemark = x?.TeacherRemark ?? "", TeacherRemark = item?.TeacherRemark ?? "",
RectorRemark = x?.RectorRemark ?? "", RectorRemark = item?.RectorRemark ?? "",
DirectorRemark = x?.DirectorRemark ?? "", DirectorRemark = item?.DirectorRemark ?? "",
x.OfferId, item.OfferId,
x.HelpEnterId, item.HelpEnterId,
HelpEnterName = UserReidsCache.GetUserLoginInfo(x.HelpEnterId)?.AccountName, HelpEnterName = UserReidsCache.GetUserLoginInfo(item.HelpEnterId)?.AccountName,
x.GeneralOccupation, item.GeneralOccupation,
x.EduOccupation, item.EduOccupation,
x.IsLessPrice, item.IsLessPrice,
x.LessPrice, item.LessPrice,
x.OrderNature, item.OrderNature,
OrderNatureName = x.OrderNature.ToName(), OrderNatureName = item.OrderNature.ToName(),
x.OldPreferPrice, item.OldPreferPrice,
x.EffectStatus, item.EffectStatus,
x.EffectStatusStr, item.EffectStatusStr,
EffectTime = Common.ConvertHelper.FormatDate(x.EffectTime), EffectTime = Common.ConvertHelper.FormatDate(item.EffectTime),
x.UpOrderId, item.UpOrderId,
x.VisitorReserveId, item.VisitorReserveId,
x.RenewOrderId, item.RenewOrderId,
x.FirstOrderId, item.FirstOrderId,
x.IsBackClass, item.IsBackClass,
x.CourseSubject, item.CourseSubject,
x.CourseSubjectName, item.CourseSubjectName,
x.CustomerId, item.CustomerId,
x.CustomerName, item.CustomerName,
x.CustomerTel, item.CustomerTel,
x.ClassScrollType, item.ClassScrollType,
SplitDetailsList = x?.SplitDetailsList?.Select(qitem => new SplitDetailsList = item?.SplitDetailsList?.Select(qitem => new
{ {
qitem.S_ClassId, qitem.S_ClassId,
qitem.S_ClassName, qitem.S_ClassName,
...@@ -2240,35 +2253,35 @@ namespace Edu.WebApi.Controllers.Course ...@@ -2240,35 +2253,35 @@ namespace Edu.WebApi.Controllers.Course
T_JoinTypeName = qitem.T_JoinType.ToName(), T_JoinTypeName = qitem.T_JoinType.ToName(),
qitem.T_OrderId qitem.T_OrderId
}), }),
SaleRemarkList = x?.SaleRemarkList.Select(z => new SaleRemarkList = item?.SaleRemarkList.Select(z => new
{ {
z.Id, z.Id,
z.Content, z.Content,
CreateBy = z.CreateByName, CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}), }),
TeacherRemarkList = x?.TeacherRemarkList.Select(z => new TeacherRemarkList = item?.TeacherRemarkList.Select(z => new
{ {
z.Id, z.Id,
z.Content, z.Content,
CreateBy = z.CreateByName, CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}), }),
RectorRemarkList = x?.RectorRemarkList.Select(z => new RectorRemarkList = item?.RectorRemarkList.Select(z => new
{ {
z.Id, z.Id,
z.Content, z.Content,
CreateBy = z.CreateByName, CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}), }),
DirectorRemarkList = x?.DirectorRemarkList.Select(z => new DirectorRemarkList = item?.DirectorRemarkList.Select(z => new
{ {
z.Id, z.Id,
z.Content, z.Content,
CreateBy = z.CreateByName, CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}), }),
GuestList = x?.GuestList.Select(z => new GuestList = item?.GuestList.Select(z => new
{ {
z.Id, z.Id,
z.GuestName, z.GuestName,
...@@ -2283,7 +2296,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -2283,7 +2296,7 @@ namespace Edu.WebApi.Controllers.Course
z.ContractUrl, z.ContractUrl,
z.ContractUrlList, z.ContractUrlList,
}), }),
ContractList = x?.ContractList.Select(z => new ContractList = item?.ContractList.Select(z => new
{ {
z.Id, z.Id,
z.StudentName, z.StudentName,
...@@ -2291,16 +2304,34 @@ namespace Edu.WebApi.Controllers.Course ...@@ -2291,16 +2304,34 @@ namespace Edu.WebApi.Controllers.Course
z.GuestId, z.GuestId,
z.Status, z.Status,
}), }),
x.CreateType, item.CreateType,
CreateTypeName = x.CreateType.ToName(), CreateTypeName = item.CreateType.ToName(),
x.StuSourceIdName, item.StuSourceIdName,
x.BrokerageMoney, item.BrokerageMoney,
x.StudyBroadRebateMoney, item.StudyBroadRebateMoney,
x.TextbookFee, item.TextbookFee,
x.CoursewareFee, item.CoursewareFee,
x.SellPriceType, item.SellPriceType,
x.TotalClassHours, item.TotalClassHours,
}) });
}
var orderS = orderModule.GetMyOrderStatisticsModule(demodel);
pageModel.Count = Convert.ToInt32(count);
var obj = new
{
Statistics = new
{
PreferPrice = orderS?.PreferPrice ?? 0,
Income = orderS?.Income ?? 0,
DueInMoney = orderS?.DueInMoney ?? 0,
GuestNum = orderS?.GuestNum ?? 0,
CancelNum = orderS?.CancelNum ?? 0,
CommissionMoney = (orderS?.CommissionMoney ?? 0) > 0 ? (orderS?.CommissionMoney ?? 0) : 0,
ExtraRewardMoney = orderS?.ExtraRewardMoney ?? 0,
BrokerageMoney = orderS?.BrokerageMoney ?? 0
},
List = list
}; };
pageModel.PageData = obj; pageModel.PageData = obj;
return ApiResult.Success("", pageModel); return ApiResult.Success("", pageModel);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment