|
@@ -26,10 +26,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -57,6 +54,7 @@ public class GoodsParameterGroupController extends BaseController {
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
//验证参数
|
|
//验证参数
|
|
AssertUtil.notNull(goodsParameterGroupAddDTO, "属性分组不能为空,请重试!");
|
|
AssertUtil.notNull(goodsParameterGroupAddDTO, "属性分组不能为空,请重试!");
|
|
|
|
+ AssertUtil.notEmpty(goodsParameterGroupAddDTO.getDistributionChannel(), "分组发布渠道不能为空,请重试!");
|
|
AssertUtil.notEmpty(goodsParameterGroupAddDTO.getGroupName(), "分组名称不能为空,请重试!");
|
|
AssertUtil.notEmpty(goodsParameterGroupAddDTO.getGroupName(), "分组名称不能为空,请重试!");
|
|
goodsParameterGroupModel.saveGoodsParameterGroup(goodsParameterGroupAddDTO, vendor);
|
|
goodsParameterGroupModel.saveGoodsParameterGroup(goodsParameterGroupAddDTO, vendor);
|
|
return SldResponse.success("添加成功", goodsParameterGroupAddDTO.getGroupName());
|
|
return SldResponse.success("添加成功", goodsParameterGroupAddDTO.getGroupName());
|
|
@@ -97,12 +95,13 @@ public class GoodsParameterGroupController extends BaseController {
|
|
|
|
|
|
@ApiOperation("属性分组列表")
|
|
@ApiOperation("属性分组列表")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "distributionChannel", value = "分组发布渠道", paramType = "query"),
|
|
@ApiImplicitParam(name = "groupName", value = "分组名称", paramType = "query"),
|
|
@ApiImplicitParam(name = "groupName", 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<GoodsParameterGroupVO>> getList(HttpServletRequest request, String groupName) {
|
|
|
|
|
|
+ public JsonResult<PageVO<GoodsParameterGroupVO>> getList(HttpServletRequest request, String groupName,@RequestParam (value = "distributionChannel", required = false, defaultValue = "1") String distributionChannel) {
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
|
|
|
|
//分页设置
|
|
//分页设置
|
|
@@ -110,6 +109,7 @@ public class GoodsParameterGroupController extends BaseController {
|
|
//根据条件查询集合
|
|
//根据条件查询集合
|
|
GoodsParameterGroupExample example = new GoodsParameterGroupExample();
|
|
GoodsParameterGroupExample example = new GoodsParameterGroupExample();
|
|
example.setStoreId(vendor.getStoreId());
|
|
example.setStoreId(vendor.getStoreId());
|
|
|
|
+ example.setDistributionChannel(distributionChannel);
|
|
example.setGroupNameLike(groupName);
|
|
example.setGroupNameLike(groupName);
|
|
List<GoodsParameterGroup> list = goodsParameterGroupModel.getGoodsParameterGroupList(example, pager);
|
|
List<GoodsParameterGroup> list = goodsParameterGroupModel.getGoodsParameterGroupList(example, pager);
|
|
List<GoodsParameterGroupVO> vos = new ArrayList<>();
|
|
List<GoodsParameterGroupVO> vos = new ArrayList<>();
|
|
@@ -124,17 +124,19 @@ public class GoodsParameterGroupController extends BaseController {
|
|
|
|
|
|
@ApiOperation("可用属性分组列表")
|
|
@ApiOperation("可用属性分组列表")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
|
+ @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("canUseList")
|
|
@GetMapping("canUseList")
|
|
- public JsonResult<PageVO<GoodsParameterGroupVO>> canUseList(HttpServletRequest request) {
|
|
|
|
|
|
+ public JsonResult<PageVO<GoodsParameterGroupVO>> canUseList(HttpServletRequest request,@RequestParam (value = "distributionChannel", required = false, defaultValue = "1") String 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);
|
|
//根据条件查询集合
|
|
//根据条件查询集合
|
|
GoodsParameterGroupExample example = new GoodsParameterGroupExample();
|
|
GoodsParameterGroupExample example = new GoodsParameterGroupExample();
|
|
|
|
+ example.setDistributionChannel(distributionChannel);
|
|
example.setStoreId(vendor.getStoreId());
|
|
example.setStoreId(vendor.getStoreId());
|
|
example.setIsShow(GoodsConst.IS_ATTRIBUTE_YES);
|
|
example.setIsShow(GoodsConst.IS_ATTRIBUTE_YES);
|
|
example.setOrderBy("sort asc, create_time desc");
|
|
example.setOrderBy("sort asc, create_time desc");
|