添加超级代理商过滤

master
username 7 months ago
parent c31da7b9ea
commit 834e4af13f

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

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

@ -71,12 +71,14 @@ public class DfProductArticleController extends BaseController {
LambdaQueryWrapper<DfProductArticle> queryWrapper = new LambdaQueryWrapper();
boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
if (!admin) {
if ("-99".equals(dfProductArticle.getStatus())) {
} else {
SysUser byId = userService.getById(SecurityUtils.getUserId());
if ("jj".equals(byId.getUserType()) || "kh".equals(byId.getUserType())) {
queryWrapper.eq(DfProductArticle::getStatus, "1");
if (!sysUser.getDeptId().equals(-1L)) {
if ("-99".equals(dfProductArticle.getStatus())) {
} else {
SysUser byId = userService.getById(SecurityUtils.getUserId());
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 (isAnonymous) {
List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerIdByUserId(sysUser.getUserId());
if (productIdsByBrokerId.size() == 0) {
productIdsByBrokerId.add(0L);
}
if (!"1".equals(dfProductInfo.getSelectByBroker())) {
queryWrapper.in(DfProductInfo::getId, productIdsByBrokerId)
.or()
.in(DfProductInfo::getCreateDept, SecurityUtils.getDeptId());
}
} else {
List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerId();
if (productIdsByBrokerId.size() == 0) {
productIdsByBrokerId.add(0L);
}
if (!"1".equals(dfProductInfo.getSelectByBroker())) {
queryWrapper.in(DfProductInfo::getId, productIdsByBrokerId)
.or()
.in(DfProductInfo::getCreateDept, SecurityUtils.getDeptId());
if (!sysUser.getDeptId().equals(-1L)) {
if (isAnonymous) {
List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerIdByUserId(sysUser.getUserId());
if (productIdsByBrokerId.size() == 0) {
productIdsByBrokerId.add(0L);
}
if (!"1".equals(dfProductInfo.getSelectByBroker())) {
queryWrapper.in(DfProductInfo::getId, productIdsByBrokerId)
.or()
.in(DfProductInfo::getCreateDept, SecurityUtils.getDeptId());
}
} else {
List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerId();
if (productIdsByBrokerId.size() == 0) {
productIdsByBrokerId.add(0L);
}
if (!"1".equals(dfProductInfo.getSelectByBroker())) {
queryWrapper.in(DfProductInfo::getId, productIdsByBrokerId)
.or()
.in(DfProductInfo::getCreateDept, SecurityUtils.getDeptId());
}
}
}
}

@ -76,12 +76,13 @@ public class DfProductMomentController extends BaseController {
condition(queryWrapper,dfProductMoment);
boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
if (!admin) {
if ("-99".equals(dfProductMoment.getStatus())) {
} else {
SysUser byId = userService.getById(SecurityUtils.getUserId());
if ("jj".equals(byId.getUserType()) || "kh".equals(byId.getUserType())) {
queryWrapper.eq(DfProductMoment::getStatus, "1");
if (!sysUser.getDeptId().equals(-1L)) {
if ("-99".equals(dfProductMoment.getStatus())) {
} else {
SysUser byId = userService.getById(SecurityUtils.getUserId());
if ("jj".equals(byId.getUserType()) || "kh".equals(byId.getUserType())) {
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");
}
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
if ("-99".equals(dfProductPoster.getStatus())) {
} else {
List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerId();
List<DfProductPoster> list = dfProductPosterService.list(new LambdaQueryWrapper<DfProductPoster>()
.eq(DfProductPoster::getPosterType, "1"));
List<Long> productIds = list.stream()
.map(DfProductPoster::getProductId)
.collect(Collectors.toList());
if (productIdsByBrokerId.size() == 0) {
productIdsByBrokerId.add(0L);
}
productIdsByBrokerId.addAll(productIds);
queryWrapper.nested(wrapper -> wrapper.in(DfProductPoster::getProductId, productIdsByBrokerId)
.or()
.isNull(DfProductPoster::getProductId));
SysUser byId = userService.getById(SecurityUtils.getUserId());
if ("jj".equals(byId.getUserType()) || "kh".equals(byId.getUserType())) {
queryWrapper.eq(DfProductPoster::getStatus,"1");
if (!sysUser.getDeptId().equals(-1L)) {
if ("-99".equals(dfProductPoster.getStatus())) {
} else {
List<Long> productIdsByBrokerId = dfBrokerService.getProductIdsByBrokerId();
List<DfProductPoster> list = dfProductPosterService.list(new LambdaQueryWrapper<DfProductPoster>()
.eq(DfProductPoster::getPosterType, "1"));
List<Long> productIds = list.stream()
.map(DfProductPoster::getProductId)
.collect(Collectors.toList());
if (productIdsByBrokerId.size() == 0) {
productIdsByBrokerId.add(0L);
}
productIdsByBrokerId.addAll(productIds);
queryWrapper.nested(wrapper -> wrapper.in(DfProductPoster::getProductId, productIdsByBrokerId)
.or()
.isNull(DfProductPoster::getProductId));
SysUser byId = userService.getById(SecurityUtils.getUserId());
if ("jj".equals(byId.getUserType()) || "kh".equals(byId.getUserType())) {
queryWrapper.eq(DfProductPoster::getStatus,"1");
}
}
}
}

Loading…
Cancel
Save