基于javaweb+mysql的jsp+servlet健身房管理系统(java+html+bootstrap+servlet+echarts+mysql)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的JSP+Servlet健身房管理系统(java+html+bootstrap+servlet+echarts+mysql)
项目介绍
角色:管理员、吧台、前台、收银员、店长,可动态添加
功能如下:权限管理 商品管理 会员管理 消费收银 统计 权限管理 商品列表 商品增加 商品分类 会员登记 会员列表 会员充值 会员刷卡 商品消费 消费订单 充值统计 销售统计 会员增长趋势 员工管理 职位管理 员工列表
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目: 否;
技术栈
- 后端:servlet 2. 前端:HTML+css+javacript+bootstrap+jQuery+echarts
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中db.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入http://localhost:8080/ 登录
String goodsId = request.getParameter("goodsId");
String goodsName = request.getParameter("goodsName");
String goodsCode = request.getParameter("goodsCode");
Integer goodsType = Integer.parseInt(request.getParameter("goodsType"));
Integer unitId = Integer.parseInt(request.getParameter("unitId"));
double goodsPrice = Double.parseDouble(request.getParameter("goodsPrice"));
Integer goodsStatus = Integer.parseInt(request.getParameter("goodsStatus"));
try {
int len = getGoodsService.updategoodsById(goodsId,
goodsCode, goodsName, goodsPrice,
goodsType, unitId, goodsStatus);
responseDto.setMessage("修改成功");
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setData(len);
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
}
}
CateGoryService cateGoryService=new CateGoryServiceImpl();
//获取参数
Integer pageNumber = IntegerUtils.ToInteger(request.getParameter("pageNumber"));
Integer pageSize = IntegerUtils.ToInteger(request.getParameter("pageSize"));
String searchName = request.getParameter("searchName");
Integer searchStatus = IntegerUtils.ToInteger(request.getParameter("searchStatus"));
try {
responseDto.setData(cateGoryService.getAllCateGoryList(pageNumber,pageSize,searchName,searchStatus));
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setMessage("操作成功");
} catch (Exception e) {
e.printStackTrace();
responseDto.setMessage(e.getMessage());
}
response.getWriter().print(new Gson().toJson(responseDto));
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
}
}
@WebServlet(name = "UpdateRechargeRuleByIdServlet",urlPatterns ="/UpdateRechargeRuleByIdServlet" )
public class UpdateRechargeRuleByIdServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
RechargeRuleService rechargeRuleService=new RechargeRuleServicelmpl();
String ruleId = request.getParameter("ruleId");
String ruleName = request.getParameter("ruleName");
String ruleCoff = request.getParameter("ruleCoff");
String ruleStatus = request.getParameter("ruleStatus");
/**
* 获得商品分类表
**/
@WebServlet(name = "CateGoryServlet" ,urlPatterns = "/CateGoryServlet")
public class CateGoryServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//返回参数
ResponseDto responseDto = new ResponseDto();
CateGoryService cateGoryService=new CateGoryServiceImpl();
//获取参数
Integer pageNumber = IntegerUtils.ToInteger(request.getParameter("pageNumber"));
Integer pageSize = IntegerUtils.ToInteger(request.getParameter("pageSize"));
String searchName = request.getParameter("searchName");
Integer searchStatus = IntegerUtils.ToInteger(request.getParameter("searchStatus"));
try {
responseDto.setData(cateGoryService.getAllCateGoryList(pageNumber,pageSize,searchName,searchStatus));
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setMessage("操作成功");
} catch (Exception e) {
e.printStackTrace();
responseDto.setMessage(e.getMessage());
}
response.getWriter().print(new Gson().toJson(responseDto));
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
}
}
@WebServlet(name = "UpdateRechargeRuleByIdServlet",urlPatterns ="/UpdateRechargeRuleByIdServlet" )
resp.getWriter().print(new Gson().toJson(responseDto));
}
}
/**
* 修改会员信息
**/
@WebServlet(name = "UpdateUserServlet" , urlPatterns = "/UpdateUserServlet")
public class UpdateUserServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
UserService userService = new UserServiceImpl();
Integer userId = Integer.parseInt(request.getParameter("userId"));
String userName = request.getParameter("userName");
Integer status = Integer.parseInt(request.getParameter("status"));
String phone = request.getParameter("phone");
String address = request.getParameter("address");
Integer cardId = Integer.parseInt(request.getParameter("cardId"));
String idCard = request.getParameter("idCard");
ResponseDto responseDto = new ResponseDto();
try {
int len = userService.updateUserById(userName,phone,status, address, idCard, cardId, userId);
System.out.println(len);
responseDto.setMessage("成功");
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setData(len);
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.printStackTrace();
}
}
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
/**
* 查找所有新闻
**/
@WebServlet(name = "GetAllNewsServlet",urlPatterns = "/GetAllNewsServlet")
public class GetAllNewsServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Integer pageNumber= IntegerUtils.ToInteger(request.getParameter("pageNumber"));
Integer pageSize= IntegerUtils.ToInteger(request.getParameter("pageSize"));
String searchTitle=request.getParameter("searchTitle");
String searchName=request.getParameter("searchName");
String createdTime=request.getParameter("createdTime");
String endTime=request.getParameter("endTime");
NewsService newsService=new NewsServiceImpl();
try {
Map<String, Object> map=newsService.getAllNews(pageNumber,pageSize,searchTitle,searchName,createdTime,endTime);
ResponseDto responseDto=new ResponseDto();
responseDto.setData(map);
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
RoleService roleService = new RoleServiceImpl();
//获取参数
Integer roleId = StringUtils.isBlank(request.getParameter("roleId")) ? 0 : Integer.parseInt(request.getParameter("roleId"));
String resources = request.getParameter("getNodeList");
//参数校验
if (StringUtils.isBlank(resources)) {
throw new RuntimeException("权限id不能为空");
}
String[] strings = resources.substring(1,resources.length()-1).split(",");
Integer[] intarray = new Integer[strings.length];
//将String数组转化为int数组
for (int i = 0; i < strings.length; i++) {
intarray[i] = Integer.parseInt(strings[i]);
}
try {
int res = roleService.updateMenuList(roleId,intarray);
//返回参数
ResponseDto responseDto = new ResponseDto();
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setData(res > 0 ? 1 : 0);
responseDto.setMessage("请求成功");
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.getMessage();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
responseDto.setData(map);
response.getWriter().print(new Gson().toJson(responseDto));
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
/**
* 修改新闻公告信息
**/
@WebServlet(name = "UpdateNewsServlet",urlPatterns = "/UpdateNewsServlet")
public class UpdateNewsServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Integer id= IntegerUtils.ToInteger(request.getParameter("id"));
String title=request.getParameter("title");
String content=request.getParameter("content");
int status=IntegerUtils.ToInteger(request.getParameter("status"));
String createdTime=request.getParameter("createdTime");
String endTime=request.getParameter("endTime");
System.out.println(status);
int len=0;
NewsService newsService=new NewsServiceImpl();
try {
len=newsService.updateNews(title,content,status,createdTime,endTime,id);
ResponseDto responseDto=new ResponseDto();
responseDto.setData(len);
responseDto.setMessage("请求成功");
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.printStackTrace();
}
/**
* 新增会员
**/
@WebServlet(name = "AddUserServlet", urlPatterns = "/AddUserServlet")
public class AddUserServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
UserService userService = new UserServiceImpl();
String userId = userService.getLastUserId();
String userName = request.getParameter("userName");
String userPhone = request.getParameter("userPhone");
String userLevel = request.getParameter("userLevel");
String userStatus = request.getParameter("userStatus");
String staffName = request.getParameter("staffName");
String credit = request.getParameter("credit");
Integer cardId = IntegerUtils.ToInteger(request.getParameter("cardId"));
String amount = request.getParameter("amount");
String idno = request.getParameter("idno");
String userSex = request.getParameter("userSex");
String province = request.getParameter("province");
String city = request.getParameter("city");
String address = request.getParameter("address");
String momo = request.getParameter("momo");
String ruleId = request.getParameter("ruleId");
String staffId = request.getParameter("staffId");
//返回参数
ResponseDto responseDto = new ResponseDto();
try {
int len = userService.addUser(userName,userPhone,userLevel,userStatus,staffName,credit,amount,idno,userSex,province,city,address,momo,ruleId,staffId,cardId);
int res1 = userService.createCard(cardId, Integer.parseInt(userId)+1+"", Double.parseDouble(amount), IntegerUtils.ToInteger(credit), IntegerUtils.ToInteger(userStatus), IntegerUtils.ToInteger(staffId), IntegerUtils.ToInteger(userLevel));
responseDto.setData(cardId);
responseDto.setData(len);
responseDto.setData(res1);
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setMessage("成功");
} catch (Exception e) {
/**
* 获取会员刷卡页面中的会员充值记录
**/
@WebServlet(name = "RechargeCardOrderServlet",urlPatterns = "/RechargeCardOrderServlet")
public class RechargeCardOrderServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
CardService cardService = new CardServiceImpl();
Integer pageNumber = IntegerUtils.ToInteger(request.getParameter("pageNumber"));
Integer pageSize = IntegerUtils.ToInteger(request.getParameter("pageSize"));
String searchId = request.getParameter("searchId");
String searchName = request.getParameter("searchName");
try {
//返回参数
ResponseDto responseDto = new ResponseDto();
cardService.getAllRechargeRecord(pageNumber, pageSize, searchId, searchName);
responseDto.setData(cardService.getAllRechargeRecord(pageNumber, pageSize, searchId, searchName));
responseDto.setMessage("请求成功");
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
@WebServlet(name = "UpdateOderServlet",urlPatterns = "/UpdateOderServlet")
public class UpdateOderServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
ResponseDto responseDto=new ResponseDto();
Integer orderId = IntegerUtils.ToInteger(request.getParameter("orderId"));
Integer cardId = IntegerUtils.ToInteger(request.getParameter("cardId"));
Integer cardType = IntegerUtils.ToInteger(request.getParameter("cardType"));
Double price =Double.parseDouble(request.getParameter("price"));
Double pay=Double.parseDouble(request.getParameter("pay"));
Integer credit = IntegerUtils.ToInteger(request.getParameter("credit"));
Integer status = IntegerUtils.ToInteger(request.getParameter("status"));
String momo = request.getParameter("momo");
OrderService orderService=new OrderServiceImpl();
try {
int len= orderService.updateOrderByOrderId(orderId,cardId,cardType,price,pay,credit,status,momo);
if (len >0) {
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setMessage("修改成功");
responseDto.setData(len);
}else {
responseDto.setStatus(ResponseDto.FAILURE_CODE);
}
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
@WebServlet(name = "UpdateStaffServlet",urlPatterns ="/UpdateStaffServlet")
public class UpdateStaffServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
/**
* 修改新闻公告信息
**/
@WebServlet(name = "UpdateNewsServlet",urlPatterns = "/UpdateNewsServlet")
public class UpdateNewsServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Integer id= IntegerUtils.ToInteger(request.getParameter("id"));
String title=request.getParameter("title");
String content=request.getParameter("content");
int status=IntegerUtils.ToInteger(request.getParameter("status"));
String createdTime=request.getParameter("createdTime");
String endTime=request.getParameter("endTime");
System.out.println(status);
int len=0;
NewsService newsService=new NewsServiceImpl();
try {
len=newsService.updateNews(title,content,status,createdTime,endTime,id);
ResponseDto responseDto=new ResponseDto();
responseDto.setData(len);
responseDto.setMessage("请求成功");
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
/**
* 获取会员刷卡页面中的会员充值记录
**/
@WebServlet(name = "RechargeCardOrderServlet",urlPatterns = "/RechargeCardOrderServlet")
public class RechargeCardOrderServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
CardService cardService = new CardServiceImpl();
Integer pageNumber = IntegerUtils.ToInteger(request.getParameter("pageNumber"));
Integer pageSize = IntegerUtils.ToInteger(request.getParameter("pageSize"));
String searchId = request.getParameter("searchId");
String searchName = request.getParameter("searchName");
try {
//返回参数
ResponseDto responseDto = new ResponseDto();
cardService.getAllRechargeRecord(pageNumber, pageSize, searchId, searchName);
responseDto.setData(cardService.getAllRechargeRecord(pageNumber, pageSize, searchId, searchName));
responseDto.setMessage("请求成功");
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
try {
int len = getGoodsService.updategoodsById(goodsId,
goodsCode, goodsName, goodsPrice,
goodsType, unitId, goodsStatus);
responseDto.setMessage("修改成功");
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setData(len);
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
}
}
@WebServlet(name = "AddGoodsServlet" ,urlPatterns = "/AddGoodsServlet")
public class AddGoodsServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
GetGoodsService getGoodsService=new GetGoodsServiceImpl();
String goodsId = request.getParameter("goodsId");
double[] doubles = new double[12];
for (int i = 0; i < doubles.length; i++) {
for (int j = 0; j < mapList.size(); j++) {
if (ints[i] == Integer.parseInt(mapList.get(j).get("month") + "")) {
doubles[i] = Double.parseDouble(mapList.get(j).get("amount") + "");
}
}
}
//返回参数
ResponseDto responseDto = new ResponseDto();
Map<String,Object> map = new HashMap<>();
map.put("ints",ints);
map.put("doubles",doubles);
responseDto.setData(map);
response.getWriter().print(new Gson().toJson(responseDto));
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
/**
* 修改新闻公告信息
**/
@WebServlet(name = "UpdateNewsServlet",urlPatterns = "/UpdateNewsServlet")
public class UpdateNewsServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Integer id= IntegerUtils.ToInteger(request.getParameter("id"));
String title=request.getParameter("title");
String content=request.getParameter("content");
int status=IntegerUtils.ToInteger(request.getParameter("status"));
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
RoleService roleService = new RoleServiceImpl();
//获取参数
Integer roleId = StringUtils.isBlank(request.getParameter("roleId")) ? 0 : Integer.parseInt(request.getParameter("roleId"));
String resources = request.getParameter("getNodeList");
//参数校验
if (StringUtils.isBlank(resources)) {
throw new RuntimeException("权限id不能为空");
}
String[] strings = resources.substring(1,resources.length()-1).split(",");
Integer[] intarray = new Integer[strings.length];
//将String数组转化为int数组
for (int i = 0; i < strings.length; i++) {
intarray[i] = Integer.parseInt(strings[i]);
}
try {
int res = roleService.updateMenuList(roleId,intarray);
//返回参数
ResponseDto responseDto = new ResponseDto();
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setData(res > 0 ? 1 : 0);
responseDto.setMessage("请求成功");
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.getMessage();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
/**
* 加载列表
*/
@WebServlet(name = "GetRechargeRuleServlet",urlPatterns = "/GetRechargeRuleServlet")
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
/**
* 获得商品分类表
**/
@WebServlet(name = "CateGoryServlet" ,urlPatterns = "/CateGoryServlet")
public class CateGoryServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//返回参数
ResponseDto responseDto = new ResponseDto();
CateGoryService cateGoryService=new CateGoryServiceImpl();
//获取参数
Integer pageNumber = IntegerUtils.ToInteger(request.getParameter("pageNumber"));
Integer pageSize = IntegerUtils.ToInteger(request.getParameter("pageSize"));
String searchName = request.getParameter("searchName");
Integer searchStatus = IntegerUtils.ToInteger(request.getParameter("searchStatus"));
try {
responseDto.setData(cateGoryService.getAllCateGoryList(pageNumber,pageSize,searchName,searchStatus));
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setMessage("操作成功");
if (len >0) {
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setMessage("修改成功");
responseDto.setData(len);
}else {
responseDto.setStatus(ResponseDto.FAILURE_CODE);
}
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
@WebServlet(name = "UpdateStaffServlet",urlPatterns ="/UpdateStaffServlet")
public class UpdateStaffServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//返回参数
ResponseDto responseDto = new ResponseDto();
Integer staffId = IntegerUtils.ToInteger(request.getParameter("staffId"));
String staffName = request.getParameter("staffName");
String phone = request.getParameter("phone");
String idCard = request.getParameter("idCard");
Integer status = IntegerUtils.ToInteger(request.getParameter("status"));
Integer roleId = IntegerUtils.ToInteger(request.getParameter("roleId"));
String remake = request.getParameter("remake");
String address = request.getParameter("address");
StaffService staffService = new StaffServiceImpl();
try {
int len = staffService.updateStaffByStaffId(staffId,staffName,phone,idCard,status,roleId,remake,address);
if (len > 0) {
String remake = request.getParameter("remake");
String address = request.getParameter("address");
StaffService staffService = new StaffServiceImpl();
try {
int len = staffService.updateStaffByStaffId(staffId,staffName,phone,idCard,status,roleId,remake,address);
if (len > 0) {
responseDto.setStatus(ResponseDto.SUCCESS_CODE);
responseDto.setMessage("修改成功");
responseDto.setData(len);
}else {
responseDto.setStatus(ResponseDto.FAILURE_CODE);
}
response.getWriter().print(new Gson().toJson(responseDto));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
@WebServlet(name = "UpdateMenuListServlet",urlPatterns = "/UpdateMenuListServlet")
public class UpdateMenuListServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
RoleService roleService = new RoleServiceImpl();
//获取参数
Integer roleId = StringUtils.isBlank(request.getParameter("roleId")) ? 0 : Integer.parseInt(request.getParameter("roleId"));
String resources = request.getParameter("getNodeList");
//参数校验
if (StringUtils.isBlank(resources)) {
throw new RuntimeException("权限id不能为空");
}
String[] strings = resources.substring(1,resources.length()-1).split(",");
Integer[] intarray = new Integer[strings.length];
//将String数组转化为int数组