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
dac969ef
Commit
dac969ef
authored
Apr 16, 2019
by
liuchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
12a10d95
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
261 additions
and
124 deletions
+261
-124
UserController.java
src/main/java/com/qiankun/controller/UserController.java
+111
-55
BaseController.java
...main/java/com/qiankun/controller/base/BaseController.java
+1
-1
User.java
src/main/java/com/qiankun/entity/User.java
+7
-0
UserVo.java
src/main/java/com/qiankun/vo/UserVo.java
+7
-0
saveuser.jsp
src/main/webapp/WEB-INF/pages/user/saveuser.jsp
+48
-48
userlist.jsp
src/main/webapp/WEB-INF/pages/user/userlist.jsp
+34
-17
style.css
src/main/webapp/resources/css/style.css
+7
-0
user.js
src/main/webapp/resources/js/user/user.js
+46
-3
No files found.
src/main/java/com/qiankun/controller/UserController.java
View file @
dac969ef
...
@@ -53,10 +53,72 @@ public class UserController extends BaseController<Object>{
...
@@ -53,10 +53,72 @@ public class UserController extends BaseController<Object>{
@RequestMapping
(
"/user/add"
)
@RequestMapping
(
"/user/add"
)
public
ModelAndView
index
(
)
throws
Exception
{
public
ModelAndView
userAdd
(
String
id
)
throws
Exception
{
ModelAndView
view
=
new
ModelAndView
();
ModelAndView
view
=
new
ModelAndView
();
UserVo
vo
=
new
UserVo
();
if
(
StringUtils
.
isNotBlank
(
id
))
{
User
user
=
userService
.
findById
(
id
);
vo
.
setId
(
user
.
getId
());
vo
.
setUserName
(
user
.
getMobile
());
vo
.
setUserCode
(
user
.
getUserCode
());
vo
.
setName
(
user
.
getName
());
vo
.
setGender
(
user
.
getGender
());
vo
.
setBirthday
(
user
.
getBirthday
());
vo
.
setPaperType
(
user
.
getPaperType
());
vo
.
setPaperId
(
user
.
getPaperId
());
vo
.
setNation
(
user
.
getNation
());
vo
.
setNativePlace
(
user
.
getNativePlace
());
vo
.
setNationality
(
user
.
getNationality
());
vo
.
setEducation
(
user
.
getEducation
());
vo
.
setDomicilePlace
(
user
.
getDomicilePlace
());
vo
.
setAddr
(
user
.
getAddr
());
vo
.
setUnit
(
user
.
getUnit
());
vo
.
setUnitAddr
(
user
.
getUnitAddr
());
vo
.
setUnitTel
(
user
.
getUnitTel
());
vo
.
setProfession
(
user
.
getProfession
());
vo
.
setMobile
(
user
.
getMobile
());
vo
.
setEmail
(
user
.
getEmail
());
vo
.
setTel
(
user
.
getTel
());
vo
.
setQq
(
user
.
getQq
());
vo
.
setWeixin
(
user
.
getWeixin
());
vo
.
setDonateBloodCount
(
user
.
getDonateBloodCount
());
vo
.
setBloodType
(
user
.
getBloodType
());
vo
.
setHeight
(
user
.
getHeight
());
vo
.
setWeight
(
user
.
getWeight
());
vo
.
setRemark
(
user
.
getRemark
());
vo
.
setRole
(
user
.
getRole
());
Set
<
Contacts
>
contacts
=
user
.
getContacts
();
Iterator
<
Contacts
>
its
=
contacts
.
iterator
();
Integer
count
=
0
;
while
(
its
.
hasNext
())
{
Contacts
c
=
its
.
next
();
if
(
count
==
0
)
{
vo
.
setContactsAddr1
(
c
.
getAddr
());
vo
.
setContactsName1
(
c
.
getName
());
vo
.
setContactsMobile1
(
c
.
getMobile
());
vo
.
setContactsRelation1
(
c
.
getRelation
());
vo
.
setContactsWeixin1
(
c
.
getWeixin
());
vo
.
setContactsQQ1
(
c
.
getQq
());
count
++;
}
else
{
vo
.
setContactsAddr2
(
c
.
getAddr
());
vo
.
setContactsName2
(
c
.
getName
());
vo
.
setContactsMobile2
(
c
.
getMobile
());
vo
.
setContactsRelation2
(
c
.
getRelation
());
vo
.
setContactsWeixin2
(
c
.
getWeixin
());
vo
.
setContactsQQ2
(
c
.
getQq
());
}
}
}
view
.
setViewName
(
"user/saveuser"
);
view
.
setViewName
(
"user/saveuser"
);
view
.
getModel
().
put
(
"dict"
,
dict
());
view
.
getModel
().
put
(
"dict"
,
dict
());
view
.
getModel
().
put
(
"user"
,
vo
);
return
view
;
return
view
;
}
}
...
@@ -67,6 +129,54 @@ public class UserController extends BaseController<Object>{
...
@@ -67,6 +129,54 @@ public class UserController extends BaseController<Object>{
ModelAndView
view
=
new
ModelAndView
();
ModelAndView
view
=
new
ModelAndView
();
User
user
=
new
User
();
User
user
=
new
User
();
Date
date
=
new
Date
();
if
(
StringUtils
.
isEmpty
(
userVo
.
getId
()))
{
Boolean
userIsExistPaperId
=
userService
.
validateUserExistByPaperId
(
userVo
.
getPaperId
());
if
(
userIsExistPaperId
)
{
view
.
getModelMap
().
put
(
"status"
,
0
);
view
.
getModel
().
put
(
"message"
,
"userIsExist_paperId"
);
return
view
;
}
Boolean
userIsExistUserName
=
userService
.
validateUserExistByUserName
(
userVo
.
getUserName
());
if
(
userIsExistUserName
)
{
view
.
getModelMap
().
put
(
"status"
,
0
);
view
.
getModel
().
put
(
"message"
,
"userIsExist_userName"
);
return
view
;
}
user
.
setCreateTime
(
date
);
user
.
setStatus
(
"0"
);
view
.
getModelMap
().
put
(
"status"
,
1
);
}
else
{
user
=
userService
.
findById
(
userVo
.
getId
());
if
(
StringUtils
.
isNotBlank
(
userVo
.
getPaperId
())
&&
!
userVo
.
getPaperId
().
equals
(
user
.
getPaperId
()))
{
Boolean
userIsExistPaperId
=
userService
.
validateUserExistByPaperId
(
userVo
.
getPaperId
());
if
(
userIsExistPaperId
)
{
view
.
getModelMap
().
put
(
"status"
,
0
);
view
.
getModel
().
put
(
"message"
,
"userIsExist_paperId"
);
return
view
;
}
}
if
(
StringUtils
.
isNotBlank
(
userVo
.
getUserName
())
&&
!
userVo
.
getUserName
().
equals
(
user
.
getUserName
()))
{
Boolean
userIsExistUserName
=
userService
.
validateUserExistByUserName
(
userVo
.
getUserName
());
if
(
userIsExistUserName
)
{
view
.
getModelMap
().
put
(
"status"
,
0
);
view
.
getModel
().
put
(
"message"
,
"userIsExist_userName"
);
return
view
;
}
}
user
.
setUpdateTime
(
date
);
user
.
getContacts
().
clear
();
view
.
getModelMap
().
put
(
"status"
,
2
);
}
user
.
setUserName
(
userVo
.
getMobile
());
user
.
setUserName
(
userVo
.
getMobile
());
user
.
setName
(
userVo
.
getName
());
user
.
setName
(
userVo
.
getName
());
...
@@ -95,32 +205,6 @@ public class UserController extends BaseController<Object>{
...
@@ -95,32 +205,6 @@ public class UserController extends BaseController<Object>{
user
.
setWeight
(
userVo
.
getWeight
());
user
.
setWeight
(
userVo
.
getWeight
());
user
.
setRemark
(
userVo
.
getRemark
());
user
.
setRemark
(
userVo
.
getRemark
());
user
.
setRole
(
userVo
.
getRole
());
user
.
setRole
(
userVo
.
getRole
());
user
.
setStatus
(
userVo
.
getStatus
());
if
(
StringUtils
.
isEmpty
(
userVo
.
getId
()))
{
Boolean
userIsExistPaperId
=
userService
.
validateUserExistByPaperId
(
userVo
.
getPaperId
());
if
(
userIsExistPaperId
)
{
view
.
getModel
().
put
(
"message"
,
"userIsExist_paperId"
);
return
view
;
}
Boolean
userIsExistUserName
=
userService
.
validateUserExistByUserName
(
userVo
.
getUserName
());
if
(
userIsExistUserName
)
{
view
.
getModel
().
put
(
"message"
,
"userIsExist_teamName"
);
return
view
;
}
Date
date
=
new
Date
();
user
.
setCreateTime
(
date
);
Contacts
contacts1
=
new
Contacts
();
Contacts
contacts1
=
new
Contacts
();
contacts1
.
setName
(
userVo
.
getContactsName1
());
contacts1
.
setName
(
userVo
.
getContactsName1
());
...
@@ -144,34 +228,6 @@ public class UserController extends BaseController<Object>{
...
@@ -144,34 +228,6 @@ public class UserController extends BaseController<Object>{
contacts2
.
setUser
(
user
);
contacts2
.
setUser
(
user
);
user
.
getContacts
().
add
(
contacts2
);
user
.
getContacts
().
add
(
contacts2
);
view
.
getModelMap
().
put
(
"status"
,
1
);
}
else
{
if
(
userVo
.
getChangePassword
()!=
null
&&
userVo
.
getChangePassword
()){
Boolean
validatePwd
=
userService
.
validatePwd
(
userVo
.
getId
(),
userVo
.
getOldpwd
());
if
(!
validatePwd
)
{
view
.
getModel
().
put
(
"message"
,
"oldPwdError"
);
return
view
;
}
}
user
=
userService
.
findById
(
userVo
.
getId
());
if
(
StringUtils
.
isNotBlank
(
userVo
.
getUserName
()))
{
Boolean
userIsExistUserName
=
userService
.
validateUserExistByUserName
(
userVo
.
getUserName
());
if
(
userIsExistUserName
)
{
view
.
getModel
().
put
(
"message"
,
"userIsExist_teamName"
);
return
view
;
}
}
if
(
userVo
.
getChangePassword
()!=
null
&&
userVo
.
getChangePassword
()){
user
.
setPwd
(
MD5
.
digest
(
userVo
.
getPwd
()));
}
user
.
setEmail
(
userVo
.
getEmail
());
}
userService
.
save
(
user
);
userService
.
save
(
user
);
return
view
;
return
view
;
}
}
...
...
src/main/java/com/qiankun/controller/base/BaseController.java
View file @
dac969ef
...
@@ -30,7 +30,7 @@ public class BaseController<Entity> extends MultiActionController {
...
@@ -30,7 +30,7 @@ public class BaseController<Entity> extends MultiActionController {
@Autowired
@Autowired
protected
ApplicationContext
ctx
;
protected
ApplicationContext
ctx
;
private
Integer
DEFAULT_COUNT
=
4
0
;
private
Integer
DEFAULT_COUNT
=
2
0
;
/**
/**
* 获取国际化.
* 获取国际化.
...
...
src/main/java/com/qiankun/entity/User.java
View file @
dac969ef
...
@@ -68,6 +68,7 @@ public class User {
...
@@ -68,6 +68,7 @@ public class User {
private
String
status
;
//状态 0.未采血 1.已采血
private
String
status
;
//状态 0.未采血 1.已采血
private
Date
createTime
=
new
Date
();
private
Date
createTime
=
new
Date
();
private
Date
updateTime
=
new
Date
();
@OneToMany
(
fetch
=
FetchType
.
LAZY
,
cascade
=
{
CascadeType
.
ALL
},
orphanRemoval
=
true
,
mappedBy
=
"user"
)
@OneToMany
(
fetch
=
FetchType
.
LAZY
,
cascade
=
{
CascadeType
.
ALL
},
orphanRemoval
=
true
,
mappedBy
=
"user"
)
@JsonIgnore
@JsonIgnore
...
@@ -323,6 +324,12 @@ public class User {
...
@@ -323,6 +324,12 @@ public class User {
public
void
setUserName
(
String
userName
)
{
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
this
.
userName
=
userName
;
}
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
...
...
src/main/java/com/qiankun/vo/UserVo.java
View file @
dac969ef
...
@@ -6,6 +6,7 @@ public class UserVo {
...
@@ -6,6 +6,7 @@ public class UserVo {
private
String
id
;
private
String
id
;
private
String
userCode
;
private
String
userName
;
//用户名
private
String
userName
;
//用户名
private
String
name
;
//姓名
private
String
name
;
//姓名
private
String
gender
;
//性别
private
String
gender
;
//性别
...
@@ -351,6 +352,12 @@ public class UserVo {
...
@@ -351,6 +352,12 @@ public class UserVo {
public
void
setContactsAddr2
(
String
contactsAddr2
)
{
public
void
setContactsAddr2
(
String
contactsAddr2
)
{
this
.
contactsAddr2
=
contactsAddr2
;
this
.
contactsAddr2
=
contactsAddr2
;
}
}
public
String
getUserCode
()
{
return
userCode
;
}
public
void
setUserCode
(
String
userCode
)
{
this
.
userCode
=
userCode
;
}
...
...
src/main/webapp/WEB-INF/pages/user/saveuser.jsp
View file @
dac969ef
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
<div class="col-xs-12">
<div class="col-xs-12">
<form action="#" id="userForm" name="userForm" method="post" onsubmit="return false" class="form-horizontal" role="form">
<form action="#" id="userForm" name="userForm" method="post" onsubmit="return false" class="form-horizontal" role="form">
<input type="hidden" id="id" name="id" value="${user.id}"/>
<div class="row">
<div class="row">
<div class="col-xs-12">
<div class="col-xs-12">
<h3 class="header smaller lighter blue">用户信息</h3></div>
<h3 class="header smaller lighter blue">用户信息</h3></div>
...
@@ -47,9 +47,10 @@
...
@@ -47,9 +47,10 @@
<div class="col-sm-9">
<div class="col-sm-9">
<select class="col-xs-10 col-sm-10" id="role" name="role">
<select class="col-xs-10 col-sm-10" id="role" name="role">
<option value="2">普通用户</option>
<option value="2"
<c:if test="${user.role==2}">selected</c:if>
>普通用户</option>
<option value="1">管理员</option>
<option value="1"
<c:if test="${user.role==1}">selected</c:if>
>管理员</option>
</select>
</select>
</div>
</div>
</div>
</div>
...
@@ -57,7 +58,7 @@
...
@@ -57,7 +58,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font> 姓名 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font> 姓名 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="name" name="name"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="name" name="name"
value="${user.name}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -69,11 +70,11 @@
...
@@ -69,11 +70,11 @@
<div class="col-sm-9">
<div class="col-sm-9">
<label>
<label>
<input name="gender" type="radio" class="ace" value="
male"
>
<input name="gender" type="radio" class="ace" value="
男" <c:if test="${user.gender=='男'}">checked</c:if>
>
<span class="lbl"> 男</span>
<span class="lbl"> 男</span>
</label>
</label>
<label>
<label>
<input name="gender" type="radio" class="ace" value="
female"
>
<input name="gender" type="radio" class="ace" value="
女" <c:if test="${user.gender=='女'}">checked</c:if>
>
<span class="lbl"> 女</span>
<span class="lbl"> 女</span>
</label>
</label>
...
@@ -87,13 +88,11 @@
...
@@ -87,13 +88,11 @@
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <font color="red">*</font> 出生日期 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <font color="red">*</font> 出生日期 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input class="col-xs-10 col-sm-10" id="birthday" name="birthday" type="text" data-date-format="yyyy-mm-dd" />
<input class="col-xs-10 col-sm-10" id="birthday" name="birthday" type="text" data-date-format="yyyy-mm-dd"
value="${user.birthday}"
/>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <font color="red">*</font> 证件类型 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <font color="red">*</font> 证件类型 </label>
...
@@ -101,15 +100,11 @@
...
@@ -101,15 +100,11 @@
<select class="col-xs-10 col-sm-10" id="paperType" name="paperType">
<select class="col-xs-10 col-sm-10" id="paperType" name="paperType">
<c:forEach var="value" items="${dict.paperType}">
<c:forEach var="value" items="${dict.paperType}">
<option value="${value}">${value}</option>
<option value="${value}"
<c:if test="${user.paperType==value}">selected</c:if>
>${value}</option>
</c:forEach>
</c:forEach>
</select>
</select>
</div>
</div>
</div>
</div>
...
@@ -119,7 +114,7 @@
...
@@ -119,7 +114,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <font color="red">*</font> 证件号码 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <font color="red">*</font> 证件号码 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="paperId" name="paperId"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="paperId" name="paperId"
value="${user.paperId}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -132,7 +127,7 @@
...
@@ -132,7 +127,7 @@
<div class="col-sm-9">
<div class="col-sm-9">
<select name="nation" id="nation" class="col-xs-10 col-sm-10">
<select name="nation" id="nation" class="col-xs-10 col-sm-10">
<c:forEach var="value" items="${dict.nation}">
<c:forEach var="value" items="${dict.nation}">
<option value="${value}" >${value}</option>
<option value="${value}"
<c:if test="${user.nation==value}">selected</c:if>
>${value}</option>
</c:forEach>
</c:forEach>
</select>
</select>
...
@@ -146,7 +141,7 @@
...
@@ -146,7 +141,7 @@
<div class="col-sm-9">
<div class="col-sm-9">
<select class="col-xs-10 col-sm-10" id="nationality" name="nationality">
<select class="col-xs-10 col-sm-10" id="nationality" name="nationality">
<c:forEach var="value" items="${dict.nationality}">
<c:forEach var="value" items="${dict.nationality}">
<option value="${value}">${value}</option>
<option value="${value}"
<c:if test="${user.nationality==value}">selected</c:if>
>${value}</option>
</c:forEach>
</c:forEach>
</select>
</select>
...
@@ -161,7 +156,7 @@
...
@@ -161,7 +156,7 @@
<div class="col-sm-9">
<div class="col-sm-9">
<select class="col-xs-10 col-sm-10" id="nativePlace" name="nativePlace">
<select class="col-xs-10 col-sm-10" id="nativePlace" name="nativePlace">
<c:forEach var="value" items="${dict.nativePlace}">
<c:forEach var="value" items="${dict.nativePlace}">
<option value="${value}">${value}</option>
<option value="${value}"
<c:if test="${user.nativePlace==value}">selected</c:if>
>${value}</option>
</c:forEach>
</c:forEach>
</select>
</select>
</div>
</div>
...
@@ -180,7 +175,7 @@
...
@@ -180,7 +175,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> 户籍所在地 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> 户籍所在地 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="domicilePlace" name="domicilePlace"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="domicilePlace" name="domicilePlace"
value="${user.domicilePlace}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -188,7 +183,7 @@
...
@@ -188,7 +183,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font> 经常居住地</label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font> 经常居住地</label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="addr" name="addr"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="addr" name="addr"
value="${user.addr}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -200,7 +195,7 @@
...
@@ -200,7 +195,7 @@
<select class="col-xs-10 col-sm-10" id="education" name="education">
<select class="col-xs-10 col-sm-10" id="education" name="education">
<option value="">请选择</option>
<option value="">请选择</option>
<c:forEach var="value" items="${dict.education}">
<c:forEach var="value" items="${dict.education}">
<option value="${value}">${value}</option>
<option value="${value}"
<c:if test="${user.education==value}">selected</c:if>
>${value}</option>
</c:forEach>
</c:forEach>
</select>
</select>
...
@@ -212,7 +207,7 @@
...
@@ -212,7 +207,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 工作单位/学校 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 工作单位/学校 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="unit" name="unit"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="unit" name="unit"
value="${user.unit}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -224,7 +219,7 @@
...
@@ -224,7 +219,7 @@
<select class="col-xs-10 col-sm-10" id="profession" name="profession">
<select class="col-xs-10 col-sm-10" id="profession" name="profession">
<option value="">请选择</option>
<option value="">请选择</option>
<c:forEach var="value" items="${dict.profession}">
<c:forEach var="value" items="${dict.profession}">
<option value="${value}">${value}</option>
<option value="${value}"
<c:if test="${user.profession==value}">selected</c:if>
>${value}</option>
</c:forEach>
</c:forEach>
</select>
</select>
...
@@ -237,7 +232,7 @@
...
@@ -237,7 +232,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 单位/学校地址 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 单位/学校地址 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="unitAddr" name="unitAddr"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="unitAddr" name="unitAddr"
value="${user.unitAddr}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -247,7 +242,7 @@
...
@@ -247,7 +242,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 单位/学校电话 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 单位/学校电话 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="unitTel" name="unitTel"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="unitTel" name="unitTel"
value="${user.unitTel}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -256,7 +251,7 @@
...
@@ -256,7 +251,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font> 本人手机 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font> 本人手机 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="mobile" name="mobile"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="mobile" name="mobile"
value="${user.mobile}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -265,7 +260,7 @@
...
@@ -265,7 +260,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 固定电话 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 固定电话 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="tel" name="tel"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="tel" name="tel"
value="${user.tel}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -278,7 +273,7 @@
...
@@ -278,7 +273,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 邮箱 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 邮箱 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="email" name="email"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="email" name="email"
value="${user.email}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -286,7 +281,7 @@
...
@@ -286,7 +281,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font>QQ号码 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font>QQ号码 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="qq" name="qq"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="qq" name="qq"
value="${user.qq}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -295,7 +290,7 @@
...
@@ -295,7 +290,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 微信号 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 微信号 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="weixin" name="weixin"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="weixin" name="weixin"
value="${user.weixin}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -305,7 +300,7 @@
...
@@ -305,7 +300,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 无偿献血次数 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 无偿献血次数 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="donateBloodCount" name="donateBloodCount"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="donateBloodCount" name="donateBloodCount"
value="${user.donateBloodCount}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -314,7 +309,12 @@
...
@@ -314,7 +309,12 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 血型 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 血型 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="bloodType" name="bloodType" placeholder="" class="col-xs-10 col-sm-10" />
<select class="col-xs-10 col-sm-10" id="bloodType" name="bloodType">
<option value="">请选择</option>
<c:forEach var="value" items="${dict.bloodType}">
<option value="${value}" <c:if test="${user.bloodType==value}">selected</c:if>>${value}</option>
</c:forEach>
</select>
</div>
</div>
</div>
</div>
...
@@ -322,7 +322,7 @@
...
@@ -322,7 +322,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 身高 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 身高 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="height" name="height"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="height" name="height"
value="${user.height}
" class="col-xs-10 col-sm-10" />
<span class="help-inline col-xs-12 col-sm-2">
<span class="help-inline col-xs-12 col-sm-2">
<span class="middle">cm</span>
<span class="middle">cm</span>
</span>
</span>
...
@@ -333,7 +333,7 @@
...
@@ -333,7 +333,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 体重 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 体重 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="weight" name="weight"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="weight" name="weight"
value="${user.weight}
" class="col-xs-10 col-sm-10" />
<span class="help-inline col-xs-12 col-sm-2">
<span class="help-inline col-xs-12 col-sm-2">
<span class="middle">kg</span>
<span class="middle">kg</span>
</span>
</span>
...
@@ -345,7 +345,7 @@
...
@@ -345,7 +345,7 @@
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 备注 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 备注 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<textarea rows="4" class="col-xs-10 col-sm-10" id="remark" name="remark"></textarea>
<textarea rows="4" class="col-xs-10 col-sm-10" id="remark" name="remark">
${user.remark}
</textarea>
</div>
</div>
</div>
</div>
...
@@ -366,7 +366,7 @@
...
@@ -366,7 +366,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font>姓名 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font>姓名 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="contactsName1" name="contactsName1"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="contactsName1" name="contactsName1"
value="${user.contactsName1}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -374,7 +374,7 @@
...
@@ -374,7 +374,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> QQ号 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> QQ号 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="contactsQQ1" name="contactsQQ1"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="contactsQQ1" name="contactsQQ1"
value="${user.contactsQQ1}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -389,7 +389,7 @@
...
@@ -389,7 +389,7 @@
<select class="col-xs-10 col-sm-10" id="contactsRelation1" name="contactsRelation1">
<select class="col-xs-10 col-sm-10" id="contactsRelation1" name="contactsRelation1">
<option value="">请选择</option>
<option value="">请选择</option>
<c:forEach var="value" items="${dict.relation}">
<c:forEach var="value" items="${dict.relation}">
<option value="${value}">${value}</option>
<option value="${value}"
<c:if test="${user.contactsRelation1==value}">selected</c:if>
>${value}</option>
</c:forEach>
</c:forEach>
</select>
</select>
...
@@ -399,7 +399,7 @@
...
@@ -399,7 +399,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 微信号</label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 微信号</label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="contactsWeixin1" name="contactsWeixin1"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="contactsWeixin1" name="contactsWeixin1"
value="${user.contactsWeixin1}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -410,7 +410,7 @@
...
@@ -410,7 +410,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font>手机</label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font>手机</label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="contactsMobile1" name="contactsMobile1"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="contactsMobile1" name="contactsMobile1"
value="${user.contactsMobile1}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -418,7 +418,7 @@
...
@@ -418,7 +418,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 联系地址</label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 联系地址</label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="contactsAddr1" name="contactsAddr1"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="contactsAddr1" name="contactsAddr1"
value="${user.contactsAddr1}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -437,7 +437,7 @@
...
@@ -437,7 +437,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font>姓名 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font>姓名 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="contactsName2" name="contactsName2"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="contactsName2" name="contactsName2"
value="${user.contactsName2}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -445,7 +445,7 @@
...
@@ -445,7 +445,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> QQ号 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> QQ号 </label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="contactsQQ2" name="contactsQQ2"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="contactsQQ2" name="contactsQQ2"
value="${user.contactsQQ2}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -460,7 +460,7 @@
...
@@ -460,7 +460,7 @@
<select class="col-xs-10 col-sm-10" id="contactsRelation2" name="contactsRelation2">
<select class="col-xs-10 col-sm-10" id="contactsRelation2" name="contactsRelation2">
<option value="">请选择</option>
<option value="">请选择</option>
<c:forEach var="value" items="${dict.relation}">
<c:forEach var="value" items="${dict.relation}">
<option value="${value}">${value}</option>
<option value="${value}"
<c:if test="${user.contactsRelation2==value}">selected</c:if>
>${value}</option>
</c:forEach>
</c:forEach>
</select>
</select>
</div>
</div>
...
@@ -469,7 +469,7 @@
...
@@ -469,7 +469,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 微信号</label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 微信号</label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="contactsWeixin2" name="contactsWeixin2"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="contactsWeixin2" name="contactsWeixin2"
value="${user.contactsWeixin2}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -480,7 +480,7 @@
...
@@ -480,7 +480,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font>手机</label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font>手机</label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="contactsMobile2" name="contactsMobile2"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="contactsMobile2" name="contactsMobile2"
value="${user.contactsMobile2}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -488,7 +488,7 @@
...
@@ -488,7 +488,7 @@
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 联系地址</label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 联系地址</label>
<div class="col-sm-9">
<div class="col-sm-9">
<input type="text" id="contactsAddr2" name="contactsAddr2"
placeholder="
" class="col-xs-10 col-sm-10" />
<input type="text" id="contactsAddr2" name="contactsAddr2"
value="${user.contactsAddr2}
" class="col-xs-10 col-sm-10" />
</div>
</div>
</div>
</div>
...
@@ -498,7 +498,7 @@
...
@@ -498,7 +498,7 @@
<div class="col-md-offset-3 col-md-9">
<div class="col-md-offset-3 col-md-9">
<button class="btn btn-sm btn-success">
<button class="btn btn-sm btn-success"
type="submit"
>
<i class="icon-save bigger-110"></i>
<i class="icon-save bigger-110"></i>
保存
保存
</button>
</button>
...
...
src/main/webapp/WEB-INF/pages/user/userlist.jsp
View file @
dac969ef
...
@@ -49,9 +49,10 @@
...
@@ -49,9 +49,10 @@
</div>
</div>
</div>
</div>
<table id="sample-table-1" class="table table-striped table-bordered table-hover">
<div class="pull-left">共${userPage.recordTotal}条</div>
<table id="table-data" class="table table-bordered ">
<thead>
<thead>
<tr
>
<tr class=""
>
<th class="center">
<th class="center">
<label>
<label>
<input type="checkbox" class="ace">
<input type="checkbox" class="ace">
...
@@ -78,8 +79,8 @@
...
@@ -78,8 +79,8 @@
<tbody>
<tbody>
<c:forEach var="user" items="${userPage.records}">
<tr
>
<tr class="tr-highlight"
>
<td class="center" width=10>
<td class="center" width=10>
<label>
<label>
<input type="checkbox" class="ace">
<input type="checkbox" class="ace">
...
@@ -87,26 +88,38 @@
...
@@ -87,26 +88,38 @@
</label>
</label>
</td>
</td>
<td></td>
<td title="${user.name}">${user.name} </td>
<td></td>
<td title="${user.gender}">${user.gender}</td>
<td></td>
<td title="${user.birthday}">${user.birthday} </td>
<td></td>
<td title="${user.nativePlace}">${user.nativePlace} </td>
<td title="${user.paperType}">${user.paperType} </td>
<td></td>
<td></td>
<td title="${user.paperId}">${user.paperId} </td>
<td></td>
<td title="${user.mobile}">${user.mobile} </td>
<td></td>
<td >
<td></td>
<c:if test="${user.role==1}">
管理员
</c:if>
<c:if test="${user.role==2}">
普通用户
</c:if>
</td>
<td title="${user.createTime}">${user.createTime} </td>
<td>
<td>
<c:if test="${user.status==0 || user.status==null}">
<span class="label label-sm label-warning">未采血</span>
<span class="label label-sm label-warning">未采血</span>
</c:if>
<c:if test="${user.status==1}">
<span class="label label-sm label-success">已采血</span>
</c:if>
</td>
</td>
<td>
<td>
<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
<button class="btn btn-xs btn-info
">
<button class="btn btn-xs btn-info" onclick="window.location.href='<webpath:path/>/user/add?id=${user.id}'
">
<i class="icon-edit bigger-120"></i>
<i class="icon-edit bigger-120"></i>
</button>
</button>
...
@@ -121,7 +134,7 @@
...
@@ -121,7 +134,7 @@
</td>
</td>
</tr>
</tr>
</c:forEach>
...
@@ -134,7 +147,11 @@
...
@@ -134,7 +147,11 @@
<webpage:page totalCount="${userPage.recordTotal}"
pageCount="${pageCount}" currentPage="${pageNumber}"
action="/user/list"
className="pageable-div pagination"
innerStyle=" float: left; width: 100%" />
</div>
</div>
</div>
</div>
...
...
src/main/webapp/resources/css/style.css
View file @
dac969ef
...
@@ -1068,7 +1068,14 @@ input.error{
...
@@ -1068,7 +1068,14 @@ input.error{
}
}
.table
thead
>
tr
>
th
,
.table
tbody
>
tr
>
th
,
.table
tfoot
>
tr
>
th
,
.table
thead
>
tr
>
td
,
.table
tbody
>
tr
>
td
,
.table
tfoot
>
tr
>
td
{
padding-left
:
3px
;
padding-right
:
3px
;
}
.table
thead
>
tr
.tr-highlight
:hover
,
.table
tbody
>
tr
.tr-highlight
:hover
{
background
:
rgba
(
173
,
216
,
230
,
1
);
}
...
...
src/main/webapp/resources/js/user/user.js
View file @
dac969ef
...
@@ -139,7 +139,9 @@ var user = {
...
@@ -139,7 +139,9 @@ var user = {
url
:
'/api/user/save'
,
url
:
'/api/user/save'
,
dataType
:
'json'
,
dataType
:
'json'
,
data
:
{
data
:
{
id
:
$
(
'#id'
).
val
(),
role
:
$
(
'#role'
).
val
(),
role
:
$
(
'#role'
).
val
(),
userName
:
$
(
'#mobile'
).
val
(),
name
:
$
(
'#name'
).
val
(),
name
:
$
(
'#name'
).
val
(),
gender
:
$
(
'input:radio[name="gender"]:checked'
).
val
(),
gender
:
$
(
'input:radio[name="gender"]:checked'
).
val
(),
birthday
:
$
(
'#birthday'
).
val
(),
birthday
:
$
(
'#birthday'
).
val
(),
...
@@ -185,23 +187,64 @@ var user = {
...
@@ -185,23 +187,64 @@ var user = {
bootbox
.
dialog
({
bootbox
.
dialog
({
message
:
"新增用户成功"
,
message
:
"新增用户成功"
,
buttons
:{
buttons
:{
"
success
"
:{
"
cancel
"
:{
"label"
:
"返回"
,
"label"
:
"返回"
,
"className"
:
"btn-sm btn-primary"
,
"className"
:
"btn-sm btn-primary"
,
"callback"
:
function
()
{
"callback"
:
function
()
{
window
.
location
.
href
=
'<webpath:path/>/
'
;
window
.
location
.
href
=
webPath
+
'/user/list
'
;
}
}
},
},
"success"
:{
"success"
:{
"label"
:
"继续添加"
,
"label"
:
"继续添加"
,
"className"
:
"btn-sm btn-primary"
,
"className"
:
"btn-sm btn-primary"
,
"callback"
:
function
()
{
"callback"
:
function
()
{
window
.
location
.
href
=
'<webpath:path/>/'
;
window
.
location
.
href
=
webPath
+
'/user/add'
;
}
}
}
}
}
});
}
else
if
(
status
==
0
){
isSubmit
=
true
;
var
message
=
data
.
message
;
if
(
message
==
"userIsExist_userName"
){
bootbox
.
dialog
({
message
:
"手机号已存在,新增失败!"
,
buttons
:{
"success"
:{
"label"
:
"OK"
,
"className"
:
"btn-sm btn-primary"
}
}
}
});
});
}
else
if
(
message
==
"userIsExist_paperId"
){
bootbox
.
dialog
({
message
:
"证件号已存在,添加失败!"
,
buttons
:{
"success"
:{
"label"
:
"OK"
,
"className"
:
"btn-sm btn-primary"
}
}
});
}
}
else
if
(
status
==
2
){
isSubmit
=
true
;
bootbox
.
dialog
({
message
:
"修改用户成功"
,
buttons
:{
"success"
:{
"label"
:
"确定"
,
"className"
:
"btn-sm btn-primary"
,
"callback"
:
function
()
{
}
}
}
});
}
}
...
...
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