权限勾选必填

yun-zuoyi
zhang.xw 2 years ago
parent e873d08e06
commit 25f6bebf94

@ -25,6 +25,7 @@ import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
@ -401,7 +402,9 @@ public class SysRoleController extends CrudBaseController<SysRole> {
ValidatorBean.beginValid(refRoleMenu)
.notNull("roleId", refRoleMenu.getRoleId())
.notNull("softType", refRoleMenu.getSoftType());
if (CollectionUtils.isEmpty(refRoleMenu.getMenuIdList())) {
throw ImppExceptionBuilder.newInstance().setSystemID(CommonEnumUtil.SOFT_TYPE.IMPP.getCode()).setErrorCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode()).setErrorDetail("未勾选菜单").build();
}
sysRoleService.refreshSysRoleRef(refRoleMenu.getRoleId(), refRoleMenu.getSoftType(), refRoleMenu.getMenuIdList()
, AuthUtil.getSessionUser().getUserName());
@ -488,4 +491,14 @@ public class SysRoleController extends CrudBaseController<SysRole> {
}
}
public static void main(String[] args) {
String aa ="{\"roleId\":\"1161540710735032320\",\"softType\":3,\"menuIdList\":[]}";
JSONObject bb = (JSONObject) JSONObject.toJSON(aa);
SysRefRoleMenu sysRefRoleMenu = JSONObject.toJavaObject(bb, SysRefRoleMenu.class);
if (CollectionUtils.isEmpty(sysRefRoleMenu.getMenuIdList())) {
System.out.println(true);
}
}
}

Loading…
Cancel
Save