添加超级代理商过滤

master
username 7 months ago
parent c31da7b9ea
commit 834e4af13f

@ -64,9 +64,12 @@ public class DfBizClueController extends BaseController {
queryWrapper.orderByDesc(DfBizClue::getBrowseTime); queryWrapper.orderByDesc(DfBizClue::getBrowseTime);
boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId()); boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
if (!admin) { if (!admin) {
SysUser byId = userService.getById(SecurityUtils.getUserId()); SysUser sysUser = userService.selectUserById(SecurityUtils.getUserId());
if ("jj".equals(byId.getUserType())) { if (!sysUser.getDeptId().equals(-1L)) {
queryWrapper.eq(DfBizClue::getUserId,SecurityUtils.getUserId()); SysUser byId = userService.getById(SecurityUtils.getUserId());
if ("jj".equals(byId.getUserType())) {
queryWrapper.eq(DfBizClue::getUserId,SecurityUtils.getUserId());
}
} }
} }
List<DfBizClue> list = dfBizClueService.list(queryWrapper); List<DfBizClue> list = dfBizClueService.list(queryWrapper);

@ -92,9 +92,12 @@ public class DfOrderController extends BaseController {
condition(queryWrapper, dfOrder); condition(queryWrapper, dfOrder);
boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId()); boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
if (!admin) { if (!admin) {
SysUser byId = userService.getById(SecurityUtils.getUserId()); SysUser sysUser = userService.selectUserById(SecurityUtils.getUserId());
if ("jj".equals(byId.getUserType())) { if (!sysUser.getDeptId().equals(-1L)) {
queryWrapper.eq(DfOrder::getBrokerId, SecurityUtils.getUserId()); SysUser byId = userService.getById(SecurityUtils.getUserId());
if ("jj".equals(byId.getUserType())) {
queryWrapper.eq(DfOrder::getBrokerId, SecurityUtils.getUserId());
}
} }
} }
String orderByColumn = dfOrder.getOrderByColumn(); String orderByColumn = dfOrder.getOrderByColumn();

@ -71,12 +71,14 @@ public class DfProductArticleController extends BaseController {
LambdaQueryWrapper<DfProductArticle> queryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<DfProductArticle> queryWrapper = new LambdaQueryWrapper();
boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId()); boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
if (!admin) { if (!admin) {
if ("-99".equals(dfProductArticle.getStatus())) { if (!sysUser.getDeptId().equals(-1L)) {
if ("-99".equals(dfProductArticle.getStatus())) {
} else {
SysUser byId = userService.getById(SecurityUtils.getUserId()); } else {
if ("jj".equals(byId.getUserType()) || "kh".equals(byId.getUserType())) { SysUser byId = userService.getById(SecurityUtils.getUserId());
queryWrapper.eq(DfProductArticle::getStatus, "1"); if ("jj".equals(byId.getUserType()) || "kh".equals(byId.getUserType())) {
queryWrapper.eq(DfProductArticle::getStatus, "1");
}
} }
} }
} }

@ -134,25 +134,27 @@ public class DfProductInfoController extends BaseController {
} }
} }
if (!SecurityUtils.isAdmin(sysUser.getUserId())) { if (!SecurityUtils.isAdmin(sysUser.getUserId())) {
if (isAnonymous) { if (!sysUser.getDeptId().equals(-1L)) {
List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerIdByUserId(sysUser.getUserId()); if (isAnonymous) {
if (productIdsByBrokerId.size() == 0) { List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerIdByUserId(sysUser.getUserId());
productIdsByBrokerId.add(0L); if (productIdsByBrokerId.size() == 0) {
} productIdsByBrokerId.add(0L);
if (!"1".equals(dfProductInfo.getSelectByBroker())) { }
queryWrapper.in(DfProductInfo::getId, productIdsByBrokerId) if (!"1".equals(dfProductInfo.getSelectByBroker())) {
.or() queryWrapper.in(DfProductInfo::getId, productIdsByBrokerId)
.in(DfProductInfo::getCreateDept, SecurityUtils.getDeptId()); .or()
} .in(DfProductInfo::getCreateDept, SecurityUtils.getDeptId());
} else { }
List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerId(); } else {
if (productIdsByBrokerId.size() == 0) { List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerId();
productIdsByBrokerId.add(0L); if (productIdsByBrokerId.size() == 0) {
} productIdsByBrokerId.add(0L);
if (!"1".equals(dfProductInfo.getSelectByBroker())) { }
queryWrapper.in(DfProductInfo::getId, productIdsByBrokerId) if (!"1".equals(dfProductInfo.getSelectByBroker())) {
.or() queryWrapper.in(DfProductInfo::getId, productIdsByBrokerId)
.in(DfProductInfo::getCreateDept, SecurityUtils.getDeptId()); .or()
.in(DfProductInfo::getCreateDept, SecurityUtils.getDeptId());
}
} }
} }
} }

@ -76,12 +76,13 @@ public class DfProductMomentController extends BaseController {
condition(queryWrapper,dfProductMoment); condition(queryWrapper,dfProductMoment);
boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId()); boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
if (!admin) { if (!admin) {
if ("-99".equals(dfProductMoment.getStatus())) { if (!sysUser.getDeptId().equals(-1L)) {
if ("-99".equals(dfProductMoment.getStatus())) {
} else { } else {
SysUser byId = userService.getById(SecurityUtils.getUserId()); SysUser byId = userService.getById(SecurityUtils.getUserId());
if ("jj".equals(byId.getUserType()) || "kh".equals(byId.getUserType())) { if ("jj".equals(byId.getUserType()) || "kh".equals(byId.getUserType())) {
queryWrapper.eq(DfProductMoment::getStatus, "1"); queryWrapper.eq(DfProductMoment::getStatus, "1");
}
} }
} }
} }

@ -85,25 +85,26 @@ public class DfProductPosterController extends BaseController {
queryWrapper.last("ORDER BY CASE WHEN t.serial_number IS NULL THEN 1 ELSE 0 END, t.serial_number ASC"); queryWrapper.last("ORDER BY CASE WHEN t.serial_number IS NULL THEN 1 ELSE 0 END, t.serial_number ASC");
} }
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) { if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
if ("-99".equals(dfProductPoster.getStatus())) { if (!sysUser.getDeptId().equals(-1L)) {
if ("-99".equals(dfProductPoster.getStatus())) {
} else { } else {
List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerId(); List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerId();
List<DfProductPoster> list = dfProductPosterService.list(new LambdaQueryWrapper<DfProductPoster>() List<DfProductPoster> list = dfProductPosterService.list(new LambdaQueryWrapper<DfProductPoster>()
.eq(DfProductPoster::getPosterType, "1")); .eq(DfProductPoster::getPosterType, "1"));
List<Long> productIds = list.stream() List<Long> productIds = list.stream()
.map(DfProductPoster::getProductId) .map(DfProductPoster::getProductId)
.collect(Collectors.toList()); .collect(Collectors.toList());
if (productIdsByBrokerId.size() == 0) { if (productIdsByBrokerId.size() == 0) {
productIdsByBrokerId.add(0L); productIdsByBrokerId.add(0L);
} }
productIdsByBrokerId.addAll(productIds); productIdsByBrokerId.addAll(productIds);
queryWrapper.nested(wrapper -> wrapper.in(DfProductPoster::getProductId, productIdsByBrokerId) queryWrapper.nested(wrapper -> wrapper.in(DfProductPoster::getProductId, productIdsByBrokerId)
.or() .or()
.isNull(DfProductPoster::getProductId)); .isNull(DfProductPoster::getProductId));
SysUser byId = userService.getById(SecurityUtils.getUserId()); SysUser byId = userService.getById(SecurityUtils.getUserId());
if ("jj".equals(byId.getUserType()) || "kh".equals(byId.getUserType())) { if ("jj".equals(byId.getUserType()) || "kh".equals(byId.getUserType())) {
queryWrapper.eq(DfProductPoster::getStatus,"1"); queryWrapper.eq(DfProductPoster::getStatus,"1");
}
} }
} }
} }

Loading…
Cancel
Save