Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
tjmdp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
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
other-project
tjmdp
Commits
22310329
Commit
22310329
authored
Apr 16, 2019
by
liuyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://192.168.10.120:8080/other-project/tjmdp
parents
68eb2767
4274060e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
374 additions
and
280 deletions
+374
-280
ActivityController.java
src/main/java/com/qiankun/controller/ActivityController.java
+45
-0
UserController.java
src/main/java/com/qiankun/controller/UserController.java
+34
-259
ActivityDao.java
src/main/java/com/qiankun/dao/ActivityDao.java
+17
-0
ActivityDaoImpl.java
src/main/java/com/qiankun/dao/ActivityDaoImpl.java
+51
-0
Activity.java
src/main/java/com/qiankun/entity/Activity.java
+6
-16
ActivityService.java
src/main/java/com/qiankun/service/ActivityService.java
+39
-0
UserService.java
src/main/java/com/qiankun/service/UserService.java
+2
-3
ActivityVo.java
src/main/java/com/qiankun/vo/ActivityVo.java
+38
-0
main.jsp
src/main/webapp/WEB-INF/decorators/main.jsp
+1
-2
activitylist.jsp
src/main/webapp/WEB-INF/pages/activity/activitylist.jsp
+141
-0
No files found.
src/main/java/com/qiankun/controller/ActivityController.java
0 → 100644
View file @
22310329
package
com
.
qiankun
.
controller
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.servlet.ModelAndView
;
import
com.qiankun.controller.base.BaseController
;
import
com.qiankun.entity.Activity
;
import
com.qiankun.service.ActivityService
;
import
com.qiankun.vo.ActivityVo
;
@Controller
public
class
ActivityController
extends
BaseController
<
Object
>{
@Autowired
private
ActivityService
activityService
;
@RequestMapping
(
"/activity/list"
)
public
ModelAndView
list
()
throws
Exception
{
ModelAndView
view
=
new
ModelAndView
();
view
.
setViewName
(
"activity/activitylist"
);
return
view
;
}
@RequestMapping
(
"/activity/add"
)
public
ModelAndView
userAdd
(
String
id
)
throws
Exception
{
ModelAndView
view
=
new
ModelAndView
();
ActivityVo
vo
=
new
ActivityVo
();
if
(
StringUtils
.
isNotBlank
(
id
))
{
Activity
activity
=
activityService
.
findById
(
id
);
}
view
.
setViewName
(
"activity/saveactivity"
);
view
.
getModel
().
put
(
"dict"
,
dict
());
view
.
getModel
().
put
(
"activity"
,
vo
);
return
view
;
}
}
\ No newline at end of file
src/main/java/com/qiankun/controller/UserController.java
View file @
22310329
package
com
.
qiankun
.
controller
;
package
com
.
qiankun
.
controller
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.ResourceBundle
;
import
java.util.ResourceBundle
;
import
java.util.Set
;
import
java.util.Set
;
...
@@ -19,8 +14,9 @@ import org.apache.commons.lang.StringUtils;
...
@@ -19,8 +14,9 @@ import org.apache.commons.lang.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.
multipart.MultipartFile
;
import
org.springframework.web.
bind.annotation.ResponseBody
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.ModelAndView
;
import
com.qiankun.annotation.Auth
;
import
com.qiankun.annotation.Auth
;
...
@@ -32,7 +28,6 @@ import com.qiankun.pages.IPageList;
...
@@ -32,7 +28,6 @@ import com.qiankun.pages.IPageList;
import
com.qiankun.service.UserService
;
import
com.qiankun.service.UserService
;
import
com.qiankun.utils.MD5
;
import
com.qiankun.utils.MD5
;
import
com.qiankun.utils.SessionUtils
;
import
com.qiankun.utils.SessionUtils
;
import
com.qiankun.vo.ProductVo
;
import
com.qiankun.vo.UserVo
;
import
com.qiankun.vo.UserVo
;
@Controller
@Controller
...
@@ -122,11 +117,18 @@ public class UserController extends BaseController<Object>{
...
@@ -122,11 +117,18 @@ public class UserController extends BaseController<Object>{
return
view
;
return
view
;
}
}
@Auth
(
verifyLogin
=
false
,
verifyURL
=
false
)
@Auth
(
verifyLogin
=
false
,
verifyURL
=
false
)
@RequestMapping
(
value
=
"/wx/api/user/save"
,
method
=
RequestMethod
.
POST
)
public
Map
<
String
,
Object
>
saveUserFormWX
(
@RequestParam
UserVo
userVo
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
return
this
.
saveUser
(
userVo
,
response
,
request
);
}
@RequestMapping
(
"/api/user/save"
)
@RequestMapping
(
"/api/user/save"
)
public
M
odelAndView
saveUser
(
UserVo
userVo
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
public
M
ap
<
String
,
Object
>
saveUser
(
UserVo
userVo
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
M
odelAndView
view
=
new
ModelAndView
();
M
ap
<
String
,
Object
>
map
=
new
HashMap
<>
();
User
user
=
new
User
();
User
user
=
new
User
();
Date
date
=
new
Date
();
Date
date
=
new
Date
();
...
@@ -135,21 +137,21 @@ public class UserController extends BaseController<Object>{
...
@@ -135,21 +137,21 @@ public class UserController extends BaseController<Object>{
Boolean
userIsExistPaperId
=
userService
.
validateUserExistByPaperId
(
userVo
.
getPaperId
());
Boolean
userIsExistPaperId
=
userService
.
validateUserExistByPaperId
(
userVo
.
getPaperId
());
if
(
userIsExistPaperId
)
{
if
(
userIsExistPaperId
)
{
view
.
getModelMap
()
.
put
(
"status"
,
0
);
map
.
put
(
"status"
,
0
);
view
.
getModel
()
.
put
(
"message"
,
"userIsExist_paperId"
);
map
.
put
(
"message"
,
"userIsExist_paperId"
);
return
view
;
return
map
;
}
}
Boolean
userIsExistUserName
=
userService
.
validateUserExistByUserName
(
userVo
.
getUserName
());
Boolean
userIsExistUserName
=
userService
.
validateUserExistByUserName
(
userVo
.
getUserName
());
if
(
userIsExistUserName
)
{
if
(
userIsExistUserName
)
{
view
.
getModelMap
()
.
put
(
"status"
,
0
);
map
.
put
(
"status"
,
0
);
view
.
getModel
()
.
put
(
"message"
,
"userIsExist_userName"
);
map
.
put
(
"message"
,
"userIsExist_userName"
);
return
view
;
return
map
;
}
}
user
.
setCreateTime
(
date
);
user
.
setCreateTime
(
date
);
user
.
setStatus
(
"0"
);
user
.
setStatus
(
"0"
);
view
.
getModelMap
()
.
put
(
"status"
,
1
);
map
.
put
(
"status"
,
1
);
}
else
{
}
else
{
user
=
userService
.
findById
(
userVo
.
getId
());
user
=
userService
.
findById
(
userVo
.
getId
());
...
@@ -157,28 +159,27 @@ public class UserController extends BaseController<Object>{
...
@@ -157,28 +159,27 @@ public class UserController extends BaseController<Object>{
if
(
StringUtils
.
isNotBlank
(
userVo
.
getPaperId
())
&&
!
userVo
.
getPaperId
().
equals
(
user
.
getPaperId
()))
{
if
(
StringUtils
.
isNotBlank
(
userVo
.
getPaperId
())
&&
!
userVo
.
getPaperId
().
equals
(
user
.
getPaperId
()))
{
Boolean
userIsExistPaperId
=
userService
.
validateUserExistByPaperId
(
userVo
.
getPaperId
());
Boolean
userIsExistPaperId
=
userService
.
validateUserExistByPaperId
(
userVo
.
getPaperId
());
if
(
userIsExistPaperId
)
{
if
(
userIsExistPaperId
)
{
view
.
getModelMap
()
.
put
(
"status"
,
0
);
map
.
put
(
"status"
,
0
);
view
.
getModel
()
.
put
(
"message"
,
"userIsExist_paperId"
);
map
.
put
(
"message"
,
"userIsExist_paperId"
);
return
view
;
return
map
;
}
}
}
}
if
(
StringUtils
.
isNotBlank
(
userVo
.
getUserName
())
&&
!
userVo
.
getUserName
().
equals
(
user
.
getUserName
()))
{
if
(
StringUtils
.
isNotBlank
(
userVo
.
getUserName
())
&&
!
userVo
.
getUserName
().
equals
(
user
.
getUserName
()))
{
Boolean
userIsExistUserName
=
userService
.
validateUserExistByUserName
(
userVo
.
getUserName
());
Boolean
userIsExistUserName
=
userService
.
validateUserExistByUserName
(
userVo
.
getUserName
());
if
(
userIsExistUserName
)
{
if
(
userIsExistUserName
)
{
view
.
getModelMap
()
.
put
(
"status"
,
0
);
map
.
put
(
"status"
,
0
);
view
.
getModel
()
.
put
(
"message"
,
"userIsExist_userName"
);
map
.
put
(
"message"
,
"userIsExist_userName"
);
return
view
;
return
map
;
}
}
}
}
user
.
setUpdateTime
(
date
);
user
.
setUpdateTime
(
date
);
user
.
getContacts
().
clear
();
user
.
getContacts
().
clear
();
view
.
getModelMap
()
.
put
(
"status"
,
2
);
map
.
put
(
"status"
,
2
);
}
}
user
.
setUserName
(
userVo
.
getMobile
());
user
.
setUserName
(
userVo
.
getMobile
());
user
.
setName
(
userVo
.
getName
());
user
.
setName
(
userVo
.
getName
());
user
.
setGender
(
userVo
.
getGender
());
user
.
setGender
(
userVo
.
getGender
());
user
.
setBirthday
(
userVo
.
getBirthday
());
user
.
setBirthday
(
userVo
.
getBirthday
());
...
@@ -227,9 +228,10 @@ public class UserController extends BaseController<Object>{
...
@@ -227,9 +228,10 @@ public class UserController extends BaseController<Object>{
contacts2
.
setUpdateTime
(
date
);
contacts2
.
setUpdateTime
(
date
);
contacts2
.
setUser
(
user
);
contacts2
.
setUser
(
user
);
user
.
getContacts
().
add
(
contacts2
);
user
.
getContacts
().
add
(
contacts2
);
userService
.
save
(
user
);
User
u
=
userService
.
save
(
user
);
return
view
;
map
.
put
(
"user"
,
u
);
return
map
;
}
}
@Auth
(
verifyLogin
=
false
,
verifyURL
=
false
)
@Auth
(
verifyLogin
=
false
,
verifyURL
=
false
)
...
@@ -303,231 +305,5 @@ public class UserController extends BaseController<Object>{
...
@@ -303,231 +305,5 @@ public class UserController extends BaseController<Object>{
}
}
return
view
;
return
view
;
}
}
@RequestMapping
(
"/api/product/save"
)
public
ModelAndView
saveProduct
(
ProductVo
productVo
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
ModelAndView
view
=
new
ModelAndView
();
User
userSession
=
SessionUtils
.
getUser
(
request
);
User
user
=
userService
.
findById
(
userSession
.
getId
());
Contacts
product
=
new
Contacts
();
Set
<
Contacts
>
productSet
=
user
.
getContacts
();
Iterator
<
Contacts
>
its
=
productSet
.
iterator
();
if
(
its
.
hasNext
())
{
product
=
its
.
next
();
}
product
.
setName
(
productVo
.
getName
());
product
.
setUpdateTime
(
new
Date
());
user
.
getContacts
().
clear
();
user
.
getContacts
().
add
(
product
);
userService
.
save
(
user
);
view
.
getModelMap
().
put
(
"message"
,
"success"
);
return
view
;
}
@RequestMapping
(
"/profile"
)
public
ModelAndView
profile
(
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
ModelAndView
view
=
new
ModelAndView
();
User
user
=
SessionUtils
.
getUser
(
request
);
view
.
getModelMap
().
put
(
"user"
,
userService
.
findById
(
user
.
getId
()));
view
.
setViewName
(
"profile"
);
return
view
;
}
@RequestMapping
(
"/product"
)
public
ModelAndView
product
(
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
ModelAndView
view
=
new
ModelAndView
();
User
userSession
=
SessionUtils
.
getUser
(
request
);
User
user
=
userService
.
findById
(
userSession
.
getId
());
Contacts
product
=
new
Contacts
();
Set
<
Contacts
>
productSet
=
user
.
getContacts
();
Iterator
<
Contacts
>
its
=
productSet
.
iterator
();
if
(
its
.
hasNext
())
{
product
=
its
.
next
();
}
view
.
getModelMap
().
put
(
"product"
,
product
);
view
.
getModelMap
().
put
(
"user"
,
user
);
view
.
setViewName
(
"product"
);
return
view
;
}
@RequestMapping
(
"/api/product/enroll/upload"
)
public
ModelAndView
uploadEnroll
(
@RequestParam
(
value
=
"enroll"
,
required
=
false
)
MultipartFile
file
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
ModelAndView
view
=
this
.
writeImportFile
(
file
,
"enroll"
,
new
ModelAndView
(),
request
);
return
view
;
}
@RequestMapping
(
"/api/product/report/upload"
)
public
ModelAndView
uploadReport
(
@RequestParam
(
value
=
"report"
,
required
=
false
)
MultipartFile
file
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
ModelAndView
view
=
this
.
writeImportFile
(
file
,
"report"
,
new
ModelAndView
(),
request
);
return
view
;
}
@RequestMapping
(
"/api/product/ppt/upload"
)
public
ModelAndView
uploadPPT
(
@RequestParam
(
value
=
"ppt"
,
required
=
false
)
MultipartFile
file
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
ModelAndView
view
=
this
.
writeImportFile
(
file
,
"ppt"
,
new
ModelAndView
(),
request
);
return
view
;
}
@RequestMapping
(
"/api/product/attachment/upload"
)
public
ModelAndView
uploadAttachment
(
@RequestParam
(
value
=
"attachment"
,
required
=
false
)
MultipartFile
file
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
ModelAndView
view
=
this
.
writeImportFile
(
file
,
"attachment"
,
new
ModelAndView
(),
request
);
return
view
;
}
public
ModelAndView
writeImportFile
(
MultipartFile
file
,
String
type
,
ModelAndView
view
,
HttpServletRequest
request
)
throws
Exception
{
if
(
file
!=
null
)
{
if
(
file
.
getSize
()<=
0
)
{
view
.
getModelMap
().
put
(
"status"
,
0
);
view
.
getModelMap
().
put
(
"size"
,
0
);
return
view
;
}
if
(
"enroll"
.
equals
(
type
)
&&
file
.
getSize
()
>
10240000
)
{
view
.
getModelMap
().
put
(
"size"
,
10
);
view
.
getModelMap
().
put
(
"status"
,
0
);
return
view
;
}
if
(
"report"
.
equals
(
type
)
&&
file
.
getSize
()
>
51200000
)
{
view
.
getModelMap
().
put
(
"size"
,
50
);
view
.
getModelMap
().
put
(
"status"
,
0
);
return
view
;
}
if
(
"ppt"
.
equals
(
type
)
&&
file
.
getSize
()
>
102400000
)
{
view
.
getModelMap
().
put
(
"size"
,
100
);
view
.
getModelMap
().
put
(
"status"
,
0
);
return
view
;
}
if
(
"attachment"
.
equals
(
type
)
&&
file
.
getSize
()
>
102400000
)
{
view
.
getModelMap
().
put
(
"size"
,
100
);
view
.
getModelMap
().
put
(
"status"
,
0
);
return
view
;
}
}
User
userSession
=
SessionUtils
.
getUser
(
request
);
ResourceBundle
rb
=
ResourceBundle
.
getBundle
(
"system"
);
String
path
=
rb
.
getString
(
"file_path"
)
+
"/"
;
File
f
=
new
File
(
path
);
if
(!
f
.
exists
()
&&
!
f
.
isDirectory
())
{
f
.
mkdir
();
}
path
=
path
+
type
+
"/"
;
f
=
new
File
(
path
);
if
(!
f
.
exists
()
&&
!
f
.
isDirectory
())
{
f
.
mkdir
();
}
if
(
f
.
exists
()
&&
f
.
isDirectory
())
{
String
[]
tempList
=
f
.
list
();
File
temp
=
null
;
for
(
int
i
=
0
;
i
<
tempList
.
length
;
i
++)
{
if
(
path
.
endsWith
(
File
.
separator
))
{
temp
=
new
File
(
path
+
tempList
[
i
]);
}
else
{
temp
=
new
File
(
path
+
File
.
separator
+
tempList
[
i
]);
}
if
(
temp
.
isFile
())
{
temp
.
delete
();
}
}
}
String
fileFullName
=
file
.
getOriginalFilename
();
FileOutputStream
t_fos
=
null
;
try
{
t_fos
=
new
FileOutputStream
(
new
File
(
path
,
fileFullName
),
true
);
t_fos
.
write
(
file
.
getBytes
());
}
finally
{
try
{
if
(
t_fos
!=
null
)
{
t_fos
.
flush
();
t_fos
.
close
();
}
}
catch
(
final
Exception
t_e
)
{
throw
t_e
;
}
}
view
.
getModelMap
().
put
(
"fileName"
,
fileFullName
);
view
.
getModelMap
().
put
(
"status"
,
1
);
User
user
=
userService
.
findById
(
userSession
.
getId
());
Contacts
product
=
new
Contacts
();
Set
<
Contacts
>
productSet
=
user
.
getContacts
();
Iterator
<
Contacts
>
its
=
productSet
.
iterator
();
if
(
its
.
hasNext
())
{
product
=
its
.
next
();
}
product
.
setUpdateTime
(
new
Date
());
user
.
getContacts
().
clear
();
user
.
getContacts
().
add
(
product
);
userService
.
save
(
user
);
return
view
;
}
@RequestMapping
(
"/api/product/download"
)
public
ModelAndView
downloadFile
(
String
fileName
,
String
type
,
String
userId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
ModelAndView
view
=
new
ModelAndView
();
FileInputStream
fis
=
null
;
OutputStream
os
=
null
;
try
{
User
userSession
=
SessionUtils
.
getUser
(
request
);
ResourceBundle
rb
=
ResourceBundle
.
getBundle
(
"system"
);
String
path
=
rb
.
getString
(
"file_path"
)
+
userId
+
"/"
+
type
+
"/"
+
fileName
;
response
.
setContentType
(
"application/octet-stream"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
//File file = new File(path);
fis
=
new
FileInputStream
(
path
);
os
=
response
.
getOutputStream
();
byte
[]
b
=
new
byte
[
1024
];
int
i
=
0
;
while
(
(
i
=
fis
.
read
(
b
))
>
0
)
{
os
.
write
(
b
,
0
,
i
);
}
os
.
flush
();
}
catch
(
IOException
e
)
{
;
}
finally
{
if
(
fis
!=
null
)
{
try
{
fis
.
close
();
fis
=
null
;
}
catch
(
Exception
e
)
{
//System.out.print(e.toString());
}
}
if
(
os
!=
null
)
{
try
{
os
.
close
();
os
=
null
;
}
catch
(
Exception
e
)
{
//System.out.print(e.toString());
}
}
}
view
.
setViewName
(
"download"
);
return
view
;
}
}
}
\ No newline at end of file
src/main/java/com/qiankun/dao/ActivityDao.java
0 → 100644
View file @
22310329
package
com
.
qiankun
.
dao
;
import
java.util.Date
;
import
com.qiankun.dao.core.Hints
;
import
com.qiankun.dao.core.IDao
;
import
com.qiankun.entity.Activity
;
import
com.qiankun.pages.IPageList
;
public
interface
ActivityDao
extends
IDao
<
Activity
,
String
>
{
IPageList
<
Activity
>
findActivityPage
(
String
searchStr
,
String
type
,
String
order
,
String
sort
,
Hints
hints
);
}
src/main/java/com/qiankun/dao/ActivityDaoImpl.java
0 → 100644
View file @
22310329
package
com
.
qiankun
.
dao
;
import
java.util.Date
;
import
org.springframework.stereotype.Repository
;
import
com.qiankun.dao.core.AbsDao
;
import
com.qiankun.dao.core.Hints
;
import
com.qiankun.entity.Activity
;
import
com.qiankun.pages.IPageList
;
import
com.qiankun.pages.PageListImpl
;
@Repository
public
class
ActivityDaoImpl
extends
AbsDao
<
Activity
,
String
>
implements
ActivityDao
{
private
static
final
String
FIND_ACTIVITY_PAGE
=
" from Activity where name like ? "
;
@Override
public
IPageList
<
Activity
>
findActivityPage
(
String
searchStr
,
String
type
,
String
order
,
String
sort
,
Hints
hints
)
{
if
(
order
==
null
){
order
=
" createTime "
;
}
if
(
sort
==
null
){
sort
=
" desc "
;
}
String
hql
=
""
;
if
(
type
!=
null
){
hql
=
" and type = '"
+
type
+
"'"
;
}
if
(
searchStr
==
null
)
{
searchStr
=
"%"
;
}
String
param
=
"%"
+
searchStr
+
"%"
;
IPageList
<
Activity
>
Activitys
=
new
PageListImpl
<
Activity
>();
Activitys
.
setRecords
(
find
(
FIND_ACTIVITY_PAGE
+
hql
+
sortHQL
(
order
,
sort
),
hints
,
param
));
Activitys
.
setRecordTotal
(
findCount
(
" select count(*) "
+
FIND_ACTIVITY_PAGE
+
hql
,
param
));
return
Activitys
;
}
}
src/main/java/com/qiankun/entity/Activity.java
View file @
22310329
...
@@ -40,9 +40,6 @@ public class Activity {
...
@@ -40,9 +40,6 @@ public class Activity {
@Lob
@Lob
private
String
content
;
//详细信息
private
String
content
;
//详细信息
@ManyToOne
private
User
review
;
//;
private
Date
day
;
//活动时间
private
Date
day
;
//活动时间
...
@@ -60,7 +57,7 @@ public class Activity {
...
@@ -60,7 +57,7 @@ public class Activity {
@JsonIgnore
@JsonIgnore
private
Set
<
User
>
user
=
new
HashSet
<
User
>();
private
Set
<
User
>
user
=
new
HashSet
<
User
>();
private
Date
upd
ateTime
=
new
Date
();
private
Date
cre
ateTime
=
new
Date
();
public
String
getId
()
{
public
String
getId
()
{
return
id
;
return
id
;
...
@@ -102,14 +99,6 @@ public class Activity {
...
@@ -102,14 +99,6 @@ public class Activity {
this
.
content
=
content
;
this
.
content
=
content
;
}
}
public
User
getReview
()
{
return
review
;
}
public
void
setReview
(
User
review
)
{
this
.
review
=
review
;
}
public
Date
getDay
()
{
public
Date
getDay
()
{
return
day
;
return
day
;
}
}
...
@@ -166,14 +155,15 @@ public class Activity {
...
@@ -166,14 +155,15 @@ public class Activity {
this
.
user
=
user
;
this
.
user
=
user
;
}
}
public
Date
get
Upd
ateTime
()
{
public
Date
get
Cre
ateTime
()
{
return
upd
ateTime
;
return
cre
ateTime
;
}
}
public
void
set
UpdateTime
(
Date
upd
ateTime
)
{
public
void
set
CreateTime
(
Date
cre
ateTime
)
{
this
.
updateTime
=
upd
ateTime
;
this
.
createTime
=
cre
ateTime
;
}
}
...
...
src/main/java/com/qiankun/service/ActivityService.java
0 → 100644
View file @
22310329
package
com
.
qiankun
.
service
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.qiankun.dao.ActivityDao
;
import
com.qiankun.dao.core.Hints
;
import
com.qiankun.entity.Activity
;
import
com.qiankun.pages.IPageList
;
@Service
public
class
ActivityService
{
@Autowired
private
ActivityDao
activityDao
;
public
Activity
findById
(
String
id
)
{
Activity
activity
=
activityDao
.
find
(
id
);
return
activity
;
}
@Transactional
public
void
save
(
Activity
activity
)
{
activityDao
.
save
(
activity
);
}
@Transactional
public
void
remove
(
String
id
)
{
activityDao
.
remove
(
id
);
}
public
IPageList
<
Activity
>
findByActivitys
(
String
searchStr
,
String
type
,
String
order
,
String
sort
,
Hints
hints
){
IPageList
<
Activity
>
activitys
=
activityDao
.
findActivityPage
(
searchStr
,
type
,
order
,
sort
,
hints
);
return
activitys
;
}
}
src/main/java/com/qiankun/service/UserService.java
View file @
22310329
package
com
.
qiankun
.
service
;
package
com
.
qiankun
.
service
;
import
org.dom4j.util.UserDataDocumentFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -24,8 +23,8 @@ public class UserService {
...
@@ -24,8 +23,8 @@ public class UserService {
@Transactional
@Transactional
public
void
save
(
User
user
)
{
public
User
save
(
User
user
)
{
userDao
.
save
(
user
);
return
userDao
.
save
(
user
);
}
}
@Transactional
@Transactional
...
...
src/main/java/com/qiankun/vo/ActivityVo.java
0 → 100644
View file @
22310329
package
com
.
qiankun
.
vo
;
import
java.util.Date
;
import
javax.persistence.Lob
;
import
javax.persistence.ManyToOne
;
import
com.qiankun.entity.User
;
public
class
ActivityVo
{
private
String
id
;
private
String
name
;
//活动名称
private
String
type
;
//活动类型
private
String
addr
;
//地点
private
String
content
;
//详细信息
private
Date
day
;
//活动时间
private
long
max
;
//最大人数;
private
String
crowd
;
//适用人群 1,2,3
private
boolean
available
;
//活动是否可用
private
String
contacts
;
//联系人
private
String
tel
;
//联系电话
}
src/main/webapp/WEB-INF/decorators/main.jsp
View file @
22310329
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
<ul
class=
"submenu"
>
<ul
class=
"submenu"
>
<li>
<li>
<a
href=
"
form-elements.html
"
>
<a
href=
"
<webpath:path/>/activity/list
"
>
<i
class=
"icon-double-angle-right"
></i>
<i
class=
"icon-double-angle-right"
></i>
活动管理
活动管理
</a>
</a>
...
@@ -276,7 +276,6 @@
...
@@ -276,7 +276,6 @@
<span
class=
"menu-text"
>
<span
class=
"menu-text"
>
礼物管理
礼物管理
</span>
</span>
</a>
</a>
</li>
</li>
...
...
src/main/webapp/WEB-INF/pages/activity/activitylist.jsp
0 → 100644
View file @
22310329
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="webpath" uri="/WEB-INF/tlds/path.tld"%>
<%@ taglib prefix="webpage" uri="/WEB-INF/tlds/pageview.tld"%>
<head>
</head>
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
<ul class="breadcrumb">
<li>
<i class="icon-home home-icon"></i>
<a href="#">首页</a>
</li>
<li class="active">活动管理</li>
</ul><!-- .breadcrumb -->
</div>
<div class="page-content">
<div class="row">
<div class="col-xs-12">
<div class="widget-toolbox">
<div class="btn-group">
<button class="btn btn-sm btn-success" onclick="window.location.href='<webpath:path/>/user/add'">
<i class="icon-plus-sign-alt bigger-110"></i>
新增
</button>
<button class="btn btn-sm btn-success">
<i class="icon-star-half-full bigger-110"></i>
禁用
</button>
<button class="btn btn-sm btn-danger">
<i class="icon-trash bigger-110"></i>
删除
</button>
</div>
</div>
<div class="pull-left">共条</div>
<table id="table-data" class="table table-bordered ">
<thead>
<tr class="">
<th class="center">
<label>
<input type="checkbox" class="ace">
<span class="lbl"></span>
</label>
</th>
<th>活动名称</th>
<th>活动类型</th>
<th>活动地址</th>
<th>活动时间</th>
<th>最大人数</th>
<th>适用人群</th>
<th>联系人</th>
<th>联系电话</th>
<th class="hidden-480">状态</th>
<th width="100">操作</th>
</tr>
</thead>
<tbody>
<tr class="tr-highlight">
<td class="center" width=10>
<label>
<input type="checkbox" class="ace">
<span class="lbl"></span>
</label>
</td>
<td title=""></td>
<td title=""></td>
<td title=""></td>
<td title=""></td>
<td title=""></td>
<td title=""></td>
<td title=""></td>
<td title=""></td>
<td title=""></td>
<td>
<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
<button class="btn btn-xs btn-info" onclick="window.location.href='<webpath:path/>/'">
<i class="icon-edit bigger-120"></i>
</button>
<button class="btn btn-xs btn-danger">
<i class="icon-trash bigger-120"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
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