ToB企服应用市场:ToB评测及商务社交产业平台

标题: 基于javaweb+mysql的jsp+servlet聚会会议室预约体系(java+jsp+bootstrap+servle [打印本页]

作者: 渣渣兔    时间: 2024-8-26 10:51
标题: 基于javaweb+mysql的jsp+servlet聚会会议室预约体系(java+jsp+bootstrap+servle
基于javaweb+mysql的jsp+servlet聚会会议室预约体系(java+jsp+bootstrap+servlet+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可设置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的JSP+Servlet聚会会议室预约体系(java+jsp+bootstrap+servlet+mysql)
项目先容
网上聚会会议室预约体系,该项目是一个前背景的项目;
前台重要功能有: 登录、注册; 首页、预约须知; 聚会会议室预约; 聚会会议室信息; 聚会会议室预约表; 背景重要功能有: 通告栏:查看、添加、修改、删除; 聚会会议室信息:查看、添加、修改、删除; 查看登记表; 查看预约消息;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 否;查看源码目次中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 8.0版本;
技术栈
使用说明
  1. public class UtilHelper {
  2.         /**
  3.          * 获取当前日期时间
  4.          */
  5.         public static String getTime() {
  6.                 Date date = new Date();
  7.                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  8.                 return sdf.format(date);
  9.         }
  10.         /**
  11.          * 把date对象转换成String
  12.          * @param date
  13.          */
  14.         public static String dateToString(Date date) {
  15.                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  16.                 return sdf.format(date);
  17.         }
  18.         /**
  19.          *
  20.          * @param num
  21.          * @return
  22.          */
  23.         public static DateTime createDateTime(int num, HttpServletRequest request){
  24.                 LocalDate ld = LocalDate.now();
  25.                 int week = ld.getDayOfWeek().getValue();
  26.                 LocalDate date = ld.plusWeeks(num);
  27.                 LocalDate monday = date.plusDays(-(week-1));
  28.                 LocalDate tuesday = monday.plusDays(1);
  29.                 LocalDate wednesday = tuesday.plusDays(1);
  30.                 LocalDate thursday = wednesday.plusDays(1);
  31.                 LocalDate friday = thursday.plusDays(1);
  32.                 LocalDate saturday = friday.plusDays(1);
  33.                 LocalDate sunday = saturday.plusDays(1);
  34.                 DateTime dateTime = new DateTime();
复制代码
  1. @WebServlet("/back/changeStatus")
  2. public class ChangeStatusServlet extends HttpServlet {
  3.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  4.         this.doGet(request, response);
  5.     }
  6.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  7.         request.setCharacterEncoding("utf8");
  8.         response.setContentType("application/json;charset=utf-8");
  9.         PrintWriter out = response.getWriter();
  10.         String id = request.getParameter("id");
  11.         String status = request.getParameter("status");
  12.         String referer = request.getHeader("referer");
  13.         MessageService messageService = new MessageServiceImpl();
  14.         UserService userService = new UserServiceImpl();
  15.         ApplyService applyService = new ApplyServiceImpl();
  16.         Message message = new Message();
  17.         int count;
  18.         if (referer.contains("regformList")){
  19.             count = userService.changeStatus(Integer.parseInt(id),Integer.parseInt(status));
  20.             if(status.equals("1")){
  21.                 String username = userService.getNameById(Integer.parseInt(id));
  22.                 message.setUid(Integer.parseInt(id));
  23.                 message.setTitle("系统消息");
  24.                 message.setContent("尊敬的用户"+username+",您好!您的会议室登记信息已通过,现在可以进行会议室预约,祝您使用愉快");
  25.                 messageService.addMessage(message);
  26.             }
  27.         }else {
  28.             count = applyService.changeStatus(Integer.parseInt(id),Integer.parseInt(status));
  29.             if(status.equals("1")){
  30.                 int uid = applyService.getUid(Integer.parseInt(id));
  31.                 String username = userService.getNameById(uid);
  32.                 String meetingName = applyService.getMeetingName(Integer.parseInt(id));
  33.                 String DateTime = applyService.getDateTime(Integer.parseInt(id));
  34.                 message.setUid(uid);
  35.                 message.setTitle("系统消息");
  36.                 message.setContent("尊敬的用户"+username+",您好!您预约于"+DateTime+meetingName+"号会议室已经预约通过,请您注意时间,准时到达.");
  37.                 messageService.addMessage(message);
  38.             }
  39.         }
  40.         if (count > 0){
复制代码
  1.         AjaxBean ajaxBean = new AjaxBean();
  2.         ajaxBean.setDateTime(datetime);
  3.         ajaxBean.setMap(pageBeanMap);
  4.         /*System.out.println(ajaxBean);*/
  5.         Gson gson = new Gson();
  6.         String json = gson.toJson(ajaxBean);
  7.         out.print(json);
  8.     }
  9. }
  10. @WebServlet("/login")
  11. public class LoginServlet extends HttpServlet {
  12.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  13.         this.doGet(request, response);
  14.     }
  15.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  16.         request.setCharacterEncoding("utf8");
  17.         String username = request.getParameter("username");
  18.         String password = request.getParameter("password");
  19.         String remember = request.getParameter("remember");
  20.         String code = request.getParameter("code");
  21.         HttpSession session = request.getSession();
  22.         String sessionCode = (String)session.getAttribute("code");
  23.         if(!(sessionCode != null && sessionCode.equalsIgnoreCase(code))){
  24.             request.setAttribute("msg","验证码输入错误,请重新输入");
  25.             request.getRequestDispatcher("login.jsp").forward(request,response);
  26.             return;
  27.         }
  28.         UserService userService = new UserServiceImpl();
  29.         User user = userService.login(username,password);
复制代码
  1. @WebServlet("/back/changeStatus")
  2. public class ChangeStatusServlet extends HttpServlet {
  3.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  4.         this.doGet(request, response);
  5.     }
  6.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  7.         request.setCharacterEncoding("utf8");
  8.         response.setContentType("application/json;charset=utf-8");
  9.         PrintWriter out = response.getWriter();
  10.         String id = request.getParameter("id");
  11.         String status = request.getParameter("status");
  12.         String referer = request.getHeader("referer");
  13.         MessageService messageService = new MessageServiceImpl();
  14.         UserService userService = new UserServiceImpl();
  15.         ApplyService applyService = new ApplyServiceImpl();
  16.         Message message = new Message();
  17.         int count;
  18.         if (referer.contains("regformList")){
  19.             count = userService.changeStatus(Integer.parseInt(id),Integer.parseInt(status));
  20.             if(status.equals("1")){
  21.                 String username = userService.getNameById(Integer.parseInt(id));
  22.                 message.setUid(Integer.parseInt(id));
  23.                 message.setTitle("系统消息");
  24.                 message.setContent("尊敬的用户"+username+",您好!您的会议室登记信息已通过,现在可以进行会议室预约,祝您使用愉快");
  25.                 messageService.addMessage(message);
  26.             }
  27.         }else {
  28.             count = applyService.changeStatus(Integer.parseInt(id),Integer.parseInt(status));
  29.             if(status.equals("1")){
  30.                 int uid = applyService.getUid(Integer.parseInt(id));
  31.                 String username = userService.getNameById(uid);
  32.                 String meetingName = applyService.getMeetingName(Integer.parseInt(id));
  33.                 String DateTime = applyService.getDateTime(Integer.parseInt(id));
  34.                 message.setUid(uid);
复制代码
  1.                 request.getRequestDispatcher("apply.jsp").forward(request,response);
  2.             }else {
  3.                 response.sendRedirect("errorPage.jsp");
  4.             }
  5.         }else {
  6.             response.sendRedirect("login.jsp");
  7.         }
  8.     }
  9. }
  10. @WebFilter(urlPatterns = "/*",initParams = {@WebInitParam(name = "url",value = "back,login,captcha,reg.jsp,regUser,index,announceList,applyList,meetingList,apply.jsp,meetinglist,autoLogin,top.jsp,css,fonts,images,js")})
  11. public class LoginFilter implements Filter {
  12.     private List<String> urls;
  13.     public void destroy() {
  14.     }
  15.     public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
  16.         HttpServletRequest request = (HttpServletRequest)req;
  17.         HttpServletResponse response = (HttpServletResponse)resp;
  18.         request.setCharacterEncoding("utf8");
  19.         String requestURI = request.getRequestURI();
  20.         /* || requestURI.contains("back") || requestURI.contains("login") || requestURI.contains("reg.jsp") || requestURI.contains("regUser") ||
  21.                 requestURI.contains("index") || requestURI.contains("announceList") || requestURI.contains("applyList") || requestURI.contains("meetingList") ||
复制代码
  1. @WebServlet("/addApply")
  2. public class AddApplyServlet extends HttpServlet {
  3.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  4.         this.doGet(request, response);
  5.     }
  6.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  7.         request.setCharacterEncoding("utf-8");
  8.         Map<String, String[]> applyMap = request.getParameterMap();
  9.         Apply apply = new Apply();
  10.         try {
  11.             ConvertUtils.register(new MyDateConverter(), Date.class);
  12.             BeanUtils.populate(apply,applyMap);
  13.         } catch (IllegalAccessException e) {
  14.             e.printStackTrace();
  15.         } catch (InvocationTargetException e) {
  16.             e.printStackTrace();
  17.         }
  18.         User user = (User)request.getSession().getAttribute("user");
  19.         if (user != null){
  20.             apply.setUid(user.getId());
  21.             ApplyService applyService = new ApplyServiceImpl();
  22.             int count = applyService.addApply(apply);
复制代码
  1. @WebServlet("/back/modifyMeeting")
  2. public class ModifyMeetingServlet extends HttpServlet {
  3.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  4.         this.doGet(request, response);
  5.     }
  6.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  7.         request.setCharacterEncoding("utf8");
  8.         Map<String, String[]> meetingMap = request.getParameterMap();
  9.         Meeting meeting = new Meeting();
  10.         try {
  11.             BeanUtils.populate(meeting,meetingMap);
  12.         } catch (IllegalAccessException e) {
  13.             e.printStackTrace();
  14.         } catch (InvocationTargetException e) {
  15.             e.printStackTrace();
  16.         }
  17.         MeetingService meetingService = new MeetingServiceImpl();
  18.         int count = meetingService.updateMeeting(meeting);
  19.         if (count > 0){
  20.             response.sendRedirect("meetingList");
  21.         }else {
  22.             response.sendRedirect("../errorPage.jsp");
  23.         }
  24.     }
  25. }
复制代码
  1.         int endHour = Integer.parseInt(start.substring(11,13));
  2.         if (startDate >= endDate){
  3.             out.print("结束时间必须晚于开始时间");
  4.         }else if(endDate - startDate >= 1000*60*60*14) {
  5.             out.print("预约时常不可超出14小时");
  6.         }else if(startHour < 8 || endHour >= 22){
  7.             out.print("请在规定的时间段选择预约时间");
  8.         }else if (applyService.isExistTime(start,end,mid)){
  9.             out.print("此时间段已被预约,请换时间段");
  10.         }else {
  11.             out.print("ok");
  12.         }
  13.     }
  14. }
  15. public class UtilHelper {
  16.         /**
  17.          * 获取当前日期时间
  18.          */
  19.         public static String getTime() {
  20.                 Date date = new Date();
  21.                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  22.                 return sdf.format(date);
  23.         }
复制代码
  1.         String password = request.getParameter("password");
  2.         String remember = request.getParameter("remember");
  3.         String code = request.getParameter("code");
  4.         HttpSession session = request.getSession();
  5.         String sessionCode = (String)session.getAttribute("code");
  6.         if(!(sessionCode != null && sessionCode.equalsIgnoreCase(code))){
  7.             request.setAttribute("msg","验证码输入错误,请重新输入");
  8.             request.getRequestDispatcher("login.jsp").forward(request,response);
  9.             return;
  10.         }
  11.         UserService userService = new UserServiceImpl();
  12.         User user = userService.login(username,password);
  13.         if (user != null){
  14.             if(remember != null){
  15.                 //创建了一个2个cookie,分别为(userKey,phone)(ssid,md5Encrypt(phone))
  16.                 CookieUtils.createCookies(username,request,response,60*60*24*7);
  17.             }
  18.             session.setAttribute("user",user);
  19.             response.sendRedirect("index.jsp");
  20.         }else{
  21.             request.setAttribute("msg","账号或用户名错误,请重新输入");
  22.             request.getRequestDispatcher("login.jsp").forward(request,response);
  23.         }
  24.     }
  25. }
  26. @WebServlet("/regForm")
  27. public class RegFormServlet extends HttpServlet {
  28.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  29.         this.doGet(request, response);
  30.     }
  31.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  32.         request.setCharacterEncoding("utf-8");
  33.         Map<String, String[]> regformMap = request.getParameterMap();
  34.         Regform regform = new Regform();
  35.         try {
  36.             BeanUtils.populate(regform,regformMap);
复制代码
  1.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  2.         response.setContentType("application/json;charset=utf-8");
  3.         PrintWriter out = response.getWriter();
  4.         String start = request.getParameter("start").replace("T"," ");
  5.         String end = request.getParameter("end").replace("T"," ");
  6.         String mid = request.getParameter("mid");
  7.         ApplyService applyService = new ApplyServiceImpl();
  8.         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  9.         Date date1 = null;
  10.         Date date2 = null;
  11.         try {
  12.             date1 = sdf.parse(start);
  13.             date2 = sdf.parse(end);
  14.         } catch (ParseException e) {
  15.             e.printStackTrace();
  16.         }
  17.         /*System.out.println("------------------");
  18.         System.out.println(date1);
  19.         System.out.println(date2);*/
  20.         long startDate = date1.getTime();
  21.         long endDate = date2.getTime();
  22.         int startHour = Integer.parseInt(start.substring(11,13));
  23.         int endHour = Integer.parseInt(start.substring(11,13));
  24.         if (startDate >= endDate){
  25.             out.print("结束时间必须晚于开始时间");
  26.         }else if(endDate - startDate >= 1000*60*60*14) {
  27.             out.print("预约时常不可超出14小时");
  28.         }else if(startHour < 8 || endHour >= 22){
  29.             out.print("请在规定的时间段选择预约时间");
  30.         }else if (applyService.isExistTime(start,end,mid)){
  31.             out.print("此时间段已被预约,请换时间段");
  32.         }else {
  33.             out.print("ok");
  34.         }
  35.     }
  36. }
复制代码
  1. @WebServlet("/back/regformList")
  2. public class RegformListServlet extends HttpServlet {
  3.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  4.         this.doGet(request, response);
  5.     }
  6.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  7.         String currentPage = request.getParameter("currentPage");
  8.         RegformService regformService = new RegformServiceImpl();
  9.         int rows = 10;
  10.         int totalPage = regformService.getTotalPage(rows);
  11.         if(currentPage == null || Integer.parseInt(currentPage) < 1){
  12.             currentPage = "1";
  13.         }
  14.         if(totalPage != 0 && Integer.parseInt(currentPage) > totalPage){
  15.             currentPage = totalPage+"";
  16.         }
  17.         ListPage<RegformList> listPage = regformService.getApplyList(Integer.parseInt(currentPage),rows);
  18.         request.setAttribute("listPage",listPage);
  19.         request.getRequestDispatcher("regform.jsp").forward(request,response);
  20.     }
  21. }
  22. @WebServlet("/back/applyList")
  23. public class ApplyListServlet extends HttpServlet {
  24.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
复制代码
  1.          * @return
  2.          */
  3.         public static String md5Encrypt(String ss) {
  4.                 ss = ss == null ? "" : ss + KEY;
  5.                 char[] md5Digist = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
  6.                 byte[] ssarr = ss.getBytes();
  7.                 try {
  8.                         MessageDigest md = MessageDigest.getInstance("MD5");//md5  sha1  sha2  加密算法
  9.                         md.update(ssarr);//把明文放到MessageDigest的对象实例去,更新数据
  10.                         byte[] mssarr = md.digest();
  11.                        
  12.                         int len = mssarr.length;
  13.                         char[] str = new char[len*2];
  14.                         int k = 0;//计数
  15.                        
  16.                         for(int i=0;i<len;i++) {
  17.                                 byte b = mssarr[i];
  18.                                 str[k++] = md5Digist[b >>> 4 & 0xf];
  19.                                 str[k++] = md5Digist[b & 0xf];
  20.                         }
  21.                         return new String(str);
  22.                 } catch (Exception e) {
  23.                         e.printStackTrace();
  24.                 }
  25.                 return null;
  26.         }
  27. }
  28. @WebServlet("/back/modifyMeeting")
  29. public class ModifyMeetingServlet extends HttpServlet {
  30.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  31.         this.doGet(request, response);
复制代码
  1. @WebServlet("/regUser")
  2. public class RegUserServlet extends HttpServlet {
  3.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  4.         this.doGet(request, response);
  5.     }
  6.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  7.         request.setCharacterEncoding("utf8");
  8.         Map<String, String[]> userMap = request.getParameterMap();
  9.         User user = new User();
  10.         try {
  11.             BeanUtils.populate(user,userMap);
  12.         } catch (IllegalAccessException e) {
  13.             e.printStackTrace();
  14.         } catch (InvocationTargetException e) {
  15.             e.printStackTrace();
  16.         }
  17.         UserService userService = new UserServiceImpl();
  18.         int status = userService.reqUser(user);
  19.         if(status != -1){
  20.             response.sendRedirect("login.jsp");
  21.         }else{
  22.             request.setAttribute("msg","注册失败");
  23.             request.getRequestDispatcher("req.jsp").forward(request,response);
  24.         }
  25.     }
  26. }
  27. @WebServlet("/autoLogin")
  28. public class AutoLoginServlet extends HttpServlet {
  29.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
复制代码
  1.         }else {
  2.             HttpSession session = request.getSession();
  3.             Admin admin = (Admin) session.getAttribute("admin");
  4.             if (admin != null){
  5.                 chain.doFilter(request,response);
  6.             }else {
  7.                 response.sendRedirect("login.jsp");
  8.             }
  9.         }
  10.     }
  11.     public void init(FilterConfig config) throws ServletException {
  12.         String url = config.getInitParameter("url");
  13.         String[] split = url.split(",");
  14.         urls = Arrays.asList(split);
  15.     }
  16. }
  17. @WebServlet("/modifyPassword")
  18. public class ModifyPasswordServlet extends HttpServlet {
  19.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  20.         this.doGet(request, response);
  21.     }
  22.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  23.         request.setCharacterEncoding("utf8");
  24.         String id = request.getParameter("id");
  25.         String oldpass = request.getParameter("oldpass");
  26.         String newpass = request.getParameter("newpass");
复制代码
  1. @WebFilter(urlPatterns = "/*",initParams = {@WebInitParam(name = "url",value = "back,login,captcha,reg.jsp,regUser,index,announceList,applyList,meetingList,apply.jsp,meetinglist,autoLogin,top.jsp,css,fonts,images,js")})
  2. public class LoginFilter implements Filter {
  3.     private List<String> urls;
  4.     public void destroy() {
  5.     }
  6.     public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
  7.         HttpServletRequest request = (HttpServletRequest)req;
  8.         HttpServletResponse response = (HttpServletResponse)resp;
  9.         request.setCharacterEncoding("utf8");
  10.         String requestURI = request.getRequestURI();
  11.         /* || requestURI.contains("back") || requestURI.contains("login") || requestURI.contains("reg.jsp") || requestURI.contains("regUser") ||
  12.                 requestURI.contains("index") || requestURI.contains("announceList") || requestURI.contains("applyList") || requestURI.contains("meetingList") ||
  13.                 requestURI.contains("apply.jsp") || requestURI.contains("meetinglist") || requestURI.contains("autoLogin") || requestURI.contains("top.jsp")){*/
  14.             if(requestURI.equals("/meeting/") || UtilHelper.contains(requestURI,urls)){
  15.                 chain.doFilter(request, response);
  16.             }else {
  17.                 HttpSession session = request.getSession();
  18.                 User user = (User)session.getAttribute("user");
  19.                 if (user != null){
  20.                     chain.doFilter(request, response);
  21.                 }else {
  22.                     response.sendRedirect(request.getContextPath()+"/login.jsp");
  23.                 }
  24.             }
  25.     }
  26.     public void init(FilterConfig config) throws ServletException {
  27.         String url = config.getInitParameter("url");
复制代码
  1.         int startHour = Integer.parseInt(start.substring(11,13));        int endHour = Integer.parseInt(start.substring(11,13));
  2.         if (startDate >= endDate){
  3.             out.print("结束时间必须晚于开始时间");
  4.         }else if(endDate - startDate >= 1000*60*60*14) {
  5.             out.print("预约时常不可超出14小时");
  6.         }else if(startHour < 8 || endHour >= 22){
  7.             out.print("请在规定的时间段选择预约时间");
  8.         }else if (applyService.isExistTime(start,end,mid)){
  9.             out.print("此时间段已被预约,请换时间段");
  10.         }else {
  11.             out.print("ok");
  12.         }
  13.     }
  14. }
  15. public class UtilHelper {
  16.         /**
  17.          * 获取当前日期时间
  18.          */
  19.         public static String getTime() {
  20.                 Date date = new Date();
  21.                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  22.                 return sdf.format(date);
  23.         }
  24.         /**         * 把date对象转换成String
复制代码
  1.         long endDate = date2.getTime();
  2.         int startHour = Integer.parseInt(start.substring(11,13));
  3.         int endHour = Integer.parseInt(start.substring(11,13));
  4.         if (startDate >= endDate){
  5.             out.print("结束时间必须晚于开始时间");
  6.         }else if(endDate - startDate >= 1000*60*60*14) {
  7.             out.print("预约时常不可超出14小时");
  8.         }else if(startHour < 8 || endHour >= 22){
  9.             out.print("请在规定的时间段选择预约时间");
  10.         }else if (applyService.isExistTime(start,end,mid)){
  11.             out.print("此时间段已被预约,请换时间段");
  12.         }else {
  13.             out.print("ok");
  14.         }
  15.     }
  16. }
  17. public class UtilHelper {
  18.         /**
  19.          * 获取当前日期时间
  20.          */
  21.         public static String getTime() {
复制代码









免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4