Commit 200fd992 authored by 黄奎's avatar 黄奎

新增字段

parent aba83108
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Sale
{
/// <summary>
/// 订单类型枚举
/// </summary>
public enum OrderTypeEnum
{
/// <summary>
/// 班级课程订单
/// </summary>
[EnumField("班级课程订单")]
CourseOrder = 1,
/// <summary>
/// 留学订单
/// </summary>
[EnumField("留学就业订单")]
StudyabroadOrder = 2,
}
}
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using Edu.Common.Enum.Sale;
using System;
using VT.FW.DB;
......@@ -153,5 +154,15 @@ namespace Edu.Model.Entity.Course
/// 报价单id
/// </summary>
public int OfferId { get; set; }
/// <summary>
/// 订单类型
/// </summary>
public OrderTypeEnum OrderType { get; set; }
/// <summary>
/// 来源编号(OrderType=1,SourceId=0),(OrderType=2,SourceId=留学就业产品对应编号)
/// </summary>
public int SourceId { get; set; }
}
}
......@@ -105,5 +105,10 @@ namespace Edu.Model.ViewModel.Course
/// 取消人数
/// </summary>
public int CancelNum { get; set; }
/// <summary>
/// 留学就业产品名称
/// </summary>
public string StudyName { get; set; }
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Linq;
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Enum.Course;
using Edu.Common.Enum.Sale;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Log;
......@@ -268,8 +270,19 @@ namespace Edu.WebApi.Controllers.Course
public ApiResult SetClassOrder()
{
var userInfo = base.UserInfo;
RB_Order_ViewModel demodel = JsonHelper.DeserializeObject<RB_Order_ViewModel>(RequestParm.Msg.ToString());
if (demodel.ClassId <= 0)
RB_Order_ViewModel demodel = new RB_Order_ViewModel()
{
OrderId=base.ParmJObj.GetInt("OrderId"),
ClassId=base.ParmJObj.GetInt("ClassId"),
GuestNum=base.ParmJObj.GetInt("GuestNum"),
OrderSource=(OrderSourceEnum)base.ParmJObj.GetInt("OrderSource"),
OrderType=(OrderTypeEnum)base.ParmJObj.GetInt("OrderType"),
PreferPrice=base.ParmJObj.GetDecimal("PreferPrice"),
SaleRemark=base.ParmJObj.GetStringValue("SaleRemark"),
SourceId=base.ParmJObj.GetInt("SourceId"),
Unit_Price=base.ParmJObj.GetDecimal("Unit_Price"),
};
if (demodel.OrderType== OrderTypeEnum.CourseOrder &&demodel.ClassId <= 0)
{
return ApiResult.ParamIsNull("请传递班级id");
}
......@@ -298,7 +311,17 @@ namespace Edu.WebApi.Controllers.Course
demodel.UpdateBy = userInfo.Id;
demodel.UpdateTime = DateTime.Now;
return orderModule.SetClassOrder(demodel, userInfo);
var flag = false;
string message = "";
if (demodel.OrderType == OrderTypeEnum.CourseOrder)
{
flag = orderModule.SetClassOrder(demodel, userInfo, out message);
}
else
{
flag = orderModule.SetStudyOrder(demodel, userInfo, out message);
}
return flag ? ApiResult.Success(message: message) : ApiResult.Failed(message: message);
}
/// <summary>
......@@ -343,7 +366,11 @@ namespace Edu.WebApi.Controllers.Course
if (model == null) {
return ApiResult.Failed("订单不存在");
}
var list = orderModule.GetClassOrderSetpPrice(OrderId);
var list = new List<RB_Order_StepPrice_ViewModel>();
if (model.OrderType == OrderTypeEnum.CourseOrder)
{
list = orderModule.GetClassOrderSetpPrice(OrderId);
}
return ApiResult.Success("", new
{
OrderInfo = new
......@@ -356,7 +383,9 @@ namespace Edu.WebApi.Controllers.Course
model.PreferPrice,
model.OrderSource,
OrderSourceName = model.OrderSource.ToName(),
model.SaleRemark
model.SaleRemark,
model.OrderType,
model.SourceId,
},
StepPriceList = list.Select(x => new
{
......@@ -410,7 +439,10 @@ namespace Edu.WebApi.Controllers.Course
model.ExtraDeductMoney,
model.IsCommissionGive,
CreateTime = model.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
CreateTime2 = model.CreateTime.ToString("yyyy年MM月dd日")
CreateTime2 = model.CreateTime.ToString("yyyy年MM月dd日"),
model.OrderType,
model.SourceId,
OrderTypeName=Common.Plugin.EnumHelper.ToName(model.OrderType),
});
}
......@@ -877,6 +909,8 @@ namespace Edu.WebApi.Controllers.Course
{
x.OrderId,
x.ClassId,
x.OrderType,
x.SourceId,
x.ClassSchoolId,
x.ClassName,
x.TradeWay,
......@@ -942,6 +976,118 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Success("", pageModel);
}
/// <summary>
/// 获取我的留学就业订单列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetMyStudyOrderPageList()
{
var userInfo = base.UserInfo;
ResultPageModel pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
RB_Order_ViewModel demodel = new RB_Order_ViewModel()
{
OrderId = base.ParmJObj.GetInt("OrderId"),
GuestName = base.ParmJObj.GetStringValue("GuestName"),
StartTime = base.ParmJObj.GetStringValue("StartTime"),
EndTime = base.ParmJObj.GetStringValue("EndTime"),
Q_NotCollect = base.ParmJObj.GetInt("Q_NotCollect"),
OrderState = (OrderStateEnum)base.ParmJObj.GetInt("OrderState"),
Q_OrderState = base.ParmJObj.GetInt("Q_OrderState"),
Q_OrderBy = base.ParmJObj.GetInt("Q_OrderBy"),
PlatformTax = base.ParmJObj.GetDecimal("PlatformTax"),
};
demodel.Group_Id = userInfo.Group_Id;
demodel.EnterID = userInfo.Id;
var orderList = orderModule.GetStudyOrderPageModule(pageModel.PageIndex, pageModel.PageSize, out long count, demodel);
var orderS = orderModule.GetStudyOrderStatisticsModule(demodel);
pageModel.Count = Convert.ToInt32(count);
pageModel.PageData = 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,
ExtraRewardMoney = orderS?.ExtraRewardMoney ?? 0
},
List = orderList.Select(x => new
{
x.OrderId,
x.ClassId,
x.OrderType,
x.SourceId,
x.ClassSchoolId,
ClassName= x.StudyName,
x.TradeWay,
x.Class_Price,
x.Unit_Price,
x.GuestNum,
x.PreferPrice,
x.Income,
x.Refund,
x.DiscountMoney,
x.PlatformTax,
DueInMoney = x.PreferPrice - (x.Income - x.Refund + x.PlatformTax + x.DiscountMoney),
x.OrderState,
OrderStateName = x.OrderState.ToName(),
x.EnterID,
EnterName = UserReidsCache.GetUserLoginInfo(x.EnterID)?.AccountName ?? "",
x.CommissionMoney,
x.ExtraRewardMoney,
x.ExtraDeductMoney,
x.IsCommissionGive,
CreateTime = x.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
x.SaleRemark,
x.TeacherRemark,
x.RectorRemark,
x.DirectorRemark,
x.OfferId,
SaleRemarkList = x.SaleRemarkList.Select(z => new
{
z.Id,
z.Content,
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
TeacherRemarkList = x.TeacherRemarkList.Select(z => new
{
z.Id,
z.Content,
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
RectorRemarkList = x.RectorRemarkList.Select(z => new
{
z.Id,
z.Content,
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
DirectorRemarkList = x.DirectorRemarkList.Select(z => new
{
z.Id,
z.Content,
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
GuestList = x.GuestList.Select(z => new
{
z.Id,
z.GuestName,
z.GuestState
})
})
};
return ApiResult.Success("", pageModel);
}
/// <summary>
/// 订单转交
/// </summary>
......
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