fixed 完善后台优惠券接口 50%
This commit is contained in:
parent
d8188a9ce1
commit
c975350899
@ -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; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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下架)
|
||||||
|
@ -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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ namespace ARW.Service.Business.BusinessService.Marketing.CouponManage.Coupons
|
|||||||
var query = _CouponRepository
|
var query = _CouponRepository
|
||||||
.Queryable()
|
.Queryable()
|
||||||
.Where(predicate.ToExpression())
|
.Where(predicate.ToExpression())
|
||||||
.OrderBy(s => s.CouponSort,OrderByType.Asc)
|
.OrderBy(s => s.CouponSort, OrderByType.Asc)
|
||||||
.Select(s => new CouponVo
|
.Select(s => new CouponVo
|
||||||
{
|
{
|
||||||
CouponId = s.CouponId,
|
CouponId = s.CouponId,
|
||||||
@ -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>
|
||||||
@ -107,7 +116,7 @@ namespace ARW.Service.Business.BusinessService.Marketing.CouponManage.Coupons
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Excel导入
|
/// Excel导入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task<string> ImportExcel(Coupon Coupon,int index,bool isUpdateSupport,string user)
|
public async Task<string> ImportExcel(Coupon Coupon, int index, bool isUpdateSupport, string user)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -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 () =>
|
||||||
{
|
{
|
||||||
@ -179,7 +189,7 @@ namespace ARW.Service.Business.BusinessService.Marketing.CouponManage.Coupons
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ namespace ARW.WebApi.Controllers.Business.Marketing.CouponManage.Coupons
|
|||||||
[HttpPost("importData")]
|
[HttpPost("importData")]
|
||||||
[Log(Title = "优惠券导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = false)]
|
[Log(Title = "优惠券导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = false)]
|
||||||
[ActionPermissionFilter(Permission = "business:coupon:import")]
|
[ActionPermissionFilter(Permission = "business:coupon:import")]
|
||||||
public async Task<IActionResult> ImportExcel([FromForm(Name = "file")] IFormFile formFile,bool updateSupport)
|
public async Task<IActionResult> ImportExcel([FromForm(Name = "file")] IFormFile formFile, bool updateSupport)
|
||||||
{
|
{
|
||||||
var isUpdateSupport = updateSupport;
|
var isUpdateSupport = updateSupport;
|
||||||
IEnumerable<CouponVo> parm = ExcelHelper<CouponVo>.ImportData(formFile.OpenReadStream());
|
IEnumerable<CouponVo> parm = ExcelHelper<CouponVo>.ImportData(formFile.OpenReadStream());
|
||||||
@ -111,7 +111,7 @@ namespace ARW.WebApi.Controllers.Business.Marketing.CouponManage.Coupons
|
|||||||
var Coupon = await _CouponService.HandleImportData(item);
|
var Coupon = await _CouponService.HandleImportData(item);
|
||||||
var modal = Coupon.Adapt<Coupon>().ToCreate(HttpContext);
|
var modal = Coupon.Adapt<Coupon>().ToCreate(HttpContext);
|
||||||
var user = JwtUtil.GetLoginUser(App.HttpContext).UserName;
|
var user = JwtUtil.GetLoginUser(App.HttpContext).UserName;
|
||||||
var msg = await _CouponService.ImportExcel(modal,i,isUpdateSupport,user);
|
var msg = await _CouponService.ImportExcel(modal, i, isUpdateSupport, user);
|
||||||
msgList.Add(msg);
|
msgList.Add(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user