资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

java网站自动预约代码,java预约系统

用java写个简单的电影院座位预约,10个座位2行。前面的座位10000文,后面的20000文,

import java.util.Scanner;

我们提供的服务有:成都做网站、网站设计、微信公众号开发、网站优化、网站认证、会泽ssl等。为上千企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的会泽网站制作公司

/**

* @author 12052010

* @Date December 05,2014

*

*/

public class Film {

public static void main(String[] args){

Scanner input = new Scanner(System.in);

int [][] num = new int[2][10];

int fg1,fg2;//标志顾客选择 的座位fg1:排数 fg2:列数

for(int i=0;inum.length;i++){

for(int j=0;jnum[i].length;j++)

num[i][j]=0;//赋初值,所有座位没有被预定

}

randomBook(num);

System.out.print("\n-----------电影院座位订票情况(0:还没被预定 1: 已经被预定)------------");

for(int i=0;inum.length;i++){

System.out.println("");

for(int j=0;jnum[i].length;j++)

System.out.print("  "+num[i][j]);

}

/**

 * 顾客输进的排数必须符合0 or 1

 */

do{

System.out.print("\nInput fg1: ");

fg1=input.nextInt();

} while(fg10||fg12);

/**

 * 顾客输进的列数必须符合 0-9

 */

do{

System.out.print("Input fg2: ");

fg2=input.nextInt();

} while(fg20||fg29);

if(num[fg1][fg2]==1){

System.out.print("\n已经被人订了,不好意思");

}else{

System.out.print("\n你要订的座位是: "+ fg1+"排  "+ fg2+"列, 票价:");

if(fg1==1)

System.out.print("10000文");

else

System.out.print("20000文");

}

}

/**

 * 随即设置电影院的座位被预定

 */

public static void  randomBook(int[][] num){

for(int i=0;inum.length;i++){

for(int j=0;jnum[i].length;j++){

//随机设置

num[i][j]=(int)(Math.random()*2);

}

}

}

}

java web项目现在有一个这样的需求:用户可以在前端进行预约,时间随便设置。

前端可以用datepickeer插件直接限制让用户选取大于当前的时间,存到数据库,

dateFmt:'yyyy-M-d H:mm:ss' ,minDate: '%y-%M-%d %H:%m:%s'

时间格式 ,最小日期是当前日期

然后在你服务器通知的方法里加条件,当前时间大于预约时间,触发方法。

java Web 启动时自动执行代码的几种方式

Web容器启动后执行代码的几种方式

其执行顺序为:

4===5===1===2===3

即指定init-method的Bean开始执行

接着实现spring的Bean后置处理器开始执行

然后是Servlet的监听器执行

再接下来是Servlet的过滤器执行

最后才是Servlet执行

1、实现Servlet监听器接口ServletContextListener

[java] view plain copy

public class InitListener implements ServletContextListener {

@Override

public void contextDestroyed(ServletContextEvent context) {

}

@Override

public void contextInitialized(ServletContextEvent context) {

// 上下文初始化执行

System.out.println("================[ServletContextListener]自动加载启动开始.");

SpringUtil.getInstance().setContext(

span style="white-space:pre" /spanWebApplicationContextUtils.getWebApplicationContext(arg0.getServletContext())

span style="white-space:pre" /span);

}

}

然后在web.xml文件配置该监听器

[html] view plain copy

listener

listener-classcom.test.init.InitListener/listener-class

/listener

2、实现Servlet的过滤器Filter

[html] view plain copy

public class InitFilter implements Filter {

@Override

public void destroy() {

}

@Override

public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException,

ServletException {

}

@Override

public void init(FilterConfig config) throws ServletException {

System.out.println("================[Filter]自动加载启动开始.");

// 读取Spring容器中的Bean[此时Bean已加载,可以使用]

//写启动需要执行的代码

System.out.println("================[Filter]自动加载启动结束.");

}

}

然后在web.xml文件配置过滤器即可

[html] view plain copy

filter

filter-nameInitFilter/filter-name

filter-classcom.test.init.InitFilter/filter-class

/filter

filter-mapping

filter-nameInitFilter/filter-name

url-pattern//url-pattern

/filter-mapping

3、编写一个Servlet,在web.xml里面配置容器启动后执行即可

[html] view plain copy

public class InitServlet extends HttpServlet {

/**

*/

private static final long serialVersionUID = 1L;

@Override

public void init(ServletConfig config) {

try {

super.init();

} catch (ServletException e) {

e.printStackTrace();

}

System.out.println("================[Servlet]自动加载启动开始.");

// 读取Spring容器中的Bean[此时Bean已加载,可以使用]

//执行想要的代码

System.out.println("================[Servlet]自动加载启动结束.");

}

}

然后在web.xml文件配置该Servlet的启动方式为:容器启动后执行

servlet

servlet-nameInitServlet/servlet-name

servlet-classcom.test.init.InitServlet/servlet-class

init-param

param-nameusername/param-name

param-valuetest/param-value

/init-param

!-- 此处指定加载顺序为2,表明还有优先级更高的Servlet要先执行 --

load-on-startup2/load-on-startup

/servlet

servlet-mapping

servlet-nameInitServlet/servlet-name

url-pattern//url-pattern

/servlet-mapping

关于启动后执行,由load-on-startup指定:

(1)当值为0或者大于0时,表示容器在应用启动时就加载这个servlet。值越小,启动优先级越高;

(2)当是一个负数时或者没有指定时,表示该servlet被调用时才加载。

4、如果你使用Spring IOC作为Bean管理容器,那么可以指定init-method其中init-method表示bean加载成功后,立即执行某个方法。配置如下:start为要执行的方法名称

[html] view plain copy

!-- service --

bean id="shopService" class="com.test.teach.service.ShopService" span style="color:#33ffff;"init-method="start"/span

property name="shopDao" ref="shopDao" /

/bean

求一个基于Java编写的医院预约系统源码

摘    要

进入21世纪以来,网络的空前发展给人们的工作和生活带来了极大的便利,信息化建设已经成为节约运营成本、提高工作效率的首选。相比之下,国内相当数量的中小医院的医院预约挂号工作还采用相对保守的手工工作方式,数据信息查询和存储的成本较高,但效率却很低下。为了使医院预约挂号管理更高效、更科学,决定开发医院预约挂号平台。

本文采用结构化分析的方法,详细阐述了一个功能比较强大的医院预约挂号平台的前后台开发、操作流程和涉及的一些关键技术。首先进行了可行性分析,然后是系统分析,通过实际的业务流程调研,分析业务流程和系统的组织结构,完成了数据流分析和数据字典;然后是系统设计阶段主要完成了功能模块的划分、阐述了系统设计的思想、数据库的设计和系统设计的工具及技术。该阶段对本系统各个模块的功能进行了详细设计,形成了本系统的功能模块图;数据库设计时先进行了概念结构设计,然后进行了逻辑结构设计,最后完成了数据表的设计。

根据前几个阶段的分析和设计,本系统在设计方面采用B/S模式,同时使用JSP技术进行基本页面的设计与功能实现,后台数据库选用SQL Server 2000数据库。本系统的设计实施为医院预约挂号系统的运行做基础,为医院预约挂号管理工作提供良好的条件。

关键词:预约挂号;结构化分析;平台

Abstract

In the 21st century, the unprecedented development of the network to the people's work and life has brought great convenience, information technology has become operational cost savings, improve efficiency of choice. In contrast, a considerable number of domestic small and medium hospitals, hospital appointment registration work is relatively conservative with manual work, data query and the high cost of storage, but the efficiency is very low. To make an appointment by registered hospital management more efficient, more science, decided to develop the hospital appointment registration platform.

In this paper, structural analysis, a function described in detail more powerful platform for the hospital before and after the appointment register sets and development, operational processes, and some of the key technologies involved. First, a feasibility analysis, and system analysis, business process through the actual research, analyze business processes and organizational structure of the system to complete the data flow analysis and data dictionary; then completed the system design phase is mainly divided into functional modules, elaborated the idea of the system design, database design and system design tools and techniques. This phase of the system function of each module in detail the design, forming a functional block diagram of the system; database design first tested the concept design, followed by a logic design, and finally completed the data table design.

According to the first few stages of the analysis and design, the system used in the design of B / S mode, JSP technology, the basic page design and implementation of function, use SQL Server 2000 database backend database. Implementation of the system design registration system for the operation of the hospital appointment as a foundation for the hospital management to provide a good appointment registration conditions.

Key Words:Appointment registration; structural analysis; platform

目    录

摘    要... I

Abstract II

一、引言... 1

(一)项目开发的背景... 1

(二)项目开发的目的... 1

二、可行性分析及总体设计原则... 2

(一)可行性分析... 2

1.技术可行性... 2

2.经济可行性... 2

3.社会可行性... 3

(二)总体设计原则... 3

三、系统分析... 5

(一)业务流程分析... 5

(二)数据流图... 6

(三)数据字典... 9

四、系统设计... 13

(一)系统功能设计... 13

(二)系统数据库设计... 14

1.概念结构设计... 14

2.逻辑结构设计... 18

3.数据库表设计... 18

(三)系统开发工具与开发模式的选择... 20

1.系统开发工具... 20

2.系统设计模式... 21

五、系统实现... 22

(一)用户模块... 22

1.登录及注册管理模块... 22

2.首界面... 23

3.用户注册界面... 24

4.公告界面... 25

5.科室预约界面... 26

6.留言界面... 27

(三)管理员模块... 28

1.登录界面... 28

2.科室管理界面... 28

3.添加专家界面... 29

六、性能测试与分析... 30

(一)测试的重要性... 30

(二)测试实例的研究与选择... 30

(三)测试环境与测试条件... 31

(四)实例测试... 32

(五)系统评价... 32

(六)测试结果... 33

参 考 文 献... 35

致    谢... 36


网站栏目:java网站自动预约代码,java预约系统
当前地址:http://cdkjz.cn/article/hosphc.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220