|
@@ -153,7 +153,6 @@ public class ChannelMgrController extends BaseApiController {
|
|
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());
|
|
list = channelService.selectChannelList(queryWrapper);
|
|
list = channelService.selectChannelList(queryWrapper);
|
|
-
|
|
|
|
if (null != list && list.size() > 0) {
|
|
if (null != list && list.size() > 0) {
|
|
for (ChannelVO channelVO : list) {
|
|
for (ChannelVO channelVO : list) {
|
|
//判断当前渠道下有无子渠道和门店
|
|
//判断当前渠道下有无子渠道和门店
|
|
@@ -404,7 +403,6 @@ public class ChannelMgrController extends BaseApiController {
|
|
return "";
|
|
return "";
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 渠道转门店
|
|
* 渠道转门店
|
|
*
|
|
*
|
|
@@ -418,7 +416,7 @@ public class ChannelMgrController extends BaseApiController {
|
|
@ApiOperation(value = "渠道转门店", notes = "渠道转门店")
|
|
@ApiOperation(value = "渠道转门店", notes = "渠道转门店")
|
|
@PostMapping("/transform")
|
|
@PostMapping("/transform")
|
|
@PreAuthorize("@ss.hasPermi('business:channel:edit')")
|
|
@PreAuthorize("@ss.hasPermi('business:channel:edit')")
|
|
- public AjaxResult channelTransformToShop(@RequestBody ChannelParam channelParam) {
|
|
|
|
|
|
+ public AjaxResult channelTransformToShop( @RequestBody ChannelParam channelParam) {
|
|
if (null == channelParam || null == channelParam.getChannelId() || null == channelParam.getParentId()) {
|
|
if (null == channelParam || null == channelParam.getChannelId() || null == channelParam.getParentId()) {
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
}
|
|
}
|
|
@@ -431,7 +429,7 @@ public class ChannelMgrController extends BaseApiController {
|
|
if (channelParam.getChannelId() == channelParam.getParentId()){
|
|
if (channelParam.getChannelId() == channelParam.getParentId()){
|
|
return AjaxResult.error("渠道'" + channel.getName() + "'转门店失败,不能选择自己作为上级渠道");
|
|
return AjaxResult.error("渠道'" + channel.getName() + "'转门店失败,不能选择自己作为上级渠道");
|
|
}
|
|
}
|
|
- //判断当前渠道下有无子渠道和门店
|
|
|
|
|
|
+ //判断当前渠道下有无子渠道
|
|
LambdaQueryWrapper<Channel> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Channel> queryWrapper = new LambdaQueryWrapper<>();
|
|
if (null != channelParam.getChannelId()) {
|
|
if (null != channelParam.getChannelId()) {
|
|
queryWrapper.eq(Channel::getParentId, channelParam.getChannelId());
|
|
queryWrapper.eq(Channel::getParentId, channelParam.getChannelId());
|
|
@@ -447,26 +445,26 @@ public class ChannelMgrController extends BaseApiController {
|
|
Channel parentChannel = channelService.getById(channelParam.getParentId());
|
|
Channel parentChannel = channelService.getById(channelParam.getParentId());
|
|
boolean mobileChange = false; // 手机号码是否有变更
|
|
boolean mobileChange = false; // 手机号码是否有变更
|
|
channel.setParentId(channelParam.getParentId());
|
|
channel.setParentId(channelParam.getParentId());
|
|
- channel.setLevel(0);
|
|
|
|
|
|
+ channel.setLevel(2);
|
|
channel.setChannelNo(parentChannel.getChannelNo()+"."+channel.getChannelId());
|
|
channel.setChannelNo(parentChannel.getChannelNo()+"."+channel.getChannelId());
|
|
//佣金比例暂定为0
|
|
//佣金比例暂定为0
|
|
channel.setCommRate(BigDecimal.ZERO);
|
|
channel.setCommRate(BigDecimal.ZERO);
|
|
/**
|
|
/**
|
|
- //校验佣金比例,不能高于其父经销商的佣金比例
|
|
|
|
- if (null != channel.getParentId() && channel.getParentId() != 0) {
|
|
|
|
- Channel parentChannel = channelService.getById(channel.getParentId());
|
|
|
|
- if (null != parentChannel) {
|
|
|
|
- if (null != parentChannel.getCommRate()
|
|
|
|
- && channel.getCommRate().compareTo(parentChannel.getCommRate()) > 0) {
|
|
|
|
- return AjaxResult.error("佣金比例不能高于父经销商的佣金比例");
|
|
|
|
- }
|
|
|
|
- channel.setLevel(parentChannel.getLevel() + 1);
|
|
|
|
- channel.setChannelNo(parentChannel.getChannelNo() + ".");
|
|
|
|
- } else {
|
|
|
|
- return AjaxResult.error("父经销商不存在");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ //校验佣金比例,不能高于其父经销商的佣金比例
|
|
|
|
+ if (null != channel.getParentId() && channel.getParentId() != 0) {
|
|
|
|
+ Channel parentChannel = channelService.getById(channel.getParentId());
|
|
|
|
+ if (null != parentChannel) {
|
|
|
|
+ if (null != parentChannel.getCommRate()
|
|
|
|
+ && channel.getCommRate().compareTo(parentChannel.getCommRate()) > 0) {
|
|
|
|
+ return AjaxResult.error("佣金比例不能高于父经销商的佣金比例");
|
|
|
|
+ }
|
|
|
|
+ channel.setLevel(parentChannel.getLevel() + 1);
|
|
|
|
+ channel.setChannelNo(parentChannel.getChannelNo() + ".");
|
|
|
|
+ } else {
|
|
|
|
+ return AjaxResult.error("父经销商不存在");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
*/
|
|
*/
|
|
channelService.updateChannel(channel, mobileChange);
|
|
channelService.updateChannel(channel, mobileChange);
|
|
|
|
|