校园兼职平台部分内容

本文介绍了使用Java技术开发的一款校园兼职平台,详细讨论了其功能实现和设计思路,包括用户注册登录、职位发布、简历投递等核心模块。通过Java的面向对象特性,实现了高效的数据管理和交互操作,为在校学生提供了方便的兼职信息获取渠道。
摘要由CSDN通过智能技术生成
package service;

import domain.CurrentUser;
import domain.Job;
import domain.UidJid;
import view.IndexView;

import java.io.*;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class JobService {
   
    static {
   
        File file=new File("src/information/yourWorkInformation.txt");
        if (!file.exists()){
   
            try {
   
                file.createNewFile();
                HashSet<UidJid>list=new HashSet<>();
                ObjectOutputStream ois=new ObjectOutputStream(new FileOutputStream("src/information/yourWorkInformation.txt"));
                ois.writeObject(list);
                ois.flush();
                ois.close();
            } catch (IOException e) {
   
                e.printStackTrace();
            }
        }
    }

    final static String JOB_INFORMATION="src/information/jobInformation.txt";
    Date workStart=new Date();
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");

    public static void getJobInformation(Integer jid, String companyName, String jobName, String jobTypeName, Integer jobLevel, String jobContent, Integer jobDemand, Integer jobTime,
                                         Integer salary,Integer status) throws IOException, ClassNotFoundException {
   

    File file=new File(JOB_INFORMATION);
    if(!file.exists()){
   
        file.createNewFile();
        ArrayList<Job>list=new ArrayList<>();
        ObjectOutputStream ois=new ObjectOutputStream(new FileOutputStream(JOB_INFORMATION));
        ois.writeObject(list);
        ois.flush();
        ois.close();
    }
        ObjectInputStream ins=new ObjectInputStream(new FileInputStream(JOB_INFORMATION));
        ArrayList<Job>js=(ArrayList<Job>)ins.readObject();


        js.add(new Job(jid,companyName,jobName,jobTypeName,jobLevel,jobContent,jobDemand,
                jobTime, salary,status));

        FileOutputStream fos = new FileOutputStream(JOB_INFORMATION);
        ObjectOutputStream os = new ObjectOutputStream(fos);
        os.writeObject(js);
        os.flush();

        System.out.println("兼职信息录入完成.");
        fos.close();
        os.close();

    }

    public static void checkWorkAll() throws IOException, ClassNotFoundException {
   
        ObjectInputStream jis = new ObjectInputStream(new FileInputStream(JOB_INFORMATION));

        ArrayList<Job> list  = (ArrayList<Job>)jis.readObject();

        for (int i = 0; i < list.size(); i++ ){
   
            Job j = list.get(i);
            System.out.println(j);
        }

       jis.close();

    }

    public static void checkWork() throws IOException, ClassNotFoundException {
   
        ObjectInputStream jis = new ObjectInputStream(new FileInputStream("src/information/yourWorkInformation.txt"));
        HashSet<UidJid> list  = (HashSet<UidJid>)jis.readObject();
        jis.close();
        for (UidJid uidJid : list) {
   
            if (uidJid.getUid().equals(CurrentUser.currentUser.getUid())){
   
                ObjectInputStream ins=new ObjectInputStream(new FileInputStream(new File(JOB_INFORMATION)));
                ArrayList<Job>jjs=(ArrayList<Job>)ins.readObject();
                ins.close();
             for (Job jj : jjs) {
   
                    if (jj.getJid().equals(uidJid.getJid
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值