银行业务调度系统

时间:2022-03-25 03:00:11
【文件属性】:

文件名称:银行业务调度系统

文件大小:11KB

文件格式:JAR

更新时间:2022-03-25 03:00:11

面向对象

用Java编写银行业务调度系统,附主类: package com.isoftstons.interview.bank; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; public class Mainlass { public Mainlass() { } public static void main(String[] args) { ServiceWindow vipWindow; for(int i = 1; i < 5; ++i) { vipWindow = new ServiceWindow(); vipWindow.setWindowId(i); vipWindow.start(); } ServiceWindow expressWindow = new ServiceWindow(); expressWindow.setType(CustomerType.EXPRESS); expressWindow.start(); vipWindow = new ServiceWindow(); vipWindow.setType(CustomerType.VIP); vipWindow.start(); Executors.newScheduledThreadPool(1).scheduleAtFixedRate(new Runnable() { public void run() { Integer number = NumberMachine.getInstance().getCommonManager().generateNewManager(); System.out.println(number + "号普通客户等待服务"); } }, 0L, (long)Constants.COMMON_CUSTOMER_INTERVAL_TIME, TimeUnit.SECONDS); Executors.newScheduledThreadPool(1).scheduleAtFixedRate(new Runnable() { public void run() { Integer number = NumberMachine.getInstance().getExpressManager().generateNewManager(); System.out.println(number + "号快速客户等待服务"); } }, 0L, (long)(Constants.COMMON_CUSTOMER_INTERVAL_TIME * 6), TimeUnit.SECONDS); Executors.newScheduledThreadPool(1).scheduleAtFixedRate(new Runnable() { public void run() { Integer number = NumberMachine.getInstance().getVipManager().generateNewManager(); System.out.println(number + "号VIP客户等待服务"); } }, 0L, (long)(Constants.COMMON_CUSTOMER_INTERVAL_TIME * 2), TimeUnit.SECONDS); } }


网友评论