java实现请假功能代码 java请求超时时间怎么实现( 二 )


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();
}
}
}
各位大神java后台请假审核功能怎么写权限系统
状态筛选
逻辑是请教条写完之后提交审核,boss后台可以看到其权限下的待审核的请假条
用java编写员工类Employeepublic class Employee {
private int id;
private byte sex;
private String name;
private String duty;
private float salary;
private int holidays;
public Employee(int id,byte sex,String name,String duty, float salary,int holidays){
this.id = id;
this.sex = sex;
this.name = name;
this.duty = duty;
this.salary = salary;
this.holidays = holidays;
}
public String getDuty() {
return duty;
}
public void setDuty(String duty) {
this.duty = duty;
}
public int getHolidays() {
return holidays;
}
public void setHolidays(int holidays) {
this.holidays = holidays;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public float getSalary() {
return salary;
}
public void setSalary(float salary) {
this.salary = salary;
}
public byte getSex() {
return sex;
}
public void setSex(byte sex) {
this.sex = sex;
}
/**
* display(),无返回值 , 该方法能打印员工的姓名、性别以及职务
* @param employee
*/
public void display(Employee employee){
System.out.println("员工姓名为: " + employee.getName());
if(employee.getSex()==1){
System.out.println("员工性别为: 男 ");
}else if(employee.getSex()==2){
System.out.println("员工性别为:女 ");
}
System.out.println("员工职务为: " + employee.getDuty());
}
/**
* getDecMoney(int day) 返回值是int型 。
* 如果请假天数=3,则扣款为30×请假天数;
* 如果请假天数超过3天,则扣款为50×请假天数 。
* @param day
* @return
*/
public intgetDecMoney(int day){
int deduction = 0; //扣除的工资
if(day = 3){
deduction = 30*day;
}else if(day3){
deduction = 50*day;
}
return deduction;
}
public static void main(String[] args){
//创建一个员工类的对象
Employee employee = new Employee(123456789,(byte) 1,"陈冠希","生产帽子的(绿色)",(float) 500.8,5);
employee.display(employee);//调用display()
int deduction = employee.getDecMoney(employee.getHolidays());//调用getDecMoney()
System.out.println("该员工因请假扣除工资" + deduction + "元");
}
}
java导出时候改里面的内容,请假类型数据库存着的是1、2倒出来时候我想把他们换成病假,事假 要怎么改啊if (null != entParms[j]) {
if (entParms[j] instanceof Date) {
Date date = (Date) entParms[j];
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
entParms[j] = sdf.format(date);
}
//加代码
if(j==5){
if("1".equals(entParms[j].toString()))
entParms[j]="病假";
else
entParms[j]="事假";