parent
1dc7fe4fab
commit
66ccd780ea
@ -0,0 +1,12 @@
|
||||
package com.ssm.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
public class FirstController {
|
||||
@RequestMapping("hello")
|
||||
public String hello(){
|
||||
return "showFirst";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.ssm.controller;
|
||||
|
||||
import com.ssm.entity.Lab;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/lab")
|
||||
public class LabController {
|
||||
|
||||
@RequestMapping("/add")
|
||||
public String addLab(Lab lab) {
|
||||
System.out.println("实验室信息:" + lab.toString());
|
||||
return "showLab";
|
||||
}
|
||||
|
||||
@RequestMapping("/newadd")
|
||||
public String newAddLab(Lab lab, Model model) {
|
||||
System.out.println("实验室信息:" + lab.toString());
|
||||
model.addAttribute("lab", lab);
|
||||
return "showLab";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.ssm.controller;
|
||||
|
||||
import com.ssm.entity.Material;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//标记
|
||||
@Controller
|
||||
//请求地址与方法
|
||||
@RequestMapping("/material")
|
||||
public class MaterialController {
|
||||
|
||||
@RequestMapping("/add")
|
||||
public String addMaterial(Material material) {
|
||||
System.out.println("材料信息:" + material.toString());
|
||||
return "showMaterial";
|
||||
}
|
||||
|
||||
@RequestMapping("/newadd")
|
||||
public String newAddMaterial(Material material, Model model) {
|
||||
System.out.println("材料信息:" + material.toString());
|
||||
model.addAttribute("material", material);
|
||||
return "showMaterial";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.ssm.controller;
|
||||
|
||||
import com.ssm.entity.MaterialStock;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/stock")
|
||||
public class MaterialStockController {
|
||||
|
||||
@RequestMapping("/add")
|
||||
public String addStock(MaterialStock stock) {
|
||||
System.out.println("材料出入库信息:" + stock.toString());
|
||||
return "showMaterialStock";
|
||||
}
|
||||
|
||||
@RequestMapping("/newadd")
|
||||
public String newAddStock(MaterialStock stock, Model model) {
|
||||
System.out.println("材料出入库信息:" + stock.toString());
|
||||
model.addAttribute("stock", stock);
|
||||
return "showMaterialStock";
|
||||
}
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
package com.ssm.controller;
|
||||
|
||||
import com.ssm.entity.Product;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/product")
|
||||
public class ProductController {
|
||||
|
||||
|
||||
@RequestMapping("/add")
|
||||
public String add(Product product){
|
||||
System.out.println("商品信息:" + product.toString());
|
||||
return "showProduct";
|
||||
}
|
||||
|
||||
@RequestMapping("/newadd")
|
||||
public ModelAndView newadd(Product product){
|
||||
|
||||
ModelAndView mv = new ModelAndView("showProduct");
|
||||
|
||||
mv.addObject("productInfo", product);
|
||||
|
||||
return mv;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.ssm.controller;
|
||||
|
||||
import com.ssm.entity.Reservation;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/reservation")
|
||||
public class ReservationController {
|
||||
|
||||
@RequestMapping("/add")
|
||||
public String addReservation(Reservation reservation) {
|
||||
System.out.println("预约信息:" + reservation.toString());
|
||||
return "showReservation";
|
||||
}
|
||||
|
||||
@RequestMapping("/newadd")
|
||||
public String newAddReservation(Reservation reservation, Model model) {
|
||||
System.out.println("预约信息:" + reservation.toString());
|
||||
model.addAttribute("reservation", reservation);
|
||||
return "showReservation";
|
||||
}
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package com.ssm.entity;
|
||||
|
||||
public class Category {
|
||||
private String cname; // 分类名称
|
||||
|
||||
public String getCname() {
|
||||
return cname;
|
||||
}
|
||||
|
||||
public void setCname(String cname) {
|
||||
this.cname = cname;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Category{" +
|
||||
"cname='" + cname + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.ssm.entity;
|
||||
|
||||
public class Lab {
|
||||
private Integer labId; // 实验室编号
|
||||
private String labName; // 实验室名称
|
||||
private String location; // 位置
|
||||
private Integer capacity; // 容纳人数
|
||||
private String status; // 状态(可用/维修中/停用)
|
||||
private String manager; // 管理员
|
||||
|
||||
// 无参构造
|
||||
public Lab() {}
|
||||
|
||||
// Getter/Setter
|
||||
public Integer getLabId() { return labId; }
|
||||
public void setLabId(Integer labId) { this.labId = labId; }
|
||||
public String getLabName() { return labName; }
|
||||
public void setLabName(String labName) { this.labName = labName; }
|
||||
public String getLocation() { return location; }
|
||||
public void setLocation(String location) { this.location = location; }
|
||||
public Integer getCapacity() { return capacity; }
|
||||
public void setCapacity(Integer capacity) { this.capacity = capacity; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public String getManager() { return manager; }
|
||||
public void setManager(String manager) { this.manager = manager; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Lab{" +
|
||||
"labId=" + labId +
|
||||
", labName='" + labName + '\'' +
|
||||
", location='" + location + '\'' +
|
||||
", capacity=" + capacity +
|
||||
", status='" + status + '\'' +
|
||||
", manager='" + manager + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.ssm.entity;
|
||||
|
||||
public class Material {
|
||||
private Integer mid; // 材料编号
|
||||
private String mname; // 材料名称
|
||||
private String spec; // 规格型号
|
||||
private Integer stockNum; // 库存数量
|
||||
private String unit; // 单位
|
||||
private Double price; // 单价
|
||||
private String supplier; // 供应商
|
||||
|
||||
// 无参构造
|
||||
public Material() {}
|
||||
|
||||
// Getter/Setter
|
||||
public Integer getMid() { return mid; }
|
||||
public void setMid(Integer mid) { this.mid = mid; }
|
||||
public String getMname() { return mname; }
|
||||
public void setMname(String mname) { this.mname = mname; }
|
||||
public String getSpec() { return spec; }
|
||||
public void setSpec(String spec) { this.spec = spec; }
|
||||
public Integer getStockNum() { return stockNum; }
|
||||
public void setStockNum(Integer stockNum) { this.stockNum = stockNum; }
|
||||
public String getUnit() { return unit; }
|
||||
public void setUnit(String unit) { this.unit = unit; }
|
||||
public Double getPrice() { return price; }
|
||||
public void setPrice(Double price) { this.price = price; }
|
||||
public String getSupplier() { return supplier; }
|
||||
public void setSupplier(String supplier) { this.supplier = supplier; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Material{" +
|
||||
"mid=" + mid +
|
||||
", mname='" + mname + '\'' +
|
||||
", spec='" + spec + '\'' +
|
||||
", stockNum=" + stockNum +
|
||||
", unit='" + unit + '\'' +
|
||||
", price=" + price +
|
||||
", supplier='" + supplier + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.ssm.entity;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class Reservation {
|
||||
private Integer rid; // 预约编号
|
||||
private Integer uid; // 用户编号
|
||||
private Integer labId; // 实验室编号
|
||||
|
||||
// 关键:加上日期格式注解,匹配表单提交的 yyyy-MM-dd 格式
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startDate; // 预约开始时间
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endDate; // 预约结束时间
|
||||
|
||||
private String status; // 状态(待审核/已通过/已拒绝)
|
||||
|
||||
// 无参构造
|
||||
public Reservation() {}
|
||||
|
||||
// Getter/Setter
|
||||
public Integer getRid() { return rid; }
|
||||
public void setRid(Integer rid) { this.rid = rid; }
|
||||
public Integer getUid() { return uid; }
|
||||
public void setUid(Integer uid) { this.uid = uid; }
|
||||
public Integer getLabId() { return labId; }
|
||||
public void setLabId(Integer labId) { this.labId = labId; }
|
||||
public Date getStartDate() { return startDate; }
|
||||
public void setStartDate(Date startDate) { this.startDate = startDate; }
|
||||
public Date getEndDate() { return endDate; }
|
||||
public void setEndDate(Date endDate) { this.endDate = endDate; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Reservation{" +
|
||||
"rid=" + rid +
|
||||
", uid=" + uid +
|
||||
", labId=" + labId +
|
||||
", startDate=" + startDate +
|
||||
", endDate=" + endDate +
|
||||
", status='" + status + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.ssm.entity;
|
||||
|
||||
public class User {
|
||||
private Integer uid; // 用户编号
|
||||
private String username; // 用户名
|
||||
private String password; // 密码
|
||||
private String realName; // 真实姓名
|
||||
private String phone; // 手机号
|
||||
private String role; // 角色(管理员/普通用户)
|
||||
|
||||
// 无参构造
|
||||
public User() {}
|
||||
|
||||
// Getter/Setter
|
||||
public Integer getUid() { return uid; }
|
||||
public void setUid(Integer uid) { this.uid = uid; }
|
||||
public String getUsername() { return username; }
|
||||
public void setUsername(String username) { this.username = username; }
|
||||
public String getPassword() { return password; }
|
||||
public void setPassword(String password) { this.password = password; }
|
||||
public String getRealName() { return realName; }
|
||||
public void setRealName(String realName) { this.realName = realName; }
|
||||
public String getPhone() { return phone; }
|
||||
public void setPhone(String phone) { this.phone = phone; }
|
||||
public String getRole() { return role; }
|
||||
public void setRole(String role) { this.role = role; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "User{" +
|
||||
"uid=" + uid +
|
||||
", username='" + username + '\'' +
|
||||
", password='" + password + '\'' +
|
||||
", realName='" + realName + '\'' +
|
||||
", phone='" + phone + '\'' +
|
||||
", role='" + role + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@ -0,0 +1,16 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: AA7
|
||||
Date: 2026/4/23
|
||||
Time: 14:21
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>入门程序</title>
|
||||
</head>
|
||||
<body>
|
||||
success!
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,16 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>操作成功</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Success!</h2>
|
||||
<p>实验室编号:${lab.labId}</p>
|
||||
<p>实验室名称:${lab.labName}</p>
|
||||
<p>位置:${lab.location}</p>
|
||||
<p>容纳人数:${lab.capacity}</p>
|
||||
<p>状态:${lab.status}</p>
|
||||
<p>管理员:${lab.manager}</p>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,17 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>操作成功</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Success!</h2>
|
||||
<p>材料编号:${material.mid}</p>
|
||||
<p>材料名称:${material.mname}</p>
|
||||
<p>规格型号:${material.spec}</p>
|
||||
<p>库存数量:${material.stockNum}</p>
|
||||
<p>单位:${material.unit}</p>
|
||||
<p>单价:${material.price}</p>
|
||||
<p>供应商:${material.supplier}</p>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,16 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>操作成功</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Success!</h2>
|
||||
<p>记录编号:${stock.stockId}</p>
|
||||
<p>材料编号:${stock.mid}</p>
|
||||
<p>操作类型:${stock.type}</p>
|
||||
<p>数量:${stock.num}</p>
|
||||
<p>操作日期:${stock.opDate}</p>
|
||||
<p>操作人:${stock.operator}</p>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,19 +0,0 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>结果页面</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Success!</h1>
|
||||
|
||||
<p>商品名称:${productInfo.pname}</p>
|
||||
<p>是否热门:${productInfo.isHot}</p>
|
||||
<p>市场价格:${productInfo.marketPrice}</p>
|
||||
<p>销售价格:${productInfo.shopPrice}</p>
|
||||
<p>商品图片:${productInfo.image}</p>
|
||||
<p>分类名称:${productInfo.category.cname}</p>
|
||||
<p>商品描述:${productInfo.pdesc}</p>
|
||||
<p>上架日期:${productInfo.pdate}</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,16 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>操作成功</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Success!</h2>
|
||||
<p>预约编号:${reservation.rid}</p>
|
||||
<p>用户编号:${reservation.uid}</p>
|
||||
<p>实验室编号:${reservation.labId}</p>
|
||||
<p>开始日期:${reservation.startDate}</p>
|
||||
<p>结束日期:${reservation.endDate}</p>
|
||||
<p>状态:${reservation.status}</p>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,15 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>操作成功</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Success!</h2>
|
||||
<p>用户编号:${user.uid}</p>
|
||||
<p>用户名:${user.username}</p>
|
||||
<p>真实姓名:${user.realName}</p>
|
||||
<p>手机号:${user.phone}</p>
|
||||
<p>角色:${user.role}</p>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,25 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>实验室管理</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>实验室信息</h3>
|
||||
<form action="${pageContext.request.contextPath}/lab/newadd" method="post">
|
||||
实验室编号:<input type="text" name="labId"><br><br>
|
||||
实验室名称:<input type="text" name="labName"><br><br>
|
||||
位置:<input type="text" name="location"><br><br>
|
||||
容纳人数:<input type="text" name="capacity"><br><br>
|
||||
状态:
|
||||
<select name="status">
|
||||
<option value="可用">可用</option>
|
||||
<option value="维修中">维修中</option>
|
||||
<option value="停用">停用</option>
|
||||
</select><br><br>
|
||||
管理员:<input type="text" name="manager"><br><br>
|
||||
<input type="submit" value="添加">
|
||||
<input type="reset" value="重置">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,21 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>添加材料</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>材料信息</h3>
|
||||
<form action="${pageContext.request.contextPath}/material/newadd" method="post">
|
||||
材料编号:<input type="text" name="mid"><br><br>
|
||||
材料名称:<input type="text" name="mname"><br><br>
|
||||
规格型号:<input type="text" name="spec"><br><br>
|
||||
库存数量:<input type="text" name="stockNum"><br><br>
|
||||
单位:<input type="text" name="unit"><br><br>
|
||||
单价:<input type="text" name="price"><br><br>
|
||||
供应商:<input type="text" name="supplier"><br><br>
|
||||
<input type="submit" value="添加">
|
||||
<input type="reset" value="重置">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,24 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>材料出入库</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>材料出入库记录</h3>
|
||||
<form action="${pageContext.request.contextPath}/stock/newadd" method="post">
|
||||
记录编号:<input type="text" name="stockId"><br><br>
|
||||
材料编号:<input type="text" name="mid"><br><br>
|
||||
操作类型:
|
||||
<select name="type">
|
||||
<option value="入库">入库</option>
|
||||
<option value="出库">出库</option>
|
||||
</select><br><br>
|
||||
数量:<input type="text" name="num"><br><br>
|
||||
操作日期:<input type="date" name="opDate"><br><br>
|
||||
操作人:<input type="text" name="operator"><br><br>
|
||||
<input type="submit" value="提交">
|
||||
<input type="reset" value="重置">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,25 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>预约管理</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>预约信息</h3>
|
||||
<form action="${pageContext.request.contextPath}/reservation/newadd" method="post">
|
||||
预约编号:<input type="text" name="rid"><br><br>
|
||||
用户编号:<input type="text" name="uid"><br><br>
|
||||
实验室编号:<input type="text" name="labId"><br><br>
|
||||
开始日期:<input type="date" name="startDate"><br><br>
|
||||
结束日期:<input type="date" name="endDate"><br><br>
|
||||
状态:
|
||||
<select name="status">
|
||||
<option value="待审核">待审核</option>
|
||||
<option value="已通过">已通过</option>
|
||||
<option value="已拒绝">已拒绝</option>
|
||||
</select><br><br>
|
||||
<input type="submit" value="提交">
|
||||
<input type="reset" value="重置">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,24 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>添加用户</title>
|
||||
</head>
|
||||
<body>
|
||||
<h3>添加用户信息</h3>
|
||||
<form action="${pageContext.request.contextPath}/user/newadd" method="post">
|
||||
用户编号:<input type="text" name="uid"><br><br>
|
||||
用户名:<input type="text" name="username"><br><br>
|
||||
密码:<input type="password" name="password"><br><br>
|
||||
真实姓名:<input type="text" name="realName"><br><br>
|
||||
手机号:<input type="text" name="phone"><br><br>
|
||||
角色:
|
||||
<select name="role">
|
||||
<option value="管理员">管理员</option>
|
||||
<option value="普通用户">普通用户</option>
|
||||
</select><br><br>
|
||||
<input type="submit" value="添加">
|
||||
<input type="reset" value="重置">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in new issue