**本次項目分爲兩類用戶,超級管理員和普通管理員,超級管理員可以創建普通管理員,並且對普通管理員進行授權,項目核心功能包括住戶信息登記,住戶繳費信息記錄,查看並且打印繳費記錄,扣費信息記錄,打印個人扣費信息等功能。**
@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;
}