try {
getById(request, response);
} catch (SQLException|IOException e) {
e.printStackTrace();
}
break;
default:
break;
}
}
private void getById(HttpServletRequest request, HttpServletResponse response) throws SQLException, IOException {
final String idStr = request.getParameter(“id”);
if(idStr==null){
throw new RuntimeException(“待查询的商品的id不能为空”);
}
Integer id = Integer.parseInt(idStr);
final Goods goods = goodsService.getGoodsById(id);
final JSONObject jsonObject = new JSONObject();
jsonObject.put(“goods”, goods);
response.getWriter().write(jsonObject.toString());
}
private void findAll(HttpServletRequest request, HttpServletResponse response) throws IOException {
List goodsList = null;
try {
goodsList = goodsService.listAllGoods();
} catch (SQLException e) {
e.printStackTrace();
}
final ArrayList ids = new ArrayList<>();
List nameList = new ArrayList<>();
List price1List = new ArrayList<>();
List price2List = new ArrayList<>();
List amountList = new ArrayList<>();
for (Goods goods : goodsList) {
final Integer id = goods.getId();
ids.add(id);
final String name = goods.getName();
nameList.add(name);
final double price1 = goods.getPrice1();
price1List.add(price1);
final double price2 = goods.getPrice2();
price2List.add(price2);
final Integer amount = goods.getAmount();
amountList.add(amount);
}
final JSONObject jsonObject = new JSONObject();
jsonObject.put(“ids”, ids);
jsonObject.put(“nameList”, nameList);
jsonObject.put(“price1List”, price1List);
jsonObject.put(“price2List”, price2List);
jsonObject.put(“amountList”, amountList);
response.getWriter().write(jsonObject.toString());
}
}
-
下载并导入jquery.min.js文件
-
下载并导入 echarts.min.js 文件
-
bar.jsp页面
<%@ page contentType=“text/html;charset=UTF-8” language=“java” %>
- pie.jsp页面
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数同学面临毕业设计项目选题时,很多人都会感到无从下手,尤其是对于计算机专业的学生来说,选择一个合适的题目尤为重要。因为毕业设计不仅是我们在大学四年学习的一个总结,更是展示自己能力的重要机会。
因此收集整理了一份《2024年计算机毕业设计项目大全》,初衷也很简单,就是希望能够帮助提高效率,同时减轻大家的负担。
既有Java、Web、PHP、也有C、小程序、Python等项目供你选择,真正体系化!
由于项目比较多,这里只是将部分目录截图出来,每个节点里面都包含素材文档、项目源码、讲解视频
如果你觉得这些内容对你有帮助,可以添加VX:vip1024c (备注项目大全获取)
4eCTxHvg-1712510207714)]
[外链图片转存中…(img-ikfbHFOh-1712510207714)]
[外链图片转存中…(img-BW7N7eaC-1712510207715)]
既有Java、Web、PHP、也有C、小程序、Python等项目供你选择,真正体系化!
由于项目比较多,这里只是将部分目录截图出来,每个节点里面都包含素材文档、项目源码、讲解视频
如果你觉得这些内容对你有帮助,可以添加VX:vip1024c (备注项目大全获取)
[外链图片转存中…(img-v4xlV48b-1712510207715)]