Commit fcc6b770 by shj

修改会议结构,会议、咨询费的预算、规则的CURD完成

parent 7408e8a0
CREATE TABLE budgetmanagementsystem.conference
(
id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
name varchar(100) COMMENT '名称(会议内容)',
price double COMMENT '会议标准费用',
comment text,
experts int(11) COMMENT '需要专家人数'
);
INSERT INTO budgetmanagementsystem.conference (id, name, price, comment, experts) VALUES (1, '项目启动会', 200, null, 3);
INSERT INTO budgetmanagementsystem.conference (id, name, price, comment, experts) VALUES (2, '中期', 200, null, 3);
INSERT INTO budgetmanagementsystem.conference (id, name, price, comment, experts) VALUES (3, '预验收', 200, null, 3);
INSERT INTO budgetmanagementsystem.conference (id, name, price, comment, experts) VALUES (4, '验收', 200, null, 2);
INSERT INTO budgetmanagementsystem.conference (id, name, price, comment, experts) VALUES (5, '学术会议', 5000, null, 3);
CREATE TABLE budgetmanagementsystem.consultation
(
id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
name varchar(100) COMMENT '专家信息(职称等)',
price double COMMENT '咨询费',
comment text
);
INSERT INTO budgetmanagementsystem.consultation (id, name, price, comment) VALUES (1, '专家', 1000, null);
CREATE TABLE budgetmanagementsystem.equipment
(
id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
name varchar(100) COMMENT '型号规格',
price double,
type varchar(50) COMMENT '子类别',
img varchar(100) COMMENT '图片url',
comment text COMMENT '备注'
);
INSERT INTO budgetmanagementsystem.equipment (id, name, price, type, img, comment) VALUES (1, '戴尔Precision T5820(Xeon W-2123/64GB/512GB+4TB/P2000)', 23700, null, null, null);
INSERT INTO budgetmanagementsystem.equipment (id, name, price, type, img, comment) VALUES (2, 'UltraLAB P490(14664-MAX)', 60000, null, null, null);
INSERT INTO budgetmanagementsystem.equipment (id, name, price, type, img, comment) VALUES (3, 'Wiseteam CP265 C33128-SAEK12', 149900, null, null, null);
INSERT INTO budgetmanagementsystem.equipment (id, name, price, type, img, comment) VALUES (4, '凌炫Pt8040(E221T-ECEP6)', 499900, null, null, null);
INSERT INTO budgetmanagementsystem.equipment (id, name, price, type, img, comment) VALUES (5, '惠普战99(4RV70PA)', 7999, null, null, null);
INSERT INTO budgetmanagementsystem.equipment (id, name, price, type, img, comment) VALUES (6, '联想ThinkStation P900(Xeon E5-2630 v3/512GB/K2200)', 41300, null, null, null);
INSERT INTO budgetmanagementsystem.equipment (id, name, price, type, img, comment) VALUES (7, '戴尔Precision T7920塔式系列(P7920T-S4110NLCN01)', 24300, null, null, null);
INSERT INTO budgetmanagementsystem.equipment (id, name, price, type, img, comment) VALUES (8, 'UltraLAB Alpha720(425256-SB28TD)', 275000, null, null, null);
INSERT INTO budgetmanagementsystem.equipment (id, name, price, type, img, comment) VALUES (9, 'UltraLAB H490(14664-M5TCX)', 47000, null, null, null);
INSERT INTO budgetmanagementsystem.equipment (id, name, price, type, img, comment) VALUES (10, 'UltraLAB EX620(23496-M528TC)', 140000, null, null, null);
INSERT INTO budgetmanagementsystem.equipment (id, name, price, type, img, comment) VALUES (11, '戴尔Precision 7530系列(Promo-M7530I78750-Online1)', 18600, null, null, null);
CREATE TABLE budgetmanagementsystem.internationalcommunication
(
id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
name varchar(100),
price double,
comment text
);
INSERT INTO budgetmanagementsystem.internationalcommunication (id, name, price, comment) VALUES (1, '澳大利亚', 39000, null);
INSERT INTO budgetmanagementsystem.internationalcommunication (id, name, price, comment) VALUES (2, '北卡莱罗纳', 21000, null);
CREATE TABLE budgetmanagementsystem.labour
(
id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
name varchar(100) COMMENT '名目(本硕博专)',
price double COMMENT '单价(人月)',
priority int(11) COMMENT '优先级',
comment text
);
INSERT INTO budgetmanagementsystem.labour (id, name, price, priority, comment) VALUES (1, '博士生', 2000, 2, null);
INSERT INTO budgetmanagementsystem.labour (id, name, price, priority, comment) VALUES (2, '硕士生', 1000, 3, null);
INSERT INTO budgetmanagementsystem.labour (id, name, price, priority, comment) VALUES (3, '专职', 11536, 1, null);
CREATE TABLE budgetmanagementsystem.material
(
id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
name varchar(100) COMMENT '名称/规格',
price double COMMENT '单价',
type varchar(50) COMMENT '类型',
img varchar(100) COMMENT '图片链接',
comment text COMMENT '备注'
);
INSERT INTO budgetmanagementsystem.material (id, name, price, type, img, comment) VALUES (1, '硬盘', 2000, null, null, null);
INSERT INTO budgetmanagementsystem.material (id, name, price, type, img, comment) VALUES (2, '加密移动硬盘', 3000, null, null, null);
CREATE TABLE budgetmanagementsystem.power
(
id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
name varchar(100),
price double,
comment text
);
CREATE TABLE budgetmanagementsystem.property
(
id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
name varchar(100) COMMENT '名称名目',
price double,
comment text
);
INSERT INTO budgetmanagementsystem.property (id, name, price, comment) VALUES (1, '著作权', 2000, null);
INSERT INTO budgetmanagementsystem.property (id, name, price, comment) VALUES (2, '知识产权', 5000, null);
INSERT INTO budgetmanagementsystem.property (id, name, price, comment) VALUES (3, '广西省电子地图数据', 10000, null);
INSERT INTO budgetmanagementsystem.property (id, name, price, comment) VALUES (4, '广西省货车 UGC 数据', 10000, null);
INSERT INTO budgetmanagementsystem.property (id, name, price, comment) VALUES (5, '广西省物流 UGC 数据', 10000, null);
INSERT INTO budgetmanagementsystem.property (id, name, price, comment) VALUES (6, '论文发表费', 4000, null);
INSERT INTO budgetmanagementsystem.property (id, name, price, comment) VALUES (7, '广西省交通流量视频数据', 10000, null);
CREATE TABLE budgetmanagementsystem.testandprocess
(
id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
name varchar(100) COMMENT '名称、内容',
price double COMMENT '单价',
comment text COMMENT '备注'
);
INSERT INTO budgetmanagementsystem.testandprocess (id, name, price, comment) VALUES (1, '测试化验加工费', 150000, null);
CREATE TABLE budgetmanagementsystem.travel
(
id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
dest varchar(50) COMMENT '目的地',
price double COMMENT '往返价格',
food double COMMENT '伙食标准',
traffic double COMMENT '交通标准',
accommodation double COMMENT '住宿标准',
comment text COMMENT '备注'
);
INSERT INTO budgetmanagementsystem.travel (id, dest, price, food, traffic, accommodation, comment) VALUES (1, '上海', 2000, 100, 80, 500, null);
INSERT INTO budgetmanagementsystem.travel (id, dest, price, food, traffic, accommodation, comment) VALUES (2, '南宁', 2000, 100, 80, 350, null);
INSERT INTO budgetmanagementsystem.travel (id, dest, price, food, traffic, accommodation, comment) VALUES (3, '桂林', 2000, 100, 80, 350, null);
INSERT INTO budgetmanagementsystem.travel (id, dest, price, food, traffic, accommodation, comment) VALUES (4, '北海', 2000, 100, 80, 350, null);
CREATE TABLE budgetmanagementsystem.workstation
(
id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
spec varchar(100) COMMENT '型号规格',
price double COMMENT '单价(万)',
img varchar(100) COMMENT '图片url'
);
CREATE UNIQUE INDEX workstation_spec_uindex ON budgetmanagementsystem.workstation (spec);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (35, '戴尔Precision T5820(Xeon W-2123/64GB/512GB+4TB/P2000)', 23700, null);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (36, 'UltraLAB P490(14664-MAX)', 60000, null);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (37, 'HP Z4 G4(1JP11AV-SC001)', 17000, null);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (38, 'Wiseteam CP265 C33128-SAEK12', 149900, null);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (39, '凌炫Pt8040(E221T-ECEP6)', 499900, null);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (40, '联想ThinkStation P520c(Xeon W-2123/16GB/256GB+1TB/P2000)', 14400, null);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (41, '戴尔Precision T7920塔式系列(P7920T-S4110NLCN01)', 24300, null);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (42, 'UltraLAB Alpha720(425256-SB28TD)', 275000, null);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (43, 'UltraLAB H490(14664-M5TCX)', 47000, null);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (44, 'UltraLAB EX620(23496-M528TC)', 140000, null);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (45, '戴尔Precision 7530系列(Promo-M7530I78750-Online1)', 18600, null);
INSERT INTO budgetmanagementsystem.workstation (id, spec, price, img) VALUES (46, '戴尔Precision 5530系列(Promo-M5530I58300-Online1)', 9999, null);
\ No newline at end of file
......@@ -5,6 +5,15 @@ package beans;
*/
public class Conference extends Item {
private int experts;
private int people;
public int getPeople() {
return people;
}
public void setPeople(int people) {
this.people = people;
}
public int getExperts() {
return experts;
......@@ -15,9 +24,15 @@ public class Conference extends Item {
}
@Override
public double computeUnitPrice() {
return getPrice()*getPeople();
}
@Override
public String toString() {
return "Conference{" +
"experts=" + experts +
", people=" + people +
"} " + super.toString();
}
}
......@@ -6,4 +6,7 @@ import java.util.List;
public interface IConferenceDao {
List<Conference> selectAll();
void insertConference(Conference conference);
void updateConference(Conference conference);
void deleteConference(Conference conference);
}
......@@ -5,4 +5,13 @@
<select id="selectAll" resultType="beans.Conference">
select * from conference
</select>
<insert id="insertConference">
insert into budgetmanagementsystem.conference(name, price, experts,people) values (#{name},#{price},#{experts},#{people})
</insert>
<update id="updateConference">
update budgetmanagementsystem.conference set name=#{name},price=#{price},experts=#{experts},people=#{people} where id=#{id};
</update>
<delete id="deleteConference">
delete from budgetmanagementsystem.conference where id =#{id}
</delete>
</mapper>
\ No newline at end of file
......@@ -6,4 +6,7 @@ import java.util.List;
public interface IConsultationDao {
List<Consultation> selectAll();
void insertConsultation(Consultation consultation);
void updateConsultation(Consultation consultation);
void deleteConsultation(Consultation consultation);
}
......@@ -5,4 +5,13 @@
<select id="selectAll" resultType="beans.Consultation">
select * from consultation
</select>
<insert id="insertConsultation">
insert into budgetmanagementsystem.consultation( name, price) values (#{name},#{price})
</insert>
<update id="updateConsultation">
update budgetmanagementsystem.consultation set name=#{name},price=#{price} where id=#{id}
</update>
<delete id="deleteConsultation">
delete from budgetmanagementsystem.consultation where id=#{id}
</delete>
</mapper>
\ No newline at end of file
package handlers;
public class DatabaseConsistenceHandler {
}
......@@ -87,6 +87,13 @@
</ul>
<%
if(false){
%>
<p>ssdd</p>
<%
}
%>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade in active" id="equipment">
......@@ -223,8 +230,42 @@
</div>
<div class="tab-pane fade" id="conference">
<p>Enterprise Java Beans(EJB)是一个创建高度可扩展性和强大企业级应用程序的开发架构,部署在兼容应用程序服务器(比如 JBOSS、Web Logic 等)的 J2EE 上。
</p>
<table class="table table-hover">
<thead>
<tr>
<th>编号</th>
<th>名称</th>
<th>单价</th>
<th>需要专家</th>
<th>会议次数</th>
</tr>
</thead>
<tbody>
<%
map = (Map) budget.getConferences();
IConferenceDao conferenceDao =
applicationContext.getBean(IConferenceDao.class);
List<Conference> conferences= conferenceDao.selectAll();
for (Conference item : conferences) {
out.write("<tr>");
out.write("<td>" + item.getId() + "</td>");
out.write("<td>" + item.getName() + "</td>");
out.write("<td>" + item.getPrice() + "</td>");
out.write("<td>" + item.getExperts() + "</td>");
int num = 0;
if (map.get(item) != null) {
num = map.get(item);
}
out.write("<td>" +
"<input type='number' value='" + num + "' />" +
"<button type='btn btn-default' class='updateItem' onclick=conference(this)>确认</button>" +
"</td>");
}
%>
</tbody>
</table>
</div>
<div class="tab-pane fade" id="international">
......@@ -339,8 +380,37 @@
</div>
<div class="tab-pane fade" id="consultation">
<p>Enterprise Java Beans(EJB)是一个创建高度可扩展性和强大企业级应用程序的开发架构,部署在兼容应用程序服务器(比如 JBOSS、Web Logic 等)的 J2EE 上。
</p>
<table class="table table-hover">
<thead>
<tr>
<th>编号</th>
<th>人员类型</th>
<th>费用标准</th>
<th>人数</th>
</tr>
</thead>
<tbody>
<%
map = (Map) budget.getConsultations();
IConsultationDao consultationDao =
applicationContext.getBean(IConsultationDao.class);
List<Consultation> consultations= consultationDao.selectAll();
for (Consultation item : consultations) {
out.write("<tr>");
out.write("<td>" + item.getId() + "</td>");
out.write("<td>" + item.getName() + "</td>");
out.write("<td>" + item.getPrice() + "</td>");
int num = 0;
if (map.get(item) != null) {
num = map.get(item);
}
out.write("<td>" + num + "</td>");
}
%>
</tbody>
</table>
<p class="help-block">此项由会议费决定,不可单独更改</p>
</div>
<div class="tab-pane fade" id="others">
......@@ -360,35 +430,24 @@
<script>
/*function updateItem(type,btn) {
var id=btn.parentElement.parentElement.firstElementChild.innerHTML;
var num=btn.parentElement.firstElementChild.value;
/!*alert(type)
alert(id)
alert(num)*!/
$.ajax({
url:"${pageContext.request.contextPath}/Budget/Modify",
type:"post",
data:{
type:type,
id:id,
nums:num
},
success:function () {
alert("success")
}
})
}*/
function equip(btn) {
var id = btn.parentElement.parentElement.firstElementChild.innerHTML;
var price=btn.parentElement.parentElement.firstElementChild.nextElementSibling.nextElementSibling.innerHTML;
alert(price);
var num = btn.parentElement.firstElementChild.value;
$.ajax({
url: "${pageContext.request.contextPath}/Budget/Modify/Material",
url: "${pageContext.request.contextPath}/Budget/Modify/Equip",
type: "post",
xhrFields:{
withCredentials:true
},
async:false,
crossDomain:true,
data: {
mode: 0,
id: id,
price:price,
nums: num
},
success: function () {
......@@ -465,6 +524,23 @@
})
}
function conference(btn) {
var id = btn.parentElement.parentElement.firstElementChild.innerHTML;
var num = btn.parentElement.firstElementChild.value;
$.ajax({
url: "${pageContext.request.contextPath}/Budget/Modify/Conference",
type: "post",
data: {
mode: 0,
id: id,
nums: num
},
success: function () {
alert("success")
}
})
}
/* function init() {
var updateEquips=document.getElementsByClassName("updateEquipment");
alert(updateEquips.length);
......
......@@ -178,8 +178,48 @@
</div>
<div class="tab-pane fade" id="conference">
<p>Enterprise Java Beans(EJB)是一个创建高度可扩展性和强大企业级应用程序的开发架构,部署在兼容应用程序服务器(比如 JBOSS、Web Logic 等)的 J2EE 上。
</p>
<table class="table table-hover">
<thead>
<tr>
<th>编号</th>
<th>名称</th>
<th>所需专家个数</th>
<th>参会人数</th>
<th>单价</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<%
IConferenceDao conferenceDao =
applicationContext.getBean(IConferenceDao.class);
List<Conference> conferences= conferenceDao.selectAll();
for (Conference item : conferences) {
out.write("<tr>");
out.write("<td>"+item.getId()+"</td>");
out.write("<td>"+item.getName()+"</td>");
out.write("<td>"
+"<input id='experts' type='number' value='"
+item.getExperts()
+"'/></td>");
out.write("<td>"
+"<input id='experts' type='number' value='"
+item.getPeople()
+"'/></td>");
out.write("<td>"
+"<input id='price' type='number' value='"
+item.getPrice()
+"'/></td>");
out.write("<td>"+
"<button class='btn btn-success' onclick=conferenceRule(this,2)>确认</button>"+
"<button class='btn btn-danger' onclick=conferenceRule(this,1)>删除</button>"+
"</td>");
}
%>
</tbody>
</table>
</div>
<div class="tab-pane fade" id="international">
......@@ -285,8 +325,38 @@
</div>
<div class="tab-pane fade" id="consultation">
<p>Enterprise Java Beans(EJB)是一个创建高度可扩展性和强大企业级应用程序的开发架构,部署在兼容应用程序服务器(比如 JBOSS、Web Logic 等)的 J2EE 上。
</p>
<table class="table table-hover">
<thead>
<tr>
<th>编号</th>
<th>人员类型</th>
<th>费用标准</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<%
IConsultationDao consultationDao =
applicationContext.getBean(IConsultationDao.class);
List<Consultation> consultations= consultationDao.selectAll();
for (Consultation item : consultations) {
out.write("<tr>");
out.write("<td>"+item.getId()+"</td>");
out.write("<td>"+item.getName()+"</td>");
out.write("<td>"
+"<input id='price' type='number' value='"
+item.getPrice()
+"'/></td>");
out.write("<td>"+
"<button class='btn btn-success' onclick=consultationRule(this,2)>确认</button>"+
"<button class='btn btn-danger' onclick=consultationRule(this,1)>删除</button>"+
"</td>");
}
%>
</tbody>
</table>
</div>
<div class="tab-pane fade" id="others">
......@@ -398,6 +468,53 @@
}
})
}
function conferenceRule(btn,curd) {
var id=btn.parentElement.parentElement.firstElementChild.innerHTML;
var name=btn.parentElement.parentElement.firstElementChild.nextElementSibling.innerHTML;
var experts=btn.parentElement.parentElement.childNodes.item(2).firstChild.value;
var people=btn.parentElement.parentElement.childNodes.item(3).firstChild.value;
var price=btn.parentElement.parentElement.childNodes.item(4).firstChild.value;
$.ajax({
url:"${pageContext.request.contextPath}/Budget/Modify/Conference",
type:"post",
data:{
mode:1,
id:id,
name:name,
price:price,
experts:experts,
people:people,
curd:curd
},
success:function () {
alert("success")
}
})
}
function consultationRule(btn,curd) {
var id=btn.parentElement.parentElement.firstElementChild.innerHTML;
var name=btn.parentElement.parentElement.firstElementChild.nextElementSibling.innerHTML;
var price=btn.parentElement.parentElement.childNodes.item(2).firstChild.value;
$.ajax({
url:"${pageContext.request.contextPath}/Budget/Modify/Consultation",
type:"post",
data:{
mode:1,
id:id,
name:name,
price:price,
curd:curd
},
success:function () {
alert("success")
}
})
}
</script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment