|
@ -8,6 +8,7 @@ import com.qs.serve.common.model.enums.BizType; |
|
|
import com.qs.serve.common.model.enums.SystemModule; |
|
|
import com.qs.serve.common.model.enums.SystemModule; |
|
|
import com.qs.serve.common.util.CopierUtil; |
|
|
import com.qs.serve.common.util.CopierUtil; |
|
|
import com.qs.serve.common.util.PageUtil; |
|
|
import com.qs.serve.common.util.PageUtil; |
|
|
|
|
|
import com.qs.serve.common.util.StringUtils; |
|
|
import com.qs.serve.modules.bms.entity.BmsChannel; |
|
|
import com.qs.serve.modules.bms.entity.BmsChannel; |
|
|
import com.qs.serve.modules.bms.entity.BmsRegion; |
|
|
import com.qs.serve.modules.bms.entity.BmsRegion; |
|
|
import com.qs.serve.modules.bms.entity.BmsRegion2; |
|
|
import com.qs.serve.modules.bms.entity.BmsRegion2; |
|
@ -40,6 +41,8 @@ public class BmsChannelPointController { |
|
|
|
|
|
|
|
|
private BmsChannelPointService bmsChannelPointService; |
|
|
private BmsChannelPointService bmsChannelPointService; |
|
|
private BmsChannelService bmsChannelService; |
|
|
private BmsChannelService bmsChannelService; |
|
|
|
|
|
private BmsRegionService bmsRegionService; |
|
|
|
|
|
private BmsRegion2Service bmsRegion2Service; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 翻页 |
|
|
* 翻页 |
|
@ -50,20 +53,43 @@ public class BmsChannelPointController { |
|
|
@PreAuthorize("hasRole('bms:channelPoint:query')") |
|
|
@PreAuthorize("hasRole('bms:channelPoint:query')") |
|
|
public R<PageVo<BmsChannelPoint>> getPage(BmsChannelPoint param){ |
|
|
public R<PageVo<BmsChannelPoint>> getPage(BmsChannelPoint param){ |
|
|
PageUtil.startPage(); |
|
|
PageUtil.startPage(); |
|
|
LambdaQueryWrapper<BmsChannelPoint> channelPointWrapper = new LambdaQueryWrapper<>(param); |
|
|
LambdaQueryWrapper<BmsChannelPoint> channelPointWrapper = new LambdaQueryWrapper<>(); |
|
|
List<BmsChannelPoint> list = bmsChannelPointService.list(channelPointWrapper); |
|
|
if(StringUtils.hasText(param.getChannelName())){ |
|
|
if(list.size()>0){ |
|
|
channelPointWrapper.like(BmsChannelPoint::getChannelName,param.getChannelName()); |
|
|
List<Long> channelIds = list.stream().map(BmsChannelPoint::getChannelId).distinct().collect(Collectors.toList()); |
|
|
} |
|
|
List<BmsChannel> channels = bmsChannelService.listByIds(channelIds); |
|
|
if(StringUtils.hasText(param.getPointName())){ |
|
|
for (BmsChannelPoint channelPoint : list) { |
|
|
channelPointWrapper.like(BmsChannelPoint::getPointName,param.getPointName()); |
|
|
for (BmsChannel channel : channels) { |
|
|
} |
|
|
if(channelPoint.getChannelId().equals(channel.getId())){ |
|
|
if(StringUtils.hasText(param.getPointCode())){ |
|
|
channelPoint.setChannelName(channel.getChannelName()); |
|
|
channelPointWrapper.like(BmsChannelPoint::getPointCode,param.getPointCode()); |
|
|
break; |
|
|
} |
|
|
} |
|
|
if(StringUtils.hasText(param.getBizRegionPath())){ |
|
|
} |
|
|
channelPointWrapper.like(BmsChannelPoint::getBizRegionPath,param.getBizRegionPath()); |
|
|
} |
|
|
} |
|
|
|
|
|
if(StringUtils.hasText(param.getSaleRegionPath())){ |
|
|
|
|
|
channelPointWrapper.like(BmsChannelPoint::getSaleRegionPath,param.getSaleRegionPath()); |
|
|
|
|
|
} |
|
|
|
|
|
if(StringUtils.hasText(param.getPointType())){ |
|
|
|
|
|
channelPointWrapper.eq(BmsChannelPoint::getPointType,param.getPointType()); |
|
|
} |
|
|
} |
|
|
|
|
|
if(StringUtils.hasText(param.getPointLevel())){ |
|
|
|
|
|
channelPointWrapper.eq(BmsChannelPoint::getPointLevel,param.getPointLevel()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<BmsChannelPoint> list = bmsChannelPointService.list(channelPointWrapper); |
|
|
|
|
|
// if(list.size()>0){
|
|
|
|
|
|
// List<Long> channelIds = list.stream().map(BmsChannelPoint::getChannelId).distinct().collect(Collectors.toList());
|
|
|
|
|
|
// List<BmsChannel> channels = bmsChannelService.listByIds(channelIds);
|
|
|
|
|
|
// for (BmsChannelPoint channelPoint : list) {
|
|
|
|
|
|
// for (BmsChannel channel : channels) {
|
|
|
|
|
|
// if(channelPoint.getChannelId().equals(channel.getId())){
|
|
|
|
|
|
// channelPoint.setChannelName(channel.getChannelName());
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
return R.byPageHelperList(list); |
|
|
return R.byPageHelperList(list); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -77,8 +103,16 @@ public class BmsChannelPointController { |
|
|
@PreAuthorize("hasRole('bms:channelPoint:query')") |
|
|
@PreAuthorize("hasRole('bms:channelPoint:query')") |
|
|
public R<BmsChannelPoint> getById(@PathVariable("id") String id){ |
|
|
public R<BmsChannelPoint> getById(@PathVariable("id") String id){ |
|
|
BmsChannelPoint bmsChannelPoint = bmsChannelPointService.getById(id); |
|
|
BmsChannelPoint bmsChannelPoint = bmsChannelPointService.getById(id); |
|
|
BmsChannel channel = bmsChannelService.getById(bmsChannelPoint.getChannelId()); |
|
|
// BmsChannel channel = bmsChannelService.getById(bmsChannelPoint.getChannelId());
|
|
|
bmsChannelPoint.setChannelName(channel.getChannelName()); |
|
|
// bmsChannelPoint.setChannelName(channel.getChannelName());
|
|
|
|
|
|
BmsRegion bmsRegion = bmsRegionService.getById(bmsChannelPoint.getSaleRegionId()); |
|
|
|
|
|
if(bmsRegion!=null){ |
|
|
|
|
|
bmsChannelPoint.setSaleRegionName(bmsRegion.getName()); |
|
|
|
|
|
} |
|
|
|
|
|
BmsRegion2 bmsRegion2 = bmsRegion2Service.getById(bmsChannelPoint.getBizRegionId()); |
|
|
|
|
|
if(bmsRegion2!=null){ |
|
|
|
|
|
bmsChannelPoint.setBizRegionName(bmsRegion2.getName()); |
|
|
|
|
|
} |
|
|
return R.ok(bmsChannelPoint); |
|
|
return R.ok(bmsChannelPoint); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|