初次提交
This commit is contained in:
parent
ad3f99c9ab
commit
480ca9397b
|
@ -6,9 +6,11 @@
|
|||
<component name="ChangeListManager">
|
||||
<list default="true" id="af4c07b7-4ec6-4591-87e0-621479a360cc" name="更改" comment="初次提交">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/hivekion/common/filter/JwtAuthenticationFilter.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/hivekion/common/filter/JwtAuthenticationFilter.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/hivekion/common/security/JwtTokenUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/hivekion/common/security/JwtTokenUtils.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/hivekion/CodeGenerator.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/hivekion/CodeGenerator.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/hivekion/baseData/controller/TreeController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/hivekion/baseData/controller/TreeController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/hivekion/common/entity/vo/LoginUser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/hivekion/common/entity/vo/LoginUser.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/hivekion/common/services/CustomUserDetailServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/hivekion/common/services/CustomUserDetailServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/hivekion/system/controller/UserLoginController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/hivekion/system/controller/UserLoginController.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -38,13 +40,15 @@
|
|||
"keyToString": {
|
||||
"Maven.springbootmybatis [clean].executor": "Run",
|
||||
"Maven.springbootmybatis [compile].executor": "Run",
|
||||
"Maven.springbootmybatis [package].executor": "Run",
|
||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||
"RequestMappingsPanelOrder0": "0",
|
||||
"RequestMappingsPanelOrder1": "1",
|
||||
"RequestMappingsPanelWidth0": "75",
|
||||
"RequestMappingsPanelWidth1": "75",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"Spring Boot.DemoApplication.executor": "Debug",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"Spring Boot.DemoApplication.executor": "Run",
|
||||
"git-widget-placeholder": "main",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
|
@ -55,13 +59,32 @@
|
|||
"project.structure.proportion": "0.15",
|
||||
"project.structure.side.proportion": "0.2",
|
||||
"settings.editor.selected.configurable": "reference.projectsettings.compiler.javacompiler",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
"vue.rearranger.settings.migration": "true",
|
||||
"应用程序.CodeGenerator.executor": "Run"
|
||||
},
|
||||
"keyToStringList": {
|
||||
"DatabaseDriversLRU": [
|
||||
"mysql"
|
||||
]
|
||||
}
|
||||
}]]></component>
|
||||
<component name="ReactorSettings">
|
||||
<option name="notificationShown" value="true" />
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<component name="RunManager" selected="Spring Boot.DemoApplication">
|
||||
<configuration name="CodeGenerator" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.hivekion.CodeGenerator" />
|
||||
<module name="springbootmybatis" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.hivekion.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="DemoApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
|
||||
<module name="springbootmybatis" />
|
||||
<option name="SPRING_BOOT_MAIN_CLASS" value="com.hivekion.DemoApplication" />
|
||||
|
@ -69,6 +92,11 @@
|
|||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="应用程序.CodeGenerator" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
|
@ -87,7 +115,9 @@
|
|||
<updated>1754560710248</updated>
|
||||
<workItem from="1754560714503" duration="2195000" />
|
||||
<workItem from="1754563543522" duration="8000" />
|
||||
<workItem from="1754564611042" duration="1866000" />
|
||||
<workItem from="1754564611042" duration="2016000" />
|
||||
<workItem from="1754567879649" duration="1208000" />
|
||||
<workItem from="1754614336718" duration="11404000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="初次提交">
|
||||
<option name="closed" value="true" />
|
||||
|
@ -113,7 +143,15 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1754565249597</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="4" />
|
||||
<task id="LOCAL-00004" summary="初次提交">
|
||||
<option name="closed" value="true" />
|
||||
<created>1754566593438</created>
|
||||
<option name="number" value="00004" />
|
||||
<option name="presentableId" value="LOCAL-00004" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1754566593438</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="5" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
|
@ -127,9 +165,14 @@
|
|||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/hivekion/common/filter/JwtAuthenticationFilter.java</url>
|
||||
<line>83</line>
|
||||
<option name="timeStamp" value="1" />
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/hivekion/system/controller/UserLoginController.java</url>
|
||||
<line>172</line>
|
||||
<option name="timeStamp" value="2" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/hivekion/system/controller/UserLoginController.java</url>
|
||||
<line>103</line>
|
||||
<option name="timeStamp" value="3" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
|
|
|
@ -28,12 +28,12 @@ public class CodeGenerator {
|
|||
})
|
||||
.packageConfig(builder -> {
|
||||
builder.parent("com.hivekion") // 设置父包名
|
||||
.moduleName("scenario") // 设置模块名(可选)
|
||||
.moduleName("environment") // 设置模块名(可选)
|
||||
.pathInfo(Collections.singletonMap(OutputFile.xml,
|
||||
basePath + "/src/main/resources/mapper/tbl")); // 设置mapperXml生成路径
|
||||
})
|
||||
.strategyConfig(builder -> {
|
||||
builder.addInclude("tbl_scenario_history") // 设置需要生成的表名(多个用逗号分隔)
|
||||
builder.addInclude("tbl_ebe") // 设置需要生成的表名(多个用逗号分隔)
|
||||
.addTablePrefix("tbl_"); // 设置过滤表前缀
|
||||
})
|
||||
.execute();
|
||||
|
|
|
@ -21,13 +21,6 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 系统中的树接口
|
||||
*
|
||||
* @author LiDongYU
|
||||
* @since 2025/7/22
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/tree")
|
||||
@Api(value = "", tags = {"树数据-系统中各类树接口"})
|
||||
|
@ -38,12 +31,6 @@ public class TreeController {
|
|||
@Resource
|
||||
private FightpowerhierarchyService fightpowerhierarchyService;
|
||||
|
||||
/**
|
||||
* 获取指定id的树;如果ID为空,返回所有
|
||||
*
|
||||
* @param id 指定ID
|
||||
* @return 列表或者对象
|
||||
*/
|
||||
@GetMapping("/armament")
|
||||
@ApiOperation(value = "装备树", notes = "")
|
||||
public ResponseData<List<TreeNode>> armamentTree(
|
||||
|
@ -65,7 +52,6 @@ public class TreeController {
|
|||
return ResponseData.success(nodeList);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/organization")
|
||||
@ApiOperation(value = "组织机构树", notes = "")
|
||||
public ResponseData<List<TreeNode>> organizedTree(Integer id) {
|
||||
|
@ -79,22 +65,18 @@ public class TreeController {
|
|||
|
||||
/**
|
||||
* 增加树节点到list
|
||||
* @param nodeList 节点列表
|
||||
* @param id 对象ID
|
||||
* @param list 对象列表
|
||||
* @param <T> 泛型对象
|
||||
*/
|
||||
private <T extends TreeEntity> void addTreeNodeToList(List<TreeNode> nodeList, Integer id, List<T> list) {
|
||||
//映射 key-value
|
||||
Map<Integer, TreeEntity> tblEntityMap = idMap(list);
|
||||
//id=父ID
|
||||
Map<Integer, List<TreeEntity>> parentMap = parentIdMap(list);
|
||||
Map<Integer, T> entityMap = idMap(list);
|
||||
Map<Integer, List<T>> parentMap = parentIdMap(list);
|
||||
if (id != null) {
|
||||
TreeEntity entity = tblEntityMap.get(id);
|
||||
buildOneEntity(nodeList, entity, parentMap);
|
||||
T entity = entityMap.get(id);
|
||||
if (entity != null) {
|
||||
buildOneEntity(nodeList, entity, parentMap);
|
||||
}
|
||||
} else {
|
||||
parentMap.forEach((key, value) -> {
|
||||
if (key <= 0) {
|
||||
if (key == null || key <= 0) {
|
||||
value.forEach(t -> buildOneEntity(nodeList, t, parentMap));
|
||||
}
|
||||
});
|
||||
|
@ -103,12 +85,9 @@ public class TreeController {
|
|||
|
||||
/**
|
||||
* 建立一个节点的树形数据
|
||||
* @param nodeList 节点列表
|
||||
* @param entity 对象
|
||||
* @param parentMap key=parentId,value为对象list
|
||||
*/
|
||||
private void buildOneEntity(List<TreeNode> nodeList, TreeEntity entity,
|
||||
Map<Integer, List<TreeEntity>> parentMap) {
|
||||
private <T extends TreeEntity> void buildOneEntity(List<TreeNode> nodeList, T entity,
|
||||
Map<Integer, List<T>> parentMap) {
|
||||
TreeNode node = new TreeNode(String.valueOf(entity.getId()), entity.getTitleName(),
|
||||
String.valueOf(entity.getId()));
|
||||
nodeList.add(node);
|
||||
|
@ -116,13 +95,12 @@ public class TreeController {
|
|||
buildRecursionArmamentTree(node, parentMap);
|
||||
}
|
||||
|
||||
|
||||
private void buildRecursionArmamentTree(TreeNode info, Map<Integer, List<TreeEntity>> parentMap) {
|
||||
|
||||
if (parentMap.containsKey(Integer.parseInt(info.getKey()))) {
|
||||
private <T extends TreeEntity> void buildRecursionArmamentTree(TreeNode info, Map<Integer, List<T>> parentMap) {
|
||||
Integer key = Integer.parseInt(info.getKey());
|
||||
if (parentMap.containsKey(key)) {
|
||||
List<TreeNode> children = new ArrayList<>();
|
||||
info.setChildren(children);
|
||||
parentMap.get(Integer.parseInt(info.getKey())).forEach(a -> {
|
||||
parentMap.get(key).forEach(a -> {
|
||||
TreeNode innerNode = new TreeNode(String.valueOf(a.getId()), a.getTitleName(),
|
||||
String.valueOf(a.getId()));
|
||||
children.add(innerNode);
|
||||
|
@ -131,11 +109,11 @@ public class TreeController {
|
|||
}
|
||||
}
|
||||
|
||||
private <T extends TreeEntity> Map<Integer, TreeEntity> idMap(List<T> list) {
|
||||
private <T extends TreeEntity> Map<Integer, T> idMap(List<T> list) {
|
||||
return list.stream().collect(Collectors.toMap(TreeEntity::getId, a -> a));
|
||||
}
|
||||
|
||||
private <T extends TreeEntity> Map<Integer, List<TreeEntity>> parentIdMap(List<T> list) {
|
||||
private <T extends TreeEntity> Map<Integer, List<T>> parentIdMap(List<T> list) {
|
||||
return list.stream().collect(Collectors.groupingBy(a -> {
|
||||
if (a.getParentId() == null) {
|
||||
a.setParentId(0);
|
||||
|
@ -143,6 +121,4 @@ public class TreeController {
|
|||
return a.getParentId();
|
||||
}, LinkedHashMap::new, Collectors.toList()));
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -29,7 +29,7 @@ public class LoginUser implements UserDetails {
|
|||
return this.passWord;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
|
||||
@Override
|
||||
public String getUsername() {
|
||||
return this.userName;
|
||||
|
@ -40,7 +40,7 @@ public class LoginUser implements UserDetails {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
@JsonIgnore
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonExpired() {
|
||||
return true;
|
||||
|
@ -51,7 +51,7 @@ public class LoginUser implements UserDetails {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
@JsonIgnore
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonLocked() {
|
||||
return true;
|
||||
|
|
|
@ -40,6 +40,7 @@ public class CustomUserDetailServiceImpl implements UserDetailsService {
|
|||
LoginUser user = new LoginUser();
|
||||
BeanUtils.copyProperties(sysUser, user);
|
||||
user.setEnabled(sysUser.getStatus().equals(0));
|
||||
user.setUserName(username);
|
||||
user.setUserId(sysUser.getId());
|
||||
if (user.getUsername().equals("admin")) {
|
||||
List<String> permissions =
|
||||
|
|
|
@ -206,6 +206,7 @@ public class UserLoginController {
|
|||
public List<UserMenuVo> UserMenu() {
|
||||
LoginUser currentUser = SecurityUtils.getCurrentLoginUser();
|
||||
List<String> permissions = new ArrayList<>();
|
||||
|
||||
if (currentUser.getUsername().equals("admin")) {
|
||||
permissions = menuService.getMenuList().stream().map(x -> x.getId()).collect(Collectors.toList());
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user