clean and formate code
This commit is contained in:
parent
be51f2d250
commit
0c1062f9b8
|
|
@ -8,5 +8,4 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
public class EdFileInfoController {
|
public class EdFileInfoController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/data/ed/permission")
|
@RequestMapping("/data/ed/permission")
|
||||||
|
|
@ -20,8 +19,8 @@ public class PermissionController {
|
||||||
@Resource
|
@Resource
|
||||||
private PermissionService permissionService;
|
private PermissionService permissionService;
|
||||||
|
|
||||||
@ApiOperation(value="查询当前用户在当前目录的功能权限",notes = "")
|
@ApiOperation(value = "查询当前用户在当前目录的功能权限", notes = "")
|
||||||
@GetMapping(value="/{fileId}")
|
@GetMapping(value = "/{fileId}")
|
||||||
public ElectromagneticResult<?> getUserPermission(@PathVariable("fileId") String fileId) {
|
public ElectromagneticResult<?> getUserPermission(@PathVariable("fileId") String fileId) {
|
||||||
String userId = UserThreadLocal.getUserId();
|
String userId = UserThreadLocal.getUserId();
|
||||||
return ElectromagneticResultUtil.success(permissionService.getUserPermission(userId, fileId));
|
return ElectromagneticResultUtil.success(permissionService.getUserPermission(userId, fileId));
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.electromagnetic.industry.software.manage.controller;
|
package com.electromagnetic.industry.software.manage.controller;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/data/ed/role")
|
@RequestMapping("/data/ed/role")
|
||||||
|
|
|
||||||
|
|
@ -70,13 +70,13 @@ public class UserController {
|
||||||
return userService.logout(token);
|
return userService.logout(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value="人员绑定", notes = "")
|
@ApiOperation(value = "人员绑定", notes = "")
|
||||||
@RequestMapping(value = "/bindRoles", method = RequestMethod.POST)
|
@RequestMapping(value = "/bindRoles", method = RequestMethod.POST)
|
||||||
public ElectromagneticResult<?> bindRoles(@RequestBody UserRoleRequest userRoleRequest) {
|
public ElectromagneticResult<?> bindRoles(@RequestBody UserRoleRequest userRoleRequest) {
|
||||||
if (userService.bindRoles(userRoleRequest)) {
|
if (userService.bindRoles(userRoleRequest)) {
|
||||||
return ElectromagneticResultUtil.success(true);
|
return ElectromagneticResultUtil.success(true);
|
||||||
} else {
|
} else {
|
||||||
return ElectromagneticResultUtil.fail("500","不可绑定空用户");
|
return ElectromagneticResultUtil.fail("500", "不可绑定空用户");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,7 +2,8 @@ package com.electromagnetic.industry.software.manage.pojo.models;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.*;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import lombok.experimental.FieldNameConstants;
|
import lombok.experimental.FieldNameConstants;
|
||||||
|
|
||||||
|
|
@ -98,7 +99,7 @@ public class EdFileInfo extends BaseModel {
|
||||||
private Integer effectFlag;
|
private Integer effectFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*保存状态,0-上传中 1-上传成功 2-上传失败
|
* 保存状态,0-上传中 1-上传成功 2-上传失败
|
||||||
*/
|
*/
|
||||||
@TableField(value = "save_status")
|
@TableField(value = "save_status")
|
||||||
private Integer saveStatus;
|
private Integer saveStatus;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
package com.electromagnetic.industry.software.manage.pojo.models;
|
package com.electromagnetic.industry.software.manage.pojo.models;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|
@ -71,7 +74,7 @@ public class Role {
|
||||||
/**
|
/**
|
||||||
* 是否有效:0-无效 1-有效
|
* 是否有效:0-无效 1-有效
|
||||||
*/
|
*/
|
||||||
@TableField(value="effect_flag")
|
@TableField(value = "effect_flag")
|
||||||
private Integer effectFlag;
|
private Integer effectFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ public class RolePermission {
|
||||||
/**
|
/**
|
||||||
* 角色编码
|
* 角色编码
|
||||||
*/
|
*/
|
||||||
@TableField(value="role_id")
|
@TableField(value = "role_id")
|
||||||
private String roleId;
|
private String roleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,6 @@ public class UserRole {
|
||||||
/**
|
/**
|
||||||
* 角色编码
|
* 角色编码
|
||||||
*/
|
*/
|
||||||
@TableField(value="role_id")
|
@TableField(value = "role_id")
|
||||||
private String roleId;
|
private String roleId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,14 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建一个新的工程
|
* 创建一个新的工程
|
||||||
|
*
|
||||||
* @param prjName 新的工程名
|
* @param prjName 新的工程名
|
||||||
*/
|
*/
|
||||||
ElectromagneticResult<?> createNewPrj(String prjName);
|
ElectromagneticResult<?> createNewPrj(String prjName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改项目名称
|
* 修改项目名称
|
||||||
|
*
|
||||||
* @param prjId
|
* @param prjId
|
||||||
* @param newPrjName
|
* @param newPrjName
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -23,6 +25,7 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除一个项目,做逻辑删除
|
* 删除一个项目,做逻辑删除
|
||||||
|
*
|
||||||
* @param prjId
|
* @param prjId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -30,6 +33,7 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加子集
|
* 添加子集
|
||||||
|
*
|
||||||
* @param parentId
|
* @param parentId
|
||||||
* @param folderName
|
* @param folderName
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -38,12 +42,14 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有项目
|
* 查询所有项目
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ElectromagneticResult<?> queryAllPrjInfo();
|
ElectromagneticResult<?> queryAllPrjInfo();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子集拖拽重排序
|
* 子集拖拽重排序
|
||||||
|
*
|
||||||
* @param folderResortDTOList
|
* @param folderResortDTOList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -51,6 +57,7 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目发布
|
* 项目发布
|
||||||
|
*
|
||||||
* @param prjId
|
* @param prjId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -58,6 +65,7 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除子集
|
* 删除子集
|
||||||
|
*
|
||||||
* @param fileId
|
* @param fileId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -65,6 +73,7 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 层级沿用
|
* 层级沿用
|
||||||
|
*
|
||||||
* @param sourceId
|
* @param sourceId
|
||||||
* @param targetId
|
* @param targetId
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -73,6 +82,7 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改子集名称
|
* 修改子集名称
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @param newFolderName
|
* @param newFolderName
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,12 @@ public interface PermissionService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前用户在当前目录的功能权限
|
* 查询当前用户在当前目录的功能权限
|
||||||
|
*
|
||||||
* @param userId
|
* @param userId
|
||||||
* @param fileId
|
* @param fileId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map<String,Boolean> getUserPermission(String userId, String fileId);
|
Map<String, Boolean> getUserPermission(String userId, String fileId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前用户有权限访问的目录id
|
* 获取当前用户有权限访问的目录id
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ import com.electromagnetic.industry.software.manage.service.EDDataService;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.core.io.FileSystemResource;
|
import org.springframework.core.io.FileSystemResource;
|
||||||
import org.springframework.core.io.InputStreamResource;
|
import org.springframework.core.io.InputStreamResource;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
|
|
@ -63,25 +62,25 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
private EDDataMapper edDataMapper;
|
private EDDataMapper edDataMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private CategoryMapper categoryMapper;
|
private CategoryMapper categoryMapper;
|
||||||
// @Value("${data.windows.path}")
|
// @Value("${data.windows.path}")
|
||||||
private String uploadFilePath;
|
private String uploadFilePath;
|
||||||
// @Value("${data.file.storage.dir}")
|
// @Value("${data.file.storage.dir}")
|
||||||
private String fileStorageDir;
|
private String fileStorageDir;
|
||||||
// @Value("${data.import.cache.dir}")
|
// @Value("${data.import.cache.dir}")
|
||||||
private String importCacheDir;
|
private String importCacheDir;
|
||||||
// @Value("${file.encode.passwd}")
|
// @Value("${file.encode.passwd}")
|
||||||
private String encodePasswd;
|
private String encodePasswd;
|
||||||
// @Value("${data.type.folder}")
|
// @Value("${data.type.folder}")
|
||||||
private String dataTypeFolder;
|
private String dataTypeFolder;
|
||||||
// @Value("${data.windows.path}")
|
// @Value("${data.windows.path}")
|
||||||
private String windowsDir;
|
private String windowsDir;
|
||||||
// @Value("${data.file.cache.dir}")
|
// @Value("${data.file.cache.dir}")
|
||||||
private String fileCacheDir;
|
private String fileCacheDir;
|
||||||
// @Value("${data.upload.cache.dir}")
|
// @Value("${data.upload.cache.dir}")
|
||||||
private String uploadCacheDir;
|
private String uploadCacheDir;
|
||||||
// @Value("${data.export.cache.dir}")
|
// @Value("${data.export.cache.dir}")
|
||||||
private String exportCacheDir;
|
private String exportCacheDir;
|
||||||
// @Value("${data.type.file}")
|
// @Value("${data.type.file}")
|
||||||
private String dataTypeFile;
|
private String dataTypeFile;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,10 @@ import com.electromagnetic.industry.software.common.enums.EleDataStatusEnum;
|
||||||
import com.electromagnetic.industry.software.common.enums.EleDataTypeEnum;
|
import com.electromagnetic.industry.software.common.enums.EleDataTypeEnum;
|
||||||
import com.electromagnetic.industry.software.common.exception.BizException;
|
import com.electromagnetic.industry.software.common.exception.BizException;
|
||||||
import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
|
import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
|
||||||
import com.electromagnetic.industry.software.common.util.*;
|
import com.electromagnetic.industry.software.common.util.EleCommonUtil;
|
||||||
|
import com.electromagnetic.industry.software.common.util.EleLog;
|
||||||
|
import com.electromagnetic.industry.software.common.util.ElectromagneticResultUtil;
|
||||||
|
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
||||||
import com.electromagnetic.industry.software.manage.mapper.EdFileInfoMapper;
|
import com.electromagnetic.industry.software.manage.mapper.EdFileInfoMapper;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo;
|
import com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.req.FolderResortDTO;
|
import com.electromagnetic.industry.software.manage.pojo.req.FolderResortDTO;
|
||||||
|
|
@ -39,15 +42,13 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.electromagnetic.industry.software.common.cons.ElectromagneticConstants.*;
|
import static com.electromagnetic.industry.software.common.cons.ElectromagneticConstants.MYSQL_FILE_PATH_SPLIT;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo> implements EdFileInfoService {
|
public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo> implements EdFileInfoService {
|
||||||
|
|
||||||
private final EleLog log = new EleLog(EdFileInfoServiceImpl.class);
|
|
||||||
|
|
||||||
private static final String PRJ_PARENT_ID = "0";
|
private static final String PRJ_PARENT_ID = "0";
|
||||||
|
private final EleLog log = new EleLog(EdFileInfoServiceImpl.class);
|
||||||
@Resource
|
@Resource
|
||||||
private Environment environment;
|
private Environment environment;
|
||||||
|
|
||||||
|
|
@ -68,6 +69,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建一个新的工程
|
* 创建一个新的工程
|
||||||
|
*
|
||||||
* @param prjName 新的工程名
|
* @param prjName 新的工程名
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -132,6 +134,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改项目名称
|
* 修改项目名称
|
||||||
|
*
|
||||||
* @param prjId
|
* @param prjId
|
||||||
* @param newPrjName
|
* @param newPrjName
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -435,7 +438,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
List<EdFileInfo> targetTmpEdFiles = targetEdFileInfos.stream()
|
List<EdFileInfo> targetTmpEdFiles = targetEdFileInfos.stream()
|
||||||
.filter(e -> StrUtil.count(e.getFilePath(), MYSQL_FILE_PATH_SPLIT) == count)
|
.filter(e -> StrUtil.count(e.getFilePath(), MYSQL_FILE_PATH_SPLIT) == count)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
Map<String, EdFileInfo> sourceFileNameMap= sourceTmpEdFiles.stream().collect(Collectors.toMap(EdFileInfo::getFileName, e -> e));
|
Map<String, EdFileInfo> sourceFileNameMap = sourceTmpEdFiles.stream().collect(Collectors.toMap(EdFileInfo::getFileName, e -> e));
|
||||||
List<String> targetFileNames = targetTmpEdFiles.stream().map(EdFileInfo::getFileName).collect(Collectors.toList());
|
List<String> targetFileNames = targetTmpEdFiles.stream().map(EdFileInfo::getFileName).collect(Collectors.toList());
|
||||||
for (EdFileInfo edFileInfo : sourceTmpEdFiles) {
|
for (EdFileInfo edFileInfo : sourceTmpEdFiles) {
|
||||||
String sourceFileName = edFileInfo.getFileName();
|
String sourceFileName = edFileInfo.getFileName();
|
||||||
|
|
@ -493,7 +496,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
.set(EdFileInfo::getFileName, newFolderName));
|
.set(EdFileInfo::getFileName, newFolderName));
|
||||||
fileSystemService.renameFile(sysFilePath, newFolderName);
|
fileSystemService.renameFile(sysFilePath, newFolderName);
|
||||||
return ElectromagneticResultUtil.success(true);
|
return ElectromagneticResultUtil.success(true);
|
||||||
} catch(Exception e) {
|
} catch (Exception e) {
|
||||||
String info = StrFormatter.format("修改子集名称为{}失败", newFolderName);
|
String info = StrFormatter.format("修改子集名称为{}失败", newFolderName);
|
||||||
log.error(info, e);
|
log.error(info, e);
|
||||||
return ElectromagneticResultUtil.fail("-1", info);
|
return ElectromagneticResultUtil.fail("-1", info);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.electromagnetic.industry.software.manage.service.serviceimpl;
|
package com.electromagnetic.industry.software.manage.service.serviceimpl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
||||||
import com.electromagnetic.industry.software.common.enums.FilePermission;
|
import com.electromagnetic.industry.software.common.enums.FilePermission;
|
||||||
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
||||||
import com.electromagnetic.industry.software.manage.mapper.RolePermissionMapper;
|
import com.electromagnetic.industry.software.manage.mapper.RolePermissionMapper;
|
||||||
|
|
@ -27,13 +26,14 @@ public class PermissionServiceImpl implements PermissionService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前用户在当前目录的功能权限
|
* 查询当前用户在当前目录的功能权限
|
||||||
|
*
|
||||||
* @param userId
|
* @param userId
|
||||||
* @param fileId
|
* @param fileId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<String,Boolean> getUserPermission (String userId, String fileId){
|
public Map<String, Boolean> getUserPermission(String userId, String fileId) {
|
||||||
Map<String,Boolean> result = new HashMap<>();
|
Map<String, Boolean> result = new HashMap<>();
|
||||||
|
|
||||||
QueryWrapper<UserRole> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<UserRole> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.select("role_id").eq("user_id", userId);
|
queryWrapper.select("role_id").eq("user_id", userId);
|
||||||
|
|
@ -70,8 +70,8 @@ public class PermissionServiceImpl implements PermissionService {
|
||||||
|
|
||||||
QueryWrapper<RolePermission> queryWrapper1 = new QueryWrapper<>();
|
QueryWrapper<RolePermission> queryWrapper1 = new QueryWrapper<>();
|
||||||
queryWrapper1.select("file_id")
|
queryWrapper1.select("file_id")
|
||||||
.in("role_id",roleIds)
|
.in("role_id", roleIds)
|
||||||
.eq("permission_code",FilePermission.VIEW);
|
.eq("permission_code", FilePermission.VIEW);
|
||||||
List<Object> fileIds = rolePermissionMapper.selectObjs(queryWrapper1);
|
List<Object> fileIds = rolePermissionMapper.selectObjs(queryWrapper1);
|
||||||
|
|
||||||
return fileIds.stream()
|
return fileIds.stream()
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ public class UserServiceImpl implements UserService {
|
||||||
public Boolean bindRoles(UserRoleRequest userRolesRequest) {
|
public Boolean bindRoles(UserRoleRequest userRolesRequest) {
|
||||||
String userId = userRolesRequest.getUserId();
|
String userId = userRolesRequest.getUserId();
|
||||||
List<String> roleIds = userRolesRequest.getRoleIds();
|
List<String> roleIds = userRolesRequest.getRoleIds();
|
||||||
if (userId == null ) {
|
if (userId == null) {
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
// 删除当前用户原绑定角色
|
// 删除当前用户原绑定角色
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,19 @@
|
||||||
<mapper namespace="com.electromagnetic.industry.software.manage.mapper.EdFileInfoMapper">
|
<mapper namespace="com.electromagnetic.industry.software.manage.mapper.EdFileInfoMapper">
|
||||||
|
|
||||||
<select id="maxPrjId" resultType="java.lang.String">
|
<select id="maxPrjId" resultType="java.lang.String">
|
||||||
select max(id) from ed_file_info where length(id) = 6
|
select max(id)
|
||||||
|
from ed_file_info
|
||||||
|
where length(id) = 6
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectAllAdminFolder"
|
<select id="selectAllAdminFolder"
|
||||||
resultType="com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo">
|
resultType="com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo">
|
||||||
select id, file_name, parent_id, sort, file_path from ed_file_info where length(id) = 6 and effect_flag = 1 and data_type = 0 and file_path like concat(#{prjId}, '%')
|
select id, file_name, parent_id, sort, file_path
|
||||||
|
from ed_file_info
|
||||||
|
where length(id) = 6
|
||||||
|
and effect_flag = 1
|
||||||
|
and data_type = 0
|
||||||
|
and file_path like concat(#{prjId}, '%')
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.electromagnetic.industry.software.common.enums;
|
package com.electromagnetic.industry.software.common.enums;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否删除枚举
|
* 是否删除枚举
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ public enum FilePermission {
|
||||||
DOWNLOAD("download", "下载文件"),
|
DOWNLOAD("download", "下载文件"),
|
||||||
IMPORT("import", "导入文件"),
|
IMPORT("import", "导入文件"),
|
||||||
EXPORT("export", "导出文件");
|
EXPORT("export", "导出文件");
|
||||||
|
|
||||||
// 枚举属性
|
// 枚举属性
|
||||||
private final String code; // 权限代码
|
private final String code; // 权限代码
|
||||||
private final String description; // 权限描述
|
private final String description; // 权限描述
|
||||||
|
|
@ -25,16 +25,6 @@ public enum FilePermission {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取权限代码
|
|
||||||
public String getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取权限描述
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据 code 查找对应的枚举
|
// 根据 code 查找对应的枚举
|
||||||
public static FilePermission fromCode(String code) {
|
public static FilePermission fromCode(String code) {
|
||||||
for (FilePermission permission : FilePermission.values()) {
|
for (FilePermission permission : FilePermission.values()) {
|
||||||
|
|
@ -53,5 +43,15 @@ public enum FilePermission {
|
||||||
}
|
}
|
||||||
return codes;
|
return codes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取权限代码
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取权限描述
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ public class EleLog {
|
||||||
public void warn(String msg) {
|
public void warn(String msg) {
|
||||||
logger.warn(msg);
|
logger.warn(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void error(String msg) {
|
public void error(String msg) {
|
||||||
logger.error(msg);
|
logger.error(msg);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue