|
@@ -22,6 +22,7 @@ import com.qs.mp.common.core.domain.AjaxResult;
|
|
import com.qs.mp.common.core.page.TableDataInfo;
|
|
import com.qs.mp.common.core.page.TableDataInfo;
|
|
import com.qs.mp.common.enums.ChannelCertifyStatusEnum;
|
|
import com.qs.mp.common.enums.ChannelCertifyStatusEnum;
|
|
import com.qs.mp.common.enums.ChannelRoleEnum;
|
|
import com.qs.mp.common.enums.ChannelRoleEnum;
|
|
|
|
+import com.qs.mp.common.enums.ChannelStatusEnum;
|
|
import com.qs.mp.common.enums.ChannelVerifyStatusEnum;
|
|
import com.qs.mp.common.enums.ChannelVerifyStatusEnum;
|
|
import com.qs.mp.common.enums.ErrorCodeEnum;
|
|
import com.qs.mp.common.enums.ErrorCodeEnum;
|
|
import com.qs.mp.common.exception.ServiceException;
|
|
import com.qs.mp.common.exception.ServiceException;
|
|
@@ -80,10 +81,10 @@ public class ChannelController extends BaseApiController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ISysUserService userService;
|
|
private ISysUserService userService;
|
|
-
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private IUserTicketOrderService userTicketOrderService;
|
|
private IUserTicketOrderService userTicketOrderService;
|
|
-
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private ITicketService ticketService;
|
|
private ITicketService ticketService;
|
|
|
|
|
|
@@ -163,6 +164,10 @@ public class ChannelController extends BaseApiController {
|
|
return AjaxResult.error("该代理已存在");
|
|
return AjaxResult.error("该代理已存在");
|
|
}
|
|
}
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
|
|
+ Channel existChannel = channelService.getById(channelId);
|
|
|
|
+ if (existChannel.getStatus() == ChannelStatusEnum.OFF) {
|
|
|
|
+ return AjaxResult.error("账号异常");
|
|
|
|
+ }
|
|
Channel channel = mapperFacade.map(channelParam, Channel.class);
|
|
Channel channel = mapperFacade.map(channelParam, Channel.class);
|
|
channel.setParentId(channelId);
|
|
channel.setParentId(channelId);
|
|
// 1、校验名称是否重复、手机号是否存在(渠道表)
|
|
// 1、校验名称是否重复、手机号是否存在(渠道表)
|
|
@@ -209,6 +214,7 @@ public class ChannelController extends BaseApiController {
|
|
if (null == channelParam || null == channelParam.getChannelId()) {
|
|
if (null == channelParam || null == channelParam.getChannelId()) {
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
}
|
|
}
|
|
|
|
+
|
|
Channel channel = mapperFacade.map(channelParam, Channel.class);
|
|
Channel channel = mapperFacade.map(channelParam, Channel.class);
|
|
// 1、校验修改子渠道是否为当前用户的子渠道
|
|
// 1、校验修改子渠道是否为当前用户的子渠道
|
|
Channel oldChannel = channelService.getById(channel.getChannelId());
|
|
Channel oldChannel = channelService.getById(channel.getChannelId());
|
|
@@ -216,6 +222,10 @@ public class ChannelController extends BaseApiController {
|
|
return AjaxResult.error("代理'" + oldChannel.getName() + "'编辑失败");
|
|
return AjaxResult.error("代理'" + oldChannel.getName() + "'编辑失败");
|
|
}
|
|
}
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
|
|
+ Channel existChannel = channelService.getById(channelId);
|
|
|
|
+ if (existChannel.getStatus() == ChannelStatusEnum.OFF) {
|
|
|
|
+ return AjaxResult.error("账号异常");
|
|
|
|
+ }
|
|
if(!oldChannel.getParentId().equals(channelId)) {
|
|
if(!oldChannel.getParentId().equals(channelId)) {
|
|
return AjaxResult.error("代理'" + oldChannel.getName() + "'编辑失败");
|
|
return AjaxResult.error("代理'" + oldChannel.getName() + "'编辑失败");
|
|
}
|
|
}
|
|
@@ -360,7 +370,7 @@ public class ChannelController extends BaseApiController {
|
|
queryWrapper.eq("t1.certify_status", siteParam.getCertifyStatus());
|
|
queryWrapper.eq("t1.certify_status", siteParam.getCertifyStatus());
|
|
}
|
|
}
|
|
list = channelService.selectChannelVoList(queryWrapper);
|
|
list = channelService.selectChannelVoList(queryWrapper);
|
|
-
|
|
|
|
|
|
+
|
|
List<Long> channelIds = new ArrayList<Long>();
|
|
List<Long> channelIds = new ArrayList<Long>();
|
|
if(null != list && list.size() > 0) {
|
|
if(null != list && list.size() > 0) {
|
|
for(ChannelVO channelVO : list) {
|
|
for(ChannelVO channelVO : list) {
|
|
@@ -376,13 +386,13 @@ public class ChannelController extends BaseApiController {
|
|
QueryWrapper<ChannelOrderDetail> ticketQtyCntQueryWrapper = new QueryWrapper<ChannelOrderDetail>();
|
|
QueryWrapper<ChannelOrderDetail> ticketQtyCntQueryWrapper = new QueryWrapper<ChannelOrderDetail>();
|
|
ticketQtyCntQueryWrapper.in("t1.channel_id", channelIds);
|
|
ticketQtyCntQueryWrapper.in("t1.channel_id", channelIds);
|
|
qtyCntList = ticketService.listTicketQtyCnt(ticketQtyCntQueryWrapper);
|
|
qtyCntList = ticketService.listTicketQtyCnt(ticketQtyCntQueryWrapper);
|
|
-
|
|
|
|
|
|
+
|
|
QueryWrapper<UserTicketOrder> ticketSaleCntQueryWrapper = new QueryWrapper<UserTicketOrder>();
|
|
QueryWrapper<UserTicketOrder> ticketSaleCntQueryWrapper = new QueryWrapper<UserTicketOrder>();
|
|
ticketSaleCntQueryWrapper.in("t1.channel_id", channelIds);
|
|
ticketSaleCntQueryWrapper.in("t1.channel_id", channelIds);
|
|
ticketSaleCntQueryWrapper.eq("t1.`status`", 1);
|
|
ticketSaleCntQueryWrapper.eq("t1.`status`", 1);
|
|
saleCntList = userTicketOrderService.listTicketSaleCnt(ticketSaleCntQueryWrapper);
|
|
saleCntList = userTicketOrderService.listTicketSaleCnt(ticketSaleCntQueryWrapper);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
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()
|
|
@@ -413,7 +423,7 @@ public class ChannelController extends BaseApiController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
}
|
|
}
|
|
@@ -443,20 +453,20 @@ public class ChannelController extends BaseApiController {
|
|
ChannelOperDataVO channelOperDataVO = channelService.getChannelOperData(channelVO.getChannelNo(), 1);
|
|
ChannelOperDataVO channelOperDataVO = channelService.getChannelOperData(channelVO.getChannelNo(), 1);
|
|
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 ticketSaleCnt = userTicketOrderService.getTicketSaleCnt(channelVO.getChannelId());
|
|
TicketCntVO ticketSaleCnt = userTicketOrderService.getTicketSaleCnt(channelVO.getChannelId());
|
|
channelVO.setOffLineSaleCnt(null != ticketSaleCnt?ticketSaleCnt.getOffLineSaleCnt():0);
|
|
channelVO.setOffLineSaleCnt(null != ticketSaleCnt?ticketSaleCnt.getOffLineSaleCnt():0);
|
|
channelVO.setOnLineSaleCnt(null != ticketSaleCnt?ticketSaleCnt.getOnLineSaleCnt():0);
|
|
channelVO.setOnLineSaleCnt(null != ticketSaleCnt?ticketSaleCnt.getOnLineSaleCnt():0);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
return AjaxResult.success(channelVO);
|
|
return AjaxResult.success(channelVO);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -472,6 +482,10 @@ public class ChannelController extends BaseApiController {
|
|
return AjaxResult.error("该门店已存在");
|
|
return AjaxResult.error("该门店已存在");
|
|
}
|
|
}
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
|
|
+ Channel existChannel = channelService.getById(channelId);
|
|
|
|
+ if (existChannel.getStatus() == ChannelStatusEnum.OFF) {
|
|
|
|
+ return AjaxResult.error("账号异常");
|
|
|
|
+ }
|
|
|
|
|
|
Channel channel = mapperFacade.map(channelParam, Channel.class);
|
|
Channel channel = mapperFacade.map(channelParam, Channel.class);
|
|
channel.setParentId(channelId);
|
|
channel.setParentId(channelId);
|
|
@@ -526,6 +540,10 @@ public class ChannelController extends BaseApiController {
|
|
return AjaxResult.error("门店'" + oldChannel.getName() + "'编辑失败");
|
|
return AjaxResult.error("门店'" + oldChannel.getName() + "'编辑失败");
|
|
}
|
|
}
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
|
|
+ Channel existChannel = channelService.getById(channelId);
|
|
|
|
+ if (existChannel.getStatus() == ChannelStatusEnum.OFF) {
|
|
|
|
+ return AjaxResult.error("账号异常");
|
|
|
|
+ }
|
|
if(!oldChannel.getParentId().equals(channelId)) {
|
|
if(!oldChannel.getParentId().equals(channelId)) {
|
|
return AjaxResult.error("门店'" + oldChannel.getName() + "'编辑失败");
|
|
return AjaxResult.error("门店'" + oldChannel.getName() + "'编辑失败");
|
|
}
|
|
}
|
|
@@ -583,6 +601,10 @@ public class ChannelController extends BaseApiController {
|
|
}
|
|
}
|
|
|
|
|
|
Long parentlId = SecurityUtils.getLoginUser().getChannelId();
|
|
Long parentlId = SecurityUtils.getLoginUser().getChannelId();
|
|
|
|
+ Channel existChannel = channelService.getById(parentlId);
|
|
|
|
+ if (existChannel.getStatus() == ChannelStatusEnum.OFF) {
|
|
|
|
+ return AjaxResult.error("账号异常");
|
|
|
|
+ }
|
|
Channel queryChannel = channelService.getById(channel.getChannelId());
|
|
Channel queryChannel = channelService.getById(channel.getChannelId());
|
|
if(null == queryChannel || null == queryChannel.getChannelId()) {
|
|
if(null == queryChannel || null == queryChannel.getChannelId()) {
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|