|
@@ -100,18 +100,20 @@ public class GoodsSellerController extends BaseController {
|
|
@ApiImplicitParam(name = "isVirtualGoods", value = "是否是虚拟商品:1-实物商品;2-虚拟商品", paramType = "query"),
|
|
@ApiImplicitParam(name = "isVirtualGoods", value = "是否是虚拟商品:1-实物商品;2-虚拟商品", paramType = "query"),
|
|
@ApiImplicitParam(name = "goodsCode", value = "商品货号", paramType = "query"),
|
|
@ApiImplicitParam(name = "goodsCode", value = "商品货号", paramType = "query"),
|
|
@ApiImplicitParam(name = "barCode", value = "商品条形码", paramType = "query"),
|
|
@ApiImplicitParam(name = "barCode", value = "商品条形码", paramType = "query"),
|
|
|
|
+ @ApiImplicitParam(name = "distributionChannel", value = "发布渠道", paramType = "query"),
|
|
@ApiImplicitParam(name = "pageSize", value = "分页大小", defaultValue = "20", paramType = "query"),
|
|
@ApiImplicitParam(name = "pageSize", value = "分页大小", defaultValue = "20", paramType = "query"),
|
|
@ApiImplicitParam(name = "current", value = "当前页面位置", defaultValue = "1", paramType = "query")
|
|
@ApiImplicitParam(name = "current", value = "当前页面位置", defaultValue = "1", paramType = "query")
|
|
})
|
|
})
|
|
@GetMapping("list")
|
|
@GetMapping("list")
|
|
public JsonResult<PageVO<GoodsVO>> getList(HttpServletRequest request, String goodsName, Integer StoreCategoryId,
|
|
public JsonResult<PageVO<GoodsVO>> getList(HttpServletRequest request, String goodsName, Integer StoreCategoryId,
|
|
Date startTime, Date endTime, Integer state, Integer auditState,
|
|
Date startTime, Date endTime, Integer state, Integer auditState,
|
|
- Integer isVirtualGoods, String goodsCode, String barCode) {
|
|
|
|
|
|
+ Integer isVirtualGoods, String goodsCode, String barCode,@RequestParam(value = "distributionChannel", required = false, defaultValue = "1") Integer distributionChannel) {
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
PagerInfo pager = WebUtil.handlerPagerInfo(request);
|
|
PagerInfo pager = WebUtil.handlerPagerInfo(request);
|
|
GoodsExample example = new GoodsExample();
|
|
GoodsExample example = new GoodsExample();
|
|
example.setStoreId(vendor.getStoreId());
|
|
example.setStoreId(vendor.getStoreId());
|
|
example.setGoodsNameLike(goodsName);
|
|
example.setGoodsNameLike(goodsName);
|
|
|
|
+ example.setDistributionChannel(distributionChannel);
|
|
if (!StringUtil.isNullOrZero(StoreCategoryId)) {
|
|
if (!StringUtil.isNullOrZero(StoreCategoryId)) {
|
|
StoreInnerLabel storeInnerLabel = storeInnerLabelModel.getStoreInnerLabelByInnerLabelId(StoreCategoryId);
|
|
StoreInnerLabel storeInnerLabel = storeInnerLabelModel.getStoreInnerLabelByInnerLabelId(StoreCategoryId);
|
|
AssertUtil.notNull(storeInnerLabel, "店铺内部分类不存在");
|
|
AssertUtil.notNull(storeInnerLabel, "店铺内部分类不存在");
|
|
@@ -426,7 +428,7 @@ public class GoodsSellerController extends BaseController {
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
|
|
|
|
//校验是否可以发布商品
|
|
//校验是否可以发布商品
|
|
- if (!checkIsCanPublish(vendor.getStoreId())) {
|
|
|
|
|
|
+ if (!checkIsCanPublish(vendor.getStoreId(), paramDTO.getDistributionChannel())) {
|
|
return SldResponse.fail("发布商品数量不允许超过店铺等级限制的数量");
|
|
return SldResponse.fail("发布商品数量不允许超过店铺等级限制的数量");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -549,7 +551,7 @@ public class GoodsSellerController extends BaseController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (checkIsCanPublish(vendor.getStoreId())) {
|
|
|
|
|
|
+ if (checkIsCanPublish(vendor.getStoreId(),1)) {
|
|
return SldResponse.success();
|
|
return SldResponse.success();
|
|
} else {
|
|
} else {
|
|
return SldResponse.fail("发布商品数量不允许超过店铺等级限制的数量");
|
|
return SldResponse.fail("发布商品数量不允许超过店铺等级限制的数量");
|
|
@@ -562,7 +564,7 @@ public class GoodsSellerController extends BaseController {
|
|
* @param storeId 店铺id
|
|
* @param storeId 店铺id
|
|
* @return 是否可发布商品
|
|
* @return 是否可发布商品
|
|
*/
|
|
*/
|
|
- public boolean checkIsCanPublish(Long storeId) {
|
|
|
|
|
|
+ public boolean checkIsCanPublish(Long storeId,Integer distributionChannel) {
|
|
boolean isCanPublish = true;
|
|
boolean isCanPublish = true;
|
|
//获取店铺信息
|
|
//获取店铺信息
|
|
Store storeDb = storeModel.getStoreByStoreId(storeId);
|
|
Store storeDb = storeModel.getStoreByStoreId(storeId);
|
|
@@ -575,6 +577,7 @@ public class GoodsSellerController extends BaseController {
|
|
GoodsExample example = new GoodsExample();
|
|
GoodsExample example = new GoodsExample();
|
|
example.setStoreId(storeId);
|
|
example.setStoreId(storeId);
|
|
example.setStateNotEquals(GoodsConst.GOODS_STATE_DELETE);
|
|
example.setStateNotEquals(GoodsConst.GOODS_STATE_DELETE);
|
|
|
|
+ example.setDistributionChannel(distributionChannel);
|
|
List<Goods> goodsList = goodsModel.getGoodsList(example, null);
|
|
List<Goods> goodsList = goodsModel.getGoodsList(example, null);
|
|
if (goodsList.size() >= storeGradeDb.getGoodsLimit()) {
|
|
if (goodsList.size() >= storeGradeDb.getGoodsLimit()) {
|
|
isCanPublish = false;
|
|
isCanPublish = false;
|