【7.2.5】【system】更新sys_app表增加一个是否是运维平台的标识

pull/40/MERGE v7.2.5
fengshuonan 2022-10-19 21:57:33 +08:00
parent 624ba3c15c
commit ade9d3a43e
8 changed files with 46 additions and 14 deletions

View File

@ -83,4 +83,13 @@ public interface AppServiceApi {
*/ */
List<SysAppResult> getSortedApps(); List<SysAppResult> getSortedApps();
/**
* app
*
* @param devopsFlag
* @author fengshuonan
* @date 2022/4/6 22:34
*/
List<SysAppResult> getSortedApps(Boolean devopsFlag);
} }

View File

@ -92,7 +92,7 @@ public interface MenuServiceApi {
* @author fengshuonan * @author fengshuonan
* @date 2022/4/8 15:59 * @date 2022/4/8 15:59
*/ */
List<IndexMenuInfo> buildAuthorities(Integer menuFrontType); List<IndexMenuInfo> buildAuthorities(Integer menuFrontType, Boolean devopsFlag);
/** /**
* *

View File

@ -86,6 +86,22 @@ public class SysApp extends BaseEntity {
@ChineseDescription("状态1-启用2-禁用") @ChineseDescription("状态1-启用2-禁用")
private Integer statusFlag; private Integer statusFlag;
/**
* -
*/
@TableField("app_sort")
@ChineseDescription("排序-升序")
private Integer appSort;
/**
* devopsY-N-
* <p>
* devopsdevops
*/
@TableField(value = "devops_flag")
@ChineseDescription("是否是devops应用Y-是N-否")
private String devopsFlag;
/** /**
* Y-N- * Y-N-
*/ */
@ -93,10 +109,4 @@ public class SysApp extends BaseEntity {
@ChineseDescription("是否删除Y-已删除N-未删除") @ChineseDescription("是否删除Y-已删除N-未删除")
private String delFlag; private String delFlag;
/**
* -
*/
@TableField("app_sort")
@ChineseDescription("排序-升序")
private Integer appSort;
} }

View File

@ -265,6 +265,11 @@ public class SysAppServiceImpl extends ServiceImpl<SysAppMapper, SysApp> impleme
@Override @Override
public List<SysAppResult> getSortedApps() { public List<SysAppResult> getSortedApps() {
return this.getSortedApps(false);
}
@Override
public List<SysAppResult> getSortedApps(Boolean devopsFlag) {
LambdaQueryWrapper<SysApp> wrapper = this.createWrapper(new SysAppRequest()); LambdaQueryWrapper<SysApp> wrapper = this.createWrapper(new SysAppRequest());
// 只查询应用名称和应用编码 // 只查询应用名称和应用编码
@ -273,6 +278,11 @@ public class SysAppServiceImpl extends ServiceImpl<SysAppMapper, SysApp> impleme
// 只查询启用的应用 // 只查询启用的应用
wrapper.eq(SysApp::getStatusFlag, StatusEnum.ENABLE.getCode()); wrapper.eq(SysApp::getStatusFlag, StatusEnum.ENABLE.getCode());
// 是否查询运维平台的菜单
if (devopsFlag != null && devopsFlag) {
wrapper.eq(SysApp::getDevopsFlag, YesOrNotEnum.Y.getCode());
}
List<SysApp> list = this.list(wrapper); List<SysApp> list = this.list(wrapper);
return list.stream().map(i -> { return list.stream().map(i -> {

View File

@ -658,10 +658,10 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
} }
@Override @Override
public List<IndexMenuInfo> buildAuthorities(Integer menuFrontType) { public List<IndexMenuInfo> buildAuthorities(Integer menuFrontType, Boolean devopsFlag) {
// 不分离应用查询菜单 // 不分离应用查询菜单
List<SysAppResult> sortedApps = appServiceApi.getSortedApps(); List<SysAppResult> sortedApps = appServiceApi.getSortedApps(devopsFlag);
List<String> appCodes = sortedApps.stream().map(SysAppResult::getAppCode).collect(Collectors.toList()); List<String> appCodes = sortedApps.stream().map(SysAppResult::getAppCode).collect(Collectors.toList());
List<SysMenu> currentUserMenus = this.getCurrentUserMenus(appCodes, false, menuFrontType); List<SysMenu> currentUserMenus = this.getCurrentUserMenus(appCodes, false, menuFrontType);

View File

@ -198,8 +198,9 @@ public class LoginController {
* @date 2022/4/8 15:31 * @date 2022/4/8 15:31
*/ */
@GetResource(name = "新版Antdv3版本的用户信息获取", path = "/v3/userInfo", requiredPermission = false) @GetResource(name = "新版Antdv3版本的用户信息获取", path = "/v3/userInfo", requiredPermission = false)
public ResponseData<IndexUserInfoV3> userInfoV3(Integer menuFrontType) { public ResponseData<IndexUserInfoV3> userInfoV3(@RequestParam(value = "menuFrontType", required = false) Integer menuFrontType,
return new SuccessResponseData<>(indexUserInfoService.userInfoV3(menuFrontType)); @RequestParam(value = "devopsFlag", required = false) Boolean devopsFlag) {
return new SuccessResponseData<>(indexUserInfoService.userInfoV3(menuFrontType, devopsFlag));
} }
} }

View File

@ -38,9 +38,11 @@ public interface IndexUserInfoService {
* Antdv3 * Antdv3
* *
* @param menuFrontType * @param menuFrontType
* @param devopsFlag devops
* @return
* @author fengshuonan * @author fengshuonan
* @date 2022/4/8 15:31 * @date 2022/4/8 15:31
*/ */
IndexUserInfoV3 userInfoV3(Integer menuFrontType); IndexUserInfoV3 userInfoV3(Integer menuFrontType, Boolean devopsFlag);
} }

View File

@ -58,7 +58,7 @@ public class IndexUserInfoServiceImpl implements IndexUserInfoService {
private MenuServiceApi menuServiceApi; private MenuServiceApi menuServiceApi;
@Override @Override
public IndexUserInfoV3 userInfoV3(Integer menuFrontType) { public IndexUserInfoV3 userInfoV3(Integer menuFrontType, Boolean devopsFlag) {
// 获取当前登录用户 // 获取当前登录用户
LoginUser loginUser = LoginContext.me().getLoginUser(); LoginUser loginUser = LoginContext.me().getLoginUser();
@ -113,7 +113,7 @@ public class IndexUserInfoServiceImpl implements IndexUserInfoService {
if (ObjectUtil.isEmpty(menuFrontType)) { if (ObjectUtil.isEmpty(menuFrontType)) {
menuFrontType = AntdvFrontTypeEnum.FRONT.getCode(); menuFrontType = AntdvFrontTypeEnum.FRONT.getCode();
} }
indexUserInfoV3.setAuthorities(menuServiceApi.buildAuthorities(menuFrontType)); indexUserInfoV3.setAuthorities(menuServiceApi.buildAuthorities(menuFrontType, devopsFlag));
// 登录人的ws-url // 登录人的ws-url
indexUserInfoV3.setWsUrl(loginUser.getWsUrl()); indexUserInfoV3.setWsUrl(loginUser.getWsUrl());