Commit 1d959cd9 authored by 黄奎's avatar 黄奎

页面修改

parent 80336bb5
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Sale
{
......
......@@ -125,6 +125,6 @@ namespace Edu.Model.Entity.Course
/// <summary>
/// 订单编号
/// </summary>
public int OrderId { get; set; }
public string OrderId { get; set; }
}
}
......@@ -8,7 +8,7 @@ namespace Edu.Model.ViewModel.Course
/// <summary>
/// 课程报价单视图实体
/// </summary>
public class RB_Course_Offer_ViewModel: RB_Course_Offer
public class RB_Course_Offer_ViewModel : RB_Course_Offer
{
/// <summary>
/// 创建人
......@@ -75,5 +75,21 @@ namespace Edu.Model.ViewModel.Course
/// 是否获取报价单详情
/// </summary>
public int IsGetDetails { get; set; }
/// <summary>
/// 订单Id列表
/// </summary>
public List<int> OrderIdList
{
get
{
List<int> list = new List<int>();
if (!string.IsNullOrEmpty(this.OrderId))
{
list = Common.ConvertHelper.StringToList(this.OrderId);
}
return list;
}
}
}
}
......@@ -257,14 +257,16 @@ namespace Edu.Module.Course
[TransactionCallHandler]
public virtual bool SetOfferCreateOrder(int offerId, List<RB_Course_OfferDetails_ViewModel> detailList)
{
bool flag = false;
var offerModel = GetCourseOfferModule(offerId);
var emModel = accountRepository.GetEmployeeInfo(offerModel.CreateBy);
string orderIds = "";
foreach (var item in detailList)
{
try
{
decimal uPrice = item.OriginalPrice / item.JoinNum;
int OrderId = orderRepository.Insert(new Model.Entity.Course.RB_Order()
var orderModel = new Model.Entity.Course.RB_Order()
{
ClassId = item.ClassId,
Class_Price = uPrice,
......@@ -298,9 +300,13 @@ namespace Edu.Module.Course
UpdateBy = offerModel.CreateBy,
UpdateTime = DateTime.Now,
OfferId = offerId
});
if (OrderId > 0)
};
int OrderId = orderRepository.Insert(orderModel);
orderModel.OrderId = OrderId;
flag = OrderId > 0;
if (flag)
{
orderIds += "," + OrderId;
if (!string.IsNullOrEmpty(item.Remark))
{
order_RemarkRepository.Insert(new Model.Entity.Course.RB_Order_Remark()
......@@ -325,14 +331,6 @@ namespace Edu.Module.Course
CreateBy = offerModel.CreateBy,
CreateTime = DateTime.Now
});
//更新报价单订单编号
Dictionary<string, object> offerFileds = new Dictionary<string, object>()
{
{nameof(RB_Course_Offer_ViewModel.OrderId),OrderId },
{nameof(RB_Course_Offer_ViewModel.CustomerStatus),4 },
};
course_OfferRepository.Update(offerFileds, new WhereHelper(nameof(RB_Course_Offer_ViewModel.Id), offerId));
}
}
catch (Exception ex)
......@@ -340,7 +338,17 @@ namespace Edu.Module.Course
LogHelper.Write(ex, "报价单创建订单失败,offerId:" + offerId + ",DetailsId:" + item.DetailsId + ",ClassId:" + item.ClassId);
}
}
return true;
if (!string.IsNullOrEmpty(orderIds))
{
//更新报价单订单编号
Dictionary<string, object> offerFileds = new Dictionary<string, object>()
{
{nameof(RB_Course_Offer_ViewModel.OrderId),orderIds.Substring(1) },
{nameof(RB_Course_Offer_ViewModel.CustomerStatus),4 },
};
flag = course_OfferRepository.Update(offerFileds, new WhereHelper(nameof(RB_Course_Offer_ViewModel.Id), offerId));
}
return flag;
}
#endregion
......
......@@ -86,13 +86,27 @@ namespace Edu.WebApi.Controllers.Course
[HttpPost]
public ApiResult GetClassList()
{
//是够添加默选项
int IsAddDefault = base.ParmJObj.GetInt("IsAddDefault");
var query = new RB_Class_ViewModel()
{
CouseId=base.ParmJObj.GetInt("CourseId")
CouseId=base.ParmJObj.GetInt("CourseId"),
};
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
var list = classModule.GetClassListModule(query);
if (list == null)
{
list = new List<RB_Class_ViewModel>();
}
if(IsAddDefault==1)
{
list.Insert(0, new RB_Class_ViewModel()
{
ClassId = 0,
ClassName = "请选择"
});
}
return ApiResult.Success(data: list);
}
......
......@@ -93,6 +93,7 @@ namespace Edu.WebApi.Controllers.Course
qitem.CustomerName,
qitem.CustomerTel,
qitem.JoinNum,
qitem.OrderIdList,
});
return ApiResult.Success(data: 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