parent
56b93eedb3
commit
b3bf00464a
@ -1,18 +0,0 @@
|
||||
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";
|
||||
}
|
||||
|
||||
}
|
@ -1,128 +0,0 @@
|
||||
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() +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
<%@ 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>
|
@ -1,67 +0,0 @@
|
||||
<%@ 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>
|
Loading…
Reference in new issue