Home stay management system based on javaweb+mysql (java+SSM+JSP+bootstrap+jQuery+mysql)

Front and back end of ssm home stay management system web page
Project introduction
Tourist functions: user registration, login, login permission interception, search rooms by name, payment process, view order information and status, comment on reserved rooms, automatically modify order status, view and count the number of remaining rooms. When the number is 0, it cannot be reserved
Administrator functions: room classification management, room management and order management

Advanced functions: export and print of various lists, query of order combination conditions

Function list
Tourist function

  • User registration and login

  • Login permission interception

  • Search for rooms by name

  • Payment process

  • View order information and status

  • Comment on the reserved room and automatically modify the order status

  • View and count the number of remaining rooms. When the number is 0, it cannot be reserved

Administrator function

Room classification management

  • Type deletion, modification and query (ready to add function, i.e. image upload function)
  • Addition, deletion, modification and query of attributes contained in type
  • Room classification picture upload

Room management

  • Room addition, deletion and modification of guide printing system
  • Query all photos of uploaded rooms
  • Property setting of supporting facilities of the room
  • Room price (original price, activity price), name, description and other attribute settings
  • Room stock statistics

Order management

  • Modification and deletion of order information

  • Order combination condition query

  • Filter out orders that have timed out without comments

Advanced features

  • Export and print functions of various lists

  • Order combination condition query

Environmental needs
1. Running environment: java jdk 1.8 is preferred. We run it on this platform. Other versions are theoretically OK.
2.IDE environment: IDEA, eclipse and MyEclipse are OK. Recommend IDEA;
3.tomcat environment: Tomcat 7 x,8. x,9. X version
4. Hardware environment: Windows 7 / 8 / 10 with more than 1G memory; Or Mac OS;
5. Maven project: Yes; Check whether the source directory contains POM xml; If yes, it is a maven project; otherwise, it is a non Maven project
6. Database: MySQL version 5.7;

Technology stack

  1. Back end: Spring MVC mybatis

  2. Front end: JSP+bootstrap+jQuery

instructions

  1. Use Navicat or other tools to create a database with the corresponding name in mysql and import the sql file of the project;

  2. Add ApplicationContext. To the project Change the database configuration in the XML configuration file to your own configuration;

  3. Use IDEA/Eclipse/MyEclipse to import the project. When importing Eclipse/MyEclipse, if it is a maven project, please select Maven;
    If it is a maven project, please execute Maven clean after successful import; Maven install command, configure tomcat, and then run;

  4. Run the project and enter localhost:8080 / login






apply

Course design, big homework, graduation project, project practice, learning demonstration, etc

							  @RequestParam("starttime") String starttime, @RequestParam("endtime") String endtime,
							  @RequestParam("isenter") int isenter, @RequestParam("ismenber") int ismenber,
							  @RequestParam("roomcount") int roomcount, @RequestParam("roomnos") String roomnos,
							  @RequestParam("price") int price)
	{
		Order o = new Order();
		o.setName(name);
		o.setId(id);
		o.setPhone(phone);
		// Format the String type as timestamp
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
		try {
			Date startT = sdf.parse(starttime);
			Date endT = sdf.parse(endtime);
            return ResultReturn.error(2,"Room number already exists!");
    }
    //Update existing information
    @RequestMapping("/room/update/{roomno}")
    public Result roomUpdate(@PathVariable("roomno") int roomno,@RequestParam("type") int type,
							 @RequestParam("price") int price,@RequestParam("ifwindow") int ifwindow,
							 @RequestParam("comment") String comment) {
        //You need to query whether it exists first
        if(roomservice.findByRoom(roomno)==null) {
            return ResultReturn.error(1,"cant't find roomno!");
        }
        else {
            Room r = saveRoom(roomno, type, price, ifwindow, comment);
	 * @param roomnoAfter  Previous room number
	 * @param roomnoBefore Now reset the room number (required for price calculation)
	 * @param orderno      Order number (required to save the price of the current order)
	 * @return Return to saved orderroom object
	 */
	@RequestMapping("/order/orderroom/update/{orno}")
	public Result orderroomUpdate(@PathVariable("orno") int orno,@RequestParam("brand") String brand,
								  @RequestParam("roomnoAfter") int roomnoAfter,
								  @RequestParam("roomnoBefore") int roomnoBefore,@RequestParam("orderno") int orderno)
	{
		OrderRoom or=orderroomservice.findOne(orno);
		or.setBrand(brand);
		or.setRoomno(roomnoAfter);
		List<Roomid> ri=roomidservice.findAll(roomnoBefore);
		for (Roomid aRi : ri)
		}
//		if(StringUtils.isEmpty(user.getPassword())){
//			ret.put("type", "error");
//			ret.put("msg", "please fill in the password!");
//			return ret;
//		}
		if(user.getRoleId() == null){
			ret.put("type", "error");
			ret.put("msg", "Please select your role!");
			return ret;
		}
		if(isExist(user.getUsername(), user.getId())){
			ret.put("type", "error");
			ret.put("msg", "The user name already exists, please re-enter!");
			return ret;
		}
		if(userService.edit(user) <= 0){
			ret.put("type", "error");
			ret.put("msg", "Failed to add user, please contact administrator!");
			return ret;
		}
		ret.put("type", "success");
		ret.put("msg", "Role added successfully!");
		return ret;
	}
    }
    public Standard saveStandard(String stdname,int roomarea,int bedno,String equip1,String equip2){
        Standard s = new Standard();
        s.setStdname(stdname);
        s.setRoomerea(roomarea);
        s.setBedno(bedno);
        s.setEquip1(equip1);
        s.setEquip2(equip2);
        return s;
    }
}
@RestController
public class MemberController
{
	private final MemberService memberService;
	@Autowired
	public MemberController(MemberService memberService)
	{
		this.memberService=memberService;
	}
	/**
	 *
	 * @return Return to member list
	 */
	@RequestMapping("/member/getall")
	public Result<List<Member>> getAll()
	{
			//Save the file to the specified directory
			photo.transferTo(new File(savePath+filename));
		}catch (Exception e) {
			// TODO Auto-generated catch block
			ret.put("type", "error");
			ret.put("msg", "Save file exception!");
			e.printStackTrace();
			return ret;
		}
		ret.put("type", "success");
		ret.put("msg", "User deleted successfully!");
		ret.put("filepath",request.getServletContext().getContextPath() + "/resources/upload/" + filename );
		return ret;
	}
	/**
	 * @param model
	 * @return
	 */
	@RequestMapping(value="/list",method=RequestMethod.GET)
	public ModelAndView list(ModelAndView model){
		Map<String, Object> queryMap = new HashMap<String, Object>();
		model.addObject("roleList", roleService.findList(queryMap));
		model.setViewName("user/list");
		return model;
	}
	
	/**
	 * Get user list
	 * @param page
	 * @param username
	 * @param roleId
	
	/**
	 * Get user list
	 * @param page
	 * @param username
	 * @param roleId
	 * @param sex
	 * @return
	 */
	@RequestMapping(value="/list",method=RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> getList(Page page,
			@RequestParam(name="username",required=false,defaultValue="") String username,
			@RequestParam(name="roleId",required=false) Long roleId,
			@RequestParam(name="sex",required=false) Integer sex
			){
		Map<String, Object> ret = new HashMap<String, Object>();
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put("username", username);
		queryMap.put("roleId", roleId);
		queryMap.put("sex", sex);
		queryMap.put("offset", page.getOffset());
		queryMap.put("pageSize", page.getRows());
		ret.put("rows", userService.findList(queryMap));
		ret.put("total", userService.getTotal(queryMap));
		return ret;
	}
			@RequestParam(name="username",required=false,defaultValue="") String username,
			@RequestParam(name="roleId",required=false) Long roleId,
			@RequestParam(name="sex",required=false) Integer sex
			){
		Map<String, Object> ret = new HashMap<String, Object>();
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put("username", username);
		queryMap.put("roleId", roleId);
		queryMap.put("sex", sex);
		queryMap.put("offset", page.getOffset());
		queryMap.put("pageSize", page.getRows());
		ret.put("rows", userService.findList(queryMap));
		ret.put("total", userService.getTotal(queryMap));
		return ret;
	}
	
	/**
	 * Add user
	 * @param user
	 * @return
	private RoleService roleService;
	
	/**
	 * User list page
	 * @param model
	 * @return
	 */
	@RequestMapping(value="/list",method=RequestMethod.GET)
	public ModelAndView list(ModelAndView model){
		Map<String, Object> queryMap = new HashMap<String, Object>();
		model.addObject("roleList", roleService.findList(queryMap));
		model.setViewName("user/list");
		return model;
	}
	
	/**
	 * Get user list
	 * @param page
	 * @param username
	 * @param roleId
	 * @param sex
	 * @return
	 */
	@RequestMapping(value="/list",method=RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> getList(Page page,
			@RequestParam(name="username",required=false,defaultValue="") String username,
		if(userService.add(user) <= 0){
			ret.put("type", "error");
			ret.put("msg", "Failed to add user, please contact administrator!");
			return ret;
		}
		ret.put("type", "success");
		ret.put("msg", "Role added successfully!");
		return ret;
	}
	
	/**
	 * Edit user
	 * @param user
	 * @return
	 */
	@RequestMapping(value="/edit",method=RequestMethod.POST)
	@ResponseBody
	public Map<String, String> edit(User user){

Tags: Java MySQL bootstrap

Posted by TronB24 on Wed, 25 May 2022 23:43:22 +0300