Commit b9b4e2d5 authored by 吴春's avatar 吴春

Merge branch 'HK' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq

parents 83406134 cb811e3a
...@@ -309,7 +309,7 @@ namespace Mall.Model.Entity.Product ...@@ -309,7 +309,7 @@ namespace Mall.Model.Entity.Product
/// </summary> /// </summary>
public int? SmallShopsId { get; set; } public int? SmallShopsId { get; set; }
/// <summary> /// <summary>
/// 订单分类 0正常订单 1司导订单 2教育订单 /// 订单分类 0正常订单 1司导订单 2教育订单 3-线下服务订单
/// </summary> /// </summary>
public int OrderClassify { get; set; } public int OrderClassify { get; set; }
/// <summary> /// <summary>
...@@ -320,5 +320,11 @@ namespace Mall.Model.Entity.Product ...@@ -320,5 +320,11 @@ namespace Mall.Model.Entity.Product
/// 课程卡抵扣金额 /// 课程卡抵扣金额
/// </summary> /// </summary>
public decimal? EducationMoney { get; set; } public decimal? EducationMoney { get; set; }
/// <summary>
/// 门店编号
/// </summary>
public int StoresId { get; set; }
} }
} }
...@@ -349,5 +349,10 @@ namespace Mall.Model.Extend.Product ...@@ -349,5 +349,10 @@ namespace Mall.Model.Extend.Product
return Common.ConvertHelper.ConvertToListInt(this.StoresIds); return Common.ConvertHelper.ConvertToListInt(this.StoresIds);
} }
} }
/// <summary>
/// 门店名称
/// </summary>
public List<string> StoreNameList { get; set; }
} }
} }
...@@ -33,5 +33,10 @@ namespace Mall.Model.Entity.User ...@@ -33,5 +33,10 @@ namespace Mall.Model.Entity.User
/// 距离公里数 /// 距离公里数
/// </summary> /// </summary>
public decimal KM { get; set; } public decimal KM { get; set; }
/// <summary>
/// 查询门店编号
/// </summary>
public string QIds { get; set; }
} }
} }
This diff is collapsed.
...@@ -208,6 +208,11 @@ namespace Mall.Module.Product ...@@ -208,6 +208,11 @@ namespace Mall.Module.Product
/// </summary> /// </summary>
private readonly RB_Member_IntegralRepository member_IntegralRepository = new RB_Member_IntegralRepository(); private readonly RB_Member_IntegralRepository member_IntegralRepository = new RB_Member_IntegralRepository();
/// <summary>
/// 门店仓储层对象
/// </summary>
private readonly RB_StoresRepository storesRepository = new RB_StoresRepository();
/// <summary> /// <summary>
/// 获取会员等级列表 /// 获取会员等级列表
...@@ -250,9 +255,16 @@ namespace Mall.Module.Product ...@@ -250,9 +255,16 @@ namespace Mall.Module.Product
string ids = string.Join(",", list.Select(x => x.Id)); string ids = string.Join(",", list.Select(x => x.Id));
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var olist = goods_OrderRepository.GetGoodsOrderNum(ids); var olist = goods_OrderRepository.GetGoodsOrderNum(ids);
var storesIds = string.Join(",", list.Where(qitem => !string.IsNullOrWhiteSpace(qitem.StoresIds)).Select(qitem => qitem.StoresIds));
List<RB_Stores_Extend> storeList = new List<RB_Stores_Extend>();
if (!string.IsNullOrWhiteSpace(storesIds))
{
storeList = storesRepository.GetStoresListRepository(new RB_Stores_Extend() { QIds = storesIds });
}
foreach (var item in list) foreach (var item in list)
{ {
item.StoreNameList = new List<string>();
item.CategoryList = clist.Where(x => x.GoodsId == item.Id).ToList(); item.CategoryList = clist.Where(x => x.GoodsId == item.Id).ToList();
//轮播图 //轮播图
item.CoverImage = ""; item.CoverImage = "";
...@@ -274,6 +286,24 @@ namespace Mall.Module.Product ...@@ -274,6 +286,24 @@ namespace Mall.Module.Product
} }
} }
item.GoodsBuyNum = olist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0; item.GoodsBuyNum = olist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0;
if (!string.IsNullOrEmpty(item.StoresIds))
{
List<int> storesResultList = Common.ConvertHelper.ConvertToListInt(item.StoresIds);
if (storesResultList != null && storesResultList.Count > 0)
{
foreach (var sItem in storesResultList)
{
string storeName = storeList?.Where(qitem => qitem.Id == sItem)?.FirstOrDefault()?.Name ?? "";
if (!string.IsNullOrEmpty(storeName))
{
item.StoreNameList.Add(storeName);
}
}
}
}
} }
} }
return list; return list;
...@@ -828,7 +858,7 @@ namespace Mall.Module.Product ...@@ -828,7 +858,7 @@ namespace Mall.Module.Product
var pupmodel = demodel.DistributionCommissionList.Where(x => x.SpecificationSort == item.SpecificationSort && x.DistributorGrade == item.DistributorGrade).FirstOrDefault(); var pupmodel = demodel.DistributionCommissionList.Where(x => x.SpecificationSort == item.SpecificationSort && x.DistributorGrade == item.DistributorGrade).FirstOrDefault();
if (item.OneCommission != pupmodel.OneCommission || item.TwoCommission != pupmodel.TwoCommission || item.ThreeCommission != pupmodel.ThreeCommission) if (item.OneCommission != pupmodel.OneCommission || item.TwoCommission != pupmodel.TwoCommission || item.ThreeCommission != pupmodel.ThreeCommission)
{ {
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() Dictionary<string, object> keyValues1 = new Dictionary<string, object>()
{ {
{ nameof(RB_Goods_DistributionCommission.OneCommission),pupmodel.OneCommission}, { nameof(RB_Goods_DistributionCommission.OneCommission),pupmodel.OneCommission},
{ nameof(RB_Goods_DistributionCommission.TwoCommission),pupmodel.TwoCommission}, { nameof(RB_Goods_DistributionCommission.TwoCommission),pupmodel.TwoCommission},
...@@ -875,7 +905,7 @@ namespace Mall.Module.Product ...@@ -875,7 +905,7 @@ namespace Mall.Module.Product
var pupmodel = demodel.MemberPriceList.Where(x => x.SpecificationSort == item.SpecificationSort && x.MemberGrade == item.MemberGrade).FirstOrDefault(); var pupmodel = demodel.MemberPriceList.Where(x => x.SpecificationSort == item.SpecificationSort && x.MemberGrade == item.MemberGrade).FirstOrDefault();
if (item.MemberPrice != pupmodel.MemberPrice) if (item.MemberPrice != pupmodel.MemberPrice)
{ {
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() Dictionary<string, object> keyValues1 = new Dictionary<string, object>()
{ {
{ nameof(RB_Goods_MemberPrice.MemberPrice),pupmodel.MemberPrice} { nameof(RB_Goods_MemberPrice.MemberPrice),pupmodel.MemberPrice}
}; };
...@@ -943,8 +973,6 @@ namespace Mall.Module.Product ...@@ -943,8 +973,6 @@ namespace Mall.Module.Product
}); });
} }
} }
//插入分销佣金 //插入分销佣金
if (demodel.SeparateDistribution == 1) if (demodel.SeparateDistribution == 1)
{ {
......
...@@ -4,6 +4,7 @@ using System.Text; ...@@ -4,6 +4,7 @@ using System.Text;
using Mall.Model.Entity.User; using Mall.Model.Entity.User;
using Mall.Model.Extend.User; using Mall.Model.Extend.User;
using System.Linq; using System.Linq;
using Mall.Model.Extend.MarketingCenter;
namespace Mall.Repository.User namespace Mall.Repository.User
{ {
...@@ -137,6 +138,10 @@ WHERE 1 = 1 AND Status = 0 "); ...@@ -137,6 +138,10 @@ WHERE 1 = 1 AND Status = 0 ");
{ {
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Stores_Extend.Id), query.Id); builder.AppendFormat(" AND {0}={1} ", nameof(RB_Stores_Extend.Id), query.Id);
} }
if (!string.IsNullOrEmpty(query.QIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Stores_Extend.Id), query.QIds);
}
if (query.Name != null && !string.IsNullOrEmpty(query.Name.Trim())) if (query.Name != null && !string.IsNullOrEmpty(query.Name.Trim()))
{ {
builder.AppendFormat(" AND {0} LIKE '%{1}%' ", nameof(RB_Stores_Extend.Name), query.Name.Trim()); builder.AppendFormat(" AND {0} LIKE '%{1}%' ", nameof(RB_Stores_Extend.Name), query.Name.Trim());
......
...@@ -694,6 +694,63 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -694,6 +694,63 @@ namespace Mall.WebApi.Controllers.MallBase
return orderModule.SetAppletSDGoodsOrderInfo(demodel); return orderModule.SetAppletSDGoodsOrderInfo(demodel);
} }
/// <summary>
/// 线下服务下单
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetAppletOfflineGoodsOrderInfo()
{
var req = RequestParm;
var userInfo = AppletUserInfo;
RB_Goods_Order_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Order_Extend>(req.msg.ToString());
if (string.IsNullOrEmpty(demodel.Consignee))
{
return ApiResult.ParamIsNull("请传递联系人");
}
if (string.IsNullOrEmpty(demodel.Mobile))
{
return ApiResult.ParamIsNull("请传递联系人手机号码");
}
demodel.DeliveryMethod = Common.Enum.Goods.OrderDeliveryMethodEnum.VerificationShop;
if ((demodel.Income ?? 0) <= 0)
{
return ApiResult.ParamIsNull("订单金额不正确");
}
if (demodel.StoresId <= 0)
{
return ApiResult.ParamIsNull("请选择服务门店");
}
demodel.BuyerMessage ??= "";//买家留言
demodel.OrderSource ??= Common.Enum.User.UserSourceEnum.WeiXin;
#region 赋默认值
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.Country ??= 2;
demodel.OrderStatus = Common.Enum.Goods.OrderStatusEnum.NonPayment;
demodel.CreateDate = DateTime.Now;
demodel.Fee ??= 0;
demodel.FreightMoney ??= 0;
demodel.HistoryOrderStatus ??= 0;
demodel.IsApplyForCancel ??= 2;
demodel.IsOrderCommission ??= 2;
demodel.MerchantsNo ??= "";
demodel.Recycled ??= 2;
demodel.Refund ??= 0;
demodel.Status = 0;
demodel.AnchorName ??= "";
demodel.UpdateDate = DateTime.Now;
demodel.UserId = userInfo.UserId;
demodel.SmallShopsId = req.SmallShopsId;
demodel.OrderClassify = 3;
demodel.DestinationAddress ??= "";
#endregion
bool flag= orderModule.SetAppletOfflineGoodsOrderModule(demodel,out string message);
return flag ? ApiResult.Success(message: message) : ApiResult.Failed(message: message);
}
/// <summary> /// <summary>
/// ERP下单 /// ERP下单
/// </summary> /// </summary>
......
...@@ -77,7 +77,12 @@ namespace Mall.WebApi.Controllers.Reserve ...@@ -77,7 +77,12 @@ namespace Mall.WebApi.Controllers.Reserve
storeTel = storeModel?.Tel, storeTel = storeModel?.Tel,
distance = storeModel?.KM, distance = storeModel?.KM,
storeCoverImg = storeModel?.CoverImg, storeCoverImg = storeModel?.CoverImg,
storeNavImg = storeModel?.NavImg storeNavImg = storeModel?.NavImg,
consumptionObj = new
{
consumptionStoreId = 0,
consumptionStoreName = "HK门店"
}
}, },
}; };
return ApiResult.Success(data: result); return ApiResult.Success(data: result);
......
...@@ -68,7 +68,10 @@ namespace Mall.WebApi.Controllers.Reserve ...@@ -68,7 +68,10 @@ namespace Mall.WebApi.Controllers.Reserve
x.GoodsStatus, x.GoodsStatus,
x.TenantId, x.TenantId,
x.MallBaseId, x.MallBaseId,
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "" CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
x.DepositMoney,
x.IsChooseServicePerson,
x.StoreNameList
}); });
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
......
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