Commit c5112361 authored by liudong1993's avatar liudong1993

商品结算

parent 5fccf7ad
......@@ -308,5 +308,17 @@ namespace Mall.Model.Entity.Product
/// 微店id
/// </summary>
public int? SmallShopsId { get; set; }
/// <summary>
/// 司导服务类型
/// </summary>
public GuideCarGoodsTypeEnum? CarType { get; set; }
/// <summary>
/// 司导预约开始时间
/// </summary>
public DateTime? TripSTime { get; set; }
/// <summary>
/// 司导预约结束时间
/// </summary>
public DateTime? TripETime { get; set; }
}
}
......@@ -19,5 +19,9 @@ namespace Mall.Model.Extend.Product
/// 商品ids
/// </summary>
public string GoodsIds { get; set; }
/// <summary>
/// 日期
/// </summary>
public string DateTime { get; set; }
}
}
......@@ -1623,20 +1623,24 @@ namespace Mall.Module.Product
#region 司导商品
string SiteName = SiteRepository.GetGuideCarSiteList(new RB_GuideCar_Site_Extend() { ID = model.SiteId ?? 0 }).FirstOrDefault()?.SiteName ?? "";
string GuideName = GuideRepository.GetGuideCarGuideList(new RB_GuideCar_Guide_Extend() { ID = model.GuideId ?? 0 }).FirstOrDefault()?.Name ?? "";
string CarName = GuideCarRepository.GetGuideCarCarList(new RB_GuideCar_Car_Extend() { ID = model.GuideId ?? 0 }).FirstOrDefault()?.Name ?? "";
var guideModel = GuideRepository.GetGuideCarGuideList(new RB_GuideCar_Guide_Extend() { ID = model.GuideId ?? 0 }).FirstOrDefault();
string GuideName = guideModel?.Name ?? "";
var carModel = GuideCarRepository.GetGuideCarCarList(new RB_GuideCar_Car_Extend() { ID = model.GuideId ?? 0 }).FirstOrDefault();
string CarName = carModel?.Name ?? "";
string CarColorName = CarColorRepository.GetCarColorList(new RB_GuideCar_CarColor_Extend() { ID = model.CarColorId ?? 0 }).FirstOrDefault()?.ColorName ?? "";
decimal GuideScore = guideModel?.Score ?? 5;
decimal CarScore = carModel?.Score ?? 5;
model.LineDescriptionList = new List<string>();
if (!string.IsNullOrEmpty(model.LineDescription) && model.LineDescription != "[]")
{
model.LineDescriptionList = JsonConvert.DeserializeObject<List<string>>(model.LineDescription);
}
var targetList = goods_TargetDateRepository.GetList(new RB_Goods_TargetDate_Extend() { GoodsId = goodsId });
if (model.AdvanceDay > 0) {
DateTime Mindate = Convert.ToDateTime(DateTime.Now.AddDays(model.AdvanceDay ?? 0).ToString("yyyy-MM-dd"));
targetList = targetList.Where(x => x.Date >= Mindate).ToList();
}
//var targetList = goods_TargetDateRepository.GetList(new RB_Goods_TargetDate_Extend() { GoodsId = goodsId });
//if (model.AdvanceDay > 0) {
// DateTime Mindate = Convert.ToDateTime(DateTime.Now.AddDays(model.AdvanceDay ?? 0).ToString("yyyy-MM-dd"));
// targetList = targetList.Where(x => x.Date >= Mindate).ToList();
//}
#endregion
#region 返回参数
......@@ -1668,8 +1672,10 @@ namespace Mall.Module.Product
site_id = model.SiteId,
guide_name = GuideName,
guide_id = model.GuideId,
guide_score = GuideScore,
car_name = CarName,
car_id = model.CarId,
car_score = CarScore,
carcolor_name = CarColorName,
carcolor_id = model.CarColorId,
car_number = model.CarNumber,
......@@ -1681,12 +1687,12 @@ namespace Mall.Module.Product
line_descriptionlist = model.LineDescriptionList,
is_spell = model.IsSpell,
ride_num = model.RideNum,
target_list = targetList.Select(x=>new {
x.Id,
Date = x.Date.Value.ToString("yyyy-MM-dd"),
x.IsReserve,
x.ReserveNum
}),
//target_list = targetList.Select(x=>new {
// x.Id,
// Date = x.Date.Value.ToString("yyyy-MM-dd"),
// x.IsReserve,
// x.ReserveNum
//}),
advance_day = model.AdvanceDay,
give_integral = model.IntegralPresent,
give_integral_type = model.IntegralPresentType,
......@@ -1803,6 +1809,7 @@ namespace Mall.Module.Product
decimal CouponsMoney = 0;//优惠总金额
bool IsPointsDeduction = false;//是否有商品可使用积分抵扣
bool address_enable = true;//地址Ok
bool date_enable = true;//日期ok
List<object> goods_list = new List<object>();
if (demodel.DetailList.Any())
{
......@@ -2278,10 +2285,20 @@ namespace Mall.Module.Product
#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 ?? 0;
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") });
if (gmodel.AdvanceDay > 0)
{
DateTime Mindate = Convert.ToDateTime(DateTime.Now.AddDays(gmodel.AdvanceDay ?? 0).ToString("yyyy-MM-dd"));
targetList = targetList.Where(x => x.Date >= Mindate).ToList();
}
if (!targetList.Any()) {
date_enable = false;
}
#endregion
goods_list.Add(new
{
......@@ -2293,6 +2310,7 @@ namespace Mall.Module.Product
forehead_integral_type = gmodel.PointsDeductionType,
accumulative = gmodel.IsMultipleDeduction,//累计多件抵扣
address_disabled,
date_enable,
unit_price = item.Unit_Price,
total_original_price = (item.Original_Price ?? 0) * (item.Number ?? 0),
total_price = (item.Unit_Price ?? 0) * (item.Number ?? 0),//优惠券(有平摊情况) 积分抵扣 (默认从第一个商品抵扣)
......@@ -2301,7 +2319,6 @@ namespace Mall.Module.Product
id = 0,
goods_id = gmodel.Id,
sign_id = item.SpecificationSort,
stock = gmodel.InventoryNum,
price = item.Unit_Price ?? 0,
original_price = item.Original_Price ?? 0,
pic_url = gmodel.CoverImage,
......@@ -2332,8 +2349,10 @@ namespace Mall.Module.Product
site_id = gmodel.SiteId,
guide_name = GuideName,
guide_id = gmodel.GuideId,
guide_score = GuideScore,
car_name = CarName,
car_id = gmodel.CarId,
car_score = CarScore,
carcolor_name = CarColorName,
carcolor_id = gmodel.CarColorId,
car_number = gmodel.CarNumber,
......@@ -2428,7 +2447,7 @@ namespace Mall.Module.Product
mch_list,
promptNoSuperiorFY = PromptNoSuperiorFY,
total_price = TotalGoodsMoney,
price_enable = true,
date_enable,
address = new
{
demodel.District,
......
......@@ -76,11 +76,11 @@ namespace Mall.Repository.GuideCar
{
if (query.ID > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_Car_Extend.ID)}={query.ID}");
builder.Append($" AND a.{nameof(RB_GuideCar_Car_Extend.ID)}={query.ID}");
}
if (!string.IsNullOrEmpty(query.GuideCarIds))
{
builder.Append($" AND {nameof(RB_GuideCar_Car_Extend.ID)} in({query.GuideCarIds})");
builder.Append($" AND a.{nameof(RB_GuideCar_Car_Extend.ID)} in({query.GuideCarIds})");
}
if (query.TenantId > 0)
{
......
......@@ -31,6 +31,12 @@ namespace Mall.Repository.Product
if (!string.IsNullOrEmpty(dmodel.GoodsIds)) {
where += $@" and {nameof(RB_Goods_TargetDate.GoodsId)} in({dmodel.GoodsIds})";
}
if (!string.IsNullOrEmpty(dmodel.DateTime)) {
where += $@" and {nameof(RB_Goods_TargetDate.Date)} ='{dmodel.DateTime}'";
}
if (dmodel.IsReserve > 0) {
where += $@" and {nameof(RB_Goods_TargetDate.IsReserve)}={dmodel.IsReserve}";
}
string sql = $@"select * from RB_Goods_TargetDate where {where} order by Date asc";
return Get<RB_Goods_TargetDate_Extend>(sql).ToList();
......
......@@ -53,12 +53,33 @@ namespace Mall.WebApi.Controllers.Product
return ApiResult.ParamIsNull("请传递商品数量");
}
}
if (!demodel.TripSTime.HasValue) {
return ApiResult.ParamIsNull("请传递预约起始时间");
}
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.UserId = userInfo.UserId;
demodel.SmallShopsId = req.SmallShopsId;
return guideCarModule.GetAppletSDGoodsSettlementInfo(demodel);
}
/// <summary>
/// 获取商品可预约日期列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppletSDGoodsTargetDateList() {
var req = RequestParm;
var userInfo = AppletUserInfo;
JObject parms = JObject.Parse(req.msg.ToString());
int GoodsId = parms.GetInt("GoodsId", 0);
string Month = parms.GetStringValue("Month");
if (GoodsId <= 0) {
return ApiResult.ParamIsNull("请传递商品id");
}
return ApiResult.Success();
}
#endregion
}
......
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