fix(自定义对比): 78390

This commit is contained in:
yjz
2023-11-14 13:59:08 +08:00
parent e31e7bf650
commit a03d84609a
@@ -77,6 +77,7 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl<LawsCustomComp
private final ISysDictItemService sysDictItemService;
private final IOSSFileService iossFileService;
public static final String STANDARD_NUMBER = "standard_number";
public static final String IS_SHOW = "is_show";
public LawsCustomCompareInfoServiceImpl(LawsCustomCompareInfoMapper lawsCustomCompareInfoMapper,
ILawsCustomCompareInfoStandardService lawsCustomCompareInfoStandardService,
@@ -112,16 +113,19 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl<LawsCustomComp
queryWrapper.and(qw -> list.forEach(v -> qw.or(iqw -> iqw.like("referenceCountry", v))));
}
queryWrapper.like(StringUtils.isNotBlank(lawsCustomCompareInfoVO.getAuthor()), "realname", lawsCustomCompareInfoVO.getAuthor());
queryWrapper.like(StringUtils.isNotBlank(lawsCustomCompareInfoVO.getIsShow()), "is_show", lawsCustomCompareInfoVO.getIsShow());
queryWrapper.like(StringUtils.isNotBlank(lawsCustomCompareInfoVO.getIsShow()), IS_SHOW, lawsCustomCompareInfoVO.getIsShow());
// 数据权限,默认只能查看公开的数据和操作人是当前登录人数据,管理员查看所有
// 数据权限,默认只能查看公开的数据和操作人是当前登录人数据,管理员查看所有
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> roleIds = Arrays.asList(loginUser.getRoleIds().split(","));
if (!roleIds.contains("admin")){
queryWrapper.eq("create_by", loginUser.getId());
queryWrapper.eq("is_show", LawsCustomCompareCommon.IS_SHOW_1);
queryWrapper.and(qw ->
qw.and(qwi -> qwi.eq(IS_SHOW, LawsCustomCompareCommon.IS_SHOW_0)
.eq("create_by", loginUser.getUsername()))
.or().eq(IS_SHOW, LawsCustomCompareCommon.IS_SHOW_1));
}
queryWrapper.eq("del_flag", 0);
queryWrapper.orderByDesc("create_time");
return lawsCustomCompareInfoMapper.queryByPage(new Page<>(pageNo, pageSize), queryWrapper);
}