Commit 7a6ccd88 authored by liudong1993's avatar liudong1993

小程序下单

parent 2ab772a8
......@@ -268,6 +268,14 @@ namespace Mall.Model.Entity.Product
/// </summary>
public DateTime? ReceivingTime { get; set; }
/// <summary>
/// 完成时间
/// </summary>
public DateTime? FinishTime { get; set; }
/// <summary>
/// 取消时间
/// </summary>
public DateTime? CancelTime { get; set; }
/// <summary>
/// 是否申请取消订单 1是 2否
/// </summary>
public int? IsApplyForCancel { get; set; }
......
......@@ -27,6 +27,10 @@ namespace Mall.Model.Extend.MarketingCenter
/// 发放数量
/// </summary>
public int GrantNum { get; set; }
/// <summary>
/// 优惠卷ids
/// </summary>
public string CouponIds { get; set; }
/// <summary>
/// 会员等级
......
......@@ -29,5 +29,29 @@ namespace Mall.Model.Extend.Product
/// 是否已发货
/// </summary>
public int? IsBindExpress { get; set; }
/// <summary>
/// 商品分类ids
/// </summary>
public List<int> CategoryIdList { get; set; }
/// <summary>
/// 剩余库存
/// </summary>
public int InventoryNum { get; set; }
/// <summary>
/// 规格价格列表id
/// </summary>
public int SpeciPriceId { get; set; }
/// <summary>
/// 是否开启单独返佣 1是 2否
/// </summary>
public int? SeparateDistribution { get; set; }
/// <summary>
/// 分销类型 1普通 2详细
/// </summary>
public int? SeparateDistributionType { get; set; }
/// <summary>
/// 分销佣金类型 1百分比 2固定值
/// </summary>
public int? SeparateDistributionMoneyType { get; set; }
}
}
......@@ -13,10 +13,11 @@ namespace Mall.Model.Extend.Product
[DB(ConnectionName = "DefaultConnection")]
public class RB_Goods_Order_Extend : RB_Goods_Order
{
public int? IsFormShoppingCart { get; set; }
/// <summary>
/// 收货地址id
/// </summary>
public int? ShippingAddressId { get; set; }
public int? ShoppingAddressId { get; set; }
/// <summary>
/// 商品id
/// </summary>
......
......@@ -53,5 +53,9 @@ namespace Mall.Model.Extend.User
/// 下单结束时间
/// </summary>
public DateTime? EndDate { get; set; }
/// <summary>
/// 优惠卷ids
/// </summary>
public string CouponIds { get; set; }
}
}
This diff is collapsed.
......@@ -71,6 +71,10 @@ namespace Mall.Repository.MarketingCenter
{
builder.Append($" AND {nameof(RB_DiscountCoupon_Extend.Name)} like '%{query.Name}%'");
}
if (!string.IsNullOrEmpty(query.CouponIds))
{
builder.Append($" AND {nameof(RB_DiscountCoupon_Extend.ID)} in({query.CouponIds})");
}
}
return Get<RB_DiscountCoupon_Extend>(builder.ToString()).ToList();
}
......
......@@ -273,5 +273,29 @@ inner join rb_goods_category c on g.Id=c.GoodsId
where {where} group by g.Id order by col.Id desc";
return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
public List<RB_Goods_Extend> GetGoodsInventoryNumList(RB_Goods_Extend dmodel)
{
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
}
if (dmodel.GoodsStatus > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.GoodsStatus)}={dmodel.GoodsStatus}";
}
string sql = $@"select g.Id,g. from RB_Goods g where {where} group by g.Id asc";
return Get<RB_Goods_Extend>(sql).ToList();
}
}
}
......@@ -30,6 +30,44 @@ namespace Mall.Repository.User
/// </summary>
public string OrderTableName { get { return nameof(RB_Goods_Order); } }
/// <summary>
/// 会员优惠券
/// </summary>
/// <returns></returns>
public List<RB_Member_DiscountCoupon_Extend> GetList(RB_Member_DiscountCoupon_Extend query)
{
StringBuilder builder = new StringBuilder();
if (query != null)
{
if (query.TenantId > 0)
{
builder.Append($" AND a.{nameof(RB_Member_DiscountCoupon_Extend.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
{
builder.Append($" AND a.{nameof(RB_Member_DiscountCoupon_Extend.MallBaseId)}={query.MallBaseId}");
}
if (query.PlatformType > 0)
{
builder.Append($" AND a.{nameof(RB_Member_DiscountCoupon_Extend.PlatformType)}={query.PlatformType}");
}
if (query.UserId > 0)
{
builder.Append($" AND a.{nameof(RB_Member_DiscountCoupon_Extend.UserId)}={query.UserId}");
}
if (query.CouponId > 0) {
builder.Append($" AND a.{nameof(RB_Member_DiscountCoupon_Extend.CouponId)}={query.CouponId}");
}
if (!string.IsNullOrEmpty(query.CouponIds)) {
builder.Append($" AND a.{nameof(RB_Member_DiscountCoupon_Extend.CouponId)} in ({query.CouponIds})");
}
if (query.UseState >= 0) {
builder.Append($" AND a.{nameof(RB_Member_DiscountCoupon_Extend.UseState)}={query.UseState}");
}
}
string sql = @$" select * FROM {TableName} AS a where 1=1 {builder.ToString()} ";
return Get<RB_Member_DiscountCoupon_Extend>(sql).ToList();
}
/// <summary>
/// 会员优惠券
......
......@@ -191,7 +191,7 @@ namespace Mall.WebApi.Controllers.MallBase
var req = RequestParm;
var userInfo = AppletUserInfo;
RB_Goods_Order_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Order_Extend>(req.msg.ToString());
if ((demodel.ShippingAddressId ?? 0) <= 0) {
if ((demodel.ShoppingAddressId ?? 0) <= 0) {
return ApiResult.ParamIsNull("请传递收货地址id");
}
if (demodel.DetailList == null || !demodel.DetailList.Any())
......@@ -258,6 +258,9 @@ namespace Mall.WebApi.Controllers.MallBase
if ((item.Number ?? 0) <= 0) {
return ApiResult.ParamIsNull("请传递商品数量");
}
if (string.IsNullOrEmpty(item.Specification)) {
return ApiResult.ParamIsNull("请传递规格名");
}
}
demodel.BuyerMessage ??= "";//买家留言
......
......@@ -84,6 +84,7 @@ namespace Mall.WebApi.Controllers.MallBase
PaymentTime = x.PaymentTime.HasValue ? x.PaymentTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
DeliveryTime = x.DeliveryTime.HasValue ? x.DeliveryTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
ReceivingTime = x.ReceivingTime.HasValue ? x.ReceivingTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
FinishTime = x.FinishTime.HasValue ? x.FinishTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
x.Country,
x.Province,
x.City,
......@@ -343,7 +344,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
var omodel = orderModule.GetOrderInfo(demodel.OrderId ?? 0);
if (omodel.OrderStatus != OrderStatusEnum.WaitSendGoods) {
if (omodel.OrderStatus != OrderStatusEnum.WaitSendGoods && omodel.OrderStatus != OrderStatusEnum.WaitReceiving) {
return ApiResult.ParamIsNull("状态不对");
}
......
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