赞
踩
局部页面效果
作者:赵橙晔
sql部分,如下
- /*
- Navicat Premium Data Transfer
- Source Server : mysql
- Source Server Type : MySQL
- Source Server Version : 50731
- Source Host : localhost:3306
- Source Schema : ssm2
- Target Server Type : MySQL
- Target Server Version : 50731
- File Encoding : 65001
- Date: 06/05/2022 14:52:03
- */
-
- SET NAMES utf8mb4;
- SET FOREIGN_KEY_CHECKS = 0;
-
- -- ----------------------------
- -- Table structure for goods
- -- ----------------------------
- DROP TABLE IF EXISTS `goods`;
- CREATE TABLE `goods` (
- `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '货物的编号',
- `goodsName` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '货物的名字',
- `goodsNum` int(255) NULL DEFAULT NULL COMMENT '货物的数量',
- `goodsPrice` double(10, 2) NULL DEFAULT NULL COMMENT '货物的单价',
- `status` int(255) NULL DEFAULT 1,
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `goodsName`(`goodsName`) USING BTREE,
- INDEX `quantity`(`goodsNum`) USING BTREE,
- INDEX `unitprice`(`goodsPrice`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-
- -- ----------------------------
- -- Records of goods
- -- ----------------------------
- INSERT INTO `goods` VALUES (1, '棒棒糖', 20000, 1.00, 1);
- INSERT INTO `goods` VALUES (2, '干脆面', 10000, 2.00, 1);
- INSERT INTO `goods` VALUES (4, '辣条', 34000, 5.00, 0);
- INSERT INTO `goods` VALUES (5, '口香糖', 20000, 6.00, 1);
- INSERT INTO `goods` VALUES (6, '沙琪玛', 30000, 7.00, 1);
- INSERT INTO `goods` VALUES (7, '大列巴', 20000, 10.00, 1);
- INSERT INTO `goods` VALUES (8, '迎春', 30000, 13.00, 1);
- INSERT INTO `goods` VALUES (9, '红塔山', 300000, 10.00, 1);
- INSERT INTO `goods` VALUES (10, '长白山', 2000, 10.00, 1);
- INSERT INTO `goods` VALUES (11, '小熊猫', 20000, 15.00, 1);
- INSERT INTO `goods` VALUES (12, '红金龙', 20000, 8.00, 1);
- INSERT INTO `goods` VALUES (13, '煊赫门', 23580, 18.00, 1);
- INSERT INTO `goods` VALUES (14, '黄鹤楼', 10000, 25.00, 1);
- INSERT INTO `goods` VALUES (15, '牡丹', 10000, 16.00, 1);
- INSERT INTO `goods` VALUES (16, '利群', 10000, 16.00, 1);
- INSERT INTO `goods` VALUES (17, '娇子', 10000, 11.00, 1);
- INSERT INTO `goods` VALUES (18, '中南海', 10000, 12.00, 1);
- INSERT INTO `goods` VALUES (19, '中华(硬)', 10000, 45.00, 1);
- INSERT INTO `goods` VALUES (20, '荷花(硬)', 2000, 34.00, 1);
- INSERT INTO `goods` VALUES (21, '房子', 20000, 300.00, 0);
-
- -- ----------------------------
- -- Table structure for permission
- -- ----------------------------
- DROP TABLE IF EXISTS `permission`;
- CREATE TABLE `permission` (
- `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '权限的编号',
- `permissionName` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
- `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-
- -- ----------------------------
- -- Records of permission
- -- ----------------------------
- INSERT INTO `permission` VALUES (1, '修改普通用户', '/updateUser');
- INSERT INTO `permission` VALUES (2, '增加普通用户', '/addUser');
- INSERT INTO `permission` VALUES (3, '删除普通用户', '/deleteUser');
- INSERT INTO `permission` VALUES (4, '查看普通用户', '/findUser');
- INSERT INTO `permission` VALUES (5, '修改管理员用户', '/updateAdmin');
- INSERT INTO `permission` VALUES (6, '增加管理员用户', '/addAdmin');
- INSERT INTO `permission` VALUES (7, '删除管理员用户', '/deleteAdmin');
- INSERT INTO `permission` VALUES (8, '查看管理员用户', '/findAdmin');
-
- -- ----------------------------
- -- Table structure for role
- -- ----------------------------
- DROP TABLE IF EXISTS `role`;
- CREATE TABLE `role` (
- `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '职位编号',
- `roleName` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
- `roleDesc` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
- `status` int(255) NULL DEFAULT NULL,
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-
- -- ----------------------------
- -- Records of role
- -- ----------------------------
- INSERT INTO `role` VALUES (1, '促销员', '负责销售货品', 1);
- INSERT INTO `role` VALUES (2, '理货员', '负责整理货品', 1);
- INSERT INTO `role` VALUES (3, '收银员', '负责给客户结账', 1);
- INSERT INTO `role` VALUES (5, '保安', '保卫平安,偷吃小熊饼干', 1);
- INSERT INTO `role` VALUES (6, '老板', '负责赚钱养家', 1);
- INSERT INTO `role` VALUES (7, '老板娘', '负责貌美如花', 1);
- INSERT INTO `role` VALUES (8, 'UXD设计师', '让程序改变的完美无瑕', 0);
- INSERT INTO `role` VALUES (9, '网红探店', '负责宣传杂货铺', 0);
- INSERT INTO `role` VALUES (10, '普通用户', '负责或者就好', 0);
- INSERT INTO `role` VALUES (11, '普通用户', '保安', 1);
- INSERT INTO `role` VALUES (12, '炼尸工', '冶炼自己', 0);
-
- -- ----------------------------
- -- Table structure for temp
- -- ----------------------------
- DROP TABLE IF EXISTS `temp`;
- CREATE TABLE `temp` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-
- -- ----------------------------
- -- Records of temp
- -- ----------------------------
- INSERT INTO `temp` VALUES (1, '/dist/jsps/assets/images/temp01.jpg');
- INSERT INTO `temp` VALUES (2, '/dist/jsps/assets/images/temp02.jpg');
-
- -- ----------------------------
- -- Table structure for user
- -- ----------------------------
- DROP TABLE IF EXISTS `user`;
- CREATE TABLE `user` (
- `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '用户编号',
- `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '用户名',
- `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '用户密码',
- `accountBalance` bigint(255) NULL DEFAULT NULL COMMENT '账户余额',
- `status` int(255) NULL DEFAULT NULL COMMENT '状态0关闭,1开启',
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `username`(`username`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-
- -- ----------------------------
- -- Records of user
- -- ----------------------------
- INSERT INTO `user` VALUES (1, '张三', '123456', 200, 1);
- INSERT INTO `user` VALUES (2, '李四', '123456', 250, 1);
-
-
- -- ----------------------------
- -- Table structure for user_goods
- -- ----------------------------
- DROP TABLE IF EXISTS `user_goods`;
- CREATE TABLE `user_goods` (
- `userId` int(11) NOT NULL,
- `goodsId` int(11) NOT NULL,
- PRIMARY KEY (`userId`, `goodsId`) USING BTREE,
- INDEX `goodsId_id`(`goodsId`) USING BTREE,
- CONSTRAINT `goodsId_id` FOREIGN KEY (`goodsId`) REFERENCES `goods` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
- CONSTRAINT `userId_id` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
- ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-
- -- ----------------------------
- -- Records of user_goods
- -- ----------------------------
- INSERT INTO `user_goods` VALUES (2, 2);
- INSERT INTO `user_goods` VALUES (4, 5);
- INSERT INTO `user_goods` VALUES (9, 6);
- INSERT INTO `user_goods` VALUES (3, 7);
- INSERT INTO `user_goods` VALUES (10, 8);
- INSERT INTO `user_goods` VALUES (9, 11);
- INSERT INTO `user_goods` VALUES (11, 13);
- INSERT INTO `user_goods` VALUES (15, 16);
- INSERT INTO `user_goods` VALUES (19, 20);
-
- -- ----------------------------
- -- Table structure for user_role
- -- ----------------------------
- DROP TABLE IF EXISTS `user_role`;
- CREATE TABLE `user_role` (
- `userId` int(11) NOT NULL,
- `roleId` int(11) NOT NULL,
- PRIMARY KEY (`userId`, `roleId`) USING BTREE,
- INDEX `user_role_roleId`(`roleId`) USING BTREE,
- CONSTRAINT `user_role_roleId` FOREIGN KEY (`roleId`) REFERENCES `role` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
- CONSTRAINT `user_role_userId` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
- ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-
- -- ----------------------------
- -- Records of user_role
- -- ----------------------------
- INSERT INTO `user_role` VALUES (1, 1);
- INSERT INTO `user_role` VALUES (4, 1);
- INSERT INTO `user_role` VALUES (6, 1);
- INSERT INTO `user_role` VALUES (1, 2);
- INSERT INTO `user_role` VALUES (2, 2);
- INSERT INTO `user_role` VALUES (5, 2);
- INSERT INTO `user_role` VALUES (8, 3);
- INSERT INTO `user_role` VALUES (19, 3);
-
- SET FOREIGN_KEY_CHECKS = 1;
文件分布式结构如下
web页面如下
index.jsp
- <html>
- <body>
- <%response.sendRedirect("http://localhost/login.jsp");%>
- </body>
- </html>
login.jsp
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <html>
- <head>
- <title>Flat Admin V.3 - Free flat-design bootstrap administrator templates</title>
-
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
-
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
- </head>
- <body>
- <div class="app app-default">
- <div class="app-container app-login">
- <div class="flex-center">
- <div class="app-header"></div>
- <div class="app-body">
- <div class="loader-container text-center">
- <div class="icon">
- <div class="sk-folding-cube">
- <div class="sk-cube1 sk-cube"></div>
- <div class="sk-cube2 sk-cube"></div>
- <div class="sk-cube4 sk-cube"></div>
- <div class="sk-cube3 sk-cube"></div>
- </div>
- </div>
- <div class="title">Logging in...</div>
- </div>
- <div class="app-block">
- <div class="app-form">
- <div class="form-header">
- <div class="app-brand"><span class="highlight">登录</span> 界面</div>
- </div>
- <form action="${pageContext.request.contextPath}/user/login" method="POST">
- <div class="input-group">
- <span class="input-group-addon" id="basic-addon1">
- <i class="fa fa-user" aria-hidden="true"></i></span>
- <input type="text" class="form-control" name="username" id="username" placeholder="Username" aria-describedby="basic-addon1">
- </div>
- <div class="input-group">
- <span class="input-group-addon" id="basic-addon2">
- <i class="fa fa-key" aria-hidden="true"></i></span>
- <input type="password" class="form-control" name="password" id="password" placeholder="Password" aria-describedby="basic-addon2">
- </div>
- <div class="text-center">
-
- <input type="submit" class="btn btn-success btn-submit" value="登录">
- <%-- <input type="submit" value="登录" >--%>
- </div>
- </form>
-
- <div class="form-line">
- <div class="title">OR</div>
- </div>
- <div class="form-footer">
- <button type="button" class="btn btn-default btn-sm btn-social __facebook">
- <div class="info">
- <i class="icon fa fa-facebook-official" aria-hidden="true"></i>
- <span class="title">其他登录方式</span>
- </div>
- </button>
- </div>
- </div>
- </div>
- </div>
- <div class="app-footer">
- </div>
- </div>
- </div>
-
- </div>
-
-
-
- </body>
- </html>
error页面
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
-
- <html>
- <head><title>Apache Tomcat/7.0.47 - Error report</title>
- <style><!--
- H1 {
- font-family: Tahoma, Arial, sans-serif;
- color: white;
- background-color: #525D76;
- font-size: 92px;
- }
-
- H2 {
- font-family: Tahoma, Arial, sans-serif;
- color: white;
- background-color: #525D76;
- font-size: 16px;
- }
-
- H3 {
- font-family: Tahoma, Arial, sans-serif;
- color: white;
- background-color: #525D76;
- font-size: 64px;
- }
-
- BODY {
- font-family: Tahoma, Arial, sans-serif;
- color: black;
- background-color: white;
- }
-
- B {
- font-family: Tahoma, Arial, sans-serif;
- color: white;
- background-color: #525D76;
- }
-
- P {
- font-family: Tahoma, Arial, sans-serif;
- background: white;
- color: black;
- font-size: 50px;
- }
-
- A {
- color: black;
- }
-
- A.name {
- color: black;
- }
-
- HR {
- color: #525D76;
- }
-
- --></style>
- </head>
- <body><h1>HTTP Status 250 - 万能错误页面</h1>
- <HR size="1" noshade="noshade">
- <p><b>type</b> Status report</p>
- <p><b>message</b> <u>org.apache.coyote.init</u></p>
- <p><b>description</b> <u>org.apache.coyote.AbstractProtocol init</u></p>
- <HR size="10" noshade="noshade">
- <h3>Apache Tomcat/7.0.47</h3></body>
- </html>
main.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
- <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" isELIgnored="false"%>
- <html>
- <head>
- <title>Home</title>
-
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
-
- </head>
- <body>
- <div class="app app-default">
- <aside class="app-sidebar" id="sidebar">
- <div class="sidebar-header">
- <a class="sidebar-brand" href="#"><span class="highlight">欢迎</span> 王琪</a>
- <button type="button" class="sidebar-toggle">
- <i class="fa fa-times"></i>
- </button>
- </div>
- <div class="sidebar-menu">
- <ul class="sidebar-nav">
- <li class="active">
- <a href="${pageContext.request.contextPath}/dist/jsps/main.jsp">
- <div class="icon">
- <i class="fa fa-tasks" aria-hidden="true"></i>
- </div>
- <div class="title">首页</div>
- </a>
- </li>
- <li class="@@menu.messaging">
- <a href="${pageContext.request.contextPath}/user/findAll?page=1&size=8">
- <div class="icon">
- <i class="fa fa-comments" aria-hidden="true"></i>
- </div>
- <div class="title">用户管理</div>
- </a>
- </li>
- <li class="@@menu.messaging ">
- <a href="${pageContext.request.contextPath}/role/findAll?page=1&size=8">
- <div class="icon">
- <i class="fa fa-cube" aria-hidden="true"></i>
- </div>
- <div class="title">职位管理</div>
- </a>
- </li>
- <li class="@@menu.messaging ">
- <a href="${pageContext.request.contextPath}/goods/findAll?page=1&size=8">
- <div class="icon">
- <i class="fa fa-cube" aria-hidden="true"></i>
- </div>
- <div class="title">货品管理</div>
- </a>
- </li>
- <li class="@@menu.messaging ">
- <a href="${pageContext.request.contextPath}/user/findUserAndGoodsById?userId=7">
- <div class="icon">
- <i class="fa fa-cube" aria-hidden="true"></i>
- </div>
- <div class="title">订单管理</div>
- </a>
- </li>
- </ul>
- </div>
- <div class="sidebar-footer">
- <ul class="menu">
- <li>
- <a href="/" class="dropdown-toggle" data-toggle="dropdown">
- <i class="fa fa-cogs" aria-hidden="true"></i>
- </a>
- </li>
- <li><a href="#"><span class="flag-icon flag-icon-th flag-icon-squared"></span></a></li>
- </ul>
- </div>
- </aside>
-
-
- <div class="app-container">
- <nav class="navbar navbar-default" id="navbar">
- <div class="container-fluid">
- <div class="navbar-collapse collapse in">
- <ul class="nav navbar-nav navbar-mobile">
- <li>
- <button type="button" class="sidebar-toggle">
- <i class="fa fa-bars"></i>
- </button>
- </li>
- <li class="logo">
- <a class="navbar-brand" href="#"><span class="highlight">欢迎</span> 王琪</a>
- </li>
- <li>
- <button type="button" class="navbar-toggle">
- <img class="profile-img" src="${pageContext.request.contextPath}/dist/jsps/assets/images/profile.png">
- </button>
- </li>
- </ul>
- <ul class="nav navbar-nav navbar-left">
- <li class="navbar-title"><span class="highlight">China soft</span><span> International</span></li>
- <li class="navbar-search hidden-sm">
- <input id="search" type="text" placeholder="Old eight..">
- <button class="btn-search"><i class="fa fa-search"></i></button>
- </li>
- </ul>
- <ul class="nav navbar-nav navbar-right">
- <li class="dropdown notification">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <div class="icon"><i class="fa fa-shopping-basket" aria-hidden="true"></i></div>
- <div class="title">New Orders</div>
- <div class="count">0</div>
- </a>
- <div class="dropdown-menu">
- <ul>
- <li class="dropdown-header">Ordering</li>
- <li class="dropdown-empty">No New Ordered</li>
- <li class="dropdown-footer">
- <a href="#">View All <i class="fa fa-angle-right" aria-hidden="true"></i></a>
- </li>
- </ul>
- </div>
- </li>
- <li class="dropdown notification warning">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <div class="icon"><i class="fa fa-comments" aria-hidden="true"></i></div>
- <div class="title">Unread Messages</div>
- <div class="count">99</div>
- </a>
- <div class="dropdown-menu">
- <ul>
- <li class="dropdown-header">Message</li>
- <li>
- <a href="#">
- <span class="badge badge-warning pull-right">10</span>
- <div class="message">
- <img class="profile" src="${pageContext.request.contextPath}https://placehold.it/100x100">
- <div class="content">
- <div class="title">"Payment Confirmation.."</div>
- <div class="description">Alan Anderson</div>
- </div>
- </div>
- </a>
- </li>
- <li>
- <a href="#">
- <span class="badge badge-warning pull-right">5</span>
- <div class="message">
- <img class="profile" src="https://placehold.it/100x100">
- <div class="content">
- <div class="title">"Hello World"</div>
- <div class="description">Marco Harmon</div>
- </div>
- </div>
- </a>
- </li>
- <li>
- <a href="#">
- <span class="badge badge-warning pull-right">2</span>
- <div class="message">
- <img class="profile" src=${pageContext.request.contextPath}"https://placehold.it/100x100">
- <div class="content">
- <div class="title">"Order Confirmation.."</div>
- <div class="description">Brenda Lawson</div>
- </div>
- </div>
- </a>
- </li>
- <li class="dropdown-footer">
- <a href="#">View All <i class="fa fa-angle-right" aria-hidden="true"></i></a>
- </li>
- </ul>
- </div>
- </li>
- <li class="dropdown notification danger">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <div class="icon"><i class="fa fa-bell" aria-hidden="true"></i></div>
- <div class="title">System Notifications</div>
- <div class="count">10</div>
- </a>
- <div class="dropdown-menu">
- <ul>
- <li class="dropdown-header">Notification</li>
- <li>
- <a href="#">
- <span class="badge badge-danger pull-right">8</span>
- <div class="message">
- <div class="content">
- <div class="title">New Order</div>
- <div class="description">$400 total</div>
- </div>
- </div>
- </a>
- </li>
- <li>
- <a href="#">
- <span class="badge badge-danger pull-right">14</span>
- Inbox
- </a>
- </li>
- <li>
- <a href="#">
- <span class="badge badge-danger pull-right">5</span>
- Issues Report
- </a>
- </li>
- <li class="dropdown-footer">
- <a href="#">View All <i class="fa fa-angle-right" aria-hidden="true"></i></a>
- </li>
- </ul>
- </div>
- </li>
- <li class="dropdown profile">
- <a href="/html/pages/profile.html" class="dropdown-toggle" data-toggle="dropdown">
- <img class="profile-img" src="${pageContext.request.contextPath}/dist/jsps/assets/images/profile.png">
- <div class="title">Profile</div>
- </a>
- <div class="dropdown-menu">
- <div class="profile-info">
- <h4 class="username">Scott White</h4>
- </div>
- <ul class="action">
- <li>
- <a href="#">
- Profile
- </a>
- </li>
- <li>
- <a href="#">
- <span class="badge badge-danger pull-right">5</span>
- My Inbox
- </a>
- </li>
- <li>
- <a href="#">
- Setting
- </a>
- </li>
- <li>
- <a href="#">
- Logout
- </a>
- </li>
- </ul>
- </div>
- </li>
- </ul>
- </div>
- </div>
- </nav>
- <div class="row">
- <div class="col-xs-12">
- <img src="${pageContext.request.contextPath}/dist/jsps/assets/images/main.jpg" height="700" width="1280" style="margin-left: 5%;margin-right: 5%"/>
- </div>
-
-
- <script type="text/javascript" src="./assets/js/vendor.js"></script>
- <script type="text/javascript" src="./assets/js/app.js"></script>
- </div>
- </div>
- </div>
- </body>
- </html>
goods-add.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <html>
- <head>
- <title>Home</title>
-
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
-
- </head>
- <body>
- <div class="app app-default">
-
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
- <div class="app-container">
-
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card card-mini">
- <div class="card-header">
- <div class="card-title">
- <a href="${pageContext.request.contextPath}/goods/findAll?page=1&size=8"> <button style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">返回上一页</button></a>
-
-
- </div>
-
-
- </div>
-
- <form style="margin-left: 10%; margin-right: 10%;" action="${pageContext.request.contextPath}/goods/save" method="post">
- <div class="form-group">
- <input type="hidden" name="id" value="${goods.id}">
- <label for="exampleInputEmail1">货品名称</label>
- <input type="text" class="form-control" name="goodsName" id="username" value="${goods.goodsName}" placeholder="请输入货物名称">
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">货品数量</label>
- <input type="text" class="form-control" name="goodsNum" id="accountBalance" value="${goods.goodsNum}" placeholder="请输入货物数量">
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">货品单价</label>
- <input type="text" class="form-control" name="goodsPrice" id="exampleInputEmail1" value="${goods.goodsPrice}" placeholder="请输入货物单价">
- </div>
- <button style="margin-left: 40%;" type="submit" class="btn btn-default">保存</button>
- <button type="reset" class="btn btn-default">重置</button>
- </form>
- </div>
-
- </div>
-
-
-
- </div>
- </div>
-
- </div>
-
- </div>
-
- <script type="text/javascript" src="../assets/js/vendor.js"></script>
- <script type="text/javascript" src="../assets/js/app.js"></script>
-
- </body>
- </html>
goods-list.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Home</title>
-
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
-
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
- </head>
- <body>
- <div class="app app-default">
-
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
- <div class="app-container">
-
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card card-mini">
- <div class="card-header">
- <div class="card-title">
- <button onclick="location.href='${pageContext.request.contextPath}/dist/jsps/pages/goods-add.jsp'"
- style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">新建</button>
- <button
- onclick="location.href='${pageContext.request.contextPath}/goods/findAllGoods'"
- style="background-color: rgb(102, 175, 220); border:beige;color: rgb(243, 241, 238);">显示全部</button>
- </div>
- </div>
-
- <div class="card-body no-padding table-responsive">
- <table class="table card-table">
- <thead>
- <tr>
- <th>货品名称</th>
- <th class="right">货品数量</th>
- <th>货品单价</th>
- <th>购物车</th>
- <th>操作方式</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${goodsList.list}" var="goodsList">
- <tr>
- <td>${goodsList.goodsName}</td>
- <td class="right">${goodsList.goodsNum}/个</td>
- <td><span class="badge badge-success badge-icon">
- <i class="fa fa-check" aria-hidden="true"></i>
- <span>${goodsList.goodsPrice}¥/个</span></span></td>
- <td><button onclick="location.href='${pageContext.request.contextPath}/user/addOrder?goodsId=${goodsList.id}&userId=3'"
-
- style="background-color: rgb(61, 210, 128);border: beige;color: beige;">添加到购物车</button></td>
- <td>
- <button onclick="location.href='${pageContext.request.contextPath}/goods/findGoodsById?goodsId=${goodsList.id}'"
- style="background-color: rgb(109, 207, 234); border:beige;color: rgb(250, 248, 243);">修 改</button>
- <button onclick="location.href='${pageContext.request.contextPath}/goods/deleteById?goodsId=${goodsList.id}'"
- style="background-color: rgb(208, 87, 46); border:beige;color: rgb(247, 245, 241);">删 除</button>
- </td>
- </tr>
- </c:forEach>
-
- </tbody>
- </table>
- </div>
- <div class="box-footer">
- <div class="pull-left">
- <div class="form-group form-inline">
- 总共${goodsList.pages} 页,共${goodsList.total} 条数据
- </div>
- </div>
- <div class="box-tools pull-right">
- <ul class="pagination">
- <li>
- <a href="${pageContext.request.contextPath}/gooods/findAll?page=1&size=${goodsList.pageSize}"
- aria-label="Previous">首页</a>
- </li>
- <li>
- <a href="${pageContext.request.contextPath}/goods/findAll?page=${goodsList.pageNum-1}&size=${goodsList.pageSize}">
- 上一页</a></li>
- <c:forEach begin="1" end="${goodsList.pages}" var="pageNum">
- <li>
- <a href="${pageContext.request.contextPath}/goods/findAll?page=${pageNum}&size=${goodsList.pageSize}">
- ${pageNum}</a></li>
- </c:forEach>
-
- <li>
- <a href="${pageContext.request.contextPath}/goods/findAll?page=${goodsList.pageNum+1}&size=${goodsList.pageSize}">下一页</a>
- </li>
- <li>
- <a href="${pageContext.request.contextPath}/goods/findAll?page=${goodsList.pages}&size=${goodsList.pageSize}"
- aria-label="Next">尾页</a>
- </li>
- </ul>
- </div>
-
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- </body>
-
- </html>
goods-list-all.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Home</title>
-
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
-
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
- </head>
- <body>
- <div class="app app-default">
-
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
- <div class="app-container">
-
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card card-mini">
- <div class="card-header">
- <div class="card-title">
- <button onclick="location.href='${pageContext.request.contextPath}/dist/jsps/pages/goods-add.jsp'"
- style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">新建</button>
- <button
- onclick="location.href='${pageContext.request.contextPath}/goods/findAllGoods'"
- style="background-color: rgb(102, 175, 220); border:beige;color: rgb(243, 241, 238);">显示全部</button>
- </div>
- </div>
-
- <div class="card-body no-padding table-responsive">
- <table class="table card-table">
- <thead>
- <tr>
- <th>货品名称</th>
- <th class="right">货品数量</th>
- <th>货品单价</th>
- <th>购物车</th>
- <th>操作方式</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${goodsList}" var="goodsList">
- <tr>
- <td>${goodsList.goodsName}</td>
- <td class="right">${goodsList.goodsNum}/个</td>
- <td><span class="badge badge-success badge-icon">
- <i class="fa fa-check" aria-hidden="true"></i>
- <span>${goodsList.goodsPrice}¥/个</span></span></td>
- <td><button onclick="location.href='${pageContext.request.contextPath}/user/addOrder?goodsId=${goodsList.id}&userId=3'"
-
- style="background-color: rgb(61, 210, 128);border: beige;color: beige;">添加到购物车</button></td>
- <td>
- <button onclick="location.href='${pageContext.request.contextPath}/goods/findRoleById?goodsId=${goodsList.id}'"
- style="background-color: rgb(109, 207, 234); border:beige;color: rgb(250, 248, 243);">修 改</button>
- <button onclick="location.href='${pageContext.request.contextPath}/goods/deleteById?goodsId=${goodsList.id}'"
- style="background-color: rgb(208, 87, 46); border:beige;color: rgb(247, 245, 241);">删 除</button>
- </td>
- </tr>
- </c:forEach>
-
- </tbody>
- </table>
- </div>
-
- </div>
- </div>
-
- </div>
-
- </div>
-
- <script type="text/javascript" src="../assets/js/vendor.js"></script>
- <script type="text/javascript" src="../assets/js/app.js"></script>
-
- </div>
- </div>
- </body>
- </html>
left.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <html>
- <head>
- <title>Title</title>
- </head>
- <body>
- <aside class="app-sidebar" id="sidebar">
- <div class="sidebar-header">
- <a class="sidebar-brand" href="#"><span class="highlight">欢迎</span> 王琪</a>
- <button type="button" class="sidebar-toggle">
- <i class="fa fa-times"></i>
- </button>
- </div>
- <div class="sidebar-menu">
- <ul class="sidebar-nav">
- <li class="active">
- <a href="${pageContext.request.contextPath}/dist/jsps/main.jsp">
- <div class="icon">
- <i class="fa fa-tasks" aria-hidden="true"></i>
- </div>
- <div class="title">首页</div>
- </a>
- </li>
- <li class="@@menu.messaging">
- <a href="${pageContext.request.contextPath}/user/findAll?page=1&size=8">
- <div class="icon">
- <i class="fa fa-comments" aria-hidden="true"></i>
- </div>
- <div class="title">用户管理</div>
- </a>
- </li>
- <li class="@@menu.messaging ">
- <a href="${pageContext.request.contextPath}/role/findAll?page=1&size=8">
- <div class="icon">
- <i class="fa fa-cube" aria-hidden="true"></i>
- </div>
- <div class="title">职位管理</div>
- </a>
- </li>
- <li class="@@menu.messaging ">
- <a href="${pageContext.request.contextPath}/goods/findAll?page=1&size=8">
- <div class="icon">
- <i class="fa fa-cube" aria-hidden="true"></i>
- </div>
- <div class="title">货品管理</div>
- </a>
- </li>
- <li class="@@menu.messaging ">
- <a href="${pageContext.request.contextPath}/user/findUserAndGoodsById?userId=7">
- <div class="icon">
- <i class="fa fa-cube" aria-hidden="true"></i>
- </div>
- <div class="title">订单管理</div>
- </a>
- </li>
- </ul>
- </div>
- <div class="sidebar-footer">
- <ul class="menu">
- <li>
- <a href="/" class="dropdown-toggle" data-toggle="dropdown">
- <i class="fa fa-cogs" aria-hidden="true"></i>
- </a>
- </li>
- <li><a href="#"><span class="flag-icon flag-icon-th flag-icon-squared"></span></a></li>
- </ul>
- </div>
- </aside>
-
- <script type="text/ng-template" id="sidebar-dropdown.tpl.html">
- <div class="dropdown-background">
- <div class="bg"></div>
- </div>
- <div class="dropdown-container">
- {{list}}
- </div>
- </script>
- </body>
- </html>
order-list
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <%@ taglib prefix="out" uri="http://java.sun.com/jsp/jstl/core" %>
-
- <!DOCTYPE html>
- <html>
- <head>
- <title>Home</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
-
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
- </head>
- <body>
- <div class="app app-default">
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
- <div class="app-container">
-
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card card-mini">
- <div class="card-header">
- <div class="card-title">
- <a> <button style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">破产按钮</button></a>
-
- </div>
- </div>
-
- <div class="card-body no-padding table-responsive">
- <table class="table card-table">
- <thead>
- <tr>
- <th>订单编号</th>
- <th class="right">订单用户</th>
- <th>购买物品</th>
- <th>购买数量</th>
- <th>支付单价</th>
- <th>操作方式</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${userList}" var="userList">
- <c:forEach items="${userList.goodsList}" var="goodsList">
-
- <tr>
- <td>zretc-wqzhp-${userList.id}-${goodsList.id}</td>
-
- <td class="right">${userList.username}</td>
- <td>${goodsList.goodsName}</td>
- <td>10个</td>
- <td><span class="badge badge-success badge-icon"><i class="fa fa-check" aria-hidden="true"></i><span>¥${goodsList.goodsPrice}</span></span></td>
- <td>
- <button onclick="location.href='${pageContext.request.contextPath}/user/findZhiFu?userId=${userList.id}&number=10&goodsPrice=${goodsList.goodsPrice}&goodsId=${goodsList.id}'"
- style="background-color: rgb(109, 207, 234); border:beige;color: rgb(250, 248, 243);">支 付</button>
-
- <button onclick="deleteOrder(${userList.id},${goodsList.id})"
- style="background-color: rgb(208, 87, 46); border:beige;color: rgb(247, 245, 241);">删 除</button>
-
-
- <button onclick="baoChang()"
- style="background-color: rgb(75,206,160); border:beige;color: rgb(247, 245, 241);">包 场</button></td>
- </tr>
- </c:forEach>
- </c:forEach>
-
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- </div>
- </div>
- <script type="text/javascript" src="${pageContext.request.contextPath}/dist/jsps/assets/js/vendor.js"></script>
- <script type="text/javascript" src="${pageContext.request.contextPath}/dist/jsps/assets/js/app.js"></script>
- <script>
- /**
- * 包场模块
- */
- function baoChang() {
- alert("After background calculation, you have not reached the strength of private field!!")
- }
-
- /**
- * 删除模块
- */
- function deleteOrder(userId,goodsId) {
- if (confirm("Are you sure you want to delete ?")) {
- window.location.href = "${pageContext.request.contextPath}/user/deleteOrder?userId="+userId+"&goodsId="+goodsId;
- }
- }
- </script>
- </body>
- </html>
role-add.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <%@ taglib prefix="out" uri="http://java.sun.com/jsp/jstl/core" %>
-
- <!DOCTYPE html>
- <html>
- <head>
- <title>Home</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
-
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
- </head>
- <body>
- <div class="app app-default">
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
- <div class="app-container">
-
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card card-mini">
- <div class="card-header">
- <div class="card-title">
- <a> <button style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">破产按钮</button></a>
-
- </div>
- </div>
-
- <div class="card-body no-padding table-responsive">
- <table class="table card-table">
- <thead>
- <tr>
- <th>订单编号</th>
- <th class="right">订单用户</th>
- <th>购买物品</th>
- <th>购买数量</th>
- <th>支付单价</th>
- <th>操作方式</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${userList}" var="userList">
- <c:forEach items="${userList.goodsList}" var="goodsList">
-
- <tr>
- <td>zretc-wqzhp-${userList.id}-${goodsList.id}</td>
-
- <td class="right">${userList.username}</td>
- <td>${goodsList.goodsName}</td>
- <td>10个</td>
- <td><span class="badge badge-success badge-icon"><i class="fa fa-check" aria-hidden="true"></i><span>¥${goodsList.goodsPrice}</span></span></td>
- <td>
- <button onclick="location.href='${pageContext.request.contextPath}/user/findZhiFu?userId=${userList.id}&number=10&goodsPrice=${goodsList.goodsPrice}&goodsId=${goodsList.id}'"
- style="background-color: rgb(109, 207, 234); border:beige;color: rgb(250, 248, 243);">支 付</button>
-
- <button onclick="deleteOrder(${userList.id},${goodsList.id})"
- style="background-color: rgb(208, 87, 46); border:beige;color: rgb(247, 245, 241);">删 除</button>
-
-
- <button onclick="baoChang()"
- style="background-color: rgb(75,206,160); border:beige;color: rgb(247, 245, 241);">包 场</button></td>
- </tr>
- </c:forEach>
- </c:forEach>
-
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- </div>
- </div>
- <script type="text/javascript" src="${pageContext.request.contextPath}/dist/jsps/assets/js/vendor.js"></script>
- <script type="text/javascript" src="${pageContext.request.contextPath}/dist/jsps/assets/js/app.js"></script>
- <script>
- /**
- * 包场模块
- */
- function baoChang() {
- alert("After background calculation, you have not reached the strength of private field!!")
- }
-
- /**
- * 删除模块
- */
- function deleteOrder(userId,goodsId) {
- if (confirm("Are you sure you want to delete ?")) {
- window.location.href = "${pageContext.request.contextPath}/user/deleteOrder?userId="+userId+"&goodsId="+goodsId;
- }
- }
- </script>
- </body>
- </html>
role-list.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Home</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
- </head>
- <body>
- <div class="app app-default">
-
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
- <div class="app-container">
-
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card card-mini">
- <div class="card-header">
- <div class="card-title">
- <button onclick="location.href='${pageContext.request.contextPath}/dist/jsps/pages/role-add.jsp'"
- style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">新建</button>
- <button
- onclick="location.href='${pageContext.request.contextPath}/role/findAllRole'"
- style="background-color: rgb(102, 175, 220); border:beige;color: rgb(243, 241, 238);">显示全部</button>
- </div>
-
-
- </div>
-
- <div class="card-body no-padding table-responsive">
- <table class="table card-table">
- <thead>
- <tr>
- <th>职位名称</th>
- <th>职位描述</th>
- <th>天作之合</th>
- <th>操作方式</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${roleList.list}" var="roleList">
- <tr>
- <td>${roleList.roleName}</td>
- <td>${roleList.roleDesc}</td>
- <td><button onclick="location.href='${pageContext.request.contextPath}/role/addOrder?roleId=${roleList.id}&userId=1'"
-
- style="background-color: rgb(61, 210, 128);border: beige;color: beige;">入职通知命令</button></td>
- <td>
- <button onclick="location.href='${pageContext.request.contextPath}/role/findRoleById?roleId=${roleList.id}'"
- style="background-color: rgb(109, 207, 234); border:beige;color: rgb(250, 248, 243);">修 改</button>
- <button onclick="location.href='${pageContext.request.contextPath}/role/deleteById?roleId=${roleList.id}'"
- style="background-color: rgb(208, 87, 46); border:beige;color: rgb(247, 245, 241);">删 除</button>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- </div>
- <div class="box-footer">
- <div class="pull-left">
- <div class="form-group form-inline">
- 总共${roleList.pages} 页,共${roleList.total} 条数据
- </div>
- </div>
- <div class="box-tools pull-right">
- <ul class="pagination">
- <li>
- <a href="${pageContext.request.contextPath}/user/findAll?page=1&size=${roleList.pageSize}"
- aria-label="Previous">首页</a>
- </li>
- <li>
- <a href="${pageContext.request.contextPath}/user/findAll?page=${roleList.pageNum-1}&size=${roleList.pageSize}">
- 上一页</a></li>
- <c:forEach begin="1" end="${roleList.pages}" var="pageNum">
- <li>
- <a href="${pageContext.request.contextPath}/user/findAll?page=${pageNum}&size=${roleList.pageSize}">
- ${pageNum}</a></li>
- </c:forEach>
-
- <li>
- <a href="${pageContext.request.contextPath}/user/findAll?page=${roleList.pageNum+1}&size=${roleList.pageSize}">下一页</a>
- </li>
- <li>
- <a href="${pageContext.request.contextPath}/user/findAll?page=${roleList.pages}&size=${roleList.pageSize}"
- aria-label="Next">尾页</a>
- </li>
- </ul>
- </div>
-
-
-
-
- </div>
- </div>
-
- </div></div>
- </div>
- </div>
-
- <script type="text/javascript" src="${pageContext.request.contextPath}../assets/js/vendor.js"></script>
- <script type="text/javascript" src="${pageContext.request.contextPath}../assets/js/app.js"></script>
-
- </body>
- </html>
role-list-all.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Home</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
- </head>
- <body>
- <div class="app app-default">
-
- <aside class="app-sidebar" id="sidebar">
- <div class="sidebar-header">
- <a class="sidebar-brand" href="#"><span class="highlight">欢迎</span> Admin</a>
- <button type="button" class="sidebar-toggle">
- <i class="fa fa-times"></i>
- </button>
- </div>
- <div class="sidebar-menu">
- <ul class="sidebar-nav">
- <li class="active">
- <a href="${pageContext.request.contextPath}/dist/jsps/main.jsp">
- <div class="icon">
- <i class="fa fa-tasks" aria-hidden="true"></i>
- </div>
- <div class="title">首页</div>
- </a>
- </li>
- <li class="@@menu.messaging">
- <a href="${pageContext.request.contextPath}/user/findAll">
- <div class="icon">
- <i class="fa fa-comments" aria-hidden="true"></i>
- </div>
- <div class="title">用户管理</div>
- </a>
- </li>
- <li class="@@menu.messaging ">
- <a href="${pageContext.request.contextPath}/role/findAll">
- <div class="icon">
- <i class="fa fa-cube" aria-hidden="true"></i>
- </div>
- <div class="title">职位管理</div>
- </a>
- </li>
- <li class="@@menu.messaging ">
- <a href="${pageContext.request.contextPath}/goods/findAll?page=1&size=8"">
- <div class="icon">
- <i class="fa fa-cube" aria-hidden="true"></i>
- </div>
- <div class="title">货品管理</div>
- </a>
- </li>
- <li class="@@menu.messaging ">
- <a href="order-list.jsp">
- <div class="icon">
- <i class="fa fa-cube" aria-hidden="true"></i>
- </div>
- <div class="title">订单管理</div>
- </a>
- </li>
- </ul>
- </div>
- <div class="sidebar-footer">
- <ul class="menu">
- <li>
- <a href="/" class="dropdown-toggle" data-toggle="dropdown">
- <i class="fa fa-cogs" aria-hidden="true"></i>
- </a>
- </li>
- <li><a href="#"><span class="flag-icon flag-icon-th flag-icon-squared"></span></a></li>
- </ul>
- </div>
- </aside>
-
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
- <div class="app-container">
-
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card card-mini">
- <div class="card-header">
- <div class="card-title">
- <button onclick="location.href='${pageContext.request.contextPath}/dist/jsps/pages/role-add.jsp'"
- style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">新建</button>
- <button
- onclick="location.href='${pageContext.request.contextPath}/role/findAllRole'"
- style="background-color: rgb(102, 175, 220); border:beige;color: rgb(243, 241, 238);">显示全部</button>
- </div>
-
-
- </div>
-
- <div class="card-body no-padding table-responsive">
- <table class="table card-table">
- <thead>
- <tr>
- <th>职位名称</th>
- <th>职位描述</th>
- <th>天作之合</th>
- <th>操作方式</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${roleList.list}" var="roleList">
- <tr>
- <td>${roleList.roleName}</td>
- <td>${roleList.roleDesc}</td>
- <td><button onclick="location.href='${pageContext.request.contextPath}/role/addOrder?roleId=${roleList.id}&userId=1'"
-
- style="background-color: rgb(61, 210, 128);border: beige;color: beige;">入职通知命令</button></td>
- <td>
- <button onclick="location.href='${pageContext.request.contextPath}/role/findRoleById?roleId=${roleList.id}'"
- style="background-color: rgb(109, 207, 234); border:beige;color: rgb(250, 248, 243);">修 改</button>
- <button onclick="location.href='${pageContext.request.contextPath}/role/deleteById?roleId=${roleList.id}'"
- style="background-color: rgb(208, 87, 46); border:beige;color: rgb(247, 245, 241);">删 除</button>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- </div>
-
- </div>
-
- </div></div>
- </div>
- </div>
-
- <script type="text/javascript" src="${pageContext.request.contextPath}../assets/js/vendor.js"></script>
- <script type="text/javascript" src="${pageContext.request.contextPath}../assets/js/app.js"></script>
-
- </body>
- </html>
temp.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Home</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
- </head>
- <body>
- <div class="app app-default">
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
- <div class="app-container">
- <div class="row">
- <table class="table table-condensed">
- <h1 style="text-align: center">离婚信息详情表</h1>
- <tr>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th>照片</th>
- <th>姓名</th>
- <th></th>
- </tr>
-
- <tr>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <td>
- <c:forEach items="${tempList}" var="temp">
- <img src="${pageContext.request.contextPath}${temp.url}" width="213px" height="320px">
- </c:forEach>
- </td>
- <td>王 琪</td>
- <th></th>
-
- </tr>
- <tr>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th>学历</th>
- <th>智商</th>
- <th></th>
- </tr>
- <tr>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <td>卡塞尔学院研究生毕业</td>
- <td>IQ:156</td>
- <th></th>
- </tr>
- <tr>
- <tr>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th>操作</th>
- <th>步骤</th>
- <th></th>
- </tr>
- <tr>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <td>
- <button onclick="location.href='${pageContext.request.contextPath}/login/findAllTemp?id=2'"
- style="background-color: rgba(22,146,168,0.9); border:beige;color: rgb(247, 245, 241);">切 换</button>
- </td>
- <td>
- <input type="file">
- </td>
- <th></th>
- </tr>
- </table>
-
- </div>
-
-
- </div>
- </div>
- </body>
- </html>
temp-list.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="multipart/form-data;charset=utf-8" />
- <title>Title</title>
- </head>
- <body>
- <form action="/temp/save" method="post" enctype="multipart/form-data">
- <label class="layui-form-label">请选择上传图片:
- <input type="file" name="pictureFile" class="layui-upload-file"></label>
- <input type="submit" value="提交">
- </form>
- </body>
- </html>
user.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <html>
- <head>
- <title>Home</title>
-
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
-
- </head>
- <body>
- <div class="app app-default">
-
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
-
-
- <div class="app-container">
-
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card card-mini">
- <div class="card-header">
- <div class="card-title">
- <a href="user-list.html"> <button style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">返回上一页</button></a>
-
-
- </div>
- </div>
-
- <%-- <table class="table table-striped">--%>
- <%-- <tr>--%>
- <%-- <td>头像</td>--%>
- <%-- <td></td>--%>
- <%-- <td></td>--%>
- <%-- </tr>--%>
- <%-- </table>--%>
- </div>
-
- </div>
-
-
-
- </div>
- </div>
-
- </div>
-
- </div>
-
-
-
- </body>
- </html>
user-add.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <html>
- <head>
- <title>Home</title>
-
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
-
- </head>
- <body>
- <div class="app app-default">
-
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
-
-
- <div class="app-container">
-
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card card-mini">
- <div class="card-header">
- <div class="card-title">
- <a href="user-list.html"> <button style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">返回上一页</button></a>
-
-
- </div>
-
-
- </div>
-
- <form style="margin-left: 10%; margin-right: 10%;" action="${pageContext.request.contextPath}/user/save" method="post">
- <div class="form-group">
- <input type="hidden" name="id" value="${user.id}">
- <label for="exampleInputEmail1">用户名</label>
- <input type="text" class="form-control" name="username" id="username" value="${user.username}" placeholder="请输入用户名">
- </div>
- <div class="form-group">
- <label for="password">账户信息</label>
- <input type="password" class="form-control" name="password" id="password" value="${user.password}" placeholder="请输入密码">
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">账户余额</label>
- <input type="text" class="form-control" name="accountBalance" id="accountBalance" value="${user.accountBalance}" placeholder=""请输入账户余额>
- </div>
- <div class="form-group">
- <label for="exampleInputEmail1">类别</label>
- <input type="text" class="form-control" id="exampleInputEmail1" value="普通用户" placeholder="">
- </div>
- <button style="margin-left: 40%;" type="submit" class="btn btn-default">保存</button>
- <button type="reset" class="btn btn-default">重置</button>
- </form>
- </div>
-
- </div>
-
-
-
- </div>
- </div>
-
- </div>
-
- </div>
-
- <script type="text/javascript" src="../assets/js/vendor.js"></script>
- <script type="text/javascript" src="../assets/js/app.js"></script>
-
- </body>
- </html>
user-list.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Home</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
- </head>
- <body>
- <div class="app app-default">
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
- <div class="app-container">
-
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card card-mini">
- <div class="card-header">
- <div class="card-title">
- <button onclick="location.href='${pageContext.request.contextPath}/dist/jsps/pages/user-add.jsp'"
- style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">新建</button>
- <button
- onclick="location.href='${pageContext.request.contextPath}/user/findAllUser'"
- style="background-color: rgb(102, 175, 220); border:beige;color: rgb(243, 241, 238);">显示全部</button>
- </div>
-
- <%-- <ul class="card-action">--%>
- <%-- <li>--%>
- <%-- <input style="width: 250px;height: 30px" placeholder="这是一个输入框">--%>
- <%-- </li>--%>
- <%-- </ul>--%>
- </div>
-
- <div class="card-body no-padding table-responsive">
- <table class="table card-table">
- <thead>
- <tr>
- <th>用户名</th>
- <th class="right">账户信息</th>
- <th>账户余额</th>
- <th>类别</th>
- <th>操作方式</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>王琪</td>
- <td class="right">******</td>
- <td><span class="badge badge-success badge-icon"><i class="fa fa-check" aria-hidden="true"></i><span>¥∞</span></span></td>
- <td>老板娘</td>
-
- <td>
-
- <button onclick="location.href='${pageContext.request.contextPath}/login/findAllTemp?id=1'"
- style="background-color: #e56932; border:beige; color: rgb(246,244,240);width: 80px;height: 25px;">离婚</button>
- </td>
- </tr>
- <c:forEach items="${userList.list}" var="userList">
- <tr>
- <td>${userList.username}</td>
- <td class="right">******</td>
- <td><span class="badge badge-success badge-icon"><i class="fa fa-check" aria-hidden="true"></i><span>¥${userList.accountBalance}</span></span></td>
- <td>普通用户</td>
- <td>
-
- <button onclick="location.href='${pageContext.request.contextPath}/user/findUserById?userId=${userList.id}'"
- style="background-color: rgb(109, 207, 234); border:beige;color: rgb(250, 248, 243);">修 改</button>
- <button onclick="location.href='${pageContext.request.contextPath}/user/deleteById?userId=${userList.id}'"
- style="background-color: rgb(208, 87, 46); border:beige;color: rgb(247, 245, 241);">删 除</button>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- </div>
- <div class="box-footer">
- <div class="pull-left">
- <div class="form-group form-inline">
- 总共${userList.pages} 页,共${userList.total} 条数据
- </div>
- </div>
- <div class="box-tools pull-right">
- <ul class="pagination">
- <li>
- <a href="${pageContext.request.contextPath}/user/findAll?page=1&size=${userList.pageSize}"
- aria-label="Previous">首页</a>
- </li>
- <li>
- <a href="${pageContext.request.contextPath}/user/findAll?page=${userList.pageNum-1}&size=${userList.pageSize}">
- 上一页</a></li>
- <c:forEach begin="1" end="${userList.pages}" var="pageNum">
- <li>
- <a href="${pageContext.request.contextPath}/user/findAll?page=${pageNum}&size=${userList.pageSize}">
- ${pageNum}</a></li>
- </c:forEach>
-
- <li>
- <a href="${pageContext.request.contextPath}/user/findAll?page=${userList.pageNum+1}&size=${userList.pageSize}">下一页</a>
- </li>
- <li>
- <a href="${pageContext.request.contextPath}/user/findAll?page=${userList.pages}&size=${userList.pageSize}"
- aria-label="Next">尾页</a>
- </li>
- </ul>
- </div>
- </div>
- </div>
-
-
-
- </div>
-
- </div>
-
- <script>
-
- </script>
- </div>
- </div>
- </body>
- </html>
user-list-all.jsp
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Home</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
- </head>
- <body>
- <div class="app app-default">
-
- <jsp:include page="left.jsp"></jsp:include>
-
- <div class="app-container">
-
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card card-mini">
- <div class="card-header">
- <div class="card-title">
- <a> <button onclick="location.href='${pageContext.request.contextPath}/dist/jsps/pages/user-add.jsp'"
- style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">新建</button></a>
- <button
- onclick="location.href='${pageContext.request.contextPath}/user/findAllUser'"
- style="background-color: rgb(102, 175, 220); border:beige;color: rgb(243, 241, 238);">显示全部</button></a>
- </div>
-
- <%-- <ul class="card-action">--%>
- <%-- <li>--%>
- <%-- <input style="width: 250px;height: 30px" placeholder="这是一个输入框">--%>
- <%-- </li>--%>
- <%-- </ul>--%>
- </div>
-
- <div class="card-body no-padding table-responsive">
- <table class="table card-table">
- <thead>
- <tr>
- <th>用户名</th>
- <th class="right">账户信息</th>
- <th>账户余额</th>
- <th>类别</th>
- <th>操作方式</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>王琪</td>
- <td class="right">******</td>
- <td><span class="badge badge-success badge-icon"><i class="fa fa-check" aria-hidden="true"></i><span>¥∞</span></span></td>
- <td>老板娘</td>
- <td>
-
- <button onclick="location.href='${pageContext.request.contextPath}/login/findAllTemp?id=1'"
- style="background-color: #e56932; border:beige; color: rgb(246,244,240);width: 80px;height: 25px;">离婚</button>
- </td>
- </tr>
-
- <c:forEach items="${userList}" var="userList">
- <tr>
- <td>${userList.username}</td>
- <td class="right">******</td>
- <td><span class="badge badge-success badge-icon"><i class="fa fa-check" aria-hidden="true"></i><span>¥${userList.accountBalance}</span></span></td>
- <td>普通用户</td>
- <td>
- <button onclick="location.href='${pageContext.request.contextPath}/user/findUserAndRoleById?userId=${userList.id}'"
- style="background-color: rgb(47, 197, 107); border:beige; color: rgb(246, 244, 240);">职位</button>
- <button onclick="location.href='${pageContext.request.contextPath}/user/findUserById?userId=${userList.id}'"
- style="background-color: rgb(109, 207, 234); border:beige;color: rgb(250, 248, 243);">修 改</button>
- <button onclick="location.href='${pageContext.request.contextPath}/user/deleteById?userId=${userList.id}'"
- style="background-color: rgb(208, 87, 46); border:beige;color: rgb(247, 245, 241);">删 除</button>
- </td>
- </tr>
- </c:forEach>
-
- </tbody>
- </table>
- </div>
-
- </div>
-
- </div>
-
- </div>
-
- <script>
-
- </script>
- </div>
- </div>
- </body>
- </html>
user-role-list
- <%--
- Created by IntelliJ IDEA.
- User: 86176
-
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Home</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/vendor.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/flat-admin.css">
- <!-- Theme -->
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue-sky.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/blue.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/red.css">
- <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/jsps/assets/css/theme/yellow.css">
-
- </head>
- <body>
- <div class="app app-default">
- <%-- 引入左边栏--%>
- <jsp:include page="left.jsp"></jsp:include>
- <div class="app-container">
-
- <div class="row">
- <table class="table table-condensed">
- <h1 style="text-align: center">职位信息详情表</h1>
- <tr>
- <td>编号</td>
- <td>职位</td>
- <td>任务</td>
- <th>操作</th>
- </tr>
- <c:forEach items="${roleList}" var="roleList">
- <tr>
- <td>**</td>
- <td>${roleList.roleName}</td>
- <td>${roleList.roleDesc}</td>
- <td>
- <button onclick=" deleteUserRole(${roleList.id},${userId})"location.href='${pageContext.request.contextPath}/user/deleteUserRoleById?roleId=${roleList.id}&userId=${userId}'"
- style="background-color: rgb(208, 87, 46); border:beige;color: rgb(247, 245, 241);">删 除</button>
- </td>
- </tr>
- </c:forEach>
-
-
- </table>
-
- </div>
-
-
- </div>
- </div>
- <script>
- /**
- * 删除模块
- */
- function deleteUserRole(roleId,userId) {
- if (confirm("Are you sure you want to delete ?")) {
- window.location.href = "${pageContext.request.contextPath}/user/deleteUserRoleById?roleId="+roleId+"&userId="+userId;
- }
- }
- </script>
- </body>
- </html>
后端代码如下
pom文件
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>com.zretc</groupId>
- <artifactId>SSM_Project</artifactId>
- <packaging>pom</packaging>
- <version>1.0-SNAPSHOT</version>
- <properties>
- <spring.version>5.0.2.RELEASE</spring.version>
- <slf4j.version>1.6.6</slf4j.version>
- <log4j.version>1.2.12</log4j.version>
- <oracle.version>11.2.0.1.0</oracle.version>
- <mybatis.version>3.4.5</mybatis.version>
- <spring.security.version>5.0.1.RELEASE</spring.security.version>
- </properties>
- <dependencies>
- <!-- spring -->
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>1.6.8</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.1.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>jstl</groupId>
- <artifactId>jstl</artifactId>
- <version>1.2</version>
- </dependency>
- <!-- log start -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <!-- log end -->
- <dependency>
- <groupId>org.mybatis</groupId>
- <artifactId>mybatis</artifactId>
- <version>${mybatis.version}</version>
- </dependency>
- <dependency>
- <groupId>org.mybatis</groupId>
- <artifactId>mybatis-spring</artifactId>
- <version>1.3.0</version>
- </dependency>
- <dependency>
- <groupId>c3p0</groupId>
- <artifactId>c3p0</artifactId>
- <version>0.9.1.2</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.github.pagehelper</groupId>
- <artifactId>pagehelper</artifactId>
- <version>5.1.2</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-web</artifactId>
- <version>${spring.security.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-config</artifactId>
- <version>${spring.security.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-core</artifactId>
- <version>${spring.security.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-taglibs</artifactId>
- <version>${spring.security.version}</version>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.47</version>
- </dependency>
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.projectlombok</groupId>
- <artifactId>lombok</artifactId>
- <version>1.16.20</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.4</version>
- </dependency>
-
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.3.1</version>
- </dependency>
- </dependencies>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.2</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <encoding>UTF-8</encoding>
- <showWarnings>true</showWarnings>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- <modules>
- <module>SSM_Pojo</module>
- <module>SSM_Service</module>
- <module>SSM_Mapper</module>
- <module>SSM_Utils</module>
- <module>SSM_Controller</module>
- </modules>
-
-
- </project>
controller层
GoodsController类
- package com.zretc.controller;
- import com.github.pagehelper.PageInfo;
- import com.zretc.pojo.Goods;
- import com.zretc.pojo.Role;
- import com.zretc.service.GoodsService;
- import com.zretc.service.RoleService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.servlet.ModelAndView;
-
- import java.util.List;
- @Controller
- @RequestMapping("/goods")
- public class GoodsController {
-
- @Autowired
- private GoodsService goodsService;
-
- /**
- * 查询所有货品
- */
- @RequestMapping("/findAllGoods")
- public ModelAndView findAll() {
- ModelAndView modelAndView = new ModelAndView();
- List<Goods> goodsList = goodsService.findAll();
- System.out.println(1111111111);
- System.out.println(goodsList);
- modelAndView.addObject("goodsList", goodsList);
- modelAndView.setViewName("goods-list-all");
- return modelAndView;
- }
-
- /**
- * 查询所有用户分页显示
- */
- @RequestMapping("/findAll")
- public ModelAndView findAllGoods(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "8") int size) {
- ModelAndView modelAndView = new ModelAndView();
- List<Goods> userList = goodsService.findAll(page,size);
- PageInfo<Goods> pageInfo = new PageInfo<>(userList);
- modelAndView.addObject("goodsList",pageInfo);
- modelAndView.setViewName("goods-list");
- return modelAndView;
- }
-
-
- /**
- * 根据职位id查询货品
- *
- * @return
- */
- @RequestMapping("findGoodsById")
- public ModelAndView findProductById(@RequestParam(name = "goodsId") int goodsId) {
- ModelAndView modelAndView = new ModelAndView();
- Goods product = goodsService.findGoodsById(goodsId);
- modelAndView.addObject("goods", product);
- modelAndView.setViewName("goods-add");
- return modelAndView;
- }
-
- /**
- * 根据id删除
- */
- @RequestMapping("/deleteById")
- public String deleteById(@RequestParam(name = "goodsId") int goodsId){
- goodsService.deleteById(goodsId);
- return "redirect:findAll";
- }
-
- /**
- * 新增
- *
- * @param goods
- */
- @RequestMapping("save")
- public String save(Goods goods) {
- System.out.println(goods);
- // 判断产品id是否为空
- if (goods.getId()==null) {
- System.out.println(goods.getId());
- System.out.println("==============");
- // 新增的方法
- goodsService.save(goods);
-
- } else {
- System.out.println(goods.getId());
- System.out.println("---------------");
- // 修改的方法
- goodsService.updateGoods(goods);
- }
- return "redirect:findAll";
- }
-
- }
- package com.zretc.controller;
-
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
-
- @Controller
- @RequestMapping("/order")
- public class OrderController {
-
- }
- package com.zretc.controller;
- import com.github.pagehelper.PageInfo;
- import com.zretc.pojo.Goods;
- import com.zretc.pojo.Role;
- import com.zretc.pojo.User;
- import com.zretc.service.UserService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.context.annotation.PropertySource;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.servlet.ModelAndView;
- import java.util.List;
- @Controller
- @RequestMapping("/user")
- public class UserController {
- @Autowired
- private UserService userService;
-
- /**
- * 查询所有用户分页显示
- */
- @RequestMapping("/findAll")
- public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "8") int size) {
- ModelAndView modelAndView = new ModelAndView();
- List<User> userList = userService.findAll(page,size);
- PageInfo<User> pageInfo = new PageInfo<>(userList);
- modelAndView.addObject("userList",pageInfo);
- modelAndView.setViewName("user-list");
- return modelAndView;
- }
- /**
- * 查询所有用户
- */
- @RequestMapping("/findAllUser")
- public ModelAndView findAllUser() {
- ModelAndView modelAndView = new ModelAndView();
- List<User> userList = userService.findAll();
- modelAndView.addObject("userList",userList);
- modelAndView.setViewName("user-list-all");
- return modelAndView;
- }
-
- /**
- * 根据产品id用户
- *
- * @return
- */
- @RequestMapping("findUserById")
- public ModelAndView findProductById(@RequestParam(name = "userId") int userId) {
- ModelAndView modelAndView = new ModelAndView();
- User product = userService.findUserById(userId);
- modelAndView.addObject("user", product);
- modelAndView.setViewName("user-add");
- return modelAndView;
- }
-
- /**
- * 根据id删除
- */
- @RequestMapping("/deleteById")
- public String deleteById(@RequestParam(name = "userId") int userId){
- userService.deleteById(userId);
- return "redirect:findAll";
- }
-
- /**
- * 新增
- *
- * @param user
- */
- @RequestMapping("/save")
- public String save(User user) {
- System.out.println(1111);
- System.out.println(user);
- // 判断产品id是否为空
- if (user.getId()==null) {
- // 新增的方法
- userService.save(user);
- } else {
- // 修改的方法
- userService.updateUser(user);
- }
-
- return "redirect:findAll";
- }
-
- /**
- * 查询每个人拥有几个职位
- */
- @RequestMapping("/findUserAndRoleById")
- public ModelAndView findUserAndRoleById(@RequestParam(name = "userId") int userId){
- System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- ModelAndView modelAndView = new ModelAndView();
- User product = userService.findUserAndRoleById(userId);
- System.out.println(product);
- List<Role> roleList = product.getRoleList();
- Integer productId = product.getId();
- System.out.println(roleList);
- modelAndView.addObject("roleList", roleList);
- modelAndView.addObject("userId", productId);
- modelAndView.setViewName("user-role-list");
- return modelAndView;
- }
-
- /**
- * 登录
- */
- @RequestMapping("/login")
- public String login(User user){
- System.out.println("99999999999999");
- System.out.println(user);
- // @RequestParam("username") String name,@RequestParam("password") String password
- //
- System.out.println("这是登录页面");
- if ("王琪".equals(user.getUsername()) && "123456".equals(user.getPassword())){
- return "../main";
- }else {
- return "../../../error";
- }
- }
-
-
- @RequestMapping("deleteUserRoleById")
- public String deleteUserRoleById(@RequestParam("roleId") int roleId,@RequestParam("userId") int userId){
- userService.deleteUserRoleById(roleId,userId);
- return "redirect:http://localhost/user/findUserAndRoleById?userId=1";
- }
-
- /**
- * 查询每个人拥有几个职位
- */
- @RequestMapping("/findUserAndGoodsById")
- public ModelAndView findUserAndGoodsById(){
- System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
- int userId=0;
- ModelAndView modelAndView = new ModelAndView();
- List<User> userList = userService.findUserAndGoodsById(userId);
- System.out.println(userList);
- modelAndView.addObject("userList", userList);
- modelAndView.setViewName("order-list");
- return modelAndView;
- }
-
- /**
- * 订单支付模块
- */
- @RequestMapping("/findZhiFu")
- public String findZhiFu(@RequestParam("userId") int id,@RequestParam("number") int goodsNum,@RequestParam("goodsPrice") double goodsPrice,@RequestParam("goodsId") int goodsId){
- userService.findZhiFu(id,goodsNum,goodsPrice,goodsId);
- return "redirect:findAll";
- }
-
- /**
- * 删除订单模块
- */
- @RequestMapping("/deleteOrder")
- public String deleteOrder(@RequestParam("userId") int userId,@RequestParam("goodsId") int goodsId){
- userService.deleteOrder(userId,goodsId);
- return "redirect:findUserAndGoodsById";
- }
-
- /**
- * 添加项目
- * @param goodsId
- * @param userId
- * @return
- */
- @RequestMapping("/addOrder")
- public String addOrder(@RequestParam("goodsId") int goodsId,@RequestParam("userId") int userId){
- userService.addOrder(goodsId,userId);
-
- return "redirect:findUserAndGoodsById";
- }
-
- }
pojo层
- package com.zretc.pojo;
-
- import lombok.Data;
-
- import java.util.List;
-
- /**
- * 实体类
- * 货品
- * 作者:
- */
- @Data
- public class Goods {
- //货品编号
- private Integer id;
- //货品名称
- private String goodsName;
- //货品数量
- private int goodsNum;
- //货品单价
- private double goodsPrice;
- //货品状态
- private int status;
- //每个产品有多少个人下订单
- private List<User> userList;
- }
- package com.zretc.pojo;
- import lombok.Data;
-
- import java.util.List;
- /**
- * 实体类
- * 职务
- * 作者:
- @Data
- public class Role {
- //职位编号
- private Integer id;
- //职位名称
- private String roleName;
- //职位描述
- private String roleDesc;
- //职位状态
- private String status;
- //这个职位有多少人
- private List<User> userList;
- }
- package com.zretc.pojo;
-
- import lombok.Data;
-
- @Data
- public class Temp {
- private int id;
- private String url;
- }
- package com.zretc.pojo;
-
- import lombok.Data;
-
- import java.util.List;
-
- @Data
- public class User {
- //用户编号
- private Integer id;
- //用户名
- private String username;
- //密码
- private String password;
- //账户余额
- private int accountBalance;
- //状态
- //是否删除
- private int status;
- //每个人有几个职位
- private List<Role> roleList;
- //每个人有几个订单
- private List<Goods> goodsList;
-
-
-
- }
service层
- package com.zretc.service;
-
- import com.zretc.pojo.Goods;
-
- import java.util.List;
-
- public interface GoodsService {
- /**
- * 查询所有货品
- * @return
- */
- List<Goods> findAll();
- /**
- * 查询所有货品分页显示
- * @return
- */
- List<Goods> findAll(int page,int size);
-
- /**
- * 根据id查询货品
- * @param goodsId
- * @return
- */
- Goods findGoodsById(int goodsId);
-
- /**
- * 根据id删除货品
- * @param goodsId
- */
- void deleteById(int goodsId);
-
- /**
- * 新增货品
- * @param goods
- */
- void save(Goods goods);
-
- /**
- * 修改商品
- * @param goods
- */
- void updateGoods(Goods goods);
- }
- package com.zretc.service;
-
- import com.zretc.pojo.Role;
- import com.zretc.pojo.Temp;
- import org.springframework.ui.ModelMap;
- import org.springframework.web.multipart.MultipartFile;
-
- import java.io.IOException;
- import java.util.List;
-
- public interface TempService {
- List<Temp> findAll(int id);
-
-
- }
- package com.zretc.service;
-
- import com.zretc.pojo.User;
- import org.apache.ibatis.annotations.Select;
-
- import java.util.List;
-
- public interface UserService {
- /**
- * 查询所有用户分页显示
- * @return
- */
- List<User> findAll(int page,int size);
- /**
- * 查询所有用户
- * @return
- */
- List<User> findAll();
-
- /**
- * 添加用户
- * @param user
- */
- void save(User user);
-
-
- /**
- * 修改用户
- */
- void updateUser(User user);
-
- /**
- * 根据id查询用户
- * @param userId
- * @return
- */
- User findUserById(int userId);
-
- /**
- * 根据id删除用户
- * @param userId
- */
- void deleteById(int userId);
-
- /**
- * 查询每个人拥有几个职位
- * @param userId
- * @return
- */
- User findUserAndRoleById(int userId);
-
- /**
- * 删除一个人拥有的职位
- * @param roleId
- */
- void deleteUserRoleById(int roleId,int userId);
-
- /**
- * 查询每个人有几个订单
- * @param userId
- * @return
- */
- List<User> findUserAndGoodsById(int userId);
-
- /**
- * 订单支付
- * @param id
- * @param goodsNum
- * @param goodsPrice
- */
- void findZhiFu(int id, int goodsNum, double goodsPrice,int goodsId);
-
- /**
- * 订单删除
- * @param userId
- * @param goodsId
- */
- void deleteOrder(int userId, int goodsId);
-
- /**
- * 订单添加
- * @param goodsId
- * @param userId
- */
- void addOrder(int goodsId, int userId);
- }
serviceImpl层
- package com.zretc.service.impl;
-
- import com.github.pagehelper.PageHelper;
- import com.zretc.mapper.GoodsMapper;
- import com.zretc.pojo.Goods;
- import com.zretc.service.GoodsService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
-
- import java.util.List;
-
- @Service
- public class GoodsServiceImpl implements GoodsService {
- @Autowired
- private GoodsMapper goodsMapper;
- /**
- * 查询所有货品
- * @return
- */
- @Override
- public List<Goods> findAll() {
- List<Goods> goodsList = goodsMapper.findAll();
- System.out.println(222222222);
- System.out.println(goodsList);
- return goodsList;
- }
- /**
- * 查询所有货品 分页显示
- * @return
- */
- @Override
- public List<Goods> findAll(int page, int size) {
- PageHelper.startPage(page,size);
- List<Goods> goodsList = goodsMapper.findAll();
- return goodsList;
- }
-
- /**
- * 根据id查询货品
- * @param goodsId
- * @return
- */
- @Override
- public Goods findGoodsById(int goodsId) {
- return goodsMapper.findGoodsById(goodsId);
- }
-
- /**
- * 根据id删除货品
- * @param goodsId
- */
- @Override
- public void deleteById(int goodsId) {
- goodsMapper.deleteById(goodsId);
- }
-
- /**
- * 新增
- * @param goods
- */
- @Override
- public void save(Goods goods) {
- goodsMapper.save(goods);
- }
-
- /**
- * 修改商品
- * @param goods
- */
- @Override
- public void updateGoods(Goods goods) {
- goodsMapper.updateGoods(goods);
- }
- }
- package com.zretc.service.impl;
-
- import com.github.pagehelper.PageHelper;
- import com.zretc.mapper.RoleMapper;
- import com.zretc.pojo.Role;
- import com.zretc.service.RoleService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
-
- import java.util.List;
-
- @Service
- public class RoleServiceImpl implements RoleService {
- @Autowired
- private RoleMapper roleMapper;
-
- /**
- * 查询所有职位
- * @return
- */
-
- @Override
- public List<Role> findAll() {
- List<Role> roleList= roleMapper.findAll();
- System.out.println("2222222222");
- System.out.println(roleList);
- return roleList;
- }
- /**
- * 通过分页查询所有职位
- */
- @Override
- public List<Role> findAll(int page, int size) {
- PageHelper.startPage(page,size);
- List<Role> roleList= roleMapper.findAll();
- return roleList;
- }
-
- /**
- * 根据id删除职位
- * @param userId
- */
- @Override
- public void deleteById(int userId) {
- roleMapper.deleteById(userId);
- }
-
- /**
- * 根据id查询职位
- * @param roleId
- * @return
- */
- @Override
- public Role findRoleById(int roleId) {
- return roleMapper.findRoleById(roleId);
- }
-
- /**
- * 新增职位
- * @param role
- */
- @Override
- public void save(Role role) {
- roleMapper.save(role);
- }
-
- /**
- * 修改职位
- * @param role
- */
- @Override
- public void updateRole(Role role) {
- roleMapper.updateRole(role);
- }
-
- /**
- * 添加给用户职位
- * @param roleId
- * @param userId
- */
- @Override
- public void addOrder(int roleId, int userId) {
- roleMapper.addOrder(roleId,userId);
- }
- }
- package com.zretc.service.impl;
-
- import com.github.pagehelper.PageHelper;
- import com.zretc.mapper.UserMapper;
- import com.zretc.pojo.Role;
- import com.zretc.pojo.User;
- import com.zretc.service.UserService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.jdbc.support.CustomSQLErrorCodesTranslation;
- import org.springframework.stereotype.Service;
-
- import java.util.ArrayList;
- import java.util.List;
-
- @Service
- public class UserServiceImpl implements UserService {
- @Autowired
- private UserMapper userMapper;
-
- /**
- * 查看所有用户分页显示
- * @param page
- * @param size
- * @return
- */
- @Override
- public List<User> findAll(int page,int size) {
- // 分页插件
- PageHelper.startPage(page,size);
- List<User> userList = userMapper.findAll();
-
- return userList ;
- }
- /**
- * 查看所有用户
- * @return
- */
- @Override
- public List<User> findAll() {
-
- List<User> userList = userMapper.findAll();
- System.out.println(userList);
- return userList ;
- }
-
- /**
- * 添加用户
- * @param user
- */
- @Override
- public void save(User user) {
- System.out.println(2222);
- System.out.println(user);
- userMapper.save(user);
- }
-
- /**
- * 修改用户
- */
-
- @Override
- public void updateUser(User user) {
- System.out.println(2222);
- System.out.println(user);
- userMapper.updataUser(user);
- }
- /**
- * 根据id查询
- */
- @Override
- public User findUserById(int userId) {
- return userMapper.findUserById(userId);
- }
- /**
- * 根据id删除用户
- */
- @Override
- public void deleteById(int userId) {
- userMapper.deleteBYId(userId);
- }
-
- /**
- * 查询每个人拥有几个zhiwie
- */
- @Override
- public User findUserAndRoleById(int userId) {
-
- User userAndRoleById = userMapper.findUserAndRoleById(userId);
- System.out.println("5555555555555555555555");
- System.out.println(userAndRoleById.getUsername());
- for (Role role : userAndRoleById.getRoleList()) {
- System.out.println(role);
- }
- return userAndRoleById;
- }
- /**
- * 删除一个人拥有的职位
- * @param roleId
- */
- @Override
- public void deleteUserRoleById(int roleId,int userId) {
- userMapper.deleteUserRoleById(roleId,userId);
- }
-
- /**
- * 查询每个人拥有的订单
- */
- @Override
- public List<User> findUserAndGoodsById(int userId) {
- System.out.println("service00000000000000000000000000");
- List<User> userList = new ArrayList<User>() ;
- List<Integer> byUserIdAll = userMapper.findByUserIdAll();
- for (Integer integer : byUserIdAll) {
- userId=integer;
- User userAndRoleById = userMapper.findUserAndGoodsById(userId);
- System.out.println(userAndRoleById);
- userList.add(userAndRoleById);
- }
- System.out.println(userList);
- return userList;
- }
-
- /**
- * 支付
- * @param id
- * @param goodsNum
- * @param goodsPrice
- */
- @Override
- public void findZhiFu(int id, int goodsNum, double goodsPrice,int goodsId) {
- double accountBalance = userMapper.findZhiFuById(id);
- System.out.println("支付模快serviceImpl");
- System.out.println(accountBalance);
- accountBalance = accountBalance-(goodsNum*goodsPrice);
- System.out.println(accountBalance);
- userMapper.findZhiFu(id,accountBalance);
- /**
- * 删除订单
- */
- userMapper.deleteOrder(id,goodsId);
- }
-
- /**
- * 订单删除
- * @param userId
- * @param goodsId
- */
- @Override
- public void deleteOrder(int userId, int goodsId) {
- userMapper.deleteOrder(userId,goodsId);
- }
-
- /**
- * 添加项目
- * @param goodsId
- * @param userId
- */
- @Override
- public void addOrder(int goodsId, int userId) {
- userMapper.addOrder(goodsId,userId);
- }
- }
mapper层
- package com.zretc.mapper;
-
- import com.zretc.pojo.Goods;
- import com.zretc.pojo.Role;
- import org.apache.ibatis.annotations.*;
- import org.springframework.stereotype.Repository;
-
- import java.util.List;
-
- @Repository
- public interface GoodsMapper {
- /**
- * 查询所有货品
- * @return
- */
- @Select("select * from goods where status=1")
- List<Goods> findAll() ;
-
- /**
- * 根据id查询货品
- * @param goodsId
- * @return
- */
- @Select("select * from goods where id=#{goodsId}")
- Goods findGoodsById(int goodsId);
-
- /**
- * 根据id删除货品
- * @param goodsId
- */
- @Update("update goods set status=0 where id=#{goodsId}")
- void deleteById(int goodsId);
- /**
- * 添加货品
- * @param goods
- */
- @Insert(" insert into goods values(#{id},#{goodsName},#{goodsNum},#{goodsPrice},1)")
- // insert into role values(#{id},#{roleName},#{roleDesc},1)
- void save(Goods goods);
-
- /**
- * 修改货品
- * @param goods
- */
- @Update("update goods set goodsName=#{goodsName},goodsNum=#{goodsNum},goodsPrice=#{goodsPrice},status=1 where id=#{id}")
- void updateGoods(Goods goods);
-
-
- /**
- * 根据用户id查询商品信息
- */
- @Select("select * from goods where id in(select goodsId from user_goods where userId=#{userId})")
- @Results({
- @Result(id = true, property = "id", column = "id"),
- @Result(property = "goodsName", column = "goodsName"),
- @Result(property = "goodsNum", column = "goodsNum"),
- @Result(property = "goodsPrice", column = "goodsPrice"),
- @Result(property = "status", column = "status"),
- })
- List<Goods> findGoodsByUserId(int id);
-
- }
- package com.zretc.mapper;
- import com.zretc.pojo.Role;
- import com.zretc.pojo.User;
- import org.apache.ibatis.annotations.*;
- import org.springframework.stereotype.Repository;
-
- import java.util.List;
- @Repository
- public interface RoleMapper {
- /**
- * 根据用户id查询角色信息
- */
- @Select("select * from role where id in(select roleId from user_role where userId=#{userId})")
- @Results({
- @Result(id = true, property = "id", column = "id"),
- @Result(property = "roleName", column = "roleName"),
- @Result(property = "roleDesc", column = "roleDesc"),
- })
- List<Role> findRoleByUserId(int id);
-
-
- /**
- * 查询所有职位
- * @return
- */
- @Select("select * from role where status=1")
- List<Role> findAll() ;
- /**
- * 根据id删除职位
- * @param roleId
- */
- @Update("update role set status=0 where id=#{roleId}")
- void deleteById(int roleId);
- /**
- * 根据id查询职位
- * @param roleId
- * @return
- */
- @Select("select * from role where id=#{roleId}")
- Role findRoleById(int roleId);
- /**
- * 新增职位
- * @param role
- */
- @Insert("insert into role values(#{id},#{roleName},#{roleDesc},1)")
- void save(Role role);
- /**
- * 修改职位
- * @param role
- */
- @Update("update role set roleName=#{roleName},roleDesc=#{roleDesc} where id=#{id}")
- void updateRole(Role role);
-
- /**
- * 给用户添加职位
- * @param roleId
- * @param userId
- */
- @Insert("INSERT INTO user_role VALUES (#{param2},#{param1})")
- void addOrder(int roleId, int userId);
- }
- package com.zretc.mapper;
-
- import com.zretc.pojo.User;
- import org.apache.ibatis.annotations.*;
- import org.springframework.stereotype.Repository;
-
- import java.util.List;
- @Repository
- public interface UserMapper {
- /**
- * 查询所有普通用户
- * @return
- */
- @Select("SELECT * FROM user where status=1")
- List<User> findAll() ;
-
- /**
- * 新增用户
- * @param user
- */
- @Insert("insert into user values(#{id},#{username},#{password},#{accountBalance},1)")
- void save(User user);
-
- /**
- * 修改用户
- * @param user
- */
- @Update("update user set username=#{username},password=#{password},accountBalance=#{accountBalance},status=1 where id=#{id}")
- void updataUser(User user);
-
- /**
- * 根据id查询
- * @param userId
- * @return
- */
- @Select("select * from user where id=#{userId}")
- User findUserById(int userId);
-
- /**
- * 根据id删除用户
- * @param userId
- */
- @Update("update user set status=0 where id=#{userId}")
- void deleteBYId(int userId);
-
- /**
- * 查询每个人有几个职位
- * @param userId
- * @return
- */
- @Select("select * from user where id=#{userId}")
- @Results({
- @Result(id = true ,property = "id",column = "id"),
- @Result(property = "username",column = "username"),
- @Result(property = "password",column = "password"),
- @Result(property = "password",column = "password"),
- @Result(property = "accountBalance",column = "accountBalance"),
- @Result(property = "status",column = "status"),
- @Result(property = "roleList", column = "id", javaType = List.class,
- many = @Many(select = "com.zretc.mapper.RoleMapper.findRoleByUserId")
- ),
- })
-
- User findUserAndRoleById(int userId);
-
- /**
- * 删除每个人的职位
- * @param roleId
- * @param userId
- */
- @Delete("delete from user_role where roleId=#{param1} and userId=#{param2} ")
- void deleteUserRoleById( int roleId,int userId);
-
-
-
- /**
- * 查询每个人有几个职位
- * @param userId
- * @return
- */
- @Select("select * from user where id=#{userId}")
- @Results({
- @Result(id = true ,property = "id",column = "id"),
- @Result(property = "username",column = "username"),
- @Result(property = "password",column = "password"),
- @Result(property = "password",column = "password"),
- @Result(property = "accountBalance",column = "accountBalance"),
- @Result(property = "status",column = "status"),
- @Result(property = "goodsList", column = "id", javaType = List.class,
- many = @Many(select = "com.zretc.mapper.GoodsMapper.findGoodsByUserId")
- ),
- })
-
- User findUserAndGoodsById(int userId);
-
-
-
- /**
- * 查询订单的所有userId
- * @return
- */
- @Select("select userId from user_goods")
- List<Integer> findByUserIdAll();
-
- /**
- * 支付功能
- * 支付订单,每个人的账户金额减少响应的数量
- * @param id
- * @param accountBalance
- */
- @Update("update user set accountBalance=#{param2} where id=#{param1}")
- void findZhiFu(int id, double accountBalance);
- /**
- * 获取支付的账户余额
- */
- @Select("select accountBalance from user where id=#{param1}")
- double findZhiFuById(int id);
-
- /**
- * 删除订单
- * @param id
- * @param goodsId
- */
- @Delete("DELETE from user_goods where userId=#{param1} and goodsId=#{param2}")
- void deleteOrder(int id, int goodsId);
-
- /**
- * 添加订单
- * @param goodsId
- * @param userId
- */
- @Insert("INSERT INTO user_goods VALUES (#{param2},#{param1})")
- void addOrder(int goodsId, int userId);
- }
源代码已经上传。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。