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

Commit 7dce1628 authored by 胡佳晨's avatar 胡佳晨

提交 混合售 根据名字搜索

parent 9039b9bd
package com.liquidnet.service.goblin.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ApiModel(value = "GoblinMixSearchDto", description = "Mix搜素")
@Data
public class GoblinMixSearchDto implements Serializable, Cloneable {
private static final long serialVersionUID = 8425727558228094908L;
@ApiModelProperty(position = 0, value = "活动id")
private String mixId;
@ApiModelProperty(position = 1, value = "活动名称")
private String name;
@ApiModelProperty(position = 5, value = "组合名称")
private String sellName;
private static final GoblinMixSearchDto obj = new GoblinMixSearchDto();
public static GoblinMixSearchDto getNew() {
try {
return (GoblinMixSearchDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinMixSearchDto();
}
}
}
......@@ -57,5 +57,15 @@ public class GoblinCommonController extends BaseController {
return AjaxResult.success(goblinCommonService.skuSearch(title, type));
}
@Log(title = "混合售搜索", businessType = BusinessType.LIST)
@GetMapping("mix")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "title", value = "混合售活动名称[模糊]"),
})
@ResponseBody
public AjaxResult mixSearch(String title) {
return AjaxResult.success(goblinCommonService.mixSearch(title));
}
/** ------------------------------------------------------------------------ **/
}
package com.liquidnet.client.admin.zhengzai.goblin.service;
import com.liquidnet.service.goblin.dto.GoblinGoodsSearchDto;
import com.liquidnet.service.goblin.dto.GoblinMixSearchDto;
import com.liquidnet.service.goblin.dto.GoblinSkusSearchDto;
import com.liquidnet.service.goblin.dto.GoblinStoreSearchDto;
......@@ -11,9 +12,11 @@ import java.util.List;
*/
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);
List<GoblinSkusSearchDto> skuSearch(String name, Integer type);
List<GoblinSkusSearchDto> skuSearch(String name, Integer type);
List<GoblinMixSearchDto> mixSearch(String name);
}
......@@ -5,13 +5,16 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinCommonService;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.goblin.dto.GoblinGoodsSearchDto;
import com.liquidnet.service.goblin.dto.GoblinMixSearchDto;
import com.liquidnet.service.goblin.dto.GoblinSkusSearchDto;
import com.liquidnet.service.goblin.dto.GoblinStoreSearchDto;
import com.liquidnet.service.goblin.entity.GoblinGoods;
import com.liquidnet.service.goblin.entity.GoblinGoodsSku;
import com.liquidnet.service.goblin.entity.GoblinMix;
import com.liquidnet.service.goblin.entity.GoblinStoreInfo;
import com.liquidnet.service.goblin.mapper.GoblinGoodsMapper;
import com.liquidnet.service.goblin.mapper.GoblinGoodsSkuMapper;
import com.liquidnet.service.goblin.mapper.GoblinMixMapper;
import com.liquidnet.service.goblin.mapper.GoblinStoreInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -38,6 +41,8 @@ public class GoblinCommonServiceImpl implements IGoblinCommonService {
GoblinGoodsMapper goblinGoodsMapper;
@Autowired
GoblinGoodsSkuMapper goblinGoodsSkuMapper;
@Autowired
GoblinMixMapper goblinMixMapper;
@Override
public List<GoblinStoreSearchDto> storeSearch(String name, List<String> status) {
......@@ -103,4 +108,23 @@ public class GoblinCommonServiceImpl implements IGoblinCommonService {
}
return dtoList;
}
@Override
public List<GoblinMixSearchDto> mixSearch(String name) {
LambdaQueryWrapper<GoblinMix> queryWrapper = Wrappers.lambdaQuery(GoblinMix.class);
queryWrapper.ne(GoblinMix::getDelTag, "1");
if (StringUtil.isNotBlank(name)) {
queryWrapper.like(GoblinMix::getName, name);
}
List<GoblinMix> list = goblinMixMapper.selectList(queryWrapper.last("limit 20"));
List<GoblinMixSearchDto> dtoList = new ArrayList<>();
for (GoblinMix item : list) {
GoblinMixSearchDto dto = GoblinMixSearchDto.getNew();
dto.setMixId(item.getMixId());
dto.setName(item.getName());
dto.setSellName(item.getSellName());
dtoList.add(dto);
}
return dtoList;
}
}
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