reformate code
This commit is contained in:
parent
75443f2d78
commit
a7ef78a56e
|
|
@ -2,7 +2,6 @@ package com.electromagnetic.industry.software.manage.config;
|
|||
|
||||
import cn.hutool.core.date.SystemClock;
|
||||
import com.electromagnetic.industry.software.common.cons.UserConstants;
|
||||
import com.electromagnetic.industry.software.common.enums.AdminTypeEnum;
|
||||
import com.electromagnetic.industry.software.common.pojo.UserLoginInfo;
|
||||
import com.electromagnetic.industry.software.common.util.TokenUtil;
|
||||
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
|
|||
import com.electromagnetic.industry.software.common.util.ElectromagneticResultUtil;
|
||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileRelation;
|
||||
import com.electromagnetic.industry.software.manage.pojo.req.CheckNameUniqueRequest;
|
||||
import com.electromagnetic.industry.software.manage.service.EdFileInfoService;
|
||||
import com.electromagnetic.industry.software.manage.service.EdFileRelationService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
|
@ -20,37 +19,39 @@ public class EdFileRelationController {
|
|||
|
||||
/**
|
||||
* 创建文件关系
|
||||
*
|
||||
* @param relation
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping (value = "/create", method = RequestMethod.POST)
|
||||
public ElectromagneticResult<?> createRelation (@RequestBody EdFileRelation relation) {
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
public ElectromagneticResult<?> createRelation(@RequestBody EdFileRelation relation) {
|
||||
return ElectromagneticResultUtil.success(edFileRelationService.createRelation(relation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消文件关系
|
||||
*
|
||||
* @param relationId 关系主键id
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping (value = "/cancel/{relationId}", method = RequestMethod.GET)
|
||||
public ElectromagneticResult<?> cancelRelation (@PathVariable("relationId") String relationId) {
|
||||
@RequestMapping(value = "/cancel/{relationId}", method = RequestMethod.GET)
|
||||
public ElectromagneticResult<?> cancelRelation(@PathVariable("relationId") String relationId) {
|
||||
return ElectromagneticResultUtil.success(edFileRelationService.cancelRelation(relationId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示文件关系
|
||||
*/
|
||||
@RequestMapping (value = "listRelations/{id}", method = RequestMethod.GET)
|
||||
public ElectromagneticResult<?> listRelations (@PathVariable("id") String id) {
|
||||
@RequestMapping(value = "listRelations/{id}", method = RequestMethod.GET)
|
||||
public ElectromagneticResult<?> listRelations(@PathVariable("id") String id) {
|
||||
return ElectromagneticResultUtil.success(edFileRelationService.listRelations(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检验文件名是否唯一
|
||||
*/
|
||||
@RequestMapping (value = "/checkFileNameExist", method = RequestMethod.POST)
|
||||
public ElectromagneticResult<?> checkFileNameExist (@RequestBody CheckNameUniqueRequest checkNameUniqueRequest) {
|
||||
@RequestMapping(value = "/checkFileNameExist", method = RequestMethod.POST)
|
||||
public ElectromagneticResult<?> checkFileNameExist(@RequestBody CheckNameUniqueRequest checkNameUniqueRequest) {
|
||||
String fileName = checkNameUniqueRequest.getFileName();
|
||||
String parentId = checkNameUniqueRequest.getParentId();
|
||||
return ElectromagneticResultUtil.success(edFileRelationService.checkNameUnique(parentId, fileName));
|
||||
|
|
@ -59,11 +60,11 @@ public class EdFileRelationController {
|
|||
/**
|
||||
* 本地上传并建立关系
|
||||
*/
|
||||
@RequestMapping (value="/upload", method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/upload", method = RequestMethod.POST)
|
||||
public ElectromagneticResult<?> uploadRelation(@RequestParam("parentId") String parentId,
|
||||
@RequestParam("file") MultipartFile file,
|
||||
@RequestParam("description") String description,
|
||||
@RequestParam("id") String id){
|
||||
return ElectromagneticResultUtil.success(edFileRelationService.uploadFileAndRelation(parentId,id,file,description));
|
||||
@RequestParam("id") String id) {
|
||||
return ElectromagneticResultUtil.success(edFileRelationService.uploadFileAndRelation(parentId, id, file, description));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import com.electromagnetic.industry.software.manage.pojo.req.RoleDTO;
|
|||
import com.electromagnetic.industry.software.manage.pojo.req.RolePageDTO;
|
||||
import com.electromagnetic.industry.software.manage.service.RoleService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -71,7 +70,7 @@ public class RoleController {
|
|||
return ElectromagneticResultUtil.success(roleService.getAllRoleNames());
|
||||
}
|
||||
|
||||
@ApiOperation(value="获得角色配置模版", notes = "")
|
||||
@ApiOperation(value = "获得角色配置模版", notes = "")
|
||||
@GetMapping(value = "/getRoleTemplate")
|
||||
public ElectromagneticResult<?> getRoleTemplate() {
|
||||
return ElectromagneticResultUtil.success(roleService.getRoleTemplate());
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.electromagnetic.industry.software.manage.pojo.models;
|
|||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.electromagnetic.industry.software.manage.pojo.other;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@ import java.util.List;
|
|||
public class UploadRecordVO {
|
||||
|
||||
private long total;
|
||||
List<UploadRecordDTO> records = new ArrayList<>();
|
||||
private List<UploadRecordDTO> records = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import com.electromagnetic.industry.software.manage.pojo.req.FileInfoQueryDTO;
|
|||
import com.electromagnetic.industry.software.manage.pojo.req.UpdateFileInfoDTO;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -141,12 +140,14 @@ public interface EdFileInfoService {
|
|||
|
||||
/**
|
||||
* 发布管理
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ElectromagneticResult<?> uploadRecord(int pageNum, int pageSize);
|
||||
|
||||
/**
|
||||
* 查询文件详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ public interface EdFileRelationService {
|
|||
|
||||
/**
|
||||
* 创建文件关系
|
||||
*
|
||||
* @param edFileRelation
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -16,20 +17,23 @@ public interface EdFileRelationService {
|
|||
|
||||
/**
|
||||
* 取消文件关系
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Boolean cancelRelation (String id);
|
||||
Boolean cancelRelation(String id);
|
||||
|
||||
/**
|
||||
* 获取关系展示数据
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
FileRelationViewVO listRelations (String id);
|
||||
FileRelationViewVO listRelations(String id);
|
||||
|
||||
/**
|
||||
* 检查文件名是否唯一
|
||||
*
|
||||
* @param parentId
|
||||
* @param fileName
|
||||
* @return
|
||||
|
|
@ -40,7 +44,7 @@ public interface EdFileRelationService {
|
|||
* 文件上传并建立关系
|
||||
*
|
||||
* @param parentId
|
||||
* @param id 主文件Id
|
||||
* @param id 主文件Id
|
||||
* @param file
|
||||
* @param descrption 关系描述
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ public interface EdPrjService {
|
|||
|
||||
/**
|
||||
* 获取项目的发布状态
|
||||
*
|
||||
* @param queryPublishStatus
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import cn.hutool.core.io.IoUtil;
|
|||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.text.StrFormatter;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
|
|
@ -61,9 +62,9 @@ import static com.electromagnetic.industry.software.common.cons.ElectromagneticC
|
|||
@Service
|
||||
public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo> implements EdFileInfoService {
|
||||
|
||||
private final EleLog log = new EleLog(EdFileInfoServiceImpl.class);
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
private final EleLog log = new EleLog(EdFileInfoServiceImpl.class);
|
||||
@Resource
|
||||
private FileSystemService fileSystemService;
|
||||
@Resource
|
||||
|
|
@ -91,46 +92,45 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
/**
|
||||
* 查询文件列表
|
||||
*
|
||||
* @param fileInfoQueryDTO
|
||||
* @param pars
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ElectromagneticResult<?> queryEdFileInfo(FileInfoQueryDTO fileInfoQueryDTO) {
|
||||
public ElectromagneticResult<?> queryEdFileInfo(FileInfoQueryDTO pars) {
|
||||
|
||||
LambdaQueryWrapper<EdFileInfo> queryWrapper = Wrappers.lambdaQuery(EdFileInfo.class)
|
||||
.select()
|
||||
.eq(EdFileInfo::getSaveStatus, EleDataSaveStatusEnum.SUCCESS.code)
|
||||
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code)
|
||||
.eq(EdFileInfo::getParentId, fileInfoQueryDTO.getParentId())
|
||||
.eq(Objects.equals(fileInfoQueryDTO.getDataStatus(), EleDataStatusEnum.NOT_PUBLISHED.code), EdFileInfo::getDataStatus, EleDataStatusEnum.NOT_PUBLISHED.code)
|
||||
.eq(Objects.equals(fileInfoQueryDTO.getDataStatus(), EleDataStatusEnum.PUBLISHED.code), EdFileInfo::getDataStatus, EleDataStatusEnum.PUBLISHED.code)
|
||||
.eq(Objects.equals(fileInfoQueryDTO.getDataStatus(), EleDataStatusEnum.OCCUPY.code), EdFileInfo::getDataStatus, EleDataStatusEnum.OCCUPY.code)
|
||||
.eq(StrUtil.isNotEmpty(fileInfoQueryDTO.getFileType()), EdFileInfo::getFileType, fileInfoQueryDTO.getFileType())
|
||||
.eq(EdFileInfo::getParentId, pars.getParentId())
|
||||
.eq(ObjUtil.equals(pars.getDataStatus(), EleDataStatusEnum.NOT_PUBLISHED.code), EdFileInfo::getDataStatus, EleDataStatusEnum.NOT_PUBLISHED.code)
|
||||
.eq(ObjUtil.equals(pars.getDataStatus(), EleDataStatusEnum.PUBLISHED.code), EdFileInfo::getDataStatus, EleDataStatusEnum.PUBLISHED.code)
|
||||
.eq(ObjUtil.equals(pars.getDataStatus(), EleDataStatusEnum.OCCUPY.code), EdFileInfo::getDataStatus, EleDataStatusEnum.OCCUPY.code)
|
||||
.eq(StrUtil.isNotEmpty(pars.getFileType()), EdFileInfo::getFileType, pars.getFileType())
|
||||
|
||||
.like(StrUtil.isNotEmpty(fileInfoQueryDTO.getKeyword()), EdFileInfo::getFileName, fileInfoQueryDTO.getKeyword())
|
||||
.like(StrUtil.isNotEmpty(fileInfoQueryDTO.getKeyword()), EdFileInfo::getFileNote, fileInfoQueryDTO.getKeyword())
|
||||
.like(StrUtil.isNotEmpty(pars.getKeyword()), EdFileInfo::getFileName, pars.getKeyword())
|
||||
.like(StrUtil.isNotEmpty(pars.getKeyword()), EdFileInfo::getFileNote, pars.getKeyword())
|
||||
|
||||
.orderByAsc(Objects.equals(fileInfoQueryDTO.getCreatedTime(), 0), EdFileInfo::getCreatedTime)
|
||||
.orderByDesc(Objects.equals(fileInfoQueryDTO.getCreatedTime(), 1), EdFileInfo::getCreatedTime)
|
||||
.orderByAsc(ObjUtil.equals(pars.getCreatedTime(), 0), EdFileInfo::getCreatedTime)
|
||||
.orderByDesc(ObjUtil.equals(pars.getCreatedTime(), 1), EdFileInfo::getCreatedTime)
|
||||
.orderByDesc(ObjUtil.isAllEmpty(pars.getCreatedTime(), pars.getFileVersion(), pars.getFileSize(), pars.getFileNameSort(), pars.getUpdatedTime(), pars.getFileTypeSort()), EdFileInfo::getCreatedTime)
|
||||
|
||||
.orderByAsc(Objects.equals(fileInfoQueryDTO.getFileVersion(), 0), EdFileInfo::getFileVersion)
|
||||
.orderByDesc(Objects.equals(fileInfoQueryDTO.getFileVersion(), 1), EdFileInfo::getFileVersion)
|
||||
.orderByAsc(ObjUtil.equals(pars.getFileVersion(), 0), EdFileInfo::getFileVersion)
|
||||
.orderByDesc(ObjUtil.equals(pars.getFileVersion(), 1), EdFileInfo::getFileVersion)
|
||||
|
||||
.orderByAsc(Objects.equals(fileInfoQueryDTO.getFileSize(), 0), EdFileInfo::getFileSize)
|
||||
.orderByDesc(Objects.equals(fileInfoQueryDTO.getFileSize(), 1), EdFileInfo::getFileSize)
|
||||
.orderByAsc(ObjUtil.equals(pars.getFileSize(), 0), EdFileInfo::getFileSize)
|
||||
.orderByDesc(ObjUtil.equals(pars.getFileSize(), 1), EdFileInfo::getFileSize)
|
||||
|
||||
.orderByAsc(Objects.equals(fileInfoQueryDTO.getFileNameSort(), 0), EdFileInfo::getFileName)
|
||||
.orderByDesc(Objects.equals(fileInfoQueryDTO.getFileNameSort(), 1), EdFileInfo::getFileName)
|
||||
.orderByAsc(ObjUtil.equals(pars.getFileNameSort(), 0), EdFileInfo::getFileName)
|
||||
.orderByDesc(ObjUtil.equals(pars.getFileNameSort(), 1), EdFileInfo::getFileName)
|
||||
|
||||
.orderByAsc(Objects.equals(fileInfoQueryDTO.getUpdatedTime(), 0), EdFileInfo::getUpdatedTime)
|
||||
.orderByDesc(Objects.equals(fileInfoQueryDTO.getUpdatedTime(), 1), EdFileInfo::getUpdatedTime)
|
||||
.orderByAsc(ObjUtil.equals(pars.getUpdatedTime(), 0), EdFileInfo::getUpdatedTime)
|
||||
.orderByDesc(ObjUtil.equals(pars.getUpdatedTime(), 1), EdFileInfo::getUpdatedTime)
|
||||
|
||||
.orderByAsc(Objects.equals(fileInfoQueryDTO.getFileTypeSort(), 0), EdFileInfo::getFileType)
|
||||
.orderByDesc(Objects.equals(fileInfoQueryDTO.getFileTypeSort(), 1), EdFileInfo::getFileType)
|
||||
.orderByAsc(ObjUtil.equals(pars.getFileTypeSort(), 0), EdFileInfo::getSort)
|
||||
.orderByDesc(ObjUtil.equals(pars.getFileTypeSort(), 1), EdFileInfo::getSort);
|
||||
|
||||
.orderByAsc(Objects.equals(fileInfoQueryDTO.getCreatedTime(), 0), EdFileInfo::getCreatedTime)
|
||||
.orderByDesc(Objects.equals(fileInfoQueryDTO.getCreatedTime(), 1), EdFileInfo::getCreatedTime);
|
||||
Page<EdFileInfo> edFileInfoPage = this.baseMapper.selectPage(new Page<>(fileInfoQueryDTO.getPageNum(), fileInfoQueryDTO.getPageSize()), queryWrapper);
|
||||
Page<EdFileInfo> edFileInfoPage = this.baseMapper.selectPage(new Page<>(pars.getPageNum(), pars.getPageSize()), queryWrapper);
|
||||
long total = edFileInfoPage.getTotal();
|
||||
List<FileInfoVO> records = BeanUtil.copyToList(edFileInfoPage.getRecords(), FileInfoVO.class);
|
||||
resetFileSize(records);
|
||||
|
|
@ -153,6 +153,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
|
||||
/**
|
||||
* 新建文件夹
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -502,7 +503,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
String preVersionId = dbVersionRelation.get(id);
|
||||
EdFileInfo tmp = importIdMap.get(preVersionId);
|
||||
saveObj.setPreVersion(tmp.getFileVersion());
|
||||
int effect = Objects.equals(saveObj.getId(), effectId) ? EffectFlagEnum.EFFECT.code : EffectFlagEnum.NOT_EFFECTIVE.code;
|
||||
int effect = ObjUtil.equals(saveObj.getId(), effectId) ? EffectFlagEnum.EFFECT.code : EffectFlagEnum.NOT_EFFECTIVE.code;
|
||||
saveObj.setEffectFlag(effect);
|
||||
}
|
||||
allObjs.addAll(saveObjs);
|
||||
|
|
@ -557,7 +558,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
for (EdFileInfo edFileInfo : edFileInfos) {
|
||||
Integer preVersion = edFileInfo.getPreVersion();
|
||||
EdFileInfo fileInfo = versionMap.get(preVersion);
|
||||
String preVersionId = Objects.isNull(fileInfo) ? null : fileInfo.getId();
|
||||
String preVersionId = ObjUtil.isNull(fileInfo) ? null : fileInfo.getId();
|
||||
versionRelation.put(edFileInfo.getId(), preVersionId);
|
||||
}
|
||||
return versionRelation;
|
||||
|
|
@ -588,7 +589,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
List<EdFileInfo> resFiles = new ArrayList<>(maps.values());
|
||||
String prjId = resFiles.get(0).getFilePath().split(MYSQL_FILE_PATH_SPLIT)[0];
|
||||
List<EdFileInfo> prjFolders = this.baseMapper.selectList(Wrappers.lambdaQuery(EdFileInfo.class)
|
||||
.likeRight(EdFileInfo::getFilePath, prjId + MYSQL_FILE_PATH_SPLIT)
|
||||
.likeRight(EdFileInfo::getFilePath, prjId + MYSQL_FILE_PATH_SPLIT)
|
||||
.eq(EdFileInfo::getPrjDir, true)
|
||||
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code));
|
||||
EdFileInfo prjFileInfo = this.baseMapper.selectById(prjId);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import com.electromagnetic.industry.software.manage.pojo.resp.FileSimpleInfoVO;
|
|||
import com.electromagnetic.industry.software.manage.service.EdFileRelationService;
|
||||
import com.electromagnetic.industry.software.manage.service.FileSystemService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
|
@ -35,23 +34,24 @@ import static com.electromagnetic.industry.software.common.cons.ElectromagneticC
|
|||
@Service
|
||||
public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper, EdFileRelation> implements EdFileRelationService {
|
||||
|
||||
private final EleLog log = new EleLog(EdFileInfoServiceImpl.class);
|
||||
@Resource
|
||||
EdFileInfoMapper edFileInfoMapper;
|
||||
@Resource
|
||||
EdFileInfoServiceImpl edFileInfoService;
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
private final EleLog log = new EleLog(EdFileInfoServiceImpl.class);
|
||||
@Resource
|
||||
private FileSystemService fileSystemService;
|
||||
|
||||
/**
|
||||
* 创建文件关系
|
||||
*
|
||||
* @param edFileRelation
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean createRelation (EdFileRelation edFileRelation) {
|
||||
public Boolean createRelation(EdFileRelation edFileRelation) {
|
||||
// 无法建立已建立的关系
|
||||
String queryId1 = edFileRelation.getId1();
|
||||
String queryId2 = edFileRelation.getId2();
|
||||
|
|
@ -61,7 +61,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
|||
.eq(EdFileRelation::getId1, queryId2).eq(EdFileRelation::getId2, queryId1);
|
||||
List<EdFileRelation> list = this.list(queryWrapper);
|
||||
if (!list.isEmpty()) {
|
||||
throw new BizException (-1, "请勿重复建立关系");
|
||||
throw new BizException(-1, "请勿重复建立关系");
|
||||
}
|
||||
|
||||
edFileRelation.setId(IdWorker.getSnowFlakeIdString());
|
||||
|
|
@ -71,11 +71,12 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
|||
|
||||
/**
|
||||
* 取消文件关系
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean cancelRelation (String id) {
|
||||
public Boolean cancelRelation(String id) {
|
||||
return this.removeById(id);
|
||||
}
|
||||
|
||||
|
|
@ -130,6 +131,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
|||
|
||||
/**
|
||||
* 检查文件名是否唯一
|
||||
*
|
||||
* @param parentId
|
||||
* @param fileName
|
||||
* @return
|
||||
|
|
@ -160,9 +162,9 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
|||
List<Edge> edges = new ArrayList<>();
|
||||
for (EdFileRelation edFileRelation : list) {
|
||||
if (edFileRelation.getId1().equals(id)) {
|
||||
edges.add(new Edge(edFileRelation.getId1(), edFileRelation.getId2(),edFileRelation.getId(),edFileRelation.getRelationship()));
|
||||
edges.add(new Edge(edFileRelation.getId1(), edFileRelation.getId2(), edFileRelation.getId(), edFileRelation.getRelationship()));
|
||||
} else {
|
||||
edges.add(new Edge(edFileRelation.getId2(), edFileRelation.getId1(),edFileRelation.getId(),edFileRelation.getRelationship()));
|
||||
edges.add(new Edge(edFileRelation.getId2(), edFileRelation.getId1(), edFileRelation.getId(), edFileRelation.getRelationship()));
|
||||
}
|
||||
}
|
||||
return edges;
|
||||
|
|
@ -172,7 +174,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
|||
* 文件上传
|
||||
*
|
||||
* @param parentId
|
||||
* @param id 主文件Id
|
||||
* @param id 主文件Id
|
||||
* @param file
|
||||
* @param descrption 关系描述
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -8,7 +8,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.electromagnetic.industry.software.common.enums.*;
|
||||
import com.electromagnetic.industry.software.common.enums.EffectFlagEnum;
|
||||
import com.electromagnetic.industry.software.common.enums.EleDataSaveStatusEnum;
|
||||
import com.electromagnetic.industry.software.common.enums.EleDataStatusEnum;
|
||||
import com.electromagnetic.industry.software.common.enums.EleDataTypeEnum;
|
||||
import com.electromagnetic.industry.software.common.exception.BizException;
|
||||
import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
|
||||
import com.electromagnetic.industry.software.common.util.EleCommonUtil;
|
||||
|
|
|
|||
|
|
@ -24,8 +24,10 @@ import com.electromagnetic.industry.software.manage.pojo.models.UserRole;
|
|||
import com.electromagnetic.industry.software.manage.pojo.req.RoleDTO;
|
||||
import com.electromagnetic.industry.software.manage.pojo.req.RolePageDTO;
|
||||
import com.electromagnetic.industry.software.manage.pojo.req.RolePermissionDTO;
|
||||
import com.electromagnetic.industry.software.manage.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.electromagnetic.industry.software.manage.service.PermissionService;
|
||||
import com.electromagnetic.industry.software.manage.service.RolePermissionService;
|
||||
import com.electromagnetic.industry.software.manage.service.RoleService;
|
||||
import com.electromagnetic.industry.software.manage.service.UserRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -65,7 +67,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||
@Override
|
||||
public Boolean createRole(RoleDTO roleDTO) {
|
||||
|
||||
if (!checkRoleNameUnique(roleDTO) ) {
|
||||
if (!checkRoleNameUnique(roleDTO)) {
|
||||
String info = "当前角色名称已存在:" + roleDTO.getRoleName();
|
||||
log.error(info);
|
||||
throw new BizException(-1, info);
|
||||
|
|
@ -101,7 +103,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||
@Override
|
||||
public Boolean updateRole(RoleDTO roleDTO) {
|
||||
|
||||
if (!checkRoleNameUnique(roleDTO) ) {
|
||||
if (!checkRoleNameUnique(roleDTO)) {
|
||||
String info = "当前角色名称已存在:" + roleDTO.getRoleName();
|
||||
log.error(info);
|
||||
throw new BizException(-1, info);
|
||||
|
|
@ -250,7 +252,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||
queryWrapper.select(Role::getRoleName);
|
||||
|
||||
List<String> roleNames = this.listObjs(queryWrapper).stream().map(Object::toString).collect(Collectors.toList());
|
||||
List<HashMap<String,String>> result = new ArrayList<>();
|
||||
List<HashMap<String, String>> result = new ArrayList<>();
|
||||
for (String roleName : roleNames) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("value", roleName);
|
||||
|
|
@ -365,6 +367,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||
|
||||
/**
|
||||
* 获取层级树结构
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<EdFileInfo> getFiles() {
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ import com.electromagnetic.industry.software.manage.service.UserService;
|
|||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
|
|||
4
pom.xml
4
pom.xml
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue