parent
fc21d6b579
commit
c8fc88b242
@ -0,0 +1,18 @@
|
||||
package com.ssm.controller;
|
||||
|
||||
import com.ssm.entity.Equip;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("equipment")
|
||||
public class EquipController {
|
||||
|
||||
//对象方式接收设备信息
|
||||
@RequestMapping("add")
|
||||
public String test(Equip equipment){
|
||||
System.out.println("设备信息:"+equipment.toString());
|
||||
return "showEquipment";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
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() {
|
||||
System.out.println("1111");
|
||||
return "showFirst";
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.ssm.entity;
|
||||
|
||||
// 设备类型表的实体类
|
||||
public class Cate {
|
||||
private String cateid; // 设备类型id
|
||||
private String catename; // 类型名称
|
||||
private String addtime; // 创建日期
|
||||
private String memo; // 备注
|
||||
|
||||
public String getCateid() {
|
||||
return cateid;
|
||||
}
|
||||
|
||||
public void setCateid(String cateid) {
|
||||
this.cateid = cateid;
|
||||
}
|
||||
|
||||
public String getCatename() {
|
||||
return catename;
|
||||
}
|
||||
|
||||
public void setCatename(String catename) {
|
||||
this.catename = catename;
|
||||
}
|
||||
|
||||
public String getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(String addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public String getMemo() {
|
||||
return memo;
|
||||
}
|
||||
|
||||
public void setMemo(String memo) {
|
||||
this.memo = memo;
|
||||
}
|
||||
|
||||
public void printMessage(){
|
||||
System.out.println("this is Category");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package com.ssm.entity;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
// 设备表的实体类
|
||||
public class Equip {
|
||||
private String equipid; // 设备id
|
||||
private String eno; // 设备号
|
||||
private String equipname; // 设备名称
|
||||
private String useinfo; // 设备作用
|
||||
private String productor; // 生产厂商
|
||||
private String price; // 采购金额
|
||||
@DateTimeFormat(pattern = "yyyy-mm-dd")
|
||||
private Date buydate; // 采购日期
|
||||
private String manager; // 负责人
|
||||
private String memo; // 备注
|
||||
private Cate cate;// 多对一映射类
|
||||
private Labx labx;// 多对一映射类
|
||||
|
||||
public String getEquipid() {
|
||||
return equipid;
|
||||
}
|
||||
|
||||
public void setEquipid(String equipid) {
|
||||
this.equipid = equipid;
|
||||
}
|
||||
|
||||
public String getEno() {
|
||||
return eno;
|
||||
}
|
||||
|
||||
public void setEno(String eno) {
|
||||
this.eno = eno;
|
||||
}
|
||||
|
||||
public String getEquipname() {
|
||||
return equipname;
|
||||
}
|
||||
|
||||
public void setEquipname(String equipname) {
|
||||
this.equipname = equipname;
|
||||
}
|
||||
|
||||
public String getUseinfo() {
|
||||
return useinfo;
|
||||
}
|
||||
|
||||
public void setUseinfo(String useinfo) {
|
||||
this.useinfo = useinfo;
|
||||
}
|
||||
|
||||
public String getProductor() {
|
||||
return productor;
|
||||
}
|
||||
|
||||
public void setProductor(String productor) {
|
||||
this.productor = productor;
|
||||
}
|
||||
|
||||
public String getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(String price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Date getBuydate() {
|
||||
return buydate;
|
||||
}
|
||||
|
||||
public void setBuydate(Date buydate) {
|
||||
this.buydate = buydate;
|
||||
}
|
||||
|
||||
public String getManager() {
|
||||
return manager;
|
||||
}
|
||||
|
||||
public void setManager(String manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
public String getMemo() {
|
||||
return memo;
|
||||
}
|
||||
|
||||
public void setMemo(String memo) {
|
||||
this.memo = memo;
|
||||
}
|
||||
|
||||
public Cate getCate() {
|
||||
return cate;
|
||||
}
|
||||
|
||||
public void setCate(Cate cate) {
|
||||
this.cate = cate;
|
||||
}
|
||||
|
||||
public Labx getLabx() {
|
||||
return labx;
|
||||
}
|
||||
|
||||
public void setLabx(Labx labx) {
|
||||
this.labx = labx;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Equipment{" +
|
||||
"equipid=" + equipid +
|
||||
", equipname='" + equipname + '\'' +
|
||||
", eno=" + eno +
|
||||
", productor=" + productor +
|
||||
", price='" + price + '\'' +
|
||||
", buydate='" + buydate + '\'' +
|
||||
", manager=" + manager +
|
||||
", useinfo=" + useinfo +
|
||||
// 输出设备分类名称
|
||||
", categoryName=" + cate.getCatename() +
|
||||
// 输出设备所在实验室名称
|
||||
", categoryName=" + labx.getLabxname() +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.ssm.entity;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
// 实验室表的实体类
|
||||
public class Labx {
|
||||
private String labxid; // 实验室id
|
||||
private String labxname; // 实验室名称
|
||||
private String manager; // 负责人
|
||||
private String contact; // 联系方式
|
||||
private String address; // 实验室地址
|
||||
@DateTimeFormat(pattern = "yyyy-mm-dd")
|
||||
private Date addtime; // 创建日期
|
||||
private String memo; // 备注
|
||||
|
||||
|
||||
|
||||
public String getLabxid() {
|
||||
return labxid;
|
||||
}
|
||||
|
||||
public void setLabxid(String labxid) {
|
||||
this.labxid = labxid;
|
||||
}
|
||||
|
||||
public String getLabxname() {
|
||||
return labxname;
|
||||
}
|
||||
|
||||
public void setLabxname(String labxname) {
|
||||
this.labxname = labxname;
|
||||
}
|
||||
|
||||
public String getManager() {
|
||||
return manager;
|
||||
}
|
||||
|
||||
public void setManager(String manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
public String getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(String contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public Date getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(Date addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public String getMemo() {
|
||||
return memo;
|
||||
}
|
||||
|
||||
public void setMemo(String memo) {
|
||||
this.memo = memo;
|
||||
}
|
||||
|
||||
public void printMessage(){
|
||||
System.out.println("this is Laboratory");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,15 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>展示Controller接收及响应数据</title>
|
||||
</head>
|
||||
<body>
|
||||
Success!
|
||||
<br>
|
||||
设备信息已在控制台输出!
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,12 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>展示入门程序信息</title>
|
||||
</head>
|
||||
<body>
|
||||
Success!
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,22 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>展示实验室信息</title>
|
||||
</head>
|
||||
<body>
|
||||
Success!
|
||||
<br>
|
||||
实验室编号:${laboratoryInfo.labxid}
|
||||
<br>
|
||||
实验室名称:${laboratoryInfo.labxname}
|
||||
<br>
|
||||
负责人:${laboratoryInfo.manager}
|
||||
<br>
|
||||
联系方式:${laboratoryInfo.contact}
|
||||
<br>
|
||||
地址:${laboratoryInfo.address}
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,67 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>添加设备</title>
|
||||
</head>
|
||||
<body>
|
||||
<form action="equipment/add" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td>设备号:</td>
|
||||
<td width="20"></td>
|
||||
<td><input type="text" name="eno" placeholder="请输入设备号" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>设备名称:</td>
|
||||
<td width="20"></td>
|
||||
<td><input type="text" name="equipname" placeholder="请输入设备名称" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>设备分类:</td>
|
||||
<td width="20"></td>
|
||||
<td><input type="text" name="cate.catename" placeholder="请输入设备分类" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>所属实验室:</td>
|
||||
<td width="20"></td>
|
||||
<td><input type="text" name="labx.labxname" placeholder="请输入所属实验室" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>设备作用:</td>
|
||||
<td width="20"></td>
|
||||
<td><input type="text" name="useinfo" placeholder="请输入设备作用" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>生产厂商:</td>
|
||||
<td width="20"></td>
|
||||
<td><input type="text" name="productor" placeholder="请输入生产厂商" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>采购金额:</td>
|
||||
<td width="20"></td>
|
||||
<td><input type="text" name="price" class="bg" placeholder="请输入采购金额" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>采购日期:</td>
|
||||
<td width="20"></td>
|
||||
<td><input type="text" name="buydate" placeholder="请输入采购日期" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>负责人:</td>
|
||||
<td width="20"></td>
|
||||
<td><input type="text" name="manager" placeholder="请输入负责人" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><input type="reset" value="重置"></td>
|
||||
<td></td>
|
||||
<td align="center">
|
||||
<input type="submit" value="添加">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,25 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>添加实验室信息</title>
|
||||
</head>
|
||||
<body>
|
||||
<form action="laboratory/add" method="post">
|
||||
实验室编号:<input type="text" name="labxid">
|
||||
<br>
|
||||
实验室名称:<input type="text" name="labxname">
|
||||
<br>
|
||||
负责人:<input type="text" name="manager">
|
||||
<br>
|
||||
联系方式:<input type="text" name="contact">
|
||||
<br>
|
||||
地址:<input type="text" name="address">
|
||||
<br>
|
||||
<input type="submit" value="添加">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,12 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>入门程序</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="hello">hello world</a>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue