|
@@ -123,7 +123,7 @@ public class ChannelController extends BaseApiController {
|
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
|
}
|
|
|
if(!parentlId.equals(queryChannel.getParentId())) {
|
|
|
- return AjaxResult.error("非当前用户的子渠道,查询失败");
|
|
|
+ return AjaxResult.error("非当前用户的下级,查询失败");
|
|
|
}
|
|
|
BeanUtils.copyProperties(queryChannel, channelVO);
|
|
|
// 查询今日的销售额、佣金收入、新增用户数
|
|
@@ -141,7 +141,7 @@ public class ChannelController extends BaseApiController {
|
|
|
@PostMapping("subchannel/create")
|
|
|
public AjaxResult channelCreate(@Validated @RequestBody ChannelParam channelParam) {
|
|
|
if (channelParam.getChannelId() != null && channelParam.getChannelId() != 0) {
|
|
|
- return AjaxResult.error("该渠道已存在");
|
|
|
+ return AjaxResult.error("该代理已存在");
|
|
|
}
|
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
|
Channel channel = mapperFacade.map(channelParam, Channel.class);
|
|
@@ -152,7 +152,7 @@ public class ChannelController extends BaseApiController {
|
|
|
queryWrapper.gt(Channel::getLevel, 0);
|
|
|
int nameCount = channelService.count(queryWrapper);
|
|
|
if(nameCount > 0) {
|
|
|
- return AjaxResult.error("渠道名称" + channel.getName() + "已存在!");
|
|
|
+ return AjaxResult.error("代理名称" + channel.getName() + "已存在!");
|
|
|
}
|
|
|
int mobileCount = channelService.count(
|
|
|
new LambdaQueryWrapper<Channel>().eq(Channel::getMobile, channel.getMobile()));
|
|
@@ -163,7 +163,7 @@ public class ChannelController extends BaseApiController {
|
|
|
Channel parentChannel = channelService.getById(channel.getParentId());
|
|
|
if(null != parentChannel && null != parentChannel.getCommRate()) {
|
|
|
if(channel.getCommRate().compareTo(parentChannel.getCommRate()) > 0) {
|
|
|
- return AjaxResult.error("佣金比例不能高于父渠道的佣金比例");
|
|
|
+ return AjaxResult.error("佣金比例不能高于上级代理的佣金比例");
|
|
|
}
|
|
|
}
|
|
|
channel.setLevel(parentChannel.getLevel()+1);
|
|
@@ -172,10 +172,10 @@ public class ChannelController extends BaseApiController {
|
|
|
try {
|
|
|
channelService.saveChannel(channel, ChannelRoleEnum.CHANNEL);
|
|
|
} catch (Exception e) {
|
|
|
- return AjaxResult.error("渠道'" + channel.getName() + "'新增失败" + e.getMessage());
|
|
|
+ return AjaxResult.error("代理'" + channel.getName() + "'新增失败" + e.getMessage());
|
|
|
}
|
|
|
|
|
|
- return AjaxResult.success("渠道'" + channel.getName() + "'新增成功");
|
|
|
+ return AjaxResult.success("代理'" + channel.getName() + "'新增成功");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -194,11 +194,11 @@ public class ChannelController extends BaseApiController {
|
|
|
// 1、校验修改子渠道是否为当前用户的子渠道
|
|
|
Channel oldChannel = channelService.getById(channel.getChannelId());
|
|
|
if(null == oldChannel || null == oldChannel.getChannelId()) {
|
|
|
- return AjaxResult.error("渠道'" + oldChannel.getName() + "'编辑失败,渠道ID异常");
|
|
|
+ return AjaxResult.error("代理'" + oldChannel.getName() + "'编辑失败");
|
|
|
}
|
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
|
if(!oldChannel.getParentId().equals(channelId)) {
|
|
|
- return AjaxResult.error("渠道'" + oldChannel.getName() + "'编辑失败,非当前用户子渠道");
|
|
|
+ return AjaxResult.error("代理'" + oldChannel.getName() + "'编辑失败");
|
|
|
}
|
|
|
// 2.校验名称是否重复、手机号是否存在(渠道表);
|
|
|
if(!channel.getName().equals(oldChannel.getName())) {
|
|
@@ -207,7 +207,7 @@ public class ChannelController extends BaseApiController {
|
|
|
queryWrapper.gt(Channel::getLevel, 0);
|
|
|
int nameCount = channelService.count(queryWrapper);
|
|
|
if(nameCount > 0) {
|
|
|
- return AjaxResult.error("渠道名称" + channel.getName() + "已存在!");
|
|
|
+ return AjaxResult.error("代理名称" + channel.getName() + "已存在!");
|
|
|
}
|
|
|
}
|
|
|
boolean mobileChange = false; // 手机号码是否有变更
|
|
@@ -226,7 +226,7 @@ public class ChannelController extends BaseApiController {
|
|
|
Channel parentChannel = channelService.getById(oldChannel.getParentId());
|
|
|
if(null != parentChannel && null != parentChannel.getCommRate()) {
|
|
|
if(channel.getCommRate().compareTo(parentChannel.getCommRate()) > 0) {
|
|
|
- return AjaxResult.error("佣金比例不能高于父渠道的佣金比例");
|
|
|
+ return AjaxResult.error("佣金比例不能高于上级代理的佣金比例");
|
|
|
}
|
|
|
}
|
|
|
// 查询子渠道的最大佣金比例
|
|
@@ -237,7 +237,7 @@ public class ChannelController extends BaseApiController {
|
|
|
if(null != map && map.containsKey("commRate")) {
|
|
|
BigDecimal commRate = new BigDecimal(map.get("commRate").toString());
|
|
|
if(!commRate.equals(BigDecimal.ZERO) && channel.getCommRate().compareTo(commRate) < 0) {
|
|
|
- return AjaxResult.error("不能低于其子渠道的最大佣金比例");
|
|
|
+ return AjaxResult.error("不能低于其下级的最大佣金比例");
|
|
|
}
|
|
|
}
|
|
|
try {
|
|
@@ -246,7 +246,7 @@ public class ChannelController extends BaseApiController {
|
|
|
} catch (Exception e) {
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
}
|
|
|
- return AjaxResult.success("渠道'" + channel.getName() + "'编辑成功");
|
|
|
+ return AjaxResult.success("代理'" + channel.getName() + "'编辑成功");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -270,7 +270,7 @@ public class ChannelController extends BaseApiController {
|
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
|
}
|
|
|
if(!channelId.equals(queryChannel.getParentId())) {
|
|
|
- return AjaxResult.error("非当前用户的子渠道,查询失败");
|
|
|
+ return AjaxResult.error("非当前用户的下级,查询失败");
|
|
|
}
|
|
|
channelId = _channelId;
|
|
|
}
|
|
@@ -363,7 +363,7 @@ public class ChannelController extends BaseApiController {
|
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
|
}
|
|
|
if(!parentlId.equals(queryChannel.getParentId())) {
|
|
|
- return AjaxResult.error("非当前用户的经销商,查询失败");
|
|
|
+ return AjaxResult.error("非当前用户的门店,查询失败");
|
|
|
}
|
|
|
BeanUtils.copyProperties(queryChannel, channelVO);
|
|
|
// 查询今日的销售额、佣金收入、新增用户数
|
|
@@ -381,7 +381,7 @@ public class ChannelController extends BaseApiController {
|
|
|
@PostMapping("site/create")
|
|
|
public AjaxResult siteCreate(@Validated @RequestBody ChannelParam channelParam) {
|
|
|
if (channelParam.getChannelId() != null && channelParam.getChannelId() != 0) {
|
|
|
- return AjaxResult.error("该经销商已存在");
|
|
|
+ return AjaxResult.error("该门店已存在");
|
|
|
}
|
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
|
|
|
@@ -393,7 +393,7 @@ public class ChannelController extends BaseApiController {
|
|
|
queryWrapper.eq(Channel::getLevel, 0);
|
|
|
int nameCount = channelService.count(queryWrapper);
|
|
|
if(nameCount > 0) {
|
|
|
- return AjaxResult.error("经销商名称" + channel.getName() + "已存在!");
|
|
|
+ return AjaxResult.error("门店名称" + channel.getName() + "已存在!");
|
|
|
}
|
|
|
int mobileCount = channelService.count(
|
|
|
new LambdaQueryWrapper<Channel>().eq(Channel::getMobile, channel.getMobile()));
|
|
@@ -404,7 +404,7 @@ public class ChannelController extends BaseApiController {
|
|
|
Channel parentChannel = channelService.getById(channel.getParentId());
|
|
|
if(null != parentChannel && null != parentChannel.getCommRate()) {
|
|
|
if(channel.getCommRate().compareTo(parentChannel.getCommRate()) > 0) {
|
|
|
- return AjaxResult.error("佣金比例不能高于父渠道的佣金比例");
|
|
|
+ return AjaxResult.error("佣金比例不能高于上级代理的佣金比例");
|
|
|
}
|
|
|
}
|
|
|
channel.setLevel(0);
|
|
@@ -413,9 +413,9 @@ public class ChannelController extends BaseApiController {
|
|
|
try {
|
|
|
channelService.saveChannel(channel,ChannelRoleEnum.SALESITE);
|
|
|
} catch (Exception e) {
|
|
|
- return AjaxResult.error("经销商'" + channel.getName() + "'新增失败"+e.getMessage());
|
|
|
+ return AjaxResult.error("门店'" + channel.getName() + "'新增失败"+e.getMessage());
|
|
|
}
|
|
|
- return AjaxResult.success("经销商'" + channel.getName() + "'新增成功");
|
|
|
+ return AjaxResult.success("门店'" + channel.getName() + "'新增成功");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -435,11 +435,11 @@ public class ChannelController extends BaseApiController {
|
|
|
// 1、校验修改子渠道是否为当前用户的子渠道
|
|
|
Channel oldChannel = channelService.getById(channel.getChannelId());
|
|
|
if(null == oldChannel || null == oldChannel.getChannelId()) {
|
|
|
- return AjaxResult.error("经销商'" + oldChannel.getName() + "'编辑失败,渠道ID异常");
|
|
|
+ return AjaxResult.error("门店'" + oldChannel.getName() + "'编辑失败");
|
|
|
}
|
|
|
Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
|
if(!oldChannel.getParentId().equals(channelId)) {
|
|
|
- return AjaxResult.error("经销商'" + oldChannel.getName() + "'编辑失败,非当前用户子渠道");
|
|
|
+ return AjaxResult.error("门店'" + oldChannel.getName() + "'编辑失败");
|
|
|
}
|
|
|
// 2.校验名称是否重复、手机号是否存在(渠道表);
|
|
|
if(!channel.getName().equals(oldChannel.getName())) {
|
|
@@ -449,7 +449,7 @@ public class ChannelController extends BaseApiController {
|
|
|
queryWrapper.eq(Channel::getLevel, 0);
|
|
|
int nameCount = channelService.count(queryWrapper);
|
|
|
if(nameCount > 0) {
|
|
|
- return AjaxResult.error("经销商名称" + channel.getName() + "已存在!");
|
|
|
+ return AjaxResult.error("门店名称" + channel.getName() + "已存在!");
|
|
|
}
|
|
|
}
|
|
|
boolean mobileChange = false; // 手机号码是否有变更
|
|
@@ -468,16 +468,16 @@ public class ChannelController extends BaseApiController {
|
|
|
Channel parentChannel = channelService.getById(oldChannel.getParentId());
|
|
|
if(null != parentChannel && null != parentChannel.getCommRate()) {
|
|
|
if(channel.getCommRate().compareTo(parentChannel.getCommRate()) > 0) {
|
|
|
- return AjaxResult.error("佣金比例不能高于父渠道的佣金比例");
|
|
|
+ return AjaxResult.error("佣金比例不能高于上级代理的佣金比例");
|
|
|
}
|
|
|
}
|
|
|
try {
|
|
|
channel.setUserId(oldChannel.getUserId());
|
|
|
channelService.updateChannel(channel, mobileChange);
|
|
|
} catch (Exception e) {
|
|
|
- return AjaxResult.error("经销商'" + channel.getName() + "'编辑失败");
|
|
|
+ return AjaxResult.error("门店'" + channel.getName() + "'编辑失败");
|
|
|
}
|
|
|
- return AjaxResult.success("经销商'" + channel.getName() + "'编辑成功");
|
|
|
+ return AjaxResult.success("门店'" + channel.getName() + "'编辑成功");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -500,7 +500,7 @@ public class ChannelController extends BaseApiController {
|
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
|
}
|
|
|
if(!parentlId.equals(queryChannel.getParentId())) {
|
|
|
- return AjaxResult.error(queryChannel.getName() + "非当前用户的经销商, 认证审核失败");
|
|
|
+ return AjaxResult.error(queryChannel.getName() + "非当前用户的门店, 认证审核失败");
|
|
|
}
|
|
|
try {
|
|
|
if(channel.getVerifyStatus() == ChannelVerifyStatusEnum.ACCEPT) {
|
|
@@ -510,9 +510,9 @@ public class ChannelController extends BaseApiController {
|
|
|
}
|
|
|
channelService.updateById(channel);
|
|
|
} catch (Exception e) {
|
|
|
- return AjaxResult.error("经销商'" + channel.getName() + "'认证审核失败");
|
|
|
+ return AjaxResult.error("门店'" + channel.getName() + "'认证审核失败");
|
|
|
}
|
|
|
- return AjaxResult.success("经销商'" + channel.getName() + "'认证审核成功");
|
|
|
+ return AjaxResult.success("门店'" + channel.getName() + "'认证审核成功");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -532,9 +532,9 @@ public class ChannelController extends BaseApiController {
|
|
|
channel.setVerifyStatus(ChannelVerifyStatusEnum.WAIT);
|
|
|
channelService.updateById(channel);
|
|
|
} catch (Exception e) {
|
|
|
- return AjaxResult.error("经销商'" + channel.getName() + "'提交认证信息失败");
|
|
|
+ return AjaxResult.error("门店'" + channel.getName() + "'提交认证信息失败");
|
|
|
}
|
|
|
- return AjaxResult.success("经销商'" + channel.getName() + "'提交认证信息成功");
|
|
|
+ return AjaxResult.success("门店'" + channel.getName() + "'提交认证信息成功");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -596,8 +596,8 @@ public class ChannelController extends BaseApiController {
|
|
|
}
|
|
|
return AjaxResult.success(channelVO);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 场景是这里要显示待审核数量
|
|
|
*
|