Source code acquisition : Blog home page " resources " Download in !

one , Project brief

function : Main functions main functions member management , Resident management , Room tube reason , system management , And the display, export and maintenance of some important data ;

two , Project operation

Environment configuration : Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ
IDEA,Eclispe,MyEclispe,Sts All support )

Project technology : JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery +
Ajax + layui+ maven wait .

 

Order control layer :
@Controller @RequestMapping("/orders") public class OrdersController {
@Resource private OrdersService ordersService; /** * Add order * @param orders *
@return */ @RequestMapping("/addOrders") @ResponseBody public String
addOrders(Orders orders){ Map<String,Object> map = new
HashMap<String,Object>(); // Call the method to add the order if(ordersService.addOrders(orders)>0){
map.put(SystemConstant.SUCCESS,true); map.put(SystemConstant.MESSAGE," Hotel reservation successful ");
}else{ map.put(SystemConstant.SUCCESS,false);
map.put(SystemConstant.MESSAGE," Hotel reservation failed , Please try again !"); } return JSON.toJSONString(map);
} }
Room control floor :
/** * @author yy */ @Controller @RequestMapping("/room") public class
RoomController { @Resource private RoomService roomService; @Resource private
RoomTypeService roomTypeService; /** * Query room details * @param id * @param model *
@return */ @RequestMapping("/{id}.html") public String detail(@PathVariable
Integer id, Model model){ // Call the method of querying room details Room room = roomService.findById(id);
// Put data into model model.addAttribute("room",room); return "detail"; } /** * Query all rooms list *
@param model * @return */ @RequestMapping("/list.html") public String
list(Model model){ // Call the method to query the list of all house types List<RoomType> roomTypeList =
roomTypeService.findRoomTypeList(null); // Create query criteria class RoomVo roomVo = new RoomVo();
roomVo.setStatus(3);// Bookable // Query room list List<Room> roomList =
roomService.findRoomListByPage(roomVo); // Put data into model
model.addAttribute("roomTypeList",roomTypeList);
model.addAttribute("roomList",roomList); return "hotelList"; } /** * Query room list according to room type
* @param model * @return */ @RequestMapping("/list/{id}") public String
list(@PathVariable Integer id,Model model){ // Call the method to query the list of all house types List<RoomType>
roomTypeList = roomTypeService.findRoomTypeList(null); // Create query criteria class RoomVo roomVo
= new RoomVo(); roomVo.setRoomtypeid(id);// layout of a house or an apartment ID roomVo.setStatus(3);// Bookable
// Query room list List<Room> roomList = roomService.findRoomListByPage(roomVo);
// Put data into model model.addAttribute("roomTypeList",roomTypeList);
model.addAttribute("roomList",roomList);
model.addAttribute("typeId",id);// The current room type will be selected ID Save to model , The purpose is to echo the selected text in the page ( Change the selected color )
return "hotelList"; } }

User control layer :
/** * @author yy */ @Controller @RequestMapping("/user") public class
UserController { @Autowired private UserService userService; /** * register * @param
user * @return */ @RequestMapping("/register") @ResponseBody public String
register(User user){ Map<String,Object> map = new HashMap<String,Object>();
// Call registered method if(userService.addUser(user)>0){
map.put(SystemConstant.SUCCESS,true);
map.put(SystemConstant.MESSAGE," congratulations , login was successful !"); }else{
map.put(SystemConstant.SUCCESS,false);
map.put(SystemConstant.MESSAGE," unfortunately , login has failed , Please try again !"); } return
JSON.toJSONString(map); } /** * Sign in * @param * @return */
@RequestMapping("/login") @ResponseBody public String login(String loginName,
String password, HttpSession Session){ Map<String,Object> map = new
HashMap<String,Object>(); // Call registered method User loginUser =
userService.login(loginName, password); // Login judgment if(loginUser!=null){ // Clear password
loginUser.setPassword(null); map.put(SystemConstant.SUCCESS,true);
// Save login user information to session in
Session.setAttribute(SystemConstant.FRONT_LOGIN_USER,loginUser); }else{
map.put(SystemConstant.SUCCESS,false);
map.put(SystemConstant.MESSAGE," Wrong user name or password , Please login again !"); } return
JSON.toJSONString(map); } /** * Query user information according to user name * @param loginName * @return */
@RequestMapping("/checkName") @ResponseBody public String checkName(String
loginName){ Map<String,Object> map = new HashMap<String,Object>(); // Call registered method
if(userService.findUserByName(loginName)!=null){
map.put(SystemConstant.EXISI,true);
map.put(SystemConstant.MESSAGE," User name exists , Please re-enter "); }else{
map.put(SystemConstant.EXISI,false); } return JSON.toJSONString(map); } }
Source code acquisition : Blog home page " resources " Download in !

Technology