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