|
@@ -68,13 +68,13 @@ public class SaleSiteMgrController extends BaseApiController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IChannelOrderService channelOrderService;
|
|
private IChannelOrderService channelOrderService;
|
|
-
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private IUserTicketOrderService userTicketOrderService;
|
|
private IUserTicketOrderService userTicketOrderService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ISysUserService userService;
|
|
private ISysUserService userService;
|
|
-
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private ITicketService ticketService;
|
|
private ITicketService ticketService;
|
|
|
|
|
|
@@ -102,30 +102,8 @@ public class SaleSiteMgrController extends BaseApiController {
|
|
queryWrapper.eq(null != channel && null != channel.getProvinceId(), "t1.province_id", channel.getProvinceId());
|
|
queryWrapper.eq(null != channel && null != channel.getProvinceId(), "t1.province_id", channel.getProvinceId());
|
|
queryWrapper.eq(null != channel && null != channel.getCityId(), "t1.city_id", channel.getCityId());
|
|
queryWrapper.eq(null != channel && null != channel.getCityId(), "t1.city_id", channel.getCityId());
|
|
queryWrapper.eq(null != channel && null != channel.getAreaId(), "t1.area_id", channel.getAreaId());
|
|
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 && null != channelVO.getChannelId()
|
|
|
|
- && StringUtils.isNotBlank(channelVO.getChannelNo())) {
|
|
|
|
- channelIds.add(channelVO.getChannelId());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- List<TicketCntVO> qtyCntList = new ArrayList<TicketCntVO>();
|
|
|
|
- List<TicketCntVO> saleCntList = new ArrayList<TicketCntVO>();
|
|
|
|
- if(null != channelIds && channelIds.size() > 0) {
|
|
|
|
- QueryWrapper<ChannelOrderDetail> ticketQtyCntQueryWrapper = new QueryWrapper<ChannelOrderDetail>();
|
|
|
|
- ticketQtyCntQueryWrapper.in("t1.channel_id", channelIds);
|
|
|
|
- qtyCntList = ticketService.listTicketQtyCnt(ticketQtyCntQueryWrapper);
|
|
|
|
-
|
|
|
|
- QueryWrapper<UserTicketOrder> ticketSaleCntQueryWrapper = new QueryWrapper<UserTicketOrder>();
|
|
|
|
- ticketSaleCntQueryWrapper.in("t1.channel_id", channelIds);
|
|
|
|
- ticketSaleCntQueryWrapper.eq("t1.`status`", 1);
|
|
|
|
- saleCntList = userTicketOrderService.listTicketSaleCnt(ticketSaleCntQueryWrapper);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ list = channelService.selectSaleSiteList(queryWrapper);
|
|
|
|
+
|
|
if(null != list && list.size() > 0) {
|
|
if(null != list && list.size() > 0) {
|
|
for(ChannelVO channelVO : list) {
|
|
for(ChannelVO channelVO : list) {
|
|
if(null != channelVO && null != channelVO.getChannelId()
|
|
if(null != channelVO && null != channelVO.getChannelId()
|
|
@@ -139,30 +117,12 @@ public class SaleSiteMgrController extends BaseApiController {
|
|
//SysUser sysUser = userService.selectUserById(channelVO.getUserId());
|
|
//SysUser sysUser = userService.selectUserById(channelVO.getUserId());
|
|
// channelVO.setSysUser(sysUser);
|
|
// channelVO.setSysUser(sysUser);
|
|
channelVO.setParentsName(getParentsName(channelVO.getChannelNo()));
|
|
channelVO.setParentsName(getParentsName(channelVO.getChannelNo()));
|
|
- // 统计盲票库存, 销量
|
|
|
|
- if(null != qtyCntList && qtyCntList.size() > 0) {
|
|
|
|
- List<TicketCntVO> voList = qtyCntList.stream().filter(item -> item.getChannelId().equals(channelVO.getChannelId()))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
- if(null != voList && voList.size() > 0) {
|
|
|
|
- TicketCntVO ticketQtyCnt = voList.get(0);
|
|
|
|
- channelVO.setOffLineQtyCnt(null != ticketQtyCnt?ticketQtyCnt.getOffLineQtyCnt():0);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if(null != saleCntList && saleCntList.size() > 0) {
|
|
|
|
- List<TicketCntVO> voList = saleCntList.stream().filter(item -> item.getChannelId().equals(channelVO.getChannelId()))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
- if(null != voList && voList.size() > 0) {
|
|
|
|
- TicketCntVO ticketSaleCnt = voList.get(0);
|
|
|
|
- channelVO.setOffLineSaleCnt(null != ticketSaleCnt?ticketSaleCnt.getOffLineSaleCnt():0);
|
|
|
|
- channelVO.setOnLineSaleCnt(null != ticketSaleCnt?ticketSaleCnt.getOnLineSaleCnt():0);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// 获取上级渠道迭代
|
|
// 获取上级渠道迭代
|
|
private String getParentsName(String channelNo) {
|
|
private String getParentsName(String channelNo) {
|
|
if(StringUtils.isNotBlank(channelNo)) {
|
|
if(StringUtils.isNotBlank(channelNo)) {
|
|
@@ -388,26 +348,26 @@ public class SaleSiteMgrController extends BaseApiController {
|
|
}
|
|
}
|
|
// 查询经销商销售额、佣金收入、订单数等
|
|
// 查询经销商销售额、佣金收入、订单数等
|
|
ChannelOperDataVO channelOperDataVO = channelService.getChannelTotalOperData(channelVO.getChannelNo());
|
|
ChannelOperDataVO channelOperDataVO = channelService.getChannelTotalOperData(channelVO.getChannelNo());
|
|
-
|
|
|
|
|
|
+
|
|
// 盲票销售张数
|
|
// 盲票销售张数
|
|
int ticketSaleCnt = userTicketOrderService.getSaleSiteTotalTicketNumCnt(channelVO.getChannelId());
|
|
int ticketSaleCnt = userTicketOrderService.getSaleSiteTotalTicketNumCnt(channelVO.getChannelId());
|
|
channelOperDataVO.setTicketSaleCnt(ticketSaleCnt);
|
|
channelOperDataVO.setTicketSaleCnt(ticketSaleCnt);
|
|
channelVO.setOperData(channelOperDataVO);
|
|
channelVO.setOperData(channelOperDataVO);
|
|
-
|
|
|
|
|
|
+
|
|
if(null != channelVO && null != channelVO.getChannelId()) {
|
|
if(null != channelVO && null != channelVO.getChannelId()) {
|
|
LambdaQueryWrapper<ChannelUserRel> userCntQueryWrapper = new LambdaQueryWrapper<ChannelUserRel>();
|
|
LambdaQueryWrapper<ChannelUserRel> userCntQueryWrapper = new LambdaQueryWrapper<ChannelUserRel>();
|
|
userCntQueryWrapper.eq(ChannelUserRel::getChannelId, channelVO.getChannelId());
|
|
userCntQueryWrapper.eq(ChannelUserRel::getChannelId, channelVO.getChannelId());
|
|
int userCnt = channelUserRelService.count(userCntQueryWrapper);
|
|
int userCnt = channelUserRelService.count(userCntQueryWrapper);
|
|
channelVO.setUserCnt(userCnt);
|
|
channelVO.setUserCnt(userCnt);
|
|
-
|
|
|
|
|
|
+
|
|
int ticketQtyCnt = ticketService.getTicketQtyCnt(channelVO.getChannelId());
|
|
int ticketQtyCnt = ticketService.getTicketQtyCnt(channelVO.getChannelId());
|
|
channelVO.setOffLineQtyCnt(ticketQtyCnt);
|
|
channelVO.setOffLineQtyCnt(ticketQtyCnt);
|
|
-
|
|
|
|
|
|
+
|
|
TicketCntVO ticketCnt = userTicketOrderService.getTicketSaleCnt(channelVO.getChannelId());
|
|
TicketCntVO ticketCnt = userTicketOrderService.getTicketSaleCnt(channelVO.getChannelId());
|
|
channelVO.setOffLineSaleCnt(null != ticketCnt?ticketCnt.getOffLineSaleCnt():0);
|
|
channelVO.setOffLineSaleCnt(null != ticketCnt?ticketCnt.getOffLineSaleCnt():0);
|
|
channelVO.setOnLineSaleCnt(null != ticketCnt?ticketCnt.getOnLineSaleCnt():0);
|
|
channelVO.setOnLineSaleCnt(null != ticketCnt?ticketCnt.getOnLineSaleCnt():0);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
return AjaxResult.success(channelVO);
|
|
return AjaxResult.success(channelVO);
|
|
}
|
|
}
|
|
|
|
|