fixed 完善后台优惠券接口 50%

This commit is contained in:
lwh 2023-07-25 12:52:05 +08:00
parent d8188a9ce1
commit c975350899
8 changed files with 78 additions and 52 deletions

View File

@ -54,6 +54,8 @@ namespace ARW.Model.Dto.Business.Marketing.CouponManage.Coupons
[Required(ErrorMessage = "排序不能为空")] [Required(ErrorMessage = "排序不能为空")]
public int CouponSort { get; set; } public int CouponSort { get; set; }
public string CouponApplicableScopeConfig { get; set; }
public string CouponGoodsIds { get; set; }

View File

@ -134,6 +134,15 @@ namespace ARW.Model.Models.Business.Marketing.CouponManage.Coupons
public string CouponApplicableScopeConfig { get; set; } public string CouponApplicableScopeConfig { get; set; }
/// <summary>
/// 描述 :适用范围(指定商品的Id集)
/// 空值 : true
/// </summary>
[EpplusTableColumn(Header = "适用范围(指定商品的Id集)")]
[SugarColumn(ColumnName = "coupon_goods_ids")]
public string CouponGoodsIds { get; set; }
/// <summary> /// <summary>
/// 描述 :发送数量(-1不限制) /// 描述 :发送数量(-1不限制)
/// 空值 : false /// 空值 : false

View File

@ -58,6 +58,11 @@ namespace ARW.Model.Vo.Business.GoodsManager.Goodss
[EpplusTableColumn(Header = "划线价格")] [EpplusTableColumn(Header = "划线价格")]
public decimal GoodsDashedPriceLowest { get; set; } public decimal GoodsDashedPriceLowest { get; set; }
/// <summary>
/// 库存总量
/// </summary>
public int GoodsTotalInventory { get; set; }
/// <summary> /// <summary>
/// 描述 :上下架状态(1上架 2下架) /// 描述 :上下架状态(1上架 2下架)

View File

@ -122,5 +122,12 @@ namespace ARW.Model.Vo.Business.Marketing.CouponManage.Coupons
[EpplusTableColumn(Header = "排序")] [EpplusTableColumn(Header = "排序")]
public int CouponSort { get; set; } public int CouponSort { get; set; }
[EpplusIgnore]
public string CouponApplicableScopeConfig { get; set; }
[EpplusIgnore]
public string CouponGoodsIdsArr { get; set; }
[EpplusIgnore]
public string[] CouponGoodsIds { get; set; }
} }
} }

View File

@ -217,6 +217,7 @@ namespace ARW.Service.Business.BusinessService.GoodsManager.Goodss
GoodsDashedPriceLowest = s.GoodsDashedPriceLowest, GoodsDashedPriceLowest = s.GoodsDashedPriceLowest,
GoodsShelfStatus = s.GoodsShelfStatus, GoodsShelfStatus = s.GoodsShelfStatus,
GoodsSort = s.GoodsSort, GoodsSort = s.GoodsSort,
GoodsTotalInventory = s.GoodsTotalInventory,
}); });

View File

@ -70,10 +70,19 @@ namespace ARW.Service.Business.BusinessService.Marketing.CouponManage.Coupons
CouponSendNumber = s.CouponSendNumber, CouponSendNumber = s.CouponSendNumber,
CouponDisplayStatus = s.CouponDisplayStatus, CouponDisplayStatus = s.CouponDisplayStatus,
CouponSort = s.CouponSort, CouponSort = s.CouponSort,
CouponApplicableScopeConfig = s.CouponApplicableScopeConfig,
CouponGoodsIdsArr = s.CouponGoodsIds
}); });
return await query.ToPageAsync(parm); var list = await query.ToPageAsync(parm);
//foreach (var item in list.Result)
//{
// item.CouponGoodsIds = item.CouponGoodsIdsArr.Split(',');
//}
return list;
} }
/// <summary> /// <summary>
@ -146,7 +155,8 @@ namespace ARW.Service.Business.BusinessService.Marketing.CouponManage.Coupons
return editStr; return editStr;
} }
} }
else{ else
{
// 开启事务 // 开启事务
var res = await UseTranAsync(async () => var res = await UseTranAsync(async () =>
{ {

View File

@ -97,14 +97,6 @@ namespace ARW.WebApi.Controllers.Business.GoodsManager.Goodss
[HttpGet("getAllGoodsList")] [HttpGet("getAllGoodsList")]
public async Task<IActionResult> GetAllGoodsList([FromQuery] GoodsQueryDto parm) public async Task<IActionResult> GetAllGoodsList([FromQuery] GoodsQueryDto parm)
{ {
var user = JwtUtil.GetLoginUser(App.HttpContext);
if (user.UserId != 1)
{
var shop = await _ShopService.GetFirstAsync(s => s.ShopUserId == user.UserId);
if (shop == null) throw new Exception("当前用户没有店铺");
parm.ShopGuid = shop.ShopGuid;
}
var res = await _GoodsService.GetAllGoodsList(parm); var res = await _GoodsService.GetAllGoodsList(parm);
return SUCCESS(res); return SUCCESS(res);
} }