|
@@ -7,6 +7,7 @@ import com.qs.mp.admin.domain.vo.TicketCntVO;
|
|
|
import com.qs.mp.admin.service.ITicketService;
|
|
|
import com.qs.mp.channel.domain.Channel;
|
|
|
import com.qs.mp.channel.domain.ChannelOrder;
|
|
|
+import com.qs.mp.channel.domain.ChannelOrderDetail;
|
|
|
import com.qs.mp.channel.domain.ChannelUserRel;
|
|
|
import com.qs.mp.channel.domain.param.ChannelParam;
|
|
|
import com.qs.mp.channel.domain.param.SaleSiteParam;
|
|
@@ -97,9 +98,26 @@ public class SaleSiteMgrController extends BaseApiController {
|
|
|
queryWrapper.eq(null != channel && null != channel.getAreaId(), "t1.area_id", channel.getAreaId());
|
|
|
queryWrapper.orderByDesc("t1.channel_id");
|
|
|
list = channelService.selectChannelVoList(queryWrapper);
|
|
|
+ List<Long> channelIds = new ArrayList<Long>();
|
|
|
if(null != list && list.size() > 0) {
|
|
|
for(ChannelVO channelVO : list) {
|
|
|
- if(null != channelVO && StringUtils.isNotBlank(channelVO.getChannelNo())) {
|
|
|
+ if(null != channelVO && null != channelVO.getChannelId()
|
|
|
+ && StringUtils.isNotBlank(channelVO.getChannelNo())) {
|
|
|
+ channelIds.add(channelVO.getChannelId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<TicketCntVO> cntList = new ArrayList<TicketCntVO>();
|
|
|
+ if(null != channelIds && channelIds.size() > 0) {
|
|
|
+ QueryWrapper<ChannelOrderDetail> ticketCntQueryWrapper = new QueryWrapper<ChannelOrderDetail>();
|
|
|
+ ticketCntQueryWrapper.in("t1.channel_id", channelIds);
|
|
|
+ cntList = ticketService.listTicketCnt(ticketCntQueryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(null != list && list.size() > 0) {
|
|
|
+ for(ChannelVO channelVO : list) {
|
|
|
+ if(null != channelVO && null != channelVO.getChannelId()
|
|
|
+ && StringUtils.isNotBlank(channelVO.getChannelNo())) {
|
|
|
// int siteCnt = channelService.getChannelSiteCnt(channelVO.getChannelNo());
|
|
|
LambdaQueryWrapper<ChannelUserRel> userCntQueryWrapper = new LambdaQueryWrapper<ChannelUserRel>();
|
|
|
userCntQueryWrapper.eq(ChannelUserRel::getChannelId, channelVO.getChannelId());
|
|
@@ -110,10 +128,16 @@ public class SaleSiteMgrController extends BaseApiController {
|
|
|
// channelVO.setSysUser(sysUser);
|
|
|
channelVO.setParentsName(getParentsName(channelVO.getChannelNo()));
|
|
|
// 统计盲票库存, 销量
|
|
|
- TicketCntVO ticketCnt = ticketService.getTicketCnt(channelVO.getChannelId());
|
|
|
- channelVO.setOffLineQtyCnt(null != ticketCnt?ticketCnt.getOffLineQtyCnt():0);
|
|
|
- channelVO.setOffLineSaleCnt(null != ticketCnt?ticketCnt.getOffLineSaleCnt():0);
|
|
|
- channelVO.setOnLineSaleCnt(null != ticketCnt?ticketCnt.getOnLineSaleCnt():0);
|
|
|
+ if(null != cntList && cntList.size() > 0) {
|
|
|
+ List<TicketCntVO> voList = cntList.stream().filter(item -> item.getChannelId().equals(channelVO.getChannelId()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if(null != voList && voList.size() > 0) {
|
|
|
+ TicketCntVO ticketCnt = voList.get(0);
|
|
|
+ channelVO.setOffLineQtyCnt(null != ticketCnt?ticketCnt.getOffLineQtyCnt():0);
|
|
|
+ channelVO.setOffLineSaleCnt(null != ticketCnt?ticketCnt.getOffLineSaleCnt():0);
|
|
|
+ channelVO.setOnLineSaleCnt(null != ticketCnt?ticketCnt.getOnLineSaleCnt():0);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -326,6 +350,7 @@ public class SaleSiteMgrController extends BaseApiController {
|
|
|
userCntQueryWrapper.eq(ChannelUserRel::getChannelId, channelVO.getChannelId());
|
|
|
int userCnt = channelUserRelService.count(userCntQueryWrapper);
|
|
|
channelVO.setUserCnt(userCnt);
|
|
|
+ channelVO.setParentsName(getParentsName(channelVO.getChannelNo()));
|
|
|
}
|
|
|
// 查询经销商销售额、佣金收入、订单数等
|
|
|
ChannelOperDataVO channelOperDataVO = channelService.getChannelTotalOperData(channelVO.getChannelNo());
|