
正文
java请假代码 java示例代码
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
java基于cs结构的,含有客户端,服务端的请假管理系统的源代码
import redis.clients.jedis.Jedis;
//java代码模拟处理redis分布式锁代码
public class redisTest {
private static long timeout = 1000;
相关问答
Q1: JAVA手写请假工作流
简单的话就不使用流程引擎
创建几个表格进行数据存储
创建一个页面用于个人请假,页面字段如(请假原因,请假天数,事由,备注,开始时间,结束时间,审批人员,隐藏个人id);
将数据存储到请假表中,添加字段,请假状态。记录,默认添加时为0 待审批
在处理人添加处理页面,填写意见,或审批通过不通过。
根据数据id 更新请假状态,记录-1 不通过,1通过。并将审批人记录到处理表中。
如需要转派,可添加修改操作,更新请假记录表。
用户就可以进行审批了。
统计个人审批的根据审批字段查询就好了。
如果需要组织结构,可以创建 dept表,user表,dept_user表,leaveInfo表
Q2: java IO练习题
希望对你有用~~嘿嘿~~(我写的是控制台的程序,没用SWING做界面)
import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
public class AbsenteeNote {
public static void main(String[] args) throws IOException {
int select = 0;
select = welcome();
if (select == 1 || select == 2) {
writeLetter(select);
} else {
viewLetter();
}
}
private static int welcome() {
int num = 0;//用于第一层菜单的选择
int num1 = 0;//用于第二层菜单的选择
do {
System.out.println("1:编写请假条");
System.out.println("2:查看请假条");
System.out.print("请选择功能号:");
Scanner in = new Scanner(System.in);
num = in.nextInt();
} while (num != 1 num != 2);//若输出的数字不为1或2,则继续选择
if (num == 1) {
do {
System.out.println("1:病假");
System.out.println("2:事假");
System.out.print("请选择功能号:");
Scanner in = new Scanner(System.in);
num1 = in.nextInt();
} while (num1 != 1 num1 != 2);
return num1;
} else {//当输入的是2(查看请假条),则任意返回一个值。
return 0;
}
}
private static void viewLetter() {//查看请假条
File letter = new File("c:\\Letter\\Letter.txt");
try {
FileInputStream view = new FileInputStream(letter);
byte b[] = new byte[view.available()];
while (view.read(b) != -1) {
FilterOutputStream viewContain=new FilterOutputStream(System.out);
System.out.println("假条内容如下:");
viewContain.write(b);
viewContain.close();
}
view.close();
} catch (FileNotFoundException e) {
System.out.println("文件不存在!!!");
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
private static void writeLetter(int num1) {//写请假条
String str = new String();
if (num1 == 1)
str = "我因发烧,请假一天 ";
else
str = "参加婚礼,于4.10请假一天";
File letter = new File("c:\\Letter\\Letter.txt");
StringBuilder contain = new StringBuilder();
Scanner in = new Scanner(System.in);
System.out.print("寄信人地址:");
contain.append("寄信人地址:" + in.nextLine() + "\r\n");
System.out.print("收件人地址:");
contain.append("收件人地址:" + in.nextLine() + "\r\n");
System.out.print("签名:");
contain.append("签名:" + in.nextLine() + "\r\n");
System.out.print("日期:");
contain.append("日期:" + in.nextLine() + "\r\n");
contain.append(str);
byte[] input = contain.toString().getBytes();
try {
FileOutputStream out = new FileOutputStream(letter);
out.write(input, 0, input.length);
System.out.println("请假条生成成功!!!");
out.close();
} catch (FileNotFoundException e) {
System.out.println("文件不存在!!!");
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
Q3: 用Java中做一个签到程序
import java.util.Scanner;
public class TestRandom {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = 0;
int b = 0;
System.out.println("即将上班,请签到...");
System.out.println("请假或签到...");
while (true) {
String line = s.next();
if("签到".equals(line.trim())){
a++;
System.out.println("有" + a +"员工签到");
}else if("请假".equals(line.trim())){
b++;
System.out.println("有" + b +"员工请假");
}else{
System.out.println("输入有误,请重新输入");
}
}
}
}
java请假代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于java示例代码、java请假代码的信息别忘了在本站进行查找喔。







