This commit is contained in:
pengjie 2023-12-15 08:58:39 +08:00
parent 398306fa7c
commit e1d6bf6045

View File

@ -17,6 +17,7 @@ import com.zhgd.xmgl.security.SecurityUser;
import com.zhgd.xmgl.security.SecurityUtil;
import com.zhgd.xmgl.util.ListUtils;
import com.zhgd.xmgl.util.MessageUtil;
import com.zhgd.xmgl.util.ParamEnum;
import com.zhgd.xmgl.util.TreeUtil;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -222,12 +223,10 @@ public class BaseMenuServiceImpl extends ServiceImpl<BaseMenuMapper, BaseMenu> i
List<EnterpriseMain> enterpriseMainList = new ArrayList<>();
if (systemRole.getSysDefault() == 1) {
EnterpriseMain enterpriseMain = new EnterpriseMain();
if (systemRole.getRoleCode().equals("BUILD")) {
enterpriseMain.setMainType(1);
} else if (systemRole.getRoleCode().equals("SUPERVISOR")) {
enterpriseMain.setMainType(2);
} else if (systemRole.getRoleCode().equals("OP")) {
enterpriseMain.setMainType(3);
for (ParamEnum.EngineeringMain type : ParamEnum.EngineeringMain.values()) {
if (systemRole.getRoleCode().equals(type)) {
enterpriseMain.setMainType(type.getValue());
}
}
enterpriseMainList.add(enterpriseMain);
} else if (accountType == 3) {
@ -255,12 +254,10 @@ public class BaseMenuServiceImpl extends ServiceImpl<BaseMenuMapper, BaseMenu> i
} else {
for (EnterpriseMain main : enterpriseMainList) {
String code = "";
if (main.getMainType() == 1) {
code = "BUILD";
} else if (main.getMainType() == 2) {
code = "SUPERVISOR";
} else if (main.getMainType() == 3) {
code = "OP";
for (ParamEnum.EngineeringMain type : ParamEnum.EngineeringMain.values()) {
if (main.getMainType() == type.getValue()) {
code = type.toString();
}
}
String iRoleId = systemRoleService.getOne(Wrappers.<SystemRole>lambdaQuery()
.eq(SystemRole::getRoleCode, code)).getRoleId();