Commit 12a10d95 authored by liuchao's avatar liuchao

no message

parent cebace75
...@@ -67,11 +67,49 @@ public class UserController extends BaseController<Object>{ ...@@ -67,11 +67,49 @@ public class UserController extends BaseController<Object>{
ModelAndView view = new ModelAndView(); ModelAndView view = new ModelAndView();
User user = new User(); User user = new User();
user.setUserName(userVo.getMobile());
user.setName(userVo.getName());
user.setGender(userVo.getGender());
user.setBirthday(userVo.getBirthday());
user.setPaperType(userVo.getPaperType());
user.setPaperId(userVo.getPaperId());
user.setNation(userVo.getNation());
user.setNativePlace(userVo.getNativePlace());
user.setNationality(userVo.getNationality());
user.setEducation(userVo.getEducation());
user.setDomicilePlace(userVo.getDomicilePlace());
user.setAddr(userVo.getAddr());
user.setUnit(userVo.getUnit());
user.setUnitAddr(userVo.getUnitAddr());
user.setUnitTel(userVo.getUnitTel());
user.setProfession(userVo.getProfession());
user.setMobile(userVo.getMobile());
user.setEmail(userVo.getEmail());
user.setTel(userVo.getTel());
user.setQq(userVo.getQq());
user.setWeixin(userVo.getWeixin());
user.setDonateBloodCount(userVo.getDonateBloodCount());
user.setBloodType(userVo.getBloodType());
user.setHeight(userVo.getHeight());
user.setWeight(userVo.getWeight());
user.setRemark(userVo.getRemark());
user.setRole(userVo.getRole());
user.setStatus(userVo.getStatus());
if (StringUtils.isEmpty(userVo.getId())) { if (StringUtils.isEmpty(userVo.getId())) {
Boolean userIsExistMobile = userService.validateUserExistByPaperId(userVo.getPaperId()); Boolean userIsExistPaperId = userService.validateUserExistByPaperId(userVo.getPaperId());
if (userIsExistMobile) { if (userIsExistPaperId) {
view.getModel().put("message", "userIsExist_paperId"); view.getModel().put("message", "userIsExist_paperId");
return view; return view;
} }
...@@ -81,23 +119,32 @@ public class UserController extends BaseController<Object>{ ...@@ -81,23 +119,32 @@ public class UserController extends BaseController<Object>{
view.getModel().put("message", "userIsExist_teamName"); view.getModel().put("message", "userIsExist_teamName");
return view; return view;
} }
Date date = new Date();
user.setCreateTime(date);
user.setMobile(userVo.getMobile()); Contacts contacts1 = new Contacts();
user.setPwd(MD5.digest(userVo.getPwd())); contacts1.setName(userVo.getContactsName1());
user.setUserName(userVo.getUserName()); contacts1.setAddr(userVo.getContactsAddr1());
contacts1.setMobile(userVo.getContactsMobile1());
contacts1.setRelation(userVo.getContactsRelation1());
contacts1.setWeixin(userVo.getContactsWeixin1());
contacts1.setQq(userVo.getContactsQQ1());
contacts1.setUpdateTime(date);
contacts1.setUser(user);
user.getContacts().add(contacts1);
user.setEmail(userVo.getEmail()); Contacts contacts2 = new Contacts();
Date date = new Date(); contacts2.setName(userVo.getContactsName2());
user.setCreateTime(date); contacts2.setAddr(userVo.getContactsAddr2());
contacts2.setMobile(userVo.getContactsMobile2());
contacts2.setRelation(userVo.getContactsRelation2());
contacts2.setWeixin(userVo.getContactsWeixin2());
contacts2.setQq(userVo.getContactsQQ2());
contacts2.setUpdateTime(date);
contacts2.setUser(user);
user.getContacts().add(contacts2);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
String year = sdf.format(date);
Contacts product = new Contacts();
product.setUser(user);
user.getContacts().add(product);
view.getModelMap().put("status", 1); view.getModelMap().put("status", 1);
} else { } else {
...@@ -120,7 +167,7 @@ public class UserController extends BaseController<Object>{ ...@@ -120,7 +167,7 @@ public class UserController extends BaseController<Object>{
if(userVo.getChangePassword()!=null && userVo.getChangePassword()){ if(userVo.getChangePassword()!=null && userVo.getChangePassword()){
user.setPwd(MD5.digest(userVo.getPwd())); user.setPwd(MD5.digest(userVo.getPwd()));
} }
user.setUserName(userVo.getUserName());
user.setEmail(userVo.getEmail()); user.setEmail(userVo.getEmail());
...@@ -144,7 +191,6 @@ public class UserController extends BaseController<Object>{ ...@@ -144,7 +191,6 @@ public class UserController extends BaseController<Object>{
if (p.equals(pwd)) { if (p.equals(pwd)) {
User user = new User(); User user = new User();
user.setMobile(superAdmin); user.setMobile(superAdmin);
user.setUserName(superAdmin);
user.setPwd(MD5.digest(pwd)); user.setPwd(MD5.digest(pwd));
SessionUtils.setUser(request, user); SessionUtils.setUser(request, user);
view.getModelMap().addAttribute("status", 1); view.getModelMap().addAttribute("status", 1);
......
...@@ -30,7 +30,8 @@ public class User { ...@@ -30,7 +30,8 @@ public class User {
@GeneratedValue(generator = "systemUUID") @GeneratedValue(generator = "systemUUID")
private String id; private String id;
private String userName; //用户名 private String userName;
private String userCode; //用户二维码
private String name; //姓名 private String name; //姓名
private String gender; //性别 private String gender; //性别
private String birthday; //出生年月 private String birthday; //出生年月
...@@ -51,6 +52,7 @@ public class User { ...@@ -51,6 +52,7 @@ public class User {
private String email; //邮箱 private String email; //邮箱
private String tel; //固定电话 private String tel; //固定电话
private String qq; private String qq;
private String weixin; //微信号
private String openid; //微信openid private String openid; //微信openid
private Integer donateBloodCount; //无偿献血次数 private Integer donateBloodCount; //无偿献血次数
private String bloodType; //血型 private String bloodType; //血型
...@@ -94,12 +96,6 @@ public class User { ...@@ -94,12 +96,6 @@ public class User {
this.id = id; this.id = id;
} }
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getMobile() { public String getMobile() {
return mobile; return mobile;
} }
...@@ -309,6 +305,24 @@ public class User { ...@@ -309,6 +305,24 @@ public class User {
public void setPoints(Set<Points> points) { public void setPoints(Set<Points> points) {
this.points = points; this.points = points;
} }
public String getWeixin() {
return weixin;
}
public void setWeixin(String weixin) {
this.weixin = weixin;
}
public String getUserCode() {
return userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
......
package com.qiankun.vo; package com.qiankun.vo;
import javax.persistence.Lob; import java.util.Date;
public class UserVo { public class UserVo {
private String id; private String id;
private String userName; //用户名 private String userName; //用户名
private String name; //姓名 private String name; //姓名
private String gender; //性别 private String gender; //性别
private String birthdate; //出生年月 private String birthday; //出生年月
private String paperType; //证件类型 private String paperType; //证件类型 1.身份证
private String paperId; //证件号 private String paperId; //证件号
private String nation; //民族 private String nation; //民族
private String nativePlace; //籍贯 private String nativePlace; //籍贯
...@@ -24,21 +24,35 @@ private String id; ...@@ -24,21 +24,35 @@ private String id;
private String profession; //职业 private String profession; //职业
private String mobile; //本人手机 private String mobile; //本人手机
private String email; //电话 private String email; //邮箱
private String tel; //固定电话 private String tel; //固定电话
private String qq; private String qq;
private String weixin; //微信号 private String weixin; //微信号
private String openid; //微信openid
private Integer donateBloodCount; //无偿献血次数 private Integer donateBloodCount; //无偿献血次数
private String bloodType; //血型 private String bloodType; //血型
private Integer height; //身高 private Integer height; //身高
private Integer weight; //体重 private Integer weight; //体重
@Lob
private String remark; //备注 private String remark; //备注
private String contactsName1;
private String contactsQQ1;
private String contactsRelation1;
private String contactsWeixin1;
private String contactsMobile1;
private String contactsAddr1;
private String contactsName2;
private String contactsQQ2;
private String contactsRelation2;
private String contactsWeixin2;
private String contactsMobile2;
private String contactsAddr2;
private String pwd; //密码 private String pwd; //密码
private String role; //角色 1.管理员 2.志愿者 3.预注册用户 private String role; //角色 1.管理员 2.志愿者
private String status; //状态 0.未采血 1.已采血
private String oldpwd; //原密码 private String oldpwd; //原密码
private Boolean changePassword; private Boolean changePassword;
...@@ -70,12 +84,7 @@ private String id; ...@@ -70,12 +84,7 @@ private String id;
public void setGender(String gender) { public void setGender(String gender) {
this.gender = gender; this.gender = gender;
} }
public String getBirthdate() {
return birthdate;
}
public void setBirthdate(String birthdate) {
this.birthdate = birthdate;
}
public String getPaperType() { public String getPaperType() {
return paperType; return paperType;
} }
...@@ -172,12 +181,7 @@ private String id; ...@@ -172,12 +181,7 @@ private String id;
public void setQq(String qq) { public void setQq(String qq) {
this.qq = qq; this.qq = qq;
} }
public String getWeixin() {
return weixin;
}
public void setWeixin(String weixin) {
this.weixin = weixin;
}
public Integer getDonateBloodCount() { public Integer getDonateBloodCount() {
return donateBloodCount; return donateBloodCount;
} }
...@@ -250,6 +254,103 @@ private String id; ...@@ -250,6 +254,103 @@ private String id;
public void setOldpwd(String oldpwd) { public void setOldpwd(String oldpwd) {
this.oldpwd = oldpwd; this.oldpwd = oldpwd;
} }
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getWeixin() {
return weixin;
}
public void setWeixin(String weixin) {
this.weixin = weixin;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getContactsName1() {
return contactsName1;
}
public void setContactsName1(String contactsName1) {
this.contactsName1 = contactsName1;
}
public String getContactsQQ1() {
return contactsQQ1;
}
public void setContactsQQ1(String contactsQQ1) {
this.contactsQQ1 = contactsQQ1;
}
public String getContactsRelation1() {
return contactsRelation1;
}
public void setContactsRelation1(String contactsRelation1) {
this.contactsRelation1 = contactsRelation1;
}
public String getContactsWeixin1() {
return contactsWeixin1;
}
public void setContactsWeixin1(String contactsWeixin1) {
this.contactsWeixin1 = contactsWeixin1;
}
public String getContactsMobile1() {
return contactsMobile1;
}
public void setContactsMobile1(String contactsMobile1) {
this.contactsMobile1 = contactsMobile1;
}
public String getContactsAddr1() {
return contactsAddr1;
}
public void setContactsAddr1(String contactsAddr1) {
this.contactsAddr1 = contactsAddr1;
}
public String getContactsName2() {
return contactsName2;
}
public void setContactsName2(String contactsName2) {
this.contactsName2 = contactsName2;
}
public String getContactsQQ2() {
return contactsQQ2;
}
public void setContactsQQ2(String contactsQQ2) {
this.contactsQQ2 = contactsQQ2;
}
public String getContactsRelation2() {
return contactsRelation2;
}
public void setContactsRelation2(String contactsRelation2) {
this.contactsRelation2 = contactsRelation2;
}
public String getContactsWeixin2() {
return contactsWeixin2;
}
public void setContactsWeixin2(String contactsWeixin2) {
this.contactsWeixin2 = contactsWeixin2;
}
public String getContactsMobile2() {
return contactsMobile2;
}
public void setContactsMobile2(String contactsMobile2) {
this.contactsMobile2 = contactsMobile2;
}
public String getContactsAddr2() {
return contactsAddr2;
}
public void setContactsAddr2(String contactsAddr2) {
this.contactsAddr2 = contactsAddr2;
}
......
...@@ -20,7 +20,7 @@ tjmdp.msgDataFormat=JSON ...@@ -20,7 +20,7 @@ tjmdp.msgDataFormat=JSON
nation=\u6c49\u65cf,\u8499\u53e4\u65cf,\u56de\u65cf,\u85cf\u65cf,\u7ef4\u543e\u5c14\u65cf,\u82d7\u65cf,\u5f5d\u65cf,\u58ee\u65cf,\u5e03\u4f9d\u65cf,\u671d\u9c9c\u65cf,\u6ee1\u65cf,\u4f97\u65cf,\u7476\u65cf,\u767d\u65cf,\u571f\u5bb6\u65cf,\u54c8\u5c3c\u65cf,\u54c8\u8428\u514b\u65cf,\u50a3\u65cf,\u9ece\u65cf,\u5088\u50f3\u65cf,\u4f64\u65cf,\u7572\u65cf,\u9ad8\u5c71\u65cf,\u62c9\u795c\u65cf,\u6c34\u65cf,\u4e1c\u4e61\u65cf,\u7eb3\u897f\u65cf,\u666f\u9887\u65cf,\u67ef\u5c14\u514b\u5b5c\u65cf,\u571f\u65cf,\u8fbe\u65a1\u5c14\u65cf,\u4eeb\u4f6c\u65cf,\u7f8c\u65cf,\u5e03\u6717\u65cf,\u6492\u62c9\u65cf,\u6bdb\u5357\u65cf,\u4ee1\u4f6c\u65cf,\u9521\u4f2f\u65cf,\u963f\u660c\u65cf,\u666e\u7c73\u65cf,\u5854\u5409\u514b\u65cf,\u6012\u65cf,\u4e4c\u5b5c\u522b\u514b\u65cf,\u4fc4\u7f57\u65af\u65cf,\u9102\u6e29\u514b\u65cf,\u5fb7\u6602\u65cf,\u4fdd\u5b89\u65cf,\u88d5\u56fa\u65cf,\u4eac\u65cf,\u5854\u5854\u5c14\u65cf,\u72ec\u9f99\u65cf,\u9102\u4f26\u6625\u65cf,\u8d6b\u54f2\u65cf,\u95e8\u5df4\u65cf,\u73de\u5df4\u65cf,\u57fa\u8bfa\u65cf nation=\u6c49\u65cf,\u8499\u53e4\u65cf,\u56de\u65cf,\u85cf\u65cf,\u7ef4\u543e\u5c14\u65cf,\u82d7\u65cf,\u5f5d\u65cf,\u58ee\u65cf,\u5e03\u4f9d\u65cf,\u671d\u9c9c\u65cf,\u6ee1\u65cf,\u4f97\u65cf,\u7476\u65cf,\u767d\u65cf,\u571f\u5bb6\u65cf,\u54c8\u5c3c\u65cf,\u54c8\u8428\u514b\u65cf,\u50a3\u65cf,\u9ece\u65cf,\u5088\u50f3\u65cf,\u4f64\u65cf,\u7572\u65cf,\u9ad8\u5c71\u65cf,\u62c9\u795c\u65cf,\u6c34\u65cf,\u4e1c\u4e61\u65cf,\u7eb3\u897f\u65cf,\u666f\u9887\u65cf,\u67ef\u5c14\u514b\u5b5c\u65cf,\u571f\u65cf,\u8fbe\u65a1\u5c14\u65cf,\u4eeb\u4f6c\u65cf,\u7f8c\u65cf,\u5e03\u6717\u65cf,\u6492\u62c9\u65cf,\u6bdb\u5357\u65cf,\u4ee1\u4f6c\u65cf,\u9521\u4f2f\u65cf,\u963f\u660c\u65cf,\u666e\u7c73\u65cf,\u5854\u5409\u514b\u65cf,\u6012\u65cf,\u4e4c\u5b5c\u522b\u514b\u65cf,\u4fc4\u7f57\u65af\u65cf,\u9102\u6e29\u514b\u65cf,\u5fb7\u6602\u65cf,\u4fdd\u5b89\u65cf,\u88d5\u56fa\u65cf,\u4eac\u65cf,\u5854\u5854\u5c14\u65cf,\u72ec\u9f99\u65cf,\u9102\u4f26\u6625\u65cf,\u8d6b\u54f2\u65cf,\u95e8\u5df4\u65cf,\u73de\u5df4\u65cf,\u57fa\u8bfa\u65cf
nativePlace=\u5317\u4eac\u5e02,\u5929\u6d25\u5e02,\u91cd\u5e86\u5e02,\u4e0a\u6d77\u5e02,\u9999\u6e2f\u7279\u522b\u884c\u653f\u533a,\u6fb3\u95e8\u7279\u522b\u884c\u653f\u533a,\u6cb3\u5317\u7701,\u5c71\u897f\u7701,\u5409\u6797\u7701,\u8fbd\u5b81\u7701,\u9ed1\u9f99\u6c5f\u7701,\u9655\u897f\u7701,\u7518\u8083\u7701,\u9752\u6d77\u7701,\u5c71\u4e1c\u7701,\u798f\u5efa\u7701,\u6d59\u6c5f\u7701,\u53f0\u6e7e\u7701,\u6cb3\u5357\u7701,\u6e56\u5317\u7701,\u6e56\u5357\u7701,\u6c5f\u897f\u7701,\u6c5f\u82cf\u7701,\u5b89\u5fbd\u7701,\u5e7f\u4e1c\u7701,\u6d77\u5357\u7701,\u56db\u5ddd\u7701,\u8d35\u5dde\u7701,\u4e91\u5357\u7701,\u5185\u8499\u53e4\u81ea\u6cbb\u533a,\u65b0\u7586\u7ef4\u543e\u5c14\u81ea\u6cbb\u533a,\u5b81\u590f\u56de\u65cf\u81ea\u6cbb\u533a,\u5e7f\u897f\u58ee\u65cf\u81ea\u6cbb\u533a,\u897f\u85cf\u81ea\u6cbb\u533a nativePlace=\u5929\u6d25\u5e02,\u5317\u4eac\u5e02,\u91cd\u5e86\u5e02,\u4e0a\u6d77\u5e02,\u9999\u6e2f\u7279\u522b\u884c\u653f\u533a,\u6fb3\u95e8\u7279\u522b\u884c\u653f\u533a,\u6cb3\u5317\u7701,\u5c71\u897f\u7701,\u5409\u6797\u7701,\u8fbd\u5b81\u7701,\u9ed1\u9f99\u6c5f\u7701,\u9655\u897f\u7701,\u7518\u8083\u7701,\u9752\u6d77\u7701,\u5c71\u4e1c\u7701,\u798f\u5efa\u7701,\u6d59\u6c5f\u7701,\u53f0\u6e7e\u7701,\u6cb3\u5357\u7701,\u6e56\u5317\u7701,\u6e56\u5357\u7701,\u6c5f\u897f\u7701,\u6c5f\u82cf\u7701,\u5b89\u5fbd\u7701,\u5e7f\u4e1c\u7701,\u6d77\u5357\u7701,\u56db\u5ddd\u7701,\u8d35\u5dde\u7701,\u4e91\u5357\u7701,\u5185\u8499\u53e4\u81ea\u6cbb\u533a,\u65b0\u7586\u7ef4\u543e\u5c14\u81ea\u6cbb\u533a,\u5b81\u590f\u56de\u65cf\u81ea\u6cbb\u533a,\u5e7f\u897f\u58ee\u65cf\u81ea\u6cbb\u533a,\u897f\u85cf\u81ea\u6cbb\u533a
profession=\u536b\u751f\u4e13\u4e1a\u6280\u672f\u4eba\u5458,\u7ecf\u6d4e\u8d22\u52a1\u4eba\u5458,\u91d1\u878d\u4e1a\u52a1\u4eba\u5458,\u6cd5\u5f8b\u4e13\u4e1a\u4eba\u5458,\u6587\u5b66\u827a\u672f\u5de5\u4f5c\u4eba\u5458,\u4f53\u80b2\u5de5\u4f5c\u4eba\u5458,\u65b0\u95fb\u6587\u5316\u5de5\u4f5c\u4eba\u5458,\u5b97\u6559\u804c\u4e1a\u8005,\u884c\u653f\u529e\u516c\u4eba\u5458,\u5b89\u5168\u4fdd\u536b\u548c\u6d88\u9632\u4eba\u5458,\u90ae\u653f\u548c\u7535\u4fe1\u4e1a\u52a1\u4eba\u5458,\u8d2d\u9500\u4eba\u5458,\u5bb6\u653f\u670d\u52a1\u4eba\u5458,\u5546\u4e1a\u670d\u52a1\u4eba\u5458,\u53f8\u4e58\u4eba\u5458,\u5f85\u4e1a,\u5176\u4ed6,\u56fd\u5bb6\u516c\u52a1\u5458,\u519b\u4eba,\u5b66\u751f,\u6559\u5e08,\u5de5\u4eba,\u519c\u6797\u7267\u751f\u4ea7\u4eba\u5458,\u519c\u6797\u7267\u6280\u672f\u4eba\u5458,\u79d1\u5b66\u7814\u7a76\u4eba\u5458,\u5de5\u7a0b\u6280\u672f\u4eba\u5458,\u98de\u673a\u548c\u8239\u8236\u6280\u672f\u4eba\u5458 profession=\u536b\u751f\u4e13\u4e1a\u6280\u672f\u4eba\u5458,\u7ecf\u6d4e\u8d22\u52a1\u4eba\u5458,\u91d1\u878d\u4e1a\u52a1\u4eba\u5458,\u6cd5\u5f8b\u4e13\u4e1a\u4eba\u5458,\u6587\u5b66\u827a\u672f\u5de5\u4f5c\u4eba\u5458,\u4f53\u80b2\u5de5\u4f5c\u4eba\u5458,\u65b0\u95fb\u6587\u5316\u5de5\u4f5c\u4eba\u5458,\u5b97\u6559\u804c\u4e1a\u8005,\u884c\u653f\u529e\u516c\u4eba\u5458,\u5b89\u5168\u4fdd\u536b\u548c\u6d88\u9632\u4eba\u5458,\u90ae\u653f\u548c\u7535\u4fe1\u4e1a\u52a1\u4eba\u5458,\u8d2d\u9500\u4eba\u5458,\u5bb6\u653f\u670d\u52a1\u4eba\u5458,\u5546\u4e1a\u670d\u52a1\u4eba\u5458,\u53f8\u4e58\u4eba\u5458,\u5f85\u4e1a,\u5176\u4ed6,\u56fd\u5bb6\u516c\u52a1\u5458,\u519b\u4eba,\u5b66\u751f,\u6559\u5e08,\u5de5\u4eba,\u519c\u6797\u7267\u751f\u4ea7\u4eba\u5458,\u519c\u6797\u7267\u6280\u672f\u4eba\u5458,\u79d1\u5b66\u7814\u7a76\u4eba\u5458,\u5de5\u7a0b\u6280\u672f\u4eba\u5458,\u98de\u673a\u548c\u8239\u8236\u6280\u672f\u4eba\u5458
bloodType=\u672a\u77e5,A,B,O,AB,A:RH+,B:RH+,AB:RH+,O:RH+,A:RH-,B:RH-,AB:RH-,O:RH- bloodType=\u672a\u77e5,A,B,O,AB,A:RH+,B:RH+,AB:RH+,O:RH+,A:RH-,B:RH-,AB:RH-,O:RH-
relation=\u7236\u6bcd,\u5144\u59b9,\u914d\u5076,\u5b50\u5973,\u4eb2\u5c5e,\u670b\u53cb relation=\u7236\u6bcd,\u5144\u59b9,\u914d\u5076,\u5b50\u5973,\u4eb2\u5c5e,\u670b\u53cb
......
...@@ -160,7 +160,6 @@ ...@@ -160,7 +160,6 @@
<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">
<option value=""></option>
<c:forEach var="value" items="${dict.nativePlace}"> <c:forEach var="value" items="${dict.nativePlace}">
<option value="${value}">${value}</option> <option value="${value}">${value}</option>
</c:forEach> </c:forEach>
...@@ -222,7 +221,13 @@ ...@@ -222,7 +221,13 @@
<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="profession" name="profession" placeholder="" class="col-xs-10 col-sm-10" /> <select class="col-xs-10 col-sm-10" id="profession" name="profession">
<option value="">请选择</option>
<c:forEach var="value" items="${dict.profession}">
<option value="${value}">${value}</option>
</c:forEach>
</select>
</div> </div>
</div> </div>
...@@ -278,7 +283,7 @@ ...@@ -278,7 +283,7 @@
</div> </div>
<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"> <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" placeholder="" class="col-xs-10 col-sm-10" />
...@@ -359,7 +364,7 @@ ...@@ -359,7 +364,7 @@
<div class="col-xs-4"> <div class="col-xs-4">
<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"> <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" placeholder="" class="col-xs-10 col-sm-10" />
...@@ -381,8 +386,13 @@ ...@@ -381,8 +386,13 @@
<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="contactsRelation1" name="contactsRelation1" placeholder="" class="col-xs-10 col-sm-10" /> <select class="col-xs-10 col-sm-10" id="contactsRelation1" name="contactsRelation1">
<option value="">请选择</option>
<c:forEach var="value" items="${dict.relation}">
<option value="${value}">${value}</option>
</c:forEach>
</select>
</div> </div>
</div> </div>
...@@ -398,7 +408,7 @@ ...@@ -398,7 +408,7 @@
<div class="col-xs-4"> <div class="col-xs-4">
<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"> <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" placeholder="" class="col-xs-10 col-sm-10" />
...@@ -425,9 +435,9 @@ ...@@ -425,9 +435,9 @@
<div class="col-xs-4"> <div class="col-xs-4">
<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"> <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="contactsName2" name="contactsName2" placeholder="" class="col-xs-10 col-sm-10" />
</div> </div>
</div> </div>
...@@ -435,7 +445,7 @@ ...@@ -435,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="contactsQQ1" name="contactsQQ1" placeholder="" class="col-xs-10 col-sm-10" /> <input type="text" id="contactsQQ2" name="contactsQQ2" placeholder="" class="col-xs-10 col-sm-10" />
</div> </div>
</div> </div>
...@@ -447,15 +457,19 @@ ...@@ -447,15 +457,19 @@
<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="contactsRelation1" name="contactsRelation1" placeholder="" class="col-xs-10 col-sm-10" /> <select class="col-xs-10 col-sm-10" id="contactsRelation2" name="contactsRelation2">
<option value="">请选择</option>
<c:forEach var="value" items="${dict.relation}">
<option value="${value}">${value}</option>
</c:forEach>
</select>
</div> </div>
</div> </div>
<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="contactsWeixin2" name="contactsWeixin2" placeholder="" class="col-xs-10 col-sm-10" />
</div> </div>
</div> </div>
...@@ -464,9 +478,9 @@ ...@@ -464,9 +478,9 @@
<div class="col-xs-4"> <div class="col-xs-4">
<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"> <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="contactsMobile2" name="contactsMobile2" placeholder="" class="col-xs-10 col-sm-10" />
</div> </div>
</div> </div>
...@@ -474,7 +488,7 @@ ...@@ -474,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="contactsAddr1" name="contactsAddr1" placeholder="" class="col-xs-10 col-sm-10" /> <input type="text" id="contactsAddr2" name="contactsAddr2" placeholder="" class="col-xs-10 col-sm-10" />
</div> </div>
</div> </div>
......
...@@ -1051,4 +1051,27 @@ a.a15:active { ...@@ -1051,4 +1051,27 @@ a.a15:active {
.form-group{ .form-group{
margin-bottom: 10px; margin-bottom: 10px;
} }
\ No newline at end of file .select2-container{
float: left;
}
.error{
color:red;
padding-left:4px;
}
input.error{
border:1px solid red;
}
...@@ -1203,3 +1203,206 @@ $.format = $.validator.format; ...@@ -1203,3 +1203,206 @@ $.format = $.validator.format;
} }
}); });
})(jQuery); })(jQuery);
//字符验证,只能包含中文、英文、数字、下划线等字符。
jQuery.validator.addMethod("stringCheck", function(value, element) {
return this.optional(element) || /^[a-zA-Z0-9\u4e00-\u9fa5-_]+$/.test(value);
}, "只能包含中文、英文、数字、下划线等字符");
// 匹配english
jQuery.validator.addMethod("isEnglish", function(value, element) {
return this.optional(element) || /^[A-Za-z]+$/.test(value);
}, "匹配english");
// 匹配汉字
jQuery.validator.addMethod("isChinese", function(value, element) {
return this.optional(element) || /^[\u4e00-\u9fa5]+$/.test(value);
}, "匹配汉字");
// 匹配中文(包括汉字和字符)
jQuery.validator.addMethod("isChineseChar", function(value, element) {
return this.optional(element) || /^[\u0391-\uFFE5]+$/.test(value);
}, "匹配中文(包括汉字和字符) ");
// 判断是否为合法字符(a-zA-Z0-9-_)
jQuery.validator.addMethod("isRightfulString", function(value, element) {
return this.optional(element) || /^[A-Za-z0-9_-]+$/.test(value);
}, "判断是否为合法字符(a-zA-Z0-9-_)");
// 判断是否包含中英文特殊字符,除英文"-_"字符外
jQuery.validator.addMethod("isContainsSpecialChar", function(value, element) {
var reg = RegExp(/[(\ )(\`)(\~)(\!)(\@)(\#)(\$)(\%)(\^)(\&)(\*)(\()(\))(\+)(\=)(\|)(\{)(\})(\')(\:)(\;)(\')(',)(\[)(\])(\.)(\<)(\>)(\/)(\?)(\~)(\!)(\@)(\#)(\¥)(\%)(\…)(\&)(\*)(\()(\))(\—)(\+)(\|)(\{)(\})(\【)(\】)(\‘)(\;)(\:)(\”)(\“)(\’)(\。)(\,)(\、)(\?)]+/);
return this.optional(element) || !reg.test(value);
}, "含有中英文特殊字符");
// IP地址验证
jQuery.validator.addMethod("ip", function(value, element) {
var ip = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
return this.optional(element) || (ip.test(value) && (RegExp.$1 < 256 && RegExp.$2 < 256 && RegExp.$3 < 256 && RegExp.$4 < 256));
}, "Please enter a valid IP address.");
// 字母和数字的验证
jQuery.validator.addMethod("chrnum", function(value, element) {
var chrnum = /^([a-zA-Z0-9]+)$/;
return this.optional(element) || (chrnum.test(value));
}, "只能输入数字和字母(字符A-Z, a-z, 0-9)");
// 中文的验证
jQuery.validator.addMethod("chinese", function(value, element) {
var chinese = /^[\u4e00-\u9fa5]+$/;
return this.optional(element) || (chinese.test(value));
}, "只能输入中文");
//判断整数value是否等于0
jQuery.validator.addMethod("isIntEqZero", function(value, element) {
value=parseInt(value);
return this.optional(element) || value==0;
}, "整数必须为0");
// 判断整数value是否大于0
jQuery.validator.addMethod("isIntGtZero", function(value, element) {
value=parseInt(value);
return this.optional(element) || value>0;
}, "Please enter a number greater than 0.");
// 判断整数value是否大于或等于0
jQuery.validator.addMethod("isIntGteZero", function(value, element) {
value=parseInt(value);
return this.optional(element) || value>=0;
}, "整数必须大于或等于0");
// 判断整数value是否不等于0
jQuery.validator.addMethod("isIntNEqZero", function(value, element) {
value=parseInt(value);
return this.optional(element) || value!=0;
}, "整数必须不等于0");
// 判断整数value是否小于0
jQuery.validator.addMethod("isIntLtZero", function(value, element) {
value=parseInt(value);
return this.optional(element) || value<0;
}, "整数必须小于0");
// 判断整数value是否小于或等于0
jQuery.validator.addMethod("isIntLteZero", function(value, element) {
value=parseInt(value);
return this.optional(element) || value<=0;
}, "整数必须小于或等于0");
// 判断浮点数value是否等于0
jQuery.validator.addMethod("isFloatEqZero", function(value, element) {
value=parseFloat(value);
return this.optional(element) || value==0;
}, "浮点数必须为0");
// 判断浮点数value是否大于0
jQuery.validator.addMethod("isFloatGtZero", function(value, element) {
value=parseFloat(value);
return this.optional(element) || value>0;
}, "Please enter a number greater than 0.");
// 判断浮点数value是否大于或等于0
jQuery.validator.addMethod("isFloatGteZero", function(value, element) {
value=parseFloat(value);
return this.optional(element) || value>=0;
}, "Please enter a number greater than or equal 0.");
// 判断浮点数value是否不等于0
jQuery.validator.addMethod("isFloatNEqZero", function(value, element) {
value=parseFloat(value);
return this.optional(element) || value!=0;
}, "浮点数必须不等于0");
// 判断浮点数value是否小于0
jQuery.validator.addMethod("isFloatLtZero", function(value, element) {
value=parseFloat(value);
return this.optional(element) || value<0;
}, "浮点数必须小于0");
// 判断浮点数value是否小于或等于0
jQuery.validator.addMethod("isFloatLteZero", function(value, element) {
value=parseFloat(value);
return this.optional(element) || value<=0;
}, "浮点数必须小于或等于0");
// 判断浮点型
jQuery.validator.addMethod("isFloat", function(value, element) {
return this.optional(element) || /^[-\+]?\d+(\.\d+)?$/.test(value);
}, "只能包含数字、小数点等字符");
// 匹配integer
jQuery.validator.addMethod("isInteger", function(value, element) {
return this.optional(element) || (/^[-\+]?\d+$/.test(value) && parseInt(value)>=0);
}, "Please enter an integer");
// 判断数值类型,包括整数和浮点数
jQuery.validator.addMethod("isNumber", function(value, element) {
return this.optional(element) || /^[-\+]?\d+$/.test(value) || /^[-\+]?\d+(\.\d+)?$/.test(value);
}, "匹配数值类型,包括整数和浮点数");
// 只能输入[0-9]数字
jQuery.validator.addMethod("isDigits", function(value, element) {
return this.optional(element) || /^\d+$/.test(value);
}, "只能输入0-9数字");
// 判断中文字符
jQuery.validator.addMethod("isChinese", function(value, element) {
return this.optional(element) || /^[\u0391-\uFFE5]+$/.test(value);
}, "只能包含中文字符。");
// 判断英文字符
jQuery.validator.addMethod("isEnglish", function(value, element) {
return this.optional(element) || /^[A-Za-z]+$/.test(value);
}, "只能包含英文字符。");
// 手机号码验证
jQuery.validator.addMethod("isMobile", function(value, element) {
var length = value.length;
var mobile = /^1[0-9]{10}$/;
return this.optional(element) || (length == 11 && mobile.test(value));
}, "请填写正确的手机号码");
// 电话号码验证
jQuery.validator.addMethod("isPhone", function(value, element) {
var tel = /^(\d{3,4}-?)?\d{7,9}$/g;
return this.optional(element) || (tel.test(value));
}, "请正确填写您的电话号码。");
// 联系电话(手机/电话皆可)验证
jQuery.validator.addMethod("isTel", function(value,element) {
var length = value.length;
var mobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
var tel = /^(\d{3,4}-?)?\d{7,9}$/g;
return this.optional(element) || tel.test(value) || (length==11 && mobile.test(value));
}, "请正确填写您的联系方式");
// 匹配qq
jQuery.validator.addMethod("isQq", function(value, element) {
return this.optional(element) || /^[1-9]\d{4,12}$/;
}, "匹配QQ");
// 邮政编码验证
jQuery.validator.addMethod("isZipCode", function(value, element) {
var zip = /^[0-9]{6}$/;
return this.optional(element) || (zip.test(value));
}, "请正确填写您的邮政编码。");
// 匹配密码,以字母开头,长度在6-12之间,只能包含字符、数字和下划线。
jQuery.validator.addMethod("isPwd", function(value, element) {
return this.optional(element) || /^[a-zA-Z]\\w{6,12}$/.test(value);
}, "以字母开头,长度在6-12之间,只能包含字符、数字和下划线。");
// 身份证号码验证
jQuery.validator.addMethod("isIdCardNo", function(value, element) {
//var idCard = /^(\d{6})()?(\d{4})(\d{2})(\d{2})(\d{3})(\w)$/;
return this.optional(element) || isIdCardNo(value);
}, "请输入正确的身份证号码。");
jQuery.validator.addMethod("isIdCardNo", function(value, element) {
//var idCard = /^(\d{6})()?(\d{4})(\d{2})(\d{2})(\d{3})(\w)$/;
return this.optional(element) || isIdCardNo(value);
}, "请输入正确的身份证号码。");
var isSubmit = true;
$(document).ready(function(){ $(document).ready(function(){
if ($('#userForm').length>0){ if ($('#userForm').length>0){
$('#userForm').validate({ $('#userForm').validate({
doNotHideMessage : true, //this option enables to show the error/success messages on tab switch.
errorElement : 'span', //default input error message container
errorClass : 'validate-inline', // default input error message class
focusInvalid : false, // do not focus the last invalid input
rules : { rules : {
"firstName" : { "name" : {
required : true required : true
}, },
"lastName" : { "birthday" : {
required : true required : true
}, },
"roleId" : { "paperId" : {
required : true required : true
}, },
"email" : { "nativePlace" : {
required : true, required : true
email : true
}, },
"password" : { "addr" : {
required : "#changePassword:checked" required : true
}, },
"confirm_password" : { "mobile" : {
required : "#changePassword:checked", required : true,
equalTo: "#password" isMobile: true,
maxlength:11,
minlength:11
}, },
"roleId": { "qq": {
required : true required : true
}, },
"jobNumber" : { "contactsName1" : {
required : "#isEmployee:checked" required : true
}, },
"hireOnDateValue" : { "contactsMobile1" : {
required : "#isEmployee:checked" required : true,
isMobile: true,
maxlength:11,
minlength:11
}, },
"clockId" : { "contactsName2" : {
required : "#isEmployee:checked", required : true
number : "#isEmployee:checked",
min : 1
}, },
"payId" : { "contactsMobile2" : {
required : "#isEmployee:checked" required : true,
isMobile: true,
maxlength:11,
minlength:11
}
},
messages:{
"name" : {
required : "不能为空"
}, },
"paygroupId" : { "birthday" : {
required : "#isEmployee:checked" required : "不能为空"
}, },
"departmentValue" : { "paperId" : {
required : true required : "不能为空"
},
"nativePlace" : {
required : "不能为空"
},
"addr" : {
required : "不能为空"
},
"mobile" : {
required : "不能为空"
},
"qq": {
required : "不能为空"
},
"contactsName1" : {
required : "不能为空"
},
"contactsMobile1" : {
required : "不能为空"
},
"contactsName2" : {
required : "不能为空"
},
"contactsMobile2" : {
required : "不能为空"
} }
}, },
errorPlacement: function (error, element) { // render error placement for each input type
error.insertAfter(element); // for other inputs, just perform default behavoir
if (element.attr("name") == "roleId") {
$("#roleId-controls div a").attr("style","border-color: #b94a48 !important");
}
},
invalidHandler: function (event, validator) { //display error alert on form submit
parent.Loading.stop();
},
highlight: function (element) { // hightlight error inputs
$(element).closest('.help-inline').removeClass('ok'); // display OK icon
$(element).closest('.control-group').removeClass('success').addClass('error'); // set error class to the control group
},
unhighlight: function (element) { // revert the change dony by hightlight
$(element).closest('.control-group').removeClass('error'); // set error class to the control group
if ($(element).attr("name") == "roleId") {
$("#roleId-controls div a").attr("style","");
}
},
success: function (label) {
label.addClass('valid').closest('.control-group').removeClass('error'); // set success class to the control group
label.remove();
},
submitHandler: function(form){
user.save(form,false);
},
onfocusin: function( element, event ) { submitHandler: function(form){
user.save(form);
} }
}); });
} }
...@@ -125,7 +130,89 @@ $(document).ready(function(){ ...@@ -125,7 +130,89 @@ $(document).ready(function(){
var user = { var user = {
save : function(form){ save : function(form){
if (isSubmit){
isSubmit = false;
$.ajax({
type: 'POST',
url: '/api/user/save',
dataType:'json',
data: {
role:$('#role').val(),
name:$('#name').val(),
gender:$('input:radio[name="gender"]:checked').val(),
birthday:$('#birthday').val(),
paperType:$('#paperType').val(),
paperId:$('#paperId').val(),
nation:$('#nation').val(),
nationality:$('#nationality').val(),
nativePlace:$('#nativePlace').val(),
domicilePlace:$('#domicilePlace').val(),
addr:$('#addr').val(),
education:$('#education').val(),
unit:$('#unit').val(),
profession:$('#profession').val(),
unitAddr:$('#unitAddr').val(),
unitTel:$('#unitTel').val(),
mobile:$('#mobile').val(),
tel:$('#tel').val(),
email:$('#email').val(),
qq:$('#qq').val(),
weixin:$('#weixin').val(),
donateBloodCount:$('#donateBloodCount').val(),
bloodType:$('#bloodType').val(),
height:$('#height').val(),
weight:$('#weight').val(),
remark:$('#remark').val(),
contactsName1:$('#contactsName1').val(),
contactsQQ1:$('#contactsQQ1').val(),
contactsRelation1:$('#contactsRelation1').val(),
contactsWeixin1:$('#contactsWeixin1').val(),
contactsMobile1:$('#contactsMobile1').val(),
contactsAddr1:$('#contactsAddr1').val(),
contactsName2:$('#contactsName2').val(),
contactsQQ2:$('#contactsQQ2').val(),
contactsRelation2:$('#contactsRelation2').val(),
contactsWeixin2:$('#contactsWeixin2').val(),
contactsMobile2:$('#contactsMobile2').val(),
contactsAddr2:$('#contactsAddr2').val()
},
success: function(data){
var status=data.status;
if(status==1){//注册成功
bootbox.dialog({
message:"新增用户成功",
buttons:{
"success":{
"label":"返回",
"className":"btn-sm btn-primary",
"callback": function () {
window.location.href='<webpath:path/>/';
}
},
"success":{
"label":"继续添加",
"className":"btn-sm btn-primary",
"callback": function () {
window.location.href='<webpath:path/>/';
}
}
}
});
}
}
});
}
} }
......
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