Commit aa7f65e3 authored by 吴春's avatar 吴春

提交下单以及订单详情返回自定义表单

parent a0862604
......@@ -329,6 +329,11 @@ namespace Mall.Model.Extend.Product
/// 查询教育商品订单 1查询教育商品订单 其他查询正常订单
/// </summary>
public int Q_OrderEduType { get; set; }
/// <summary>
/// 客户自定义表单填写内容 2024-01-30 add by:W
/// </summary>
public string CustomFormInfo { get; set; }
}
/// <summary>
......
......@@ -983,10 +983,16 @@ namespace Mall.Module.Product
}
}
List<object> resultList = new List<object>();
List<Model.Extend.TradePavilion.FormDataItem> listFormData = new List<Model.Extend.TradePavilion.FormDataItem>();
foreach (var item in model.DetailList)
{
var EduData = goodsRepository.ParsingEduJsonRepository(item.EduJsonData);
var tempList = goodsRelevanceList?.Where(qitem => qitem.GoodsId == item.GoodsId)?.ToList();
if (!string.IsNullOrWhiteSpace(item.CustomFormInfo) && listFormData?.Count == 0)
{
listFormData = AnalyzeFormComponent(item.CustomFormInfo, isGetAnswer: false);
}
resultList.Add(new
{
DetailId = item.Id,
......@@ -1007,6 +1013,7 @@ namespace Mall.Module.Product
{
template_message_list,
model.OrderId,
CustomFormInfo = listFormData,
model.OrderNo,
model.OrderStatus,
model.VersionSource,
......@@ -3004,7 +3011,7 @@ namespace Mall.Module.Product
sign = "",
confine_order_count = gmodel.LimitBuyOrderNum,//限制订单数量
form_id = gmodel.FormsId,//表单id
form_data_json = (customFormModel?.Id??0)>0 ? AnalyzeFormComponent(customFormModel.FormData, isGetAnswer: false):new List<Model.Extend.TradePavilion.FormDataItem>(),
form_data_json = (customFormModel?.Id ?? 0) > 0 ? AnalyzeFormComponent(customFormModel.FormData, isGetAnswer: false) : new List<Model.Extend.TradePavilion.FormDataItem>(),
marketingLogo = JsonHelper.Serialize(tempLogo),
});
}
......@@ -8075,6 +8082,7 @@ namespace Mall.Module.Product
int detailId = goods_OrderDetailRepository.Insert(new RB_Goods_OrderDetail()
{
Id = 0,
CustomFormInfo = demodel.CustomFormInfo,
CostMoney = item.CostMoney,
CoverImage = item.CoverImage,
CreateDate = DateTime.Now,
......
......@@ -92,9 +92,9 @@ namespace Mall.WebApi.Controllers.MallBase
x.EduData,
x.Original_Price,
});
List<object> robj = new List<object>()
List<object> robj = new List<object>()
{
new
new
{
MallId =MallModel?.MallBaseId??0,
MallName =MallModel?.MallName??"",
......@@ -487,7 +487,7 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.ParamIsNull("请传递购物车id");
}
}
if (demodel.OrderEduType != 1)
if (demodel.OrderEduType != 1 && userInfo.TenantId != 29)
{
if (demodel.JJSWStuId <= 0)
{
......@@ -506,7 +506,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.ParamIsNull("请选择学员!");
}
if (userInfo.TenantId != 27)
if (userInfo.TenantId != 27 && userInfo.TenantId != 29)
{
if (demodel.DeliveryMethod != Common.Enum.Goods.OrderDeliveryMethodEnum.VerificationShop)
{
......@@ -520,7 +520,14 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
}
if (userInfo.TenantId == 29)
{
if (string.IsNullOrWhiteSpace(demodel.CustomFormInfo))
{
return ApiResult.ParamIsNull("请填写旅客信息");
}
}
if (demodel.DetailList == null || !demodel.DetailList.Any())
{
return ApiResult.ParamIsNull("请传递商品信息");
......@@ -560,10 +567,10 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.BuyerMessage ??= "";//买家留言
demodel.OrderSource ??= UserSourceEnum.WeiXin;
#region 赋默认值
demodel.MallBaseId = userInfo.MallBaseId;
demodel.Country ??= 2;
demodel.CreateDate = DateTime.Now;
demodel.Fee ??= 0;
demodel.FreightMoney ??= 0;
......@@ -579,7 +586,7 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.UserId = userInfo.UserId;
demodel.SmallShopsId = req.SmallShopsId;
demodel.OrderClassify = 0;
if (userInfo!=null)
if (userInfo != null)
{
if (userInfo.UserId.ToString() == Config.XuZongUserId)
{
......@@ -817,7 +824,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
[AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult SetERPGoodsOrderInfo()
{
var req = RequestParm;
......@@ -910,7 +918,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
[AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult UpdateERPGoodsOrderInfo()
{
var req = RequestParm;
......
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