Commit 2120c03f authored by suntao's avatar suntao

渠道列表查询 添加渠道名 模糊查询

parent 704e32c3
......@@ -39,11 +39,11 @@ public class ChannelConfController {
@Security(authorityId = "Channel.getChannelList")
@ChannelIdInit(channelIdSPEL = "#this[0]")
@PostMapping("/info")
public Result channelList(Long channelId, Integer pageNumber, Integer pageSize) {
public Result channelList(Long channelId, String channelName, Integer pageNumber, Integer pageSize) {
if (pageNumber == null || pageSize == null) {
return Result.buildFial("page信息不对");
}
return Result.buildSuccess(channelConfService.getChannelInfo(pageNumber, pageSize, channelId));
return Result.buildSuccess(channelConfService.getChannelInfo(pageNumber, pageSize, channelId, channelName));
}
/**
......
......@@ -12,7 +12,7 @@ import org.springframework.data.domain.Page;
*/
public interface ChannelConfService {
Page<ChannelListModel> getChannelInfo(Integer pageNumber, Integer pageSize, Long channelId);
Page<ChannelListModel> getChannelInfo(Integer pageNumber, Integer pageSize, Long channelId, String channelName);
ChannelConfVo getChannelConf(Long channelId);
......
......@@ -39,9 +39,9 @@ public class ChannelConfServiceImpl implements ChannelConfService{
@Override
public Page<ChannelListModel> getChannelInfo(Integer pageNumber, Integer pageSize, Long channelId) {
public Page<ChannelListModel> getChannelInfo(Integer pageNumber, Integer pageSize, Long channelId, String channelName) {
Page<ClfChannelConfiguration> page = clfCenterService.findChannelConfigurationByCriteriaQueryPage(pageNumber, pageSize, channelId);
Page<ClfChannelConfiguration> page = clfCenterService.findChannelConfigurationByCriteriaQueryPage(pageNumber, pageSize, channelId, channelName);
Page<ChannelListModel> channelListModelPage = page.map(it -> {
ChannelListModel channelListModel = new ChannelListModel();
......
......@@ -23,7 +23,7 @@ public interface CLFCenterService {
List<ApplyRequestHistory> findApplyRequestHistoryBySpecification(OrderBaseModel orderBaseModel);
Page<ClfChannelConfiguration> findChannelConfigurationByCriteriaQueryPage(Integer pageNumber, Integer pageSize, Long channelId);
Page<ClfChannelConfiguration> findChannelConfigurationByCriteriaQueryPage(Integer pageNumber, Integer pageSize, Long channelId, String channelName);
ClfChannelConfiguration findChannelConfigurationByChannelId(Long channelId);
......
......@@ -2,7 +2,6 @@ package cn.quantgroup.cashloanflowboss.spi.clf.service;
import cn.quantgroup.cashloanflowboss.api.order.model.OrderBaseModel;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.*;
import cn.quantgroup.cashloanflowboss.spi.clf.model.KANoticeType;
import cn.quantgroup.cashloanflowboss.spi.clf.repository.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -91,7 +90,7 @@ public class CLFCenterServiceImpl implements CLFCenterService{
}
@Override
public Page<ClfChannelConfiguration> findChannelConfigurationByCriteriaQueryPage(Integer pageNumber, Integer pageSize, Long channelId) {
public Page<ClfChannelConfiguration> findChannelConfigurationByCriteriaQueryPage(Integer pageNumber, Integer pageSize, Long channelId, String channelName) {
return clfChannelConfigurationRepository.findAll((root, criteriaQuery, criteriaBuilder) -> {
List<Predicate> predicates = new ArrayList<>();
......@@ -101,6 +100,10 @@ public class CLFCenterServiceImpl implements CLFCenterService{
predicates.add(criteriaBuilder.equal(root.get("registeredFrom"), channelId.longValue()));
}
if (StringUtils.isNotEmpty(channelName)) {
predicates.add(criteriaBuilder.like(root.get("channelName"), "%" + channelName + "%"));
}
// 设置查询条件
criteriaQuery.where(criteriaBuilder.and(predicates.toArray(new Predicate[predicates.size()])));
// 指定排序
......
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