**本次项目分为两类用户,超级管理员和普通管理员,超级管理员可以创建普通管理员,并且对普通管理员进行授权,项目核心功能包括住户信息登记,住户缴费信息记录,查看并且打印缴费记录,扣费信息记录,打印个人扣费信息等功能。**
@RequestMapping("login") public void login(Admin vo, HttpServletResponse response){
// 接收参数
String aid = vo.getAid(); String password = new MD5Code().getMD5ofStr("{"+vo.getPassword()+"}"+vo.getAid()); // 加密处理
@RequestMapping("login") public void login(Admin vo, HttpServletResponse response){
// 接收参数
String aid = vo.getAid(); String password = new MD5Code().getMD5ofStr("{"+vo.getPassword()+"}"+vo.getAid()); // 加密处理
编写 action 方法实现数据 json 格式转换,本次使用 fastjson 实现数据转换处理,在 layui 中定义页面表格显示有格式要求,
我们必须按照 layui 格式进行编写,使用 map 集合转换数据;
范例:定义 listSplit 方法
@RequiresUser @RequiresRoles("hello") @RequiresPermissions("users:list") @RequestMapping("listSplit") public void listSplit(HttpServletResponse response, HttpServletRequest request) { try { response.setCharacterEncoding("UTF-8"); request.setCharacterEncoding("UTF-8"); int currentPage = 1; int lineSize = 12;
lineSize = Integer. parseInt (request.getParameter("limit"));
currentPage = Integer. parseInt (request.getParameter("page")); Map<String, Object> map = this.usersService.listSplit(currentPage, lineSize); map.put("data", map.get("allUsers")); map.put("count", map.get("allCount")); map.put("msg", ""); map.put("code", 0);
response.getWriter().print(JSONObject. toJSONString (map, SerializerFeature. WriteDateUseDateFormat )); } catch (Exception e) {
}
}
记录管理员编号与住房编号,是为了更好查询操作的人员,管理员可以查看此住房缴费信息。
范例:定义 pay
public class Pay implements Serializable { private Integer pid; private Double price; private Timestamp credate; private String aid,uid;
}