Commit 2cfdfe25 authored by 吴春's avatar 吴春

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

parents 1178c657 f067c546
......@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Product;
using Mall.Model.Extend.Finance;
using Mall.Model.Extend.Reserve;
namespace Mall.Model.Extend.Product
{
......@@ -36,6 +37,12 @@ namespace Mall.Model.Extend.Product
/// 课程卡信息 //2020-10-11 Add By:w
/// </summary>
public List<Education.RB_Education_MemberCoupon_Extend> MemberEducationCouponList { get; set; }
/// <summary>
/// 套餐卡信息
/// </summary>
public List<RB_Reserve_MemberCoupon_Extend> ReserveCouponList { get; set; }
/// <summary>
/// 是否直播订单
/// </summary>
......
......@@ -325,6 +325,11 @@ namespace Mall.Module.Product
/// </summary>
private Mall.Repository.Education.RB_Education_MemberCouponRepository educationMemberCouponRepository = new Mall.Repository.Education.RB_Education_MemberCouponRepository();
/// <summary>
/// 套餐卡仓储层对象
/// </summary>
private RB_Reserve_MemberCouponRepository reserveMemberCouponRepository = new RB_Reserve_MemberCouponRepository();
/// <summary>
/// 服务人员仓储层对象
/// </summary>
......@@ -976,6 +981,13 @@ namespace Mall.Module.Product
{
QIds = servicePersions
});
List<RB_Reserve_MemberCoupon_Extend> educationCouponList = new List<RB_Reserve_MemberCoupon_Extend>();
//查询订单详情对应的课程卡信息
string educationCouponIds = string.Join(",", dlist.Where(x => x.EducationCouponId > 0).Select(x => x.EducationCouponId).Distinct());
if (!string.IsNullOrWhiteSpace(educationCouponIds))
{
educationCouponList = reserveMemberCouponRepository.GetList(new RB_Reserve_MemberCoupon_Extend { TenantId = tenantId, MallBaseId = mallBaseId, Ids = educationCouponIds });
}
foreach (var item in dlist)
{
item.CoverImagePath = item.CoverImage;
......@@ -989,6 +1001,7 @@ namespace Mall.Module.Product
model.PresentFXGrade = 1;
}
item.ServicepersonalName = serviceList?.Where(qitem => qitem.ID == item.ServicepersonalId)?.FirstOrDefault()?.Name ?? "";
item.ReserveCouponList = educationCouponList.Where(x => x.Id == item.EducationCouponId).ToList();// 2020-10-11 订单详情对应的套餐卡
}
}
model.DetailList = dlist;
......@@ -1040,6 +1053,7 @@ namespace Mall.Module.Product
model.PreferPrice,
model.Income,
model.CouponMoney,
EducationMoney=(model?.EducationMoney??0),
model.Consignee,
model.Mobile,
model.ShoppingAddress,
......@@ -1058,6 +1072,12 @@ namespace Mall.Module.Product
x.ServiceTime,
x.GoodServiceTime,
x.ServicepersonalName,
MemberEducationCouponList = x?.ReserveCouponList.Select(z => new
{
z.Name,
z.UseHeXiao,
z.HeXiao
}),
}),
model.IsApplyForCancel,
model.RejectRemark,
......@@ -4942,10 +4962,10 @@ namespace Mall.Module.Product
}
#endregion
#region 课程卡初始化
List<RB_Education_MemberCoupon_Extend> eList = new List<RB_Education_MemberCoupon_Extend>();
List<RB_Education_Coupon_Extend> deList = new List<RB_Education_Coupon_Extend>();
List<RB_Education_CouponProduct_Extend> edcpList = new List<RB_Education_CouponProduct_Extend>();
#region 套餐卡初始化
List<RB_Reserve_MemberCoupon_Extend> eList = new List<RB_Reserve_MemberCoupon_Extend>();
List<RB_Reserve_Coupon_Extend> deList = new List<RB_Reserve_Coupon_Extend>();
List<RB_Reserve_CouponProduct_Extend> edcpList = new List<RB_Reserve_CouponProduct_Extend>();
if (demodel.Use_Education_Id > 0)
{
if (demodel.User_Coupon_Id > 0)
......@@ -4958,7 +4978,10 @@ namespace Mall.Module.Product
message = "套餐卡与积分抵扣不能同时使用";
return false;
}
eList = education_MemberCouponRepository.GetList(new RB_Education_MemberCoupon_Extend() { Ids = (demodel.Use_Education_Id ?? 0).ToString(), UserId = umodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
eList = reserve_MemberCouponRepository.GetList(new RB_Reserve_MemberCoupon_Extend() {
Ids = (demodel.Use_Education_Id ?? 0).ToString(), UserId = umodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId,
}
);
if (eList.Any())
{
var educationModel = eList.FirstOrDefault();
......@@ -4968,17 +4991,48 @@ namespace Mall.Module.Product
return false;
}
string cIds = string.Join(",", eList.Select(x => x.CouponId).Distinct());
deList = education_CouponRepository.GetDiscountCouponList(new RB_Education_Coupon_Extend() { CouponIds = cIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }, true);
edcpList = education_CouponProductRepository.GetListByDiscountCouponIds(new Model.Entity.Education.RB_Education_Coupon() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }, cIds, true);
deList = reserve_CouponRepository.GetDiscountCouponList(new RB_Reserve_Coupon_Extend()
{
CouponIds = cIds,
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
StoreId = demodel.StoresId,
}, true);
edcpList = reserve_CouponProductRepository.GetListByDiscountCouponIds(new RB_Reserve_Coupon_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }, cIds, true);
if (deList.Any())
{
foreach (var item in deList)
{
if (!string.IsNullOrWhiteSpace(item.StoreIds))
{
if (item.StoreIds != "0")
{
bool isGrantCoupon = false;
foreach (var itemStoreId in item.StoreIds.Split(","))
{
if (Convert.ToInt32(itemStoreId) > 0)
{
if (Convert.ToInt32(itemStoreId) == demodel.StoresId)
{
isGrantCoupon = true;
}
}
}
if (!isGrantCoupon)
{
message = "领取套餐卡不属于当前门店";
return false;
}
}
}
}
foreach (var item in eList)
{
if (item.CouponId > 0)
{
if (!deList.Where(x => x.ID == item.CouponId).Any())
{
message = "课程卡不存在,请核实后再试";
message = "套餐卡不存在,请核实后再试";
return false;
}
}
......@@ -5303,7 +5357,7 @@ namespace Mall.Module.Product
}
#endregion
#region 课程
#region 套餐
if (demodel.Use_Education_Id > 0)
{
var ccmodel = eList.Where(x => x.Id == demodel.Use_Education_Id).FirstOrDefault();
......@@ -5368,7 +5422,7 @@ namespace Mall.Module.Product
#endregion
TotalMoney += (item.Final_Price ?? 0);
item.OrderType = gmodel.GoodsType;
item.OrderType = OrderTypeEnum.OfflineService;
item.GoodsName = gmodel.Name;
item.CoverImage = "";
if (!string.IsNullOrEmpty(gmodel.CarouselImage) && gmodel.CarouselImage != "[]")
......@@ -5495,7 +5549,7 @@ namespace Mall.Module.Product
message = "套餐卡抵扣金额不正确";
return false;
}
if (CouponsMoney != demodel.CouponMoney)
if (CouponsMoney != (demodel?.CouponMoney??0))
{
message = "优惠金额计算有误";
return false;
......@@ -8500,12 +8554,20 @@ namespace Mall.Module.Product
{
QIds = persionIds
});
//查询订单详情对应的课程卡信息
string educationCouponIds = string.Join(",", dlist.Where(x => x.EducationCouponId > 0).Select(x => x.EducationCouponId).Distinct());
List<RB_Reserve_MemberCoupon_Extend> educationCouponList = new List<RB_Reserve_MemberCoupon_Extend>();
if (!string.IsNullOrWhiteSpace(educationCouponIds))
{
educationCouponList = reserveMemberCouponRepository.GetList(new RB_Reserve_MemberCoupon_Extend { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, Ids = educationCouponIds });
}
foreach (var item in dlist)
{
item.CoverImagePath = item.CoverImage;
item.GoodsSubName = GList.Where(x => x.Id == item.GoodsId).FirstOrDefault()?.SubName ?? "";
item.FinanceList = flist.Where(x => x.ECOrderDetailId == item.Id).ToList();// 2020-08-19 新增财务单据列表
item.ServicepersonalName = persionList?.Where(qitem => qitem.ID == item.ServicepersonalId)?.FirstOrDefault()?.Name ?? "";
item.ReserveCouponList = educationCouponList.Where(x => x.Id == item.EducationCouponId).ToList();// 2020-10-11 订单详情对应的课程卡
}
}
//2020-08-25 Add By:W Start
......@@ -12529,11 +12591,19 @@ namespace Mall.Module.Product
{
QIds = servicePersions
});
List<RB_Reserve_MemberCoupon_Extend> educationCouponList = new List<RB_Reserve_MemberCoupon_Extend>();
// 查询订单详情对应的套餐卡信息
string educationCouponIds = string.Join(",", dlist.Where(x => x.EducationCouponId > 0).Select(x => x.EducationCouponId).Distinct());
if (!string.IsNullOrWhiteSpace(educationCouponIds))
{
educationCouponList = reserveMemberCouponRepository.GetList(new RB_Reserve_MemberCoupon_Extend { TenantId = tenantId, MallBaseId = mallBaseId, Ids = educationCouponIds });
}
foreach (var item in dlist)
{
item.CoverImagePath = item.CoverImage;
item.IsBindExpress = erList.Where(x => x.OrderDetailId == item.Id).Any() ? 1 : 2;
item.ServicepersonalName = serviceList?.Where(qitem => qitem.ID == item.ServicepersonalId)?.FirstOrDefault()?.Name ?? "";
item.ReserveCouponList = educationCouponList.Where(x => x.Id == item.EducationCouponId).ToList();// 2020-10-11 订单详情对应的套餐卡
}
}
model.DetailList = dlist;
......@@ -12691,6 +12761,7 @@ namespace Mall.Module.Product
model.PreferPrice,
model.Income,
model.FreightMoney,
EducationMoney=(model?.EducationMoney??0),
CouponMoney = model.CouponMoney ?? 0,
IntegralMoney = (model.DetailList != null && model.DetailList.Any()) ? (model.DetailList.Sum(x => x.IntegralMoney ?? 0)) : 0,
IntegralNumber = (model.DetailList != null && model.DetailList.Any()) ? (model.DetailList.Sum(x => x.IntegralNumber ?? 0)) : 0,
......@@ -12796,6 +12867,12 @@ namespace Mall.Module.Product
x.ServiceTime,
x.ServiceDate,
x.ServicepersonalName,
MemberEducationCouponList = x?.ReserveCouponList.Select(z => new
{
z.Name,
z.UseHeXiao,
z.HeXiao
}),
}),
});
}
......
......@@ -24,6 +24,7 @@ using Mall.Repository.Finance;
using Mall.Repository.GuideCar;
using Mall.Repository.MarketingCenter;
using Mall.Repository.Product;
using Mall.Repository.Reserve;
using Mall.Repository.User;
using Mall.ThirdCore.Message;
using Microsoft.Extensions.Configuration;
......@@ -57,6 +58,24 @@ namespace Mall.Module.Product
/// </summary>
private RB_Education_MemberUseCouponRepository education_MemberUseCouponRepository = new RB_Education_MemberUseCouponRepository();
/// <summary>
/// 套餐卡
/// </summary>
private RB_Reserve_MemberCouponRepository reserve_MemberCouponRepository = new RB_Reserve_MemberCouponRepository();
/// <summary>
/// 套餐卡实体
/// </summary>
private RB_Reserve_CouponRepository reserve_CouponRepository = new RB_Reserve_CouponRepository();
/// <summary>
/// 套餐卡适配
/// </summary>
private RB_Reserve_CouponProductRepository reserve_CouponProductRepository = new RB_Reserve_CouponProductRepository();
/// <summary>
/// 套餐卡使用
/// </summary>
private RB_Reserve_MemberUseCouponRepository reserve_MemberUseCouponRepository = new RB_Reserve_MemberUseCouponRepository();
/// <summary>
......
......@@ -11,6 +11,7 @@ using Mall.Model.Entity.Product;
using Mall.Model.Entity.User;
using Mall.Model.Extend.BaseSetUp;
using Mall.Model.Extend.Product;
using Mall.Model.Extend.Reserve;
using Mall.Model.Extend.User;
using Mall.Model.Query;
using Mall.Repository;
......@@ -2648,7 +2649,7 @@ namespace Mall.Module.Product
/// <param name="MallBaseId"></param>
/// <param name="storeId">门店编号</param>
/// <returns></returns>
public object GetAppletOfflineGoodsInfoModule(int goodsId, int UserId, int SmallShopsId, int TenantId, int MallBaseId, int storeId = 0)
public object GetAppletOfflineGoodsInfoModule(int goodsId, int UserId, int SmallShopsId, int TenantId, int MallBaseId, int storeId = 0,int servicePersionId=0)
{
var model = goodsRepository.GetEntity(goodsId).RefMapperTo<RB_Goods_Extend>();
if (model == null || model.TenantId != TenantId || model.MallBaseId != MallBaseId)
......@@ -3538,8 +3539,12 @@ namespace Mall.Module.Product
{
categoryIds = string.Join(",", model.CategoryList.Select(qitem => qitem.CategoryId));
}
var servicePersionList = reserve_ServicePersonalRepository.GetServicePersonalListExtRepository(storeId,model.Id, categoryIds)?.ToList() ?? new List<Model.Extend.Reserve.RB_Reserve_ServicePersonal_Extend>();
//服务人员列表
var servicePersionList = new List<RB_Reserve_ServicePersonal_Extend>();
if (model.IsChooseServicePerson == 1)
{
servicePersionList= reserve_ServicePersonalRepository.GetServicePersonalListExtRepository(storeId, model.Id, categoryIds,servicePersionId)?.ToList() ?? new List<Model.Extend.Reserve.RB_Reserve_ServicePersonal_Extend>();
}
var storeModel = storesRepository.GetEntity(storeId);
List<StoreReserveDate> storeDateList = new List<StoreReserveDate>();
DateTime currentDay = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd"));
......
......@@ -91,6 +91,14 @@ namespace Mall.Repository.Reserve
{
builder.Append($" AND {nameof(RB_Reserve_Coupon_Extend.ID)} in({query.CouponIds})");
}
if (query.StoreId > 0)
{
builder.Append($" AND ( FIND_IN_SET('{query.StoreId}', {nameof(RB_Reserve_Coupon_Extend.StoreIds)}) or FIND_IN_SET('0', {nameof(RB_Reserve_Coupon_Extend.StoreIds)} )) ");
}
else
{
builder.Append($" AND FIND_IN_SET('0', {nameof(RB_Reserve_Coupon_Extend.StoreIds)})");
}
}
return Get<RB_Reserve_Coupon_Extend>(builder.ToString()).ToList();
}
......
......@@ -341,8 +341,9 @@ ORDER BY t.orderNum desc ";
/// <param name="storeId"></param>
/// <param name="productId"></param>
/// <param name="categoryIds"></param>
/// <param name="servicePersionId">服务人员Id</param>
/// <returns></returns>
public List<RB_Reserve_ServicePersonal_Extend> GetServicePersonalListExtRepository(int storeId, int productId, string categoryIds)
public List<RB_Reserve_ServicePersonal_Extend> GetServicePersonalListExtRepository(int storeId, int productId, string categoryIds,int servicePersionId=0)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
......@@ -365,6 +366,10 @@ LEFT JOIN
) AS orderTab ON A.ID=orderTab.OrderNum
WHERE A.Status=0 AND A.StoreId={2}
", productId, categoryIds, storeId);
if (servicePersionId > 0)
{
builder.AppendFormat(" AND A.ID={0} ", servicePersionId);
}
return Get<RB_Reserve_ServicePersonal_Extend>(builder.ToString()).ToList();
}
......
......@@ -423,13 +423,13 @@ namespace Mall.WebApi.Controllers.MallBase
JObject prams = JObject.Parse(req.msg.ToString());
int GoodsId = prams.GetInt("GoodsId", 0);
int StoreId = prams.GetInt("StoreId", 0);
int servicePersionId = prams.GetInt("servicePersionId", 0);
if (StoreId<=0 || GoodsId<=0)
{
return ApiResult.ParamIsNull(message:"请选择门店");
}
int UserId = req.UserId;
object Robj = productModule.GetAppletOfflineGoodsInfoModule(GoodsId, UserId, req.SmallShopsId, req.TenantId, req.MallBaseId, storeId: StoreId);
object Robj = productModule.GetAppletOfflineGoodsInfoModule(GoodsId, UserId, req.SmallShopsId, req.TenantId, req.MallBaseId, storeId: StoreId,servicePersionId:servicePersionId);
return ApiResult.Success("", Robj);
}
......
......@@ -710,7 +710,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
demodel.DeliveryMethod = Common.Enum.Goods.OrderDeliveryMethodEnum.VerificationShop;
if ((demodel.Income ?? 0) <= 0)
if ((demodel.Income ?? 0) < 0)
{
return ApiResult.ParamIsNull("订单金额不正确");
}
......
......@@ -1909,6 +1909,10 @@ namespace Mall.WebApi.Controllers.MallBase
CouponMoney = y.CouponMoney ?? 0,
InsuranceMoney = y.InsuranceMoney ?? 0,
InsuranceCostMoney = y.InsuranceCostMoney ?? 0,
MemberEducationCouponList = y.ReserveCouponList.Select(z => new
{
z.Name,
}),
SFinanceList = y.FinanceList.Where(z => z.Type == 1).Select(z => new
{
z.FrID,
......
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