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")
|
||||||
|
|
|
||||||
|
|
@ -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")
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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,6 +7,7 @@ public interface PermissionService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前用户在当前目录的功能权限
|
* 查询当前用户在当前目录的功能权限
|
||||||
|
*
|
||||||
* @param userId
|
* @param userId
|
||||||
* @param fileId
|
* @param fileId
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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,6 +26,7 @@ public class PermissionServiceImpl implements PermissionService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前用户在当前目录的功能权限
|
* 查询当前用户在当前目录的功能权限
|
||||||
|
*
|
||||||
* @param userId
|
* @param userId
|
||||||
* @param fileId
|
* @param fileId
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
|
|
@ -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;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否删除枚举
|
* 是否删除枚举
|
||||||
|
|
|
||||||
|
|
@ -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