Quellcode durchsuchen

merge from examcloud-R

deason vor 5 Jahren
Ursprung
Commit
eed74489a4
19 geänderte Dateien mit 240 neuen und 788 gelöschten Zeilen
  1. 45 130
      examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/OrgController.java
  2. 1 1
      examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/ResourceController.java
  3. 11 272
      examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/RolePrivilegeController.java
  4. 19 21
      examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/StudentController.java
  5. 0 30
      examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/bean/CustomPrivilegeDomain.java
  6. 0 73
      examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/bean/OrgPrivilegeTreeDomain.java
  7. 0 12
      examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/bean/ResourceDomain.java
  8. 1 8
      examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/PrivilegeGroupRepo.java
  9. 0 2
      examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/PrivilegeRepo.java
  10. 0 2
      examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/RootOrgPrivilegeRelationRepo.java
  11. 3 37
      examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/entity/PrivilegeGroupEntity.java
  12. 60 72
      examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/entity/ResourceEntity.java
  13. 3 8
      examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/OrgServiceImpl.java
  14. 92 81
      examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/ResourceServiceImpl.java
  15. 0 3
      examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/RolePrivilegeServiceImpl.java
  16. 1 1
      examcloud-core-basic-starter/src/main/resources/aliyun.xml
  17. 2 32
      examcloud-core-basic-starter/src/main/resources/org-properties.xml
  18. 1 2
      examcloud-core-basic-starter/src/main/resources/security.properties
  19. 1 1
      examcloud-core-basic-starter/src/main/resources/upyun.xml

+ 45 - 130
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/OrgController.java

@@ -1,5 +1,49 @@
 package cn.com.qmth.examcloud.core.basic.api.controller;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import javax.persistence.criteria.Predicate;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.codec.DecoderException;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.fileupload.disk.DiskFileItem;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.domain.Sort.Direction;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
 import cn.com.qmth.examcloud.api.commons.exchange.PageInfo;
 import cn.com.qmth.examcloud.api.commons.security.bean.User;
 import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
@@ -38,37 +82,7 @@ import cn.com.qmth.examcloud.web.redis.RedisClient;
 import cn.com.qmth.examcloud.web.support.ApiId;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import cn.com.qmth.examcloud.web.support.Naked;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.codec.DecoderException;
-import org.apache.commons.codec.binary.Hex;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.fileupload.disk.DiskFileItem;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.domain.Pageable;
-import org.springframework.data.domain.Sort;
-import org.springframework.data.domain.Sort.Direction;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.commons.CommonsMultipartFile;
-
-import javax.persistence.criteria.Predicate;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.*;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 /**
  * {@link StatusException} 状态码范围:001XXX<br>
@@ -1173,6 +1187,7 @@ public class OrgController extends ControllerSupport {
 	 * 方法注释
 	 *
 	 * @author WANGWEI
+	 * @param id
 	 * @param request
 	 * @param file
 	 * @throws IOException
@@ -1303,104 +1318,4 @@ public class OrgController extends ControllerSupport {
 		return map;
 	}
 
-	/**
-	 * 导入自定义菜单logo
-	 *
-	 * @author lideyin
-	 * @param request
-	 * @param file
-	 * @throws IOException
-	 */
-	@ApiOperation(value = "导入自定义菜单logo", notes = "导入自定义菜单logo")
-	@PostMapping("importCusMenuLogo/{orgId}")
-	@Transactional
-	public String importCusMenuLogo(@PathVariable Long orgId, HttpServletRequest request,
-							 @RequestParam CommonsMultipartFile file) throws IOException {
-
-		OrgEntity orgEntity = GlobalHelper.getEntity(orgRepo, orgId, OrgEntity.class);
-		if (null == orgEntity) {
-			throw new StatusException("140002", "orgEntity is null");
-		}
-
-		validateRootOrgIsolation(orgEntity.getRootId());
-
-		DiskFileItem fileItem = (DiskFileItem) file.getFileItem();
-		File storeLocation = fileItem.getStoreLocation();
-		String name = file.getOriginalFilename();
-
-		System.out.println(storeLocation.length());
-		if (999999 < storeLocation.length()) {
-			throw new StatusException("140082", "文件过大");
-		}
-
-		String fileSuffix = null;
-		if (name.endsWith(".jpg")) {
-			fileSuffix = ".jpg";
-		} else if (name.endsWith(".gif")) {
-			fileSuffix = ".gif";
-		} else if (name.endsWith(".png")) {
-			fileSuffix = ".png";
-		} else {
-			throw new StatusException("101001", "文件格式错误");
-		}
-
-		byte[] byteArray = null;
-		InputStream inputStream = null;
-		try {
-			inputStream = new FileInputStream(storeLocation);
-			byteArray = IOUtils.toByteArray(inputStream);
-		} finally {
-			IOUtils.closeQuietly(inputStream);
-		}
-
-		String hexString = Hex.encodeHexString(byteArray);
-
-		DynamicEnumManager manager = OrgProperty.getDynamicEnumManager();
-		DynamicEnum logoFile = manager.getByName("CUS_MENU_LOGO_FILE");
-		DynamicEnum logoFileSuffix = manager.getByName("CUS_MENU_LOGO_FILE_SUFFIX");
-		DynamicEnum logoFileUrl = manager.getByName("CUS_MENU_LOGO_FILE_URL");
-
-		OrgPropertyEntity fileEntity = orgPropertyRepo.findByOrgIdAndKeyId(orgId, logoFile.getId());
-		if (null == fileEntity) {
-			fileEntity = new OrgPropertyEntity();
-			fileEntity.setKeyId(logoFile.getId());
-			fileEntity.setOrgId(orgId);
-		}
-		fileEntity.setValue(hexString);
-		orgPropertyRepo.save(fileEntity);
-
-		OrgPropertyEntity fileSuffixEntity = orgPropertyRepo.findByOrgIdAndKeyId(orgId,
-				logoFileSuffix.getId());
-		if (null == fileSuffixEntity) {
-			fileSuffixEntity = new OrgPropertyEntity();
-			fileSuffixEntity.setKeyId(logoFileSuffix.getId());
-			fileSuffixEntity.setOrgId(orgId);
-		}
-		fileSuffixEntity.setValue(fileSuffix);
-		orgPropertyRepo.save(fileSuffixEntity);
-
-		String path = systemConfig.getTempDataDir() + "/cusMenuLogo/" + orgId
-				+ fileSuffixEntity.getValue();
-
-		FileUtils.copyFile(storeLocation, new File(path));
-
-		//通用存储
-		FileStoragePathEnvInfo env=new FileStoragePathEnvInfo();
-		env.setFileSuffix(fileSuffix);
-		env.setRootOrgId(orgEntity.getRootId().toString());
-		YunPathInfo pi=FileStorageUtil.saveFile("orgLogo", env, storeLocation,null);
-		String url =pi.getUrl();
-
-		OrgPropertyEntity logoFileUrlEntity = orgPropertyRepo.findByOrgIdAndKeyId(orgId,
-				logoFileUrl.getId());
-		if (null == logoFileUrlEntity) {
-			logoFileUrlEntity = new OrgPropertyEntity();
-			logoFileUrlEntity.setKeyId(logoFileUrl.getId());
-			logoFileUrlEntity.setOrgId(orgId);
-		}
-		logoFileUrlEntity.setValue(url);
-		orgPropertyRepo.save(logoFileUrlEntity);
-
-		return url;
-	}
 }

+ 1 - 1
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/ResourceController.java

@@ -100,7 +100,7 @@ public class ResourceController extends ControllerSupport {
 			BeanUtils.copyProperties(next, bean);
 //			bean.setFileUrl(upyunFileUrl + bean.getFilePath());
 			//通用存储
-			bean.setFileUrl(FileStorageUtil.realPath(bean.getFileTreatyPath()));
+			bean.setFileUrl(FileStorageUtil.realPath(bean.getFilePath()));
 			resourceDomainList.add(bean);
 		}
 		PageInfo<ResourceDomain> ret = new PageInfo<ResourceDomain>();

+ 11 - 272
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/RolePrivilegeController.java

@@ -7,9 +7,9 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import cn.com.qmth.examcloud.core.basic.api.controller.bean.*;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Sort;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -25,12 +25,16 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 
-import cn.com.qmth.examcloud.api.commons.enums.PrivilegeGroupType;
 import cn.com.qmth.examcloud.api.commons.security.bean.User;
 import cn.com.qmth.examcloud.api.commons.security.enums.RoleMeta;
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.util.RegExpUtil;
 import cn.com.qmth.examcloud.core.basic.api.bean.RoleBean;
+import cn.com.qmth.examcloud.core.basic.api.controller.bean.PrivilegeDomain;
+import cn.com.qmth.examcloud.core.basic.api.controller.bean.PrivilegeGroupDomain;
+import cn.com.qmth.examcloud.core.basic.api.controller.bean.RoleDomain;
+import cn.com.qmth.examcloud.core.basic.api.controller.bean.UpdateRolePrivilegeRelationsDomain;
+import cn.com.qmth.examcloud.core.basic.api.controller.bean.UpdateRootOrgPrivilegeRelationsDomain;
 import cn.com.qmth.examcloud.core.basic.base.constants.BasicConsts;
 import cn.com.qmth.examcloud.core.basic.dao.PrivilegeGroupRepo;
 import cn.com.qmth.examcloud.core.basic.dao.PrivilegeRepo;
@@ -48,7 +52,6 @@ import cn.com.qmth.examcloud.core.basic.service.bean.RoleInfo;
 import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
 import cn.com.qmth.examcloud.web.helpers.tree.EleTreeNode;
 import cn.com.qmth.examcloud.web.helpers.tree.TreeUtil;
-import cn.com.qmth.examcloud.web.interceptor.GlobalSequenceLock;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -192,16 +195,11 @@ public class RolePrivilegeController extends ControllerSupport {
 	@ApiOperation(value = "查询权限组")
 	@GetMapping("getPrivilegeGroupList")
 	public List<PrivilegeGroupDomain> getPrivilegeGroupList() {
-
-		List<PrivilegeGroupEntity> list = privilegeGroupRepo.findAllByRootOrgIdIsNullOrderById();
+		Sort sort = new Sort(Sort.Direction.ASC, "id");
+		List<PrivilegeGroupEntity> list = privilegeGroupRepo.findAll(sort);
 
 		List<PrivilegeGroupDomain> ret = Lists.newArrayList();
 
-		if (null != list && !list.isEmpty()) {
-			list = list.stream().filter(p -> PrivilegeGroupType.STUDENT_CLIENT_MENU != p.getType())
-					.collect(Collectors.toList());
-		}
-
 		for (PrivilegeGroupEntity cur : list) {
 			PrivilegeGroupDomain bean = new PrivilegeGroupDomain();
 			bean.setId(cur.getId());
@@ -255,210 +253,6 @@ public class RolePrivilegeController extends ControllerSupport {
 		return pList;
 	}
 
-	/**
-	 * 2020年2月19日
-	 *
-	 * @author WANGWEI
-	 * @param rootOrgId
-	 * @param includeDisabledCodes
-	 * @return
-	 */
-	@ApiOperation(value = "查询菜单树")
-	@GetMapping("getStudentClientMenuTree/{rootOrgId}")
-	@GlobalSequenceLock
-	@Transactional
-	public OrgPrivilegeTreeDomain getStudentClientMenuTree(@PathVariable Long rootOrgId,
-														   @RequestParam(required = false) Boolean includeDisabledCodes) {
-
-		PrivilegeGroupEntity group = privilegeGroupRepo.findByRootOrgIdAndType(rootOrgId,
-				PrivilegeGroupType.STUDENT_CLIENT_MENU);
-
-		//如果考生自定义菜单未初始化,默认初始化一份
-		if (null == group) {
-			PrivilegeGroupEntity globalGroup = privilegeGroupRepo
-					.findByCode(PrivilegeGroupType.STUDENT_CLIENT_MENU.name());
-
-			group = new PrivilegeGroupEntity();
-			group.setCode(PrivilegeGroupType.STUDENT_CLIENT_MENU.name() + "_" + rootOrgId);
-			group.setName(globalGroup.getName());
-			group.setRootOrgId(rootOrgId);
-			group.setType(PrivilegeGroupType.STUDENT_CLIENT_MENU);
-
-			group.setExt1(globalGroup.getExt1());
-			group.setExt2(globalGroup.getExt2());
-			group.setExt3(globalGroup.getExt3());
-			group.setExt4(globalGroup.getExt4());
-			group.setExt5(globalGroup.getExt5());
-
-			group = privilegeGroupRepo.save(group);
-
-			List<PrivilegeEntity> globalPrivilegeList = privilegeRepo
-					.findAllByGroupIdOrderByWeightDesc(globalGroup.getId());
-			Map<Long, Integer> idIndex = Maps.newHashMap();
-			List<PrivilegeEntity> privilegeList = Lists.newArrayList();
-			Set<Long> privilegeIdSet = Sets.newHashSet();
-			int c = 0;
-			for (PrivilegeEntity cur : globalPrivilegeList) {
-				idIndex.put(cur.getId(), c);
-				c++;
-
-				PrivilegeEntity privilegeEntity = new PrivilegeEntity();
-				privilegeEntity.setCode(cur.getCode() + "_" + rootOrgId);
-				privilegeEntity.setDescription(cur.getDescription());
-				privilegeEntity.setGroupId(group.getId());
-				privilegeEntity.setName(cur.getName());
-				privilegeEntity.setWeight(cur.getWeight());
-
-				privilegeEntity.setExt1(cur.getExt1());
-				privilegeEntity.setExt2(cur.getExt2());
-				privilegeEntity.setExt3(cur.getExt3());
-				privilegeEntity.setExt4(cur.getExt4());
-				privilegeEntity.setExt5(cur.getExt5());
-
-				PrivilegeEntity saved = privilegeRepo.save(privilegeEntity);
-				privilegeList.add(saved);
-
-				privilegeIdSet.add(saved.getId());
-
-			}
-
-			for (int i = 0; i < globalPrivilegeList.size(); i++) {
-				PrivilegeEntity p = privilegeList.get(i);
-				if (null == p.getParentId()) {
-					continue;
-				}
-
-				Integer j = idIndex.get(globalPrivilegeList.get(i).getId());
-				p.setParentId(privilegeList.get(j).getId());
-				privilegeRepo.save(p);
-			}
-
-			rolePrivilegeService.updateRootOrgPrivilegeRelations(rootOrgId, group.getId(),
-					privilegeIdSet);
-		}
-
-		List<PrivilegeEntity> privilegeList = privilegeRepo
-				.findAllByGroupIdOrderByWeightDesc(group.getId());
-
-		EleTreeNode rootNode = new EleTreeNode(BasicConsts.ROOT_PRIVILEGE_ID, group.getName());
-
-		if (null != includeDisabledCodes && includeDisabledCodes) {
-			if (!isSuperAdmin()) {
-				throw new StatusException("012001", "非法请求");
-			}
-			TreeUtil.convert2OneEleTreeNode(rootNode, privilegeList, Lists.newArrayList());
-		} else {
-			TreeUtil.convert2OneEleTreeNode(rootNode, privilegeList, disabledPrivilegeCodeList);
-		}
-
-		OrgPrivilegeTreeDomain domain= new OrgPrivilegeTreeDomain();
-		domain.setPrivilegeGroupId(group.getId());
-		domain.setPrivilegeGroupType(group.getType().name());
-		domain.setTreeData(rootNode);
-
-		List<RootOrgPrivilegeRelationEntity> roprlist = rootOrgPrivilegeRelationRepo
-				.findAllByRootOrgIdAndGroupId(rootOrgId, group.getId());
-
-		List<Long> pList = roprlist.stream().map(RootOrgPrivilegeRelationEntity::getPrivilegeId)
-				.collect(Collectors.toList());
-
-		domain.setOwnedPrivilegeIds(pList);
-
-		return domain;
-	}
-
-	/**
-	 * 2020年2月11日
-	 *
-	 * @author WANGWEI
-	 * @param rootOrgId
-	 * @return
-	 */
-	@ApiOperation(value = "查询学生端菜单")
-	@GetMapping("getStudentClientMenu")
-	public List<CustomPrivilegeDomain> getStudentClientMenu(
-			@RequestParam(required = false) Long rootOrgId) {
-
-		if (null == rootOrgId) {
-			rootOrgId = getRootOrgId();
-		} else {
-			validateRootOrgIsolation(rootOrgId);
-		}
-
-		String code = PrivilegeGroupType.STUDENT_CLIENT_MENU.name() + "_" + rootOrgId;
-
-		boolean undefined = false;
-
-		PrivilegeGroupEntity privilegeGroup = privilegeGroupRepo.findByCode(code);
-
-		if (null == privilegeGroup) {
-			privilegeGroup = privilegeGroupRepo
-					.findByCode(PrivilegeGroupType.STUDENT_CLIENT_MENU.name());
-			undefined = true;
-		} else {
-			if (null == privilegeGroup.getRootOrgId()) {
-				throw new StatusException("002101", "data error");
-			}
-			GlobalHelper.uniformRootOrg(rootOrgId, privilegeGroup.getRootOrgId());
-		}
-
-		List<Long> pList = null;
-		if (!undefined) {
-			List<RootOrgPrivilegeRelationEntity> list = rootOrgPrivilegeRelationRepo
-					.findAllByRootOrgIdAndGroupId(rootOrgId, privilegeGroup.getId());
-
-			pList = list.stream().map(RootOrgPrivilegeRelationEntity::getPrivilegeId)
-					.collect(Collectors.toList());
-		}
-
-		List<PrivilegeEntity> privilegeList = privilegeRepo
-				.findAllByGroupId(privilegeGroup.getId());
-
-		List<CustomPrivilegeDomain> privilegeInfoList = Lists.newArrayList();
-
-		for (PrivilegeEntity cur : privilegeList) {
-			boolean hasPrivilege = undefined ? true : (pList!=null && pList.contains(cur.getId()));
-
-			if (!hasPrivilege) {
-				continue;
-			}
-
-			CustomPrivilegeDomain privilegeInfo = new CustomPrivilegeDomain();
-			privilegeInfo.setHasPrivilege(hasPrivilege);
-			privilegeInfo.setCode(cur.getCode());
-			privilegeInfo.setCreationTime(cur.getCreationTime());
-			privilegeInfo.setGroupId(cur.getGroupId());
-			privilegeInfo.setGroupCode(privilegeGroup.getCode());
-			privilegeInfo.setId(cur.getId());
-			privilegeInfo.setName(cur.getName());
-			privilegeInfo.setParentId(cur.getParentId());
-			privilegeInfo.setUpdateTime(cur.getUpdateTime());
-			privilegeInfo.setDescription(cur.getDescription());
-			privilegeInfo.setWeight(cur.getWeight());
-			privilegeInfo.setExt1(cur.getExt1());
-			privilegeInfo.setExt2(cur.getExt2());
-			privilegeInfo.setExt3(cur.getExt3());
-			privilegeInfo.setExt4(cur.getExt4());
-			privilegeInfo.setExt5(cur.getExt5());
-
-			//如果未自定义过菜单,则routeCode和权限编码一致
-			String routeCode;
-			if (undefined) {
-				routeCode=cur.getCode();
-			}
-			//如果自定义过菜单,则特殊处理
-			else{
-				routeCode= cur.getCode().replace("_"+rootOrgId,"");
-			}
-			privilegeInfo.setRouteCode(routeCode);
-
-			privilegeInfoList.add(privilegeInfo);
-
-		}
-
-		return privilegeInfoList;
-	}
-
 	@ApiOperation(value = "查询角色的权限ID集合")
 	@GetMapping("getPrivilegeIdList/{rootOrgId}/{roleId}")
 	public Set<Long> getPrivilegeIdList(@PathVariable Long rootOrgId, @PathVariable Long roleId) {
@@ -520,9 +314,7 @@ public class RolePrivilegeController extends ControllerSupport {
 		Long privilegeGroupId = req.getPrivilegeGroupId();
 		Set<Long> privilegeIdSet = req.getPrivilegeIdSet();
 
-		User accessUser = getAccessUser();
-        Long userRootOrgId = accessUser.getRootOrgId();
-		if ((!rootOrgId.equals(userRootOrgId)) && !isSuperAdmin()) {
+		if (!isSuperAdmin()) {
 			throw new StatusException("012601", "非法请求");
 		}
 
@@ -593,36 +385,9 @@ public class RolePrivilegeController extends ControllerSupport {
 			}
 		}
 
-		privilege = privilegeRepo.save(privilege);
-
-		if (group.getType().equals(PrivilegeGroupType.STUDENT_CLIENT_MENU)
-				&& group.getCode().equals(PrivilegeGroupType.STUDENT_CLIENT_MENU.name())) {
-
-			List<PrivilegeGroupEntity> gList = privilegeGroupRepo
-					.findAllByType(PrivilegeGroupType.STUDENT_CLIENT_MENU);
-
-			for (PrivilegeGroupEntity cur : gList) {
-				if (null == cur.getRootOrgId()) {
-					continue;
-				}
-				PrivilegeEntity p = privilegeRepo
-						.findByCode(privilege.getCode() + "_" + cur.getRootOrgId());
-				if (null != p) {
-					p.setDescription(privilege.getDescription());
-
-					p.setExt1(privilege.getExt1());
-					p.setExt2(privilege.getExt2());
-					p.setExt3(privilege.getExt3());
-					p.setExt4(privilege.getExt4());
-					p.setExt5(privilege.getExt5());
-
-					privilegeRepo.save(p);
-				}
-			}
-
-		}
+		PrivilegeEntity ret = privilegeRepo.save(privilege);
 
-		return privilege;
+		return ret;
 	}
 
 	@ApiOperation(value = "删除权限")
@@ -642,32 +407,6 @@ public class RolePrivilegeController extends ControllerSupport {
 
 		privilegeRepo.deleteById(id);
 		rolePrivilegeRelationRepo.deleteByPrivilegeId(id);
-		rootOrgPrivilegeRelationRepo.deleteByPrivilegeId(id);
-
-		PrivilegeGroupEntity groupEntity = GlobalHelper.getPresentEntity(privilegeGroupRepo,
-				privilege.getGroupId(), PrivilegeGroupEntity.class);
-
-		if (groupEntity.getType().equals(PrivilegeGroupType.STUDENT_CLIENT_MENU)
-				&& groupEntity.getCode().equals(PrivilegeGroupType.STUDENT_CLIENT_MENU.name())) {
-
-			List<PrivilegeGroupEntity> gList = privilegeGroupRepo
-					.findAllByType(PrivilegeGroupType.STUDENT_CLIENT_MENU);
-
-			for (PrivilegeGroupEntity cur : gList) {
-				if (null == cur.getRootOrgId()) {
-					continue;
-				}
-				PrivilegeEntity p = privilegeRepo
-						.findByCode(privilege.getCode() + "_" + cur.getRootOrgId());
-				if (null != p) {
-					privilegeRepo.deleteById(p.getId());
-					rolePrivilegeRelationRepo.deleteByPrivilegeId(p.getId());
-					rootOrgPrivilegeRelationRepo.deleteByPrivilegeId(p.getId());
-				}
-			}
-
-		}
-
 	}
 
 	@ApiOperation(value = "查询权限")

+ 19 - 21
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/StudentController.java

@@ -102,13 +102,12 @@ public class StudentController extends ControllerSupport {
      */
     @ApiOperation(value = "查询学生分页数据", notes = "分页")
     @GetMapping("studentPage/{curPage}/{pageSize}")
-    public PageInfo<StudentDomain> getStudentPage(
-            @PathVariable Integer curPage,
-            @PathVariable Integer pageSize, @RequestParam String name,
-            @RequestParam String studentCode, @RequestParam String identityNumber,
-            @RequestParam(required = false) Long rootOrgId,
-            @RequestParam(required = false) Long orgId,
-            @RequestParam(required = false) BooleanSelect hasPhoto) {
+    public PageInfo<StudentDomain> getStudentPage(@PathVariable Integer curPage,
+                                                  @PathVariable Integer pageSize, @RequestParam String name,
+                                                  @RequestParam String studentCode, @RequestParam String identityNumber,
+                                                  @RequestParam(required = false) Long rootOrgId,
+                                                  @RequestParam(required = false) Long orgId,
+                                                  @RequestParam(required = false) BooleanSelect hasPhoto) {
 
         User accessUser = getAccessUser();
         if (null == rootOrgId) {
@@ -126,10 +125,10 @@ public class StudentController extends ControllerSupport {
             if (StringUtils.isNotEmpty(name)) {
                 predicates.add(cb.like(root.get("name"), toSqlSearchPattern(name)));
             }
-            if (StringUtils.isNotBlank(identityNumber)) {
-                predicates.add(cb.like(root.get("identityNumber"), toSqlRightLike(identityNumber)));
+            if (StringUtils.isNotEmpty(identityNumber)) {
+                predicates.add(
+                        cb.like(root.get("identityNumber"), toSqlSearchPattern(identityNumber)));
             }
-
             if (null != hasPhoto) {
                 Boolean hasPhotoBoolean = hasPhoto.getBoolean();
                 if (null != hasPhotoBoolean) {
@@ -141,12 +140,12 @@ public class StudentController extends ControllerSupport {
                 }
             }
 
-            if (StringUtils.isNotBlank(studentCode)) {
+            if (StringUtils.isNotEmpty(studentCode)) {
                 Subquery<StudentCodeEntity> subquery = query.subquery(StudentCodeEntity.class);
                 Root<StudentCodeEntity> subRoot = subquery.from(StudentCodeEntity.class);
                 subquery.select(subRoot.get("id"));
                 Predicate p1 = cb.equal(subRoot.get("studentId"), root.get("id"));
-                Predicate p2 = cb.like(subRoot.get("studentCode"), toSqlRightLike(studentCode));
+                Predicate p2 = cb.like(subRoot.get("studentCode"), toSqlSearchPattern(studentCode));
                 subquery.where(cb.and(p1, p2));
                 predicates.add(cb.exists(subquery));
             }
@@ -247,14 +246,13 @@ public class StudentController extends ControllerSupport {
         ret.setList(studentDomainList);
         ret.setTotal(studentList.getTotalElements());
         return ret;
+
     }
 
     @ApiOperation(value = "导出学生", notes = "")
     @GetMapping("export")
-    public void exportStudents(@RequestParam String name,
-                               @RequestParam String studentCode,
-                               @RequestParam String identityNumber,
-                               @RequestParam(required = false) Long rootOrgId,
+    public void exportStudents(@RequestParam String name, @RequestParam String studentCode,
+                               @RequestParam String identityNumber, @RequestParam(required = false) Long rootOrgId,
                                @RequestParam(required = false) Long orgId,
                                @RequestParam(required = false) BooleanSelect hasPhoto) {
 
@@ -274,10 +272,10 @@ public class StudentController extends ControllerSupport {
             if (StringUtils.isNotEmpty(name)) {
                 predicates.add(cb.like(root.get("name"), toSqlSearchPattern(name)));
             }
-            if (StringUtils.isNotBlank(identityNumber)) {
-                predicates.add(cb.like(root.get("identityNumber"), toSqlRightLike(identityNumber)));
+            if (StringUtils.isNotEmpty(identityNumber)) {
+                predicates.add(
+                        cb.like(root.get("identityNumber"), toSqlSearchPattern(identityNumber)));
             }
-
             if (null != hasPhoto) {
                 Boolean hasPhotoBoolean = hasPhoto.getBoolean();
                 if (null != hasPhotoBoolean) {
@@ -289,12 +287,12 @@ public class StudentController extends ControllerSupport {
                 }
             }
 
-            if (StringUtils.isNotBlank(studentCode)) {
+            if (StringUtils.isNotEmpty(studentCode)) {
                 Subquery<StudentCodeEntity> subquery = query.subquery(StudentCodeEntity.class);
                 Root<StudentCodeEntity> subRoot = subquery.from(StudentCodeEntity.class);
                 subquery.select(subRoot.get("id"));
                 Predicate p1 = cb.equal(subRoot.get("studentId"), root.get("id"));
-                Predicate p2 = cb.like(subRoot.get("studentCode"), toSqlRightLike(studentCode));
+                Predicate p2 = cb.like(subRoot.get("studentCode"), toSqlSearchPattern(studentCode));
                 subquery.where(cb.and(p1, p2));
                 predicates.add(cb.exists(subquery));
             }

+ 0 - 30
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/bean/CustomPrivilegeDomain.java

@@ -1,30 +0,0 @@
-package cn.com.qmth.examcloud.core.basic.api.controller.bean;
-
-import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
-import cn.com.qmth.examcloud.web.helpers.tree.TreeNode;
-
-import java.util.Date;
-
-/**
- * @Description 可自定义的PrivilegeDomain
- * @Author lideyin
- * @Date 2020/5/12 17:16
- * @Version 1.0
- */
-public class CustomPrivilegeDomain extends PrivilegeDomain {
-
-	private static final long serialVersionUID = -8828760710678965127L;
-
-	/**
-	 * 路由编码码
-	 */
-	private String routeCode;
-
-	public String getRouteCode() {
-		return routeCode;
-	}
-
-	public void setRouteCode(String routeCode) {
-		this.routeCode = routeCode;
-	}
-}

+ 0 - 73
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/bean/OrgPrivilegeTreeDomain.java

@@ -1,73 +0,0 @@
-package cn.com.qmth.examcloud.core.basic.api.controller.bean;
-
-import cn.com.qmth.examcloud.api.commons.enums.PrivilegeGroupType;
-import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
-import cn.com.qmth.examcloud.web.helpers.tree.EleTreeNode;
-import cn.com.qmth.examcloud.web.helpers.tree.TreeNode;
-import java.util.List;
-
-import java.util.Date;
-
-/**
- * @Description 组织机构权限树
- * @Author lideyin
- * @Date 2020/5/11 15:50
- * @Version 1.0
- */
-public class OrgPrivilegeTreeDomain implements JsonSerializable {
-
-	private static final long serialVersionUID = 6079872470102312782L;
-
-
-	/**
-	 * 权限组ID
-	 */
-	private Long privilegeGroupId;
-
-	/**
-	 * 权限组类型
-	 */
-	private String privilegeGroupType;
-
-	/**
-	 * 组织机构拥有的权限id
-	 */
-	private List<Long> ownedPrivilegeIds;
-
-	/**
-	 * 权限树
-	 */
-	private EleTreeNode treeData;
-
-	public Long getPrivilegeGroupId() {
-		return privilegeGroupId;
-	}
-
-	public void setPrivilegeGroupId(Long privilegeGroupId) {
-		this.privilegeGroupId = privilegeGroupId;
-	}
-
-	public String getPrivilegeGroupType() {
-		return privilegeGroupType;
-	}
-
-	public void setPrivilegeGroupType(String privilegeGroupType) {
-		this.privilegeGroupType = privilegeGroupType;
-	}
-
-	public EleTreeNode getTreeData() {
-		return treeData;
-	}
-
-	public void setTreeData(EleTreeNode treeData) {
-		this.treeData = treeData;
-	}
-
-	public List<Long> getOwnedPrivilegeIds() {
-		return ownedPrivilegeIds;
-	}
-
-	public void setOwnedPrivilegeIds(List<Long> ownedPrivilegeIds) {
-		this.ownedPrivilegeIds = ownedPrivilegeIds;
-	}
-}

+ 0 - 12
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/bean/ResourceDomain.java

@@ -25,8 +25,6 @@ public class ResourceDomain implements JsonSerializable {
 	private Long parentId;
 
 	private Date creationTime;
-	
-	private String fileTreatyPath;
 
 	public Long getId() {
 		return id;
@@ -100,14 +98,4 @@ public class ResourceDomain implements JsonSerializable {
 		this.creationTime = creationTime;
 	}
 
-    
-    public String getFileTreatyPath() {
-        return fileTreatyPath;
-    }
-
-    
-    public void setFileTreatyPath(String fileTreatyPath) {
-        this.fileTreatyPath = fileTreatyPath;
-    }
-
 }

+ 1 - 8
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/PrivilegeGroupRepo.java

@@ -1,12 +1,9 @@
 package cn.com.qmth.examcloud.core.basic.dao;
 
-import java.util.List;
-
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.repository.query.QueryByExampleExecutor;
 
-import cn.com.qmth.examcloud.api.commons.enums.PrivilegeGroupType;
 import cn.com.qmth.examcloud.core.basic.dao.entity.PrivilegeGroupEntity;
 
 public interface PrivilegeGroupRepo
@@ -17,10 +14,6 @@ public interface PrivilegeGroupRepo
 
 	PrivilegeGroupEntity findByCode(String code);
 
-	List<PrivilegeGroupEntity> findAllByRootOrgIdIsNullOrderById();
-
-	PrivilegeGroupEntity findByRootOrgIdAndType(Long rootOrgId, PrivilegeGroupType type);
+}
 
-	List<PrivilegeGroupEntity> findAllByType(PrivilegeGroupType type);
 
-}

+ 0 - 2
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/PrivilegeRepo.java

@@ -23,8 +23,6 @@ public interface PrivilegeRepo
 
 	List<PrivilegeEntity> findAllByGroupIdOrderByWeightDesc(Long groupId);
 
-	List<PrivilegeEntity> findAllByGroupId(Long groupId);
-
 	List<PrivilegeEntity> findAllByParentId(Long parentId);
 
 	List<PrivilegeEntity> findAllByIdIn(List<Long> idList);

+ 0 - 2
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/RootOrgPrivilegeRelationRepo.java

@@ -17,8 +17,6 @@ public interface RootOrgPrivilegeRelationRepo
 
 	void deleteByRootOrgIdAndGroupId(Long rootOrgId, Long groupId);
 
-	void deleteByPrivilegeId(Long privilegeId);
-
 	List<RootOrgPrivilegeRelationEntity> findAllByRootOrgId(Long rootOrgId);
 
 	List<RootOrgPrivilegeRelationEntity> findAllByRootOrgIdAndGroupId(Long rootOrgId, Long groupId);

+ 3 - 37
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/entity/PrivilegeGroupEntity.java

@@ -2,15 +2,11 @@ package cn.com.qmth.examcloud.core.basic.dao.entity;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
-import javax.persistence.Index;
 import javax.persistence.Table;
 
-import cn.com.qmth.examcloud.api.commons.enums.PrivilegeGroupType;
 import cn.com.qmth.examcloud.web.jpa.JpaEntity;
 
 /**
@@ -21,9 +17,7 @@ import cn.com.qmth.examcloud.web.jpa.JpaEntity;
  * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
  */
 @Entity
-@Table(name = "EC_B_PRIVILEGE_GROUP", indexes = {
-		@Index(name = "IDX_B_PRI_G_002001", columnList = "code", unique = true),
-		@Index(name = "IDX_B_PRI_G_002002", columnList = "rootOrgId,type", unique = true)})
+@Table(name = "EC_B_PRIVILEGE_GROUP")
 public class PrivilegeGroupEntity extends JpaEntity {
 
 	private static final long serialVersionUID = -3654724059677675683L;
@@ -38,27 +32,15 @@ public class PrivilegeGroupEntity extends JpaEntity {
 	/**
 	 * 权限组名称
 	 */
-	@Column(nullable = false)
+	@Column(unique = true, nullable = false)
 	private String name;
 
 	/**
 	 * 权限组编码
 	 */
-	@Column(nullable = false)
+	@Column(unique = true, nullable = false)
 	private String code;
 
-	/**
-	 * 权限组类型
-	 */
-	@Enumerated(EnumType.STRING)
-	private PrivilegeGroupType type;
-
-	/**
-	 * 顶级机构ID
-	 */
-	@Column(nullable = true)
-	private Long rootOrgId;
-
 	/**
 	 * 扩展属性
 	 */
@@ -113,22 +95,6 @@ public class PrivilegeGroupEntity extends JpaEntity {
 		this.code = code;
 	}
 
-	public PrivilegeGroupType getType() {
-		return type;
-	}
-
-	public void setType(PrivilegeGroupType type) {
-		this.type = type;
-	}
-
-	public Long getRootOrgId() {
-		return rootOrgId;
-	}
-
-	public void setRootOrgId(Long rootOrgId) {
-		this.rootOrgId = rootOrgId;
-	}
-
 	public String getExt1() {
 		return ext1;
 	}

+ 60 - 72
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/entity/ResourceEntity.java

@@ -12,99 +12,87 @@ import cn.com.qmth.examcloud.web.jpa.JpaEntity;
 
 @Entity
 @Table(name = "EC_B_RESOURCE", indexes = {
-        @Index(name = "IDX_B_RESOURCE_000001", columnList = "rootOrgId,parentId", unique = false),
-        @Index(name = "IDX_B_RESOURCE_000002", columnList = "rootOrgId,filePath", unique = true) })
+		@Index(name = "IDX_B_RESOURCE_000001", columnList = "rootOrgId,parentId", unique = false),
+		@Index(name = "IDX_B_RESOURCE_000002", columnList = "rootOrgId,filePath", unique = true)})
 public class ResourceEntity extends JpaEntity {
+	private static final long serialVersionUID = 4326176782077577894L;
 
-    private static final long serialVersionUID = 4326176782077577894L;
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	private Long id;
 
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    private Long id;
+	@Column(nullable = false)
+	private Long rootOrgId;
 
-    @Column(nullable = false)
-    private Long rootOrgId;
+	@Column(nullable = false)
+	private String name;
 
-    @Column(nullable = false)
-    private String name;
+	@Column(nullable = false)
+	private Boolean isFile;
 
-    @Column(nullable = false)
-    private Boolean isFile;
+	@Column(nullable = true)
+	private String suffix;
 
-    @Column(nullable = true)
-    private String suffix;
+	@Column(nullable = false)
+	private String filePath;
 
-    @Column(nullable = false)
-    private String filePath;
+	@Column(nullable = true)
+	private Long parentId;
 
-    @Column(nullable = true)
-    private Long parentId;
+	public Long getId() {
+		return id;
+	}
 
-    @Column(nullable = true)
-    private String fileTreatyPath;
+	public void setId(Long id) {
+		this.id = id;
+	}
 
-    public Long getId() {
-        return id;
-    }
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
 
-    public void setId(Long id) {
-        this.id = id;
-    }
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
 
-    public Long getRootOrgId() {
-        return rootOrgId;
-    }
+	public String getName() {
+		return name;
+	}
 
-    public void setRootOrgId(Long rootOrgId) {
-        this.rootOrgId = rootOrgId;
-    }
+	public void setName(String name) {
+		this.name = name;
+	}
 
-    public String getName() {
-        return name;
-    }
+	public Boolean getIsFile() {
+		return isFile;
+	}
 
-    public void setName(String name) {
-        this.name = name;
-    }
+	public void setIsFile(Boolean isFile) {
+		this.isFile = isFile;
+	}
 
-    public Boolean getIsFile() {
-        return isFile;
-    }
+	public String getSuffix() {
+		return suffix;
+	}
 
-    public void setIsFile(Boolean isFile) {
-        this.isFile = isFile;
-    }
+	public void setSuffix(String suffix) {
+		this.suffix = suffix;
+	}
 
-    public String getSuffix() {
-        return suffix;
-    }
+	public String getFilePath() {
+		return filePath;
+	}
 
-    public void setSuffix(String suffix) {
-        this.suffix = suffix;
-    }
+	public void setFilePath(String filePath) {
+		this.filePath = filePath;
+	}
 
-    public String getFilePath() {
-        return filePath;
-    }
+	public Long getParentId() {
+		return parentId;
+	}
 
-    public void setFilePath(String filePath) {
-        this.filePath = filePath;
-    }
-
-    public Long getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(Long parentId) {
-        this.parentId = parentId;
-    }
-    
-    public String getFileTreatyPath() {
-        return fileTreatyPath;
-    }
-    
-    public void setFileTreatyPath(String fileTreatyPath) {
-        this.fileTreatyPath = fileTreatyPath;
-    }
+	public void setParentId(Long parentId) {
+		this.parentId = parentId;
+	}
 
 }

+ 3 - 8
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/OrgServiceImpl.java

@@ -82,7 +82,7 @@ public class OrgServiceImpl implements OrgService {
 	 * 保存顶级机构
 	 *
 	 * @author WANGWEI
-	 *
+	 * 
 	 * @see
 	 * cn.com.qmth.examcloud.core.basic.service.OrgService#saveRootOrg(cn.com.
 	 * qmth.examcloud.core.basic.service.bean.OrgInfo)
@@ -172,7 +172,7 @@ public class OrgServiceImpl implements OrgService {
 	 * 保存子机构
 	 *
 	 * @author WANGWEI
-	 *
+	 * 
 	 * @see
 	 * cn.com.qmth.examcloud.core.basic.service.OrgService#saveSubOrg(cn.com.
 	 * qmth.examcloud.core.basic.service.bean.OrgInfo)
@@ -326,12 +326,7 @@ public class OrgServiceImpl implements OrgService {
 			if (!de.isLegal(value)) {
 				throw new StatusException("001200", "机构属性值非法. key=" + key);
 			}
-
-			if (null == value) {
-				map.put(de, null);
-			} else {
-				map.put(de, value.trim());
-			}
+			map.put(de, value.trim());
 		}
 
 		return map;

+ 92 - 81
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/ResourceServiceImpl.java

@@ -17,89 +17,100 @@ import cn.com.qmth.examcloud.core.basic.service.ResourceService;
 import cn.com.qmth.examcloud.core.basic.service.bean.ResourceInfo;
 import cn.com.qmth.examcloud.support.filestorage.FileStorageUtil;
 import cn.com.qmth.examcloud.web.filestorage.FileStoragePathEnvInfo;
-import cn.com.qmth.examcloud.web.filestorage.YunPathInfo;
 
 @Service
 public class ResourceServiceImpl implements ResourceService {
 
-    private static final String FILE_ROOT_PATH = "/resource";
-
-    private static final String FILE_PATH_SEPARATE = "/";
-
-    @Autowired
-    ResourceRepo resourceRepo;
-
-    // @Autowired
-    // UpyunCloudService upyunCloudService;
-
-    @Override
-    public void addDir(ResourceInfo info) {
-
-        ResourceEntity e = new ResourceEntity();
-        e.setName(info.getName());
-        e.setRootOrgId(info.getRootOrgId());
-        e.setIsFile(false);
-        if (info.getParentId() == null) {
-            e.setParentId(null);
-            e.setFilePath(
-                    FILE_ROOT_PATH + FILE_PATH_SEPARATE + info.getRootOrgId() + FILE_PATH_SEPARATE + info.getName());
-        } else {
-            e.setParentId(info.getParentId());
-            Optional<ResourceEntity> op = resourceRepo.findById(info.getParentId());
-            if (op.isPresent()) {
-                ResourceEntity pe = op.get();
-                e.setFilePath(pe.getFilePath() + FILE_PATH_SEPARATE + info.getName());
-            } else {
-                throw new StatusException("100000", "上级目录不存在");
-            }
-        }
-        resourceRepo.saveAndFlush(e);
-    }
-
-    @Override
-    public void addFile(Long rootOrgId, Long parentId, MultipartFile dataFile) {
-
-        ResourceEntity e = new ResourceEntity();
-        String fileName = dataFile.getOriginalFilename();
-        e.setName(fileName);
-        e.setRootOrgId(rootOrgId);
-        e.setIsFile(true);
-        String suffix = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length());
-        e.setSuffix(suffix);
-
-
-        if (parentId == null) {
-            e.setParentId(null);
-            e.setFilePath(FILE_ROOT_PATH + FILE_PATH_SEPARATE + rootOrgId + FILE_PATH_SEPARATE + fileName);
-        } else {
-            e.setParentId(parentId);
-            Optional<ResourceEntity> op = resourceRepo.findById(parentId);
-            if (op.isPresent()) {
-                ResourceEntity pe = op.get();
-                e.setFilePath(pe.getFilePath() + FILE_PATH_SEPARATE + fileName);
-            } else {
-                throw new StatusException("100020", "上级目录不存在");
-            }
-        }
-        
-        CommonsMultipartFile cf = (CommonsMultipartFile) dataFile;
-        DiskFileItem fi = (DiskFileItem) cf.getFileItem();
-
-        File f = fi.getStoreLocation();
-        // 通用存储
-        FileStoragePathEnvInfo env = new FileStoragePathEnvInfo();
-        env.setRootOrgId(rootOrgId.toString());
-        env.setRelativePath(e.getFilePath());
-        YunPathInfo pi=FileStorageUtil.saveFile("resource", env, f, null);
-        e.setFileTreatyPath(pi.getRelativePath());
-        
-        ResourceEntity olde = resourceRepo.findByRootOrgIdAndFilePath(rootOrgId, e.getFilePath());
-        if (olde != null) {
-            olde.setUpdateTime(new Date());
-            resourceRepo.save(olde);
-        } else {
-            resourceRepo.save(e);
-        }
-
-    }
+	private static final String FILE_ROOT_PATH = "/resource";
+
+	private static final String FILE_PATH_SEPARATE = "/";
+
+	@Autowired
+	ResourceRepo resourceRepo;
+
+//	@Autowired
+//	UpyunCloudService upyunCloudService;
+
+	@Override
+	public void addDir(ResourceInfo info) {
+
+		ResourceEntity e = new ResourceEntity();
+		e.setName(info.getName());
+		e.setRootOrgId(info.getRootOrgId());
+		e.setIsFile(false);
+		if (info.getParentId() == null) {
+			e.setParentId(null);
+			e.setFilePath(FILE_ROOT_PATH + FILE_PATH_SEPARATE + info.getRootOrgId()
+					+ FILE_PATH_SEPARATE + info.getName());
+		} else {
+			e.setParentId(info.getParentId());
+			Optional<ResourceEntity> op = resourceRepo.findById(info.getParentId());
+			if (op.isPresent()) {
+				ResourceEntity pe = op.get();
+				e.setFilePath(pe.getFilePath() + FILE_PATH_SEPARATE + info.getName());
+			} else {
+				throw new StatusException("100000", "上级目录不存在");
+			}
+		}
+		resourceRepo.saveAndFlush(e);
+	}
+
+	@Override
+	public void addFile(Long rootOrgId, Long parentId, MultipartFile dataFile) {
+
+		ResourceEntity e = new ResourceEntity();
+		String fileName = dataFile.getOriginalFilename();
+		e.setName(fileName);
+		e.setRootOrgId(rootOrgId);
+		e.setIsFile(true);
+		String suffix = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length());
+		e.setSuffix(suffix);
+		if (parentId == null) {
+			e.setParentId(null);
+			e.setFilePath(FILE_ROOT_PATH + FILE_PATH_SEPARATE + rootOrgId + FILE_PATH_SEPARATE
+					+ fileName);
+		} else {
+			e.setParentId(parentId);
+			Optional<ResourceEntity> op = resourceRepo.findById(parentId);
+			if (op.isPresent()) {
+				ResourceEntity pe = op.get();
+				e.setFilePath(pe.getFilePath() + FILE_PATH_SEPARATE + fileName);
+			} else {
+				throw new StatusException("100020", "上级目录不存在");
+			}
+		}
+		ResourceEntity olde = resourceRepo.findByRootOrgIdAndFilePath(rootOrgId, e.getFilePath());
+		if (olde != null) {
+			olde.setUpdateTime(new Date());
+			resourceRepo.save(olde);
+		} else {
+			resourceRepo.save(e);
+		}
+		CommonsMultipartFile cf = (CommonsMultipartFile) dataFile;
+		DiskFileItem fi = (DiskFileItem) cf.getFileItem();
+
+		File f = fi.getStoreLocation();
+//		PutFileReq req = new PutFileReq();
+//		List<FormFilePart> formFilePartList = new ArrayList<FormFilePart>();
+
+//		FormFilePart part = new FormFilePart("file", fileName, f);
+//		formFilePartList.add(part);
+//
+//		req.setFormFilePartList(formFilePartList);
+//		req.setSiteId("resource");
+//		req.setRootOrgId(rootOrgId);
+//		String relativePath = e.getFilePath().replaceFirst(FILE_ROOT_PATH, "")
+//				.replaceFirst(FILE_PATH_SEPARATE, "");
+//		req.setRelativePath(relativePath);
+//		upyunCloudService.putFile(req);
+		
+		//通用存储
+		FileStoragePathEnvInfo env=new FileStoragePathEnvInfo();
+		env.setRootOrgId(rootOrgId.toString());
+		String relativePath = e.getFilePath().replaceFirst(FILE_ROOT_PATH, "")
+				.replaceFirst(FILE_PATH_SEPARATE, "");
+		env.setRelativePath(relativePath);
+		FileStorageUtil.saveFile("resource", env, f,null);
+		
+	}
 }

+ 0 - 3
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/RolePrivilegeServiceImpl.java

@@ -127,9 +127,6 @@ public class RolePrivilegeServiceImpl implements RolePrivilegeService {
 		rootOrgPrivilegeRelationRepo.deleteByRootOrgIdAndGroupId(rootOrgId, privilegeGroupId);
 
 		for (Long cur : privilegeIdSet) {
-			if(cur==-1){
-				continue;
-			}
 			PrivilegeEntity privilegeEntity = GlobalHelper.getPresentEntity(privilegeRepo, cur,
 					PrivilegeEntity.class);
 			if (!privilegeEntity.getGroupId().equals(privilegeGroupId)) {

+ 1 - 1
examcloud-core-basic-starter/src/main/resources/aliyun.xml

@@ -6,7 +6,7 @@
 		<name>资源</name>
 		<aliyunId>1</aliyunId>
 		<maxSize>50M</maxSize>
-		<path>/${relativePath}</path>
+		<path>/resource/${relativePath}</path>
 	</site>
 	<site>
 		<id>orgLogo</id>

+ 2 - 32
examcloud-core-basic-starter/src/main/resources/org-properties.xml

@@ -33,7 +33,7 @@
 	<enum>
 		<id>5</id>
 		<name>LOGIN_TYPE</name>
-		<desc>登录方式</desc>
+		<desc>登录帐号类型</desc>
 		<valueType>STRING</valueType>
 	</enum>
 	<enum>
@@ -132,34 +132,4 @@
 		<desc>学生端登录支持</desc>
 		<valueType>STRING</valueType>
 	</enum>
-	<enum>
-		<id>22</id>
-		<name>CUS_MENU_LOGO_FILE</name>
-		<desc>机构自定义菜单图标文件(文件转字符串存储)</desc>
-		<valueType>STRING</valueType>
-	</enum>
-	<enum>
-		<id>23</id>
-		<name>CUS_MENU_LOGO_FILE_SUFFIX</name>
-		<desc>机构自定义菜单图标文件后缀</desc>
-		<valueType>STRING</valueType>
-	</enum>
-	<enum>
-		<id>24</id>
-		<name>CUS_MENU_LOGO_FILE_URL</name>
-		<desc>机构自定义菜单图标URL</desc>
-		<valueType>STRING</valueType>
-	</enum>
-	<enum>
-		<id>25</id>
-		<name>IS_CUSTOM_MENU_LOGO</name>
-		<desc>机构是否自定义菜单</desc>
-		<valueType>BOOLEAN</valueType>
-	</enum>
-	<enum>
-		<id>26</id>
-		<name>APP_EXAM_ENABLED </name>
-		<desc>开放APP考试</desc>
-		<valueType>BOOLEAN</valueType>
-	</enum>
-</enums>
+</enums>

+ 1 - 2
examcloud-core-basic-starter/src/main/resources/security.properties

@@ -8,5 +8,4 @@
 [s][${$rmp.ctr.basic}/auth][/sendVerificationCode][POST]=true
 [s][${$rmp.ctr.basic}/org][propertyNoSession/{key}][GET]=true
 [s][${$rmp.ctr.basic}/org][property/{orgId}/{key}][GET]=true
-[s][${$rmp.ctr.basic}/systemProperty][{key}][GET]=true
-[s][${$rmp.ctr.basic}/rolePrivilege][getStudentClientMenu][GET]=true
+[s][${$rmp.ctr.basic}/systemProperty][{key}][GET]=true

+ 1 - 1
examcloud-core-basic-starter/src/main/resources/upyun.xml

@@ -6,7 +6,7 @@
 		<name>资源</name>
 		<upyunId>1</upyunId>
 		<maxSize>50M</maxSize>
-		<path>/${relativePath}</path>
+		<path>/resource/${relativePath}</path>
 	</site>
 	<site>
 		<id>orgLogo</id>