Commit 16effd7d authored by 黄奎's avatar 黄奎

下单管理

parent 4698553a
......@@ -354,5 +354,15 @@ namespace Mall.Model.Entity.Product
/// 服务人员的id
/// </summary>
public int? ServicepersonalId { get; set; }
/// <summary>
/// 服务日期
/// </summary>
public string ServiceDate { get; set; }
/// <summary>
/// 服务时间
/// </summary>
public string ServiceTime { get; set; }
}
}
......@@ -4684,7 +4684,13 @@ namespace Mall.Module.Product
}
int DefFreightId = 0;//默认运费id
GoodsIds = string.Join(",", demodel.DetailList.Select(x => x.GoodsId));
var gList = goodsRepository.GetList(new RB_Goods_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var gList = goodsRepository.GetList(new RB_Goods_Extend()
{
GoodsIds = GoodsIds,
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
GoodsClassify = 3
});
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var speciPList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
......@@ -4937,11 +4943,6 @@ namespace Mall.Module.Product
}
else
{
if (item.Number > gmodel.InventoryNum)
{
message = "商品库存不足:" + gmodel.Name;
return false;
}
item.SmallShopsCostPrice = gmodel.SellingPrice ?? 0;
if (demodel.SmallShopsId > 0)
{
......@@ -5153,7 +5154,6 @@ namespace Mall.Module.Product
#endregion
#region 优惠券
//decimal CouponsMoney = 0;
if (demodel.User_Coupon_Id > 0)
{
var ccmodel = cList.Where(x => x.Id == demodel.User_Coupon_Id).FirstOrDefault();
......@@ -5530,7 +5530,6 @@ namespace Mall.Module.Product
}
#endregion
item.FreightMoney = Express;
item.CommentGiveIntegral = 0;
if (gmodel.IntegralComment > 0)
{
......@@ -5564,26 +5563,26 @@ namespace Mall.Module.Product
demodel.PreferPrice = TotalMoney + CouponsMoney;
#region 手续费计算
decimal ServiceCharge = Convert.ToDecimal(Config.SettlementRate) / 100;
if (ServiceCharge > 0)
{
decimal TotalFee = Math.Round((demodel.Income ?? 0) * ServiceCharge, 2, MidpointRounding.AwayFromZero);
if (demodel.DetailList.Any())
{
int dcount = demodel.DetailList.Count();
decimal avgFee = Math.Round(TotalFee / dcount, 2, MidpointRounding.AwayFromZero);
foreach (var item in demodel.DetailList)
{
item.ServiceCharge = avgFee;
}
if (avgFee * dcount != TotalFee)
{
//多余的 直接算在第一个商品里
var detailmodel = demodel.DetailList.FirstOrDefault();
detailmodel.ServiceCharge += (TotalFee - avgFee * dcount);
}
}
}
//decimal ServiceCharge = Convert.ToDecimal(Config.SettlementRate) / 100;
//if (ServiceCharge > 0)
//{
// decimal TotalFee = Math.Round((demodel.Income ?? 0) * ServiceCharge, 2, MidpointRounding.AwayFromZero);
// if (demodel.DetailList.Any())
// {
// int dcount = demodel.DetailList.Count();
// decimal avgFee = Math.Round(TotalFee / dcount, 2, MidpointRounding.AwayFromZero);
// foreach (var item in demodel.DetailList)
// {
// item.ServiceCharge = avgFee;
// }
// if (avgFee * dcount != TotalFee)
// {
// //多余的 直接算在第一个商品里
// var detailmodel = demodel.DetailList.FirstOrDefault();
// detailmodel.ServiceCharge += (TotalFee - avgFee * dcount);
// }
// }
//}
#endregion
try
......@@ -7176,7 +7175,10 @@ namespace Mall.Module.Product
InsuranceCostMoney = item.InsuranceCostMoney ?? 0,
InsuranceFinanceId = 0,
CommentGiveIntegral = item.CommentGiveIntegral,
EducationCouponId = item.EducationCouponId
EducationCouponId = item.EducationCouponId,
ServiceDate = item.ServiceDate,
ServicepersonalId = item.ServicepersonalId,
ServiceTime = item.ServiceTime,
}, trans);
item.Id = detailId;
if (detailId > 0 && SatisfiedGoodsList.Any())
......
......@@ -3754,7 +3754,8 @@ namespace Mall.Module.Product
qitem.Name,
qitem.Major,
Gender = qitem.Gender.ToInt(),
ReserveCount=qitem.OrderNum
ReserveCount=qitem.OrderNum,
ServiceId=qitem.ID
}),
storeDateList= storeDateList.Select(qitem => new {qitem.DayDateStr,qitem.WeekDayStr,qitem.TimeList})
},
......
......@@ -722,8 +722,11 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.BuyerMessage ??= "";//买家留言
demodel.OrderSource ??= Common.Enum.User.UserSourceEnum.WeiXin;
#region 赋默认值
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
//demodel.TenantId = userInfo.TenantId;
//demodel.MallBaseId = userInfo.MallBaseId;
demodel.TenantId = 12;
demodel.MallBaseId =2;
demodel.Country ??= 2;
demodel.OrderStatus = Common.Enum.Goods.OrderStatusEnum.NonPayment;
demodel.CreateDate = DateTime.Now;
......@@ -744,7 +747,7 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.DestinationAddress ??= "";
#endregion
bool flag= orderModule.SetAppletOfflineGoodsOrderModule(demodel,out string message);
return flag ? ApiResult.Success(message: message) : ApiResult.Failed(message: message);
return flag ? ApiResult.Success(message: message,data: new { demodel.OrderId }) : ApiResult.Failed(message: message);
}
/// <summary>
......
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