Commit fca629f7 authored by liudong1993's avatar liudong1993

保险

parent c72a3433
...@@ -326,5 +326,13 @@ namespace Mall.Model.Entity.Product ...@@ -326,5 +326,13 @@ namespace Mall.Model.Entity.Product
/// 线路名称 /// 线路名称
/// </summary> /// </summary>
public string LineName { get; set; } public string LineName { get; set; }
/// <summary>
/// 保险价格
/// </summary>
public decimal? InsuranceMoney { get; set; }
/// <summary>
/// 保险成本价格
/// </summary>
public decimal? InsuranceCostMoney { get; set; }
} }
} }
...@@ -1828,10 +1828,12 @@ namespace Mall.Module.Product ...@@ -1828,10 +1828,12 @@ namespace Mall.Module.Product
decimal Total_integral_price = 0;//总积分金额 decimal Total_integral_price = 0;//总积分金额
int Total_use_integral = 0;//总积分 int Total_use_integral = 0;//总积分
decimal CouponsMoney = 0;//优惠总金额 decimal CouponsMoney = 0;//优惠总金额
decimal InsuranceMoney = 0;//保险金额
bool IsPointsDeduction = false;//是否有商品可使用积分抵扣 bool IsPointsDeduction = false;//是否有商品可使用积分抵扣
bool address_enable = true;//地址Ok bool address_enable = true;//地址Ok
bool date_enable = true;//日期ok bool date_enable = true;//日期ok
List<object> goods_list = new List<object>(); 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()) if (demodel.DetailList.Any())
{ {
string GoodsIds = string.Join(",", demodel.DetailList.Select(x => x.GoodsId)); string GoodsIds = string.Join(",", demodel.DetailList.Select(x => x.GoodsId));
...@@ -2304,12 +2306,6 @@ namespace Mall.Module.Product ...@@ -2304,12 +2306,6 @@ namespace Mall.Module.Product
} }
#region 司导信息 #region 司导信息
//string SiteName = sitelist.Where(x => x.ID == gmodel.SiteId).FirstOrDefault()?.SiteName ?? "";
//string GuideName = guidelist.Where(x => x.ID == gmodel.GuideId).FirstOrDefault()?.Name ?? "";
//decimal GuideScore = guidelist.Where(x => x.ID == gmodel.GuideId).FirstOrDefault()?.Score ?? 5;
//string CarName = carlist.Where(x => x.ID == gmodel.CarId).FirstOrDefault()?.Name ?? "";
//decimal CarScore = carlist.Where(x => x.ID == gmodel.CarId).FirstOrDefault()?.Score ?? 5;
//string CarColorName = carcolorlist.Where(x => x.ID == gmodel.CarColorId).FirstOrDefault()?.ColorName ?? "";
var targetList = goods_TargetDateRepository.GetList(new RB_Goods_TargetDate_Extend() { GoodsId = gmodel.Id, IsReserve = 1, DateTime = demodel.TripSTime.Value.ToString("yyyy-MM-dd") }); var targetList = goods_TargetDateRepository.GetList(new RB_Goods_TargetDate_Extend() { GoodsId = gmodel.Id, IsReserve = 1, DateTime = demodel.TripSTime.Value.ToString("yyyy-MM-dd") });
if (gmodel.AdvanceDay > 0) if (gmodel.AdvanceDay > 0)
{ {
...@@ -2339,6 +2335,10 @@ namespace Mall.Module.Product ...@@ -2339,6 +2335,10 @@ namespace Mall.Module.Product
decimal CarScore = carModel?.Score ?? 5; decimal CarScore = carModel?.Score ?? 5;
string CarModel = carModel?.CarType ?? ""; string CarModel = carModel?.CarType ?? "";
//保险
decimal qInsuranceMoney = guidebaseModel?.SalePrice ?? 0;
decimal qInsuranceCostMoney = guidebaseModel?.CostPrice ?? 0;
InsuranceMoney += qInsuranceMoney;
#endregion #endregion
goods_list.Add(new goods_list.Add(new
{ {
...@@ -2369,6 +2369,8 @@ namespace Mall.Module.Product ...@@ -2369,6 +2369,8 @@ namespace Mall.Module.Product
integral_price = demodel.Use_Integral == 1 ? item.IntegralMoney : 0,//积分抵扣金额 integral_price = demodel.Use_Integral == 1 ? item.IntegralMoney : 0,//积分抵扣金额
use_integral = demodel.Use_Integral == 1 ? item.IntegralNumber : 0, use_integral = demodel.Use_Integral == 1 ? item.IntegralNumber : 0,
couponMoney, couponMoney,
insurance_money = qInsuranceMoney,
insurance_costmoney = qInsuranceCostMoney,
name = gmodel.Name, name = gmodel.Name,
cover_pic = gmodel.CoverImage, cover_pic = gmodel.CoverImage,
detail = gmodel.GoodsDetails, detail = gmodel.GoodsDetails,
...@@ -2467,7 +2469,8 @@ namespace Mall.Module.Product ...@@ -2467,7 +2469,8 @@ namespace Mall.Module.Product
user_coupon_id = demodel.User_Coupon_Id ?? 0 user_coupon_id = demodel.User_Coupon_Id ?? 0
}, },
integral = IntegralObj, integral = IntegralObj,
total_price = TotalGoodsMoney, insurance_money = InsuranceMoney,
total_price = TotalGoodsMoney + InsuranceMoney,
}); });
//订阅 //订阅
...@@ -2491,8 +2494,9 @@ namespace Mall.Module.Product ...@@ -2491,8 +2494,9 @@ namespace Mall.Module.Product
{ {
mch_list, mch_list,
promptNoSuperiorFY = PromptNoSuperiorFY, promptNoSuperiorFY = PromptNoSuperiorFY,
total_price = TotalGoodsMoney, total_price = TotalGoodsMoney + InsuranceMoney,
date_enable, date_enable,
insurance_description = guidebaseModel?.InsuranceDescription,
address = new address = new
{ {
demodel.District, demodel.District,
......
...@@ -3786,6 +3786,7 @@ namespace Mall.Module.Product ...@@ -3786,6 +3786,7 @@ namespace Mall.Module.Product
decimal TotalIntegralMoney = 0;//总使用积分抵扣金额 decimal TotalIntegralMoney = 0;//总使用积分抵扣金额
List<RB_Goods_CouponModel> GoodsCouponList = new List<RB_Goods_CouponModel>();//商品优惠卷 价格(每个商品优惠的价格) List<RB_Goods_CouponModel> GoodsCouponList = new List<RB_Goods_CouponModel>();//商品优惠卷 价格(每个商品优惠的价格)
decimal CouponsMoney = 0;//优惠卷验证 decimal CouponsMoney = 0;//优惠卷验证
decimal InsuranceMoney = 0;//保险金额
#region 优惠卷初始化 #region 优惠卷初始化
List<RB_Member_DiscountCoupon_Extend> cList = new List<RB_Member_DiscountCoupon_Extend>(); 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>(); List<Model.Extend.MarketingCenter.RB_DiscountCoupon_Extend> dcList = new List<Model.Extend.MarketingCenter.RB_DiscountCoupon_Extend>();
...@@ -3838,6 +3839,7 @@ namespace Mall.Module.Product ...@@ -3838,6 +3839,7 @@ namespace Mall.Module.Product
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var mpriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var mpriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var mallbaseModel = mallBaseRepository.GetListRepository(new Model.Extend.BaseSetUp.RB_MallBase_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault(); var mallbaseModel = mallBaseRepository.GetListRepository(new Model.Extend.BaseSetUp.RB_MallBase_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
var guidebaseModel = guideCar_BaseRepository.GetList(new Model.Extend.GuideCar.RB_GuideCar_Base_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
#region 微店价格 #region 微店价格
RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend(); RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend();
...@@ -4276,6 +4278,9 @@ namespace Mall.Module.Product ...@@ -4276,6 +4278,9 @@ namespace Mall.Module.Product
} }
item.FreightMoney = 0; item.FreightMoney = 0;
item.InsuranceMoney = guidebaseModel?.SalePrice ?? 0;
item.InsuranceCostMoney = guidebaseModel?.CostPrice ?? 0;
InsuranceMoney += (item.InsuranceMoney ?? 0);
} }
} }
if (CouponsMoney != demodel.CouponMoney) if (CouponsMoney != demodel.CouponMoney)
...@@ -4283,11 +4288,11 @@ namespace Mall.Module.Product ...@@ -4283,11 +4288,11 @@ namespace Mall.Module.Product
return ApiResult.Failed("优惠金额计算有误"); return ApiResult.Failed("优惠金额计算有误");
} }
//验证总额 //验证总额
if (demodel.Income != TotalMoney) if (demodel.Income != TotalMoney + InsuranceMoney)
{ {
return ApiResult.Failed("订单合计金额不正确"); return ApiResult.Failed("订单合计金额不正确");
} }
demodel.PreferPrice = TotalMoney + CouponsMoney; demodel.PreferPrice = TotalMoney + CouponsMoney + InsuranceMoney;
#region 手续费计算 #region 手续费计算
decimal ServiceCharge = Convert.ToDecimal(Config.SettlementRate) / 100; decimal ServiceCharge = Convert.ToDecimal(Config.SettlementRate) / 100;
...@@ -5868,7 +5873,9 @@ namespace Mall.Module.Product ...@@ -5868,7 +5873,9 @@ namespace Mall.Module.Product
IsSpell = item.IsSpell, IsSpell = item.IsSpell,
TripETime = item.TripETime, TripETime = item.TripETime,
TripSTime = item.TripSTime, TripSTime = item.TripSTime,
UseDay = item.UseDay UseDay = item.UseDay,
InsuranceMoney = item.InsuranceMoney,
InsuranceCostMoney = item.InsuranceCostMoney
}, trans); }, trans);
item.Id = detailId; item.Id = detailId;
if (detailId > 0 && SatisfiedGoodsList.Any()) if (detailId > 0 && SatisfiedGoodsList.Any())
......
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