Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BudgetManagementSystem
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王利雷
BudgetManagementSystem
Commits
7c4b42bb
Commit
7c4b42bb
authored
May 15, 2019
by
shj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
差旅费结构、显示、增删改优化
parent
43b56536
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
74 additions
and
71 deletions
+74
-71
Budget.java
src/main/java/beans/Budget.java
+5
-4
Travel.java
src/main/java/beans/Travel.java
+16
-21
BudgetHandler.java
src/main/java/handlers/BudgetHandler.java
+28
-25
DetailHandler.java
src/main/java/handlers/DetailHandler.java
+4
-3
IBudgetService.java
src/main/java/service/IBudgetService.java
+1
-1
IDetailService.java
src/main/java/service/IDetailService.java
+1
-1
BudgetService.java
src/main/java/service/impl/BudgetService.java
+10
-9
DetailService.java
src/main/java/service/impl/DetailService.java
+2
-2
budgetDetail.jsp
src/main/webapp/budgetDetail.jsp
+5
-2
index.jsp
src/main/webapp/index.jsp
+2
-1
JsonTest.java
src/test/java/JsonTest.java
+0
-2
No files found.
src/main/java/beans/Budget.java
View file @
7c4b42bb
...
@@ -14,7 +14,8 @@ public class Budget implements Serializable {
...
@@ -14,7 +14,8 @@ public class Budget implements Serializable {
private
Map
<
Material
,
Integer
>
materials
;
private
Map
<
Material
,
Integer
>
materials
;
private
Map
<
TestAndProcess
,
Integer
>
testAndProcesses
;
private
Map
<
TestAndProcess
,
Integer
>
testAndProcesses
;
private
Map
<
Power
,
Integer
>
powers
;
private
Map
<
Power
,
Integer
>
powers
;
private
Map
<
Travel
,
Pair
>
travels
;
//private Map<Travel, Pair> travels;
private
Map
<
Travel
,
Integer
>
travels
;
//private Map<Conference, Pair> conferences;
//private Map<Conference, Pair> conferences;
private
Map
<
Conference
,
Integer
>
conferences
;
private
Map
<
Conference
,
Integer
>
conferences
;
private
Map
<
InternationalCommunication
,
Integer
>
internationalCommunications
;
private
Map
<
InternationalCommunication
,
Integer
>
internationalCommunications
;
...
@@ -81,11 +82,11 @@ public class Budget implements Serializable {
...
@@ -81,11 +82,11 @@ public class Budget implements Serializable {
this
.
powers
=
powers
;
this
.
powers
=
powers
;
}
}
public
Map
<
Travel
,
Pai
r
>
getTravels
()
{
public
Map
<
Travel
,
Intege
r
>
getTravels
()
{
return
travels
;
return
travels
;
}
}
public
void
setTravels
(
Map
<
Travel
,
Pai
r
>
travels
)
{
public
void
setTravels
(
Map
<
Travel
,
Intege
r
>
travels
)
{
this
.
travels
=
travels
;
this
.
travels
=
travels
;
}
}
...
@@ -171,7 +172,7 @@ public class Budget implements Serializable {
...
@@ -171,7 +172,7 @@ public class Budget implements Serializable {
}
}
if
(
travels
!=
null
)
if
(
travels
!=
null
)
for
(
Travel
travel
:
travels
.
keySet
())
{
for
(
Travel
travel
:
travels
.
keySet
())
{
direct
+=
travel
.
co
st
(
travels
.
get
(
travel
)
);
direct
+=
travel
.
co
mputeUnitPrice
()*
travels
.
get
(
travel
);
}
}
if
(
conferences
!=
null
)
if
(
conferences
!=
null
)
for
(
Conference
conference
:
conferences
.
keySet
())
{
for
(
Conference
conference
:
conferences
.
keySet
())
{
...
...
src/main/java/beans/Travel.java
View file @
7c4b42bb
...
@@ -7,37 +7,26 @@ import com.alibaba.fastjson.annotation.JSONField;
...
@@ -7,37 +7,26 @@ import com.alibaba.fastjson.annotation.JSONField;
*/
*/
public
class
Travel
extends
Item
{
public
class
Travel
extends
Item
{
@JSONField
(
name
=
"dest"
)
private
String
dest
;
@JSONField
(
name
=
"food"
)
private
double
food
;
private
double
food
;
@JSONField
(
name
=
"traffic"
)
private
double
traffic
;
private
double
traffic
;
@JSONField
(
name
=
"accommodation"
)
private
double
accommodation
;
private
double
accommodation
;
private
int
people
;
private
int
days
;
@Override
public
int
getPeople
()
{
public
double
computeUnitPrice
()
{
return
people
;
return
getPrice
()
+
getFood
()
+
getAccommodation
()
+
getTraffic
();
}
}
public
void
setPeople
(
int
people
)
{
@Override
this
.
people
=
people
;
public
String
toString
()
{
return
"Travel{"
+
"dest='"
+
dest
+
'\''
+
", food="
+
food
+
", traffic="
+
traffic
+
", accommodation="
+
accommodation
+
"} "
+
super
.
toString
();
}
}
public
String
getDest
()
{
public
int
getDays
()
{
return
getName
()
;
return
days
;
}
}
public
void
setD
est
(
String
dest
)
{
public
void
setD
ays
(
int
days
)
{
setName
(
dest
)
;
this
.
days
=
days
;
}
}
public
double
getFood
()
{
public
double
getFood
()
{
...
@@ -70,6 +59,7 @@ public class Travel extends Item {
...
@@ -70,6 +59,7 @@ public class Travel extends Item {
* @param pair
* @param pair
* @return
* @return
*/
*/
@Deprecated
public
double
cost
(
Pair
pair
)
{
public
double
cost
(
Pair
pair
)
{
if
(
pair
==
null
||
pair
.
getPeople
()<=
0
||
pair
.
getDays
()<=
0
)
return
0.0
;
if
(
pair
==
null
||
pair
.
getPeople
()<=
0
||
pair
.
getDays
()<=
0
)
return
0.0
;
return
pair
.
getPeople
()
*
return
pair
.
getPeople
()
*
...
@@ -77,4 +67,9 @@ public class Travel extends Item {
...
@@ -77,4 +67,9 @@ public class Travel extends Item {
+
(
getTraffic
()
+
getFood
())
*
pair
.
getDays
()
+
(
getTraffic
()
+
getFood
())
*
pair
.
getDays
()
+
getAccommodation
()
*
(
pair
.
getDays
()
-
1
));
+
getAccommodation
()
*
(
pair
.
getDays
()
-
1
));
}
}
@Override
public
double
computeUnitPrice
()
{
return
getPeople
()*(
getPrice
()
+
(
getTraffic
()+
getFood
())*
getDays
()
+
getAccommodation
()*(
getDays
()-
1
));
}
}
}
src/main/java/handlers/BudgetHandler.java
View file @
7c4b42bb
...
@@ -413,16 +413,15 @@ public class BudgetHandler {
...
@@ -413,16 +413,15 @@ public class BudgetHandler {
private
IInternationalCommunicationDao
internationalCommunicationDao
;
private
IInternationalCommunicationDao
internationalCommunicationDao
;
/**
/**
* 修改预算中的国际交流合作费
、规则中的国际交流合作费
* 修改预算中的国际交流合作费
*
*
* @param mode
* @param mode
* @param id
* @param internationalCommunication
* @param name
* @param price
* @param nums
* @param nums
* @param curd
* @param curd
* @param request
* @param request
* @param response
* @param response
* @throws IOException
*/
*/
@RequestMapping
(
"/Modify/International"
)
@RequestMapping
(
"/Modify/International"
)
public
void
modifyInternational
(
Integer
mode
,
InternationalCommunication
internationalCommunication
,
Integer
nums
,
Integer
curd
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
public
void
modifyInternational
(
Integer
mode
,
InternationalCommunication
internationalCommunication
,
Integer
nums
,
Integer
curd
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
...
@@ -629,10 +628,10 @@ public class BudgetHandler {
...
@@ -629,10 +628,10 @@ public class BudgetHandler {
* @param response
* @param response
*/
*/
@RequestMapping
(
"/Modify/Travel"
)
@RequestMapping
(
"/Modify/Travel"
)
public
void
modifyTravel
(
Integer
mode
,
Travel
travel
,
Pair
pair
,
Integer
curd
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
public
void
modifyTravel
(
Integer
mode
,
Travel
travel
,
Integer
nums
,
Integer
curd
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
System
.
out
.
println
(
"/Modify/Travel"
);
System
.
out
.
println
(
"/Modify/Travel"
);
if
(
pair
==
null
||
pair
.
getDays
()
<
0
||
pair
.
getPeople
()
<
0
)
return
;
if
(
nums
<
0
)
return
;
String
sessionID
=
getSessionID
(
request
.
getCookies
());
String
sessionID
=
getSessionID
(
request
.
getCookies
());
Budget
budget
=
retrieveBudget
(
sessionID
);
Budget
budget
=
retrieveBudget
(
sessionID
);
...
@@ -641,15 +640,15 @@ public class BudgetHandler {
...
@@ -641,15 +640,15 @@ public class BudgetHandler {
return
;
return
;
}
}
Map
<
Travel
,
Pai
r
>
items
=
budget
.
getTravels
();
Map
<
Travel
,
Intege
r
>
items
=
budget
.
getTravels
();
checkService
.
checkTravel
(
travel
);
checkService
.
checkTravel
(
travel
);
if
(
curd
.
equals
(
0
))
{
if
(
curd
.
equals
(
0
))
{
items
.
put
(
travel
,
pair
);
items
.
put
(
travel
,
nums
);
}
else
if
(
curd
.
equals
(
1
))
{
}
else
if
(
curd
.
equals
(
1
))
{
items
.
remove
(
travel
);
items
.
remove
(
travel
);
}
else
{
}
else
{
items
.
remove
(
travel
);
items
.
remove
(
travel
);
items
.
put
(
travel
,
pair
);
items
.
put
(
travel
,
nums
);
}
}
afterUpdate
(
budget
);
afterUpdate
(
budget
);
serializeBudget
(
budget
,
getFilePath
(
sessionID
));
serializeBudget
(
budget
,
getFilePath
(
sessionID
));
...
@@ -801,19 +800,20 @@ public class BudgetHandler {
...
@@ -801,19 +800,20 @@ public class BudgetHandler {
}
}
writer
.
newLine
();
writer
.
newLine
();
writer
.
write
(
"差旅费,目的地,往返价格,伙食费,交通费,住宿费,人数,天数,小计"
);
writer
.
write
(
"差旅费,目的地,往返价格,伙食费,交通费,住宿费,人数,天数,
次数,
小计"
);
writer
.
newLine
();
writer
.
newLine
();
Map
<
Travel
,
Pai
r
>
travels
=
budget
.
getTravels
();
Map
<
Travel
,
Intege
r
>
travels
=
budget
.
getTravels
();
for
(
Item
item
:
travels
.
keySet
())
{
for
(
Item
item
:
travels
.
keySet
())
{
if
(
item
instanceof
Travel
)
{
if
(
item
instanceof
Travel
)
{
writer
.
write
(
comma
+
((
Travel
)
item
).
get
Dest
()
writer
.
write
(
comma
+
((
Travel
)
item
).
get
Name
()
+
comma
+
item
.
getPrice
()
+
comma
+
item
.
getPrice
()
+
comma
+
((
Travel
)
item
).
getFood
()
+
comma
+
((
Travel
)
item
).
getFood
()
+
comma
+
((
Travel
)
item
).
getTraffic
()
+
comma
+
((
Travel
)
item
).
getTraffic
()
+
comma
+
((
Travel
)
item
).
getAccommodation
()
+
comma
+
((
Travel
)
item
).
getAccommodation
()
+
comma
+
travels
.
get
(
item
).
getPeople
()
+
comma
+
((
Travel
)
item
).
getPeople
()
+
comma
+
travels
.
get
(
item
).
getDays
()
+
comma
+
((
Travel
)
item
).
getDays
()
+
comma
+
((
Travel
)
item
).
cost
(
travels
.
get
(
item
)));
+
comma
+
travels
.
get
(
item
)
+
comma
+
item
.
computeUnitPrice
()
*
travels
.
get
(
item
));
writer
.
newLine
();
writer
.
newLine
();
}
}
}
}
...
@@ -835,17 +835,20 @@ public class BudgetHandler {
...
@@ -835,17 +835,20 @@ public class BudgetHandler {
}
}
writer
.
newLine
();
writer
.
newLine
();
writer
.
write
(
"国际合作交流费,会议内容,
费用标准,会议
次数,小计"
);
writer
.
write
(
"国际合作交流费,会议内容,
市际交通(往返交通),住宿补贴,伙食补贴,公杂费,人数,天数,
次数,小计"
);
writer
.
newLine
();
writer
.
newLine
();
items
=
(
Map
)
budget
.
getInternationalCommunications
();
Map
<
InternationalCommunication
,
Integer
>
internationalCommunications
=
budget
.
getInternationalCommunications
();
for
(
Item
item
:
items
.
keySet
())
{
for
(
InternationalCommunication
item
:
internationalCommunications
.
keySet
())
{
if
(
item
instanceof
InternationalCommunication
)
{
writer
.
write
(
comma
+
item
.
getName
()
writer
.
write
(
comma
+
item
.
getName
()
+
comma
+
item
.
getPrice
()
+
comma
+
item
.
getPrice
()
+
comma
+
item
.
getAccommodation
()
+
comma
+
items
.
get
(
item
)
+
comma
+
item
.
getFood
()
+
comma
+
item
.
computeUnitPrice
()
*
items
.
get
(
item
));
+
comma
+
item
.
getTraffic
()
writer
.
newLine
();
+
comma
+
item
.
getPeople
()
}
+
comma
+
item
.
getDays
()
+
comma
+
items
.
get
(
item
)
+
comma
+
item
.
computeUnitPrice
()
*
internationalCommunications
.
get
(
item
));
writer
.
newLine
();
}
}
writer
.
newLine
();
writer
.
newLine
();
...
...
src/main/java/handlers/DetailHandler.java
View file @
7c4b42bb
...
@@ -281,7 +281,7 @@ public class DetailHandler {
...
@@ -281,7 +281,7 @@ public class DetailHandler {
response
.
sendError
(
444
,
"budget not exists"
);
response
.
sendError
(
444
,
"budget not exists"
);
return
;
return
;
}
}
Map
<
Travel
,
Pai
r
>
travels
=
budget
.
getTravels
();
Map
<
Travel
,
Intege
r
>
travels
=
budget
.
getTravels
();
List
<
JSONObject
>
list
=
new
LinkedList
<>();
List
<
JSONObject
>
list
=
new
LinkedList
<>();
for
(
Travel
item
:
travels
.
keySet
())
{
for
(
Travel
item
:
travels
.
keySet
())
{
JSONObject
obj
=
new
JSONObject
();
JSONObject
obj
=
new
JSONObject
();
...
@@ -291,8 +291,9 @@ public class DetailHandler {
...
@@ -291,8 +291,9 @@ public class DetailHandler {
obj
.
put
(
"food"
,
item
.
getFood
());
obj
.
put
(
"food"
,
item
.
getFood
());
obj
.
put
(
"traffic"
,
item
.
getTraffic
());
obj
.
put
(
"traffic"
,
item
.
getTraffic
());
obj
.
put
(
"accommodation"
,
item
.
getAccommodation
());
obj
.
put
(
"accommodation"
,
item
.
getAccommodation
());
obj
.
put
(
"people"
,
travels
.
get
(
item
).
getPeople
());
obj
.
put
(
"people"
,
item
.
getPeople
());
obj
.
put
(
"days"
,
travels
.
get
(
item
).
getDays
());
obj
.
put
(
"days"
,
item
.
getDays
());
obj
.
put
(
"nums"
,
travels
.
get
(
item
));
list
.
add
(
obj
);
list
.
add
(
obj
);
}
}
object
.
put
(
"data"
,
list
);
object
.
put
(
"data"
,
list
);
...
...
src/main/java/service/IBudgetService.java
View file @
7c4b42bb
...
@@ -15,7 +15,7 @@ public interface IBudgetService {
...
@@ -15,7 +15,7 @@ public interface IBudgetService {
Map
<
Power
,
Integer
>
doPower
(
Double
number
);
Map
<
Power
,
Integer
>
doPower
(
Double
number
);
Map
<
Travel
,
Pai
r
>
doTravel
(
Double
number
);
Map
<
Travel
,
Intege
r
>
doTravel
(
Double
number
);
//Map<Conference, Pair> doConference(Double number);
//Map<Conference, Pair> doConference(Double number);
Map
<
Conference
,
Integer
>
doConference
(
Double
number
);
Map
<
Conference
,
Integer
>
doConference
(
Double
number
);
...
...
src/main/java/service/IDetailService.java
View file @
7c4b42bb
...
@@ -8,7 +8,7 @@ public interface IDetailService {
...
@@ -8,7 +8,7 @@ public interface IDetailService {
double
sumEquipment
(
Map
<
Equipment
,
Integer
>
equipments
);
double
sumEquipment
(
Map
<
Equipment
,
Integer
>
equipments
);
double
sumTravel
(
Map
<
Travel
,
Pai
r
>
travels
);
double
sumTravel
(
Map
<
Travel
,
Intege
r
>
travels
);
double
sumLabour
(
Map
<
Labour
,
Integer
>
labour
);
double
sumLabour
(
Map
<
Labour
,
Integer
>
labour
);
...
...
src/main/java/service/impl/BudgetService.java
View file @
7c4b42bb
...
@@ -187,24 +187,25 @@ public class BudgetService implements IBudgetService {
...
@@ -187,24 +187,25 @@ public class BudgetService implements IBudgetService {
* @return
* @return
*/
*/
@Override
@Override
public
Map
<
Travel
,
Pai
r
>
doTravel
(
Double
number
)
{
public
Map
<
Travel
,
Intege
r
>
doTravel
(
Double
number
)
{
Map
<
Travel
,
Pai
r
>
result
=
new
HashMap
<>();
Map
<
Travel
,
Intege
r
>
result
=
new
HashMap
<>();
List
<
Travel
>
travels
=
travelDao
.
selectAll
();
List
<
Travel
>
travels
=
travelDao
.
selectAll
();
if
(
travels
!=
null
&&
travels
.
size
()
!=
0
)
{
if
(
travels
!=
null
&&
travels
.
size
()
!=
0
)
{
double
sofar
=
0.0
;
double
sofar
=
0.0
;
for
(
Travel
travel
:
travels
)
{
for
(
Travel
travel
:
travels
)
{
travel
.
setPeople
(
1
);
travel
.
setDays
(
1
);
if
(
sofar
<
number
)
{
if
(
sofar
<
number
)
{
Pair
pair
=
new
Pair
(
1
,
1
);
result
.
put
(
travel
,
1
);
result
.
put
(
travel
,
pair
);
sofar
+=
travel
.
computeUnitPrice
();
sofar
+=
travel
.
cost
(
pair
);
}
}
}
}
while
(
sofar
<
number
)
{
while
(
sofar
<
number
)
{
for
(
Travel
travel
:
result
.
keySet
())
{
for
(
Travel
travel
:
result
.
keySet
())
{
Pair
pair
=
result
.
get
(
travel
);
int
days
=
travel
.
getDays
(
);
double
oldCost
=
travel
.
co
st
(
pair
);
double
oldCost
=
travel
.
co
mputeUnitPrice
(
);
pair
.
setDays
(
pair
.
getDays
()
+
1
);
travel
.
setDays
(
days
+
1
);
double
newCost
=
travel
.
co
st
(
pair
);
double
newCost
=
travel
.
co
mputeUnitPrice
(
);
sofar
+=
(
newCost
-
oldCost
);
sofar
+=
(
newCost
-
oldCost
);
//System.out.println("oldCost:" + oldCost);
//System.out.println("oldCost:" + oldCost);
//System.out.println("newCost:" + newCost);
//System.out.println("newCost:" + newCost);
...
...
src/main/java/service/impl/DetailService.java
View file @
7c4b42bb
...
@@ -18,10 +18,10 @@ public class DetailService implements IDetailService {
...
@@ -18,10 +18,10 @@ public class DetailService implements IDetailService {
}
}
@Override
@Override
public
double
sumTravel
(
Map
<
Travel
,
Pai
r
>
travels
)
{
public
double
sumTravel
(
Map
<
Travel
,
Intege
r
>
travels
)
{
double
sum
=
0.0
;
double
sum
=
0.0
;
for
(
Travel
travel
:
travels
.
keySet
())
{
for
(
Travel
travel
:
travels
.
keySet
())
{
sum
+=
travel
.
co
st
(
travels
.
get
(
travel
)
);
sum
+=
travel
.
co
mputeUnitPrice
()*
travels
.
get
(
travel
);
}
}
return
sum
;
return
sum
;
}
}
...
...
src/main/webapp/budgetDetail.jsp
View file @
7c4b42bb
...
@@ -223,6 +223,7 @@
...
@@ -223,6 +223,7 @@
<th>
住宿补助
</th>
<th>
住宿补助
</th>
<th>
人数
</th>
<th>
人数
</th>
<th>
天数
</th>
<th>
天数
</th>
<th>
次数
</th>
<th>
操作
</th>
<th>
操作
</th>
</tr>
</tr>
</thead>
</thead>
...
@@ -236,6 +237,7 @@
...
@@ -236,6 +237,7 @@
<td><input
type=
"number"
v-model=
"item.accommodation"
class=
"form-control"
></td>
<td><input
type=
"number"
v-model=
"item.accommodation"
class=
"form-control"
></td>
<td><input
type=
"number"
v-model=
"item.people"
class=
"form-control"
></td>
<td><input
type=
"number"
v-model=
"item.people"
class=
"form-control"
></td>
<td><input
type=
"number"
v-model=
"item.days"
class=
"form-control"
></td>
<td><input
type=
"number"
v-model=
"item.days"
class=
"form-control"
></td>
<td><input
type=
"number"
v-model=
"item.nums"
class=
"form-control"
></td>
<td>
<td>
<button
class=
"btn btn-success"
@
click=
"update(item)"
>
确认
</button>
<button
class=
"btn btn-success"
@
click=
"update(item)"
>
确认
</button>
<button
class=
"btn btn-danger"
@
click=
"del(item)"
>
删除
</button>
<button
class=
"btn btn-danger"
@
click=
"del(item)"
>
删除
</button>
...
@@ -305,7 +307,7 @@
...
@@ -305,7 +307,7 @@
<p
class=
"help-block"
><b>
市际
</b>
交通:指代往返价格、会议注册费等一次性费用
</p>
<p
class=
"help-block"
><b>
市际
</b>
交通:指代往返价格、会议注册费等一次性费用
</p>
<p
class=
"help-block"
><b>
市内
</b>
交通:指代一切公杂费
</p>
<p
class=
"help-block"
><b>
市内
</b>
交通:指代一切公杂费
</p>
</div>
</div>
<table
class=
"table table-hover"
>
<table
class=
"table table-hover
text-nowrap
"
>
<thead>
<thead>
<tr>
<tr>
<th>
名称
</th>
<th>
名称
</th>
...
@@ -380,7 +382,7 @@
...
@@ -380,7 +382,7 @@
</td>
</td>
</tr>
</tr>
<tr
class=
"success"
>
<tr
class=
"success"
>
<td><input
type=
"text"
readonly
v-model=
"sample.name"
class=
"form-control"
></td>
<td><input
type=
"text"
v-model=
"sample.name"
class=
"form-control"
></td>
<td><input
type=
"number"
v-model=
"sample.price"
class=
"form-control"
></td>
<td><input
type=
"number"
v-model=
"sample.price"
class=
"form-control"
></td>
<td><input
type=
"number"
v-model=
"sample.nums"
class=
"form-control"
></td>
<td><input
type=
"number"
v-model=
"sample.nums"
class=
"form-control"
></td>
<td>
<td>
...
@@ -736,6 +738,7 @@
...
@@ -736,6 +738,7 @@
traffic
:
item
.
traffic
,
traffic
:
item
.
traffic
,
days
:
item
.
days
,
days
:
item
.
days
,
people
:
item
.
people
,
people
:
item
.
people
,
nums
:
item
.
nums
,
curd
:
curd
curd
:
curd
},
},
{
emulateJSON
:
true
}
{
emulateJSON
:
true
}
...
...
src/main/webapp/index.jsp
View file @
7c4b42bb
...
@@ -183,8 +183,9 @@
...
@@ -183,8 +183,9 @@
</div>
</div>
<!-- Button -->
<!-- Button -->
<div>
<div
title=
"所有复选框必须勾选,如果不需要某类费用,后面的数字填0即可"
>
<button
class=
"btn btn-default btn-lg center-block"
type=
"submit"
>
生成预算
</button>
<button
class=
"btn btn-default btn-lg center-block"
type=
"submit"
>
生成预算
</button>
<p
class=
"help-block"
style=
"color:red"
>
所有复选框必须勾选,如果不需要某类费用,后面的数字填0即可
</p>
</div>
</div>
</form>
</form>
...
...
src/test/java/JsonTest.java
View file @
7c4b42bb
...
@@ -21,11 +21,9 @@ public class JsonTest {
...
@@ -21,11 +21,9 @@ public class JsonTest {
{
{
Map
<
Travel
,
Pair
>
map
=
new
HashMap
<>();
Map
<
Travel
,
Pair
>
map
=
new
HashMap
<>();
map
.
put
(
new
Travel
(){{
map
.
put
(
new
Travel
(){{
setDest
(
"xxx"
);
setPrice
(
100
);
setFood
(
10
);
setTraffic
(
50
);
setAccommodation
(
80
);
setPrice
(
100
);
setFood
(
10
);
setTraffic
(
50
);
setAccommodation
(
80
);
}},
new
Pair
(
1
,
1
));
}},
new
Pair
(
1
,
1
));
map
.
put
(
new
Travel
(){{
map
.
put
(
new
Travel
(){{
setDest
(
"yyy"
);
setPrice
(
200
);
setFood
(
20
);
setTraffic
(
90
);
setAccommodation
(
99
);
setPrice
(
200
);
setFood
(
20
);
setTraffic
(
90
);
setAccommodation
(
99
);
}},
new
Pair
(
1
,
2
));
}},
new
Pair
(
1
,
2
));
for
(
Map
.
Entry
<
Travel
,
Pair
>
travelPairEntry
:
map
.
entrySet
())
{
for
(
Map
.
Entry
<
Travel
,
Pair
>
travelPairEntry
:
map
.
entrySet
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment