Commit fedef7b8 authored by 吴春's avatar 吴春

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

parents 73606fb2 dffbc1a7
......@@ -1918,6 +1918,7 @@ namespace Mall.Module.Product
bool address_enable = true;//地址Ok
bool date_enable = true;//日期ok
string date_remark = "";//日期无法下单备注
int seat_number = 0;//座位数量
List<object> goods_list = new List<object>();
var guidebaseModel = guideCar_BaseRepository.GetList(new RB_GuideCar_Base_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
if (demodel.DetailList.Any())
......@@ -2007,11 +2008,15 @@ namespace Mall.Module.Product
//初始化值
foreach (var item in demodel.DetailList)
{
seat_number = item.Number ?? 0;
var gmodel = gList.Where(x => x.Id == item.GoodsId).FirstOrDefault();
if (gmodel == null || gmodel.GoodsStatus != 1 || gmodel.GoodsClassify != 1)
{
continue;
}
if (gmodel.CarType != GuideCarGoodsTypeEnum.Line) {
item.Number = 1;//s设置成一个人表示一口价 保险费算人头数
}
var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList();
#region 图片
......@@ -2404,7 +2409,7 @@ namespace Mall.Module.Product
date_remark = "出发日期不在可预定日期内,请重新选择出发日期";
}
var targetModel = targetList.FirstOrDefault();
if (targetModel == null || targetModel.ReserveNum + (item.Number ?? 0) > (gmodel.RideNum ?? 0))
if (targetModel == null || targetModel.ReserveNum + seat_number > (gmodel.RideNum ?? 0))
{
date_enable = false;
date_remark = "剩余座位数不足,请重新选择出发日期";
......@@ -2427,14 +2432,14 @@ namespace Mall.Module.Product
//保险
decimal qInsuranceMoney = (guidebaseModel?.SalePrice ?? 0);
decimal qInsuranceCostMoney = (guidebaseModel?.CostPrice ?? 0);
InsuranceMoney += qInsuranceMoney * (item.Number ?? 0);
InsuranceMoney += qInsuranceMoney * seat_number;
#endregion
goods_list.Add(new
{
id = gmodel.Id,
name = gmodel.Name,
categoryIdList = item.CategoryIdList,
num = item.Number,
num = seat_number,
surplus_num = (gmodel.RideNum ?? 0) - (targetModel?.ReserveNum ?? 0),
forehead_integral = gmodel.PointsDeduction,
forehead_integral_type = gmodel.PointsDeductionType,
......@@ -2468,7 +2473,7 @@ namespace Mall.Module.Product
id = x.Id,
pic_url = x.Path
}),
number = item.Number,
number = seat_number,
goods_share_level = DistributionCommissionList.Where(x => x.GoodsId == gmodel.Id).Select(x => new
{
share_commission_first = x.OneCommission,
......
......@@ -3842,6 +3842,7 @@ namespace Mall.Module.Product
List<RB_Goods_CouponModel> GoodsCouponList = new List<RB_Goods_CouponModel>();//商品优惠卷 价格(每个商品优惠的价格)
decimal CouponsMoney = 0;//优惠卷验证
decimal InsuranceMoney = 0;//保险金额
int seat_number = 0;//座位数量
#region 优惠卷初始化
List<RB_Member_DiscountCoupon_Extend> cList = new List<RB_Member_DiscountCoupon_Extend>();
List<Model.Extend.MarketingCenter.RB_DiscountCoupon_Extend> dcList = new List<Model.Extend.MarketingCenter.RB_DiscountCoupon_Extend>();
......@@ -3908,6 +3909,7 @@ namespace Mall.Module.Product
foreach (var item in demodel.DetailList)
{
seat_number = item.Number ?? 0;
var gmodel = gList.Where(x => x.Id == item.GoodsId).FirstOrDefault();
if (gmodel == null || gmodel.GoodsStatus != 1 || gmodel.GoodsClassify != 1)
{
......@@ -3917,6 +3919,9 @@ namespace Mall.Module.Product
{
return ApiResult.Failed("商品服务类型不一致");
}
if (gmodel.CarType != GuideCarGoodsTypeEnum.Line) {
item.Number = 1;//设置为单人 用于计算一口价
}
int uday = Convert.ToInt32((gmodel.UseDay ?? 0).Equals(Convert.ToDecimal(0.5)) ? 1 : (gmodel.UseDay ?? 0));
if (demodel.TripSTime.Value.AddDays(uday - 1).ToString("yyyy-MM-dd") != demodel.TripETime.Value.ToString("yyyy-MM-dd"))
{
......@@ -3952,7 +3957,7 @@ namespace Mall.Module.Product
if (gmodel.CarType == GuideCarGoodsTypeEnum.Line && gmodel.IsSpell == 1)
{
var targetModel = targetList.FirstOrDefault();
if ((gmodel.RideNum ?? 0) - (targetModel.ReserveNum) < (item.Number ?? 0))
if ((gmodel.RideNum ?? 0) - (targetModel.ReserveNum) < seat_number)
{
return ApiResult.Failed("商品剩余座位数不足,剩余:" + ((gmodel.RideNum ?? 0) - (targetModel.ReserveNum)));
}
......@@ -3966,7 +3971,7 @@ namespace Mall.Module.Product
return ApiResult.Failed(qitem.Date.Value.ToString("yyyy-MM-dd") + "已被预定,无法下单");
}
//验证座位数量
if ((gmodel.RideNum ?? 0) - (qitem.ReserveNum) < (item.Number ?? 0))
if ((gmodel.RideNum ?? 0) - (qitem.ReserveNum) < seat_number)
{
return ApiResult.Failed(qitem.Date.Value.ToString("yyyy-MM-dd") + "剩余座位数不足,剩余:" + ((gmodel.RideNum ?? 0) - (qitem.ReserveNum)));
}
......@@ -4334,8 +4339,8 @@ namespace Mall.Module.Product
}
item.FreightMoney = 0;
item.InsuranceMoney = (guidebaseModel?.SalePrice ?? 0) * (item.Number ?? 0);
item.InsuranceCostMoney = (guidebaseModel?.CostPrice ?? 0) * (item.Number ?? 0);
item.InsuranceMoney = (guidebaseModel?.SalePrice ?? 0) * seat_number;
item.InsuranceCostMoney = (guidebaseModel?.CostPrice ?? 0) * seat_number;
InsuranceMoney += (item.InsuranceMoney ?? 0);
item.CommentGiveIntegral = 0;
......@@ -4347,9 +4352,14 @@ namespace Mall.Module.Product
}
else
{
item.CommentGiveIntegral = Convert.ToInt32((gmodel.IntegralComment ?? 0) * (item.Number ?? 0));
item.CommentGiveIntegral = Convert.ToInt32((gmodel.IntegralComment ?? 0));
}
}
if (gmodel.CarType != GuideCarGoodsTypeEnum.Line)
{
item.Number = seat_number;
}
}
}
if (CouponsMoney != demodel.CouponMoney)
......
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