Explorar o código

2019/12/518:08

jzdsh %!s(int64=5) %!d(string=hai) anos
pai
achega
5fe6dcad91

+ 264 - 0
src/main/java/com/yc/education/controller/admin/AdminsManageController.java

@@ -0,0 +1,264 @@
+package com.yc.education.controller.admin;
+
+import com.github.pagehelper.PageInfo;
+import com.yc.education.model.Admins;
+import com.yc.education.model.City;
+import com.yc.education.service.AdminsService;
+import com.yc.education.service.ICityService;
+import com.yc.education.util.AjaxMessage;
+import com.yc.education.util.AppConst;
+import com.yc.education.util.DateUtils;
+import com.yc.education.util.SM4;
+import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+import sun.misc.resources.Messages_ko;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @ClassName AdminsManageController
+ * @Description 附近养车网后台 用户管理
+ * @Author QuZhangJing
+ * @Date 2019/12/5 9:49
+ * @Version 1.0
+ */
+@Controller
+@RequestMapping("admin")
+public class AdminsManageController {
+
+    @Autowired
+    private AdminsService  adminsService;
+
+    @Autowired
+    private ICityService iCityService;
+
+    /**
+     * 用户信息查询
+     * @param province 省
+     * @param city     市
+     * @param district 区
+     * @param name     姓名
+     * @param pageNum  页数
+     * @param pageSize 条数
+     * @return
+     */
+    @RequestMapping("adminsList.html")
+    public ModelAndView listAllAdminsInfo(
+            @RequestParam(defaultValue = "") String province,
+            @RequestParam(defaultValue = "") String city,
+            @RequestParam(defaultValue = "") String district,
+            @RequestParam(defaultValue = "") String name,
+            @RequestParam(defaultValue = "1")Integer pageNum,
+            @RequestParam(defaultValue = "10")Integer pageSize){
+        ModelAndView mav = new ModelAndView();
+
+        mav.addObject("province1", province);
+        mav.addObject("city", city);
+        mav.addObject("district", district);
+        mav.addObject("name", name);
+        /*用户管理根据省市区查询  数据处理*/
+        if (province != "省" && !"省".equals(province.trim())&& !"".equals(province)) {
+            City city1 = iCityService.selectByAddrCode(province.trim());//根据省地址码获取具体地址
+            province = city1.getAddrName();
+        }
+        if (city != "- 市" && !"- 市".equals(city.trim()) &&!"".equals(city)) {
+            City city1 = iCityService.selectByAddrCode(city.trim());//根据城市地址码获取具体地址
+            city = city1.getAddrName();
+        }
+        if (district != "- 县/区" && !"- 县/区".equals(district.trim())&& !"".equals(district)) {
+            City city1 = iCityService.selectByAddrCode(district.trim());//根据区域地址码获取具体地址
+            district = city1.getAddrName();
+        }
+        if("省".equals(province.trim())){
+            province = null;
+        }
+        if("- 市".equals(city.trim())){
+            city = null;
+        }
+        if("- 县/区".equals(district.trim())){
+            district = null;
+        }
+
+        List<Admins> listAllAdminsInfo  = adminsService.listAllAdminsInfo(province,city,district,name,pageNum,pageSize);
+        List<City> provinceList = iCityService.provinceList();//查询省份
+
+        mav.addObject("province", provinceList);
+        mav.addObject("pageInfo",new PageInfo<Admins>(listAllAdminsInfo));
+        mav.addObject("pageNum",pageNum);
+        mav.addObject("pageSize",pageSize);
+        return mav;
+    }
+
+    /**
+     * 添加跳转
+     * @return
+     */
+    @RequestMapping("adminsAdd.html")
+    public ModelAndView adminsAdd(){
+        ModelAndView mav = new ModelAndView();
+
+        List<City> provinceList = iCityService.provinceList();//查询省份
+
+        mav.addObject("province", provinceList);
+        return mav;
+    }
+
+    /**
+     * 添加 实现
+     * @param request
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("adminsAdds.html")
+    public AjaxMessage<Object> adminsAdds(HttpServletRequest request){
+        AjaxMessage<Object> am = new AjaxMessage<>();
+        Admins admins = new Admins();
+        SM4 sm4 = new SM4();
+        try {
+            BeanUtils.populate(admins,request.getParameterMap());
+            admins.setBornDate(DateUtils.getDateByPattern(admins.getFormatDate(),DateUtils.FORMAT_YYYY_MM_DD));
+            /*判断账号名称是否存在*/
+            int loginnameRows = adminsService.listLoginnameIsRepeat(admins.getLoginname().trim());
+            if (loginnameRows > 0){
+                am.setIs(false);
+                am.setMsg("账号已存在");
+                return  am;
+            }
+            /*判断电话是否已存在*/
+            int telephoneRows = adminsService.listTelephoneIsRepeat(admins.getTelephone());
+            if (telephoneRows > 0){
+                am.setIs(false);
+                am.setMsg("电话已存在");
+                return am;
+            }
+            /*如果密码为空 就把手机号后六位设置为密码*/
+            if (StringUtils.isBlank(admins.getPassword())){
+              admins.setPassword(admins.getTelephone().substring(5,11));
+            }
+            /*密码加密*/
+            admins.setPassword(sm4.encode(admins.getPassword(), AppConst.Sm4Key));
+            /*将地址码转成地址*/
+            if (admins.getProvince() != null && !"".equals(admins.getProvince())) {
+                City city = iCityService.selectByAddrCode(admins.getProvince().trim());//根据省地址码获取具体地址
+                admins.setProvince(city.getAddrName());
+            }
+            if (admins.getCity() != null && !"".equals(admins.getCity())) {
+                City city = iCityService.selectByAddrCode(admins.getCity().trim());//根据城市地址码获取具体地址
+                admins.setCity(city.getAddrName());
+            }
+            if (admins.getDistrict() != null && !"".equals(admins.getDistrict())) {
+                City city = iCityService.selectByAddrCode(admins.getDistrict().trim());//根据区域地址码获取具体地址
+                admins.setDistrict(city.getAddrName());
+            }
+            admins.setCreateDate(new Date());
+            int rows = adminsService.save(admins);
+            if (rows > 0){
+                am.setIs(true);
+                am.setMsg("添加成功");
+                return am;
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return am;
+    }
+
+    /**
+     * 修改跳转
+     * @param id
+     * @return
+     */
+    @RequestMapping("adminsUpdate.html")
+    public ModelAndView adminsUpdate(Integer id){
+
+        ModelAndView mav = new ModelAndView();
+
+        Admins  admins  = adminsService.selectByKey(id);
+
+        admins.setFormatDate(DateUtils.getSpecifyDate(admins.getBornDate(),DateUtils.FORMAT_YYYY_MM_DD));
+
+        /*根据省市区地址获取地址码*/
+        if (admins.getProvince()!= null && !"".equals(admins.getProvince())){//查询省地址码
+            City city  = iCityService.selectByAddrName(admins.getProvince().trim(),"01");
+            admins.setProvince(city.getAddrCode());
+        }
+        if (admins.getCity()!= null && !"".equals(admins.getCity())){//查询市地址码
+            City city  = iCityService.selectByAddrName(admins.getCity().trim(),"02");
+            admins.setCity(city.getAddrCode());
+        }
+        if (admins.getDistrict()!= null && !"".equals(admins.getDistrict())&& admins.getCity()!=null && !"".equals(admins.getCity())){//查询区域地址码
+            City city  = iCityService.selectThreeAddrCode(admins.getDistrict().trim(),admins.getCity());
+            admins.setDistrict(city.getAddrCode());
+        }
+
+        List<City> provinceList = iCityService.provinceList();//查询省份
+        List<City> cityList = iCityService.cityList(admins.getProvince());//查询城市
+        List<City> districtList = iCityService.districtList(admins.getCity());//查询区域
+
+        mav.addObject("province",provinceList);
+        mav.addObject("city",cityList);
+        mav.addObject("district",districtList);
+
+        mav.addObject("admins",admins);
+        return  mav;
+    }
+
+    @ResponseBody
+    @RequestMapping("adminsUpdates.html")
+    public AjaxMessage<Object> adminsUpdates(HttpServletRequest request){
+        AjaxMessage<Object> am = new AjaxMessage<>();
+        Admins admins = new Admins();
+        try {
+            BeanUtils.populate(admins,request.getParameterMap());
+
+            /*判断用户账号是否存在*/
+            int loginnameRows  =  adminsService.listLoginnameIsExist(admins.getLoginname(),admins.getId());
+            if (loginnameRows > 0){
+                am.setIs(false);
+                am.setMsg("账号已存在");
+                return am;
+            }
+            /*判断用户电话是否存在*/
+            int telephoneRows  =  adminsService.listTelephoneIsExist(admins.getTelephone(),admins.getId());
+            if (telephoneRows > 0){
+                am.setIs(false);
+                am.setMsg("电话已存在");
+                return am;
+            }
+            /*将地址码转成地址*/
+            if (admins.getProvince() != null && !"".equals(admins.getProvince())) {
+                City city = iCityService.selectByAddrCode(admins.getProvince().trim());//根据省地址码获取具体地址
+                admins.setProvince(city.getAddrName());
+            }
+            if (admins.getCity() != null && !"".equals(admins.getCity())) {
+                City city = iCityService.selectByAddrCode(admins.getCity().trim());//根据城市地址码获取具体地址
+                admins.setCity(city.getAddrName());
+            }
+            if (admins.getDistrict() != null && !"".equals(admins.getDistrict())) {
+                City city = iCityService.selectByAddrCode(admins.getDistrict().trim());//根据区域地址码获取具体地址
+                admins.setDistrict(city.getAddrName());
+            }
+            admins.setBornDate(DateUtils.getDateByPattern(admins.getFormatDate(),DateUtils.FORMAT_YYYY_MM_DD));
+            admins.setModifyDate(new Date());
+            int rows = adminsService.updateNotNull(admins);
+            if (rows > 0){
+                am.setIs(true);
+                am.setMsg("修改成功");
+                return am;
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+      return am;
+    }
+
+}

+ 13 - 0
src/main/java/com/yc/education/mapper/AdminsMapper.java

@@ -2,10 +2,23 @@ package com.yc.education.mapper;
 
 import com.yc.education.model.Admins;
 import com.yc.education.util.MyMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 public interface AdminsMapper extends MyMapper<Admins> {
 	
 	//admin登录
 	public Admins findadminlogin(String loginname, String password);
+
+    List<Admins> listAllAdminsInfo(@Param("province") String province,@Param("city") String city,@Param("district") String district,@Param("name") String name);
+
+    int listLoginnameIsRepeat(@Param("loginname") String loginname);
+
+    int listTelephoneIsRepeat(@Param("telephone") String telephone);
+
+    int listLoginnameIsExist(@Param("loginname") String loginname,@Param("id") Integer id);
+
+    int listTelephoneIsExist(@Param("telephone") String telephone,@Param("id") Integer id);
 }

+ 263 - 12
src/main/java/com/yc/education/model/Admins.java

@@ -1,65 +1,316 @@
 package com.yc.education.model;
 
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
 
+import java.util.Date;
+import javax.persistence.*;
 
 public class Admins {
     /**
-     * 绠$悊鍛樼櫥褰曡〃
+     * 管理员表主键
      */
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     private Integer id;
 
+    /**
+     * 用户名
+     */
     private String loginname;
 
+    /**
+     * 密码
+     */
     private String password;
 
     /**
-     * 鑾峰彇绠$悊鍛樼櫥褰曡〃
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 电话
+     */
+    private String telephone;
+
+    /**
+     * 省
+     */
+    private String province;
+
+    /**
+     * 市
+     */
+    private String city;
+
+    /**
+     * 区
+     */
+    private String district;
+
+    /**
+     * 街道
+     */
+    private String street;
+
+    /**
+     * 出生日期
+     */
+    @Column(name = "born_date")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date bornDate;
+
+    @Transient
+    private String formatDate;//出生日期
+
+    /**
+     * 状态 1 启用 0 禁用
+     */
+    private String state;
+
+    /**
+     * 创建日期
+     */
+    @Column(name = "create_date")
+    private Date createDate;
+
+    /**
+     * 修改日期
+     */
+    @Column(name = "modify_date")
+    private Date modifyDate;
+
+    /**
+     * 获取管理员表主键
      *
-     * @return id - 绠$悊鍛樼櫥褰曡〃
+     * @return id - 管理员表主键
      */
     public Integer getId() {
         return id;
     }
 
     /**
-     * 璁剧疆绠$悊鍛樼櫥褰曡〃
+     * 设置管理员表主键
      *
-     * @param id 绠$悊鍛樼櫥褰曡〃
+     * @param id 管理员表主键
      */
     public void setId(Integer id) {
         this.id = id;
     }
 
     /**
-     * @return loginname
+     * 获取用户名
+     *
+     * @return loginname - 用户名
      */
     public String getLoginname() {
         return loginname;
     }
 
     /**
-     * @param loginname
+     * 设置用户名
+     *
+     * @param loginname 用户名
      */
     public void setLoginname(String loginname) {
         this.loginname = loginname;
     }
 
     /**
-     * @return password
+     * 获取密码
+     *
+     * @return password - 密码
      */
     public String getPassword() {
         return password;
     }
 
     /**
-     * @param password
+     * 设置密码
+     *
+     * @param password 密码
      */
     public void setPassword(String password) {
         this.password = password;
     }
+
+    /**
+     * 获取姓名
+     *
+     * @return name - 姓名
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * 设置姓名
+     *
+     * @param name 姓名
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * 获取电话
+     *
+     * @return telephone - 电话
+     */
+    public String getTelephone() {
+        return telephone;
+    }
+
+    /**
+     * 设置电话
+     *
+     * @param telephone 电话
+     */
+    public void setTelephone(String telephone) {
+        this.telephone = telephone;
+    }
+
+    /**
+     * 获取省
+     *
+     * @return province - 省
+     */
+    public String getProvince() {
+        return province;
+    }
+
+    /**
+     * 设置省
+     *
+     * @param province 省
+     */
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    /**
+     * 获取市
+     *
+     * @return city - 市
+     */
+    public String getCity() {
+        return city;
+    }
+
+    /**
+     * 设置市
+     *
+     * @param city 市
+     */
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    /**
+     * 获取区
+     *
+     * @return district - 区
+     */
+    public String getDistrict() {
+        return district;
+    }
+
+    /**
+     * 设置区
+     *
+     * @param district 区
+     */
+    public void setDistrict(String district) {
+        this.district = district;
+    }
+
+    /**
+     * 获取街道
+     *
+     * @return street - 街道
+     */
+    public String getStreet() {
+        return street;
+    }
+
+    /**
+     * 设置街道
+     *
+     * @param street 街道
+     */
+    public void setStreet(String street) {
+        this.street = street;
+    }
+
+    /**
+     * 获取出生日期
+     *
+     * @return born_date - 出生日期
+     */
+    public Date getBornDate() {
+        return bornDate;
+    }
+
+    /**
+     * 设置出生日期
+     *
+     * @param bornDate 出生日期
+     */
+    public void setBornDate(Date bornDate) {
+        this.bornDate = bornDate;
+    }
+
+    /**
+     * 获取创建日期
+     *
+     * @return create_date - 创建日期
+     */
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    /**
+     * 设置创建日期
+     *
+     * @param createDate 创建日期
+     */
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    /**
+     * 获取修改日期
+     *
+     * @return modify_date - 修改日期
+     */
+    public Date getModifyDate() {
+        return modifyDate;
+    }
+
+    /**
+     * 设置修改日期
+     *
+     * @param modifyDate 修改日期
+     */
+    public void setModifyDate(Date modifyDate) {
+        this.modifyDate = modifyDate;
+    }
+
+    public String getFormatDate() {
+        return formatDate;
+    }
+
+    public void setFormatDate(String formatDate) {
+        this.formatDate = formatDate;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
 }

+ 12 - 2
src/main/java/com/yc/education/service/AdminsService.java

@@ -2,12 +2,22 @@ package com.yc.education.service;
 
 import com.yc.education.model.Admins;
 
+import java.util.List;
+
 public interface AdminsService extends IService<Admins> {
 	
 	
 	//admin登录
 	Admins findadminlogin(String loginname, String password);
-	
-	
 
+
+    List<Admins> listAllAdminsInfo(String province, String city, String district, String name, Integer pageNum, Integer pageSize);
+
+	int listLoginnameIsRepeat(String loginname);
+
+	int listTelephoneIsRepeat(String telephone);
+
+	int listLoginnameIsExist(String loginname, Integer id);
+
+	int listTelephoneIsExist(String telephone, Integer id);
 }

+ 54 - 0
src/main/java/com/yc/education/service/impl/AdminsServiceImpl.java

@@ -1,11 +1,14 @@
 package com.yc.education.service.impl;
 
+import com.github.pagehelper.PageHelper;
 import com.yc.education.mapper.AdminsMapper;
 import com.yc.education.model.Admins;
 import com.yc.education.service.AdminsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service("AdminsServiceImpl")
 public class AdminsServiceImpl extends BaseService<Admins> implements AdminsService {
 
@@ -24,4 +27,55 @@ public class AdminsServiceImpl extends BaseService<Admins> implements AdminsServ
 		}
 	}
 
+    @Override
+    public List<Admins> listAllAdminsInfo(String province, String city, String district, String name, Integer pageNum, Integer pageSize) {
+        try {
+			PageHelper.startPage(pageNum,pageSize);
+        	return mapper.listAllAdminsInfo(province,city,district,name);
+		}catch (Exception e){
+        	e.printStackTrace();
+		}
+        return null;
+    }
+
+    @Override
+    public int listLoginnameIsRepeat(String loginname) {
+        try {
+        	return mapper.listLoginnameIsRepeat(loginname);
+		}catch (Exception e){
+        	e.printStackTrace();
+		}
+        return 0;
+    }
+
+	@Override
+	public int listTelephoneIsRepeat(String telephone) {
+		try {
+			return mapper.listTelephoneIsRepeat(telephone);
+		}catch (Exception e){
+			e.printStackTrace();
+		}
+		return 0;
+	}
+
+    @Override
+    public int listLoginnameIsExist(String loginname, Integer id) {
+		try {
+			return mapper.listLoginnameIsExist(loginname,id);
+		}catch (Exception e){
+			e.printStackTrace();
+		}
+		return 0;
+    }
+
+	@Override
+	public int listTelephoneIsExist(String telephone, Integer id) {
+		try {
+			return  mapper.listTelephoneIsExist(telephone,id);
+		}catch (Exception e){
+			e.printStackTrace();
+		}
+		return 0;
+	}
+
 }

+ 1 - 2
src/main/java/com/yc/education/test/mainTest.java

@@ -151,9 +151,8 @@ public class mainTest {
 
         FileOutputStream fileOutputStream = new FileOutputStream(file);
         fileOutputStream.write("gggg\r\nssssssss".getBytes());
-
         fileOutputStream.flush();
-
+        fileOutputStream.close();
         FileInputStream fileInputStream = new FileInputStream(file);
         int by = 0;
         while ((by=fileInputStream.read())!= -1){

+ 56 - 3
src/main/resources/mapper/AdminsMapper.xml

@@ -5,11 +5,64 @@
     <!--
       WARNING - @mbggenerated
     -->
-    <id column="id" property="id" jdbcType="INTEGER" />
-    <result column="loginname" property="loginname" jdbcType="VARCHAR" />
-    <result column="password" property="password" jdbcType="VARCHAR" />
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="loginname" jdbcType="VARCHAR" property="loginname" />
+    <result column="password" jdbcType="VARCHAR" property="password" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="telephone" jdbcType="CHAR" property="telephone" />
+    <result column="province" jdbcType="VARCHAR" property="province" />
+    <result column="city" jdbcType="VARCHAR" property="city" />
+    <result column="district" jdbcType="VARCHAR" property="district" />
+    <result column="street" jdbcType="VARCHAR" property="street" />
+    <result column="born_date" jdbcType="DATE" property="bornDate" />
+    <result column="create_date" jdbcType="DATE" property="createDate" />
+    <result column="modify_date" jdbcType="DATE" property="modifyDate" />
+    <result column="state" jdbcType="DATE" property="state" />
   </resultMap>
     <select id="findadminlogin" resultMap="BaseResultMap">
   select * from admins where loginname=#{0} and password=#{1}
   </select>
+
+  <!--用户管理  查询所有用户信息并分页-->
+  <select id="listAllAdminsInfo" resultMap="BaseResultMap">
+    select * from admins
+    <where>
+      <if test="province != null and province != ''">
+        and province =#{province}
+      </if>
+      <if test="city != null and city != ''">
+        and city =#{city}
+      </if>
+      <if test="district != null and district != ''">
+        and district =#{district}
+      </if>
+      <if test="name != null and name != ''">
+        and name like concat ('%',#{name},'%')
+      </if>
+    </where>
+    order by create_date desc
+  </select>
+
+  <!--用户添加 判断账号是否重复-->
+  <select id="listLoginnameIsRepeat" resultType="INTEGER">
+    select count(1) from admins
+    <where>
+      <if test="loginname != null and loginname != ''">
+        loginname = #{loginname}
+      </if>
+    </where>
+  </select>
+  <!--用户添加 判断电话是否重复-->
+  <select id="listTelephoneIsRepeat" resultType="INTEGER">
+    select count(2) from admins where telephone = #{telephone}
+  </select>
+
+  <!--用户修改 判断账号是否重复-->
+  <select id="listLoginnameIsExist" resultType="INTEGER">
+    select count(1) from admins where loginname = #{loginname} and id != #{id}
+  </select>
+  <!--用户添加 判断电话是否重复-->
+  <select id="listTelephoneIsExist" resultType="INTEGER">
+    select count(2) from admins where telephone = #{telephone} and id != #{id}
+  </select>
 </mapper>

+ 322 - 0
src/main/webapp/WEB-INF/jsp/admin/adminsAdd.jsp

@@ -0,0 +1,322 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%
+    String base = pageContext.getServletContext().getContextPath();
+%>
+<!--_meta 作为公共模版分离出去-->
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <script type="text/javascript">
+        window.UEDITOR_SERVER_URL = '<%=base%>';
+    </script>
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
+    <meta http-equiv="Cache-Control" content="no-siteapp"/>
+    <LINK rel="Bookmark" href="/favicon.ico">
+    <LINK rel="Shortcut Icon" href="/favicon.ico"/>
+
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui/css/H-ui.min.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/H-ui.admin.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/Hui-iconfont/1.0.8/iconfont.css"/>
+    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/admin/icheck/icheck.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/skin/default/skin.css" id="skin"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/style.css"/>
+
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/jquery/1.9.1/jquery.min.js"></script>
+    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/layer/layer.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/js/jquery.validate.min.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/js/validate-methods.js"></script>
+    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/js/messages_zh.min.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/icheck/jquery.icheck.min.js"></script>
+    <script src="${pageContext.request.contextPath}/static/admin/manage/js/WdatePicker.js"></script>
+
+    <script type="text/javascript">
+        window.onunload = function() {
+            window.location.href="adminsList.html"
+        };
+        $(function () {
+            $("#sub").click(function () {
+             var loginname = $("#loginname").val();
+             var name  = $("#name").val();
+             var telephone = $("#telephone").val();
+             var province = $("#s_province").val();
+             var city = $("#s_city").val();
+             var district = $("#s_county").val();
+             var street = $("#street").val();
+             var bornDate = $("#bornDate").val();
+             var authPhone_reg = /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(16[0-9])|(17[0-9])|(18[0-9]))\d{8}$|^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(16[0-9])|(17[0-9])|(18[0-9]))\d{8}$|^0\d{2,3}-?\d{7,8}$/;
+             if (loginname == null || loginname == ""){
+                 layer.msg("账号不能为空");
+                 return false;
+             }
+             if (name == null || name == ""){
+                 layer.msg("姓名不能为空");
+                 return false;
+             }
+             if(telephone == null || telephone == ''){
+                 layer.msg("电话不能为空");
+                 return false;
+             }
+             if(province == '省'){
+                 layer.msg("省份不能为空");
+                 return false;
+             }
+             if (city ==' - 市'){
+                 layer.msg("城市不能为空");
+                 return false;
+             }
+             if (district==' - 县/区'){
+                 layer.msg("区域不能为空");
+                 return false;
+             }
+             if (street == null || street == ''){
+                 layer.msg("街道不能为空");
+                 return false;
+             }
+             if (bornDate == null || bornDate == ''){
+                 layer.msg("出生日期不能为空");
+                 return false;
+             }
+                if (!(authPhone_reg.test(telephone))) {
+                    layer.msg("用户电话不正确~");
+                    return false;
+                }
+
+             var formData  = new FormData();
+             formData.append("loginname",$("#loginname").val());//账号
+                formData.append("password",$("#password").val());//密码
+                formData.append("name",$("#name").val());//姓名
+                formData.append("telephone",$("#telephone").val());//电话
+                formData.append("state",$("#state").val());//状态
+                formData.append("province",$("#s_province").val());//省
+                formData.append("city",$("#s_city").val());//市
+                formData.append("district",$("#s_county").val());//区
+                formData.append("street",$("#street").val());//街道
+                formData.append("formatDate",$("#bornDate").val())//出生日期
+
+                $.ajax({
+                    type:"POST",
+                    url:"adminsAdds.html",
+                    data:formData,
+                    dataType:"json",
+                    cache: false,
+                    async : false,
+                    processData: false,
+                    contentType: false,
+                    success:function (ajax) {
+                        if (ajax.is){
+                            layer.msg(ajax.msg);
+                            layer.alert(ajax.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
+                            var index = parent.layer.getFrameIndex(window.name);
+                            parent.layer.close(index);
+                            });
+
+                        } else {
+                            layer.msg(ajax.msg);
+                        }
+                    }
+                })
+            });
+        });
+    </script>
+
+    <title>管理员管理</title>
+</head>
+<body>
+<nav class="breadcrumb">
+    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span><a href="javascript:history.go(-1)" title="用户管理">用户管理</a><span class="c-gray en">&gt;</span> 添加
+    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<article class="page-container">
+    <form  class="form form-horizontal" id="subform">
+
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>账号:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="loginname" id="loginname">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1">密码:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="password" id="password">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1">启/禁用:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <select name="state" id="state"   class="input-text">
+                        <option value="0" >禁用</option>
+                        <option value="1" selected>启用</option>
+                </select>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>姓名:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="name" id="name">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>电话:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="telephone" id="telephone">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>省,市,区:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <select id="s_province" name ="province" onchange="provinceChange(this.value)" style="width: 100px;height: 30px;font-size: 14px">
+                    <option value="省">省</option>
+                    <c:forEach items="${province}" var ="province" >
+                        <option value="${province.addrCode}">${province.addrName}</option>
+                    </c:forEach>
+                </select>
+                <select id="s_city" name ="city" onchange="cityChange(this.value)" style="width: 100px;height: 30px;font-size: 14px">
+                    <option value=" - 市"> - 市</option>
+                </select>
+                <select id="s_county" name ="district" style="width: 100px;height: 30px;font-size: 14px">
+                    <option value=" - 县/区"> - 县/区</option>
+                </select>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>街道:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="street" id="street">
+            </div>
+        </div>
+        <div class="row cl" >
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>出生日期:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" id="bornDate"  name="bornDate" value=""  onfocus="WdatePicker({ Date:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}' })"  class="input-text Wdate" >
+                <input type="text" hidden onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d' })"  class="input-text Wdate" style="width:120px;">
+            </div>
+        </div>
+
+        <div class="row cl">
+            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-1">
+                <button type="button" class="btn btn-primary radius" id="sub" name="admin-role-save"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
+            </div>
+        </div>
+    </form>
+</article>
+
+<!--请在下方写此页面业务相关的脚本-->
+<!-- 百度文本编辑器   引用文件 -->
+<link href="<%=base%>/static/ue/themes/default/css/ueditor.css" type="text/css" rel="stylesheet">
+<script src="<%=base%>/static/ue/ueditor.config.js" type="text/javascript"></script>
+<script src="<%=base%>/static/ue/ueditor.all.js" type="text/javascript"></script>
+<script type="text/javascript" src="<%=base%>/static/ue/lang/zh-cn/zh-cn.js"></script>
+
+<!-- 百度文本编辑器   js -->
+<script type="text/javascript">
+
+    /*根据选择省份展示该省份下的城市*/
+    function provinceChange(provinceVal){
+        $.ajax({
+            type:"POST",
+            url:"listCityByAddrCode.html",
+            data:{"addrCode":provinceVal.toString()},
+            dataType:"json",
+            success:function(ajax){
+                if (ajax.is){
+                    $("#s_city").html('<option value=" - 市"> - 市</option>');
+                    var str = "";
+                    for (var i = 0; i < ajax.data.length; i++){
+                        str += '<option value=" '+ajax.data[i].addrCode+' ">'+ajax.data[i].addrName+'</option>';
+                    };
+                    $("#s_city").append(str);
+                }
+            }
+        })
+    }
+
+    /*根据选择城市展示该城市下的区域*/
+    function cityChange(cityVal){
+        $.ajax({
+            type:"POST",
+            url:"listDistrictByAddrCode.html",
+            data:{"addrCode":cityVal.toString()},
+            dataType:"json",
+            success:function(ajax){
+                if (ajax.is){
+                    $("#s_county").html('<option value=" - 县/区"> - 县/区</option>');
+                    var str = "";
+                    for (var i = 0; i < ajax.data.length; i++){
+                        str += '<option value=" '+ajax.data[i].addrCode+' ">'+ajax.data[i].addrName+'</option>';
+                    };
+                    $("#s_county").append(str);
+                }
+            }
+        })
+    }
+
+
+    $(function () {
+        var ue = UE.getEditor('introduction', {
+            //关闭字数统计
+            wordCount: false,
+            toolbars: [['fullscreen', 'source', '|', 'undo', 'redo', '|',
+                'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
+                'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
+                'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
+                'directionalityltr', 'directionalityrtl', 'indent', '|',
+                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
+                'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
+                'insertimage', 'emotion', 'insertvideo', 'attachment', 'map', 'template', 'background', '|',
+                'horizontal', 'date', 'time', 'spechars', 'wordimage', '|',
+                'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
+                'print', 'preview', 'searchreplace', 'help'
+            ]],
+            //关闭elementPath
+            elementPathEnabled: false,
+        });
+    });
+
+
+    var currentBrowserId;
+
+    function browserImage(targetId) {
+        currentBrowserId = targetId;
+        var weboxTemp = $.webox({
+            height: 600,
+            width: 1024,
+            bgvisibel: true,
+            title: '图片管理',
+            iframe: '<%=base%>/admin/image/imgbox.html?' + Math.random()
+        });
+    }
+
+    function setImagepath(imgPath) {
+        $('#' + currentBrowserId).val(imgPath);
+    }
+
+    function closeFrame() {
+        $('#locked .span').click();
+    }
+</script>
+
+
+<!--请在下方写此页面业务相关的脚本-->
+<script type="text/javascript">
+</script>
+<!--/请在上方写此页面业务相关的脚本-->
+</body>
+</html>

+ 308 - 0
src/main/webapp/WEB-INF/jsp/admin/adminsList.jsp

@@ -0,0 +1,308 @@
+<%@ 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="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>后台管理</title>
+
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui/css/H-ui.min.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/H-ui.admin.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/Hui-iconfont/1.0.8/iconfont.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/skin/default/skin.css" id="skin"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/style.css"/>
+    <link href="${pageContext.request.contextPath}/static/admin/css/page.css" rel="stylesheet" type="text/css"/>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/jquery/1.9.1/jquery.min.js"></script>
+    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/layer/layer.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/h-ui/js/H-ui.min.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/js/H-ui.admin.js"></script>
+</head>
+<body>
+<nav class="breadcrumb">
+    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>用户管理
+    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<div class="page-container">
+    <form action="adminsList.html" method="post" enctype="multipart/form-data">
+        <div class="text-c">
+            <select id="s_province" name ="province" onchange="provinceChange(this.value)" style="width: 100px;height: 30px;font-size: 14px">
+                <option value="省">省</option>
+                <c:forEach items="${province}" var ="province" >
+                    <option value="${province.addrCode}">${province.addrName}</option>
+                </c:forEach>
+            </select>
+            <select id="s_city" name ="city" onchange="cityChange(this.value)" style="width: 100px;height: 30px;font-size: 14px">
+                <option value=" - 市"> - 市</option>
+            </select>
+            <select id="s_county" name ="district" style="width: 100px;height: 30px;font-size: 14px" >
+                <option value=" - 县/区"> - 县/区</option>
+            </select>
+
+            <input  type="text" name="name" id="searchName" value="" placeholder="姓名"  style="width:250px" class="input-text">
+
+            <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
+        </div>
+    </form>
+
+    <div class="cl pd-5 bg-1 bk-gray mt-20">
+        <%--<span class="l">
+            <a class="btn btn-danger radius"  href="javascript:;"  id="delete"    ><i class="Hui-iconfont">&#xe6e2;</i>批量删除</a>
+        </span>--%>
+        <a class="btn btn-primary radius"  onclick="user_add('用户添加','adminsAdd.html','1200','510')"><i class="Hui-iconfont">&#xe600;</i> 用户添加</a>
+        <i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</i>
+        <span class="r">共有数据:<strong>${pageInfo.total}</strong> 条</span>
+    </div>
+
+    <div class="mt-20">
+
+        <table class="table table-border table-bordered table-bg table-hover table-sort" style="table-layout:fixed">
+            <thead>
+            <tr class="text-c">
+                <th width="30"><input id="checked_all" type="checkbox">全选</th>
+                <th width="50">账号</th>
+                <th width="70">姓名</th>
+                <th width="90">电话</th>
+                <th width="30">省</th>
+                <th width="30">市</th>
+                <th width="30">区</th>
+                <th width="50">街道</th>
+                <th width="60">出生日期</th>
+                <th width="60">创建时间</th>
+                <th width="60">修改时间</th>
+                <th width="60">编辑权限</th>
+                <th width="80">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            <c:choose>
+                <c:when test="${pageInfo.list.size() > 0}">
+                    <c:forEach items="${pageInfo.list}" var="admin">
+                        <tr class="text-c">
+                            <th><input name="ck_pro" value="${admin.id }" type="checkbox"></th>
+
+                            <td class="text-l">${admin.loginname}</td>
+
+                            <td class="text-l">${admin.name}</td>
+
+                            <td class="text-l">${admin.telephone}</td>
+
+                            <td class="text-l">${admin.province}</td>
+
+                            <td class="text-l">${admin.city}</td>
+
+                            <td class="text-l">${admin.district}</td>
+
+                            <td class="text-l">${admin.street}</td>
+
+                            <td><fmt:formatDate value="${admin.bornDate}"
+                                                pattern="yyyy-MM-dd"></fmt:formatDate></td>
+
+                            <td><fmt:formatDate value="${admin.createDate}"
+                                                pattern="yyyy-MM-dd"></fmt:formatDate></td>
+
+                            <td><fmt:formatDate value="${admin.modifyDate}"
+                                                pattern="yyyy-MM-dd"></fmt:formatDate></td>
+
+                            <td class="text-l"><a href="#">编辑权限</a></td>
+
+                            <td class="f-14 td-manage">
+
+
+                                <a style="text-decoration:none" class="ml-5"  onclick="admins_update('用户修改','adminsUpdate.html?id=${admin.id}','1200','510')" title="查看"><i class="Hui-iconfont">&#xe6df;</i></a>
+                                    <a href="#"><i style="color:green;">禁用</i></a>
+                            </td>
+                        </tr>
+                    </c:forEach>
+                </c:when>
+                <c:otherwise>
+                    <tr class="text-c">
+                        <td colspan="13" align="center">暂无数据</td>
+                    </tr>
+
+                </c:otherwise>
+            </c:choose>
+
+            </tbody>
+        </table>
+    </div>
+
+    <div id="PageNum">
+        <section>
+            <div class="bd points-goods-list">
+                <ul class="pages">
+                    <select name="pageSize"  onchange="pageSizeChoose(this.value)" id="pageSize">
+                        <option value="5" <c:if test="${pageInfo.pageSize =='5'}">selected="selected"</c:if> >5</option>
+                        <option value="10" <c:if test="${pageInfo.pageSize == '10'}">selected="selected"</c:if>>10</option>
+                        <option value="30"<c:if test="${pageInfo.pageSize == '30'}">selected="selected"</c:if>>30</option>
+                        <option value="50"<c:if test="${pageInfo.pageSize == '50'}">selected="selected"</c:if>>50</option>
+                        <option value="100"<c:if test="${pageInfo.pageSize == '100'}">selected="selected"</c:if>>100</option>
+                    </select>
+                    <li>
+                        <a href="adminsList.html?province=${province1}&city=${city}&district=${district}&name=${name}&pageNum=1&pageSize=${pageInfo.pageSize}">首页</a>
+                    </li>
+                    <li class="prev"><a
+                            href="adminsList.html?province=${province1}&city=${city}&district=${district}&name=${name}&pageNum=${pageInfo.prePage}&pageSize=${pageInfo.pageSize}">上一页</a>
+                    </li>
+                    <c:forEach items="${pageInfo.navigatepageNums}" var="nav">
+                        <c:if test="${nav == pageInfo.pageNum}">
+                            <li>
+                                <a href="adminsList.html?province=${province1}&city=${city}&district=${district}&name=${name}&pageNum=${nav}&pageSize=${pageInfo.pageSize}"
+                                   class="active">${nav}</a></li>
+                        </c:if>
+                        <c:if test="${nav != pageInfo.pageNum}">
+                            <li>
+                                <a href="adminsList.html?province=${province1}&city=${city}&district=${district}&name=${name}&pageNum=${nav}&pageSize=${pageInfo.pageSize}">${nav}</a>
+                            </li>
+                        </c:if>
+                    </c:forEach>
+                    <li class="next"><a
+                            href="adminsList.html?province=${province1}&city=${city}&district=${district}&name=${name}&pageNum=${pageInfo.nextPage}&pageSize=${pageInfo.pageSize}">下一页</a>
+                    </li>
+                    <li>
+                        <a href="adminsList.html?province=${province1}&city=${city}&district=${district}&name=${name}&pageNum=${pageInfo.pages }&pageSize=${pageInfo.pageSize}">末页</a>
+                    </li>
+                </ul>
+            </div>
+        </section>
+    </div>
+</div>
+</div>
+<script type="text/javascript">
+
+    /*根据选择省份展示该省份下的城市*/
+    function provinceChange(provinceVal){
+        $.ajax({
+            type:"POST",
+            url:"listCityByAddrCode1.html",
+            data:{"addrCode":provinceVal.toString()},
+            dataType:"json",
+            success:function(ajax){
+                if (ajax.is){
+                    $("#s_city").html('<option value=" - 市"> - 市</option>');
+                    var str = "";
+                    for (var i = 0; i < ajax.data.length; i++){
+                        str += '<option value=" '+ajax.data[i].addrCode+' ">'+ajax.data[i].addrName+'</option>';
+                    };
+                    $("#s_city").append(str);
+                }
+            }
+        })
+    }
+
+    /*根据选择城市展示该城市下的区域*/
+    function cityChange(cityVal){
+        $.ajax({
+            type:"POST",
+            url:"listDistrictByAddrCode1.html",
+            data:{"addrCode":cityVal.toString()},
+            dataType:"json",
+            success:function(ajax){
+                if (ajax.is){
+                    $("#s_county").html('<option value=" - 县/区"> - 县/区</option>');
+                    var str = "";
+                    for (var i = 0; i < ajax.data.length; i++){
+                        str += '<option value=" '+ajax.data[i].addrCode+' ">'+ajax.data[i].addrName+'</option>';
+                    };
+                    $("#s_county").append(str);
+                }
+            }
+        })
+    }
+    <%--每页条数选择--%>
+    function pageSizeChoose(pageSizeVal){
+        location.href="adminsList.html?province=${province1}&city=${city}&district=${district}&name=${name}&pageSize="+pageSizeVal;
+    }
+
+    /*用户添加*/
+    function user_add(title,url,w,h){
+        layer_show(title,url,w,h);
+    }
+    /*用户修改*/
+    function admins_update(title,url,w,h){
+        console.log(title);
+        layer_show(title,url,w,h);
+    }
+
+    //全选与反选
+    $("#sltall").click(function () {
+        if ($(this).prop("checked")) {
+            $("[name='id']").prop("checked", true);//全选
+        } else {
+            $("[name='id']").prop("checked", false);//取消全选
+        }
+    });
+
+
+    function downs() {
+        var chkvalue = "";//定义一个数组
+        $("input[name='id']:checked").each(function () {
+            chkvalue += $(this).val() + ",";
+        });
+        window.location.href = "signexcels.html?chkvalue=" + chkvalue;
+    };
+
+    function del(id) {
+        layer.confirm('确认要删除吗?', function (index) {
+            $.post("providerDel.html", {id: id}, function (data) {
+                if (data.is) {
+                    layer.alert(data.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
+                        window.location = window.location;
+                    });
+                } else {
+                    layer.msg(data.msg, {icon: 2, time: 1000});
+                }
+            }, "json");
+        });
+    }
+
+
+    $("#delete").click(function () {
+        /*//判断是否至少选择一项
+        var checkedNum =$("input[name='ck_pro']:checked").length;
+        if(checkedNum==0){
+            layer.msg("请至少选择一个!",{icon:2,time:1000});
+            return;
+        }*/
+        layer.confirm('确认要删除全部后台录入信息吗?', function () {
+            /* var checkList= new Array();
+             $("input[name='ck_pro']:checked").each(function(){
+                 checkList.push($(this).val());
+             });*/
+            $.ajax({
+                type: "POST",
+                url: "providerDels.html",
+                /*data:{
+                    "id":checkList.toString()
+                },*/
+                dataType: "json",
+                success: function (ajax) {
+                    if (ajax.is) {
+                        layer.alert(ajax.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
+                            window.location = window.location;
+                        });
+                        /* $(":checkbox").prop("checked", false);*/
+                    } else {
+                        layer.msg(ajax.msg, {icon: 2, time: 1000});
+                    }
+                }
+            })
+        })
+    });
+    $("#checked_all").click(function () {
+        $("input[name='ck_pro']").prop("checked", this.checked);
+
+    })
+</script>
+</body>
+</html>

+ 329 - 0
src/main/webapp/WEB-INF/jsp/admin/adminsUpdate.jsp

@@ -0,0 +1,329 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%
+    String base = pageContext.getServletContext().getContextPath();
+%>
+<!--_meta 作为公共模版分离出去-->
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <script type="text/javascript">
+        window.UEDITOR_SERVER_URL = '<%=base%>';
+    </script>
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
+    <meta http-equiv="Cache-Control" content="no-siteapp"/>
+    <LINK rel="Bookmark" href="/favicon.ico">
+    <LINK rel="Shortcut Icon" href="/favicon.ico"/>
+
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui/css/H-ui.min.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/H-ui.admin.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/Hui-iconfont/1.0.8/iconfont.css"/>
+    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/admin/icheck/icheck.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/skin/default/skin.css" id="skin"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/style.css"/>
+
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/jquery/1.9.1/jquery.min.js"></script>
+    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/layer/layer.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/js/jquery.validate.min.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/js/validate-methods.js"></script>
+    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/js/messages_zh.min.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/icheck/jquery.icheck.min.js"></script>
+    <script src="${pageContext.request.contextPath}/static/admin/manage/js/WdatePicker.js"></script>
+
+    <script type="text/javascript">
+        window.onunload = function() {
+            window.location.href="adminsList.html"
+        };
+        $(function () {
+            $("#sub").click(function () {
+             var loginname = $("#loginname").val();
+             var name  = $("#name").val();
+             var telephone = $("#telephone").val();
+             var province = $("#s_province").val();
+             var city = $("#s_city").val();
+             var district = $("#s_county").val();
+             var street = $("#street").val();
+             var bornDate = $("#bornDate").val();
+             var authPhone_reg = /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(16[0-9])|(17[0-9])|(18[0-9]))\d{8}$|^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(16[0-9])|(17[0-9])|(18[0-9]))\d{8}$|^0\d{2,3}-?\d{7,8}$/;
+             if (loginname == null || loginname == ""){
+                 layer.msg("账号不能为空");
+                 return false;
+             }
+             if (name == null || name == ""){
+                 layer.msg("姓名不能为空");
+                 return false;
+             }
+             if(telephone == null || telephone == ''){
+                 layer.msg("电话不能为空");
+                 return false;
+             }
+             if(province == '省'){
+                 layer.msg("省份不能为空");
+                 return false;
+             }
+             if (city ==' - 市'){
+                 layer.msg("城市不能为空");
+                 return false;
+             }
+             if (district==' - 县/区'){
+                 layer.msg("区域不能为空");
+                 return false;
+             }
+             if (street == null || street == ''){
+                 layer.msg("街道不能为空");
+                 return false;
+             }
+             if (bornDate == null || bornDate == ''){
+                 layer.msg("出生日期不能为空");
+                 return false;
+             }
+                if (!(authPhone_reg.test(telephone))) {
+                    layer.msg("用户电话不正确~");
+                    return false;
+                }
+
+             var formData  = new FormData();
+                formData.append("id",$("#id").val());//id
+                formData.append("loginname",$("#loginname").val());//账号
+                formData.append("name",$("#name").val());//姓名
+                formData.append("telephone",$("#telephone").val());//电话
+                formData.append("state",$("#state").val());//状态
+                formData.append("province",$("#s_province").val());//省
+                formData.append("city",$("#s_city").val());//市
+                formData.append("district",$("#s_county").val());//区
+                formData.append("street",$("#street").val());//街道
+                formData.append("formatDate",$("#bornDate").val())//出生日期
+
+                $.ajax({
+                    type:"POST",
+                    url:"adminsUpdates.html",
+                    data:formData,
+                    dataType:"json",
+                    cache: false,
+                    async : false,
+                    processData: false,
+                    contentType: false,
+                    success:function (ajax) {
+                        if (ajax.is){
+                            layer.msg(ajax.msg);
+                            layer.alert(ajax.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
+                            var index = parent.layer.getFrameIndex(window.name);
+                            parent.layer.close(index);
+                            });
+
+                        } else {
+                            layer.msg(ajax.msg);
+                        }
+                    }
+                })
+            });
+        });
+    </script>
+
+    <title>管理员管理</title>
+</head>
+<body>
+<nav class="breadcrumb">
+    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span><a href="javascript:history.go(-1)" title="用户管理">用户管理</a><span class="c-gray en">&gt;</span> 添加
+    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<article class="page-container">
+    <form  class="form form-horizontal" id="subform">
+
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>账号:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="loginname" id="loginname" value="${admins.loginname}">
+                <input type="text" hidden class="input-text" name="id" id="id" value="${admins.id}">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1">启/禁用:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <select name="state" id="state"   class="input-text">
+                    <c:if test="${admins.state == '0'}">
+                        <option value="0" selected>禁用</option>
+                        <option value="1" >启用</option>
+                    </c:if>
+                    <c:if test="${admins.state == '1'}">
+                        <option value="0" >禁用</option>
+                        <option value="1" selected>启用</option>
+                    </c:if>
+                </select>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>姓名:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="name" id="name" value="${admins.name}">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>电话:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="telephone" id="telephone" value="${admins.telephone}">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>省,市,区:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <select id="s_province" name ="province" onchange="provinceChange(this.value)" style="width: 100px;height: 30px;font-size: 14px">
+
+                    <c:forEach items="${province}" var="province">
+                        <option value="${province.addrCode}" <c:if test="${province.addrCode == admins.province}">selected="selected"</c:if>>${province.addrName}</option>
+                    </c:forEach>
+                </select>
+                <select id="s_city" name ="city"  onchange="cityChange(this.value)" style="width: 100px;height: 30px;font-size: 14px">
+                    <c:forEach items="${city}" var="city">
+                        <option value="${city.addrCode}" <c:if test="${admins.city == city.addrCode}">selected="selected"</c:if> >${city.addrName}</option>
+                    </c:forEach>
+                </select>
+
+                <select id="s_county" name ="district" style="width: 100px;height: 30px;font-size: 14px">
+                    <c:forEach items="${district}" var="district">
+                        <option value="${district.addrCode}" <c:if test="${admins.district == district.addrCode}">selected="selected"</c:if> >${district.addrName}</option>
+                    </c:forEach>
+                </select>
+            </div>
+            <%--  <div id="show"></div>--%>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>街道:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="street" id="street" value="${admins.street}">
+            </div>
+        </div>
+        <div class="row cl" >
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>出生日期:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" id="bornDate"  name="bornDate" value="${admins.formatDate}"  onfocus="WdatePicker({ Date:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}' })"  class="input-text Wdate" >
+                <input type="text" hidden onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d' })"  class="input-text Wdate" style="width:120px;">
+            </div>
+        </div>
+
+        <div class="row cl">
+            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-1">
+                <button type="button" class="btn btn-primary radius" id="sub" name="admin-role-save"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
+            </div>
+        </div>
+    </form>
+</article>
+
+<!--请在下方写此页面业务相关的脚本-->
+<!-- 百度文本编辑器   引用文件 -->
+<link href="<%=base%>/static/ue/themes/default/css/ueditor.css" type="text/css" rel="stylesheet">
+<script src="<%=base%>/static/ue/ueditor.config.js" type="text/javascript"></script>
+<script src="<%=base%>/static/ue/ueditor.all.js" type="text/javascript"></script>
+<script type="text/javascript" src="<%=base%>/static/ue/lang/zh-cn/zh-cn.js"></script>
+
+<!-- 百度文本编辑器   js -->
+<script type="text/javascript">
+
+    /*根据选择省份展示该省份下的城市*/
+    function provinceChange(provinceVal){
+        $.ajax({
+            type:"POST",
+            url:"listCityByAddrCode.html",
+            data:{"addrCode":provinceVal.toString()},
+            dataType:"json",
+            success:function(ajax){
+                if (ajax.is){
+                    $("#s_city").html('<option value=" - 市"> - 市</option>');
+                    var str = "";
+                    for (var i = 0; i < ajax.data.length; i++){
+                        str += '<option value=" '+ajax.data[i].addrCode+' ">'+ajax.data[i].addrName+'</option>';
+                    };
+                    $("#s_city").append(str);
+                }
+            }
+        })
+    }
+
+    /*根据选择城市展示该城市下的区域*/
+    function cityChange(cityVal){
+        $.ajax({
+            type:"POST",
+            url:"listDistrictByAddrCode.html",
+            data:{"addrCode":cityVal.toString()},
+            dataType:"json",
+            success:function(ajax){
+                if (ajax.is){
+                    $("#s_county").html('<option value=" - 县/区"> - 县/区</option>');
+                    var str = "";
+                    for (var i = 0; i < ajax.data.length; i++){
+                        str += '<option value=" '+ajax.data[i].addrCode+' ">'+ajax.data[i].addrName+'</option>';
+                    };
+                    $("#s_county").append(str);
+                }
+            }
+        })
+    }
+
+
+    $(function () {
+        var ue = UE.getEditor('introduction', {
+            //关闭字数统计
+            wordCount: false,
+            toolbars: [['fullscreen', 'source', '|', 'undo', 'redo', '|',
+                'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
+                'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
+                'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
+                'directionalityltr', 'directionalityrtl', 'indent', '|',
+                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
+                'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
+                'insertimage', 'emotion', 'insertvideo', 'attachment', 'map', 'template', 'background', '|',
+                'horizontal', 'date', 'time', 'spechars', 'wordimage', '|',
+                'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
+                'print', 'preview', 'searchreplace', 'help'
+            ]],
+            //关闭elementPath
+            elementPathEnabled: false,
+        });
+    });
+
+
+    var currentBrowserId;
+
+    function browserImage(targetId) {
+        currentBrowserId = targetId;
+        var weboxTemp = $.webox({
+            height: 600,
+            width: 1024,
+            bgvisibel: true,
+            title: '图片管理',
+            iframe: '<%=base%>/admin/image/imgbox.html?' + Math.random()
+        });
+    }
+
+    function setImagepath(imgPath) {
+        $('#' + currentBrowserId).val(imgPath);
+    }
+
+    function closeFrame() {
+        $('#locked .span').click();
+    }
+</script>
+
+
+<!--请在下方写此页面业务相关的脚本-->
+<script type="text/javascript">
+</script>
+<!--/请在上方写此页面业务相关的脚本-->
+</body>
+</html>

+ 1 - 0
src/main/webapp/WEB-INF/jsp/admin/index.jsp

@@ -281,6 +281,7 @@
                     <ul>
                         <li><a data-href="bannerList.html" data-title="广告位" href="javascript:void(0)">广告位</a></li>
 						<li><a data-href="bannerNumber.html" data-title="广告位数量" href="javascript:void(0)">系统设置</a></li>
+                        <li><a data-href="adminsList.html" data-title="用户管理" href="javascript:void(0)">用户管理</a></li>
 <%--                        <li><a data-href="bannerDetailList.html" data-title="banner详情" href="javascript:void(0)">banner详情开发中....</a></li>--%>
 
                     </ul>