企业账号也可以调用【查询配置的模块和菜单列表】接口
This commit is contained in:
parent
af1194e4b4
commit
b70b990094
@ -184,11 +184,11 @@ public class BaseModuleController {
|
|||||||
baseModuleService.copyModuleAndMenu();
|
baseModuleService.copyModuleAndMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询项目配置的模块和菜单列表", notes = "查询项目配置的模块和菜单列表", httpMethod = "POST")
|
@ApiOperation(value = "查询配置的模块和菜单列表", notes = "查询配置的模块和菜单列表", httpMethod = "POST")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "userId", value = "用户id", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "userId", value = "用户id", paramType = "body", required = true, dataType = "String"),
|
||||||
@ApiImplicitParam(name = "moduleType", value = "模块类型,1企业模块,2项目后台模块,3企业后台,4项目看板", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "moduleType", value = "模块类型,1企业模块,2项目后台模块,3企业后台,4项目看板", paramType = "body", required = true, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = false, dataType = "String"),
|
||||||
})
|
})
|
||||||
@PostMapping(value = "/getModuleAndMenuList")
|
@PostMapping(value = "/getModuleAndMenuList")
|
||||||
public Result<Map<String, Object>> getModuleAndMenuList(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
public Result<Map<String, Object>> getModuleAndMenuList(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||||
|
|||||||
@ -9,6 +9,9 @@
|
|||||||
<if test="projectSelectType == '1'.toString()">
|
<if test="projectSelectType == '1'.toString()">
|
||||||
and a.module_type in (2,4)
|
and a.module_type in (2,4)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="moduleType != null and moduleType != ''">
|
||||||
|
and a.module_type = #{moduleType}
|
||||||
|
</if>
|
||||||
ORDER BY a.module_type,a.label_sort_num,a.label_name,a.module_id
|
ORDER BY a.module_type,a.label_sort_num,a.label_name,a.module_id
|
||||||
</select>
|
</select>
|
||||||
<select id="getProjectModuleList" resultType="com.zhgd.xmgl.modules.basicdata.entity.BaseModule">
|
<select id="getProjectModuleList" resultType="com.zhgd.xmgl.modules.basicdata.entity.BaseModule">
|
||||||
|
|||||||
@ -1,12 +1,10 @@
|
|||||||
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.BaseMenu;
|
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.BaseModule;
|
import com.zhgd.xmgl.modules.basicdata.entity.BaseModule;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.CompanyConfig;
|
import com.zhgd.xmgl.modules.basicdata.entity.CompanyConfig;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||||
@ -19,6 +17,7 @@ import com.zhgd.xmgl.modules.basicdata.service.IBaseAuthorityService;
|
|||||||
import com.zhgd.xmgl.modules.basicdata.service.IBaseModuleService;
|
import com.zhgd.xmgl.modules.basicdata.service.IBaseModuleService;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -26,7 +25,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 模块
|
* @Description: 模块
|
||||||
@ -47,6 +45,9 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
|
|||||||
private SystemUserServiceImpl systemUserService;
|
private SystemUserServiceImpl systemUserService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CompanyConfigMapper companyConfigMapper;
|
private CompanyConfigMapper companyConfigMapper;
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private CompanyConfigServiceImpl companyConfigService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBaseAuthorityService baseAuthorityService;
|
private IBaseAuthorityService baseAuthorityService;
|
||||||
|
|
||||||
@ -126,10 +127,13 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
|
|||||||
if (systemUser == null) {
|
if (systemUser == null) {
|
||||||
throw new OpenAlertException("账号不存在");
|
throw new OpenAlertException("账号不存在");
|
||||||
}
|
}
|
||||||
if (StrUtil.isBlank(projectSn)) {
|
CompanyConfig companyConfig;
|
||||||
throw new OpenAlertException("projectSn不能为空");
|
if (StrUtil.isNotBlank(projectSn)) {
|
||||||
|
companyConfig = companyConfigMapper.getCompanyConfigByProject(projectSn);
|
||||||
|
} else {
|
||||||
|
//企业类型
|
||||||
|
companyConfig = companyConfigMapper.getCompanyConfigBySn(systemUser.getSn());
|
||||||
}
|
}
|
||||||
CompanyConfig companyConfig = companyConfigMapper.getCompanyConfigByProject(projectSn);
|
|
||||||
if (companyConfig == null) {
|
if (companyConfig == null) {
|
||||||
throw new OpenAlertException("企业配置不存在");
|
throw new OpenAlertException("企业配置不存在");
|
||||||
}
|
}
|
||||||
@ -137,6 +141,11 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
|
|||||||
return systemUserService.getUserAuthority(null, 5, projectSn, companyConfig.getHeadquartersSn(), companyConfig.getStyleType(), moduleType);
|
return systemUserService.getUserAuthority(null, 5, projectSn, companyConfig.getHeadquartersSn(), companyConfig.getStyleType(), moduleType);
|
||||||
} else if (Objects.equals(systemUser.getAccountType(), 5) || Objects.equals(systemUser.getAccountType(), 6)) {
|
} else if (Objects.equals(systemUser.getAccountType(), 5) || Objects.equals(systemUser.getAccountType(), 6)) {
|
||||||
return systemUserService.getUserAuthority(Long.valueOf(userId), systemUser.getAccountType(), projectSn, companyConfig.getHeadquartersSn(), companyConfig.getStyleType(), moduleType);
|
return systemUserService.getUserAuthority(Long.valueOf(userId), systemUser.getAccountType(), projectSn, companyConfig.getHeadquartersSn(), companyConfig.getStyleType(), moduleType);
|
||||||
|
} else if (Objects.equals(systemUser.getAccountType(), SystemUserAccountTypeEnum.ENTERPRISE_ADMINISTRATOR_ACCOUNT.getValue())
|
||||||
|
|| Objects.equals(systemUser.getAccountType(), SystemUserAccountTypeEnum.ENTERPRISE_DISTRICT_ACCOUNT.getValue())
|
||||||
|
|| Objects.equals(systemUser.getAccountType(), SystemUserAccountTypeEnum.ENTERPRISE_CITY_ACCOUNT.getValue())
|
||||||
|
|| Objects.equals(systemUser.getAccountType(), SystemUserAccountTypeEnum.ENTERPRISE_SUB_ACCOUNT.getValue())) {
|
||||||
|
return systemUserService.getUserAuthority(Long.valueOf(userId), systemUser.getAccountType(), systemUser.getSn(), companyConfig.getHeadquartersSn(), companyConfig.getStyleType(), moduleType);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -988,12 +988,14 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
|||||||
param.put("styleType", styleType);
|
param.put("styleType", styleType);
|
||||||
if (accountType == 2) {
|
if (accountType == 2) {
|
||||||
param.put("headquartersSn", headquartersSn);
|
param.put("headquartersSn", headquartersSn);
|
||||||
|
param.put("moduleType", moduleType);
|
||||||
moduleList = baseModuleMapper.getCompanyModuleList(param);
|
moduleList = baseModuleMapper.getCompanyModuleList(param);
|
||||||
menuList = baseMenuService.selectHeadquartersMenuList(param);
|
menuList = baseMenuService.selectHeadquartersMenuList(param);
|
||||||
actionList = baseActionMapper.getHeadquartersActionList(param);
|
actionList = baseActionMapper.getHeadquartersActionList(param);
|
||||||
data.put("roleName", "公司管理员");
|
data.put("roleName", "公司管理员");
|
||||||
} else if (accountType == 3 || accountType == 4 || accountType == 7) {
|
} else if (accountType == 3 || accountType == 4 || accountType == 7) {
|
||||||
param.put("userId", userId);
|
param.put("userId", userId);
|
||||||
|
param.put("moduleType", moduleType);
|
||||||
moduleList = baseModuleMapper.getUserModuleList(param);
|
moduleList = baseModuleMapper.getUserModuleList(param);
|
||||||
menuList = baseMenuService.selectComapnyUserMenuList(param);
|
menuList = baseMenuService.selectComapnyUserMenuList(param);
|
||||||
actionList = baseActionMapper.getComapnyUserActionList(param);
|
actionList = baseActionMapper.getComapnyUserActionList(param);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user