mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 02:46:50 +08:00
@@ -32,6 +32,8 @@ public class UrlSecurityFilterImpl implements IUrlSecurityFilter{
|
||||
noLoginUrls.add("/xboe/sys/user/sync-all");
|
||||
//noLoginUrls.add("");
|
||||
noLoginUrls.add("/xboe/m/exam/alone-extend/save");
|
||||
|
||||
noLoginUrls.add("/xboe/m/course/manage/test");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -229,6 +229,7 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
public UserOrgIds getOrgIds() {
|
||||
UserOrgIds uids=new UserOrgIds();
|
||||
List<String> orgIds = new ArrayList<>();
|
||||
|
||||
uids.setIds(orgIds);
|
||||
String token = TokenProxy.getToken(request);
|
||||
String type="application/json";
|
||||
@@ -260,12 +261,29 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
// orgIds.add(elements.next().toString());
|
||||
// }
|
||||
// }
|
||||
Set<String> orgSetIds = new HashSet<>();//用于排重判断
|
||||
|
||||
if(rootNode.get("result")!=null & rootNode.get("result").get("mainList")!=null) {
|
||||
JsonNode result = rootNode.get("result").get("mainList");
|
||||
Iterator<JsonNode> elements = result.elements();
|
||||
if(rootNode.get("result")!=null) {
|
||||
JsonNode mainList = rootNode.get("result").get("mainList");
|
||||
JsonNode readOnlyList = rootNode.get("result").get("readOnlyList");
|
||||
//主列表
|
||||
if(mainList!=null && !mainList.isEmpty()) {
|
||||
Iterator<JsonNode> elements = mainList.elements();
|
||||
while (elements.hasNext()){
|
||||
orgIds.add(elements.next().toString());
|
||||
String oid=elements.next().asText();
|
||||
orgIds.add(oid);
|
||||
orgSetIds.add(oid);
|
||||
}
|
||||
}
|
||||
//只读列表
|
||||
if(readOnlyList!=null && !readOnlyList.isEmpty()) {
|
||||
Iterator<JsonNode> elements = readOnlyList.elements();
|
||||
while (elements.hasNext()){
|
||||
String oid=elements.next().asText();
|
||||
if(!orgSetIds.contains(oid)) {
|
||||
orgIds.add(oid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,6 +294,24 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// String json="{\"mainList\": [\"6998568222014574593\",\"6998568178507059201\",\"6998568191714922497\",\"6998568195720482817\",\"6998568197947658241\",\"6998568188397228033\",\"6998568201529593857\",\"6998568211277156353\",\"6998568231271403521\",\"6998568237076320257\",\"6998568255854219265\",\"6998568239068614657\",\"6998568283775700993\",\"6998568294148214785\",\"6998568454492262401\",\"6998568457495384065\",\"6998568488780697601\",\"6998568492371021825\",\"6998568492924669953\",\"6998568219623821313\",\"6998568507143360513\",\"6998568507181109249\",\"6998568507248218113\",\"6998568181724090369\",\"6998568481679740929\",\"6998568513686474753\",\"6998568547987492865\",\"6998568579704819713\",\"6998568598142980097\",\"6998568598520467457\",\"6998568600449847297\",\"6998568651326754817\",\"6998568652689903617\",\"6998568658578706433\",\"6998568496787623937\"]}";
|
||||
// ObjectMapper mapper=new ObjectMapper();
|
||||
//
|
||||
// try {
|
||||
// JsonNode rootNode= mapper.readTree(json);
|
||||
// JsonNode mainList = rootNode.get("mainList");
|
||||
// Iterator<JsonNode> elements = mainList.elements();
|
||||
// while (elements.hasNext()){
|
||||
// String oid=elements.next().asText();
|
||||
// System.out.println(oid);
|
||||
// }
|
||||
//
|
||||
// }catch(Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
|
||||
private String getBaseUrl(String url) {
|
||||
String baseUrl=SysConstant.getConfigValue("xboe.server.userbasic.url");
|
||||
if(StringUtils.isBlank(baseUrl)) {
|
||||
|
||||
@@ -105,6 +105,14 @@ public class CourseManageApi extends ApiBaseController{
|
||||
@Autowired
|
||||
IDataUserSyncService userSyncService;
|
||||
|
||||
|
||||
@PostMapping("/test")
|
||||
public JsonResponse<PageList<Course>> findTest(Pagination pager,CourseQueryDto dto){
|
||||
//dto.setOrgAid("7003708665807110150");
|
||||
PageList<Course> coursePageList = courseService.findPage(pager.getPageIndex(), pager.getPageSize(),dto);
|
||||
return success(coursePageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理列表的查询
|
||||
* @param pager
|
||||
@@ -118,12 +126,15 @@ public class CourseManageApi extends ApiBaseController{
|
||||
//getCurrent().get
|
||||
try {
|
||||
UserOrgIds userOrgIds=outSideDataService.getOrgIds();
|
||||
|
||||
List<String> orgIds = userOrgIds.getIds();
|
||||
|
||||
if(userOrgIds.getPermissions().containsKey(UserOrgIds.IsSystemAdminKey)){
|
||||
dto.setIsSystemAdmin(userOrgIds.getPermissions().get(UserOrgIds.IsSystemAdminKey));
|
||||
}else {
|
||||
dto.setIsSystemAdmin(false);
|
||||
}
|
||||
|
||||
String ids="";
|
||||
if(userOrgIds.getIds()!=null && !userOrgIds.getIds().isEmpty())
|
||||
{
|
||||
|
||||
@@ -256,13 +256,12 @@ public class CourseServiceImpl implements ICourseService {
|
||||
List<IFieldFilter> filters = createFilters(dto);
|
||||
|
||||
//有权限的查询,也同时查询出创建人的数据,在权限上
|
||||
|
||||
if(TempFilterConfig.Manager_CourseFile_ByOrgIds) {
|
||||
if(dto.getIsSystemAdmin()==null || !dto.getIsSystemAdmin()) {
|
||||
|
||||
if(StringUtil.isNotBlank(dto.getOrgIds())){
|
||||
log.error("【"+dto.getOrgAid()+"】 按机构过滤和自己创建的课程");
|
||||
log.error(" orgids "+dto.getOrgIds());
|
||||
//log.info("【"+dto.getOrgAid()+"】 按机构过滤和自己创建的课程");
|
||||
//log.info(" orgids "+dto.getOrgIds());
|
||||
if(dto.getOrgIds().contains(",")){
|
||||
String[] split = dto.getOrgIds().split(",");
|
||||
List<String> strings = Arrays.asList(split);
|
||||
@@ -271,12 +270,12 @@ public class CourseServiceImpl implements ICourseService {
|
||||
filters.add(FieldFilters.or(FieldFilters.eq("orgId",dto.getOrgIds()),FieldFilters.eq("sysCreateAid",dto.getOrgAid())));
|
||||
}
|
||||
}else {
|
||||
log.error("【"+dto.getOrgAid()+"】 机构ids没有, 只查询自己创建的课程");
|
||||
//log.info("【"+dto.getOrgAid()+"】 机构ids没有, 只查询自己创建的课程");
|
||||
//没有机构权限,只能查出自己创建的
|
||||
filters.add(FieldFilters.eq("sysCreateAid",dto.getOrgAid()));
|
||||
}
|
||||
}else {
|
||||
log.error("【"+dto.getOrgAid()+"】IsSystemAdmin is true 不过机构过滤,查询全部");
|
||||
//log.info("【"+dto.getOrgAid()+"】IsSystemAdmin is true 不过机构过滤,查询全部");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,7 +293,7 @@ public class CourseServiceImpl implements ICourseService {
|
||||
}
|
||||
|
||||
PageList<Course> rs=courseDao.findPage(pageIndex, pageSize, filters, oc);
|
||||
|
||||
//log.info("查询出的条数:"+rs.getCount());
|
||||
return rs;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user