记得上下班打卡 | git大法好,push需谨慎

Commit 8dfbe68e authored by 胡佳晨's avatar 胡佳晨

搜索接口修改

parent 8bbabb01
...@@ -40,10 +40,18 @@ public class GoblinCommonController extends BaseController { ...@@ -40,10 +40,18 @@ public class GoblinCommonController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "title", value = "商品名称[模糊]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "title", value = "商品名称[模糊]"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "type", value = "商品类型[0-常规|1-数字藏品]"), @ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "type", value = "商品类型[0-常规|1-数字藏品]"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "shelvesStatus", value = "上线状态"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuAppear", value = "显示状态"),
}) })
@ResponseBody @ResponseBody
public AjaxResult goodsSearch(String title, Integer type) { public AjaxResult goodsSearch(String title, Integer type,String shelvesStatus,String spuAppear) {
return AjaxResult.success(goblinCommonService.goodsSearch(title, type)); if("".equals(shelvesStatus)){
shelvesStatus=null;
}
if("".equals(spuAppear)){
spuAppear=null;
}
return AjaxResult.success(goblinCommonService.goodsSearch(title, type,shelvesStatus,spuAppear));
} }
@Log(title = "商品搜索", businessType = BusinessType.LIST) @Log(title = "商品搜索", businessType = BusinessType.LIST)
...@@ -51,10 +59,14 @@ public class GoblinCommonController extends BaseController { ...@@ -51,10 +59,14 @@ public class GoblinCommonController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "title", value = "商品名称[模糊]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "title", value = "商品名称[模糊]"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "type", value = "商品类型[0-常规|1-数字藏品]"), @ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "type", value = "商品类型[0-常规|1-数字藏品]"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "shelvesStatus", value = "上线状态"),
}) })
@ResponseBody @ResponseBody
public AjaxResult skuSearch(String title, Integer type) { public AjaxResult skuSearch(String title, Integer type,String shelvesStatus) {
return AjaxResult.success(goblinCommonService.skuSearch(title, type)); if("".equals(shelvesStatus)){
shelvesStatus=null;
}
return AjaxResult.success(goblinCommonService.skuSearch(title, type,shelvesStatus));
} }
@Log(title = "混合售搜索", businessType = BusinessType.LIST) @Log(title = "混合售搜索", businessType = BusinessType.LIST)
......
...@@ -14,9 +14,9 @@ public interface IGoblinCommonService { ...@@ -14,9 +14,9 @@ public interface IGoblinCommonService {
List<GoblinStoreSearchDto> storeSearch(String name, List<String> status); List<GoblinStoreSearchDto> storeSearch(String name, List<String> status);
List<GoblinGoodsSearchDto> goodsSearch(String name, Integer type); List<GoblinGoodsSearchDto> goodsSearch(String name, Integer type,String shelvesStatus,String spuAppear);
List<GoblinSkusSearchDto> skuSearch(String name, Integer type); List<GoblinSkusSearchDto> skuSearch(String name, Integer type,String shelvesStatus);
List<GoblinMixSearchDto> mixSearch(String name); List<GoblinMixSearchDto> mixSearch(String name);
} }
...@@ -62,14 +62,22 @@ public class GoblinCommonServiceImpl implements IGoblinCommonService { ...@@ -62,14 +62,22 @@ public class GoblinCommonServiceImpl implements IGoblinCommonService {
} }
@Override @Override
public List<GoblinGoodsSearchDto> goodsSearch(String name, Integer type) { public List<GoblinGoodsSearchDto> goodsSearch(String name, Integer type, String shelvesStatus, String spuAppear) {
if (type == null) {//普通商品 if (type == null) {//普通商品
type = 1; type = 1;
} }
LambdaQueryWrapper<GoblinGoods> queryWrapper = Wrappers.lambdaQuery(GoblinGoods.class); LambdaQueryWrapper<GoblinGoods> queryWrapper = Wrappers.lambdaQuery(GoblinGoods.class);
queryWrapper.ne(GoblinGoods::getDelFlg, "1"); queryWrapper.ne(GoblinGoods::getDelFlg, "1");
// queryWrapper.eq(GoblinGoods::getShelvesStatus, "3"); if (shelvesStatus != null) {
// queryWrapper.eq(GoblinGoods::getSpuAppear, "0"); queryWrapper.eq(GoblinGoods::getShelvesStatus, shelvesStatus);
} else {
// queryWrapper.eq(GoblinGoods::getShelvesStatus, "3");
}
if (spuAppear != null) {
queryWrapper.eq(GoblinGoods::getSpuAppear, spuAppear);
} else {
queryWrapper.eq(GoblinGoods::getSpuAppear, "1");
}
queryWrapper.eq(GoblinGoods::getSpuType, type); queryWrapper.eq(GoblinGoods::getSpuType, type);
if (StringUtil.isNotBlank(name)) { if (StringUtil.isNotBlank(name)) {
queryWrapper.like(GoblinGoods::getName, name); queryWrapper.like(GoblinGoods::getName, name);
...@@ -86,13 +94,17 @@ public class GoblinCommonServiceImpl implements IGoblinCommonService { ...@@ -86,13 +94,17 @@ public class GoblinCommonServiceImpl implements IGoblinCommonService {
} }
@Override @Override
public List<GoblinSkusSearchDto> skuSearch(String name, Integer type) { public List<GoblinSkusSearchDto> skuSearch(String name, Integer type, String shelvesStatus) {
if (type == null) {//普通商品 if (type == null) {//普通商品
type = 1; type = 1;
} }
LambdaQueryWrapper<GoblinGoodsSku> queryWrapper = Wrappers.lambdaQuery(GoblinGoodsSku.class); LambdaQueryWrapper<GoblinGoodsSku> queryWrapper = Wrappers.lambdaQuery(GoblinGoodsSku.class);
queryWrapper.ne(GoblinGoodsSku::getDelFlg, "1"); queryWrapper.ne(GoblinGoodsSku::getDelFlg, "1");
// queryWrapper.eq(GoblinGoodsSku::getShelvesStatus, "3"); if (shelvesStatus != null) {
queryWrapper.eq(GoblinGoodsSku::getShelvesStatus, shelvesStatus);
} else {
// queryWrapper.eq(GoblinGoodsSku::getShelvesStatus, "3");
}
// queryWrapper.eq(GoblinGoodsSku::getSpuAppear, "0"); // queryWrapper.eq(GoblinGoodsSku::getSpuAppear, "0");
queryWrapper.eq(GoblinGoodsSku::getSkuType, type); queryWrapper.eq(GoblinGoodsSku::getSkuType, type);
if (StringUtil.isNotBlank(name)) { if (StringUtil.isNotBlank(name)) {
......
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