diff --git a/.idea/misc.xml b/.idea/misc.xml index dae93b91321b6d389b472255a801019b0e74f326..803a7162d5c3e85bd8d366b889b98320128d5861 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/src/main/java/com/pro/info/controller/CustomerController.java b/src/main/java/com/pro/info/controller/CustomerController.java new file mode 100644 index 0000000000000000000000000000000000000000..12d68bc5023aa7c3c5923470f9059e990fbbfeab --- /dev/null +++ b/src/main/java/com/pro/info/controller/CustomerController.java @@ -0,0 +1,53 @@ +package com.pro.info.controller; + +import com.github.pagehelper.PageInfo; +import com.pro.info.entity.Customer; +import com.pro.info.service.CustomerService; +import com.sun.xml.internal.xsom.impl.scd.Iterators; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Controller +@RequestMapping(value = "/info") +public class CustomerController { + @Autowired + private CustomerService customerService; + + /** + * 获得客户维修页面值 + * @param page + * @param pageSize + * @return + */ + @RequestMapping("customerList") + @ResponseBody + public Map getCustomer(@RequestParam(value = "page" ,defaultValue ="1") int page,@RequestParam(value = "limit",required = false) int pageSize) { +// System.out.println("page"+page); +// System.out.println("limit:---------------"+limit); + + Map map = new HashMap(); + PageInfo customer = customerService.getCustomer(page,pageSize); + + + map.put("code", 0); + map.put("msg", ""); + map.put("count", customer.getTotal()); + map.put("data", customer.getList()); + System.out.println("map--------------->"+map); + return map; + + } + /* + 去客户维护页面 + */ +@RequestMapping("customer") + public String toCustomer(){ + return "info/customerList"; +} +} diff --git a/src/main/java/com/pro/info/mapper/CustomerMapper.java b/src/main/java/com/pro/info/mapper/CustomerMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..1a8226aed2f1426570f089fb97e422e9b3614731 --- /dev/null +++ b/src/main/java/com/pro/info/mapper/CustomerMapper.java @@ -0,0 +1,16 @@ +package com.pro.info.mapper; + +import com.pro.info.entity.Customer; +import org.mybatis.spring.annotation.MapperScan; + +import java.util.List; +@MapperScan +public interface CustomerMapper { + /** + * 查询客户 + * 2018/8/3 10:41 + * zls + * @return + */ + public List getCustomer(); +} diff --git a/src/main/java/com/pro/info/service/CustomerService.java b/src/main/java/com/pro/info/service/CustomerService.java new file mode 100644 index 0000000000000000000000000000000000000000..ec7ca255e31314a531c4d600b8ab02d68658c83a --- /dev/null +++ b/src/main/java/com/pro/info/service/CustomerService.java @@ -0,0 +1,14 @@ +package com.pro.info.service; + +import com.github.pagehelper.PageInfo; +import com.pro.info.entity.Customer; +import com.pro.sys.entity.Page; + +import java.util.List; + +public interface CustomerService { + /** + * 客户查询 + */ + public PageInfo getCustomer(int page,int pageSize); +} diff --git a/src/main/java/com/pro/info/service/impl/CustomerServiceImpl.java b/src/main/java/com/pro/info/service/impl/CustomerServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..0e33fc32ce2db2946b316762ad55376d60b683bf --- /dev/null +++ b/src/main/java/com/pro/info/service/impl/CustomerServiceImpl.java @@ -0,0 +1,23 @@ +package com.pro.info.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.pro.info.entity.Customer; +import com.pro.info.mapper.CustomerMapper; +import com.pro.info.service.CustomerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +@Service +public class CustomerServiceImpl implements CustomerService { +@Autowired +private CustomerMapper customerMapper; + @Override + public PageInfo getCustomer(int page,int pageSize) { + PageHelper.startPage(page,pageSize); + List customer = customerMapper.getCustomer(); + PageInfo customerPageInfo = new PageInfo(customer); + return customerPageInfo; + } +} diff --git a/src/main/java/com/pro/sys/entity/Page.java b/src/main/java/com/pro/sys/entity/Page.java new file mode 100644 index 0000000000000000000000000000000000000000..9c8f767b2dbe9361dd64601dea3da104edf8bd8f --- /dev/null +++ b/src/main/java/com/pro/sys/entity/Page.java @@ -0,0 +1,81 @@ +package com.pro.sys.entity; + +import java.io.Serializable; +import java.util.List; + +public class Page implements Serializable { + private static final long serialVersionUID = 8656597559014685635L; + private long total; //总记录数 + private List list; //结果集 + private int pageNum; // 第几页 + private int pageSize; // 每页记录数 + private int pages; // 总页数 + private int size; // 当前页的数量 <= pageSize,该属性来自ArrayList的size属性 + + /** + * 包装Page对象,因为直接返回Page对象,在JSON处理以及其他情况下会被当成List来处理, + * 而出现一些问题。 + * @param list page结果 + */ + public Page(List list) { + if (list instanceof com.github.pagehelper.Page) { + com.github.pagehelper.Page page = (com.github.pagehelper.Page) list; + this.pageNum = page.getPageNum(); + this.pageSize = page.getPageSize(); + this.total = page.getTotal(); + this.pages = page.getPages(); + this.list = page; + this.size = page.size(); + } + } + + public long getTotal() { + return total; + } + + public void setTotal(long total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getPageNum() { + return pageNum; + } + + public void setPageNum(int pageNum) { + this.pageNum = pageNum; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + +} + diff --git a/src/main/resources/mapper/info/CustomerMapper.xml b/src/main/resources/mapper/info/CustomerMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..24262411da67e239325fe23fa7ccc0095752cca6 --- /dev/null +++ b/src/main/resources/mapper/info/CustomerMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/spring-root-shiro.xml b/src/main/resources/spring-root-shiro.xml index edca378c3ef779f47838ebc9916383088586b496..217dda5fd2336cd8d9d9668c495e02217acbb63d 100644 --- a/src/main/resources/spring-root-shiro.xml +++ b/src/main/resources/spring-root-shiro.xml @@ -17,11 +17,9 @@ - /static/** = anon /sys/login = anon /pro/readName = authc, perms[/readName] /pro/readData = authc, perms[/readData] - /logout = logout /** = authc diff --git a/src/main/web/WEB-INF/views/info/customerList.jsp b/src/main/web/WEB-INF/views/info/customerList.jsp new file mode 100644 index 0000000000000000000000000000000000000000..765ca2766357c80db397571f3b5babc54d01ae32 --- /dev/null +++ b/src/main/web/WEB-INF/views/info/customerList.jsp @@ -0,0 +1,71 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2018/8/3 + Time: 15:02 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + + +<%--
+ + + + + + + + + + + + + + + +
idxingmingremarkzhuangtai
${customer.cus_id}${customer.cus_name}${customer.cus_remark}${customer.cus_status}
+
--%> + +
+ + + + + +
+
+ + + + + + + + + diff --git a/src/main/web/WEB-INF/views/info/index.jsp b/src/main/web/WEB-INF/views/info/index.jsp new file mode 100644 index 0000000000000000000000000000000000000000..1d68e6a0a7dc18707e756e03a06286554298859f --- /dev/null +++ b/src/main/web/WEB-INF/views/info/index.jsp @@ -0,0 +1,185 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2018/8/3 + Time: 13:59 + To change this template use File | Settings | File Templates. +--%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + + + Insert title here + + + + + + + + +
+ XXX云信息系统 +
当前用户:XXX
+
+
+ +
+点击 + + +
+ + + +
+ +
+ + +
+ + +
+
+ + + + + + + + + + diff --git a/src/main/web/static/bootstrap-4.1.1/signin.css b/src/main/web/static/bootstrap-4.1.1/signin.css deleted file mode 100644 index 3a233496f72a1c418c792c76d8116b0f26a0f9c7..0000000000000000000000000000000000000000 --- a/src/main/web/static/bootstrap-4.1.1/signin.css +++ /dev/null @@ -1,40 +0,0 @@ -body { - padding-top: 40px; - padding-bottom: 40px; - background-color: #eee; -} - -.form-signin { - max-width: 330px; - padding: 15px; - margin: 0 auto; -} -.form-signin .form-signin-heading, -.form-signin .checkbox { - margin-bottom: 10px; -} -.form-signin .checkbox { - font-weight: normal; -} -.form-signin .form-control { - position: relative; - height: auto; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - padding: 10px; - font-size: 16px; -} -.form-signin .form-control:focus { - z-index: 2; -} -.form-signin input[type="email"] { - margin-bottom: -1px; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.form-signin input[type="password"] { - margin-bottom: 10px; - border-top-left-radius: 0; - border-top-right-radius: 0; -}