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,
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 = orderList?.Select(x => 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) }), try
x.OrderId, {
x.ClassId, ClassList.Add(new
x.ClassNo, {
x.OrderType, cItem.ClassId,
x.SourceId, cItem.ClassName,
x.ClassSchoolId, cItem.CouseId,
x.ClassName, cItem.CourseSubjectName,
OpenTime = Common.ConvertHelper.FormatDate(x.OpenTime), cItem.CourseName,
x.JoinType, cItem.TeacherName,
JoinTypeName = x.JoinType.ToName(), cItem.Teacher_Id,
x.TargetJoinType, OpenTimeStr = Common.ConvertHelper.FormatDate(cItem.OpenTime)
TargetJoinTypeName = x.TargetJoinType.ToName(), });
x.SourceOrderId, }
x.SourceClassName, catch (Exception ex)
x.TargetOrderId, {
x.TargetClassName, Common.Plugin.LogHelper.Write(ex, "GetOrderPageListStatistics-Item:" + Common.Plugin.JsonHelper.Serialize(item));
x.StartClassHours, }
x.CourseName, }
x.TradeWay, }
x.Class_Price, list.Add(new
x.Unit_Price, {
x.GuestNum, ClassList,
x.PreferPrice, item.OrderId,
x.Income, item.ClassId,
x.Refund, item.ClassNo,
x.DiscountMoney, item.OrderType,
x.PlatformTax, item.SourceId,
DueInMoney = x.PreferPrice - (x.Income - x.Refund + x.PlatformTax + x.DiscountMoney), item.ClassSchoolId,
x.OrderState, item.ClassName,
OrderStateName = x.OrderState.ToName(), OpenTime = Common.ConvertHelper.FormatDate(item.OpenTime),
x.OrderSource, item.JoinType,
OrderSourceName = x.OrderSource.ToName(), JoinTypeName = item.JoinType.ToName(),
x.EnterID, item.TargetJoinType,
EnterName = UserReidsCache.GetUserLoginInfo(x.EnterID)?.AccountName ?? "", TargetJoinTypeName = item.TargetJoinType.ToName(),
x.CreateBy, item.SourceOrderId,
CreateByName = UserReidsCache.GetUserLoginInfo(x.CreateBy)?.AccountName ?? "", item.SourceClassName,
x.CourseConsultantId, item.TargetOrderId,
ConsultantName = UserReidsCache.GetUserLoginInfo(x.CourseConsultantId)?.AccountName ?? "", item.TargetClassName,
IsAchievements = x.YFCommission > 0 ? 1 : 2, item.StartClassHours,
YFCommissionMoney = x.YFCommission > 0 ? x.YFCommission : GetOrderYFCommission(x), item.CourseName,
x.CommissionMoney, item.TradeWay,
x.ExtraCommissionMoney, item.Class_Price,
x.ExtraRewardMoney, item.Unit_Price,
x.ExtraDeductMoney, item.GuestNum,
IsCommissionGive = x.YFCommission > 0 ? 1 : x.IsCommissionGive, item.PreferPrice,
x.CommissionBack, item.Income,
CreateTime = x.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), item.Refund,
SaleRemark = x?.SaleRemark ?? "", item.DiscountMoney,
TeacherRemark = x?.TeacherRemark ?? "", item.PlatformTax,
RectorRemark = x?.RectorRemark ?? "", DueInMoney = item.PreferPrice - (item.Income - item.Refund + item.PlatformTax + item.DiscountMoney),
DirectorRemark = x?.DirectorRemark ?? "", item.OrderState,
x.OfferId, OrderStateName = item.OrderState.ToName(),
x.HelpEnterId, item.OrderSource,
HelpEnterName = UserReidsCache.GetUserLoginInfo(x.HelpEnterId)?.AccountName, OrderSourceName = item.OrderSource.ToName(),
x.GeneralOccupation, item.EnterID,
x.EduOccupation, EnterName = UserReidsCache.GetUserLoginInfo(item.EnterID)?.AccountName ?? "",
x.IsLessPrice, item.CreateBy,
x.LessPrice, CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "",
x.OrderNature, item.CourseConsultantId,
OrderNatureName = x.OrderNature.ToName(), ConsultantName = UserReidsCache.GetUserLoginInfo(item.CourseConsultantId)?.AccountName ?? "",
x.OldPreferPrice, IsAchievements = item.YFCommission > 0 ? 1 : 2,
x.EffectStatus, YFCommissionMoney = item.YFCommission > 0 ? item.YFCommission : GetOrderYFCommission(item),
x.EffectStatusStr, item.CommissionMoney,
EffectTime = Common.ConvertHelper.FormatDate(x.EffectTime), item.ExtraCommissionMoney,
x.UpOrderId, item.ExtraRewardMoney,
x.VisitorReserveId, item.ExtraDeductMoney,
x.RenewOrderId, IsCommissionGive = item.YFCommission > 0 ? 1 : item.IsCommissionGive,
x.FirstOrderId, item.CommissionBack,
x.IsBackClass, CreateTime = item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
x.CourseSubject, SaleRemark = item?.SaleRemark ?? "",
x.CourseSubjectName, TeacherRemark = item?.TeacherRemark ?? "",
x.CustomerId, RectorRemark = item?.RectorRemark ?? "",
x.CustomerName, DirectorRemark = item?.DirectorRemark ?? "",
x.CustomerTel, item.OfferId,
x.ClassScrollType, item.HelpEnterId,
SplitDetailsList = x?.SplitDetailsList?.Select(qitem => new HelpEnterName = UserReidsCache.GetUserLoginInfo(item.HelpEnterId)?.AccountName,
item.GeneralOccupation,
item.EduOccupation,
item.IsLessPrice,
item.LessPrice,
item.OrderNature,
OrderNatureName = item.OrderNature.ToName(),
item.OldPreferPrice,
item.EffectStatus,
item.EffectStatusStr,
EffectTime = Common.ConvertHelper.FormatDate(item.EffectTime),
item.UpOrderId,
item.VisitorReserveId,
item.RenewOrderId,
item.FirstOrderId,
item.IsBackClass,
item.CourseSubject,
item.CourseSubjectName,
item.CustomerId,
item.CustomerName,
item.CustomerTel,
item.ClassScrollType,
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