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
96cd9b7c
Commit
96cd9b7c
authored
Apr 01, 2019
by
shj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前端使用Vue框架进行重构
parent
eefc3b0e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
21 deletions
+77
-21
BudgetHandler.java
src/main/java/handlers/BudgetHandler.java
+15
-13
DetailHandler.java
src/main/java/handlers/DetailHandler.java
+53
-0
ICheckService.java
src/main/java/service/ICheckService.java
+3
-4
CheckService.java
src/main/java/service/impl/CheckService.java
+6
-4
budgetDetail.jsp
src/main/webapp/budgetDetail.jsp
+0
-0
detail.js
src/main/webapp/js/detail.js
+0
-0
No files found.
src/main/java/handlers/BudgetHandler.java
View file @
96cd9b7c
...
...
@@ -422,25 +422,21 @@ public class BudgetHandler {
@Autowired
private
IPropertyDao
propertyDao
;
/**
* 修改预算中的国际交流合作费、规则中的国际交流合作费
*
* @param mode
* @param id
* @param name
* @param price
* @param property
* @param nums
* @param curd
* @param request
* @param response
*/
@RequestMapping
(
"/Modify/Property"
)
public
void
modifyProperty
(
Integer
mode
,
Integer
id
,
String
name
,
Double
price
,
Integer
nums
,
Integer
curd
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
void
modifyProperty
(
Integer
mode
,
Property
property
,
Integer
nums
,
Integer
curd
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
System
.
out
.
println
(
"/Modify/Property"
);
if
(
mode
.
equals
(
0
))
//修改预算
{
/*
if (mode.equals(0))//修改预算
{
*/
if
(
nums
<
0
)
return
;
String
sessionID
=
getSessionID
(
request
.
getCookies
());
Budget
budget
=
retrieveBudget
(
sessionID
);
...
...
@@ -449,11 +445,17 @@ public class BudgetHandler {
Map
<
Property
,
Integer
>
items
=
null
;
items
=
budget
.
getProperties
();
Property
mod
=
propertyDao
.
selectById
(
id
);
if
(
mod
!=
null
)
items
.
put
(
mod
,
nums
);
if
(!
checkService
.
checkProperty
(
property
))
return
;
if
(
curd
.
equals
(
0
)){
items
.
put
(
property
,
nums
);
}
else
if
(
curd
.
equals
(
1
)){
items
.
remove
(
property
);
}
else
{
items
.
remove
(
property
);
items
.
put
(
property
,
nums
);
}
serializeBudget
(
budget
,
getFilePath
(
sessionID
));
}
else
//修改规则
/*} *//*
else//修改规则
{
Property item = new Property();
item.setId(id);
...
...
@@ -469,7 +471,7 @@ public class BudgetHandler {
{
propertyDao.updateProperty(item);
}
}
}
*/
}
...
...
src/main/java/handlers/DetailHandler.java
View file @
96cd9b7c
...
...
@@ -150,4 +150,57 @@ public class DetailHandler {
e
.
printStackTrace
();
}
}
@RequestMapping
(
"/Power"
)
public
void
powerDetail
(
HttpServletRequest
request
,
HttpServletResponse
response
){
try
{
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setContentType
(
"text/html;charset=utf-8"
);
PrintWriter
writer
=
response
.
getWriter
();
JSONObject
object
=
new
JSONObject
();
String
sessionID
=
BudgetHandler
.
getSessionID
(
request
.
getCookies
());
Budget
budget
=
BudgetHandler
.
retrieveBudget
(
sessionID
);
Map
<
Power
,
Integer
>
powers
=
budget
.
getPowers
();
List
<
JSONObject
>
list
=
new
LinkedList
<>();
for
(
Power
item
:
powers
.
keySet
())
{
JSONObject
obj
=
new
JSONObject
();
obj
.
put
(
"id"
,
item
.
getId
());
obj
.
put
(
"name"
,
item
.
getName
());
obj
.
put
(
"price"
,
item
.
getPrice
());
obj
.
put
(
"nums"
,
powers
.
get
(
item
));
list
.
add
(
obj
);
}
object
.
put
(
"powers"
,
list
);
writer
.
write
(
JSON
.
toJSONString
(
object
));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
@RequestMapping
(
"/Property"
)
public
void
propertyDetail
(
HttpServletRequest
request
,
HttpServletResponse
response
){
try
{
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setContentType
(
"text/html;charset=utf-8"
);
PrintWriter
writer
=
response
.
getWriter
();
JSONObject
object
=
new
JSONObject
();
String
sessionID
=
BudgetHandler
.
getSessionID
(
request
.
getCookies
());
Budget
budget
=
BudgetHandler
.
retrieveBudget
(
sessionID
);
Map
<
Property
,
Integer
>
propertyIntegerMap
=
budget
.
getProperties
();
List
<
JSONObject
>
list
=
new
LinkedList
<>();
for
(
Property
item
:
propertyIntegerMap
.
keySet
())
{
JSONObject
obj
=
new
JSONObject
();
obj
.
put
(
"id"
,
item
.
getId
());
obj
.
put
(
"name"
,
item
.
getName
());
obj
.
put
(
"price"
,
item
.
getPrice
());
obj
.
put
(
"nums"
,
propertyIntegerMap
.
get
(
item
));
list
.
add
(
obj
);
}
object
.
put
(
"data"
,
list
);
writer
.
write
(
JSON
.
toJSONString
(
object
));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
src/main/java/service/ICheckService.java
View file @
96cd9b7c
package
service
;
import
beans.Equipment
;
import
beans.Indirect
;
import
beans.Material
;
import
beans.Travel
;
import
beans.*
;
public
interface
ICheckService
{
boolean
checkEquipment
(
Equipment
equipment
);
boolean
checkMaterial
(
Material
material
);
boolean
checkTravel
(
Travel
travel
);
boolean
checkIndirect
(
Indirect
indirect
);
boolean
checkProperty
(
Property
property
);
}
src/main/java/service/impl/CheckService.java
View file @
96cd9b7c
package
service
.
impl
;
import
beans.Equipment
;
import
beans.Indirect
;
import
beans.Material
;
import
beans.Travel
;
import
beans.*
;
import
org.springframework.stereotype.Service
;
import
service.ICheckService
;
@Service
...
...
@@ -29,4 +26,9 @@ public class CheckService implements ICheckService {
public
boolean
checkIndirect
(
Indirect
indirect
)
{
return
true
;
}
@Override
public
boolean
checkProperty
(
Property
property
)
{
return
true
;
}
}
src/main/webapp/budgetDetail.jsp
View file @
96cd9b7c
This diff is collapsed.
Click to expand it.
src/main/webapp/js/detail.js
0 → 100644
View file @
96cd9b7c
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